body.dark-theme {
  --bg-color: #050509;
  --bg-secondary: #101019;
  --text-color: #f8f8ff;
  --accent: #ff6bcb;
  --accent-soft: rgba(255, 107, 203, 0.2);
  --board-bg: #17171f;
  --btn-bg: #ff6bcb;
  --btn-bg-hover: #ff82d3;
  --btn-text: #050509;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --shadow-soft: 0 20px 40px rgba(0, 0, 0, 0.5);
}

body.light-theme {
  --bg-color: #f5f5ff;
  --bg-secondary: #ffffff;
  --text-color: #1a1a2b;
  --accent: #6b5bff;
  --accent-soft: rgba(107, 91, 255, 0.14);
  --board-bg: #ffffff;
  --btn-bg: #6b5bff;
  --btn-bg-hover: #8678ff;
  --btn-text: #ffffff;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --shadow-soft: 0 20px 40px rgba(15, 23, 42, 0.18);
}

html,
body {
  height: 100%;
}

body {
  min-height: 100vh;
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
  background: radial-gradient(
      circle at top,
      var(--accent-soft),
      transparent 60%
    ),
    linear-gradient(145deg, var(--bg-color), var(--bg-secondary));
  color: var(--text-color);
  display: flex;
  align-items: stretch;
  justify-content: center;
}

/* Game container */
.game-container {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* Screens */
.screen {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  row-gap: 24px;
  text-align: center;
  transition: margin-top 0.6s ease-out, opacity 0.6s ease-out;
}

.screen.up {
  margin-top: -100vh;
  opacity: 0;
}

h1 {
  font-size: clamp(2rem, 3vw, 3rem);
  letter-spacing: 0.03em;
}

h2 {
  font-size: 1.4rem;
  margin-top: 8px;
}

.subtitle {
  max-width: 480px;
  font-weight: 300;
  font-size: 0.95rem;
  opacity: 0.9;
}

.hint {
  margin-top: 8px;
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Options list (time & difficulty) */
.options-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

/* Board */
.board {
  width: min(500px, 90vw);
  height: min(500px, 90vw);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 28px;
  position: relative;
  background: radial-gradient(
      circle at top left,
      var(--accent-soft),
      transparent 60%
    ),
    var(--board-bg);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-subtle);
}

/* Circles */
.circle {
  position: absolute;
  border-radius: 50%;
  background-color: #e2f3ff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.4);
  animation: pop-in 0.15s ease-out;
  cursor: pointer;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

.circle:hover {
  transform: scale(1.08);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.5);
}

/* Disable text selection and copying for the board and circles */
.board,
.circle {
  -webkit-user-select: none; /* Safari / iOS */
  -ms-user-select: none;     /* old IE (not really needed, but harmless) */
  user-select: none;         /* modern browsers */
  -webkit-touch-callout: none; /* disable "copy/share" popup on iOS */
}

/* Remove grey tap highlight in mobile browsers */
.board,
.circle,
.btn {
  -webkit-tap-highlight-color: transparent;
}

/* Timer */
.timer-title {
  margin-bottom: 16px;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.9rem;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

#time {
  font-weight: 700;
  font-size: 1.4rem;
}

/* Buttons */
.btn {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.18s ease-out, transform 0.12s ease-out,
    box-shadow 0.18s ease-out, border-color 0.18s ease-out;
  background-color: var(--bg-secondary);
  color: var(--text-color);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.35);
}

.btn.primary {
  background-color: var(--btn-bg);
  color: var(--btn-text);
}

.btn.primary:hover {
  background-color: var(--btn-bg-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.35);
}

.btn.outlined {
  background-color: transparent;
  border-color: var(--border-subtle);
  box-shadow: none;
}

.btn.outlined:hover {
  border-color: var(--accent);
  background-color: var(--accent-soft);
}

.btn.active {
  border-color: var(--accent);
  background-color: var(--accent-soft);
}

/* Theme toggle button */
.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  padding: 8px 14px;
  font-size: 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background-color: rgba(15, 23, 42, 0.7);
  color: var(--text-color);
  cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  z-index: 10;
  transition: background-color 0.2s ease-out, transform 0.1s ease-out,
    box-shadow 0.2s ease-out;
}

body.light-theme .theme-toggle {
  background-color: rgba(255, 255, 255, 0.8);
}

.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}

/* Result block */
.result {
  text-align: center;
  padding: 20px;
}

.result h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.result p {
  font-size: 0.95rem;
  opacity: 0.85;
  margin-bottom: 16px;
}

/* Utility */
.hide {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

/* Animations */
@keyframes pop-in {
  from {
    transform: scale(0.4);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Accessibility */
.btn:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================
   MOBILE STYLES
   ============================ */
@media (max-width: 768px) {
  .screen {
    row-gap: 16px;
  }

  h1 {
    font-size: 1.8rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .options-list {
    gap: 8px;
    flex-wrap: wrap;
  }

  .btn {
    padding: 8px 14px;
    font-size: 0.85rem;
  }

  /* Smaller board for mobile */
  .board {
    width: 90vw;
    height: 90vw;
    border-radius: 20px;
  }

  /* Timer fix */
  .timer-title {
    font-size: 0.85rem;
    margin-bottom: 10px;
  }

  #time {
    font-size: 1.2rem;
  }

  /* Circles slightly smaller on mobile */
  .circle {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  }

  /* Theme toggle — smaller */
  .theme-toggle {
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    font-size: 0.75rem;
  }
}

/* ============================
   VERY SMALL DEVICES
   ============================ */
@media (max-width: 480px) {
  h1 {
    font-size: 1.6rem;
  }

  .btn {
    padding: 7px 12px;
    font-size: 0.8rem;
  }

  .board {
    border-radius: 16px;
  }

  .timer-title {
    font-size: 0.75rem;
  }

  #time {
    font-size: 1.1rem;
  }
}
