/* WordAKA — plain CSS, mobile first. Colors are tokens; dark mode via prefers-color-scheme. */
:root {
  --paper: #fbf8f3;
  --card: #ffffff;
  --ink: #1d2433;
  --muted: #5f6b7a;
  --line: #e6e1d8;
  --accent: #3b5bdb;
  --accent-ink: #ffffff;
  --accent-soft: #e8edff;
  --good: #2f9e44;
  --warn: #e8590c;
  --gold: #f59f00;
  --tile: #1d2433;
  --tile-ink: #fbf8f3;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(29, 36, 51, .06), 0 4px 16px rgba(29, 36, 51, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121620;
    --card: #1a202c;
    --ink: #e9edf5;
    --muted: #9aa5b5;
    --line: #2a3242;
    --accent: #7c95ff;
    --accent-ink: #0d1220;
    --accent-soft: #232c45;
    --tile: #e9edf5;
    --tile-ink: #121620;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
code { font-family: var(--mono); font-size: .9em; background: var(--accent-soft); padding: .05em .35em; border-radius: 6px; }

/* Layout */
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 20px; padding-bottom: 48px; }
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar .wrap { display: flex; align-items: center; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 1.2rem; color: var(--ink); letter-spacing: -.02em; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a, .nav-right a, .nav-right button { padding: 6px 10px; border-radius: 8px; color: var(--ink); font-weight: 500; }
.nav a:hover, .nav-right a:hover { background: var(--accent-soft); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav-right { display: flex; gap: 4px; align-items: center; }
.badge { display: inline-block; min-width: 1.3em; padding: 0 .35em; border-radius: 99px; background: var(--warn); color: #fff; font-size: .72rem; text-align: center; line-height: 1.3em; vertical-align: top; }
.badge[data-count="0"] { display: none; }
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.subnav a { padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--ink); font-size: .9rem; }
.subnav a.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
footer { color: var(--muted); font-size: .85rem; text-align: center; padding: 24px 16px 40px; }

.grid { display: grid; gap: 16px; }
.play-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .play-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }
.cols-2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .cols-2 { grid-template-columns: 1fr 1fr; } }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card + .card { margin-top: 16px; }
.card.narrow { max-width: 440px; margin: 0 auto; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat b { display: block; font-size: 1.5rem; }
.stat span { color: var(--muted); font-size: .85rem; }

/* Forms */
label { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 4px; }
label.inline { display: inline-flex; gap: 6px; align-items: center; font-weight: 500; margin: 6px 12px 6px 0; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=date], input[type=url], input[type=tel], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 100px; resize: vertical; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--warn); }
.btn.small { padding: 5px 10px; font-size: .85rem; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.htmx-request { opacity: .6; cursor: progress; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.or { text-align: center; color: var(--muted); margin: 14px 0; font-size: .85rem; }
.oauth { display: grid; gap: 8px; }

/* Word tiles */
.word { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.word i { font-style: normal; display: grid; place-items: center; width: 2.4rem; height: 2.6rem; background: var(--tile); color: var(--tile-ink);
  border-radius: 8px; font-weight: 800; font-size: 1.35rem; text-transform: uppercase; }
@media (max-width: 420px) { .word i { width: 1.9rem; height: 2.2rem; font-size: 1.1rem; } }
.kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; color: var(--accent); }

.search { display: flex; gap: 8px; margin: 12px 0 4px; }
.search input { font-size: 1.05rem; }
.searching { display: none; }
.htmx-request .searching { display: block; }
.dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.dots b { width: 10px; height: 10px; border-radius: 99px; background: var(--line); }
.dots b.used { background: var(--accent); }

.score { display: flex; align-items: baseline; gap: 10px; }
.score .big { font-size: 2.6rem; font-weight: 800; line-height: 1; }
.result { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.hits { list-style: none; margin: 8px 0 0; padding: 0; }
.hits li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.hits li:last-child { border-bottom: 0; }
.hits .n { font-weight: 700; font-variant-numeric: tabular-nums; }
.hits .zero { color: var(--muted); }
.history { list-style: none; padding: 0; margin: 0; }
.history li { border-bottom: 1px solid var(--line); padding: 8px 0; }
.history summary { display: flex; justify-content: space-between; gap: 10px; cursor: pointer; list-style: none; }
.history summary::-webkit-details-marker { display: none; }
.history .q { font-weight: 600; overflow-wrap: anywhere; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: .78rem; font-weight: 600; }
.pill.gold { background: #fff3d6; color: #a86a00; }
.pill.warn { background: #ffe8d9; color: var(--warn); }
.pill.good { background: #e3f6e7; color: var(--good); }

/* Ranks & boards */
.ranks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ranks div { text-align: center; padding: 10px 6px; border-radius: 10px; background: var(--accent-soft); }
.ranks b { display: block; font-size: 1.35rem; }
.ranks span { font-size: .78rem; color: var(--muted); }
.tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.tabs button { flex: 1; padding: 6px; border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 8px; font: inherit; font-size: .9rem; cursor: pointer; }
.tabs button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; }
tr.me td { background: var(--accent-soft); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.medal-1 { color: var(--gold); }

/* Lists */
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list li:last-child { border-bottom: 0; }
.empty { color: var(--muted); text-align: center; padding: 20px 0; }
.unread { border-inline-start: 3px solid var(--accent); padding-inline-start: 8px !important; }

.hero { text-align: center; padding: 24px 0 8px; }
.hero h1 { font-size: 2rem; }
.code { font-family: var(--mono); font-size: 1.6rem; font-weight: 800; letter-spacing: .15em; }
.ad-slot { border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); text-align: center; padding: 24px; margin: 16px 0; font-size: .8rem; }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.cal { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cal .day { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--card); min-height: 92px; }
.cal .day.today { outline: 2px solid var(--accent); }
.cal .day.past { opacity: .7; }
.cal .day.empty-day { border-style: dashed; }
.cal .d { font-size: .78rem; color: var(--muted); }
.cal .w { font-weight: 700; display: block; margin: 2px 0; }
.chart-box { position: relative; height: 240px; }
.prose h2 { margin-top: 1.25rem; }
.prose li { margin-bottom: .35rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
@media (max-width: 720px) {
  .topbar .wrap { gap: 4px 12px; padding-top: 6px; padding-bottom: 4px; }
  .nav-right { margin-inline-start: auto; }
  .nav { order: 3; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  .nav a { white-space: nowrap; }
  .hide-sm { display: none; }
}

/* Google sign-in button (follows Google's branding: white/neutral button, color "G" on the left). */
.btn-google { background: #fff; color: #1f1f1f; border-color: #747775; gap: 10px; font-weight: 500; }
.btn-google:hover { background: #f8f9fa; border-color: #1f1f1f; }
.btn-google .google-logo { flex: none; }
@media (prefers-color-scheme: dark) {
  .btn-google { background: #131314; color: #e3e3e3; border-color: #8e918f; }
  .btn-google:hover { background: #1f1f20; border-color: #e3e3e3; }
}

/* Party progress bar */
.progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 8px 0 14px; }
.progress b { display: block; height: 100%; background: var(--good); transition: width .4s; }
.progress.big { height: 14px; }

/* Party big screen (TV / projector): large type, no chrome, scales with the viewport. */
main.screen { box-sizing: border-box; padding: 2vh 3vw; min-height: 100vh; font-size: clamp(16px, 1.6vw, 34px); }
.screen-tools { position: fixed; inset-inline-end: 12px; bottom: 12px; opacity: .35; z-index: 5; }
.screen-tools:hover { opacity: 1; }
:fullscreen .screen-tools { display: none; }
.screen-head { display: flex; justify-content: space-between; align-items: baseline; gap: 2vw; flex-wrap: wrap; margin-bottom: 2vh; }
.screen-head .logo { font-size: 1.6em; }
.screen-join { color: var(--muted); }
.screen-join .code { font-size: 1.1em; color: var(--ink); }
.screen h2 { font-size: 1.2em; }
.screen .kicker { font-size: .8em; }
.screen .card { padding: 1.2em; }
.screen-lobby { display: grid; grid-template-columns: 1fr 1fr; gap: 4vw; align-items: center; min-height: 70vh; }
.screen-code { font-family: var(--mono); font-weight: 800; letter-spacing: .12em; font-size: clamp(48px, 9vw, 200px); line-height: 1; margin: 1vh 0; }
.screen-sub { color: var(--muted); font-size: 1.1em; }
.qr { width: min(32vh, 30vw); background: #fff; border-radius: 12px; padding: 8px; }
.qr svg { display: block; width: 100%; height: auto; }
.screen-names { list-style: none; padding: 0; margin: 0 0 2vh; display: flex; flex-wrap: wrap; gap: .5em; }
.screen-names li { background: var(--accent-soft); border-radius: 99px; padding: .25em .8em; font-weight: 600; }
.screen-round { text-align: center; margin-bottom: 2vh; }
.screen-word { justify-content: center; margin: 1.5vh 0; }
.screen-word i { width: clamp(44px, 7vw, 150px); height: clamp(50px, 8vw, 170px); font-size: clamp(28px, 5vw, 110px); border-radius: .18em; }
.screen-meta { display: flex; gap: 2vw; font-size: 1.3em; }
.screen-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2vw; align-items: start; }
.screen-grid > div > .card + .card { margin-top: 2vh; }
.screen-table td { padding: .35em .4em; font-size: 1em; }
.screen-table .rank { width: 2.2em; color: var(--muted); }
.screen-table code { font-size: .85em; }
.screen-table td.dotcell { width: 1%; white-space: nowrap; padding-inline-end: 1em; }
.screen-table .dots b { width: .55em; height: .55em; }
.screen-final { text-align: center; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 2vw; margin: 3vh 0 4vh; }
.place { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5vh 2vw; min-width: 18vw; box-shadow: var(--shadow); }
.place-1 { order: 2; padding-top: 5vh; padding-bottom: 5vh; }
.place-2 { order: 1; padding-top: 3vh; padding-bottom: 3vh; }
.place-3 { order: 3; }
.place .medal { font-size: 2.5em; }
.place .name { font-weight: 700; font-size: 1.2em; }
.place .pts { font-size: 2em; font-weight: 800; }
.screen-final .screen-grid { text-align: start; }
@media (max-width: 800px) { .screen-lobby, .screen-grid { grid-template-columns: 1fr; } }

/* Party: round results shown during the break between rounds */
.round-results { border: 2px solid var(--accent); }
.round-results .next-in { font-size: 1.1rem; }
.round-results .next-in b { font-size: 1.4rem; font-variant-numeric: tabular-nums; }

/* Right-to-left (Hebrew) */
.party-code-box { text-align: end; }
.lang-switch { font-weight: 600; }
[dir="rtl"] body { font-family: "Rubik", "Assistant", "Segoe UI", "Arial Hebrew", system-ui, sans-serif; }
[dir="rtl"] .search input { text-align: right; }
[dir="rtl"] .search input:placeholder-shown { direction: rtl; }
/* Arrows in link text read naturally in both directions. */
[dir="rtl"] .pager, [dir="rtl"] .subnav { direction: rtl; }

/* SweetAlert2 inputs: the global `input { width: 100% }` plus Swal's 2em side
   margins made prompt fields overflow the dialog. Fit them inside instead. */
.swal2-popup .swal2-input,
.swal2-popup .swal2-textarea,
.swal2-popup .swal2-select {
  box-sizing: border-box;
  width: calc(100% - 4em);
  max-width: calc(100% - 4em);
  margin-inline: 2em;
}
.swal2-popup .swal2-input[type=number] { width: 10em; max-width: calc(100% - 4em); justify-self: center; text-align: center; }
.swal2-popup .swal2-textarea { min-height: 16em; font-family: var(--mono); font-size: .85rem; }
@media (max-width: 480px) {
  .swal2-popup .swal2-input, .swal2-popup .swal2-textarea, .swal2-popup .swal2-select {
    width: calc(100% - 2em); max-width: calc(100% - 2em); margin-inline: 1em;
  }
}

/* Groups: per-group ranks under the rank summary, and group chips on leaderboards */
.group-ranks { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.group-ranks li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 8px; border-radius: 8px; background: var(--paper); font-size: .92rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 10px; }
.chip { border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 99px; padding: 3px 10px; font: inherit; font-size: .85rem; cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.member-list .you { font-weight: 700; }

/* Phrase targets: a gap between the words' tiles; the search behind the best score */
.word i.gap { background: none; width: .7em; }
.best-query { color: var(--muted); }
.best-query .q { font-weight: 600; color: var(--ink); }

/* Monospace fonts space Hebrew letters out badly: show code-styled text in the page font when right-to-left. */
[dir="rtl"] code, code:lang(he) { font-family: inherit; }

/* Public nickname availability */
.nick-status { min-height: 1.4em; margin: 4px 0; font-size: .9rem; }
.nick-status .good { color: var(--good); }
.nick-status .bad { color: var(--warn); }
.nick-suggest { gap: 6px; margin-top: 4px; align-items: center; flex-wrap: wrap; }

/* ---- Phone layout -------------------------------------------------------- */
/* Play / Ranking tabs (only with JS, only when the play grid is one column). */
.view-tabs { display: none; }
@media (max-width: 899px) {
  .js .view-tabs { display: flex; gap: 6px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    position: sticky; top: 64px; z-index: 5; }
  .js .view-tabs button { flex: 1; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 600; padding: 8px; border-radius: 9px; cursor: pointer; }
  .js .view-tabs button.on { background: var(--accent); color: var(--accent-ink); }
  .js .play-grid[data-view="play"] > [data-pane="rank"],
  .js .play-grid[data-view="rank"] > [data-pane="play"] { display: none; }
}
.rank-badge:empty { display: none; }
.rank-badge { display: inline-block; padding: 0 .4em; margin-inline-start: 4px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: .85em; }
.view-tabs button.on .rank-badge { background: rgba(255, 255, 255, .25); color: inherit; }
.rank-badge.pulse { animation: rank-pulse 1.2s ease-out 2; }
@keyframes rank-pulse { 0% { transform: scale(1); } 30% { transform: scale(1.35); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .rank-badge.pulse { animation: none; } }

/* Collapsible sections (open on wide screens via app.js). */
details.more > summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .9rem; margin-top: 8px; list-style-position: inside; }
details.card.more > summary { color: var(--ink); margin-top: 0; }
details.card.more > summary h2 { display: inline; }
details.card.more[open] > summary { margin-bottom: 8px; }
.hint { font-size: .9rem; margin: 8px 0 0; }

/* Bottom tab bar (phones). */
.tabbar { display: none; }
@media (max-width: 720px) {
  .tabbar { display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 20; background: var(--card); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 10px rgba(0, 0, 0, .06); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px 7px; color: var(--muted);
    font-size: .72rem; font-weight: 600; text-decoration: none; }
  .tabbar a span { font-size: 1.25rem; line-height: 1.2; }
  .tabbar a.active { color: var(--accent); }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .topbar .wrap { min-height: 48px; padding-top: 0; padding-bottom: 0; }
  .js .view-tabs { top: 56px; }
}
@media (max-width: 480px) {
  main.wrap { padding-top: 12px; }
  .card { padding: 12px; }
  .card + .card { margin-top: 12px; }
  .play-grid { gap: 12px; }
  .score .big { font-size: 2.1rem; }
  footer { padding-bottom: 16px; }
}

/* The "Me" page. */
.menu { list-style: none; margin: 12px 0 0; padding: 0; }
.menu li { border-top: 1px solid var(--line); }
.menu li > a { display: flex; gap: 8px; align-items: center; padding: 12px 4px; color: var(--ink); font-weight: 500; }
.menu li.langs { display: flex; gap: 8px; align-items: center; padding: 10px 4px; flex-wrap: wrap; }

/* Analytics consent bar (sits above the phone tab bar). */
.consent { position: fixed; inset-inline: 16px; bottom: 16px; z-index: 30; max-width: 560px; margin-inline: auto; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0, 0, 0, .15); padding: 12px 14px; font-size: .9rem; }
.consent p { margin: 0 0 8px; }
@media (max-width: 720px) { .consent { bottom: calc(72px + env(safe-area-inset-bottom)); } }

/* Contact form honeypot, admin messages */
.hp { position: absolute; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }
.msg { white-space: pre-wrap; margin: 10px 0; }

/* Big-screen pairing (/tv) */
.tv-pair { min-height: calc(100vh - 4vh); box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 8px 24px 84px; }
:fullscreen .tv-pair, .no-fs .tv-pair { padding-bottom: 8px; }
.tv-logo { font-size: clamp(2rem, 5vw, 3.5rem); }
.tv-code { font-size: clamp(4rem, 16vw, 11rem); font-weight: 800; letter-spacing: .08em; line-height: 1; font-variant-numeric: tabular-nums;
  background: var(--card); border: 2px solid var(--line); border-radius: 24px; padding: .15em .4em; }
.tv-steps { text-align: start; font-size: clamp(1rem, 2.4vw, 1.6rem); margin: 8px 0; }
.tv-steps li { margin: 6px 0; }

/* Prompt dialogs: long labels and addresses wrap instead of overflowing. */
.swal2-popup .swal2-input-label { flex-wrap: wrap; text-align: center; margin-inline: 1.5em; overflow-wrap: anywhere; }
.swal2-popup .swal-prompt-text { margin: 0 0 .4em; }
.swal2-popup .swal-prompt-hint { margin: 0; font-weight: 700; color: var(--accent); overflow-wrap: anywhere; }

/* Big screens: an obvious full-screen button; hidden once full screen (or where it's unsupported). */
.fs-hint { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 6; display: inline-flex; gap: .5em; align-items: baseline;
  padding: .6em 1.2em; border: 0; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700;
  font-size: clamp(16px, 1.4vw, 28px); cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); animation: fs-pulse 2.4s ease-in-out 3; }
.fs-hint small { font-weight: 500; color: inherit; opacity: .85; }
:fullscreen .fs-hint, .no-fs .fs-hint { display: none; }
@keyframes fs-pulse { 50% { transform: translateX(-50%) scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .fs-hint { animation: none; } }
html:has(.tv-pair) { overflow: hidden; } /* the pairing page always fits one screen */
.notice { background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; }
.screen-note { font-size: .7em; margin: .3em 0 .8em; }

/* Spinner while a search runs (the form gets .htmx-request from hx-indicator="this"). */
.spinner { display: inline-block; width: 1em; height: 1em; border: .16em solid currentColor; border-inline-end-color: transparent;
  border-radius: 50%; vertical-align: -.15em; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 1.6s; } }
.search .btn { position: relative; }
.search .btn .spinner { display: none; position: absolute; inset: 0; margin: auto; }
.search-form.htmx-request .search .btn .spinner { display: block; }
.search-form.htmx-request .search .btn .btn-label { visibility: hidden; }
.search-form.htmx-request input { opacity: .7; }

/* Search box clear button: at the page's end side (left in Hebrew, right in English). */
.search-field { position: relative; flex: 1; min-width: 0; }
.search-field input { width: 100%; }
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
[dir="ltr"] .search-field input { padding-right: 2.4em; }
[dir="rtl"] .search-field input { padding-left: 2.4em; }
.search-clear { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 1.8em; height: 1.8em;
  border: 0; border-radius: 50%; background: var(--line); color: var(--ink); font: inherit; font-size: .8rem; line-height: 1; cursor: pointer; }
.search-clear:hover { background: var(--accent-soft); color: var(--accent); }

.word-check { margin-top: 10px; }
.word-check ul { margin: 6px 0 8px; padding-inline-start: 1.2em; }

/* Admin danger zone */
.danger-zone { border-color: var(--warn); }
.danger-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.danger-row .btn { flex: none; }
@media (max-width: 600px) { .danger-row { flex-direction: column; align-items: stretch; } }

/* Admin: language of the managed words (separate from the interface language). */
.word-lang { align-items: center; margin-top: -8px; }
.word-lang .muted { font-size: .85rem; margin-inline-end: 4px; }

/* Pricing */
.pricing-head { text-align: center; max-width: 640px; margin: 0 auto 16px; }
.pricing { display: grid; gap: 16px; grid-template-columns: 1fr; max-width: 1000px; margin: 0 auto; }
@media (min-width: 860px) { .pricing { grid-template-columns: repeat(3, 1fr); align-items: stretch; } .pricing .card + .card { margin-top: 0; } }
.plan { display: flex; flex-direction: column; }
.plan .price { font-size: 2rem; font-weight: 800; margin: 4px 0; }
.plan ul { list-style: none; padding: 0; margin: 8px 0 16px; flex: 1; }
.plan li { padding: 4px 0; }
.plan.featured { border: 2px solid var(--accent); }

/* Language menu in the phone top bar */
.show-sm { display: none; }
@media (max-width: 720px) { .show-sm { display: block; } }
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; cursor: pointer; padding: 6px 8px; border-radius: 8px; font-weight: 600; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary span { text-transform: uppercase; font-size: .85rem; }
.lang-menu[open] summary { background: var(--accent-soft); }
.lang-list { position: absolute; inset-inline-end: 0; top: calc(100% + 4px); z-index: 30; display: grid; min-width: 150px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .15); padding: 4px; }
.lang-list a { padding: 10px 12px; border-radius: 8px; color: var(--ink); }
.lang-list a.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.other-langs a { margin-inline-end: 6px; }

/* Stats and streaks */
.stats-page { max-width: 820px; margin: 0 auto; }
.big-stats { margin-bottom: 16px; }
.big-stats .stat.streak b { color: var(--warn); }
.streak-line { margin: -4px 0 8px; font-weight: 600; }
.streak-line a { text-decoration: none; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; margin: 8px 0; }
.bar { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bar i { display: block; width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; }
.bar.missed i { background: var(--line); }
.save-card { margin-top: 16px; border-color: var(--accent); }
