/* Sockglass look: tissue-paper bedroom window at night (reserved in low-ai-feel registry 2026-10-15). */
:root {
  --sg-wall: #262A4A; --sg-sprig: #33385C; --sg-frame: #E9E2D0; --sg-ink: #0E1020; --sg-cream: #F4EBD3;
  --sg-glass: #11152B; --sg-line: #CBBE9E; --sg-peg: #C79A5B; --sg-red: #E2483D;
  --sg-text: "Andika", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --pl-font: var(--sg-text);
  --pl-topbar-bg: #1D2140;
  --pl-topbar-text: var(--sg-cream);
  --pl-control-text: var(--sg-cream);
  --pl-control-bg: transparent;
  --pl-control-border: #4A5080;
  --pl-focus: var(--sg-line);
  --pl-overlay: rgb(10 12 28 / .72);
  --pl-card-bg: var(--sg-cream);
  --pl-card-text: var(--sg-ink);
  --pl-card-muted: #2F3350;
  --pl-card-border: #CBBE9E;
  --pl-primary: var(--sg-ink);
  --pl-primary-text: var(--sg-cream);
  --pl-shadow: rgb(0 0 0 / .45);
  --pl-share-bg: var(--sg-cream);
  --pl-radius-control: 6px;
  --pl-radius-card: 4px;
  --pl-radius-picture: 2px;
  color-scheme: dark;
  font-family: var(--sg-text);
  color: var(--sg-cream);
  background: var(--sg-wall);
}
body {
  background-color: var(--sg-wall);
  background-image:
    radial-gradient(circle at 12px 14px, var(--sg-sprig) 0 1.6px, transparent 2.2px),
    radial-gradient(circle at 30px 34px, var(--sg-sprig) 0 1.2px, transparent 1.8px);
  background-size: 40px 44px;
}
[data-pl="topbar"] { box-shadow: 0 1px 0 #3A3F6A; }
[data-pl="back"] { color: var(--sg-cream); }
[data-pl="back"][data-brand] { gap: 6px; }
.pl-brand-title { font-family: "Gluten", var(--sg-text); font-size: 18px; font-weight: 700; line-height: 1; }
:lang(zh-Hant) .pl-brand-title { font-family: var(--sg-text); }
.pl-topbar__actions button { color: var(--sg-cream); }

/* the rules card is a sheet of cream paper with two strips of tape */
[data-pl="howto-card"] { border-width: 0; box-shadow: 0 2px 0 #C9BE9E, 0 18px 50px var(--pl-shadow); overflow: auto; }
[data-pl="howto-card"]::before, [data-pl="howto-card"]::after {
  content: ""; position: absolute; top: -6px; width: 64px; height: 18px; background: rgb(246 231 161 / .55);
  border-left: 1px dashed rgb(14 16 32 / .18); border-right: 1px dashed rgb(14 16 32 / .18);
}
[data-pl="howto-card"]::before { left: 18px; transform: rotate(-4deg); }
[data-pl="howto-card"]::after { right: 18px; transform: rotate(3deg); }
[data-pl="howto-card"] h2 { font-family: "Gluten", var(--sg-text); font-weight: 700; letter-spacing: 0; }
:lang(zh-Hant) [data-pl="howto-card"] h2 { font-family: var(--sg-text); }
[data-pl="howto-pictures"] canvas { border: 3px solid var(--sg-frame); background: var(--sg-wall); }
[data-pl="howto-lines"] { font-weight: 400; font-size: 15px; color: var(--sg-ink); }
.pl-howto-footer button { color: var(--sg-ink); background: transparent; border-color: #B9AD8C; }
.pl-howto-footer .pl-howto-start { color: var(--sg-cream); background: var(--sg-ink); border-color: var(--sg-ink); min-width: 96px; }

.shell { padding-top: calc(62px + env(safe-area-inset-top)); }
#play-screen { padding-top: 4px; }
.level-row { min-height: 34px; }
.level-name { font-family: "Gluten", var(--sg-text); font-weight: 700; font-size: 22px; color: var(--sg-cream); }
:lang(zh-Hant) .level-name { font-family: var(--sg-text); }
.move-count { display: none; }
.board-shell { border: 0; border-radius: 3px; background: var(--sg-wall); box-shadow: none; }
.success-effect { display: none; }
.message { color: var(--sg-line); min-height: 1.35em; margin: 6px 4px 2px; text-align: center; }
.message.refused { color: #F2A79F; }

button { border-radius: 6px; border-color: #4A5080; background: transparent; color: var(--sg-cream); }
.controls { padding-top: 4px; }
.controls button { font-weight: 400; }
button:focus-visible, a:focus-visible { outline-color: var(--sg-line); }

.is-result .controls, .is-result .message { display: none; }
.result-card {
  position: relative; margin: 10px 0 12px; padding: 16px 14px 14px; border: 0; border-radius: 3px;
  background: var(--sg-cream); color: var(--sg-ink); box-shadow: 0 2px 0 #C9BE9E;
}
.result-title { font-family: "Gluten", var(--sg-text); font-weight: 700; color: var(--sg-ink); font-size: 24px; }
:lang(zh-Hant) .result-title { font-family: var(--sg-text); }
.result-marks { font-weight: 400; color: #2F3350; }
.share-line { display: none; }
.result-actions button { color: var(--sg-ink); border-color: #B9AD8C; font-weight: 400; }
.result-actions .primary-button { color: var(--sg-cream); background: var(--sg-ink); border-color: var(--sg-ink); box-shadow: none; }

.eyebrow { color: var(--sg-line); }
.map-heading h1 { font-family: "Gluten", var(--sg-text); font-weight: 700; color: var(--sg-cream); }
:lang(zh-Hant) .map-heading h1 { font-family: var(--sg-text); }
.level-tile { background: var(--sg-glass); border: 3px solid var(--sg-frame); border-radius: 2px; color: var(--sg-cream); }
.level-tile strong { font-family: "Gluten", var(--sg-text); font-weight: 700; }
:lang(zh-Hant) .level-tile strong { font-family: var(--sg-text); }
.level-tile small { color: var(--sg-line); }
.level-tile.complete { background: #4A3F22; border-color: #F6E7A1; }
.quiet-button { color: var(--sg-cream); }
@media (min-width: 700px) { .shell { background: transparent; border-color: #3A3F6A; box-shadow: none; } }

/* Story (design/STORY_20261023.md): premise on the How to play card, one beat line on the result card. */
.sg-premise { margin: 0 0 12px; padding: 0 0 10px; border-bottom: 1px dashed var(--pl-card-border); }
.sg-premise p { margin: 0 0 6px; font-size: 17px; line-height: 1.4; color: var(--pl-card-text); }
.sg-premise p:first-child { font-family: "Gluten", var(--sg-text); font-size: 19px; }
:lang(zh-Hant) .sg-premise p:first-child { font-family: var(--sg-text); }
.story-line { margin: 4px auto 12px; max-width: 30ch; font-size: 17px; line-height: 1.4; font-style: italic; color: var(--pl-card-text); }
:lang(zh-Hant) .story-line { font-style: normal; }
.result-card.story-end .story-line { font-style: normal; font-family: "Gluten", var(--sg-text); font-size: 20px; padding: 10px 6px; border-top: 2px solid var(--sg-peg); border-bottom: 2px solid var(--sg-peg); }
:lang(zh-Hant) .result-card.story-end .story-line { font-family: var(--sg-text); }
/* Tonight's window sits first on the Levels screen, the width of the grid, lit from inside. */
.level-tile.daily { grid-column: 1 / -1; background: #2E2A1C; border-color: var(--sg-peg); }
.level-tile.daily.complete { background: #4A3F22; border-color: #F6E7A1; }

/* One screen (taste/ONE_SCREEN.md, P1FS22): the win card is a sheet pinned to the bottom of the screen, Next level first and full width. */
.result-card:not([hidden]) {
  position: fixed; z-index: 30; left: 50%; bottom: 0; width: min(100%, 430px); transform: translateX(-50%);
  display: flex; flex-direction: column; max-height: min(62dvh, calc(100dvh - 72px)); overflow-y: auto; overscroll-behavior: contain;
  margin: 0; padding: 14px 14px max(14px, env(safe-area-inset-bottom)); border-radius: 10px 10px 0 0;
  box-shadow: 0 -8px 28px rgb(0 0 0 / .35);
}
.result-card .result-title { order: 0; }
.result-card .result-marks { order: 1; margin: 2px 0 10px; }
.result-card .result-actions { order: 2; }
.result-card .story-line { order: 3; }
.result-card .share-line { order: 4; margin: 10px 0 0; }
.result-actions #next-button:not([hidden]) { flex: 1 1 100%; order: -1; }
@media (max-height: 760px) {
  .shell { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .controls { padding-bottom: 6px; }
  .message { margin-top: 6px; margin-bottom: 2px; }
}

/* first-visit card: Play and the toggles stay pinned to the bottom of the card; the rest scrolls above */
.pl-howto-footer { position: sticky; bottom: -20px; margin: 0 -20px -20px; padding: 10px 20px 20px; background: var(--pl-card-bg); box-shadow: 0 -8px 10px -6px rgba(14, 16, 32, 0.18); z-index: 2; }

/* P2NV20: one row above the window (Level N left, picture chips and "3 of 3 lit" right), then the goal. */
.level-row { align-items: center; min-height: 40px; padding: 0 3px; gap: 8px; flex-wrap: nowrap; }
.level-name { white-space: nowrap; }
.lit { display: flex; align-items: center; gap: 8px; min-width: 0; margin-left: auto; }
.lit-chips { display: inline-flex; gap: 6px; flex: 0 1 auto; }
.lit-chips svg { display: block; flex: none; }
.lit-count { display: inline-flex; align-items: baseline; gap: 5px; font-size: 20px; line-height: 1.45; white-space: nowrap; color: var(--sg-cream); }
.lit-count b { font-size: 24px; line-height: 1.45; font-weight: 700; color: #F6E7A1; font-variant-numeric: tabular-nums; }
.instruction { display: block; margin: 2px 3px 8px; min-height: 0; color: var(--sg-cream); font-size: 20px; line-height: 1.35; }
.instruction[hidden], .has-coach .instruction { display: none; }
:lang(zh-Hant) .instruction { font-size: 22px; }
.pegs-left { margin: 0; padding: 2px 8px 0; font-size: 20px; line-height: 1.3; color: var(--sg-cream); white-space: nowrap; text-align: right; pointer-events: none; }
:lang(zh-Hant) .pegs-left { font-size: 20px; }
.is-result .pegs-left { display: none; }
.pl-topbar__actions .lv-icon { display: none; }
@media (max-width: 359px) {
  [data-pl="back"] svg { display: none; }
  .pl-topbar__actions .lv-word { display: none; }
  .pl-topbar__actions .lv-icon { display: inline; }
  [data-pl="levels"] { width: 44px; }
  .lit-chips { gap: 3px; }
  .lit-chips svg { width: 22px; height: 22px; }
  .level-row { gap: 4px; }
  .level-row { flex-wrap: wrap; row-gap: 0; }
  .lit-chips[data-n="5"], .lit-chips[data-n="6"], .lit-chips[data-n="7"], .lit-chips[data-n="8"] { display: none; }
}
@media (min-width: 360px) { .lit-chips[data-n="6"] svg, .lit-chips[data-n="7"] svg, .lit-chips[data-n="8"] svg { width: 20px; height: 20px; } .lit-chips[data-n="6"], .lit-chips[data-n="7"], .lit-chips[data-n="8"] { gap: 3px; } }
@media (max-height: 700px) { .instruction { margin-bottom: 4px; } .level-row { min-height: 36px; } }
@media (max-width: 430px) { .lit-chips[data-n="7"], .lit-chips[data-n="8"] { display: none; } }
