/*Note: AI (Codex) was used to update and extend Simon game code. Please see html file for details.*/
/* // AI-Generated */
/* Beginner note: CSS variables (custom properties) for colors used across the page. */
:root {
  --navy: #011f3f;
  --gold: #fef2bf;
  --sky: #76c7ff;
  --mint: #b7f5d0;
  --ink: #0b1220;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.14);
  --accent: #ffb347;
  --glow: rgba(118, 199, 255, 0.45);
}

/* Beginner note: Base page styling (background, font, and layout). */
body {
  text-align: center;
  background: radial-gradient(circle at top, #163a63 0%, #011f3f 60%, #02162b 100%);
  color: var(--gold);
  font-family: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
  position: relative;
}

/* // AI-Generated */
/* Beginner note: Decorative overlay glow on the whole page. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.06) 0%, rgba(0, 0, 0, 0.45) 70%, rgba(0, 0, 0, 0.75) 100%);
  pointer-events: none;
  z-index: 0;
}

/* Beginner note: Styling for the main game title. */
#game-title {
  font-family: 'Press Start 2P', cursive;
  font-size: 2.4rem;
  margin: 32px 0 18px;
  letter-spacing: 2px;
}

/* Beginner note: Styling for the level/status heading. */
#level-title {
  font-family: 'Press Start 2P', cursive;
  font-size: 1.6rem;
  margin: 18px 0 24px;
  color: var(--gold);
}

/* // AI-Generated */
/* Beginner note: The main card that wraps the game UI. */
.ui-shell {
  max-width: 980px;
  margin: 28px auto 40px;
  padding: 24px 28px 34px;
  border-radius: 24px;
  background: rgba(2, 18, 36, 0.9);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
  position: relative;
  z-index: 1;
}

/* // AI-Generated */
/* Beginner note: Header spacing around the title/instructions. */
.page-header {
  padding: 8px 8px 0;
}

/* // AI-Generated */
/* Beginner note: Small instruction banner box. */
.instruction-banner {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  margin: 0 auto 16px;
  max-width: 860px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

/* // AI-Generated */
/* Beginner note: Instruction text formatting. */
.instruction-banner p {
  margin: 0;
  line-height: 1.65;
  font-size: 1rem;
}

/* // AI-Generated */
/* Beginner note: "Link-style" button for toggling instructions. */
.link-button {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(118, 199, 255, 0.1);
  color: var(--sky);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 6px 14px;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

/* // AI-Generated */
/* Beginner note: Hover/focus effect for the link button. */
.link-button:hover,
.link-button:focus-visible {
  color: var(--accent);
  box-shadow: 0 0 16px rgba(255, 179, 71, 0.6);
  transform: translateY(-1px);
}

/* // AI-Generated */
/* Beginner note: The expanded instructions panel. */
.more-info {
  max-width: 860px;
  margin: 0 auto 18px;
  background: var(--panel-strong);
  border-radius: 14px;
  padding: 16px 20px;
  text-align: left;
  color: #eef6ff;
}

/* Beginner note: Heading inside the instructions panel. */
.more-info h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

/* Beginner note: List styling for the rules. */
.more-info ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.7;
}

/* // AI-Generated */
/* Beginner note: Utility class to hide elements. */
.hidden {
  display: none;
}

/* // AI-Generated */
/* Beginner note: Container for the main game area. */
.game-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 8px 8px 20px;
  position: relative;
}

/* // AI-Generated */
/* Beginner note: Layer for visual checkpoint effects. */
.checkpoint-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

/* // AI-Generated */
/* Beginner note: Small dots used in the checkpoint animation. */
.burst-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: 0;
  animation: burst 700ms ease-out forwards;
}

/* // AI-Generated */
/* Beginner note: Bigger dots for the ultimate checkpoint. */
.burst-dot.ultimate {
  width: 14px;
  height: 14px;
  animation: burst-ultimate 1200ms ease-out forwards;
}

/* // AI-Generated */
/* Beginner note: Animation for regular checkpoint dots. */
@keyframes burst {
  0% {
    transform: translate(0, 0) scale(0.6);
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--x), var(--y)) scale(1);
    opacity: 0;
  }
}

/* // AI-Generated */
/* Beginner note: Animation for the ultimate checkpoint dots. */
@keyframes burst-ultimate {
  0% {
    transform: translate(0, 0) scale(0.4);
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--x), var(--y)) scale(1.2);
    opacity: 0;
  }
}

/* // AI-Generated */
/* Beginner note: Status bar layout (message + counters). */
.status-bar.hud {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  padding: 8px 6px;
}

/* // AI-Generated */
/* Beginner note: Pill-shaped status message. */
.status-pill {
  background: rgba(0, 0, 0, 0.35);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.05);
  text-align: left;
}

/* // AI-Generated */
/* Beginner note: Horizontal row of counters. */
.counters {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}

/* // AI-Generated */
/* Beginner note: Shared styling for counter bubbles. */
.counter {
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* // AI-Generated */
/* Beginner note: Special styling for master mode label. */
.master-indicator {
  background: rgba(0, 0, 0, 0.6);
  color: #f7d37a;
  border: 1px solid rgba(255, 255, 255, 0.25);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

/* // AI-Generated */
/* Beginner note: Container for modes + action buttons. */
.controls {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 18px 0 10px;
}

/* // AI-Generated */
/* Beginner note: Segmented pill background behind mode buttons. */
.segmented {
  display: flex;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.35);
}

/* // AI-Generated */
/* Beginner note: Shared layout for the two button groups. */
.modes,
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* // AI-Generated */
/* Beginner note: Base button styles for modes and actions. */
.mode-btn,
.action-btn {
  font-family: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.95rem;
  padding: 10px 18px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border 0.15s ease, box-shadow 0.15s ease;
}

/* // AI-Generated */
/* Beginner note: Default look for mode buttons. */
.mode-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #e7f0ff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

/* Beginner note: Hover/focus effects for mode buttons. */
.mode-btn:hover,
.mode-btn:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  border-color: var(--sky);
  box-shadow: 0 0 18px var(--glow);
  transform: translateY(-2px);
}

/* // AI-Generated */
/* Beginner note: Selected/active mode button styling. */
.mode-btn.selected {
  background: rgba(255, 179, 71, 0.25);
  color: #fff2d4;
  border-color: rgba(255, 220, 170, 0.9);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.6), 0 0 18px rgba(255, 179, 71, 0.7);
  transform: translateY(0);
}

/* // AI-Generated */
/* Beginner note: Styling for action buttons like Start/Replay. */
.action-btn {
  background: var(--mint);
  color: var(--ink);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
  min-width: 130px;
}

/* Beginner note: Hover/focus effects for action buttons. */
.action-btn:hover,
.action-btn:focus-visible {
  background: #d5ffe6;
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(183, 245, 208, 0.85);
}

/* // AI-Generated */
/* Beginner note: Pressed state for action buttons. */
.action-btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.35);
}

/* // AI-Generated */
/* Beginner note: Disabled state for action buttons. */
.action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Beginner note: Layout wrapper for the 4 Simon buttons. */
.container {
  display: block;
  width: min(540px, 90%);
  margin: 12px auto 0;
  position: relative;
}

/* // AI-Generated */
/* Beginner note: Soft glow behind the button grid. */
.container::before {
  content: "";
  position: absolute;
  inset: -10% -15% -5% -15%;
  background: radial-gradient(circle at center, rgba(118, 199, 255, 0.2), rgba(1, 31, 63, 0) 60%);
  z-index: 0;
}

/* Beginner note: Each row of the button grid. */
.row {
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}

/* Beginner note: Base styling for the Simon buttons. */
.btn {
  margin: 18px;
  display: inline-block;
  height: 200px;
  width: 200px;
  border: 8px solid rgba(0, 0, 0, 0.7);
  border-radius: 20%;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
  box-shadow: inset 0 8px 14px rgba(255, 255, 255, 0.12), inset 0 -10px 18px rgba(0, 0, 0, 0.35), 0 16px 22px rgba(0, 0, 0, 0.35);
}

/* Beginner note: Hover effect for the Simon buttons. */
.btn:hover {
  transform: translateY(-3px);
  filter: brightness(1.08);
  box-shadow: inset 0 8px 14px rgba(255, 255, 255, 0.18), inset 0 -10px 18px rgba(0, 0, 0, 0.35), 0 18px 26px rgba(0, 0, 0, 0.45);
}

/* // AI-Generated */
/* Beginner note: Visible focus ring for keyboard users. */
.btn:focus-visible {
  outline: 4px solid rgba(255, 255, 255, 0.7);
  outline-offset: 4px;
}

/* // AI-Generated */
/* Beginner note: Disabled style for buttons while sequence plays. */
.btn.disabled {
  pointer-events: none;
  filter: grayscale(0.2);
  opacity: 0.75;
}

/* Beginner note: Flash the page background on a wrong answer. */
.game-over {
  background-color: red;
  opacity: 0.8;
}

/* Beginner note: Color classes for each button. */
.red {
  background-color: #d73a3a;
}

.green {
  background-color: #2da44e;
}

.blue {
  background-color: #1f6feb;
}

.yellow {
  background-color: #f0b429;
}

/* Beginner note: Visual "pressed" effect when a button is activated. */
.pressed {
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.8), 0 0 60px rgba(255, 255, 255, 0.55);
  animation: pulse 200ms ease-in-out;
}

/* // AI-Generated */
/* Beginner note: Small pulse animation for pressed buttons. */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

/* // AI-Generated */
/* Beginner note: Tablet-size layout tweaks. */
@media (max-width: 720px) {
  .ui-shell {
    margin: 18px 12px 30px;
    padding: 18px 16px 26px;
  }
}

/* // AI-Generated */
/* Beginner note: Phone-size layout tweaks. */
@media (max-width: 640px) {
  #game-title {
    font-size: 1.7rem;
  }

  #level-title {
    font-size: 1.2rem;
  }

  .btn {
    height: 140px;
    width: 140px;
    margin: 12px;
  }

  .status-bar {
    text-align: center;
  }

  #status-message {
    text-align: center;
  }
}
