/* ------------------------------------------------------------------
   Słownikowo · Endless — prywatna, lokalna kopia gry.
   Wygląd odtworzony w CSS (bez plików graficznych oryginału).
   ------------------------------------------------------------------ */

:root {
  --body-color: #ffffff;
  --font-color: #000000;
  --surface: #f3f4f3;
  --surface-2: #e6e8e6;
  --surface-3: #d6d9d6;
  --muted: #505552;
  --hairline: #e2e4e2;
  --bar: #b2b7b2;
  --green: #7cb880;
  --gold: #c7b264;
  --danger: #c8452f;
  --danger-tint: rgba(200, 69, 47, 0.1);
  --nav-ink: #111211;

  --toast-bg: rgba(255, 255, 255, 0.88);
  --toast-edge: rgba(21, 22, 15, 0.08);
  --toast-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 18px 40px -12px rgba(21, 22, 15, 0.28);

  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  --font-game: -apple-system, "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

html[data-theme="dark"] {
  --body-color: #121213;
  --font-color: #ffffff;
  --surface: #1c1d1d;
  --surface-2: #232424;
  --surface-3: #2c2d2d;
  --muted: #a8aeaa;
  --hairline: #262727;
  --bar: #6f7171;
  --danger: #e05a45;
  --danger-tint: rgba(224, 90, 69, 0.14);

  --toast-bg: rgba(28, 28, 26, 0.92);
  --toast-edge: rgba(255, 255, 255, 0.08);
  --toast-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 40px -12px rgba(0, 0, 0, 0.7);
}

html[data-cb="true"] {
  --green: #f5793a;
  --gold: #85c0f9;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--body-color);
  color: var(--font-color);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
svg { display: block; }

.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
@supports (height: 100dvh) {
  .app { height: 100dvh; }
}

.main.game-enter { animation: gameIn 0.4s ease both; }
@keyframes gameIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ------------------------------- header ------------------------------- */

.site-header {
  flex-shrink: 0;
  width: 100%;
  background: var(--body-color);
  border-bottom: 1px solid var(--hairline);
}

.header-desktop {
  display: flex;
  align-items: center;
  gap: 24px;
  width: 100%;
  height: 76px;
  padding: 0 24px;
}

.header-mobile { display: none; }

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark { width: 12px; height: 12px; border-radius: 4px; background: var(--green); }
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: -0.1px; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.nav-pill:hover { color: var(--font-color); }
.nav-pill.active { background: var(--gold); color: var(--nav-ink); font-weight: 600; }
.nav-dot { width: 8px; height: 8px; border-radius: 999px; }
.dot-green { background: var(--green); }
.dot-orange { background: #e8845f; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-2);
  transition: background-color 0.15s ease;
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn svg { width: 19px; height: 19px; fill: currentColor; }

.mobile-title { min-width: 0; text-align: left; display: flex; flex-direction: column; gap: 2px; }
.mobile-title-top { display: flex; align-items: center; gap: 8px; }
.mobile-title-name { font-size: 22px; font-weight: 700; line-height: 1.1; letter-spacing: -0.3px; }
.mobile-title .chev { width: 12px; height: 12px; fill: var(--muted); flex-shrink: 0; }
.mobile-sub { font-size: 13px; line-height: 1.2; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* -------------------------------- main -------------------------------- */

.main {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 20px;
}

.meta {
  flex-shrink: 0;
  width: 100%;
  max-width: 430px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.meta-left { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta-right { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.dots { display: flex; align-items: center; gap: 5px; }
.dot { width: 9px; height: 9px; border-radius: 999px; background: var(--surface-3); transition: background-color 0.3s ease; }
.dot.used { background: var(--gold); }
.dot.win { background: var(--green); }
.tries { white-space: nowrap; }

.board {
  width: 100%;
  max-width: 430px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-family: var(--font-game);
}

.guesses {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}
.guesses.before { flex-direction: column-reverse; }

.guess {
  margin: 0;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--font-color);
  line-height: 1.16;
  white-space: nowrap;
  transition: font-size 0.4s cubic-bezier(0.22, 0.9, 0.24, 1), opacity 0.4s ease, padding 0.4s cubic-bezier(0.22, 0.9, 0.24, 1);
}
.guess .gp { color: var(--green); transition: color 0.3s ease; }
.guess .ge { color: var(--muted); }
.guess.d0 { font-size: 40px; padding: 4px 0; opacity: 1; }
.guess.d1 { font-size: 32px; padding: 3px 0; opacity: 0.72; }
.guess.d2 { font-size: 26px; padding: 2px 0; opacity: 0.52; }
.guess.d3 { font-size: 21px; padding: 1px 0; opacity: 0.38; }
.guess.d4 { font-size: 17px; padding: 1px 0; opacity: 0.26; }

.guess.enter-below { animation: rowInBelow 0.52s cubic-bezier(0.16, 1.1, 0.3, 1) both; }
.guess.enter-above { animation: rowInAbove 0.52s cubic-bezier(0.16, 1.1, 0.3, 1) both; }

@keyframes rowInBelow {
  from { opacity: 0; transform: translateY(34px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes rowInAbove {
  from { opacity: 0; transform: translateY(-34px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.guess-ghost {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  margin: 0;
  text-align: center;
  font-family: var(--font-game);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--font-color);
  white-space: nowrap;
}

.guess-form {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  margin: 0;
}
.rule { height: 1px; flex: 1; background: var(--gold); opacity: 0.45; transition: background-color 0.3s ease; }
.guess-input {
  width: 16ch;
  min-width: 0;
  flex-shrink: 0;
  border: 0;
  border-radius: 13px;
  background: var(--surface);
  padding: 10px 16px;
  text-align: center;
  font-family: inherit;
  font-size: 30px;
  font-weight: 700;
  line-height: 40px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--font-color);
  caret-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 1.5px var(--gold);
  transition: color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.guess-input::placeholder { color: var(--muted); opacity: 0.55; font-weight: 700; }
.guess-input:disabled { opacity: 1; -webkit-text-fill-color: var(--font-color); }
.guess-input.won {
  color: var(--green);
  box-shadow: 0 0 0 1.5px var(--green);
  -webkit-text-fill-color: var(--green);
}
.guess-form.checking .guess-input { opacity: 0.62; }
.guess-form.checking .rule { opacity: 0.25; }
.hint {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  font-size: 12px;
  color: var(--muted);
}
.key {
  border: 1px solid var(--surface-3);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 15px;
  color: var(--font-color);
}

.result {
  width: 100%;
  max-width: 430px;
  flex-shrink: 0;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  animation: resultIn 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.05) both;
}
.result[hidden] { display: none; }
.result-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.result-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.result-dot { width: 7px; height: 7px; border-radius: 999px; flex-shrink: 0; background: var(--green); }
.result-dot.lose { background: var(--danger); }
.result-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; letter-spacing: 0.04em; }
.result-sub b { color: var(--font-color); }
@keyframes resultIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--gold);
  color: var(--nav-ink);
  font-size: 14px;
  font-weight: 700;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px 18px;
  border-radius: 10px;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--font-color);
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.15s ease;
}
.btn-ghost:hover { background: var(--surface-2); }

/* ------------------------------- loader ------------------------------- */

.load-screen {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.load-screen.leaving { animation: loadOut 0.45s ease forwards; }
@keyframes loadOut { to { opacity: 0; visibility: hidden; } }

.load-skeleton {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  pointer-events: none;
}
.load-skeleton .stack { display: flex; flex-direction: column; align-items: center; gap: 12px; transform: scale(0.8); }
.load-skeleton .bar { height: 14px; border-radius: 7px; background: var(--surface); }

.load-scrim { position: absolute; inset: 0; background: var(--body-color); opacity: 0.86; }

.load-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}
.load-words { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lw { color: var(--font-color); }
.lw-1 { font-size: 14px; opacity: 0.22; }
.lw-2 { font-size: 18px; font-weight: 500; opacity: 0.5; }

.load-box {
  margin: 4px 0;
  border-radius: 13px;
  background: var(--surface);
  padding: 8px 16px;
  box-shadow: 0 0 0 1.5px var(--gold);
}
.load-typed {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--font-color);
  white-space: nowrap;
}
.load-caret {
  display: inline-block;
  width: 3px;
  height: 22px;
  margin-left: 2px;
  background: var(--gold);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.load-caption { display: flex; flex-direction: column; gap: 8px; text-align: center; }
.load-caption p { margin: 0; }
.load-caption .lc-title { font-size: 17px; font-weight: 700; }
.load-caption .lc-sub { font-size: 12.5px; color: var(--muted); }

.load-error { padding: 24px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.load-error p { margin: 0; color: var(--muted); font-size: 13px; }

/* -------------------------------- modals ------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.55);
  animation: overlayIn 0.2s ease both;
}
.modal-overlay.closing { animation: overlayOut 0.18s ease forwards; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes overlayOut { to { opacity: 0; } }

.modal-panel {
  position: relative;
  width: 520px;
  max-width: 100%;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 20px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  padding: 26px;
  animation: panelIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.05) both;
}
.modal-overlay.closing .modal-panel { animation: panelOut 0.18s ease forwards; }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(12px) scale(0.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes panelOut {
  to { opacity: 0; transform: translateY(8px) scale(0.985); }
}

.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal-head h2 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -0.4px; }
.modal-sub { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.modal-x {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.modal-x:hover { background: var(--surface-3); color: var(--font-color); }
.modal-x:focus, .modal-panel:focus { outline: none; }
.modal-x svg { width: 14px; height: 14px; fill: currentColor; }

.modal-p { margin: 14px 0 0; font-size: 13px; line-height: 1.6; color: var(--muted); }

/* how to play */
.help-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.examples {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.example-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 34px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid var(--surface-3);
  background: var(--surface-2);
}
.example-row .w { font-size: 13px; font-weight: 600; }
.example-row .h { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.example-row.answer {
  justify-content: center;
  background: transparent;
  border: 1px dashed var(--gold);
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.steps li { display: flex; align-items: flex-start; gap: 11px; }
.steps .n {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.steps .t { font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.steps b { color: var(--font-color); font-weight: 700; }

.prefix-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.prefix-card { border: 1px solid var(--hairline); border-radius: 11px; padding: 13px 15px; min-width: 0; }
.prefix-word { font-size: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; line-height: 1.2; }
.prefix-word .gp { color: var(--green); }
.prefix-word .ge { color: var(--muted); }
.prefix-desc { margin-top: 6px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.prefix-desc b { color: var(--font-color); font-weight: 700; }

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 13px 15px;
  border-radius: 11px;
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--font-color);
}
.notice .nd { width: 7px; height: 7px; border-radius: 999px; background: var(--gold); flex-shrink: 0; }

.modal-footer { display: flex; justify-content: flex-end; margin-top: 18px; }

/* settings */
.settings-panel { width: 480px; border-radius: 24px; }
.settings-list { margin-top: 14px; border-top: 1px solid var(--hairline); }
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
}
.setting-title { font-size: 15px; font-weight: 600; }
.setting-desc { margin-top: 2px; font-size: 12px; color: var(--muted); }
.toggle {
  position: relative;
  flex-shrink: 0;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: var(--surface-3);
  transition: background-color 0.2s ease;
}
.toggle .knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
.toggle[aria-checked="true"] { background: var(--green); }
.toggle[aria-checked="true"] .knob { transform: translateX(20px); }

.settings-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
.settings-note { font-size: 11.5px; color: var(--muted); min-width: 0; }
.settings-close {
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 600;
}
.settings-close:hover { background: var(--surface-3); }

/* stats */
.stats-panel { width: 460px; }
.stats-current {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 15px;
  border-radius: 11px;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 500;
}
.stats-current .nd { width: 7px; height: 7px; border-radius: 999px; background: var(--gold); flex-shrink: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.stat-card { padding: 14px; border-radius: 11px; background: var(--surface-2); min-width: 0; }
.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  line-height: 1.35;
}
.stat-value { margin-top: 8px; font-size: 28px; font-weight: 700; line-height: 1; }
.stat-value.gold { color: var(--gold); }
.stats-best { margin-top: 10px; font-size: 12px; color: var(--muted); }
.stats-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.stats-actions .btn-primary { width: 100%; }
.stats-reset {
  margin-top: 14px;
  width: 100%;
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
  padding: 4px 0;
}
.stats-reset:hover { color: var(--danger); }

/* games sheet */
.game-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 11px;
  border: 1px solid var(--hairline);
  margin-top: 10px;
  transition: background-color 0.15s ease;
}
.game-row:hover { background: var(--surface-2); }
.game-row.active { background: var(--surface-2); border-color: var(--gold); }
.game-row .gm-dot { width: 10px; height: 10px; border-radius: 4px; background: var(--gold); flex-shrink: 0; }
.game-row .gm-dot.green { background: var(--green); border-radius: 999px; }
.game-row .gm-dot.orange { background: #e8845f; border-radius: 999px; }
.game-row .gm-name { font-size: 15px; font-weight: 600; }
.game-row .gm-tag { margin-left: auto; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.game-row .gm-arrow { margin-left: auto; color: var(--muted); font-size: 16px; }

/* -------------------------------- toasts ------------------------------- */

.toasts {
  position: fixed;
  top: 99px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 10px;
  border-radius: 999px;
  background: var(--toast-bg);
  border: 1px solid var(--toast-edge);
  box-shadow: var(--toast-shadow);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  font-size: 13px;
  font-weight: 600;
  color: var(--font-color);
  animation: toastIn 0.28s cubic-bezier(0.18, 0.9, 0.32, 1.15) both;
}
.toast.out { animation: toastOut 0.22s ease forwards; }
.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--danger-tint);
  color: var(--danger);
  flex-shrink: 0;
}
.toast-icon svg { width: 11px; height: 11px; fill: currentColor; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px) scale(0.98); } }

/* ------------------------------ responsive ----------------------------- */

@media (max-width: 799px) {
  .header-desktop { display: none; }
  .header-mobile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
  }
  .header-mobile .header-actions { gap: 8px; }
  .header-mobile .icon-btn { width: 40px; height: 40px; }

  .main { padding: 12px 16px 16px; }
  .meta { font-size: 10.5px; letter-spacing: 0.06em; gap: 8px; }
  .meta-right { gap: 8px; }
  .dots { gap: 3px; }
  .dot { width: 7px; height: 7px; }

  .guess.d0 { font-size: 30px; }
  .guess.d1 { font-size: 25px; }
  .guess.d2 { font-size: 20px; }
  .guess.d3 { font-size: 16px; }
  .guess.d4 { font-size: 13px; }

  .guess-input { font-size: 24px; line-height: 32px; padding: 9px 14px; border-radius: 12px; }
  .guess-form { gap: 10px; padding: 13px 0; }
  .hint { font-size: 11.5px; gap: 8px; padding-top: 8px; }

  .toasts { top: 74px; }

  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-panel {
    width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    padding: 22px 20px 26px;
  }
  .modal-panel::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: var(--surface-3);
    margin: 0 auto 14px;
  }
  .settings-panel, .stats-panel { width: 100%; }
  .modal-overlay.closing .modal-panel { animation: sheetOut 0.18s ease forwards; }
  @keyframes sheetOut { to { transform: translateY(100%); opacity: 0.6; } }
  .modal-panel { animation: sheetIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
  @keyframes sheetIn { from { transform: translateY(100%); } to { transform: translateY(0); } }
  .modal-head h2 { font-size: 19px; }
  .prefix-grid { gap: 8px; }
  .prefix-card { padding: 11px 12px; }
  .prefix-word { font-size: 17px; }
  .prefix-desc { font-size: 11.5px; }
  .stat-card { padding: 12px; }
  .stat-value { font-size: 24px; }
  .stat-label { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

