/* ==========================================================================
   DoYouThinkYouCanSpell.com - Game Arenas & Gameplay Components
   ========================================================================== */

/* Game Arena Container */
.game-arena {
  width: 100%;
  max-width: 820px;
  margin: 20px auto 60px;
  animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Top HUD */
.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
}

.hud-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.hud-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.hud-val {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
}

.score-pill .hud-val {
  color: var(--brand-gold);
}

.streak-pill .hud-val {
  color: #FB923C;
}

/* Circular Timer Ring */
.timer-ring-container {
  position: relative;
  width: 76px;
  height: 76px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  box-shadow: none;
}

.timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-bg {
  fill: none;
  stroke: rgba(148, 163, 184, 0.15);
  stroke-width: 8;
}

.timer-progress {
  fill: none;
  stroke: var(--accent-cyan);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.95s linear, stroke 0.3s ease;
}

.timer-text {
  position: absolute;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: #FFFFFF;
}

/* Main Flash Card */
.game-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-card);
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Flash Feedbacks */
.flash-correct {
  border-color: var(--accent-emerald) !important;
  box-shadow: 0 0 35px rgba(16, 185, 129, 0.4) !important;
}

.flash-incorrect {
  border-color: var(--accent-rose) !important;
  box-shadow: 0 0 35px rgba(239, 68, 68, 0.4) !important;
  animation: shake 0.35s ease;
}

.flash-pass {
  border-color: #64748B !important;
  box-shadow: 0 0 20px rgba(100, 116, 139, 0.3) !important;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* Card Meta Badges */
.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-gold {
  background: rgba(245, 158, 11, 0.15);
  color: var(--brand-gold);
  border: 1px solid var(--border-gold);
}

.badge-origin {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-pos {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
}

/* Audio Pronunciation Area */
.audio-control-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.btn-voice-large {
  background: linear-gradient(135deg, #133827 0%, #0E291D 100%);
  border: 2px solid var(--brand-gold);
  color: #FFFFFF;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.2);
  transition: all 0.2s ease;
}

.btn-voice-large:hover {
  background: var(--brand-gold);
  color: #071A12;
  transform: scale(1.03);
}

.btn-subtle {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-subtle:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}

/* Clue Box */
.clue-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 28px;
  text-align: center;
}

.clue-phonetic {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.15rem;
  color: var(--accent-cyan);
  margin-bottom: 10px;
  letter-spacing: 0.05em;
}

.clue-definition {
  font-size: 1.05rem;
  color: var(--text-main);
  margin-bottom: 12px;
  line-height: 1.5;
}

.clue-sentence {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Speller Typing Input */
.speller-input-form {
  margin-bottom: 24px;
}

.input-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-align: left;
}

.input-wrapper {
  display: flex;
  position: relative;
  align-items: center;
}

.spell-input-box {
  width: 100%;
  background: var(--bg-input);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 56px 16px 20px;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 0.05em;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.spell-input-box:focus {
  border-color: var(--brand-gold);
  box-shadow: 0 0 15px var(--brand-gold-glow);
}

.spell-input-box.text-uppercase {
  text-transform: uppercase;
}

.btn-submit-arrow {
  position: absolute;
  right: 12px;
  width: 40px;
  height: 40px;
  background: var(--brand-gold);
  border: none;
  border-radius: 10px;
  color: #071A12;
  font-size: 1.25rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.btn-submit-arrow:hover {
  transform: scale(1.08);
}

/* Card Actions */
.card-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.btn-action {
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-pass {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.btn-pass:hover {
  background: rgba(148, 163, 184, 0.2);
  color: #FFFFFF;
}

.btn-gold {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #071A12;
}

.btn-gold:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
}

/* ==========================================================================
   Challenge 2: The Etymology Detective Styling
   ========================================================================== */

.mystery-box {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
}

.mystery-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brand-gold);
  text-transform: uppercase;
  margin-bottom: 18px;
  text-align: center;
}

.roots-clues-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.root-clue-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.root-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
}

.root-meaning {
  font-size: 1rem;
  font-weight: 700;
  color: #FFFFFF;
}

.root-hidden {
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--brand-gold);
}

.root-hidden.revealed {
  font-weight: bold;
  color: var(--accent-emerald);
}

.clue-meaning-box {
  border-top: 1px dashed var(--border-light);
  padding-top: 14px;
  text-align: left;
}

.clue-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
}

.case-definition {
  font-size: 0.98rem;
  color: var(--text-main);
  margin-top: 4px;
}

.case-feedback {
  padding: 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  text-align: center;
}

.feedback-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--accent-emerald);
}

.feedback-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--accent-rose);
}

.feedback-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.points-badge {
  display: inline-block;
  background: var(--brand-gold);
  color: #071A12;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.85rem;
  margin-top: 8px;
}

/* ==========================================================================
   Challenge 3: Spelling Tennis Styling
   ========================================================================== */

.tennis-court {
  background: linear-gradient(180deg, #134E4A 0%, #064E3B 100%);
  border: 2px solid #34D399;
  position: relative;
  overflow: hidden;
}

.court-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.target-word-announcement {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: #FDE68A;
}

.tennis-net-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.35);
  border: 2px dashed rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  margin-bottom: 24px;
  position: relative;
}

.court-half {
  flex: 1;
  text-align: center;
}

.player-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: #A7F3D0;
  margin-bottom: 8px;
}

.last-letter-bubble {
  width: 60px;
  height: 60px;
  margin: 0 auto;
  background: #065F46;
  border: 2px solid #34D399;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  color: #FFFFFF;
}

.tennis-net {
  width: 6px;
  height: 90px;
  background: #FFFFFF;
  position: relative;
  border-radius: 3px;
}

.tennis-ball {
  position: absolute;
  top: 30px;
  left: -12px;
  font-size: 24px;
  transition: transform 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.rally-letter-stream {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.rally-slot {
  width: 44px;
  height: 52px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: #FFFFFF;
}

.rally-slot.filled-coach {
  background: #1E3A8A;
  border-color: #60A5FA;
}

.rally-slot.filled-speller {
  background: #047857;
  border-color: #34D399;
}

.shot-clock-bar {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  margin-bottom: 20px;
  overflow: hidden;
}

.shot-clock-fill {
  width: 100%;
  height: 100%;
  background: #F59E0B;
  transition: width 0.1s linear;
}

.tennis-controls {
  text-align: center;
}

.shot-instruction {
  font-size: 1rem;
  font-weight: 700;
  color: #F8FAFC;
  margin-bottom: 12px;
}

.shot-instruction.turn-active {
  color: #FDE68A;
  animation: pulse 1s infinite;
}

.shot-instruction.turn-fault {
  color: #F87171;
}

.shot-instruction.turn-won {
  color: #6EE7B7;
}

.tennis-input-box {
  width: 120px;
  height: 64px;
  margin: 0 auto;
  background: #05140E;
  border: 3px solid #34D399;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 900;
  color: #FFFFFF;
  text-align: center;
  text-transform: uppercase;
  outline: none;
}

/* ==========================================================================
   Challenge 4: The Imposter Hunt Styling
   ========================================================================== */

.imposter-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.imposter-option-card {
  background: var(--bg-card);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px 18px;
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: #FFFFFF;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.imposter-option-card:hover {
  border-color: var(--brand-gold);
  transform: scale(1.02);
  background: #1F2D44;
}

.card-imposter-caught {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: var(--accent-rose) !important;
  color: #FCA5A5 !important;
  animation: shake 0.35s ease;
}

.card-false-alarm {
  background: rgba(148, 163, 184, 0.2) !important;
  border-color: #64748B !important;
}

.card-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.trap-panel {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
}

.trap-banner {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: #F87171;
  margin-bottom: 6px;
}

.trap-explanation {
  font-size: 0.95rem;
  color: #FECACA;
  margin-bottom: 18px;
}

.correction-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--accent-emerald);
  padding: 12px;
  border-radius: 8px;
  margin-top: 14px;
  color: #A7F3D0;
}

.correction-missed {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--accent-rose);
  padding: 12px;
  border-radius: 8px;
  margin-top: 14px;
  color: #FECACA;
}

/* ==========================================================================
   Championship Stage Simulator Styling
   ========================================================================== */

.stage-card {
  background: linear-gradient(180deg, #133827 0%, #0E291D 100%);
  border: 2px solid var(--border-gold);
}

.stage-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stage-status {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pronouncer-podium {
  text-align: center;
  margin-bottom: 24px;
}

.podium-avatar {
  font-size: 42px;
  margin-bottom: 8px;
}

.inquiry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.btn-inquiry {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
  text-align: left;
}

.btn-inquiry:hover {
  background: #223048;
  border-color: var(--brand-gold);
}

.pronouncer-dialogue-box {
  background: #0B1120;
  border-left: 4px solid var(--brand-gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.dialogue-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--brand-gold);
  letter-spacing: 0.05em;
}

.dialogue-content {
  font-size: 1.05rem;
  color: #FFFFFF;
  margin-top: 4px;
  line-height: 1.5;
}

.stage-result-panel {
  padding: 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  text-align: center;
}

.stage-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--accent-emerald);
}

.stage-eliminated {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--accent-rose);
}

.result-headline {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.btn-voice-circular {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border: 2px solid #F59E0B;
  color: #FFFFFF;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  transition: all 0.2s ease;
}

.btn-voice-circular:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.5);
}

.btn-voice-circular-small {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #065F46;
  border: 1.5px solid #F59E0B;
  color: #FFFFFF;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-voice-circular-small:hover {
  transform: scale(1.1);
  background: #047857;
}

.mini-round-select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-gold);
  color: var(--brand-gold);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  border-radius: 6px;
  padding: 2px 4px;
  cursor: pointer;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@media (max-width: 600px) {
  .game-arena {
    margin: 8px auto 20px;
  }
  .game-hud {
    margin-bottom: 12px;
    gap: 6px;
  }
  .hud-item {
    padding: 6px 6px;
    min-width: 0;
    flex: 1;
    border-radius: 8px;
  }
  .hud-label {
    font-size: 0.6rem;
  }
  .hud-val {
    font-size: 1.1rem;
  }
  .fault-pill .hud-val {
    font-size: 0.78rem;
    white-space: nowrap;
    letter-spacing: -1px;
  }
  .game-card {
    padding: 14px 12px;
    border-radius: 12px;
  }
  .clue-box {
    margin-bottom: 12px;
  }
  .clue-definition {
    font-size: 0.9rem;
  }
  .clue-sentence {
    font-size: 0.82rem;
  }
  .spell-input-box {
    font-size: 1.15rem;
    padding: 10px 12px;
  }
  .pronouncer-dialogue-box {
    padding: 8px 12px;
    margin-bottom: 12px;
  }
  .dialogue-content {
    font-size: 0.92rem;
  }
  .inquiry-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-bottom: 12px;
  }
  .btn-inquiry {
    padding: 8px 8px;
    font-size: 0.76rem;
  }
  .tennis-court {
    padding: 12px 10px;
  }
  .tennis-net-container {
    padding: 10px 6px;
    margin-bottom: 10px;
  }
  .last-letter-bubble {
    width: 42px;
    height: 42px;
    font-size: 1.35rem;
  }
  .tennis-net {
    height: 56px;
  }
  .rally-letter-stream {
    margin-bottom: 14px;
    gap: 4px;
  }
  .rally-slot {
    width: 28px;
    height: 36px;
    font-size: 1.15rem;
  }
  .tennis-input-box {
    width: 80px;
    height: 46px;
    font-size: 1.45rem;
  }
  .imposter-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 10px 0;
  }
  .imposter-option-card {
    padding: 12px 6px;
    font-size: 1rem;
  }
}
