/* Shared from BaseGameDiscord 0.52.0. Do not edit here: change it in BaseGameDiscord and run tools/sync.mjs. */
/* Every full-screen page (How to play, Settings, Stats, Leaderboard, Other games, round review) is built the same way in every game:
     title fixed at the top  ·  contents in a recessed track (like a switch that is off)  ·  buttons raised like a switch that is on
     ·  one blue Close button fixed at the bottom, in the same place and size on every page.
   Pages slide up to open and slide down to close. */
.sheet-back { display: none !important; }
.sheet.sheet, .og-pop.og-pop {
  --pg-top: max(clamp(10px, 2.2vh, 20px), env(safe-area-inset-top));
  --pg-w: 440px; --close-h: 60px; --close-bottom: max(20px, env(safe-area-inset-bottom));
  position: fixed; inset: 0; z-index: 60; margin: 0; width: auto; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 12px;
  padding: var(--pg-top) 16px calc(var(--close-bottom) + var(--close-h) + 14px);
  border-radius: 0; box-shadow: none; overflow: hidden; overscroll-behavior: contain;
  background-color: var(--bg); background-image: radial-gradient(var(--bg-dot) 1.2px, transparent 1.3px); background-size: 18px 18px;   /* the same recessed, edge-less ground as the home screen */
  animation: panel-up .26s cubic-bezier(.2,.8,.25,1) both; will-change: transform;
}
html.discord-mobile .sheet.sheet, html.discord-mobile .og-pop.og-pop { --pg-top: calc(env(safe-area-inset-top) + 60px); }
body.testing .sheet.sheet, body.testing .og-pop.og-pop, body.practicing .sheet.sheet, body.practicing .og-pop.og-pop, body.practice .sheet.sheet { --close-bottom: calc(env(safe-area-inset-bottom) + 40px); }
.sheet.sheet.closing, .og-pop.og-pop.closing { animation: panel-down .22s cubic-bezier(.4,0,.8,.4) both; pointer-events: none; }
@keyframes panel-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes panel-down { from { transform: none; } to { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) {
  .sheet.sheet, .og-pop.og-pop, .sheet.sheet.closing, .og-pop.og-pop.closing { animation: none; }
}

/* the title, fixed at the top */
.sheet.sheet > .heading, .og-pop.og-pop > .heading { flex: none; margin: 0 !important; width: 100%; max-width: var(--pg-w); text-align: center; }
/* everything else sits in a column of the same width */
.sheet.sheet > *, .og-pop.og-pop > * { width: 100%; max-width: var(--pg-w); }
.sheet.sheet > .tabs, .sheet.sheet > .lb-reveal, .sheet.sheet > .board-sub { flex: none; }

/* the contents: a recessed track that scrolls on its own */
.sheet.sheet > .panel-body, .og-pop.og-pop > .panel-body, .panel-body {
  flex: 0 1 auto !important; min-height: 0 !important; overflow-y: auto !important; max-height: none !important; height: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 14px; align-items: stretch; justify-content: flex-start;
  background: none; border: 0; border-radius: 0; padding: 2px 2px 6px; margin: auto 0;
}
/* cards and plain lists inside the track lose their own box */
.panel-body > .card { background: none; border: 0; box-shadow: none; padding: 0; margin: 0; width: auto; max-width: none; display: flex; flex-direction: column; gap: 14px; }
/* buttons and rows inside the track stand out of it, like a switch that is on */
.panel-body :is(.set-row, .stat, .og-btn, .other-games > button, button.soft, button.link-btn) {
  background: var(--surface); box-shadow: 0 3px 0 var(--surface-edge); border-radius: 12px; border: 0;
}
.panel-body button.soft, .panel-body .set-btn { color: var(--ink); font-weight: 800; padding: 12px 14px; width: 100%; font-size: 1rem; }
.panel-body .other-games { margin: auto 0; }
.panel-body .other-games > button { padding: 12px 8px 10px; width: 100%; }

/* the one Close button: same place, same size, on every page */
.sheet.sheet > .sheet-close, .og-pop.og-pop > .sheet-close {
  position: absolute; left: 16px; right: 16px; bottom: var(--close-bottom); margin: 0 auto; width: auto; max-width: var(--pg-w);
  height: var(--close-h); min-height: var(--close-h); padding: 0 20px; box-sizing: border-box; flex: none; font-size: 20px;
}

/* "Play the tutorial": a second fixed button, right above Close (How to play page) */
.sheet.sheet > .tut-btn {
  position: absolute; left: 16px; right: 16px; bottom: calc(var(--close-bottom) + var(--close-h) + 12px); margin: 0 auto; width: auto; max-width: var(--pg-w);
  height: 52px; box-sizing: border-box; flex: none; padding: 0 16px; font-size: 1rem; font-weight: 800; color: var(--ink);
  background: var(--surface); border: 2px solid var(--surface-edge); border-radius: 14px; box-shadow: 0 3px 0 var(--surface-edge);
}
.sheet.sheet:has(> .tut-btn) { padding-bottom: calc(var(--close-bottom) + var(--close-h) + 12px + 52px + 14px); }

/* the leaderboard: title and tabs fixed, only the list scrolls (the list is the recessed track) */
#board.sheet > .people, #board.sheet > .ranks {
  flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; margin: 0 0 8px; align-content: start;
  background: none; border: 0; border-radius: 0; padding: 2px 2px 6px; gap: 8px;
}
#board.sheet .people li, #board.sheet .ranks li { background: var(--surface); box-shadow: 0 2px 0 var(--surface-edge); }
#board.sheet .people li.m1, #board.sheet .ranks li.p1 { background: linear-gradient(90deg, rgb(255 190 40 / 0.34), rgb(255 190 40 / 0.14)), var(--surface); }
#board.sheet .people li.m2, #board.sheet .ranks li.p2 { background: linear-gradient(90deg, rgb(190 202 220 / 0.34), rgb(190 202 220 / 0.13)), var(--surface); }
#board.sheet .people li.m3, #board.sheet .ranks li.p3 { background: linear-gradient(90deg, rgb(214 128 62 / 0.34), rgb(214 128 62 / 0.14)), var(--surface); }
#board.sheet .people li.lb-lock, #board.sheet .people li:has(> .quiet), #board.sheet .ranks li.board-msg { background: none; box-shadow: none; }
#board.sheet .people .quiet { display: block; width: 100%; text-align: center; }
#board.sheet .people li.lb-lock { flex-direction: column; align-items: center; text-align: center; }

/* matching scroll bars for the recessed tracks */
.panel-body, #board.sheet > .people, #board.sheet > .ranks { scrollbar-width: thin; scrollbar-color: var(--surface-edge) transparent; }
.panel-body::-webkit-scrollbar, #board.sheet > .people::-webkit-scrollbar, #board.sheet > .ranks::-webkit-scrollbar { width: 12px; }
.panel-body::-webkit-scrollbar-track, #board.sheet > .people::-webkit-scrollbar-track, #board.sheet > .ranks::-webkit-scrollbar-track { background: transparent; margin: 6px 0; }
.panel-body::-webkit-scrollbar-thumb, #board.sheet > .people::-webkit-scrollbar-thumb, #board.sheet > .ranks::-webkit-scrollbar-thumb {
  background: var(--surface); border-radius: 999px; border: 2px solid var(--surface-edge); background-clip: padding-box; box-shadow: 0 2px 0 var(--surface-edge);
}

.sheet[hidden], .og-pop[hidden] { display: none !important; }

/* a chosen option in a list of choices (Sound style): ringed in the game's accent colour */
.panel-body button.soft[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent, var(--blue, #5b87f0)), 0 2px 0 var(--surface-edge); }
.panel-body button.soft[disabled] { opacity: .6; }

/* Pop-up card (Support): a small card centred over a dimmed page. Tap outside or Close to dismiss. */
.pop-wrap { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(8, 12, 17, .72); backdrop-filter: blur(2px); animation: pop-fade .18s ease-out both; }
.pop-wrap[hidden] { display: none !important; }
.pop-wrap.closing { animation: pop-fade-out .16s ease-in both; pointer-events: none; }
.pop-card { width: 100%; max-width: 360px; max-height: 88vh; max-height: 88dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
  background: var(--bg, #fff); border: 2px solid var(--surface-edge); border-radius: 24px; padding: 20px 18px 22px; animation: pop-scale .2s cubic-bezier(.2,.8,.25,1) both; }
.pop-title { margin: 0; text-align: center; font-size: 1.5rem; font-weight: 900; }
.pop-body { display: flex; flex-direction: column; gap: 14px; }
.pop-card button.soft { background: var(--surface); box-shadow: 0 3px 0 var(--surface-edge); border: 0; border-radius: 12px; color: var(--ink); font-weight: 800; padding: 13px 14px; width: 100%; font-size: 1rem; }
.pop-close { width: 100%; margin-top: 2px; }
@keyframes pop-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes pop-scale { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pop-wrap, .pop-card, .pop-wrap.closing { animation: none; } }

/* Stats (every game): a title, then a row of tiles pressed together. */
.stat-grid { display: grid; gap: 12px; }
.stat-group h3 { margin: 0 0 6px; font-size: 0.8rem; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); text-align: center; }
/* Stats: each group is a title and a row of tiles pressed together, with a small notch where two meet (1, 2 or 3 tiles across). */
.stat-row { display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); gap: 2px; }
.stat { display: grid; justify-items: center; align-content: center; gap: 2px; min-width: 0; padding: 12px 6px; border-radius: 16px; text-align: center; }
.stat .n { font-size: clamp(1.15rem, 3vh, 1.45rem); font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .k { background: none; border: 0; border-radius: 0; height: auto; box-shadow: none; display: block; color: var(--muted); font-weight: 700; font-size: 0.78rem; line-height: 1.2; }
.stat .k.lvl { color: #fff; padding: 0 8px; border-radius: 999px; white-space: nowrap; font-size: 0.72rem; }
.stat .k.lvl.easy { background: #2e9b63; }
.stat .k.lvl.medium { background: #5b86f0; }
.stat .k.lvl.hard { background: #e2604f; }

/* The practice level picker (shared by every game that has one): the pop-up, its card and the level buttons */
.practice-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; }
.practice-pop[hidden] { display: none; }
.practice-card { background: var(--surface); border-radius: 22px; padding: 18px; width: 100%; max-width: 340px; }
.practice-card h3 { margin: 0 0 14px; text-align: center; font-weight: 900; font-size: 1.3rem; color: var(--ink); }
.practice-row { display: grid; gap: 10px; }
.practice-row button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--surface-edge); background: var(--bg); color: var(--ink); font: inherit; font-weight: 900; font-size: 1.1rem; text-align: left; }
.practice-row button:active { transform: translateY(1px); }
.practice-row i { width: 14px; height: 14px; border-radius: 50%; flex: none; }

/* The practice level picker: the same pop-up as Support (dark recessed card, raised buttons, blue Close) */
.practice-pop { z-index: 70; background: rgba(8, 12, 17, .72); backdrop-filter: blur(2px); animation: pop-fade .18s ease-out both; }
.practice-pop .practice-card { max-width: 360px; background: var(--bg, #fff); border: 2px solid var(--surface-edge); border-radius: 24px; padding: 20px 18px 22px; display: flex; flex-direction: column; gap: 14px; animation: pop-scale .2s cubic-bezier(.2,.8,.25,1) both; }
.practice-pop .practice-card h3 { margin: 0; font-size: 1.5rem; }
.practice-pop .practice-row { gap: 14px; }
.practice-pop .practice-row button { background: var(--surface); border: 0; border-radius: 12px; box-shadow: 0 3px 0 var(--surface-edge); }
.practice-pop .pop-close { width: 100%; margin-top: 2px; }

/* ---- Settings > Theme: a big button with a preview card, and the pop-up that lists the themes ---- */
.panel-body .theme-btn { min-height: 104px; display: flex; align-items: center; gap: 14px; padding: 12px 14px; text-align: left; justify-content: flex-start; }
.theme-pv { display: flex; flex-direction: column; gap: 5px; flex: none; width: 96px; height: 80px; padding: 8px; border-radius: 12px; box-sizing: border-box;
  background-color: var(--bg); background-image: radial-gradient(var(--dot) 1px, transparent 1.1px); background-size: 10px 10px; box-shadow: 0 0 0 2px var(--surface-edge); }
.theme-pv i { display: block; height: 15px; border-radius: 5px; background: var(--surface); box-shadow: 0 2px 0 var(--edge); }
.theme-pv i + i { width: 70%; }
.theme-pv b { display: block; height: 16px; margin-top: auto; border-radius: 6px; background: var(--accent); box-shadow: 0 2px 0 var(--aedge); }
.theme-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.theme-tx b { font-size: 1.1rem; }
.theme-tx small, .theme-std small { color: var(--muted); font-size: .8rem; font-weight: 700; }
.panel-body .theme-btn .chev { margin-left: auto; }
.theme-list { gap: 8px; }
.theme-opt { position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 12px; border-radius: 12px; cursor: pointer;
  background: var(--surface); box-shadow: 0 3px 0 var(--surface-edge); font-weight: 800; text-align: left; }
.theme-opt .theme-pv { width: 60px; height: 46px; padding: 5px; gap: 3px; border-radius: 9px; background-size: 8px 8px; box-shadow: 0 0 0 1.5px var(--surface-edge); }
.theme-opt .theme-pv i { height: 8px; border-radius: 3px; box-shadow: 0 1px 0 var(--edge); }
.theme-opt .theme-pv b { height: 9px; border-radius: 3px; box-shadow: 0 1px 0 var(--aedge); }
.theme-std { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.theme-opt .switch { margin-left: auto; flex: none; }
.theme-opt .switch:disabled { opacity: .4; }
.theme-opt.on:not([data-skin=""])::after { content: "✓"; position: absolute; right: 16px; color: var(--accent, var(--blue)); font-size: 1.25rem; font-weight: 900; }
.theme-opt.on { outline: 2px solid var(--accent, var(--blue)); outline-offset: -2px; }

/* The Theme pop-up is wider than the other pop-ups: a little margin on a phone, more room for the previews on a bigger screen */
.pop-wrap:has(#theme-pop), #theme-pop.pop-wrap { padding: 8px; }
#theme-pop .pop-card, #theme-pop > .pop-card { max-width: min(520px, 100%); }

.theme-opt[data-skin="discord"]::after { display: none; }   /* its row has the dark / light switch where the tick goes */
.theme-logo { align-items: center; }
.theme-logo svg { width: 46%; height: auto; margin-top: 1px; fill: var(--logo, #fff); }
.theme-logo b { margin-top: auto; align-self: stretch; }
.theme-opt .theme-logo svg { width: 52%; }

/* Other games: three across with smaller icons, so the whole list fits on a phone without scrolling */
.og-pop .other-games { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px; }
.og-pop .other-games img { width: clamp(48px, 17vw, 72px); }
.og-pop .panel-body .other-games > button { padding: 8px 4px; gap: 4px; font-size: 0.78rem; line-height: 1.15; }
