:root {
  --bg-dark: #0d0f1a;
  --bg-panel: #1a1d33;
  --text: #e0e8ff;
  --muted: #a0a8c8;
  --accent-blue: #6fa8ff;
  --accent-pink: #ff7ac2;
  --accent-green: #6fe3a2;
  --accent-yellow: #ffd86b;
  --accent-red: #ff6f6f;
  --accent-purple: #b794f6;
  --accent-orange: #ffa94d;
  --accent-cyan: #5ce8f5;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  background: radial-gradient(circle at top, #1e2245, var(--bg-dark) 70%);
  color: var(--text);
  font-family:
    "Lexend",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

/* Header */
.app-header {
  padding: 12px 24px;
  border-bottom: 1px solid #303560;
  background: linear-gradient(180deg, #1a1d33 0%, var(--bg-dark) 100%);
}

.title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.help-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-panel);
  border: 2px solid var(--accent-blue);
  color: var(--accent-blue);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(111, 168, 255, 0.3);
}

.help-btn:hover {
  background: var(--accent-blue);
  color: var(--bg-dark);
  box-shadow: 0 0 25px rgba(111, 168, 255, 0.6);
  transform: scale(1.1);
}

.limit-badge,
.game-title {
  font-size: 28px;
  font-weight: 900;
  color: var(--accent-blue);
  line-height: 1;
  text-shadow: 0 0 6px #1a1d33;
  margin: 0;
}

.scores-display {
  display: flex;
  gap: 16px;
}

.score-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-panel);
  border: 2px solid var(--accent-green);
  border-radius: 12px;
  padding: 6px 14px;
  box-shadow: 0 0 20px rgba(111, 227, 162, 0.3);
  min-width: 80px;
}

.score-box.agent-score {
  border-color: var(--accent-orange);
  box-shadow: 0 0 20px rgba(255, 169, 77, 0.3);
}

.score-label {
  font-family: "Space Mono", monospace;
  font-size: 11px;
  color: var(--muted);
}

.score-value {
  font-family: "Space Mono", monospace;
  font-size: 24px;
  font-weight: 900;
  color: var(--accent-green);
  text-shadow: 0 0 10px var(--accent-green);
}

.score-box.agent-score .score-value {
  color: var(--accent-orange);
  text-shadow: 0 0 10px var(--accent-orange);
}

.tagline {
  font-family: "Space Mono", monospace;
  font-size: 12px;
  color: var(--accent-pink);
  text-shadow: 0 0 10px var(--accent-pink);
  margin-top: 6px;
  text-align: center;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 16px;
  padding: 16px;
  height: calc(100vh - 120px);
  overflow: hidden;
}

/* Left Panel */
.left-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.turn-indicator {
  background: var(--bg-panel);
  border: 2px solid #303560;
  border-radius: 14px;
  padding: 12px 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.current-player {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-display {
  font-size: 36px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: bounce 2s ease-in-out infinite;
}

.avatar-display img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.player-name-display {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.timer-display {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #141938;
  border: 2px solid var(--accent-yellow);
  border-radius: 10px;
  padding: 6px 14px;
  box-shadow: 0 0 15px rgba(255, 216, 107, 0.3);
}

.timer-label {
  font-family: "Space Mono", monospace;
  font-size: 12px;
  color: var(--muted);
}

.timer-value {
  font-family: "Space Mono", monospace;
  font-size: 22px;
  font-weight: 900;
  color: var(--accent-yellow);
  text-shadow: 0 0 10px var(--accent-yellow);
  min-width: 50px;
  text-align: center;
}

.timer-value.warning {
  color: var(--accent-red);
  animation: pulse-timer 0.5s ease-in-out infinite;
}

@keyframes pulse-timer {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Sequence Card */
.sequence-card {
  background: var(--bg-panel);
  border: 3px solid var(--accent-blue);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.sequence-card h3 {
  margin: 0 0 20px;
  color: var(--accent-pink);
  font-size: 20px;
  text-align: center;
}

.sequence-display {
  background: #141938;
  border: 2px solid var(--accent-cyan);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.sequence-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.sequence-number {
  font-family: "Space Mono", monospace;
  font-size: 28px;
  font-weight: 900;
  color: var(--accent-cyan);
  padding: 12px 20px;
  background: var(--bg-panel);
  border: 2px solid var(--accent-cyan);
  border-radius: 10px;
  min-width: 80px;
  text-align: center;
  box-shadow: 0 0 15px rgba(92, 232, 245, 0.3);
}

.sequence-number.given {
  border-color: var(--accent-green);
  color: var(--accent-green);
  box-shadow: 0 0 15px rgba(111, 227, 162, 0.3);
}

.sequence-number.correct {
  border-color: var(--accent-green);
  color: var(--accent-green);
  animation: correct-flash 0.5s ease;
}

.sequence-number.incorrect {
  border-color: var(--accent-red);
  color: var(--accent-red);
  animation: shake 0.5s ease;
}

@keyframes correct-flash {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
    box-shadow: 0 0 30px rgba(111, 227, 162, 0.8);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

.sequence-number.placeholder {
  border-color: #4a4f80;
  color: var(--muted);
  opacity: 0.5;
}

/* Input Section */
.input-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-group {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.input-group label {
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
}

.input-group input {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #141938;
  color: var(--text);
  border: 2px solid #4a4f80;
  font-size: 18px;
  font-family: "Space Mono", monospace;
  font-weight: 700;
}

.input-group input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 20px rgba(111, 168, 255, 0.3);
}

.submit-btn,
.buy-btn {
  padding: 12px 24px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.submit-btn {
  background: linear-gradient(135deg, #74c0fc, #339af0);
  color: #fff;
  box-shadow: 0 4px 15px rgba(111, 168, 255, 0.4);
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(111, 168, 255, 0.6);
}

.buy-btn {
  background: linear-gradient(135deg, #ffd86b, #ffa94d);
  color: #1a1d33;
  box-shadow: 0 4px 15px rgba(255, 216, 107, 0.4);
}

.buy-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 216, 107, 0.6);
}

.submit-btn:disabled,
.buy-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.hint-text {
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
  text-align: center;
}

/* Animation Canvas */
.animation-canvas {
  background: var(--bg-panel);
  border: 2px solid #303560;
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
  min-height: 200px;
  position: relative;
  overflow: hidden;
}

.avatar-character {
  position: absolute;
  font-size: 48px;
  width: 60px;
  height: 60px;
  z-index: 10;
  transition: all 0.5s ease;
  bottom: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-character img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.avatar-character.skipping {
  animation: skip 0.5s ease-in-out;
}

@keyframes skip {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-30px) rotate(-10deg);
  }
  75% {
    transform: translateY(-30px) rotate(10deg);
  }
}

.avatar-character.tumbling {
  animation: tumble 1s ease-out forwards;
}

@keyframes tumble {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(100px) rotate(360deg) scale(0.8);
  }
  100% {
    transform: translateY(200px) rotate(720deg) scale(0.3);
    opacity: 0;
  }
}

.avatar-character.winning {
  animation: victory 2s ease-in-out infinite;
}

@keyframes victory {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.2) rotate(-15deg);
  }
  75% {
    transform: scale(1.2) rotate(15deg);
  }
}

.sequence-path {
  display: flex;
  gap: 60px;
  padding: 40px 20px;
  align-items: flex-end;
}

.path-step {
  width: 50px;
  height: 50px;
  background: #141938;
  border: 3px solid var(--accent-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Space Mono", monospace;
  font-weight: 700;
  color: var(--accent-blue);
  font-size: 14px;
  box-shadow: 0 0 15px rgba(111, 168, 255, 0.3);
}

.path-step.completed {
  border-color: var(--accent-green);
  background: rgba(111, 227, 162, 0.2);
  color: var(--accent-green);
  box-shadow: 0 0 20px rgba(111, 227, 162, 0.5);
}

.path-step.failed {
  border-color: var(--accent-red);
  background: rgba(255, 111, 111, 0.2);
  color: var(--accent-red);
}

.boom-effect {
  position: absolute;
  font-size: 64px;
  animation: boom 1s ease-out forwards;
  z-index: 20;
}

@keyframes boom {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  50% {
    transform: scale(1.5);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.rainbow-effect {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 0, 0, 0.2),
    rgba(255, 165, 0, 0.2),
    rgba(255, 255, 0, 0.2),
    rgba(0, 255, 0, 0.2),
    rgba(0, 0, 255, 0.2),
    rgba(75, 0, 130, 0.2),
    rgba(238, 130, 238, 0.2)
  );
  animation: rainbow-slide 3s linear infinite;
  pointer-events: none;
}

@keyframes rainbow-slide {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 200% 200%;
  }
}

.gold-shower {
  position: absolute;
  font-size: 32px;
  animation: shower 2s ease-out forwards;
  z-index: 15;
}

@keyframes shower {
  0% {
    transform: translateY(-100px) translateX(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(300px) translateX(var(--x-offset, 0)) rotate(360deg);
    opacity: 0;
  }
}

/* Right Panel */
.right-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.players-info {
  background: var(--bg-panel);
  border: 2px solid #4a4f80;
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 8px;
}

.player-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.player-avatar {
  font-size: 42px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-panel);
  border-radius: 50%;
  border: 2px solid var(--accent-green);
  overflow: hidden;
}

.player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.player-card.agent .player-avatar {
  border-color: var(--accent-orange);
}

.player-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.level-info {
  background: var(--bg-panel);
  border: 2px solid #4a4f80;
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: var(--shadow);
  text-align: center;
}

.level-badge {
  display: inline-block;
  background: var(--accent-blue);
  color: #fff;
  font-family: "Space Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
}

.vs-divider {
  font-size: 16px;
  font-weight: 900;
  color: var(--accent-pink);
}

/* Progress Panel */
.progress-panel {
  background: var(--bg-panel);
  border: 2px solid #303560;
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.progress-panel h3 {
  margin: 0 0 16px;
  color: var(--accent-blue);
  font-size: 15px;
  text-align: center;
}

.sequences-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sequence-progress-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: #141938;
  border: 2px solid #4a4f80;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.sequence-progress-item.current {
  border-color: var(--accent-yellow);
  box-shadow: 0 0 15px rgba(255, 216, 107, 0.3);
}

.sequence-number-badge {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-panel);
  border: 2px solid #4a4f80;
  border-radius: 50%;
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  flex-shrink: 0;
}

.sequence-progress-item.current .sequence-number-badge {
  border-color: var(--accent-yellow);
  color: var(--accent-yellow);
}

.progress-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.progress-bar-row {
  display: flex;
  gap: 4px;
}

.progress-bar-segment {
  flex: 1;
  height: 8px;
  background: #4a4f80;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.progress-bar-segment.correct-player {
  background: var(--accent-green);
  box-shadow: 0 0 10px rgba(111, 227, 162, 0.5);
}

.progress-bar-segment.incorrect-player {
  background: var(--accent-red);
}

.progress-bar-segment.correct-agent {
  background: var(--accent-orange);
  box-shadow: 0 0 10px rgba(255, 169, 77, 0.5);
}

.progress-bar-segment.incorrect-agent {
  background: #4a4f80;
}

/* Game Log */
.game-log {
  background: var(--bg-panel);
  border: 1px solid #303560;
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.game-log h3 {
  margin: 0 0 12px;
  color: var(--accent-blue);
  font-size: 16px;
  text-align: center;
}

.log-content {
  flex: 1;
  overflow-y: auto;
  font-family: "Space Mono", monospace;
  font-size: 12px;
  line-height: 1.6;
}

.log-entry {
  margin: 6px 0;
  padding: 4px 8px;
  border-left: 3px solid var(--accent-cyan);
  background: #141938;
  border-radius: 4px;
}

.log-entry.correct {
  border-left-color: var(--accent-green);
}

.log-entry.incorrect {
  border-left-color: var(--accent-red);
}

.log-entry.info {
  border-left-color: var(--accent-blue);
}

/* Overlays */
.overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: #0d0f1acc;
  backdrop-filter: blur(8px);
  z-index: 100;
  overflow-y: auto;
  padding: 20px;
}

.overlay.visible {
  display: grid;
}

.overlay .card {
  background: var(--bg-dark);
  border: 2px solid #303560;
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
  color: var(--text);
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  width: 100%;
}

.overlay .card h2 {
  margin: 0 0 16px;
  color: var(--accent-blue);
  font-size: 32px;
  text-align: center;
}

.overlay .card h3 {
  color: var(--accent-pink);
  font-size: 20px;
  margin: 16px 0 8px;
}

/* Instructions */
.instructions {
  width: min(700px, 90vw);
}

.instructions-content {
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 10px;
  line-height: 1.6;
}

.instructions-content ul,
.instructions-content ol {
  padding-left: 24px;
}

.instructions-content li {
  margin: 6px 0;
}

.countdown {
  margin-top: 20px;
  text-align: center;
  color: var(--accent-yellow);
  font-family: "Space Mono", monospace;
  font-size: 18px;
  font-weight: 700;
}

/* Setup */
.setup {
  width: min(550px, 90vw);
}

.setup form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setup label {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.setup input[type="text"],
.setup select {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  background: #141938;
  color: var(--text);
  border: 2px solid #4a4f80;
  font-size: 15px;
  font-family: inherit;
}

.setup input:focus,
.setup select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 20px rgba(111, 168, 255, 0.3);
}

/* Avatar Selection */
.avatar-selection {
  margin-top: 8px;
}

.avatar-container {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  background: #141938;
  border: 2px solid #303560;
  border-radius: 16px;
  padding: 16px;
}

.avatar-preview {
  flex-shrink: 0;
  width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #252850 0%, #1e2040 100%);
  border: 3px solid var(--accent-green);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 0 30px rgba(111, 227, 162, 0.3);
}

.avatar-preview img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.preview-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-green);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.avatar-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-height: 156px;
  overflow-y: auto;
  padding-right: 8px;
}

.avatar-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #1e2245;
  border: 2px solid #4a4f80;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  padding: 8px 4px;
  position: relative;
}

.avatar-option img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.avatar-name {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.25s ease;
}

.avatar-option:hover {
  border-color: var(--accent-blue);
  background: rgba(111, 168, 255, 0.1);
  box-shadow: 0 0 15px rgba(111, 168, 255, 0.3);
}

.avatar-option:hover img {
  transform: scale(1.15);
}

.avatar-option:hover .avatar-name {
  color: var(--accent-blue);
}

.avatar-option.selected {
  border-color: var(--accent-green);
  background: rgba(111, 227, 162, 0.15);
  box-shadow: 0 0 20px rgba(111, 227, 162, 0.4);
}

.avatar-option.selected::after {
  content: "✓";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  background: var(--accent-green);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-option.selected img {
  transform: scale(1.1);
}

.avatar-option.selected .avatar-name {
  color: var(--accent-green);
  font-weight: 700;
}

button.primary {
  padding: 16px 32px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #74c0fc, #339af0);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  font-family: inherit;
}

button.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

button.primary:active {
  transform: translateY(0);
}

.instructions button.primary {
  display: block;
  margin: 0 auto;
}

/* Game Over */
.gameover {
  width: min(1200px, 90vw);
}

.final-scores-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 30px 0;
}

.final-score-card {
  flex: 1;
  max-width: 300px;
  background: var(--bg-panel);
  border: 3px solid var(--accent-green);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}

.final-score-card.agent {
  border-color: var(--accent-orange);
}

.score-avatar {
  font-size: 64px;
  margin-bottom: 16px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-avatar img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.score-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.score-display-large {
  font-family: "Space Mono", monospace;
  font-size: 56px;
  font-weight: 900;
  color: var(--accent-green);
  text-shadow: 0 0 20px var(--accent-green);
}

.final-score-card.agent .score-display-large {
  color: var(--accent-orange);
  text-shadow: 0 0 20px var(--accent-orange);
}

.vs-divider-large {
  font-size: 32px;
  font-weight: 900;
  color: var(--accent-pink);
}

.winner-section {
  text-align: center;
  margin: 20px 0;
  padding: 20px;
  background: var(--bg-panel);
  border-radius: 12px;
}

.winner-message {
  font-size: 28px;
  font-weight: 900;
  color: var(--accent-yellow);
  text-shadow: 0 0 20px var(--accent-yellow);
  margin-bottom: 12px;
}

.winner-animation {
  font-size: 48px;
  animation: victory 1.5s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}

.winner-animation img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.review-section {
  margin: 30px 0;
  max-height: 400px;
  overflow-y: auto;
  padding: 20px;
  background: var(--bg-panel);
  border-radius: 12px;
}

.review-item {
  margin: 20px 0;
  padding: 16px;
  background: #141938;
  border-radius: 10px;
  border-left: 4px solid var(--accent-red);
}

.review-question {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 8px;
}

.review-answer {
  font-family: "Space Mono", monospace;
  font-size: 14px;
  color: var(--text);
  margin: 6px 0;
}

.review-explanation {
  font-size: 14px;
  color: var(--muted);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #303560;
  line-height: 1.6;
}

.sequence-type-badge {
  display: inline-block;
  background: var(--accent-purple);
  color: #fff;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  margin-right: 8px;
}

.leaderboard-section {
  margin: 30px 0;
  padding: 20px;
  background: var(--bg-panel);
  border-radius: 12px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #303560;
}

.leaderboard-table th {
  color: var(--accent-blue);
  font-weight: 700;
  font-size: 14px;
}

.leaderboard-table td {
  color: var(--text);
  font-family: "Space Mono", monospace;
  font-size: 13px;
}

.leaderboard-rank {
  font-weight: 900;
  color: var(--accent-yellow);
}

.leaderboard-table tr.highlight {
  background: rgba(111, 168, 255, 0.1);
  border: 2px solid var(--accent-blue);
}

.gameover-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.action-btn {
  padding: 16px 32px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #74c0fc, #339af0);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  font-family: inherit;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

.action-btn:active {
  transform: translateY(0);
}

button.chip {
  background: linear-gradient(135deg, #b794f6, #8b5cf6);
}

/* Utility */
.hidden {
  display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #141938;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #4a4f80;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #5a5f90;
}

/* Responsive */
@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .right-panel {
    max-height: 400px;
  }
}

@media (max-width: 768px) {
  .scores-display {
    flex-direction: column;
    gap: 8px;
  }

  .avatar-container {
    flex-direction: column;
    align-items: center;
  }

  .avatar-preview {
    width: 100%;
    flex-direction: row;
    padding: 12px 16px;
    gap: 16px;
  }

  .avatar-preview img {
    width: 60px;
    height: 60px;
  }

  .avatar-grid {
    grid-template-columns: repeat(4, 1fr);
    max-height: 180px;
  }

  .final-scores-section {
    flex-direction: column;
  }

  .vs-divider-large {
    transform: rotate(90deg);
  }
}
