/* =========================================================================
   Worduel — app styles

   Built straight off design/index.html. The rules that matter and why:

   * the landing is ONE screen tall, never scrolls, and splits into header /
     middle / bottom, with a single 1px full-bleed divider above the controls
   * every full-bleed divider (landing bottom, timer bar, keyboard top) is done
     with a negative margin that cancels the screen padding, then pays it back
   * exactly one coral button per screen, and it is always the one that moves
     the player forward: Play on the landing, Enter on the keyboard
   * flags and avatars are inline SVG, never emoji: Windows has no glyphs for
     regional indicators and prints the letters GB and ES instead
   ========================================================================= */
:root {
  --rausch: #ff385c;
  --rausch-dark: #e0314f;
  --rausch-soft: #fff0f3;
  --ink: #222;
  --ink-2: #484848;
  --muted: #717171;
  --line: #ddd;
  --line-2: #ebebeb;
  --bg: #fff;
  --bg-soft: #f7f7f7;
  --green: #2eb872;
  --yellow: #f5b14c;
  --absent: #9aa0a6;
  --tile-empty: #d9dce1;
  --amber: #f59e0b;
  --amber-dark: #d97706;
  --amber-soft: #fff7ea;
  --graphite: #3a3f47;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .08);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, .12);
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --app-w: 460px;
  --pad: 18px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg-soft);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}

button, input, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* The app is a phone-width column, centered and framed on anything wider.
   Centring is done with align-items on the column, NOT with margin-inline:auto
   on the children: an auto side margin on a flex item cancels the stretch and
   collapses it to its content width, which squeezed the header to 221px on a
   390px phone and pushed it into the middle of the screen. */
body { align-items: center; }
body > main, body > header, body > .appbar, body > .sheetb, body > .npsheet, body > .picksheet {
  width: 100%;
  max-width: var(--app-w);
}
/* The sheets and the auth screen are fixed, so they are out of the flex flow
   and do still need auto margins to sit in the middle. */
body > .sheetb, body > .npsheet, body > .picksheet, body > .screen.auth {
  margin-inline: auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  max-width: var(--app-w);
  margin-inline: auto;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line-2);
  z-index: -1;
}

/* --------------------------- Launch screen ----------------------------- */
/* Coral edge to edge, white lock-up in the middle, nothing else. It lasts
   exactly as long as the boot does, never a second longer. */
.launch {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--rausch);
  display: grid;
  place-items: center;
  transition: opacity .25s ease;
}
.launch img { width: 52%; max-width: 230px; height: auto; display: block; margin-bottom: 4%; }
.launch.gone { opacity: 0; pointer-events: none; }

/* --------------------------- Shared header ----------------------------- */
/* The same row on the landing, matchmaking, sign-in and account: streak,
   rating, avatar. Your state should not vanish when you change screen. */
.app-hd {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(12px + var(--safe-t)) 16px 12px;
  border-bottom: 1px solid var(--line-2);
  background: var(--bg);
  flex: 0 0 auto;
}
.hd-left { display: flex; align-items: center; gap: 8px; }

/* ------------------------- App offer, iPhone only ----------------------- */
/* Sits in the column flow under the header, so it pushes the screen down
   instead of covering anything. Same width cap as the header and main. */
.appbar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px 9px 14px;
  border-bottom: 1px solid var(--line-2);
  background: var(--bg-soft);
}
.ab-icon { width: 34px; height: 34px; border-radius: 8px; flex: 0 0 auto; box-shadow: var(--shadow-sm); }
.ab-txt {
  flex: 1 1 auto; min-width: 0;
  font-size: 13px; line-height: 1.3; color: var(--muted);
}
.ab-get {
  flex: 0 0 auto;
  padding: 6px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 800; text-decoration: none;
  background: var(--rausch); color: #fff;
}
.ab-x {
  flex: 0 0 auto;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; color: var(--muted);
  background: none; border: none;
}

.streak-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px 6px 10px; border-radius: 999px;
  font-weight: 800; font-size: 14px;
  background: linear-gradient(135deg, #ffedd0, #ffe0b0);
  color: var(--amber-dark); border: 1px solid #f4d59a; box-shadow: var(--shadow-sm);
}
.streak-pill .fl { font-size: 15px; filter: drop-shadow(0 1px 1px rgba(217, 119, 6, .35)); }
/* at risk: played yesterday, not yet today */
.streak-pill.risk {
  background: #fff; border: 1.5px dashed var(--amber);
  animation: st-pulse 1.4s ease-in-out infinite;
}
/* burned out, or never started */
.streak-pill.off { background: var(--bg-soft); color: var(--muted); border-color: var(--line); }
.streak-pill.off .fl { filter: grayscale(1) opacity(.6); }
@keyframes st-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .45); }
  50% { box-shadow: 0 0 0 7px rgba(245, 158, 11, 0); }
}

.rating-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 13px; border-radius: 999px; font-weight: 800; font-size: 14px;
  background: var(--rausch-soft); color: var(--rausch-dark);
  border: 1px solid #ffd3dc; box-shadow: var(--shadow-sm);
  font-variant-numeric: tabular-nums;
}
/* Until the real rating arrives the pill shimmers instead of claiming 500 */
.rating-pill.loading #rating-n {
  display: inline-block; width: 28px; height: 11px; border-radius: 4px;
  background: linear-gradient(90deg, #ffd3dc, #fff6f8, #ffd3dc);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* --------------------------- Avatars and flags -------------------------- */
.av {
  display: inline-block; flex: 0 0 auto;
  width: 36px; height: 36px; border-radius: 50%;
  overflow: hidden; background: var(--bg-soft); box-shadow: 0 0 0 1px rgba(0, 0, 0, .09);
  padding: 0;
}
.av svg { display: block; width: 100%; height: 100%; }
.av.xl { display: block; width: 84px; height: 84px; margin: 0 auto 10px; }
.av-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 11px; margin: 14px 0 10px; }
.av-grid .av { width: 100%; height: auto; aspect-ratio: 1 / 1; }
.av-grid .av.sel { box-shadow: 0 0 0 2.5px var(--rausch); }

.fg {
  display: inline-block; flex: 0 0 auto;
  width: 21px; height: 14px; border-radius: 3px; overflow: hidden;
  vertical-align: -2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
}
.fg svg { display: block; width: 100%; height: 100%; }

/* --------------------------- Screens ----------------------------------- */
main {
  position: relative;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.app-hd + main, main.with-hd { height: auto; flex: 1 1 auto; min-height: 0; }
body { display: flex; flex-direction: column; }
body > main { flex: 1 1 auto; min-height: 0; height: auto; }

.screen { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

/* --------------------------- Landing ----------------------------------- */
.lnd { padding: 0 20px calc(18px + var(--safe-b)); }
.lnd-mid {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 13px;
}
.lnd-brand { width: 176px; max-width: 54%; height: auto; display: block; }
.lnd-copy { font-size: 14.5px; line-height: 1.5; color: var(--muted); max-width: 320px; }
.lnd-bottom { flex: 0 0 auto; display: flex; flex-direction: column; gap: 16px; }

/* One divider, full bleed, then the pair of controls sits on the button grid.
   The negative margin kills the screen padding, the padding puts it back. */
.picker-row {
  display: flex; align-items: center;
  margin: 0 -20px; padding: 16px 20px 0;
  border-top: 1px solid var(--line-2);
}
.picker {
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 15.5px; letter-spacing: -.015em;
  color: var(--ink); white-space: nowrap; padding: 4px 0;
}
.picker .pick-ico { font-size: 16px; }
.caret {
  flex: 0 0 auto; width: 6.5px; height: 6.5px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  border-radius: 1px; transform: translateY(-2.5px) rotate(45deg);
}
.pk-div { flex: 0 0 auto; width: 1px; height: 26px; background: var(--line-2); }
/* crossword.kz plays one language, so the divider and the right half go away */
.picker-row.single .picker { flex: 0 1 auto; margin-inline: auto; }

.btn-play {
  display: block; width: 100%;
  padding: 18px 20px; border-radius: var(--r-md);
  background: var(--rausch); color: #fff;
  font-weight: 800; font-size: 18px; letter-spacing: -.015em;
  box-shadow: 0 9px 22px rgba(255, 56, 92, .34);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-play:active { transform: translateY(1px) scale(.995); box-shadow: 0 5px 14px rgba(255, 56, 92, .3); }

/* --------------------------- Matchmaking -------------------------------- */
.mm {
  align-items: center; justify-content: center; text-align: center;
  padding: 20px 20px calc(20px + var(--safe-b));
}
.mm-tag {
  display: inline-block; padding: 6px 15px; border-radius: 999px;
  background: var(--rausch-soft); color: var(--rausch-dark);
  font-weight: 700; font-size: 12px; margin-bottom: 16px;
}
.mm-status { font-size: 24px; font-weight: 800; letter-spacing: -.02em; min-height: 1.2em; }
.mm-arena { display: flex; align-items: center; justify-content: center; gap: 24px; margin: 34px 0 28px; }
.mm-p { display: flex; flex-direction: column; align-items: center; gap: 9px; min-width: 80px; }
.mm-av {
  width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; font-weight: 800; font-size: 24px; color: #fff;
  background: linear-gradient(135deg, #5b6470, #828b97);
}
.mm-av svg { display: block; width: 100%; height: 100%; }
.mm-av.opp.searching { animation: mm-blink 1.1s ease-in-out infinite; }
@keyframes mm-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.mm-nm {
  display: inline-flex; align-items: center; gap: 5px;
  font-weight: 600; font-size: 13px; color: var(--ink-2);
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mm-mid { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.mm-radar { position: relative; width: 54px; height: 54px; display: grid; place-items: center; }
.mm-core { width: 14px; height: 14px; border-radius: 50%; background: var(--rausch); z-index: 1; }
.mm-radar::before, .mm-radar::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--rausch); animation: mm-radar 1.6s ease-out infinite;
}
.mm-radar::after { animation-delay: .8s; }
@keyframes mm-radar { 0% { transform: scale(.35); opacity: .85; } 100% { transform: scale(1.4); opacity: 0; } }
.mm.found .mm-radar::before, .mm.found .mm-radar::after { animation: none; opacity: 0; }
.mm.found .mm-core { background: var(--green); }
.mm.found .mm-av.opp { animation: none; }
.mm-timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 16px; color: var(--muted); }
.ghost {
  margin: 20px auto 0; display: block; padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--line); font-weight: 600; font-size: 14px;
  color: var(--ink-2); background: #fff;
}

/* --------------------------- Game -------------------------------------- */
.game { padding: calc(14px + var(--safe-t)) 14px calc(12px + var(--safe-b)); }

.gtop { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex: 0 0 auto; }
.mode-tag { padding: 9px 16px; border-radius: 999px; background: var(--rausch-soft); color: var(--rausch-dark); font-weight: 700; font-size: 15px; }
.qbtn { padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line); font-weight: 600; font-size: 14px; color: var(--ink-2); background: #fff; }

.dtop { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex: 0 0 auto; }
.dvs { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 0; }
/* Both sides share the row evenly and truncate on their own side. Without a
   flex basis they size to their content, and a long opponent name simply ran
   over the VS and into your own name. */
.dp { flex: 1 1 0; display: flex; align-items: center; gap: 8px; min-width: 0; }
.dp.you { flex-direction: row-reverse; }
.dp .av { width: 32px; height: 32px; }
/* whose turn is never written out: the ring around the active avatar and the
   colour of the timer bar say it, and the board says it again */
.dp.act .av { box-shadow: 0 0 0 2.5px var(--absent); }
.dp.you.act .av { box-shadow: 0 0 0 2.5px var(--rausch); }
/* takes whatever the avatar leaves, so the name row is bounded and can
   actually truncate instead of spilling out over the VS */
.dp-i { flex: 1 1 0; display: flex; flex-direction: column; gap: 5px; min-width: 0; max-width: 100%; }
.dp.you .dp-i { align-items: flex-end; }
.dp-n {
  display: flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%;
  font-weight: 700; font-size: 12.5px; color: var(--ink-2); white-space: nowrap;
}
/* the flag keeps its size, the name is what gives way */
.dp-n > span:not(.fg) { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dp-vs { flex: 0 0 auto; }
.dp.you .dp-n { color: var(--rausch-dark); }
.dp-vs { flex: 0 0 auto; font-weight: 800; color: #c4c4c4; font-size: 10.5px; letter-spacing: .06em; }

/* skips: three ticks, green while in hand, grey once spent */
.pips { display: flex; gap: 4px; }
.pip { width: 15px; height: 4px; border-radius: 2px; background: var(--green); }
.pip.spent { background: var(--line); }

.qx {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-size: 14px; line-height: 1; display: grid; place-items: center; box-shadow: var(--shadow-sm);
}

/* one bar, full bleed, no digits: the exact second never mattered */
.tbar { position: relative; height: 6px; background: var(--line-2); margin: 0 -14px 12px; overflow: hidden; flex: 0 0 auto; }
.tf { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 3px 3px 0; background: var(--absent); width: 100%; }
.tbar.you .tf { background: var(--rausch); }
.tbar.warn .tf { background: var(--rausch-dark); animation: tb-pulse .9s ease-in-out infinite; }
@keyframes tb-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.board-wrap { flex: 1 1 auto; min-height: 0; display: flex; justify-content: center; align-items: flex-start; overflow: hidden; padding: 2px 0 8px; }
.board-wrap.up { align-items: flex-end; }
.board { display: flex; flex-direction: column; gap: 7px; width: 100%; max-width: 340px; }
.grow { display: flex; align-items: center; justify-content: center; gap: 8px; }
.ava-slot { flex: 0 0 32px; width: 32px; height: 32px; display: grid; place-items: center; }
.grow .row { flex: 1 1 auto; max-width: 300px; }
.ava { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; opacity: .5; }
.ava svg { display: block; width: 100%; height: 100%; }
.grow.active .ava { opacity: 1; }
.grow.active .ava.player { box-shadow: 0 0 0 4px rgba(255, 56, 92, .18); }
.grow.active .ava.bot { box-shadow: 0 0 0 4px rgba(120, 130, 145, .18); }

.row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tile {
  aspect-ratio: 1 / 1; display: grid; place-items: center;
  border: 2px solid var(--tile-empty); border-radius: 9px;
  font-weight: 700; font-size: clamp(20px, 6.5vw, 28px); text-transform: uppercase;
  color: var(--ink); background: #fff;
}
.tile.filled { border-color: var(--muted); animation: pop .1s ease; }
@keyframes pop { 0% { transform: scale(.94); } 100% { transform: scale(1); } }
.tile.g { background: var(--green); border-color: var(--green); color: #fff; }
.tile.y { background: var(--yellow); border-color: var(--yellow); color: #fff; }
.tile.x { background: var(--absent); border-color: var(--absent); color: #fff; }
.tile.flip { animation: flip .55s ease forwards; }
@keyframes flip {
  0% { transform: rotateX(0); }
  50% { transform: rotateX(90deg); }
  100% { transform: rotateX(0); }
}
.row.shake { animation: shake .4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.toast-row { min-height: 18px; text-align: center; margin: 6px 0 8px; flex: 0 0 auto; }
.toast { font-weight: 600; font-size: 13px; color: var(--ink); opacity: 0; transition: opacity .18s ease; }
.toast.show { opacity: 1; }

/* --------------------------- Keyboard ----------------------------------- */
/* Always cut off from the board by one full-bleed line, so the eye splits the
   screen into "where I play" and "what I type with". */
.kb {
  display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto;
  margin: 0 -14px; padding: 12px 14px 0; border-top: 1px solid var(--line-2);
}
.kb.lock { opacity: .45; pointer-events: none; }
.kb-row { display: flex; gap: 5px; justify-content: center; }
/* key width is pinned to the ten-key top row so short rows stay centered
   instead of stretching to fill */
.key {
  flex: 0 0 var(--key-w, 31.7px); height: 46px; border-radius: 8px;
  background: #eceef1; color: var(--ink);
  font-weight: 700; font-size: 14px; text-transform: uppercase;
  display: grid; place-items: center; box-shadow: 0 2px 0 rgba(0, 0, 0, .12);
  padding: 0;
}
.key:active { transform: translateY(1px); box-shadow: none; }
/* the bottom row is the action row: Enter is a button, not a letter */
.kb-act { gap: 8px; margin-top: 4px; }
.key.enter {
  flex: 1 1 auto; height: 54px; background: var(--rausch); color: #fff;
  font-size: 15.5px; font-weight: 800; letter-spacing: .04em; text-transform: none;
  box-shadow: 0 3px 0 var(--rausch-dark);
}
.key.back { flex: 0 0 78px; height: 54px; }
.key.g { background: var(--green); color: #fff; box-shadow: 0 2px 0 #239a5b; }
.key.y { background: var(--yellow); color: #fff; box-shadow: 0 2px 0 #d8973a; }
.key.x { background: var(--absent); color: #fff; box-shadow: 0 2px 0 #7d838a; }
.key svg { width: 20px; height: 20px; }

/* --------------------------- Sheets ------------------------------------- */
.veil { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); backdrop-filter: blur(2px); z-index: 8; }

.sheetb, .npsheet, .picksheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9;
  background: #fff; border-radius: 24px 24px 0 0;
  box-shadow: 0 -12px 44px rgba(0, 0, 0, .22);
  animation: rise .3s cubic-bezier(.2, .8, .3, 1);
}
@keyframes rise { from { transform: translateY(18px); opacity: .4; } to { transform: none; opacity: 1; } }

/* Result: a sheet that takes almost the whole screen, because there is
   something to read now, not just three numbers and a button. */
.sheetb { top: 58px; display: flex; flex-direction: column; overflow: hidden; }
.rb-band { flex: 0 0 auto; padding: 12px 20px 22px; text-align: center; color: #fff; background: var(--green); }
.rb-band.lose { background: var(--graphite); }
.rb-grab, .np-grab { display: block; width: 40px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .45); margin: 0 auto 16px; }
.npsheet .np-grab, .picksheet .np-grab { background: var(--line); margin-bottom: 18px; }
.rb-title { font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.rb-sub { font-size: 13.5px; opacity: .82; margin-top: 4px; }
.rb-score { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 17px; }
.rb-rate { font-weight: 800; font-size: 27px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.rb-delta { padding: 6px 13px; border-radius: 999px; background: rgba(255, 255, 255, .22); font-weight: 800; font-size: 14px; }
.rb-pips { display: flex; gap: 5px; }
.rb-pip { width: 12px; height: 12px; border-radius: 3px; background: rgba(255, 255, 255, .28); }
.rb-pip.on { background: #fff; }

.rb-body { flex: 1 1 auto; display: flex; flex-direction: column; padding: 20px 20px calc(20px + var(--safe-b)); overflow-y: auto; }
.rb-wordrow { display: flex; align-items: flex-end; gap: 13px; }
.rb-word { flex: 0 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; width: 232px; }
.rb-word .tile { font-size: 21px; border-radius: 8px; }
.rb-word .tile.ans { background: var(--graphite); border-color: var(--graphite); color: #fff; }
.rb-pos { flex: 1 1 auto; min-width: 0; font-size: 12.5px; font-weight: 700; color: var(--muted); padding-bottom: 5px; }
/* only shown when the word language differs from the interface language */
.rb-lang { margin-top: 10px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.rb-lang b { color: var(--ink-2); }
.rb-def { margin-top: 13px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.rb-ex { list-style: none; margin-top: 17px; display: flex; flex-direction: column; gap: 12px; }
.rb-ex li { position: relative; padding-left: 21px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); font-style: italic; }
.rb-ex li::before {
  content: "\201C"; position: absolute; left: 0; top: -3px;
  font-size: 24px; line-height: 1; color: var(--rausch); font-style: normal; font-weight: 800;
}

/* the streak lives inside the result, there is no second modal after it */
.rb-streak { flex: 0 0 auto; margin-top: 18px; padding: 14px 14px 12px; border-radius: var(--r-md); background: var(--amber-soft); border: 1px solid #f6dfa8; }
.rbs-head { display: flex; align-items: center; gap: 11px; }
.rbs-fire { flex: 0 0 auto; font-size: 25px; filter: drop-shadow(0 2px 4px rgba(217, 119, 6, .35)); }
.rbs-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.rbs-n { font-weight: 800; font-size: 15.5px; letter-spacing: -.015em; color: var(--amber-dark); }
.rbs-sub { font-size: 11.5px; color: #b3812f; margin-top: 1px; }
.rbs-best { flex: 0 0 auto; font-size: 11.5px; font-weight: 800; color: var(--amber-dark); background: #fff; border: 1px solid #f4d59a; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }

.week { display: flex; justify-content: center; gap: 7px; margin: 14px 0 4px; }
/* days still ahead of today read as neither done nor missed */
.wd.ahead .dot { opacity: .45; border-style: dashed; }
.wd.ahead .lb { opacity: .55; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.wd .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: var(--bg-soft); color: var(--muted); border: 1.5px solid var(--line-2); }
.wd.done .dot { background: linear-gradient(135deg, #ffce7a, #f59e0b); color: #fff; border-color: transparent; }
.wd.today .dot { box-shadow: 0 0 0 3px var(--amber-soft), 0 0 0 4.5px var(--amber); }
.wd .lb { font-size: 9.5px; color: var(--muted); font-weight: 600; }

.rb-solved { flex: 0 0 auto; text-align: center; margin-top: 13px; font-size: 12px; font-weight: 600; color: var(--muted); }
.rb-foot { flex: 0 0 auto; margin-top: auto; padding-top: 16px; }

.btn-primary { width: 100%; padding: 15px 20px; border-radius: var(--r-md); background: var(--rausch); color: #fff; font-weight: 700; font-size: 16px; box-shadow: var(--shadow-sm); }
.btn-ghost2 { width: 100%; margin-top: 9px; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line); font-weight: 600; font-size: 14px; color: var(--ink-2); background: #fff; }
.btn-danger-solid {
  width: 100%; padding: 14px 20px; border-radius: var(--r-md);
  background: var(--rausch-dark); color: #fff; font-weight: 700; font-size: 16px;
  box-shadow: var(--shadow-sm);
}
.btn-danger { width: 100%; margin-top: 9px; padding: 12px; border-radius: var(--r-md); border: 1px solid #f3c9d2; font-weight: 700; font-size: 14px; color: var(--rausch-dark); background: #fff; }

/* --------------------------- Survey -------------------------------------- */
.npsheet { padding: 12px 20px calc(18px + var(--safe-b)); display: flex; flex-direction: column; }
.np-mark { width: 46px; height: auto; display: block; margin: 0 auto; }
.np-title { margin-top: 14px; font-size: 23px; font-weight: 800; letter-spacing: -.028em; text-align: center; }
.np-sub { margin-top: 6px; font-size: 13.5px; line-height: 1.45; color: var(--muted); text-align: center; }
/* stars are glyphs, not emoji: every system draws the emoji its own way */
.stars { display: flex; justify-content: center; gap: 9px; margin: 22px 0 8px; }
.star { width: 44px; height: 44px; display: grid; place-items: center; font-size: 36px; line-height: 1; color: var(--line); padding: 0; }
.star.on { color: var(--amber); }
.np-hint { text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); min-height: 1.2em; }
.np-area { width: 100%; margin-top: 18px; padding: 13px 14px; min-height: 104px; border: 1.5px solid var(--line); border-radius: var(--r-md); font-size: 14px; line-height: 1.45; resize: none; }
.np-btns { margin-top: 18px; }

/* --------------------------- Picker sheet -------------------------------- */
.picksheet { padding: 12px 20px calc(18px + var(--safe-b)); }
.ps-title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: center; margin-bottom: 8px; }
.ps-list { display: flex; flex-direction: column; }
.ps-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 15px 4px; border-bottom: 1px solid var(--line-2); font-weight: 700; font-size: 16px; text-align: left; }
.ps-item:last-child { border-bottom: none; }
.ps-item .tick { margin-left: auto; color: var(--rausch); font-weight: 800; }
.ps-item.soon { color: var(--muted); }
.ps-item .soonbadge { margin-left: auto; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; color: var(--muted); background: var(--bg-soft); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; }
.ps-scroll { max-height: 46dvh; overflow-y: auto; }

/* --------------------------- Auth ---------------------------------------- */
.auth {
  position: fixed; inset: 0; z-index: 10; max-width: var(--app-w); margin-inline: auto;
  background: #fff; padding: calc(24px + var(--safe-t)) 24px calc(24px + var(--safe-b));
  justify-content: center; text-align: center; overflow-y: auto;
}
.auth-x { position: absolute; top: calc(14px + var(--safe-t)); right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); display: grid; place-items: center; }
.auth-step { display: flex; flex-direction: column; }
.a-emoji { font-size: 48px; line-height: 1; margin-bottom: 8px; }
.a-h1 { font-size: 25px; font-weight: 800; letter-spacing: -.03em; margin-top: 4px; }
.a-lead { color: var(--muted); font-size: 13.5px; margin: 8px 0 4px; line-height: 1.45; }
.a-list { list-style: none; text-align: left; margin: 18px 0 22px; display: flex; flex-direction: column; gap: 11px; }
.a-list li { display: flex; gap: 10px; font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.a-list li > span { flex: 1 1 auto; min-width: 0; }
.a-list strong { color: var(--ink); font-weight: 800; }
.a-list li::before { content: "✓"; flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; background: var(--rausch-soft); color: var(--rausch-dark); font-size: 11px; font-weight: 800; display: grid; place-items: center; margin-top: 1px; }
/* Apple's own guideline: black, mark on the left, same corner radius as ours */
.btn-apple { width: 100%; padding: 15px 20px; border-radius: var(--r-md); background: #000; color: #fff; font-weight: 600; font-size: 16.5px; letter-spacing: -.01em; display: flex; align-items: center; justify-content: center; gap: 9px; }
.btn-apple svg { width: 19px; height: 19px; fill: #fff; margin-top: -3px; }
.a-chg { font-size: 12.5px; font-weight: 700; color: var(--rausch-dark); margin: -2px 0 14px; }
.a-inp { width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: var(--r-md); font-size: 14px; text-align: left; background: #fff; margin-bottom: 10px; }
.a-inp.pick { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.a-inp .caret { margin-left: auto; }
.a-name { font-size: 21px; font-weight: 800; margin-top: 6px; }
.a-meta { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; margin: 4px 0 16px; }
.a-del { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-2); }

/* --------------------------- RTL ----------------------------------------- */
[dir="rtl"] .caret { transform: translateY(-2.5px) rotate(45deg); }
[dir="rtl"] .rb-ex li { padding-left: 0; padding-right: 21px; }
[dir="rtl"] .rb-ex li::before { left: auto; right: 0; }
[dir="rtl"] .ps-item { text-align: right; }
[dir="rtl"] .ps-item .tick, [dir="rtl"] .ps-item .soonbadge { margin-left: 0; margin-right: auto; }
[dir="rtl"] .a-list { text-align: right; }
[dir="rtl"] .a-inp { text-align: right; }
[dir="rtl"] .auth-x { right: auto; left: 14px; }

/* --------------------------- Short screens ------------------------------- */
@media (max-height: 700px) {
  .lnd-brand { width: 140px; }
  .lnd-copy { font-size: 13.5px; }
  .key { height: 42px; }
  .key.enter, .key.back { height: 50px; }
  .sheetb { top: 34px; }
}
