/* ---------------------------------------------------------
   Torontle — Wordle-style game, built on wordle.html.
   Extends css/style.css (shared header/footer/tokens).
--------------------------------------------------------- */

.wordle-page {
  padding: 40px 0 70px;
}

.wordle-intro {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 26px;
}

.wordle-intro h1 {
  font-size: clamp(2rem, 5vw, 2.6rem);
  margin: 4px 0 12px;
  font-weight: 800;
}

.wordle-intro .hero-sub {
  color: var(--text-dim);
  margin: 0;
}

.mode-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
}

.mode-tab {
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text-dim);
  padding: 9px 20px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.mode-tab.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.stats-bar {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin: 0 auto 20px;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
  min-width: 64px;
}

.stat-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
}

.stat-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-top: 2px;
}

.wordle-status {
  text-align: center;
  min-height: 1.4em;
  font-weight: 600;
  color: var(--gold);
  margin: 0 0 16px;
}

.board-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 26px;
  overflow-x: auto;
  padding: 4px;
}

.board {
  display: grid;
  grid-template-rows: repeat(var(--rows), 1fr);
  gap: 6px;
}

.board-row {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(38px, 52px));
  gap: 6px;
}

.tile {
  aspect-ratio: 1;
  border: 2px solid var(--card-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text);
  background: var(--card);
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.tile.filled {
  border-color: #4a4d56;
  transform: scale(1.03);
}

.tile.correct {
  background: #2f8a4e;
  border-color: #2f8a4e;
  color: #fff;
}

.tile.present {
  background: var(--gold);
  border-color: var(--gold);
  color: #1a1400;
}

.tile.absent {
  background: #26282e;
  border-color: #26282e;
  color: var(--text-faint);
}

.tile.shake {
  animation: tile-shake 0.4s ease;
}

@keyframes tile-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

.end-panel {
  max-width: 480px;
  margin: 0 auto 26px;
  background: linear-gradient(135deg, rgba(224,38,63,0.14), rgba(28,30,35,0.5));
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  text-align: left;
}

.end-panel h2 {
  margin: 0 0 10px;
  font-size: 1.3rem;
}

.end-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.keyboard {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.key {
  border: none;
  border-radius: 6px;
  background: #33353d;
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0;
  height: 46px;
  min-width: 32px;
  flex: 1;
  max-width: 44px;
  cursor: pointer;
  text-transform: uppercase;
}

.key.wide { max-width: 62px; font-size: 0.68rem; }

.key.correct { background: #2f8a4e; color: #fff; }
.key.present { background: var(--gold); color: #1a1400; }
.key.absent { background: #1c1d21; color: var(--text-faint); }

.key:hover { filter: brightness(1.1); }

.wordle-footnote {
  text-align: center;
  color: var(--text-faint);
  font-size: 0.78rem;
  max-width: 480px;
  margin: 26px auto 0;
}

@media (max-width: 480px) {
  .key { min-width: 24px; height: 42px; font-size: 0.72rem; }
  .key.wide { max-width: 48px; }
}
