:root {
  --bg: #121213;
  --tile-border-empty: #3a3a3c;
  --tile-border-filled: #565758;
  --correct: #538d4e;
  --present: #b59f3b;
  --absent: #3a3a3c;
  --key-bg: #818384;
  --key-text: #fff;
  --header-border: #3a3a3c;
  --modal-bg: #1a1a1b;
  --text: #ffffff;
  --text-muted: #818384;
  --accent: #538d4e;
  --card-bg: #1a1a1b;
  --card-hover: #242426;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
  min-height: 100vh;
  user-select: none;
}

/* ===== LANDING PAGE ===== */
.home-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.home-page .site-header {
  text-align: center;
  margin-bottom: 50px;
}

.home-page .site-header h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  background: linear-gradient(135deg, #538d4e, #b59f3b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-page .site-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-top: 8px;
}

.game-cards {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.game-card {
  background: var(--card-bg);
  border: 1px solid var(--header-border);
  border-radius: 16px;
  padding: 36px 32px;
  width: 280px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transition: background 0.2s, transform 0.15s, border-color 0.2s;
  cursor: pointer;
}

.game-card:hover {
  background: var(--card-hover);
  border-color: var(--accent);
  transform: translateY(-4px);
}

.game-card h2 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.game-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  text-align: center;
  line-height: 1.5;
}

.card-icon {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wordle-preview {
  display: flex;
  gap: 4px;
}

.wordle-preview .tile {
  width: 38px;
  height: 38px;
  border: none;
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.wordle-preview .tile.correct { background: var(--correct); }
.wordle-preview .tile.present { background: var(--present); }
.wordle-preview .tile.absent  { background: var(--absent); }

.play-btn {
  background: var(--accent);
  color: white;
  padding: 10px 28px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: opacity 0.2s;
}

.game-card:hover .play-btn {
  opacity: 0.9;
}

/* ===== SHARED GAME HEADER ===== */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 56px;
  border-bottom: 1px solid var(--header-border);
  max-width: 500px;
  margin: 0 auto;
}

.game-header .back-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.game-header .back-btn:hover {
  color: var(--text);
}

.game-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  transition: background 0.15s;
}

.icon-btn:hover {
  background: rgba(255,255,255,0.08);
}

.mobile-only {
  display: flex;
}

@media (min-width: 860px) {
  .mobile-only {
    display: none;
  }
}

/* ===== TOAST ===== */
#toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--text);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 1000;
  white-space: nowrap;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 500;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--modal-bg);
  border: 1px solid var(--header-border);
  border-radius: 16px;
  padding: 32px 28px;
  max-width: 400px;
  width: 90%;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal h2 {
  text-align: center;
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s;
}

.modal-close:hover {
  color: var(--text);
}

/* ===== WORDLE BOARD ===== */
#wordle-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#game-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

#game-main {
  display: flex;
  flex-direction: column;
  width: 100%;
  align-items: center;
  order: 1;
  flex-shrink: 0;
}

/* Side panels — mobile: shown below keyboard */
.side-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 500px;
  padding: 12px 12px 20px;
  border-top: 1px solid var(--header-border);
  flex-shrink: 0;
}

#left-panel { order: 2; }
#right-panel {
  order: 3;
  align-items: center;
}

/* Wide layout: side-by-side */
@media (min-width: 860px) {
  #wordle-page {
    height: 100vh;
  }

  #game-area {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8px;
    overflow: hidden;
  }

  #game-main {
    flex: none;
    width: auto;
    overflow: hidden;
    order: 0;
  }

  #board-container {
    flex: 1;
    padding: 20px 0;
  }

  .side-panel {
    flex-direction: column;
    width: 190px;
    max-width: none;
    padding: 20px 16px 0;
    border-top: none;
  }

  #left-panel { order: 0; align-items: unset; }
  #right-panel { order: 0; align-items: unset; }

  .game-header {
    max-width: none;
  }

  /* Slightly larger tiles on wide screens */
  .tile {
    width: 68px;
    height: 68px;
    font-size: 2.1rem;
  }

  .key {
    height: 60px;
    min-width: 46px;
  }

  .key.key-wide {
    min-width: 68px;
  }

  #keyboard {
    max-width: 560px;
  }
}

/* Side panel styles */
.panel-section {
  margin-bottom: 28px;
}

.panel-section:last-child {
  margin-bottom: 0;
}

.panel-heading {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--header-border);
}

.panel-stat-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.panel-stat-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  min-width: 36px;
  text-align: right;
}

.panel-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Alphabet grid */
#alpha-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin-top: 4px;
}

.alpha-cell {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  transition: background 0.3s, color 0.3s;
}

.alpha-cell.correct { background: var(--correct); color: #fff; }
.alpha-cell.present { background: var(--present); color: #fff; }
.alpha-cell.absent  { background: var(--absent);  color: rgba(255,255,255,0.25); }

#board-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
}

#board {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.row {
  display: flex;
  gap: 5px;
}

.tile {
  width: 62px;
  height: 62px;
  border: 2px solid var(--tile-border-empty);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  text-transform: uppercase;
  transition: border-color 0.05s;
  position: relative;
}

.tile.filled {
  border-color: var(--tile-border-filled);
}

.tile.correct {
  background: var(--correct);
  border-color: var(--correct);
  color: white;
}

.tile.present {
  background: var(--present);
  border-color: var(--present);
  color: white;
}

.tile.absent {
  background: var(--absent);
  border-color: var(--absent);
  color: white;
}

@keyframes pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.tile.pop {
  animation: pop 0.1s ease;
}

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

.row.shake {
  animation: shake 0.5s ease;
}

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

.tile.bounce {
  animation: bounce 0.6s ease forwards;
}

/* ===== KEYBOARD ===== */
#keyboard {
  padding: 0 8px 12px;
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 6px;
}

.key {
  height: 58px;
  min-width: 43px;
  padding: 0 6px;
  border: none;
  border-radius: 4px;
  background: var(--key-bg);
  color: var(--key-text);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  text-transform: uppercase;
}

.key.key-wide {
  min-width: 65px;
  font-size: 0.75rem;
}

.key.correct { background: var(--correct); color: white; }
.key.present { background: var(--present); color: white; }
.key.absent  { background: var(--absent);  color: white; }

.key:active {
  opacity: 0.85;
}

/* ===== STATS MODAL ===== */
.stats-grid {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.stat-box {
  text-align: center;
  flex: 1;
}

.stat-box .num {
  font-size: 2rem;
  font-weight: 700;
}

.stat-box .label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.distribution-title {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.dist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.dist-label {
  width: 16px;
  text-align: right;
  font-size: 0.9rem;
  font-weight: 700;
}

.dist-bar {
  flex: 1;
  background: var(--absent);
  height: 24px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  min-width: 24px;
  transition: width 0.8s ease;
  position: relative;
}

.dist-bar.current {
  background: var(--correct);
}

.dist-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
}

.share-btn {
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  background: var(--correct);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: opacity 0.2s;
}

.share-btn:hover {
  opacity: 0.9;
}

/* ===== HOW TO PLAY ===== */
.how-to-play p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 12px;
}

.example-row {
  display: flex;
  gap: 5px;
  margin: 12px 0;
}

.example-tile {
  width: 42px;
  height: 42px;
  border: 2px solid var(--tile-border-empty);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  text-transform: uppercase;
}

.example-tile.correct { background: var(--correct); border-color: var(--correct); color: white; }
.example-tile.present { background: var(--present); border-color: var(--present); color: white; }
.example-tile.absent  { background: var(--absent);  border-color: var(--absent);  color: white; }

.example-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 4px 0 16px;
}

.example-desc strong {
  color: var(--text);
}

.divider {
  height: 1px;
  background: var(--header-border);
  margin: 20px 0;
}

/* ===== SONGLESS PAGE ===== */
#songless-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.songless-content {
  flex: 1;
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
  padding: 20px 16px;
}

.day-info {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

/* Attempt timeline */
.attempt-timeline {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 28px;
}

.attempt-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--absent);
  position: relative;
  max-width: 60px;
}

.attempt-bar::after {
  content: attr(data-label);
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.attempt-bar.current { background: #565758; }
.attempt-bar.correct { background: var(--correct); }
.attempt-bar.wrong   { background: var(--present); }
.attempt-bar.skipped { background: var(--absent); opacity: 0.6; }

/* Player */
.player-area {
  background: var(--card-bg);
  border: 1px solid var(--header-border);
  border-radius: 16px;
  padding: 28px 24px;
  margin-bottom: 20px;
  text-align: center;
}

.clip-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 50px;
  margin: 16px 0;
}

.wave-bar {
  width: 4px;
  border-radius: 2px;
  background: var(--absent);
  transition: height 0.1s, background 0.3s;
}

.waveform.playing .wave-bar {
  background: var(--correct);
  animation: wave 0.8s ease-in-out infinite;
}

.wave-bar:nth-child(1)  { height: 8px;  animation-delay: 0.0s; }
.wave-bar:nth-child(2)  { height: 16px; animation-delay: 0.1s; }
.wave-bar:nth-child(3)  { height: 28px; animation-delay: 0.2s; }
.wave-bar:nth-child(4)  { height: 36px; animation-delay: 0.15s; }
.wave-bar:nth-child(5)  { height: 44px; animation-delay: 0.05s; }
.wave-bar:nth-child(6)  { height: 36px; animation-delay: 0.25s; }
.wave-bar:nth-child(7)  { height: 24px; animation-delay: 0.1s; }
.wave-bar:nth-child(8)  { height: 30px; animation-delay: 0.3s; }
.wave-bar:nth-child(9)  { height: 20px; animation-delay: 0.05s; }
.wave-bar:nth-child(10) { height: 10px; animation-delay: 0.2s; }
.wave-bar:nth-child(11) { height: 16px; animation-delay: 0.15s; }
.wave-bar:nth-child(12) { height: 28px; animation-delay: 0.0s; }
.wave-bar:nth-child(13) { height: 38px; animation-delay: 0.1s; }
.wave-bar:nth-child(14) { height: 20px; animation-delay: 0.25s; }
.wave-bar:nth-child(15) { height: 12px; animation-delay: 0.05s; }

@keyframes wave {
  0%, 100% { transform: scaleY(0.6); }
  50%       { transform: scaleY(1.4); }
}

.play-btn-large {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--correct);
  border: none;
  color: white;
  font-size: 1.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: transform 0.15s, opacity 0.15s;
}

.play-btn-large:hover {
  transform: scale(1.06);
}

.play-btn-large:active {
  transform: scale(0.95);
}

.play-btn-large:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Guess attempts history */
.guess-history {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.guess-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.guess-item.skipped {
  background: rgba(58,58,60,0.5);
  color: var(--text-muted);
}

.guess-item.wrong {
  background: rgba(181,159,59,0.15);
  color: var(--present);
  border: 1px solid rgba(181,159,59,0.3);
}

.guess-item .guess-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

/* Search area */
.search-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-container {
  position: relative;
}

#search-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--card-bg);
  border: 1px solid var(--header-border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

#search-input:focus {
  border-color: var(--correct);
}

#search-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--modal-bg);
  border: 1px solid var(--header-border);
  border-radius: 10px;
  overflow: hidden;
  z-index: 100;
  max-height: 240px;
  overflow-y: auto;
}

.dropdown-item {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(58,58,60,0.5);
  transition: background 0.1s;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: rgba(255,255,255,0.05);
}

.dropdown-item .song-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.dropdown-item .song-artist {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.action-btns {
  display: flex;
  gap: 10px;
}

.btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  letter-spacing: 0.03em;
}

.btn:active {
  transform: scale(0.98);
}

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

.btn-skip {
  background: var(--card-bg);
  border: 1px solid var(--header-border);
  color: var(--text-muted);
}

.btn-skip:hover:not(:disabled) {
  border-color: var(--text-muted);
  color: var(--text);
}

.btn-submit {
  background: var(--correct);
  color: white;
}

.btn-submit:hover:not(:disabled) {
  opacity: 0.9;
}

/* Game result */
#game-result {
  background: var(--card-bg);
  border: 1px solid var(--header-border);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  margin-top: 20px;
}

#game-result.hidden {
  display: none;
}

#result-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

#result-title.won   { color: var(--correct); }
#result-title.lost  { color: var(--text-muted); }

.result-song-name {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.result-artist-name {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.songless-share-btn {
  width: 100%;
  padding: 14px;
  background: var(--correct);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: opacity 0.2s;
}

.songless-share-btn:hover {
  opacity: 0.9;
}

/* No audio warning */
.no-audio-warning {
  background: rgba(181,159,59,0.1);
  border: 1px solid rgba(181,159,59,0.4);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.82rem;
  color: var(--present);
  line-height: 1.5;
  margin-bottom: 12px;
}

/* ===== MODE BUTTONS (left panel) ===== */
.mode-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--header-border);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--text);
  text-align: left;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
  margin-bottom: 8px;
}
.mode-btn:hover {
  background: rgba(255,255,255,0.09);
  border-color: var(--accent);
}
.mode-btn:last-child { margin-bottom: 0; }
.mode-icon {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.mode-name {
  font-size: 0.83rem;
  font-weight: 700;
  line-height: 1.2;
}
.mode-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.mode-btn-done {
  opacity: 0.6;
}
.mode-btn-done .mode-desc {
  color: var(--correct);
}

/* ===== DAILY INDICATOR ===== */
#daily-indicator {
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 0.8rem;
  background: rgba(181,159,59,0.1);
  border-bottom: 1px solid rgba(181,159,59,0.25);
}
.daily-label {
  color: var(--present);
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* ===== SPEED MODE BAR ===== */
#speed-mode-bar {
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  background: rgba(83,141,78,0.1);
  border-bottom: 1px solid rgba(83,141,78,0.25);
  max-width: 100%;
}
#speed-timer-fill-wrap {
  flex: 1;
  height: 6px;
  background: var(--absent);
  border-radius: 3px;
  overflow: hidden;
  max-width: 220px;
}
#speed-timer-fill {
  height: 100%;
  width: 100%;
  border-radius: 3px;
  background: var(--correct);
  transition: width 0.95s linear, background 0.4s;
}
.speed-time {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--correct);
  min-width: 32px;
  text-align: right;
}
.speed-sep {
  color: var(--text-muted);
  font-size: 0.8rem;
}
.speed-score {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

/* ===== SPEED RESULT MODAL ===== */
.speed-final-display {
  font-size: 5rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
  margin: 16px 0 4px;
}

/* ===== HARD MODE BUTTON ===== */
#hard-mode-btn {
  font-size: 1rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
#hard-mode-btn.active {
  color: var(--present);
}

/* ===== BATTLE INDICATOR ===== */
#battle-indicator {
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 0.8rem;
  background: rgba(83,141,78,0.12);
  border-bottom: 1px solid rgba(83,141,78,0.25);
}
.battle-label {
  color: var(--correct);
  font-weight: 700;
  letter-spacing: 0.05em;
}
.battle-sep {
  color: var(--text-muted);
}
.battle-player {
  color: var(--text);
  font-weight: 700;
}

/* ===== BATTLE SCORE GRID ===== */
.battle-score-grid {
  display: flex;
  gap: 16px;
  justify-content: center;
}
.battle-score-box {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--header-border);
  border-radius: 10px;
  padding: 16px 12px;
}
.battle-score-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.battle-score-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .tile {
    width: 52px;
    height: 52px;
    font-size: 1.6rem;
  }

  .key {
    height: 50px;
    min-width: 33px;
    font-size: 0.78rem;
  }

  .key.key-wide {
    min-width: 52px;
    font-size: 0.68rem;
  }

  .keyboard-row {
    gap: 4px;
  }

  .game-cards {
    flex-direction: column;
    align-items: center;
  }

  .home-page .site-header h1 {
    font-size: 2.2rem;
  }
}
