:root {
  --bg: #0f1115;
  --panel: #181c23;
  --text: #f2f4f8;
  --muted: #9aa3b2;
  --accent: #4f8cff;
  --win: #2fbf71;
  --present: #d4a017;
  --absent: #3a4048;
  --radius: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
}
#topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid #232833; }
#brand { font-weight: 800; letter-spacing: 0.3px; }
#day-label { color: var(--muted); font-size: 0.9rem; }
#app { flex: 1; display: flex; flex-direction: column; }
.screen { display: none; flex: 1; flex-direction: column; align-items: center; justify-content: center; padding: 20px 16px 32px; max-width: 620px; width: 100%; margin: 0 auto; text-align: center; }
.screen.active { display: flex; }
.hidden { display: none !important; }
h1 { font-size: 1.9rem; line-height: 1.25; margin-bottom: 12px; }
h2 { font-size: 1.5rem; margin-bottom: 16px; }
.sub { color: var(--muted); margin-bottom: 26px; line-height: 1.5; }
.muted { color: var(--muted); font-size: 0.9rem; }
.error { color: var(--present); font-size: 0.95rem; margin-top: 8px; min-height: 1.2em; }
.btn { border: 1px solid #2a3140; background: var(--panel); color: var(--text); border-radius: 12px; padding: 12px 18px; font-size: 1rem; font-weight: 700; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.big { font-size: 1.15rem; padding: 15px 34px; border-radius: 14px; }
.btn.ghost { background: transparent; }
.streak-line { margin-top: 18px; font-weight: 700; }
.countdown { margin-top: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Duel layout */
#duel { display: flex; gap: 22px; justify-content: center; align-items: flex-start; width: 100%; }
.col-label { font-size: 0.75rem; font-weight: 800; letter-spacing: 1px; color: var(--muted); margin-bottom: 8px; }
#bot-status { margin-top: 8px; min-height: 1.2em; font-size: 0.8rem; }
.grid { display: grid; grid-template-rows: repeat(6, 1fr); gap: 6px; }
.grid .row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tile { width: 52px; height: 52px; border: 2px solid #2a3140; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 800; text-transform: uppercase; background: transparent; }
.tile.filled { border-color: #4a5468; }
.tile.correct { background: var(--win); border-color: var(--win); }
.tile.present { background: var(--present); border-color: var(--present); }
.tile.absent { background: var(--absent); border-color: var(--absent); }
.tile.pop { transform: scale(1.08); transition: transform 0.08s; }
.grid.mini .tile { width: 30px; height: 30px; font-size: 0.9rem; border-radius: 6px; }

/* Keyboard */
#keyboard { margin-top: 20px; width: 100%; max-width: 500px; display: flex; flex-direction: column; gap: 7px; }
.kb-row { display: flex; gap: 6px; justify-content: center; }
.key { flex: 1; min-width: 0; height: 52px; border: none; border-radius: 6px; background: #4a5468; color: var(--text); font-weight: 700; font-size: 0.95rem; text-transform: uppercase; cursor: pointer; }
.key.wide { flex: 1.6; font-size: 0.8rem; }
.key.correct { background: var(--win); }
.key.present { background: var(--present); }
.key.absent { background: #232833; color: #6b7686; }

/* Result */
#result-grids { display: flex; gap: 26px; justify-content: center; margin-bottom: 14px; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--panel); border: 1px solid #2a3140; padding: 10px 18px; border-radius: 999px; font-size: 0.9rem; }

@media (max-width: 460px) {
  .tile { width: 40px; height: 40px; font-size: 1.2rem; }
  .grid.mini .tile { width: 22px; height: 22px; font-size: 0.7rem; }
  .grid { gap: 5px; }
  .grid .row { gap: 5px; }
  #duel { gap: 10px; }
  #result-grids { gap: 14px; }
}
.quip { color: var(--muted); font-style: italic; margin-top: -6px; }
