/* Speed Word Search
   Same look as Odd One Out: chunky tiles on a dotted background,
   with bright highlighter strokes for the words you find. */

:root{
  --bg: #e3ebf3;
  --bg-dot: #cfdbe7;
  --surface: #ffffff;
  --surface-edge: #cbd8e5;
  --ink: #152230;
  --muted: #5b6f84;
  --tile: #ffffff;
  --tile-ink: #152230;
  --tile-edge: #b3c3d3;
  --odd: #f2b23a;
  --odd-edge: #c98a14;
  --right: #2fae6c;
  --right-edge: #1f8350;
  --wrong: #e2604f;
  --blue: #3e6fe0;
  --blue-edge: #2a52b3;
  --font: "Outfit", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
/* dark: follows the device unless the player has picked a side in Settings */
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg: #111c26;
    --bg-dot: #1a2835;
    --surface: #182633;
    --surface-edge: #24384a;
    --ink: #eef3f8;
    --muted: #8ea2b6;
    --tile: #f3f6fa;
    --tile-ink: #152230;
    --tile-edge: #92a5b8;
    --blue: #5b86f0;
    --blue-edge: #3b63c7;
  }
}
:root[data-theme="dark"]{
  --bg: #111c26;
  --bg-dot: #1a2835;
  --surface: #182633;
  --surface-edge: #24384a;
  --ink: #eef3f8;
  --muted: #8ea2b6;
  --tile: #f3f6fa;
  --tile-ink: #152230;
  --tile-edge: #92a5b8;
  --blue: #5b86f0;
  --blue-edge: #3b63c7;
}

html, body{ margin: 0; min-height: 100%; touch-action: pan-x pan-y; }

html, body{ height: 100%; overflow: hidden; }

/* every screen fits the height it's given: sizes shrink on short screens */

/* ---- the logo: a little grid of letter tiles with one word highlighted ---- */
.logo{ display: grid; grid-template-columns: repeat(3, auto); gap: 5px; justify-content: center; }
.logo i{
  width: clamp(18px, 3.2vh, 24px); height: clamp(18px, 3.2vh, 24px); border-radius: 7px;
  background: var(--tile); box-shadow: 0 3px 0 var(--tile-edge);
  font: 900 clamp(11px, 1.9vh, 14px)/1 var(--font); font-style: normal; color: var(--tile-ink);
  display: grid; place-items: center;
}
.logo i.on{ background: var(--odd); box-shadow: 0 3px 0 var(--odd-edge); color: #2a1c00; }
.logo-spin i.on{ animation: blink 1.2s ease-in-out infinite; }
.logo-spin i.on:nth-child(5){ animation-delay: 0.15s; }
.logo-spin i.on:nth-child(9){ animation-delay: 0.3s; }
@keyframes blink{ 50% { background: var(--tile); box-shadow: 0 3px 0 var(--tile-edge); color: var(--tile-ink); } }

/* ---- type ---- */

.heading{ font-size: 1.6rem; margin: 0; font-weight: 900; letter-spacing: -0.01em; }
.lede{ margin: 0; font-size: 1.05rem; color: var(--muted); }

/* ---- buttons ---- */
button:focus-visible{ outline-color: var(--odd); }
.big{
  appearance: none; border: 0; width: 100%;
  border-radius: 16px;
  background: var(--blue);
  box-shadow: 0 5px 0 var(--blue-edge);
  color: #fff;
  font-size: clamp(1.05rem, 2.6vh, 1.25rem); font-weight: 900;
  padding: clamp(11px, 2vh, 16px) 20px;
  margin-bottom: 5px;
  transition: transform 0.06s, box-shadow 0.06s;
}
.big:active{ transform: translateY(4px); box-shadow: 0 1px 0 var(--blue-edge); }

.soft:active{ transform: translateY(3px); box-shadow: 0 1px 0 var(--surface-edge); }

/* ---- menu ---- */
.panel{
  background: var(--surface);
  border: 1.5px solid var(--surface-edge);
  border-radius: 20px;
  padding: clamp(10px, 1.8vh, 14px) 16px;
  display: flex; flex-direction: column; gap: clamp(6px, 1.2vh, 10px);
  min-height: 0;
  flex: 0 1 auto;
}
/* only scrolls if a huge group won't fit, which a small server never reaches */

/* ---- game ---- */
.game{ justify-content: flex-start; }
.hud{ display: flex; align-items: center; gap: 12px; flex: none; }
.progress{ flex: 1; display: grid; gap: 6px; }
.bars{ list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.bars li{ height: 7px; border-radius: 4px; background: var(--surface-edge); }
.bars li.done{ background: var(--right); }
.bars li.now{ background: var(--odd); }
.penalty{
  font-weight: 900; color: #fff; background: var(--wrong);
  border-radius: 999px; padding: 3px 10px; font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.clock-wrap{ display: flex; justify-content: center; flex: none; }
.clock{
  margin: 0;
  font-size: min(17vw, clamp(2.2rem, 8.5vh, 4.4rem));
  font-weight: 900; line-height: 1; letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.clock.frozen{ color: var(--muted); }
.prompt{ margin: -4px 0 0; text-align: center; color: var(--muted); font-weight: 700; font-size: clamp(0.85rem, 2vh, 1rem); flex: none; }

.tiles{
  flex: 1 1 auto; min-height: 0; max-height: 470px;
  display: grid; grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: clamp(6px, 1.4vh, 12px);
  padding-bottom: 5px;
}
.tile{
  appearance: none; width: 100%;
  min-height: 0; height: 100%; padding: 4px 16px;
  border: 0; border-radius: clamp(12px, 2vh, 16px);
  background: var(--tile); color: var(--tile-ink);
  box-shadow: 0 5px 0 var(--tile-edge);
  font-size: clamp(1rem, 3.1vh, 1.35rem); font-weight: 900; line-height: 1.1;
  touch-action: manipulation;
  transition: transform 0.06s, box-shadow 0.06s;
}
.tile:active:not(:disabled){ transform: translateY(4px); box-shadow: 0 1px 0 var(--tile-edge); }
.tile:disabled{ cursor: default; }
.tile.wrong{
  background: transparent; color: var(--muted);
  box-shadow: inset 0 0 0 2px var(--surface-edge);
  text-decoration: line-through; text-decoration-thickness: 3px; text-decoration-color: var(--wrong);
  transform: translateY(5px);
}
.tile.right{
  background: var(--odd); color: #2a1c00;
  box-shadow: 0 5px 0 var(--odd-edge);
  animation: pop 0.35s ease-out;
}
.tile.shake{ animation: shake 0.3s; }
@keyframes shake{
  20% { transform: translate(-7px, 5px); }
  60% { transform: translate(7px, 5px); }
}
@keyframes pop{
  40% { transform: scale(1.05) rotate(-2deg); }
}
.tiles.fresh .tile{ animation: rise 0.25s ease-out both; }
.tiles.fresh .tile:nth-child(2){ animation-delay: 0.03s; }
.tiles.fresh .tile:nth-child(3){ animation-delay: 0.06s; }
.tiles.fresh .tile:nth-child(4){ animation-delay: 0.09s; }
.tiles.fresh .tile:nth-child(5){ animation-delay: 0.12s; }
@keyframes rise{ from { opacity: 0; transform: translateY(10px); } }

/* keeps its space even when empty, so nothing jumps */

/* ---- paused ---- */
.pause-badge{ --pause-bg: var(--odd); --pause-edge: var(--odd-edge); --pause-ink: #2a1c00; }   /* the rest of the Paused screen: pause.css (shared) */

/* ---- results ---- */
.stamp{
  margin-top: 4px; padding: 4px 12px; border-radius: 999px;
  background: var(--right); color: #fff; font-weight: 900; font-size: 0.9rem;
  transform: rotate(-3deg);
}
.stamp[hidden]{ display: none; }
.review{
  margin: 0; padding: 0; list-style: none;
  display: grid; grid-template-rows: repeat(5, minmax(0, 1fr)); gap: clamp(5px, 1.2vh, 10px);
  flex: 1 1 auto; min-height: 0; max-height: 330px;
}
.review li{ min-height: 0; }
.review button{
  appearance: none; width: 100%; height: 100%; min-height: 0; text-align: left;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  background: var(--surface);
  border: 1.5px solid var(--surface-edge);
  border-radius: 14px;
  font-weight: 800; font-size: clamp(0.85rem, 2.2vh, 1rem);
}
.review .num{ color: var(--muted); font-weight: 800; flex: none; }
.review .ans{
  padding: 2px 9px; border-radius: 8px; background: var(--odd); color: #2a1c00;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.review .time{ margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; white-space: nowrap; flex: none; }
.review .time .x{ color: var(--wrong); }
.words{ display: flex; flex-wrap: wrap; gap: 6px; }
.words .w{
  padding: 4px 10px; border-radius: 8px;
  background: var(--bg); color: var(--muted);
  font-weight: 700;
}
.words .w.odd{ background: var(--odd); color: #2a1c00; }
.why{ margin: 0; color: var(--muted); }
.why b{ color: var(--ink); }

/* ---- sheets ---- */

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{ animation: none !important; transition: none !important; }
}

/* ---- terms and privacy pages ---- */

.doc p, .doc li{ color: var(--ink); }
.doc a{ color: var(--blue); }

/* the explanation box keeps its space between rounds */

/* results rows look and feel like the game's other buttons, with an arrow */
.review button{
  box-shadow: 0 4px 0 var(--surface-edge);
  margin-bottom: 4px;
  transition: transform 0.06s, box-shadow 0.06s;
}
.review button:active{ transform: translateY(3px); box-shadow: 0 1px 0 var(--surface-edge); }
.review .chev{
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: var(--muted); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
}

/* centred titles everywhere */
.heading{ text-align: center; }

/* how to play: one short line per rule, each with a small tile icon */

.ri{
  flex: none; width: 38px; height: 38px; border-radius: 11px;
  background: var(--tile); box-shadow: 0 4px 0 var(--tile-edge);
  display: grid; place-items: center;
}
.ri:not(.ri-odd):not(.ri-wrong){ border: 1.5px solid var(--surface-edge); }

/* round details: the five words as a neat stack of mini tiles, like the game */

/* one feel throughout: headings, single lines and messages are centred;
   lists that line up in columns (rules, players, rounds) stay left-aligned so they're easy to scan */
.lede, .quiet, .date, .today-line, .prompt, .why{ text-align: center; }
#next-board{ text-align: center; }
/* keep "Round 3 of 5" in the true middle of the screen */
.hud{ display: grid; grid-template-columns: 56px 1fr 56px; }
.hud .penalty{ justify-self: end; }
.hud .penalty[hidden]{ display: none; }

/* testing mode: a strip across the top of every screen */
.test-banner{
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: calc(env(safe-area-inset-top) + 5px) 12px 5px;
  background: repeating-linear-gradient(-45deg, var(--odd) 0 14px, #f5c25c 14px 28px);
  color: #2b1d00; font-weight: 900; font-size: 13px; letter-spacing: .04em;
  text-align: center; text-transform: uppercase; box-shadow: 0 2px 0 var(--odd-edge);
}

body.testing #app{ padding-top: calc(env(safe-area-inset-top) + 36px); }

/* leaderboard */

/* ---- panels (How to play, stats, leaderboard, round review) fill the screen ---- */
.back{ display: inline-flex; align-items: center; gap: 4px; border: 0; background: var(--bg); color: var(--ink); font: inherit; font-weight: 900; padding: 5px 12px 5px 6px; margin-left: 0; min-height: 32px; box-sizing: border-box; border-radius: 12px; cursor: pointer; }

/* test banner sits at the bottom, clear of Discord's own buttons at the top */
.test-banner{ top: auto; bottom: 0; padding: 5px 12px calc(env(safe-area-inset-bottom) + 5px); box-shadow: 0 -2px 0 var(--odd-edge); }
body.testing #app{ padding-top: max(clamp(10px, 2.2vh, 20px), env(safe-area-inset-top)); padding-bottom: calc(env(safe-area-inset-bottom) + 36px); }

/* the round's difficulty, shown beside the question */
.level{
  display: inline-block; margin-right: 8px; padding: 1px 10px; border-radius: 999px;
  font-size: 0.85em; font-weight: 900; color: #fff; vertical-align: 1px;
}
.level[hidden]{ display: none; }
.level.easy{ background: #2e9b63; }
.level.medium{ background: #5b86f0; }
.level.hard{ background: #e2604f; }

/* ---- tutorial ---- */

.tut-dots li.on{ width: 22px; background: var(--odd); }
.tut-dots li.past{ background: var(--right); }

.tut-stage{ flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: clamp(6px, 1.4vh, 12px); }
.tut-stage .tiles{ flex: 1 1 auto; max-height: 380px; }
.tut-stage .tile{ font-size: clamp(0.95rem, 2.7vh, 1.2rem); }
.tut-card{
  background: var(--surface); border: 1.5px solid var(--surface-edge); border-radius: 18px;
  padding: 14px 16px; display: grid; gap: 10px;
}
.tut-card .row{ display: flex; align-items: center; gap: 12px; font-weight: 700; }
.tut-card .row .ri{ flex: none; }

.tut-note.good{ color: var(--right-edge); }
.tut-note.bad{ color: var(--wrong); }

/* Discord on phones covers the top of the game with its own bar: keep clear of it */

/* ================================================================ word search */
:root{ --extreme: #7b3fd1; }
.level.extreme{ background: var(--extreme); }

/* the HUD: pause, words found, today's level */
.hud .level{ justify-self: end; margin: 0; white-space: nowrap; font-size: 0.8rem; }
.hud{ grid-template-columns: 56px 1fr auto; }
.theme-line{ margin: -4px 0 0; text-align: center; color: var(--muted); font-weight: 700; font-size: clamp(0.85rem, 2vh, 1rem); flex: none; }
.theme-line b{ color: var(--ink); }

/* the board fills whatever room is left; JS keeps it square */
.board-wrap{ flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; }
.board{
  position: relative; flex: none;
  background: var(--tile); border-radius: clamp(12px, 2vh, 18px);
  box-shadow: 0 5px 0 var(--tile-edge);
  touch-action: none; cursor: crosshair;
  margin-bottom: 5px;
}
.board svg{ position: absolute; inset: 4%; width: 92%; height: 92%; overflow: visible; pointer-events: none; }
.board .cells{
  position: absolute; inset: 4%;
  display: grid; grid-template-columns: repeat(var(--n), 1fr); grid-template-rows: repeat(var(--n), 1fr);
  pointer-events: none;
}
.board .cells span{
  display: grid; place-items: center;
  color: var(--tile-ink); font-weight: 500; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.board .cells span.anchor{ color: #fff; }
.board line{ stroke-linecap: round; }
.board line.found{ opacity: 0.75; }
.board line.drag{ opacity: 0.55; }
.board line.miss{ opacity: 0.6; animation: fade 0.45s ease-out forwards; }
.board line.pop{ animation: pop-line 0.3s ease-out; }
.board circle.anchor{ fill: var(--blue); }
@keyframes fade{ to { opacity: 0; } }
@keyframes pop-line{ from { opacity: 1; stroke-width: 1; } }
.board.fresh{ animation: rise 0.3s ease-out both; }

/* the words to find */
.word-list{
  flex: none; list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(4px, 0.9vh, 7px);
}
.word-list li{
  padding: clamp(2px, 0.5vh, 4px) 9px; border-radius: 9px;
  background: var(--surface); border: 1.5px solid var(--surface-edge);
  font-weight: 900; font-size: clamp(0.78rem, 1.9vh, 0.95rem); letter-spacing: 0.03em;
  transition: background 0.2s, color 0.2s;
}
.word-list li.got{ color: #1a1300; text-decoration: line-through; text-decoration-thickness: 2px; border-color: transparent; }
.word-list li .t{ font-weight: 700; margin-left: 6px; opacity: 0.8; font-variant-numeric: tabular-nums; text-decoration: none; display: inline-block; }

/* results: the starting board with every word marked, and your times */
#done .board-wrap{ flex: 1 1 auto; }
#done .board{ cursor: default; }
.splits{ flex: none; }
.done-meta{ display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
.done-meta .level{ margin: 0; }
.done-meta .theme{ font-weight: 800; color: var(--muted); }

/* menu: today's level beside the line */
.today-line .level{ margin: 0 8px 0 0; font-size: 0.85em; }

/* tutorial boards */
.tut-stage .board-wrap{ flex: 1 1 auto; max-height: 330px; }
.levels-list{ display: grid; gap: 8px; }
.levels-list .row{ display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--muted); }
.levels-list .row .level{ flex: none; width: 92px; text-align: center; margin: 0; }

/* how to play: the highlighter icon */
.ri-hi{ background: var(--odd); box-shadow: 0 4px 0 var(--odd-edge); transform: rotate(-8deg); }
.ri-hi svg{ stroke: #2a1c00; }

/* the game clock: small and quiet, so it doesn't pull your eye off the grid */
#game .clock{
  font-size: clamp(1.25rem, 3.4vh, 1.6rem);
  letter-spacing: -0.01em;
  color: var(--muted);
}
#game .theme-line{ margin-top: -2px; }
/* the clock is hidden while playing; your time shows at the end */
#game .clock-wrap{ display: none; }

/* ---- shared tidy-up: key information sits in the middle of the screen ---- */
/* tutorial: progress dots in the middle, Skip on the right */
.tut-top .tut-dots{ justify-self: center; }

.tut-stage{ align-items: stretch; text-align: center; }
.tut-card .quiet{ text-align: center; }
.lede[hidden]{ display: none; }
/* How to play, stats and round panels: Back at the top, the content centred below it
   (the leaderboard stays top-aligned so the tabs don't jump when lists change length) */
/* the HUD keeps "3 of 8 found" in the true middle; today's level sits beside the theme, like Odd One Out's question line */
.hud{ grid-template-columns: 56px 1fr 56px; }
.theme-line .level{ font-size: 0.85em; }
.tut-card .row, .levels-list .row{ text-align: left; }

/* tutorial: a preview of the results screen */
.tut-result{ justify-items: center; text-align: center; gap: 6px; padding: 18px 16px; }
.tut-result .k{ font-weight: 800; color: var(--muted); }
.tut-result .tt{ font-size: clamp(2.2rem, 7vh, 3.2rem); font-weight: 900; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tut-result .word-list{ margin-top: 8px; }
/* tutorial: Back on the left, Next on the right */

.big.secondary:active{ box-shadow: 0 1px 0 var(--surface-edge); }
.big.secondary:disabled{ opacity: 0.4; }

.today-line[hidden]{ display: none; }
/* the top bar: pause on the left, today's level and theme in the middle */
.hud .theme-line{ margin: 0; justify-self: center; }
.hud .theme-line .level{ margin-right: 10px; }

/* test mode: choose the level */
.pick-level{ display: grid; gap: 6px; }
.pick-level[hidden]{ display: none; }
.pick-row{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pick-row .level{
  margin: 0; border: 0; cursor: pointer; padding: 7px 2px; font-size: clamp(0.72rem, 3.3vw, 0.85rem);
  white-space: nowrap; opacity: 0.45; box-shadow: 0 3px 0 rgb(0 0 0 / 0.25);
}
.pick-row .level[aria-pressed="true"]{ opacity: 1; outline: 2.5px solid var(--ink); outline-offset: 2px; }
.pick-row .level:disabled{ cursor: wait; }

/* ---- short screens (a phone on its side): logo and title sit side by side so the menu still fits ---- */
@media (max-height: 430px){
  .menu .brand{ display: grid; grid-template-columns: auto auto; column-gap: 14px; justify-content: center; align-items: center; }
  .menu .brand .logo{ grid-row: 1 / 3; }
  .menu .brand .title{ margin: 0; text-align: left; font-size: 1.6rem; align-self: end; }
  .menu .brand .date{ margin: 2px 0 0; text-align: left; align-self: start; }
}

/* ---- big screens (desktop, tablet): the whole game grows with the window instead of staying phone-sized ---- */
@media (min-height: 800px) and (min-width: 760px){
  html{ font-size: clamp(16px, 2vh, 26px); }
  body{ font-size: clamp(17px, 2.1vh, 28px); }
  .screen{ max-width: clamp(440px, 56vh, 760px); }
}

/* ---- settings ---- */

:root[data-theme="dark"]{ color-scheme: dark; }

/* sheets scroll when their content doesn't fit (a long leaderboard, a phone on its side) rather than being cut off */

/* the tutorial on a short screen: tighter text and buttons so the steps still fit */
@media (max-height: 480px){
  .tut{ gap: 6px; }
  .tut .heading{ font-size: 1.25rem; }
  .tut .lede{ font-size: 0.95rem; line-height: 1.3; }
  .tut-nav .big{ padding-top: 9px; padding-bottom: 9px; min-height: 0; }
  .tut-note{ min-height: 0; margin: 0; }
}

/* shown on the first tutorial step for players who have been through an older tutorial */

@media (max-height: 480px){ .tut-updated{ padding: 2px 10px; font-size: 0.72rem; } }

/* ---- colour-blind mode: blue and orange instead of green and red, with a mark beside the colour ---- */

/* ---- practice: a blue strip along the bottom ---- */

/* Practice: a quiet button, almost the colour of the page, so the eye stays on Play and Results */

/* ---- the board was rebuilt: a small tab on the right edge, and the page it opens ---- */
.notice-tab{
  position: fixed; right: 0; top: 62px;
  width: 32px; height: 44px; padding: 0;
  border: 0; border-radius: 14px 0 0 14px;
  background: #e2483d; color: #fff; font-size: 1.5rem; font-weight: 900; line-height: 1;
  box-shadow: -2px 3px 0 rgba(0, 0, 0, 0.35);
  z-index: 5;
}
.notice-tab:active{ transform: translateX(2px); }
.notice-tab[hidden]{ display: none; }
.screen.notice{ justify-content: space-between; }
.notice-body{ flex: 1; display: grid; align-content: center; justify-items: center; gap: 14px; }
.notice-badge{
  width: 76px; height: 76px; border-radius: 22px;
  background: #e2483d; box-shadow: 0 6px 0 #a42e26;
  display: grid; place-items: center; color: #fff; font-size: 3rem; font-weight: 900;
}

/* Settings: 'Our other games' pinned to the bottom, the same in every game */

/* Practice: a pop-up with the game's levels, like the language pop-up */

/* language: the flag on the leaderboard, and the pop-up of languages opened from Settings */

/* Account (Android app only): Google sign-in and the link to Discord */
#acct{ display: flex; flex-direction: column; gap: 10px; }
#acct[hidden]{ display: none; }
#acct p{ margin: 0; text-align: center; }
input#nick{
  appearance: none; width: 100%; box-sizing: border-box; text-align: center;
  font: inherit; font-weight: 700; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--surface-edge); border-radius: 14px; padding: 12px 14px;
}
input#nick[hidden], #acct #nick-btn[hidden]{ display: none; }
#acct #acct-msg:empty{ display: none; }
#acct #acct-msg{ color: var(--bad, #e5484d); font-size: 0.9rem; }
#acct #acct-msg.ok{ color: var(--good, #2fa36b); }

/* Settings page: an account card on top (Android app), then one card of preferences, */
#acct.card{ padding: 10px 12px; flex-direction: column; gap: 8px; }
#acct.card[hidden]{ display: none; }
#acct .prof{ display: flex; align-items: center; gap: 10px; }
#acct #acct-name{ font-weight: 900; font-size: 1.05rem; overflow-wrap: anywhere; }
#acct .av{ flex: none; width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, #5b86f0, #8e5bf0) center / cover; color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 1.15rem; }
input#nick{ text-align: left; background: var(--bg); }
#acct .soft.primary{ background: var(--blue); border-color: var(--blue-edge); box-shadow: 0 4px 0 var(--blue-edge); color: #fff; }
#acct .soft.discord{ background: #e0e3ff; border-color: #b9bff5; box-shadow: 0 4px 0 #b9bff5; }
#acct .soft.discord .dlogo{ height: 22px; width: auto; max-width: 100%; display: block; }
#acct [hidden], #settings [hidden]{ display: none !important; }
#acct .prof .link{ margin-left: auto; align-self: flex-start; padding: 4px 2px; font-size: 0.9rem; }

/* Welcome screen (Android app) + Google's own button, scaled up to sit well on a phone */
.welcome .logo{ margin-bottom: 6px; }
.welcome .lede{ max-width: 21em; }
.welcome .lede.soft-note{ background: var(--surface); border-radius: 14px; padding: 11px 16px; color: var(--ink); font-weight: 700; }
.welcome .fine{ color: var(--muted); font-size: 0.8rem; font-weight: 600; max-width: 22em; margin-top: 12px; }
.welcome .fine a{ color: inherit; text-decoration: underline; }
.gsi-material-button{ appearance: none; -webkit-appearance: none; background-color: #fff; background-image: none; border: 1px solid #747775; border-radius: 24px; box-sizing: border-box; color: #1f1f1f; cursor: pointer; font-family: "Roboto", arial, sans-serif; font-size: 16px; font-weight: 500; height: 52px; letter-spacing: 0.25px; outline: none; overflow: hidden; padding: 0 16px; position: relative; text-align: center; transition: background-color .218s, border-color .218s, box-shadow .218s; vertical-align: middle; white-space: nowrap; width: 100%; max-width: 340px; margin-top: 10px; }
.gsi-material-button .gsi-material-button-icon{ height: 22px; margin-right: 12px; min-width: 22px; width: 22px; }
.gsi-material-button .gsi-material-button-content-wrapper{ align-items: center; display: flex; flex-direction: row; flex-wrap: nowrap; height: 100%; justify-content: center; position: relative; width: 100%; }
.gsi-material-button .gsi-material-button-contents{ flex-grow: 0; flex-shrink: 1; font-family: "Roboto", arial, sans-serif; font-weight: 500; overflow: hidden; text-overflow: ellipsis; vertical-align: top; }
.gsi-material-button .gsi-material-button-state{ transition: opacity .218s; bottom: 0; left: 0; opacity: 0; position: absolute; right: 0; top: 0; }
.gsi-material-button:disabled{ cursor: default; background-color: #ffffff61; border-color: #1f1f1f1f; }
.gsi-material-button:not(:disabled):active .gsi-material-button-state{ background-color: #303030; opacity: 12%; }
.gsi-material-button:not(:disabled):hover{ box-shadow: 0 1px 2px 0 rgba(60,64,67,.30), 0 1px 3px 1px rgba(60,64,67,.15); }
.gsi-material-button:not(:disabled):hover .gsi-material-button-state{ background-color: #303030; opacity: 8%; }
.discord-signin{ appearance: none; -webkit-appearance: none; border: 0; border-radius: 24px; background: #5865f2; color: #fff; height: 52px; width: 100%; max-width: 340px; margin-top: 10px; padding: 0 16px; display: flex; align-items: center; justify-content: center; gap: 9px; font-family: "Roboto", arial, sans-serif; font-size: 16px; font-weight: 500; letter-spacing: 0.25px; cursor: pointer; }
.discord-signin:active{ background: #4752c4; }
.discord-signin:disabled{ opacity: 0.6; cursor: default; }
.discord-signin .dlogo{ height: 19px; width: auto; display: block; margin-top: 1px; }
#acct .prof .link{ white-space: nowrap; flex: none; }

/* the "your name was changed" pop-up (nn-pop) */
.rep-pop{ position: fixed; inset: 0; z-index: 70; background: rgb(0 0 0 / 0.55); display: flex; align-items: flex-end; justify-content: center; }
.rep-pop[hidden]{ display: none; }
.rep-card{ background: var(--surface); width: 100%; max-width: 460px; border-radius: 26px 26px 0 0; padding: 12px 18px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; max-height: 92vh; overflow-y: auto; }
.rep-card [hidden]{ display: none !important; }
.rep-card > div, .rep-card > form{ display: flex; flex-direction: column; gap: 10px; }
.rep-grab{ width: 44px; height: 5px; border-radius: 3px; background: var(--surface-edge); margin: 0 auto 4px; align-self: center; }
.rep-sub{ margin: 0; color: var(--muted); font-size: 0.9rem; font-weight: 600; line-height: 1.4; }
.rep-card h3{ margin: 0; font-weight: 900; font-size: 1.25rem; overflow-wrap: anywhere; }
.rep-opt{ appearance: none; border: 0; background: var(--bg); color: var(--ink); font: inherit; font-weight: 800; border-radius: 14px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.rep-opt.bad{ color: var(--bad, #e5484d); }
.rep-opt svg{ fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rep-opt[data-rep-close]{ justify-content: center; color: var(--muted); }

/* Podium rows on the leaderboard: gold, silver and bronze behind the whole row */
   /* same inset on every row so the podium colour has room and names still line up */

/* other games: a button on the menu opens a popup with the other games' app icons */

          /* the main block sits centred between the top and the two buttons, which stay at the bottom */

/* today's leaderboard, locked until today's puzzle is finished */

/* every panel ends with one blue Close button at the bottom (there is no Back button at the top) */
   /* the last leaderboard row always clears the Close button */

/* Surrender: a quiet red link on the pause screen, and the red "Surrendered" on the leaderboard and menu */

/* Android profile: Edit profile above the Discord button (the same Discord button as the login screen), and the edit pop-up */
#acct .discord-signin{ max-width: none; margin-top: 0; }
#prof-pop input#nick{ width: 100%; text-align: left; background: var(--bg); margin-bottom: 10px; box-sizing: border-box; }
#prof-pop #nick-btn{ width: 100%; margin: 0 0 14px; }
.faces{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; justify-items: center; margin-bottom: 14px; }
.faces button{ width: 46px; height: 46px; border-radius: 50%; border: 3px solid transparent; padding: 0; box-shadow: 0 3px 0 rgba(0,0,0,0.25); cursor: pointer; }
.faces button[aria-pressed="true"]{ border-color: var(--ink); }
#prof-pop .big{ width: 100%; }

/* Languages are switched off (LANGUAGES_ON in client/i18n.js): no Language button, no leaderboard flag */
/* every panel: the content sits in the vertical middle and only the Close button stays at the bottom */

/* Other games on a short screen (a phone on its side): three across, so all the games and Close fit without scrolling */
@media (max-height: 520px){
  .other-games{ grid-template-columns: repeat(3, 1fr); gap: 8px 12px; }
  .other-games img{ width: clamp(40px, 15vh, 64px); }
  .other-games button{ gap: 4px; }
}

/* a phone on its side: the menu and the result screen are taller than the screen, so they scroll from the top (they used to be cut off at both ends) */
@media (max-height: 520px){
  .screen.menu, .screen.done{ overflow-y: auto; overscroll-behavior: contain; justify-content: flex-start; padding-bottom: 8px; }
}

/* small phones (about 320x568): trim the menu so the logo clears the top edge and the buttons stay on screen */
@media (max-height: 620px) and (min-height: 431px){
  .menu .brand{ margin-top: 8px; }
  .menu .other-btn{ padding-top: 10px; padding-bottom: 10px; }
  .menu .logo i{ width: 18px; height: 18px; font-size: 11px; }
}
/* pop-up cards (edit profile) */
.pop{ position: fixed; inset: 0; z-index: 60; background: rgb(0 0 0 / 0.55); display: flex; align-items: center; justify-content: center; padding: 24px; }
.pop[hidden]{ display: none; }
.pop-card{ background: var(--surface); border-radius: 22px; padding: 18px; width: 100%; max-width: 340px; }
.pop-card h3{ margin: 0 0 14px; text-align: center; font-weight: 900; font-size: 1.3rem; color: var(--ink); }

/* Settings: a slimmer account card so the list below it (down to Support) fits without scrolling. */
#acct .discord-signin{ height: 44px; }
#acct .soft.discord .dlogo, #acct .discord-signin .dlogo{ height: 18px; }
