@font-face { font-family: "Lilita One"; src: url(/static/fonts/lilita-one.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Nunito"; src: url(/static/fonts/nunito.woff2) format("woff2"); font-weight: 200 1000; font-display: swap; }

:root {
  --sky: #62C6F2; --sky-dark: #2B8EC2; --sky-pale: #E6F6FD; --line: #D6EEF9;
  --ink: #10264A; --sun: #FFD54A; --sun-dark: #C9A22F;
  --coral: #FF6B5B; --coral-dark: #C94A3D; --grass: #5ED67E; --grass-dark: #36A456;
}
* { box-sizing: border-box; }
/* class rules like .btn and .stack set display, which beats the browser's own [hidden] rule */
[hidden] { display: none !important; }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  background-color: var(--sky);
  background-image: radial-gradient(rgba(255, 255, 255, .35) 2px, transparent 2px);
  background-size: 22px 22px;
  font: 600 16px/1.4 Nunito, system-ui, sans-serif;
}
a { color: var(--ink); }
h1, h2, .logo, .btn, .space, .hidden-tile { font-family: "Lilita One", system-ui, sans-serif; font-weight: 400; }
h1, h2 { margin: 0; } h1 { font-size: 30px; } h2 { font-size: 18px; }
p { margin: 0; }
.top, main { max-width: 34rem; margin: 0 auto; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; }
main { display: flex; flex-direction: column; gap: 14px; padding: 0 12px 28px; }
.logo { font-size: 32px; color: #fff; text-decoration: none; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 0 4px 0 var(--ink); }
.nav { display: flex; align-items: center; gap: 10px; }
.nav form { margin: 0; }
.lang { position: relative; padding: 6px 10px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .5); color: var(--ink); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
/* phone tap targets: an invisible ::after grows small controls to about 44px without changing their look */
.lang::after, .filters a::after, .play-tile::after, .squares summary::after { content: ""; position: absolute; inset: -6px; }
.squares summary::after { inset: -11px -4px; } /* 22px chip → 44px */
.filters a::after { inset: -4px; } /* chips sit 8px apart: their areas must not overlap */
/* only the header's account pill: the waiting row also marks the viewer with class "me" */
.nav .me { display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 999px; background: #fff; box-shadow: 0 4px 0 var(--sky-dark); text-decoration: none; font-weight: 800; }
.pawn { width: 26px; height: 26px; flex: none; }
.pawn path { stroke: var(--ink); stroke-width: 1.5; }

.panel { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 16px; background: #fff; box-shadow: 0 5px 0 var(--sky-dark); }
.panel.flush { gap: 0; padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--sun); }
.panel-head .chip { margin-left: auto; }
.chip { padding: 0 8px; border-radius: 999px; background: #fff; font-size: 12px; font-weight: 800; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border: 0; border-radius: 14px; background: #fff; color: var(--ink); box-shadow: 0 5px 0 var(--sky-dark); font-size: 20px; text-decoration: none; cursor: pointer; }
.btn.wide { width: 100%; }
/* the invite link reads as text, not a field to type in; Copy and Share share the row under it (one alone takes it all) */
.invite-actions { display: flex; gap: 8px; }
.invite-actions .btn { flex: 1; }
.invite-link { background: var(--sky-pale); box-shadow: none; font-size: 14px; text-overflow: ellipsis; cursor: default; }
/* confirm sheets: a bottom sheet over the dimmed page; :target shows the same sheet without JS */
.sheet { width: min(100% - 24px, 34rem); margin: auto auto 28px; padding: 18px 16px 16px; border: 0; border-radius: 18px; background: #fff; color: var(--ink); box-shadow: 0 6px 0 var(--sky-dark); }
.sheet::backdrop { background: rgba(16, 38, 74, .55); }
.sheet:target { display: block; position: fixed; inset: auto 0 0; z-index: 10; box-shadow: 0 0 0 100vmax rgba(16, 38, 74, .55); }
.sheet h2 { font-size: 22px; }
.sheet .muted { font-size: 14px; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--sky-dark); }
/* tap feedback while a request runs: htmx marks the form, app.js the push buttons */
.htmx-request .btn, a.htmx-request, .btn[aria-busy="true"] { opacity: .6; pointer-events: none; }
/* while any page or form is loading: a thin bar sliding along the top of the screen */
body:has(.htmx-request)::before { content: ""; position: fixed; top: 0; left: 0; z-index: 20; width: 40%; height: 3px; background: var(--coral); animation: loading 1s ease-in-out infinite; }
@keyframes loading { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { body:has(.htmx-request)::before { width: 100%; animation: none; } }
.btn.go, .btn.danger { background: var(--coral); color: #fff; box-shadow: 0 5px 0 var(--coral-dark); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }

input, textarea { width: 100%; padding: 10px 12px; border: 0; border-radius: 14px; background: #fff; color: var(--ink); box-shadow: inset 0 3px 0 var(--line), 0 0 0 2px var(--line); font: inherit; resize: vertical; }
input[type=color] { width: 64px; height: 44px; padding: 4px; }
input[type=checkbox] { width: 22px; height: 22px; margin: 0 6px 0 0; padding: 0; box-shadow: none; vertical-align: -5px; }
label { display: block; font-weight: 800; }
.paste, .inline-form { display: flex; gap: 8px; align-items: stretch; }
.inline-form input { flex: 1; }
.inline-form input[type=color] { flex: none; }
/* share texts are several lines: a full-width box, the buttons below it */
.paste { flex-wrap: wrap; }
.paste textarea { flex-basis: 100%; min-height: 7.5em; }
.paste textarea[readonly] { background: var(--sky-pale); } /* pasted: kept as the game wrote it, Clear to change it */
.paste .btn { flex: 1; }
/* everything played today: the paste box folds behind one line, still there for a new game or an old puzzle */
.paste-later > summary { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; min-height: 44px; padding: 10px 14px; border-radius: 16px; background: #fff; box-shadow: 0 5px 0 var(--sky-dark); cursor: pointer; list-style: none; font-weight: 800; }
.paste-later > summary::-webkit-details-marker { display: none; }
.paste-later .tick { color: var(--grass-dark); font-size: 20px; } /* only the tick is green: green text on white is too faint */
.paste-later .again { font-size: 14px; text-decoration: underline; }
.paste-later[open] > summary { margin-bottom: 10px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.title-row h1 { min-width: 0; overflow-wrap: anywhere; }
/* games still to play: compact chips that wrap */
.play-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.play-chips a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--coral); color: #fff; box-shadow: 0 4px 0 var(--coral-dark); font-family: "Lilita One", system-ui, sans-serif; font-size: 17px; text-decoration: none; }
.play-chips a:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--coral-dark); }
/* game picker: one game per row, a real checkbox; ticked row = sky-pale, no JS */
.game-rows { display: grid; border: 0; margin: 0; padding: 0; list-style: none; }
.game-rows legend { font-weight: 800; margin-bottom: 6px; }
.game-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; border-top: 2px dashed var(--line); }
label.game-row { cursor: pointer; } /* the picker; members' read-only rows are not clickable */
.game-row:first-of-type { border-top: 0; }
.game-row input { width: 24px; height: 24px; padding: 0; box-shadow: none; accent-color: var(--ink); flex: none; }
.game-row b { display: block; font-family: "Lilita One", system-ui, sans-serif; font-weight: 400; font-size: 20px; }
.game-row:has(:checked) { background: var(--sky-pale); }
.game-row:has(:focus-visible) { outline: 3px solid var(--ink); outline-offset: -3px; }

.tabs { display: flex; gap: 8px; }
.tabs a { flex: 1; min-width: 0; padding: 12px 2px; border-radius: 12px; background: #fff; box-shadow: 0 4px 0 var(--sky-dark); text-align: center; text-decoration: none; font-weight: 800; }
@media (max-width: 400px) { .tabs { gap: 6px; } .tabs a { font-size: 15px; } }
.tabs a[aria-current="page"] { background: var(--sun); box-shadow: 0 4px 0 var(--sun-dark); }
/* one row that scrolls sideways on a phone; the padding keeps the chips' tap areas inside the scroll box */
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; margin: -4px -2px 0; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters a { flex: none; position: relative; padding: 8px 12px; border-radius: 999px; background: #fff; box-shadow: 0 3px 0 var(--sky-dark); text-decoration: none; font-weight: 800; font-size: 14px; }
.filters a[aria-current="page"] { background: var(--sun); box-shadow: 0 3px 0 var(--sun-dark); }

.row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-top: 2px dashed var(--line); }
.row.out { opacity: .5; }
.row .grow { flex: 1; min-width: 0; }
.row:has([data-dialog]) { align-items: center; } /* name level with its Kick button */
.line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.space { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--sky-pale); box-shadow: 0 3px 0 var(--ink); font-size: 15px; }
.space.first { background: var(--sun); }
.tile { margin-left: auto; padding: 1px 8px; border-radius: 6px; background: var(--sun); box-shadow: 0 2px 0 rgba(16, 38, 74, .35); font-weight: 800; }
.tile.fail { background: #FFB4AB; }
.grid { margin: 4px 0 0; font: inherit; font-size: 12px; line-height: 1.1; letter-spacing: 1px; white-space: pre-line; }
.hint { padding: 10px 14px 0; font-size: 14px; text-align: center; }
/* variants of one puzzle (Songless categories) share a card, switched by chips; without JS they stack under their names */
.variant-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px 2px; scrollbar-width: none; }
.variant-tabs::-webkit-scrollbar { display: none; }
.variant { flex: none; position: relative; min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--sky-pale); color: var(--ink); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
.variant::after { content: ""; position: absolute; inset: -4px; }
.variant.on { background: var(--sun); box-shadow: 0 3px 0 var(--sun-dark); }
.variant .mark { margin-left: 4px; opacity: .7; }
.variant-name { margin: 0; padding: 10px 14px 0; font-size: 16px; }
.tabbed .variant-name { display: none; }
.variant-panel .foot { padding: 6px 14px 12px; }
/* share grids as palette squares, hidden until tapped */
.squares { margin-top: 4px; }
.squares summary { position: relative; display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--sky-pale); font-size: 13px; font-weight: 800; cursor: pointer; list-style: none; }
.squares summary::-webkit-details-marker { display: none; }
.squares[open] summary { margin-bottom: 6px; }
.sq-row { display: flex; gap: 3px; margin-bottom: 3px; }
.sq { width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 -2px 0 rgba(16, 38, 74, .25); }
.sq.red { background: var(--coral); } .sq.green { background: var(--grass); }
.sq.yellow { background: var(--sun); } .sq.orange { background: #FF9F43; }
.sq.miss { background: #8A97AD; } .sq.empty { background: var(--sky-pale); }
/* one row of players; many players scroll sideways */
.waiting { display: flex; gap: 14px; overflow-x: auto; padding: 12px 14px 16px; scrollbar-width: none; }
.waiting::-webkit-scrollbar { display: none; }
.waiting > div { flex: none; min-width: 60px; }
.play-tile { position: relative; display: inline-block; min-height: 32px; line-height: 24px; text-decoration: none; }
.waiting > div { display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 800; font-size: 14px; }
.hidden-tile, .start-tile { min-width: 52px; padding: 4px 6px; border-radius: 8px; text-align: center; font-size: 14px; }
.hidden-tile { background: var(--ink); color: #fff; }
.start-tile { border: 2px dashed var(--sky-dark); color: var(--sky-dark); font-family: inherit; }
.waiting .me .start-tile { border: 2px solid var(--coral-dark); background: var(--coral); color: #fff; }

.track { display: flex; gap: 3px; align-items: flex-end; }
.track > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.track .pawns { display: flex; flex-direction: column-reverse; align-items: center; min-height: 54px; }
.track .pawns .pawn { width: 18px; height: 18px; }
.track .cell { width: 100%; height: 22px; display: grid; place-items: center; border-radius: 6px; background: var(--sky-pale); box-shadow: 0 2px 0 var(--sky-dark); font-size: 11px; font-weight: 800; }
.track .cell.start { background: var(--grass); }
.track .cell.goal { background: var(--sun); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; font-weight: 800; }
.legend span { display: flex; align-items: center; gap: 4px; }
.legend .pawn { width: 16px; height: 16px; }
.legend.past { margin: 0; padding: 0; list-style: none; }

/* a stats table never pushes the page wider: it scrolls inside its panel */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
th, td { padding: 6px 4px; border-bottom: 2px dashed var(--line); text-align: left; }
th:not(:first-child), td:not(:first-child) { text-align: right; }
.groups { margin: 0; padding-left: 18px; }
/* links that are the main way around on a phone: a full 44px line */
.groups a, .foot a, .back a, .panel h2 a, .panel-head h2 a { display: inline-block; padding: 11px 0; margin: -11px 0; }
.groups li { padding: 11px 0; }
.error { color: var(--coral-dark); font-weight: 800; }
#paste-error, .empty { text-align: center; } /* short standalone messages sit centred; lists and forms stay left */
.muted { opacity: .7; }
.center { text-align: center; }
.foot { text-align: center; }
.version { padding: 0 0 20px; font-size: 13px; opacity: .7; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* /help: illustrated steps; the platform panels and their extra sections share one variant switcher */
.help { display: flex; flex-direction: column; gap: 14px; }
.help .variant-name { padding: 0; }
.platforms { display: flex; flex-wrap: wrap; gap: 8px; }
.steps, .mini { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.steps li, .mini li { display: flex; align-items: center; gap: 10px; }
.steps p, .mini p { flex: 1; min-width: 0; }
.steps b { display: block; font-family: "Lilita One", system-ui, sans-serif; font-weight: 400; font-size: 17px; }
.steps .art { width: 76px; height: 60px; flex: none; }
.ill { display: block; width: 100%; max-width: 260px; height: auto; margin: 0 auto; }
.ill.bell { max-width: 200px; }
.callout { padding: 10px 12px; border-radius: 12px; background: var(--sky-pale); font-size: 15px; }
.callout.warn { background: #FFF1BF; }
.key { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 6px; background: var(--sky-pale); box-shadow: 0 2px 0 var(--line); text-align: center; font-weight: 800; }
.key svg { vertical-align: -2px; }
.small { font-size: 14px; }
.strong { font-weight: 800; }
/* Home welcome card: shown once per browser by app.js */
.welcome { position: relative; }
.welcome h2 { font-size: 22px; padding-right: 40px; }
.welcome .close { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); font: 800 22px/1 Nunito, system-ui, sans-serif; cursor: pointer; }
.welcome .actions .btn { flex: 1; }
/* history: one line per puzzle, its winners (or why not) on the right */
.past { padding-left: 0; list-style: none; }
.past li { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.past li > :last-child { margin-left: auto; }
.winner { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; }
.winner .pawn { width: 20px; height: 20px; }

/* badges: round meme medallions with a sun ring, like a game token */
.medal { position: relative; flex: none; display: block; width: 48px; height: 48px; border-radius: 50%; overflow: hidden; border: 2px solid var(--ink); box-shadow: 0 0 0 3px var(--sun), 0 0 0 5px var(--ink), 0 4px 0 3px var(--ink); background: var(--sky-pale); }
.medal img { display: block; width: 100%; height: 100%; object-fit: cover; }
.medal.locked { border-style: dashed; box-shadow: 0 0 0 3px var(--line); opacity: .5; }
.wall-who { display: flex; align-items: center; gap: 8px; }
.wall-who b { font-family: "Lilita One", system-ui, sans-serif; font-weight: 400; font-size: 18px; }
.wall-who .muted { margin-left: auto; font-size: 13px; }
.shelf { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 6px; }
.slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 76px; text-align: center; font-size: 12px; font-weight: 800; line-height: 1.15; }
.count { position: absolute; top: 32px; right: 4px; padding: 0 7px; border-radius: 999px; background: var(--coral); color: #fff; box-shadow: 0 2px 0 var(--coral-dark); font-size: 13px; font-weight: 800; }
/* your badges: a list that scrolls inside its panel */
.hist { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; }
.hist li { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-top: 2px dashed var(--line); }
.hist li:first-child { border-top: 0; }
.hist .medal { width: 40px; height: 40px; box-shadow: 0 0 0 3px var(--sun), 0 0 0 4px var(--ink); }
.hist .grow { flex: 1; min-width: 0; }
.hist .grow a { text-decoration: none; }
.hist time { display: block; font-size: 13px; opacity: .7; }
.pill { flex: none; min-height: 44px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--sky-pale); color: var(--ink); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
/* new badges: one sun row on Today, a pill on Home's group rows */
.minis { display: flex; flex: none; }
.minis .medal { width: 36px; height: 36px; box-shadow: 0 0 0 2px #fff; }
.minis .medal + .medal { margin-left: -14px; }
.medal.more { display: grid; place-items: center; background: #fff; font-size: 13px; font-weight: 800; }
.news-row { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 12px; border-radius: 16px; background: var(--sun); box-shadow: 0 5px 0 var(--sun-dark); text-decoration: none; }
.news-row .txt { flex: 1; min-width: 0; line-height: 1.2; }
.news-row .txt b { display: block; font-family: "Lilita One", system-ui, sans-serif; font-weight: 400; font-size: 17px; }
.news-row .txt span { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.go { flex: none; font-size: 24px; font-weight: 800; }
/* Home's groups: whole rows to tap, not underlined links */
.group-rows { list-style: none; margin: 0 -14px; padding: 0; }
.group-rows li + li { border-top: 2px dashed var(--line); }
.group-rows li.muted { padding: 8px 14px; }
.group-row { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 8px 10px 8px 14px; text-decoration: none; }
.group-row .name { flex: 1; min-width: 0; font-family: "Lilita One", system-ui, sans-serif; font-size: 20px; overflow-wrap: anywhere; }
.group-row .go { opacity: .6; }
.news-pill { display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: var(--sun); box-shadow: 0 2px 0 var(--sun-dark); font-size: 13px; font-weight: 800; white-space: nowrap; }
.news-pill .medal { width: 28px; height: 28px; }
.news-pill .medal + .medal { margin-left: -12px; }
/* the share page: one big medallion card */
.brag { align-items: center; text-align: center; gap: 12px; padding: 24px 18px 20px; }
.medal.big { width: 130px; height: 130px; margin: 10px 0 18px; border-width: 4px; box-shadow: 0 0 0 7px var(--sun), 0 0 0 10px var(--ink), 0 8px 0 8px var(--ink); }
.brag h1 { font-size: 28px; line-height: 1.15; }
.brag .quote { margin-top: -6px; font-style: italic; }
.brag .who { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 800; }
