/* Letter Rip screens: title (mode menu), play and results. The look
   itself (colours, fonts, tiles, path line, effects) is in src/fx/theme.css, linked after
   this file; body has class="arcade". Flat colour and hard offset shadows only. */

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font: 700 16px/1.4 var(--wb-font-ui, system-ui, sans-serif);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}
#app { position: fixed; inset: 0; }
button { font: inherit; color: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding:
    calc(env(safe-area-inset-top, 0px) + 10px)
    calc(env(safe-area-inset-right, 0px) + 10px)
    calc(env(safe-area-inset-bottom, 0px) + 10px)
    calc(env(safe-area-inset-left, 0px) + 10px);
}

/* ---- title ------------------------------------------------------------------ */

.screen-title { align-items: center; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.title-main {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Fits the screen without scrolling: spare height spreads around the blocks, and on a
     short screen the logo gives up height (the only block that shrinks). */
  justify-content: space-evenly;
  gap: clamp(10px, 1.8vh, 22px);
  padding: 4px 0;
}
.title-main > * { flex-shrink: 0; }
.title-main > .logo-wrap { flex-shrink: 1; min-height: 110px; }
.logo-wrap { position: relative; display: flex; flex-direction: column; align-items: center; width: min(80%, 340px); }
.logo {
  display: block;
  flex: 0 1 auto;
  min-height: 0;
  width: 100%;
  height: auto;
  object-fit: contain;
  animation: logo-float 5s ease-in-out infinite;
  pointer-events: none;
}
.tagline { margin: -10px 0 0; font: 800 13px/1.4 var(--wb-font-ui); letter-spacing: 0.22em; text-transform: uppercase; color: var(--wb-ink-soft); }
@keyframes logo-float { 0%, 100% { translate: 0 0; rotate: -1deg; } 50% { translate: 0 -6px; rotate: 1deg; } }

.title-actions { display: grid; justify-items: center; gap: 12px; }
.play-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  min-width: 230px;
  padding: 16px 40px 20px;
  border-radius: 22px;
  font: 400 36px/1 var(--wb-font-display);
  color: #fff;
  background: var(--wb-magenta);
  box-shadow: 0 7px 0 #a8164f;
  transition: translate 70ms, box-shadow 70ms;
}
.play-btn:active { translate: 0 5px; box-shadow: 0 2px 0 #a8164f; }
.play-btn.loading { opacity: 0.8; }

/* The mode menu: three big buttons, each with an icon tile, a status line
   and the mode's best. */
.modes { width: min(100%, 400px); display: grid; gap: clamp(10px, 1.6vh, 16px); }
.mode-btn {
  --face: var(--wb-magenta); --lip: #a8164f; --ink: #fff; --well: rgba(14, 10, 36, 0.22);
  appearance: none;
  border: 0;
  cursor: pointer;
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 14px;
  row-gap: 6px;
  width: 100%;
  padding: 12px 14px 13px 12px;
  border-radius: 20px;
  text-align: left;
  color: var(--ink);
  background: var(--face);
  box-shadow: 0 6px 0 var(--lip);
  transition: translate 70ms, box-shadow 70ms;
}
.mode-btn:active { translate: 0 4px; box-shadow: 0 2px 0 var(--lip); }
.mode-btn[data-mode=timed] { --face: var(--wb-gold); --lip: #c99400; --ink: #1c1442; --well: rgba(28, 20, 66, 0.12); }
.mode-btn[data-mode=daily] { --face: var(--wb-cyan); --lip: #1d9ac2; --ink: #1c1442; --well: rgba(28, 20, 66, 0.12); }
.mode-icon {
  grid-row: 1 / span 2;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #1c1442;
  background: #fff;
  box-shadow: 0 4px 0 rgba(14, 10, 36, 0.3);
}
.mode-glyph { font: 800 34px/1 var(--wb-font-ui); margin-top: -3px; }
.mode-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.mode-icon.cal { grid-template-rows: auto 1fr; place-items: stretch; overflow: hidden; padding: 0; }
.cal-month { font: 800 10px/1 var(--wb-font-ui); letter-spacing: 0.08em; text-align: center; padding: 4px 0 3px; color: #fff; background: var(--wb-magenta); }
.cal-day { display: grid; place-items: center; font: 800 25px/1 var(--wb-font-ui); }
.mode-name {
  grid-column: 2; grid-row: 1; align-self: end;
  font: 400 24px/1 var(--wb-font-display);
  text-transform: uppercase;
}
.mode-sub {
  grid-column: 2; grid-row: 2; align-self: start;
  font: 700 11px/1.3 var(--wb-font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
  white-space: nowrap;
}
.mode-sub b { font-weight: 800; }
.mode-btn.resume .mode-sub { opacity: 1; }
.mode-best {
  grid-column: 3; grid-row: 1 / span 2;
  display: grid; justify-items: end; gap: 5px;
  min-width: 84px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--well);
}
.mode-best-label { font: 800 10px/1 var(--wb-font-ui); letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.8; }
.mode-best-num { font: 800 16px/1 var(--wb-font-ui); font-variant-numeric: tabular-nums; }
/* Today's Daily is done: a check on the calendar, still playable as practice. */
.mode-btn.played .mode-icon::after {
  content: '';
  position: absolute;
  left: 50px; top: 4px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--wb-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m5.5 12.5 4 4 9-9' fill='none' stroke='%230b2e1e' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
  box-shadow: 0 0 0 2px #1c1442;
}
.title-sub { margin: 0; min-height: 1em; font: 700 13px/1.6 var(--wb-font-ui); color: var(--wb-ink-soft); text-align: center; letter-spacing: 0.04em; }
.title-sub b { color: #fff; font-weight: 800; }
.link-btn {
  appearance: none; border: 0; background: none; padding: 6px 10px; cursor: pointer;
  font: 800 12px/1 var(--wb-font-ui); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--wb-gold); text-decoration: underline; text-underline-offset: 4px;
}
/* One row: on a narrow phone the cells shrink and a long value wraps inside its cell. */
.title-stats {
  display: flex;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  margin: 0;
}
.title-stats:empty { display: none; }
.title-stats > div {
  flex: 0 1 auto;
  min-width: 72px;
  padding: 9px 10px 10px;
  border-radius: 12px;
  background: var(--wb-panel);
  text-align: center;
}
.title-stats dt { font: 800 10px/1 var(--wb-font-ui); letter-spacing: 0.14em; color: var(--wb-ink-soft); text-transform: uppercase; }
.title-stats dd { margin: 6px 0 0; font: 800 15px/1.3 var(--wb-font-ui); color: #fff; overflow-wrap: anywhere; }

@media (max-height: 820px) {
  .title-stats { display: none; }
  .tagline { display: none; }
}
@media (max-height: 700px) { .mode-btn { padding-top: 9px; padding-bottom: 10px; } }
/* Too short to fit (landscape, a small window): the menu scrolls instead. */
@media (max-height: 560px) { .title-main { flex-shrink: 0; } }
.title-foot { flex: none; width: 100%; max-width: 420px; display: grid; justify-items: center; gap: 2px; }
.footer { margin: 6px 0 0; font: 700 12px/1 var(--wb-font-ui); letter-spacing: 0.06em; }
.footer a { color: var(--wb-ink-soft); }
/* "Privacy options": only where Google's consent rules require it (client/src/ads.js); looks like its neighbours. */
.footer-link { appearance: none; border: 0; background: none; padding: 0; cursor: pointer; font: inherit; letter-spacing: inherit; color: var(--wb-ink-soft); text-decoration: underline; }

/* Store: Remove Ads / Restore Purchases (client/src/ui/store.js) */
.store:not([hidden]) { display: grid; justify-items: center; gap: 2px; width: 100%; }
.store-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 14px; }
.store-row[hidden] { display: none; }
/* The Remove Ads ribbon: a gold sash across the top of the logo (client/src/ui/store.js shows it for non-buyers).
   In flow above the logo so it takes its own room, overlapping the logo's top edge by a few px. */
.ribbon {
  appearance: none; border: 0; cursor: pointer; position: relative; z-index: 2;
  order: -1; flex: none; width: 118%; margin-bottom: -8px;
  padding: clamp(11px, 1.7vh, 15px) 30px clamp(15px, 2.3vh, 20px);
  /* gold with a darker lip along the bottom edge and a light glint that sweeps across */
  background:
    linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 0.7) 50%, transparent 58%) -150% 0 / 60% 100% no-repeat,
    linear-gradient(to bottom, var(--wb-gold) calc(100% - 6px), #c99400 calc(100% - 6px));
  color: #1c1442;
  clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 50%, 100% 100%, 0 100%, 16px 50%);
  font: 900 clamp(15px, 2.1vh, 18px)/1 var(--wb-font-ui); letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap;
  animation: ribbon-glint 3.2s ease-in-out infinite, ribbon-pulse 2.4s ease-in-out infinite;
}
.ribbon[hidden] { display: none; }
.ribbon:active { translate: 0 3px; }
.ribbon:disabled { opacity: 0.55; cursor: default; animation: none; }
@keyframes ribbon-glint { 0%, 55% { background-position: -150% 0, 0 0; } 100% { background-position: 260% 0, 0 0; } }
@keyframes ribbon-pulse { 0%, 100% { scale: 1; } 50% { scale: 1.035; } }
@media (prefers-reduced-motion: reduce) { .ribbon { animation: none; } }
.store-price { margin-left: 8px; opacity: 0.75; }
.store-price:empty { display: none; }
.store-row button:disabled { opacity: 0.55; cursor: default; }
.store-msg { margin: 0; min-height: 0; font: 700 12px/1.4 var(--wb-font-ui); color: var(--wb-ink-soft); text-align: center; }
.store-msg:empty { display: none; }
.store-msg.error { color: var(--wb-red); }
/* Room for the native banner, which AdMob draws over the page; zero until a banner is up. */
.banner-slot { width: 100%; height: 0; }
.banner-slot.on { height: 60px; }

/* Account (client/src/account.js) */
.account:not([hidden]) {
  display: grid; justify-items: center; gap: 6px; width: 100%; padding: 10px 14px;
  border-radius: 14px; background: var(--wb-panel);
  font-family: system-ui, -apple-system, sans-serif;
}
.account-line { margin: 0; font-size: 13px; color: var(--wb-ink-soft); text-align: center; }
.account-line b { color: var(--wb-ink); }
.account-google { min-height: 40px; }
.account-error { margin: 0; font-size: 13px; color: var(--wb-red); text-align: center; }
.account-native { display: grid; gap: 8px; width: min(100%, 280px); }
.link { border: 0; background: none; padding: 0; font: inherit; color: var(--wb-gold); cursor: pointer; text-decoration: underline; }
.signin-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; border-radius: 21px; font: 600 16px/1 -apple-system, system-ui, sans-serif; cursor: pointer;
}
.signin-btn.apple { background: #fff; color: #000; border: 0; }
.signin-btn.google { background: #131314; color: #e3e3e3; border: 1px solid #8e918f; }
.signin-logo { display: inline-flex; font-size: 19px; line-height: 1; }
.signin-logo svg { width: 18px; height: 18px; }

/* ---- play ------------------------------------------------------------------- */

.screen-play { gap: 6px; }
.screen-play > * { width: 100%; max-width: 560px; margin-left: auto; margin-right: auto; }

.hud {
  flex: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 12px;
  border-radius: 16px;
  background: var(--wb-panel);
}
.hud-score { grid-column: 2; grid-row: 1; text-align: center; min-width: 0; }
.hud-score .hud-num { margin-top: 4px; font-size: clamp(28px, 9vw, 38px); line-height: 1; text-shadow: 0.06em 0.06em 0 var(--wb-magenta); }
.hud-side { display: contents; }
.hud-cell { grid-row: 1; }
.hud-best { grid-column: 1; justify-self: start; }
.hud-cell:not(.hud-best) { grid-column: 3; justify-self: end; text-align: right; }
.hud-cell .hud-num { margin-top: 5px; font-size: 17px; line-height: 1; }
.hud-best.hot .hud-label { color: var(--wb-gold); }
.hud-best.hot .hud-num { color: var(--wb-gold); }
/* The meter row: Timed's clock, Daily's tiles left. */
.hud-meter { grid-column: 1 / -1; grid-row: 2; display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.hud-meter .hud-label { flex: none; width: 5em; }
.meter-track { flex: 1; height: 12px; border-radius: 999px; background: var(--wb-slot); overflow: hidden; }
.meter-fill { height: 100%; border-radius: inherit; transform-origin: left center; transition: transform 0.2s linear, background 0.3s; background: var(--wb-green); }
.hud-meter.tiles .meter-fill { background: var(--wb-gold); transition-duration: 0.5s; }
.meter-num {
  flex: none; min-width: 3.2em; text-align: right;
  font: 800 26px/1 var(--wb-font-ui); font-variant-numeric: tabular-nums; color: #fff;
}
.hud-meter.tiles .meter-num { font-size: 22px; }
.hud-meter.urgent .hud-label { color: var(--wb-red); }
.hud-meter.urgent .meter-fill { background: var(--wb-red); }
.hud-meter.urgent .meter-num { color: var(--wb-red); }
.hud-meter.urgent .meter-num.pulse { animation: clock-pulse 700ms ease-out; }
@keyframes clock-pulse { 0% { scale: 1.35; } 45% { scale: 1; } }
.hud.urgent-glow { box-shadow: inset 0 0 0 3px var(--wb-red); }
.hud-num.bump { animation: hud-bump 320ms cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes hud-bump { 0% { scale: 1; } 35% { scale: 1.22; } 100% { scale: 1; } }

.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* The word line and board sit right under the HUD, within thumb reach. Spare
   height (tall phones) goes below the board, with a small wordmark when there's room. */
.stage-foot { flex: 1 1 0; min-height: 0; width: 100%; display: grid; place-items: center; overflow: hidden; }
.stage-logo {
  height: min(84px, 10vh);
  width: auto;
  max-width: 50%;
  object-fit: contain;
  pointer-events: none;
}
@media (max-height: 780px) { .stage-logo { display: none; } }
@media (min-aspect-ratio: 3/4) { .stage-logo { display: none; } }

/* The word being spelled, just above the board. */
.preview {
  flex: none;
  height: 56px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  white-space: nowrap;
}
.preview-word {
  min-width: 0;
  font: 400 30px/1.15 var(--wb-font-display);
  color: #fff;
  text-shadow: 0.06em 0.06em 0 var(--wb-magenta);
}
.preview-points { font: 800 16px/1 var(--wb-font-ui); color: #1c1442; background: var(--wb-gold); padding: 6px 11px; border-radius: 999px; }
.preview-extra { font: 800 11px/1.4 var(--wb-font-ui); color: var(--wb-gold); letter-spacing: 0.1em; }
.preview-points:empty, .preview-extra:empty { display: none; }
.preview.valid .preview-word { color: var(--wb-green); text-shadow: 0.06em 0.06em 0 #12693f; }
.preview.valid .preview-points { background: var(--wb-green); color: #0b2e1e; }
.preview.bad .preview-word { color: var(--wb-red); font-size: 22px; text-shadow: 0.06em 0.06em 0 #6a1424; }
.preview.loading .preview-word, .preview.hello .preview-word {
  font: 800 14px/1.6 var(--wb-font-ui); letter-spacing: 0.14em; color: var(--wb-ink-soft); text-shadow: none;
}
.preview.loading .preview-word { animation: blink 1s steps(2) infinite; }
.preview.done .preview-word { color: var(--wb-green); text-shadow: 0.06em 0.06em 0 #12693f; }
.preview.flash { animation: preview-in 260ms cubic-bezier(0.3, 1.5, 0.5, 1); }
.preview.done { animation: preview-in 260ms cubic-bezier(0.3, 1.5, 0.5, 1), preview-out 300ms 1000ms ease-in forwards; }
.preview.bad.flash { animation: preview-shake 320ms ease-out; }
@keyframes preview-in { 0% { scale: 0.7; opacity: 0.2; } 100% { scale: 1; opacity: 1; } }
@keyframes preview-out { to { opacity: 0; translate: 0 -8px; } }
@keyframes preview-shake { 20% { translate: -6px 0; } 40% { translate: 6px 0; } 60% { translate: -3px 0; } 80% { translate: 2px 0; } }
@keyframes blink { 50% { opacity: 0.35; } }

.board-well { flex: none; padding: 8px; }
/* New tiles fall in from behind the top edge of the well. */
.board-clip { clip-path: inset(-6px -40px -40px -40px); }
.board {
  position: relative;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
}
.board .tile-pos { position: absolute; left: 0; top: 0; width: var(--tile-size); height: var(--tile-size); will-change: transform; }
.board .tile-pos.badged { z-index: 1; }
.board .tile-pos.lifted { z-index: 2; }
.board-slots { position: absolute; inset: 0; pointer-events: none; }
.slot {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--tile-size);
  height: var(--tile-size);
  border-radius: calc(var(--tile-size) * 0.2);
  background: var(--wb-slot);
}

/* A tile that just turned into a bonus: punch and flare. */
.tile.bonus-born { animation: wb-bonus-born 760ms cubic-bezier(0.3, 1.4, 0.5, 1); z-index: 2; }
.tile.wild.bonus-born { animation: wb-bonus-born 760ms cubic-bezier(0.3, 1.4, 0.5, 1), wb-spin 6s linear infinite; }
@keyframes wb-bonus-born {
  0% { scale: 0.6; }
  35% { scale: 1.35; }
  65% { scale: 0.94; }
  100% { scale: 1; }
}

/* Banners (effects.js) sit over the upper part of the board (play.js sets --banner-top). */
#screen-play .fx-banner { top: var(--banner-top, 36%); }

/* The points flying from the word up to the score. Its own width, not the
   full-width `.screen-play > *` (hud.js centres it on the word by that width). */
.score-fly {
  position: absolute;
  left: 0;
  top: 0;
  width: max-content;
  margin: 0;
  z-index: 60;
  pointer-events: none;
  font: 800 calc(16px + var(--lv, 0) * 3px) / 1 var(--wb-font-ui);
  color: var(--ink, #fff);
  white-space: nowrap;
  -webkit-text-stroke: 0.16em var(--wb-shadow);
  paint-order: stroke fill;
  text-shadow: 0.08em 0.1em 0 var(--wb-shadow);
}
.score-fly.lv-1 { --lv: 1; }
.score-fly.lv-2 { --lv: 2; --ink: var(--wb-cyan); }
.score-fly.lv-3 { --lv: 3; --ink: var(--wb-gold); }
.score-fly.lv-4 { --lv: 4; --ink: var(--wb-magenta); }
.score-fly.lv-5 { --lv: 5; --ink: var(--wb-gold); }
.score-fly.time-fly { --lv: 1; --ink: var(--wb-green); }

/* Bottom bar. */
.bar { flex: none; display: flex; align-items: center; gap: 10px; padding-top: 4px; }
.icon-btn, .pill-btn {
  --face: var(--wb-violet); --lip: #4b2fb0;
  appearance: none;
  border: 0;
  cursor: pointer;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  border-radius: 14px;
  background: var(--face);
  box-shadow: 0 4px 0 var(--lip);
  transition: translate 60ms, box-shadow 60ms, opacity 120ms;
}
.icon-btn { width: 48px; flex: none; }
.icon-btn:active, .pill-btn:active { translate: 0 3px; box-shadow: 0 1px 0 var(--lip); }
.icon-btn svg, .pill-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .off { display: none; }
.icon-btn.is-off { --face: #3a2f78; --lip: #261c57; color: var(--wb-ink-soft); }
.icon-btn.is-off .on { display: none; }
.icon-btn.is-off .off { display: block; }
.pill-btn {
  --face: var(--wb-cyan); --lip: #1d9ac2;
  margin-left: auto;
  padding: 0 16px 0 12px;
  font: 800 17px/1 var(--wb-font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1c1442;
}
.pill-btn .ic-done, .pill-btn.done .ic-new { display: none; }
.pill-btn.done .ic-done { display: block; }
.pill-btn.done:not(.confirm) { --face: var(--wb-gold); --lip: #c99400; }
.pill-btn.confirm { --face: var(--wb-red); --lip: #a8213a; color: #fff; }

/* Short screens (landscape phones, small windows): tighter chrome. */
@media (max-height: 640px) {
  .screen-play { gap: 4px; }
  .hud { padding: 7px 12px 8px; }
  .preview { height: 44px; }
  .preview-word { font-size: 25px; }
  .icon-btn, .pill-btn { height: 42px; }
  .icon-btn { width: 42px; }
}

/* ---- results -------------------------------------------------------------------- */

.screen-results { align-items: center; overflow-y: auto; -webkit-overflow-scrolling: touch; z-index: 5; }
.screen-results { --accent: var(--wb-magenta); }
.screen-results[data-mode=timed] { --accent: var(--wb-gold); }
.screen-results[data-mode=daily] { --accent: var(--wb-cyan); }
.results {
  flex: 1 0 auto;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.8vh, 16px);
  padding: 6px 0;
}
.results-head { text-align: center; display: grid; gap: 10px; justify-items: center; }
.results-mode { margin: 0; display: flex; align-items: center; gap: 8px; font: 800 13px/1 var(--wb-font-ui); letter-spacing: 0.16em; color: var(--accent); }
.results-tag { padding: 4px 8px; border-radius: 6px; font-size: 11px; color: #0b2e1e; background: var(--wb-green); }
.results-tag.practice { color: #1c1442; background: #d9d3f5; }
.results-title {
  margin: 0;
  font: 400 clamp(28px, 9vw, 38px)/1 var(--wb-font-display);
  color: #fff;
  text-shadow: 0.07em 0.07em 0 var(--accent);
  white-space: nowrap;
  rotate: -2deg;
}
.results-score-box {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 14px 14px 16px;
  border-radius: 18px;
  background: var(--wb-panel);
}
.results-score { font: 800 clamp(40px, 13vw, 54px)/1 var(--wb-font-ui); font-variant-numeric: tabular-nums; color: #fff; text-shadow: 0.06em 0.06em 0 var(--wb-magenta); }
.results-score.bump { animation: hud-bump 420ms cubic-bezier(0.3, 1.6, 0.5, 1); }
.results-newbest {
  font: 400 20px/1 var(--wb-font-display); color: #1c1442;
  background: var(--wb-gold); padding: 6px 14px 8px; border-radius: 10px; box-shadow: 4px 4px 0 var(--wb-magenta);
  rotate: -3deg;
  animation: newbest-in 520ms cubic-bezier(0.3, 1.7, 0.5, 1), newbest-glow 1.4s 520ms ease-in-out infinite;
}
@keyframes newbest-in { 0% { scale: 0.2; opacity: 0; } 100% { scale: 1; opacity: 1; } }
@keyframes newbest-glow { 50% { scale: 1.08; } }
.results-best { font: 700 12px/1 var(--wb-font-ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--wb-ink-soft); }
.results-best:empty { display: none; }
.results-stats { margin: 0; font: 700 13px/1.5 var(--wb-font-ui); letter-spacing: 0.06em; color: var(--wb-ink); text-align: center; }
.results-boardbest {
  width: 100%;
  display: grid; justify-items: center; gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--wb-panel);
  box-shadow: inset 0 0 0 2px var(--wb-cyan);
}
.bb-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; justify-content: center; }
.bb-line b { font: 400 21px/1 var(--wb-font-display); color: var(--wb-cyan); }
.bb-score { font: 800 15px/1 var(--wb-font-ui); color: #fff; }
.bb-found { font: 800 10px/1 var(--wb-font-ui); letter-spacing: 0.08em; padding: 4px 6px; border-radius: 5px; color: #0b2e1e; background: var(--wb-green); }
.results-words {
  --rows: 5;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows), auto);
  grid-auto-flow: column;
  column-gap: 10px;
  row-gap: 4px;
}
.results-words.empty { display: none; }
.results-words li {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 10px;
  background: var(--wb-panel);
}
.results-words li { font-size: 17px; }
.rw-word { font-size: 1em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--wb-font-ui); font-weight: 800; line-height: 21px; letter-spacing: 0.04em; color: #fff; }
.rw-score { flex: none; font: 800 13px/1 var(--wb-font-ui); font-variant-numeric: tabular-nums; color: var(--wb-green); }
.results-words li.longest { background: var(--wb-gold); }
.results-words li.longest .rw-word, .results-words li.longest .rw-score { color: #1c1442; }
.results-words li.longest .rw-word::after { content: ' ★'; font-size: 0.8em; }
.results-more, .results-none { margin: -4px 0 0; font: 700 12px/1 var(--wb-font-ui); letter-spacing: 0.08em; color: var(--wb-ink-soft); }
.results-more:empty { display: none; }
.results-none { margin: 0; font-size: 13px; }
/* New-Daily reminder card (client/src/notify.js). */
.nudge {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--wb-panel);
  box-shadow: inset 0 0 0 2px var(--wb-gold);
  text-align: center;
}
.nudge[hidden], .nudge [hidden] { display: none; }
.nudge-ask { display: grid; justify-items: center; gap: 10px; }
.nudge-text { margin: 0; font: 700 14px/1.4 var(--wb-font-ui); color: var(--wb-ink-soft); }
.nudge-text b { color: #fff; font-weight: 800; white-space: nowrap; }
.nudge-btns { display: flex; align-items: center; justify-content: center; gap: 6px; }
.nudge .pill-btn { --face: var(--wb-gold); --lip: #c99400; margin-left: 0; height: 42px; padding: 0 18px; font-size: 15px; }
.results-rank {
  width: 100%;
  display: grid; justify-items: center; gap: 8px;
  padding: 14px 12px 12px;
  border-radius: 18px;
  background: var(--wb-panel);
  box-shadow: inset 0 0 0 2px var(--wb-gold);
  animation: newbest-in 520ms cubic-bezier(0.3, 1.7, 0.5, 1);
}
.rank-top {
  font: 400 clamp(26px, 8.5vw, 36px)/1 var(--wb-font-display);
  color: var(--wb-gold);
  white-space: nowrap;
  text-shadow: 0.07em 0.07em 0 var(--wb-magenta);
  rotate: -2deg;
}
.rank-when { font: 700 11px/1 var(--wb-font-ui); letter-spacing: 0.1em; color: var(--wb-ink-soft); }
.rank-when:empty, .rank-goal:empty { display: none; }
.rank-word { display: grid; justify-items: center; gap: 6px; }
.rank-word b { color: var(--wb-gold); }
.rank-goal { margin: 2px 0 0; font: 800 12px/1.3 var(--wb-font-ui); letter-spacing: 0.08em; color: var(--wb-green); text-align: center; }
.results-actions { width: 100%; display: grid; justify-items: center; gap: 16px; margin-top: 4px; }
.results-again { min-width: 0; width: min(100%, 300px); padding: 14px 24px 17px; font-size: 28px; }
.results-row { display: flex; gap: 12px; justify-content: center; }
.results-row .pill-btn { margin-left: 0; padding: 0 18px 0 14px; }
.results-share { --face: var(--wb-violet); --lip: #4b2fb0; color: #fff; }
@media (max-height: 700px) {
  .results-again { padding: 11px 24px 14px; font-size: 24px; }
  .results-score-box { padding: 10px 12px 12px; gap: 8px; }
  .results-words li { font-size: 15px; }
  .results-words li { padding: 4px 9px; }
}
