/* 자동 생성 — tools/build-css.sh · 손으로 고치지 말고 css/game.css 를 고친다 */
/* gb-ui.css — game-builder 기본틀 UI(첫 화면 셸 · 학교 순위 · 학교 찾기 · 문제 · 모드 카드 · 모드 띠 · 전체화면 단추).
 * 키트 정본 = ~/.claude/skills/game-builder/kit/school-hub/client. 게임은 :root 의 --gb-* 토큰만 덮어 자기 색을 입힌다.
 * 🔴 원칙(2026-10-11 사용자 «심플하고 세련된 UI · 직관적인»): 주 행동 단추 1개 · 같은 종류는 같은 모양 · 장식 띠·배지 남발 금지 ·
 *    글자 ≥ 12px · 누르는 곳 ≥ 44px · 첫 화면 맨 위 = 학교 순위(접지 않음).
 */
:root {
  --gb-bg: #0f1729;
  --gb-panel: rgba(255, 255, 255, 0.055);
  --gb-panel-2: rgba(255, 255, 255, 0.09);
  --gb-line: rgba(255, 255, 255, 0.1);
  --gb-text: #eaf1ff;
  --gb-dim: rgba(234, 241, 255, 0.6);
  --gb-accent: #8fe3c0;
  --gb-accent-ink: #062419;
  --gb-gold: #ffd166;
  --gb-danger: #ff6b6b;
  --gb-radius: 16px;
  --gb-font: system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
}

/* ── 첫 화면 셸: 머리줄 → 학교 순위 → 주 단추 → 모드 → 보조 줄 ── */
.gb-home { width: 100%; max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; font-family: var(--gb-font); color: var(--gb-text); }
.gb-home-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.gb-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; letter-spacing: -0.3px; }
.gb-brand canvas, .gb-brand img { width: 34px; height: 34px; }
.gb-tools { display: flex; gap: 6px; }
.gb-icon { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--gb-line); background: var(--gb-panel); color: var(--gb-text);
  display: grid; place-items: center; font-size: 20px; cursor: pointer; padding: 0; }
.gb-icon:active { transform: scale(0.94); }
.gb-play { border: 0; border-radius: var(--gb-radius); min-height: 56px; font: 800 18px var(--gb-font); cursor: pointer;
  background: var(--gb-accent); color: var(--gb-accent-ink); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25); }
.gb-play:active { transform: scale(0.98); }
.gb-sub { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.gb-sub > button { min-height: 44px; border-radius: 12px; border: 1px solid var(--gb-line); background: var(--gb-panel); color: var(--gb-text);
  font: 700 13.5px var(--gb-font); cursor: pointer; padding: 6px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gb-sub > button.done { color: var(--gb-accent); border-color: color-mix(in srgb, var(--gb-accent) 50%, transparent); }

/* ── 학교 순위 카드(첫 화면 맨 위 · 접지 않음) ── */
.gb-rank { background: var(--gb-panel); border: 1.5px solid color-mix(in srgb, var(--gb-gold) 55%, transparent); border-radius: var(--gb-radius);
  padding: 10px 14px 8px; text-align: left; font-family: var(--gb-font); color: var(--gb-text); }
.gb-rank-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.gb-rank-head b { font-size: 15px; color: var(--gb-gold); }
.gb-rank-head small { flex: 1; color: var(--gb-dim); font-size: 12px; }
.gb-tix { font-size: 12.5px; font-weight: 800; color: var(--gb-text); background: var(--gb-panel-2); border-radius: 999px; padding: 2px 9px; }
.gb-rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; font-size: 14px; }
/* 순위가 뒤늦게 떠도 아래 단추가 밀리지 않게 자리를 잡아 둔다(동틀녘 마을 2026-11-05 «떠나기» 92px 밀려 헛누름) */
[data-gb="school-rank"] { min-height: 218px; }
.gb-rank-list li { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.gb-rank-list .pos { flex: 0 0 24px; text-align: center; font-weight: 800; font-size: 13px; color: var(--gb-dim); }
.gb-rank-list li.medal .pos { font-size: 15px; }
.gb-rank-list .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-rank-list .nm small { color: var(--gb-dim); font-size: 12px; }
.gb-rank-list .pt { font-variant-numeric: tabular-nums; color: var(--gb-gold); }
.gb-rank-list li.me { color: var(--gb-accent); font-weight: 800; }
.gb-rank-list li.sep { border-top: 1px dashed var(--gb-line); margin-top: 3px; padding-top: 3px; }
.gb-rank-list li.dim { color: var(--gb-dim); font-size: 13px; }
.gb-rank-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--gb-line); font-size: 12.5px; }
.gb-mine { color: var(--gb-dim); }
.gb-mine b { color: var(--gb-accent); }
.gb-link { background: none; border: 0; color: var(--gb-accent); font: 700 12.5px var(--gb-font); cursor: pointer; padding: 6px 2px; min-height: 44px; }

/* ── 모드 카드(전부 같은 모양) ── */
.gb-modes { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 8px; }
.gb-mode { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 8px; align-items: center;
  text-align: left; min-height: 76px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--gb-line); background: var(--gb-panel);
  color: var(--gb-text); font-family: var(--gb-font); cursor: pointer; }
.gb-mode:active { transform: scale(0.97); }
.gb-mode-emoji { grid-row: 1 / span 2; width: 28px; height: 28px; line-height: 1; display: grid; place-items: center; color: var(--gb-accent, #ffcf5a); }
.gb-mode-emoji svg { width: 26px; height: 26px; }
.gb-mode-name { font-weight: 800; font-size: 15px; }
.gb-mode-desc { font-size: 12px; color: var(--gb-dim); line-height: 1.3; }
.gb-mode-best { grid-column: 1 / span 2; font-size: 12px; font-weight: 700; color: var(--gb-gold); min-height: 0; }
.gb-mode-best:empty { display: none; }

/* ── 게임 중 모드 띠 ── */
.gb-modebar { display: flex; justify-content: center; align-items: center; gap: 8px; pointer-events: none; font-family: var(--gb-font); font-variant-numeric: tabular-nums; }
.gb-chip { background: rgba(10, 16, 32, 0.72); color: var(--gb-text); border-radius: 12px; padding: 5px 12px; font-weight: 800; font-size: 15px; }
.gb-time { font-size: 20px; }
.gb-time.urgent { color: var(--gb-danger); animation: gbBlink 0.5s steps(2) infinite; }
.gb-hearts i { font-style: normal; }
.gb-hearts i.lost { opacity: 0.25; filter: grayscale(1); }
@keyframes gbBlink { 50% { opacity: 0.55; } }

/* ── 전체 덮개(학교 찾기 · 문제) ── */
/* 🔴 열 = minmax(0,1fr) — auto 열이면 입력칸·단추의 고유 폭이 열을 넓혀 390px 폰에서 창이 오른쪽으로 잘렸다(보카웜 2026-10-12 실측 sheet 434px) */
#gb-layer, #gb-tier-layer { position: fixed; inset: 0; z-index: 1000; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 16px; background: rgba(6, 10, 22, 0.72);
  backdrop-filter: blur(4px); font-family: var(--gb-font); color: var(--gb-text); overflow-y: auto; }
#gb-layer[hidden], #gb-tier-layer[hidden] { display: none; }
.gb-sheet { width: 100%; max-width: 520px; background: var(--gb-bg); border: 1px solid var(--gb-line); border-radius: 20px; padding: 18px 16px; text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45); }
.gb-sheet h2 { margin: 0 0 6px; font-size: 21px; }
.gb-hint { margin: 0 0 12px; color: var(--gb-dim); font-size: 13.5px; line-height: 1.5; }
.gb-hint b { color: var(--gb-text); }
.gb-row { display: flex; gap: 6px; }
.gb-row select, .gb-row input { min-height: 46px; border-radius: 12px; border: 1px solid var(--gb-line); background: var(--gb-panel-2); color: var(--gb-text);
  font: 600 16px var(--gb-font); padding: 0 10px; }
.gb-row input { flex: 1; min-width: 0; user-select: text; -webkit-user-select: text; }
.gb-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; }
.gb-pick { width: 100%; min-height: 46px; text-align: left; border-radius: 12px; border: 1px solid var(--gb-line); background: var(--gb-panel); color: var(--gb-text);
  font: 700 15px var(--gb-font); padding: 8px 12px; cursor: pointer; }
.gb-pick small { color: var(--gb-dim); font-weight: 600; }
.gb-msg { min-height: 20px; margin: 10px 0 0; font-size: 14px; color: var(--gb-dim); }
.gb-msg b { color: var(--gb-gold); }
.gb-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.gb-btn { min-height: 46px; min-width: 110px; border-radius: 12px; border: 0; background: var(--gb-accent); color: var(--gb-accent-ink); font: 800 16px var(--gb-font);
  padding: 0 18px; cursor: pointer; }
.gb-btn.ghost { background: transparent; color: var(--gb-text); border: 1px solid var(--gb-line); }
.gb-btn:disabled { opacity: 0.5; }
.gb-opts { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.gb-seg { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.gb-pill { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--gb-line); background: var(--gb-panel); color: var(--gb-text);
  font: 700 14px var(--gb-font); cursor: pointer; }
.gb-pill.on { background: var(--gb-accent); border-color: var(--gb-accent); color: var(--gb-accent-ink); }
.gb-qprog { display: flex; gap: 6px; justify-content: center; margin: 6px 0 0; }
.gb-qprog i { width: 30px; height: 7px; border-radius: 9px; background: var(--gb-panel-2); }
.gb-qprog i.done { background: var(--gb-accent); }
.gb-qprog i.now { background: var(--gb-gold); }
.gb-qtext { font-size: clamp(26px, 7vw, 40px); font-weight: 800; margin: 16px 0; }
.gb-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gb-choice { min-height: 72px; border-radius: 14px; border: 1px solid var(--gb-line); background: var(--gb-panel-2); color: var(--gb-text); font: 800 22px var(--gb-font); cursor: pointer; }
.gb-choice:active { transform: scale(0.97); }
.gb-review { text-align: left; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.gb-review .no { color: var(--gb-danger); }

@media (max-height: 640px) {
  .gb-home { gap: 8px; }
  .gb-rank { padding: 7px 12px 6px; }
  .gb-rank-list { font-size: 13px; }
  .gb-rank-list li { min-height: 21px; }
  .gb-play { min-height: 50px; font-size: 17px; }
  .gb-mode { min-height: 64px; padding: 8px 10px; }
}
@media (max-width: 350px) {
  .gb-mode-desc { display: none; }
}

/* 분수 = 위아래로 쌓기(kit/frac/frac.css 와 같은 규칙) — 여기 두는 이유: CSP style-src 'self' 게임은 frac.js 의 인라인 <style> 주입이 막힌다 */
.frac{display:inline-flex;flex-direction:column;align-items:center;vertical-align:middle;line-height:1.05;margin:0 .12em;font-size:.9em;font-variant-numeric:tabular-nums}
.frac-n{padding:0 .18em .06em;border-bottom:.09em solid currentColor}.frac-d{padding:.06em .18em 0}.frac-mixed{white-space:nowrap}.frac-mixed>.frac{margin-left:.06em}
/* 키트 화면 안에서는 키트 분수가 이긴다 — 게임이 자기 분수용 .frac(inline-block·top 이동)을 따로 갖고 있으면 뒤에 로드된 그 규칙이
   위 규칙을 덮어 «3 4»처럼 가로로 붙었다(퐁당 낚시 style.css 2026-10-12). id 선택자로 이기고, 게임이 흔히 주는 속성을 되돌린다. */
#gb-layer .frac,[data-gb] .frac{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;vertical-align:middle;position:static;top:auto;float:none;width:auto;height:auto;text-align:center;line-height:1.05}
#gb-layer .frac-n,#gb-layer .frac-d,[data-gb] .frac-n,[data-gb] .frac-d{display:block;position:static;float:none}
/* 보기가 홀수(수학 = 3개)면 마지막 보기를 한 줄 전체로 — 2열 격자에 빈칸이 남아 «하나 빠진» 것처럼 보였다(티샷 사용자 화면) */
#gb-layer .gb-choices > .gb-choice:last-child:nth-child(odd){grid-column:1/-1}

/* 아이콘(gb-icons.js) — 이모지 대신 */
.gb-ic { width: 1.1em; height: 1.1em; vertical-align: -0.18em; flex: none; }
.gb-ic-ok { color: #6fdc8c; } .gb-ic-no { color: #ff7a6b; }
.gb-hearts i .gb-ic { color: #ff5a6e; } .gb-hearts i.lost .gb-ic { color: rgba(255,255,255,.25); }
.gb-rank-list .pos.m1, .gb-rank-list .pos.m2, .gb-rank-list .pos.m3 { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-weight: 900; color: #1b1b1b; }
.gb-rank-list .pos.m1 { background: #ffd34d; } .gb-rank-list .pos.m2 { background: #d7dde6; } .gb-rank-list .pos.m3 { background: #e0a46a; }

/* 1.4.0 — 첫 화면 통계 줄 · 전체 순위(더보기) */
.gb-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 2px 0 6px; padding: 6px 0; border-bottom: 1px solid var(--gb-line); text-align: center; }
.gb-stats span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.gb-stats b { font-size: 15px; font-variant-numeric: tabular-nums; color: var(--gb-text); }
.gb-stats small { font-size: 12px; color: var(--gb-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gb-more { display: block; width: 100%; text-align: center; }
.gb-rank-all { text-align: left; }
.gb-rank-all h2 { text-align: center; }
.gb-tabs { display: flex; gap: 6px; justify-content: center; margin: 4px 0 8px; }
.gb-tab { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--gb-line); background: transparent; color: var(--gb-text); font: 700 14px var(--gb-font); cursor: pointer; }
.gb-tab.on { background: var(--gb-accent); color: var(--gb-accent-ink); border-color: transparent; }
.gb-rank-scroll { max-height: min(60vh, 520px); overflow-y: auto; padding: 0 4px; }
.gb-rank-scroll li { min-height: 30px; }

/* 첫 화면 맨 아래 선행쌤 링크(1.14.0) — 누르는 곳 ≥44px · 글자 ≥12px */
.gb-site { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; margin: 10px 0 6px; padding: 10px 14px;
  box-sizing: border-box; flex-shrink: 0; border-radius: 16px; text-decoration: none; color: #fff; font: 500 13px var(--gb-font);
  background: linear-gradient(110deg, #6d28d9, #db2777, #f97316, #db2777, #6d28d9); background-size: 300% 100%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35) inset, 0 8px 24px rgba(219, 39, 119, 0.45); animation: gb-site-flow 7s linear infinite; }
.gb-site::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%); transform: translateX(-120%); animation: gb-site-shine 3.2s ease-in-out infinite; }
.gb-site-ic { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px;
  background: rgba(255, 255, 255, 0.22); animation: gb-site-pop 1.6s ease-in-out infinite; }
.gb-site-ic .gb-ic { width: 24px; height: 24px; }
.gb-site-tx { display: flex; flex-direction: column; min-width: 0; flex: 1; text-align: left; line-height: 1.25; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.gb-site-tx b { font-size: 18px; font-weight: 900; letter-spacing: -0.01em; }
.gb-site-tx small { font-size: 13px; font-weight: 600; opacity: 0.95; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gb-site-go { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; min-height: 36px; padding: 0 12px; border-radius: 999px;
  background: #fff; color: #be185d; font-weight: 800; font-size: 13px; }
.gb-site-go .gb-ic { width: 14px; height: 14px; }
.gb-site:hover, .gb-site:focus-visible { filter: brightness(1.08); box-shadow: 0 0 0 2px #fff inset, 0 10px 30px rgba(219, 39, 119, 0.6); }
@keyframes gb-site-flow { to { background-position: 300% 0; } }
@keyframes gb-site-shine { 0%, 55% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@keyframes gb-site-pop { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.12) rotate(-8deg); } }
@media (prefers-reduced-motion: reduce) { .gb-site, .gb-site::after, .gb-site-ic { animation: none; } }
/* 🎁 하루 첫 판 안내(2026-11-03) — 판 위에 잠깐 떴다 사라진다(누를 것 없음) */
.gb-note { position: fixed; left: 50%; top: max(14px, env(safe-area-inset-top), 21vh);   /* 맨 위는 게임마다 점수·막대 칸 — 거기 뜨면 판 시작 3초 동안 덮었다(2026-11-09 콩콩 구름계단 «문까지 n초» 막대) */ transform: translateX(-50%); z-index: 9999; pointer-events: none; max-width: min(92vw, 520px);
  padding: 10px 16px; border-radius: 14px; background: rgba(20, 28, 48, 0.92); color: #fff; font-size: 14px; font-weight: 700; line-height: 1.4; text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); animation: gb-note-in .25s ease-out; }
.gb-note svg { width: 16px; height: 16px; vertical-align: -3px; }
@keyframes gb-note-in { from { opacity: 0; transform: translate(-50%, -8px); } }
@media (prefers-reduced-motion: reduce) { .gb-note { animation: none; } }

/* 별명 만들기(gb-nick.js · 2026-11-04) — 아이가 꾸밈말·동물을 골라 만든다. 자유 입력 0 */
.gb-nick-back { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0.55); }
.gb-nick-card { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 18px; border-radius: 18px; background: var(--gb-panel, #1b2333); color: var(--gb-text, #fff); display: grid; gap: 10px; }
.gb-nick-title { margin: 0; font-size: 20px; }
.gb-nick { display: grid; gap: 8px; }
.gb-nick-out { font-size: 24px; font-weight: 800; text-align: center; padding: 10px; border-radius: 12px; background: color-mix(in srgb, var(--gb-accent) 18%, transparent); color: var(--gb-text, #fff); }
.gb-nick-h { font-size: 14px; color: var(--gb-dim, #c9d2e3); }
.gb-nick-row { display: flex; flex-wrap: wrap; gap: 6px; }
.gb-nick-chip { min-height: 48px; padding: 0 14px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--gb-text, #fff) 25%, transparent); background: transparent; color: var(--gb-text, #fff); font-size: 15px; cursor: pointer; }
.gb-nick-chip.on { background: var(--gb-accent); color: var(--gb-accent-ink); border-color: var(--gb-accent); font-weight: 700; }
.gb-nick-note { margin: 0; font-size: 13px; color: var(--gb-dim, #c9d2e3); }
.gb-nick-cancel { min-height: 48px; background: transparent; border: 0; color: var(--gb-dim, #c9d2e3); font-size: 15px; cursor: pointer; }
/* 길게 누르기가 글자 선택·복사 메뉴를 띄워 조작을 가리지 않게(2026-11-05 포물선 요새단) */
html, body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea { -webkit-user-select: text; user-select: text; }

/* 셈 이용권 문제(gb-sem.js) — 조각 줄 + 화면 키패드 */
.gb-sem-q { font-size: clamp(22px, 6vw, 32px); font-weight: 800; margin: 8px 0 6px; }
.gb-sem-list { list-style: none; margin: 0 auto; padding: 3px; box-sizing: border-box; display: flex; flex-direction: column; gap: 4px; width: min(100%, 340px); max-height: 30dvh; overflow-y: auto; }
.gb-sem-list li { display: grid; grid-template-columns: 1fr auto minmax(4.6em, 1fr); align-items: center; gap: 2px 8px; padding: 4px 10px; flex: none; border-radius: 10px; font-size: 19px; font-weight: 800; }
.gb-sem-list li[hidden] { display: none; }
.gb-sem-list li.cur { background: var(--gb-panel-2); box-shadow: inset 0 0 0 2px var(--gb-gold); }
.gb-sem-list li.done { opacity: 0.72; font-size: 16px; }
.gb-sem-why { grid-column: 1 / -1; font-size: 13px; font-weight: 700; color: var(--gb-dim); }
.gb-sem-list li.done .gb-sem-why { display: none; }
.gb-sem-ex { text-align: right; white-space: nowrap; } .gb-sem-sl { text-align: left; }
.gb-sem-sl.good { color: var(--gb-accent); } .gb-sem-sl.shown { color: var(--gb-danger); }
.gb-sem-in { width: 100%; max-width: 100%; box-sizing: border-box; font: inherit; padding: 3px 8px; border-radius: 10px; border: 2px solid var(--gb-gold); background: var(--gb-bg); color: var(--gb-text); }
.gb-sem-list li.shake { animation: gbSemShake 0.3s; }
@keyframes gbSemShake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .gb-sem-list li.shake { animation: none; } }
/* 조각이 늘어도 키패드가 안 움직인다 — 손가락 밑에서 키가 밀리면 다른 숫자가 눌린다 */
.gb-sem-list { min-height: 30dvh; }
.gb-sem-pad .gb-numpad { margin-top: 6px; gap: 6px; }
.gb-sem-pad .gb-numpad-key { background: var(--gb-panel-2); border-color: var(--gb-line); color: var(--gb-text); }
.gb-sem-pad .gb-numpad-key.ok { background: var(--gb-accent); border-color: transparent; color: var(--gb-accent-ink); }
.gb-quiz .gb-sem-play ~ .gb-msg:empty { display: none; }
.gb-quiz .gb-sem-play ~ .gb-btns { margin-top: 6px; }
@media (max-height: 520px) {
  .gb-sem-play { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; align-items: start; }
  .gb-sem-pad .gb-numpad-key { min-height: 44px; }
  .gb-sem-list { max-height: 50dvh; }
  .gb-sem-list li { font-size: 16px; padding: 3px 6px; column-gap: 4px; }
  .gb-sem-q { font-size: 20px; margin: 2px 0; }
}
/* 방 안에서 푸는 문제 — 위 띠(몇 명 모였나 · 방장 시작) */
.gb-qroom { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; margin: -4px 0 10px; padding: 6px 10px; border-radius: 12px; background: rgba(0, 184, 148, 0.16); font-weight: 700; font-size: 14px; }
.gb-qroom .gb-btn { flex: none; min-height: 44px; }
.gb-qroom .gb-btn[hidden] { display: none; }
/* 1.24.0 학교 찾기 결과 — 반짝이며 누르고 싶게(2026-11-08 사용자 «이름으로 검색하면 아래에 학교 선택을 반짝반짝») · 시험 tests/school-pick-ui.test.mjs */
.gb-tapcue { display: inline-flex; align-items: center; gap: 6px; color: #ffd84a; font-size: 15px; animation: gbCueBob 1.1s ease-in-out infinite; }
.gb-tapcue svg { width: 18px; height: 18px; }
.gb-pick { position: relative; overflow: hidden; border: 2px solid #ffc83d; background: linear-gradient(135deg, var(--gb-panel), rgba(255, 200, 61, 0.16));
  box-shadow: 0 0 0 0 rgba(255, 200, 61, 0.55); animation: gbPickIn 0.35s ease-out both, gbPickGlow 1.6s ease-in-out 0.35s infinite; animation-delay: calc(var(--gb-i, 0) * 40ms), calc(0.35s + var(--gb-i, 0) * 120ms); }
.gb-pick::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  transform: translateX(-120%); animation: gbPickShine 2.2s ease-in-out infinite; animation-delay: calc(var(--gb-i, 0) * 150ms); pointer-events: none; }
.gb-pick:hover, .gb-pick:focus-visible { transform: scale(1.02); border-color: #fff1a8; }
.gb-pick.hot { border-width: 3px; padding-right: 76px; }
.gb-tapme { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: #ffc83d; color: #2b1d00; font-size: 13px; font-weight: 800;
  border-radius: 999px; padding: 4px 10px; animation: gbTapPop 0.9s ease-in-out infinite; }
@keyframes gbPickIn { from { transform: translateY(6px) scale(0.97); } }   /* 투명도는 건드리지 않는다 — 대비 검사가 나타나는 순간을 1:1 로 잰다(매쓰스텝 D39 · SP-6) */
@keyframes gbPickGlow { 50% { box-shadow: 0 0 14px 3px rgba(255, 200, 61, 0.55); } }
@keyframes gbPickShine { 0%, 45% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@keyframes gbTapPop { 50% { transform: translateY(-50%) scale(1.12); } }
@keyframes gbCueBob { 50% { transform: translateY(2px); } }
@media (prefers-reduced-motion: reduce) { .gb-pick, .gb-pick::after, .gb-tapme, .gb-tapcue { animation: none; } }

/* 🏅 개인 티어 모양은 gb-tier.js 가 스스로 싣는다(구성 스타일시트 — CSP 무관 · 키트 CSS 를 안 읽는 게임도 · 1.32) */
/* 찌릿 구슬 연구소 — 밤 과학관 톤(짙은 남색 · 판은 무채색, 말(줄기·단지)은 주황·보라·푸름) · 글자 ≥12px · 누르는 곳 ≥44px */
:root {
  --night: #0b1024; --night2: #141c3a; --ink: #eef2ff; --muted: #b6bfdc; --card: rgba(22, 30, 62, 0.88); --card2: rgba(255, 255, 255, 0.08);
  --amber: #ffb35c; --violet: #a99bff; --sky: #5ab8ff; --good: #7ee0a6; --warn: #ff8a7a; --gold: #ffd166;
  --gb-bg: #121a36; --gb-accent: #ffb35c; --gb-accent-ink: #2a1300; --gb-gold: #ffd166;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--night); color: var(--ink); touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
[hidden] { display: none !important; }
#world { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 1; touch-action: none; }
.ic { width: 1.2em; height: 1.2em; vertical-align: -0.2em; }
kbd { font: 800 11px/1 system-ui; color: #2a1f5c; background: #e7e2ff; border-radius: 4px; padding: 1px 4px; }

/* 첫 화면 뒷그림 — 폭 제한 없는 조상(body 바로 아래) · 반투명 막 · 판 중엔 숨김 */
.home-art { position: fixed; inset: 0; z-index: 2; background: var(--night) url(../assets/art/bg-wide.webp) center/cover no-repeat; pointer-events: none; }
.home-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,12,30,0.55), rgba(8,12,30,0.15) 45%, rgba(8,12,30,0.6)); }
@media (orientation: portrait) { .home-art { background-image: url(../assets/art/bg-tall.webp); } }
body.playing .home-art { display: none; }

.loading, .gl-no { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #2a2160, var(--night) 70%); }
.ld-card { background: var(--card); border-radius: 18px; padding: 22px 26px; min-width: 260px; text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,0.45); border: 1px solid rgba(169,155,255,0.3); }
.ld-title { font-size: 26px; font-weight: 800; color: var(--amber); margin-bottom: 12px; }
.ld-bar { height: 10px; border-radius: 6px; background: #252e58; overflow: hidden; } .ld-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--violet), var(--amber)); transition: width 0.2s; }
.ld-msg { margin-top: 10px; font-size: 15px; color: var(--muted); }

/* 첫 화면 */
.gb-home { position: fixed; inset: 0; z-index: 10; overflow-y: auto; padding: max(12px, env(safe-area-inset-top)) 14px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; touch-action: pan-y; }
.gb-home > * { width: min(440px, 100%); }
@media (orientation: landscape) and (min-width: 900px) { .gb-home { align-items: flex-end; padding-right: max(4vw, 18px); } }
.gb-home-top { display: flex; align-items: center; justify-content: space-between; }
.gb-brand { font-size: 27px; font-weight: 900; color: #fff; text-shadow: 0 0 16px rgba(169,155,255,0.75), 0 2px 0 #241a5c; letter-spacing: -0.5px; }
.gb-brand b { color: var(--amber); }
.gb-tools { display: flex; gap: 8px; }
.gb-icon, .tb-btn { width: 46px; height: 46px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.12); background: var(--card); color: #e9e4ff; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0,0,0,0.3); cursor: pointer; font-size: 20px; }
.buddy { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 16px; padding: 10px 14px; border: 1px solid rgba(169,155,255,0.28); }
.buddy img { width: 64px; height: 64px; object-fit: contain; flex: none; filter: drop-shadow(0 0 10px rgba(169,155,255,0.6)); }
.bd-txt { flex: 1; min-width: 0; }
.buddy .bd-name { font-weight: 800; font-size: 16px; color: #e3ddff; } .buddy .bd-goal { font-size: 14px; color: var(--muted); margin-top: 2px; }
.buddy .bd-bar { height: 8px; border-radius: 5px; background: #252e58; overflow: hidden; margin-top: 6px; } .buddy .bd-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--amber)); }
.gb-play { height: 64px; border: 0; border-radius: 20px; font-size: 21px; font-weight: 900; color: #2a1300; background: linear-gradient(180deg, #ffd08a, #ff9c3d); box-shadow: 0 5px 0 #b8611a, 0 8px 22px rgba(255,140,60,0.35); cursor: pointer; }
.gb-play:active { transform: translateY(3px); box-shadow: 0 2px 0 #b8611a; }
.play-sub { margin: -4px 0 0; font-size: 13.5px; color: var(--muted); text-align: center; }
.lab-card { display: flex; align-items: center; gap: 12px; min-height: 64px; border: 1.5px solid rgba(90,184,255,0.55); border-radius: 18px; background: linear-gradient(90deg, rgba(40,70,130,0.85), rgba(30,40,90,0.85)); color: #fff; text-align: left; padding: 10px 14px; cursor: pointer; }
.lab-card .lab-ic { width: 42px; height: 42px; border-radius: 12px; background: rgba(90,184,255,0.25); display: grid; place-items: center; color: #bfe4ff; flex: none; } .lab-card .lab-ic svg { width: 26px; height: 26px; }
.lab-card b { display: block; font-size: 17px; } .lab-card small { font-size: 13px; color: #cfe6ff; }
.gb-sub { display: flex; gap: 8px; } .gb-sub button { flex: 1; min-height: 48px; border: 1px solid rgba(255,255,255,0.1); border-radius: 14px; background: var(--card); color: var(--ink); font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 5px; cursor: pointer; }
.home-foot { font-size: 12px; color: var(--muted); text-align: center; margin: 4px 0 0; line-height: 1.5; }
.ssam-slot:empty { display: none; }
.home-reset { display: block; margin: 6px auto 0; min-height: 44px; padding: 0 18px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: underline; cursor: pointer; }
.home-reset[data-sure] { color: #ffd0c8; text-decoration: none; background: #5a1f1a; }

/* 오늘 할 일·도장판 */
.ret-card { background: var(--card); border-radius: 16px; padding: 10px 14px; border: 1px solid rgba(255,255,255,0.08); }
.ret-head { display: flex; justify-content: space-between; align-items: baseline; } .ret-head b { font-size: 15px; color: var(--gold); } .ret-n { font-size: 13px; color: var(--muted); }
.ret-list { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ret-list li { display: flex; align-items: center; gap: 8px; font-size: 14px; } .ret-list .ck { width: 20px; height: 20px; border-radius: 6px; border: 2px solid #5c6aa8; display: grid; place-items: center; font-size: 12px; color: var(--good); flex: none; }
.ret-list li.done .tx { color: var(--muted); text-decoration: line-through; } .ret-list i { margin-left: auto; font-style: normal; font-size: 13px; color: var(--muted); }
.ret-foot { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.ret-stamps { display: flex; gap: 6px; margin-top: 8px; } .ret-stamps i { width: 26px; height: 26px; border-radius: 50%; border: 2px dashed #5c6aa8; } .ret-stamps i.on { border-style: solid; border-color: var(--amber); background: radial-gradient(circle, #ffd08a, #ff9c3d); }
.ret-week { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.08); }
.ret-goal { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; margin-top: 4px; } .ret-goal em { font-style: normal; color: var(--muted); }
.ret-goal > i { display: block; height: 7px; border-radius: 5px; background: #252e58; overflow: hidden; } .ret-goal > i > u { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--amber)); text-decoration: none; }
.ret-greet { display: flex; align-items: center; gap: 10px; background: rgba(255,179,92,0.14); border: 1px solid rgba(255,179,92,0.45); border-radius: 14px; padding: 8px 12px; font-size: 14px; }
.ret-greet img { width: 44px; height: 44px; object-fit: contain; }
.ret-res { margin: 8px 0; } .ret-ev { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; padding: 5px 8px; border-radius: 10px; background: rgba(255,255,255,0.06); margin-top: 4px; } .ret-ev b { color: var(--gold); white-space: nowrap; }
.ret-near { margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(169,155,255,0.12); } .ret-near-h { font-size: 14px; color: #e3ddff; }
.ret-tom { font-size: 13px; color: var(--muted); margin-top: 6px; text-align: center; }

/* 판 HUD */
.hud { position: fixed; inset: 0; z-index: 12; pointer-events: none; }
.hud button, .hud .spin-bar, .hud input, .hud label { pointer-events: auto; }
.h-top { position: absolute; left: 0; right: 0; top: max(8px, env(safe-area-inset-top)); display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 0 10px; }
.h-mid { flex: 1; max-width: 420px; display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.h-row { display: flex; justify-content: center; align-items: baseline; gap: 12px; } .h-row.small { font-size: 14px; color: #dfe5ff; font-weight: 700; gap: 10px; }
.h-num { font-size: 32px; font-weight: 900; color: #fff; text-shadow: 0 0 12px rgba(169,155,255,0.8); font-variant-numeric: tabular-nums; line-height: 1.05; }
.h-time { font-size: 20px; font-weight: 900; color: #fff; background: rgba(40,50,110,0.75); border-radius: 10px; padding: 1px 10px; font-variant-numeric: tabular-nums; } .h-time.urgent { background: rgba(170,50,40,0.85); }
.h-meter { position: relative; height: 26px; border-radius: 13px; background: rgba(20,26,58,0.85); border: 1px solid rgba(255,209,102,0.5); overflow: visible; }
.h-meter > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 13px; background: linear-gradient(90deg, #ffcf6a, #ff9c3d); transition: width 0.25s; }
.h-meter > span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13.5px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.7); }
.h-ghost { position: absolute; top: 28px; left: var(--x, 0); transform: translateX(-50%); font-size: 12px; font-weight: 800; border-radius: 8px; padding: 1px 6px; white-space: nowrap; }
.h-ghost.ahead { background: #1f6e48; color: #d7ffe9; } .h-ghost.behind { background: #4a4f66; color: #e6e8f0; }
.chain { color: var(--gold); } .chain.fever { color: #fff; background: linear-gradient(90deg, #ff9c3d, #a99bff); border-radius: 8px; padding: 0 6px; }
.h-chips { position: absolute; top: calc(max(8px, env(safe-area-inset-top)) + 112px); left: 50%; transform: translateX(-50%); display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; width: min(560px, 96vw); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: #fff; background: rgba(20,26,58,0.85); border: 1px solid rgba(255,255,255,0.15); border-radius: 999px; padding: 4px 10px; }
.chip i { width: 12px; height: 12px; border-radius: 50%; background: var(--gc); box-shadow: 0 0 8px var(--gc); } .chip.done { border-color: var(--good); color: var(--good); } .chip.pw { border-color: var(--violet); }
.h-arrows .arrow { position: absolute; display: flex; align-items: center; gap: 6px; transform: translateY(-50%); background: rgba(120,30,30,0.9); color: #fff; border-radius: 12px; padding: 6px 10px; font-size: 13px; font-weight: 800; overflow: hidden; }
.h-arrows .arrow.l { left: 6px; } .h-arrows .arrow.r { right: 6px; flex-direction: row-reverse; }
.h-arrows .arrow.weak { background: rgba(140,110,10,0.92); }
.h-arrows .arrow > i { position: absolute; left: 0; bottom: 0; height: 3px; background: #ffd166; }
.h-arrows .arrow b { display: inline-flex; } .h-arrows .arrow b .ic { width: 20px; height: 20px; }
.h-guide { position: absolute; left: 0; top: 0; width: 44px; height: 44px; animation: guide 1.2s ease-in-out infinite; } .h-guide svg { width: 44px; height: 44px; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6)); }
@keyframes guide { 50% { margin-top: 10px; } }
.h-rule { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); background: rgba(16,20,48,0.9); border: 1px solid rgba(255,209,102,0.5); border-radius: 18px; padding: 12px 18px; text-align: center; width: min(420px, 90vw); }
.h-rule b { display: block; font-size: 19px; color: var(--gold); } .h-rule span { display: block; font-size: 14px; color: #e3e8ff; margin-top: 4px; }
.h-say { position: absolute; left: 50%; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 168px); transform: translateX(-50%); display: flex; gap: 8px; align-items: center; background: rgba(16,20,48,0.92); border: 1px solid rgba(169,155,255,0.45); border-radius: 16px; padding: 6px 12px 6px 6px; max-width: 86vw; }
.h-say img { width: 44px; height: 44px; border-radius: 12px; object-fit: contain; background: rgba(169,155,255,0.15); } .h-say b { font-size: 13px; color: var(--violet); display: block; } .h-say span { font-size: 15px; font-weight: 700; }
.h-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 8px max(8px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.h-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.gas-bar { display: flex; gap: 6px; }
.gas { position: relative; width: 66px; min-height: 58px; border-radius: 14px; border: 2px solid rgba(255,255,255,0.18); background: rgba(16,20,48,0.88); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; padding: 4px 2px; }
.gas i { width: 24px; height: 24px; border-radius: 50%; background: var(--gc); box-shadow: 0 0 12px var(--gc); }
.gas.pat-stripe i { background: repeating-linear-gradient(45deg, var(--gc) 0 4px, #fff 4px 6px); } .gas.pat-wave i { background: radial-gradient(circle at 35% 35%, #fff 0 3px, var(--gc) 4px); } .gas.pat-dot i { background: radial-gradient(circle, #fff 0 2px, var(--gc) 3px); background-size: 8px 8px; }
.gas .gn { font-size: 12px; font-weight: 800; } .gas kbd { position: absolute; right: 3px; top: 3px; display: none; }
.gas.on { border-color: var(--gc); box-shadow: 0 0 0 2px var(--gc), 0 0 16px var(--gc); } .gas.lock { opacity: 0.4; }
.dial-bar { display: flex; align-items: center; gap: 4px; background: rgba(16,20,48,0.88); border-radius: 14px; padding: 4px 6px; border: 1px solid rgba(255,255,255,0.15); }
.dial-ic { color: #dfe5ff; display: grid; place-items: center; } .dial-ic svg { width: 22px; height: 22px; }
.dial-bar button { min-width: 44px; min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: #dfe5ff; font-size: 15px; font-weight: 900; cursor: pointer; } .dial-bar button.on { background: var(--amber); color: #2a1300; }
.freeze { min-width: 64px; min-height: 52px; border: 2px solid #6fb8ff; border-radius: 14px; background: rgba(20,50,90,0.9); color: #d9eeff; font-weight: 800; display: flex; align-items: center; gap: 4px; padding: 0 10px; cursor: pointer; } .freeze:disabled { opacity: 0.4; }
.spin-bar { width: min(640px, 100%); min-height: 72px; border-radius: 18px; background: repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 14px, rgba(255,255,255,0.12) 14px 16px), rgba(16,20,48,0.85); border: 1.5px solid rgba(255,209,102,0.45); display: flex; align-items: center; justify-content: center; gap: 8px; color: #fff5dc; font-size: 14px; font-weight: 800; touch-action: none; cursor: ew-resize; }
.spin-bar.on { border-color: var(--amber); background-color: rgba(60,40,20,0.9); } .spin-ic svg { width: 26px; height: 26px; } .spin-t kbd { margin-left: 3px; display: none; }
.lab-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; background: rgba(16,20,48,0.85); border-radius: 14px; padding: 6px 12px; }
.tube-sl { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: #dff4ff; } .tube-sl input { width: 180px; height: 44px; }
.h-keys { position: absolute; left: 50%; top: calc(max(8px, env(safe-area-inset-top)) + 140px); transform: translateX(-50%); font-size: 12.5px; color: #dfe5ff; background: rgba(16,20,48,0.75); border-radius: 10px; padding: 4px 10px; white-space: nowrap; display: none; }
@media (hover: hover) and (pointer: fine) { .h-keys, .gas kbd, .spin-t kbd { display: inline-block; } .h-keys { display: block; } }
@media (orientation: landscape) and (max-height: 520px) { .h-chips { top: 76px; } .h-say { bottom: 96px; } .spin-bar { min-height: 60px; } .gas { min-height: 50px; } }
body.lab .gas-bar, body.lab .dial-bar { display: flex !important; }

/* 탐구 카드 */
.card-ui { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; padding: 0 10px max(10px, env(safe-area-inset-bottom)); pointer-events: none; }
.card-box { pointer-events: auto; width: min(520px, 100%); background: rgba(14,18,44,0.95); border: 1.5px solid rgba(255,209,102,0.55); border-radius: 20px; padding: 14px 16px; }
.card-h { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--gold); } .card-h img { width: 40px; height: 40px; object-fit: contain; }
.card-q { display: block; font-size: 18px; margin: 8px 0; line-height: 1.45; }
.card-opts { display: flex; flex-direction: column; gap: 6px; } .card-why { font-size: 15px; line-height: 1.6; color: #e9edff; margin: 6px 0; }
.card-gas { display: flex; gap: 6px; justify-content: center; margin: 6px 0; }

/* 배지 — 사실과 놀이 규칙을 가른다 */
.badge { display: inline-block; font-style: normal; font-size: 11.5px; font-weight: 800; border-radius: 999px; padding: 2px 8px; margin-left: 4px; }
.badge.real { background: #1f6e48; color: #d7ffe9; } .badge.play { background: #4b3a8f; color: #ece7ff; }

/* 시트(멈춤·결과·도감·꾸미기·설정) */
.sheet { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(6,8,22,0.55); }
.sh-box { position: relative; width: min(470px, 94vw); max-height: 88vh; overflow-y: auto; background: #151d40; color: var(--ink); border: 1px solid rgba(169,155,255,0.3); border-radius: 22px; padding: 20px 18px 18px; box-shadow: 0 14px 40px rgba(0,0,0,0.5); touch-action: pan-y; }
.sh-x { position: absolute; right: 10px; top: 10px; width: 44px; height: 44px; border: 0; border-radius: 12px; background: #232c58; color: #fff; font-size: 20px; cursor: pointer; }
.sh-h { font-size: 22px; font-weight: 900; margin: 0 0 10px; color: var(--gold); }
.sh-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; } .sh-row > * { flex: 1; } .sh-row.col { flex-direction: column; }
.gb-btn { min-height: 52px; border: 0; border-radius: 16px; font-size: 16px; font-weight: 800; color: #2a1300; background: linear-gradient(180deg, #ffd08a, #ff9c3d); cursor: pointer; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.gb-btn.ghost { background: #232c58; color: #e9e4ff; } .gb-btn.warn { background: #a8402e; color: #fff; }
.big-score { font-size: 46px; font-weight: 900; text-align: center; color: var(--amber); font-variant-numeric: tabular-nums; text-shadow: 0 0 16px rgba(255,156,61,0.5); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; } .stat-grid div { background: #1d2650; border-radius: 12px; padding: 8px 10px; font-size: 14px; } .stat-grid b { display: block; font-size: 20px; }
.note { font-size: 14px; color: var(--muted); text-align: center; margin: 8px 0; line-height: 1.5; } .note.dim { font-size: 12.5px; opacity: 0.85; }
.stamps { display: flex; gap: 8px; justify-content: center; margin: 8px 0; }
.stamps > .stamp { flex: 1; max-width: 130px; text-align: center; background: #1d2650; border-radius: 14px; padding: 8px 6px; border: 2px dashed #3e4a86; color: var(--muted); }
.stamps > .stamp svg { width: 28px; height: 28px; } .stamps > .stamp b { display: block; font-size: 14px; } .stamps > .stamp small { font-size: 12px; }
.stamps > .stamp.on { border-style: solid; border-color: var(--amber); color: #ffe3b8; background: rgba(255,156,61,0.15); }
.pw-grid { display: flex; flex-direction: column; gap: 8px; } .pw { min-height: 64px; border: 1.5px solid rgba(169,155,255,0.5); border-radius: 16px; background: #1d2650; color: #fff; text-align: left; padding: 8px 12px; cursor: pointer; } .pw b { display: block; font-size: 16px; } .pw small { color: var(--muted); font-size: 13px; }
.room-h { font-size: 15px; color: #e3ddff; margin: 12px 0 4px; }
.stage-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.stage-grid button { min-height: 54px; border: 0; border-radius: 12px; background: #1d2650; font-size: 15px; font-weight: 800; color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.stage-grid button.boss { background: #3a2b6e; } .stage-grid button:disabled { opacity: 0.35; } .stage-grid small { font-size: 11px; color: var(--amber); letter-spacing: 1px; } .stage-grid em { font-style: normal; font-size: 11px; color: #d6ccff; }
.dex-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.dex, .cos { min-height: 64px; border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; background: #1d2650; color: #fff; text-align: left; padding: 6px 10px; cursor: pointer; font-size: 13px; }
.dex b, .cos b { display: block; font-size: 13.5px; line-height: 1.35; } .dex:not(.own) b { color: #6c78ad; } .dex .badge { margin: 4px 0 0; }
.cos small { color: var(--muted); } .cos.on { border-color: var(--amber); } .cos.lock { opacity: 0.45; }
.dex-body { font-size: 15px; line-height: 1.65; background: #1d2650; border-radius: 14px; padding: 12px; } .dex-body small { color: var(--muted); }
.toggle { display: flex; justify-content: space-between; align-items: center; min-height: 52px; border-bottom: 1px solid rgba(255,255,255,0.08); font-size: 16px; }
.toggle button { min-width: 84px; min-height: 44px; border: 0; border-radius: 12px; background: #232c58; font-weight: 800; color: #e9e4ff; cursor: pointer; } .toggle button.on { background: var(--amber); color: #2a1300; }
.toast { position: fixed; left: 50%; top: 20%; transform: translateX(-50%); z-index: 45; background: rgba(20,24,56,0.94); border: 1px solid rgba(255,209,102,0.4); color: #fff; padding: 10px 16px; border-radius: 14px; font-size: 16px; font-weight: 700; max-width: 86vw; text-align: center; pointer-events: none; }
/* 결과 화면 — 구슬이 보이게 아래(세로)·오른쪽(가로) 패널 */
.sheet.dock { background: transparent; place-items: end center; pointer-events: none; }
.sheet.dock .sh-box { pointer-events: auto; width: min(560px, 100vw); max-height: 62vh; border-radius: 22px 22px 0 0; }
@media (orientation: landscape) { .sheet.dock { place-items: center end; } .sheet.dock .sh-box { width: min(400px, 40vw); max-height: 94vh; border-radius: 22px 0 0 22px; } }
@media (prefers-reduced-motion: reduce) { .h-guide { animation: none; } }

/* 결과 단추 줄은 시트 아래에 붙는다 — 작은 폰에서 «한 판 더»가 스크롤 밑으로 빠졌다(2026-11-15 probe-retention ②) */
.sh-row.ret-stick { position: sticky; bottom: -18px; z-index: 2; background: #151d40; padding: 10px 0 6px; box-shadow: 0 -12px 14px #151d40; }
/* 가로 폰(낮은 화면) 첫 화면 = 두 단 — 왼쪽 학교 순위 · 오른쪽 반김·찌릿·주 단추(스크롤 없이 «시작»이 보인다 · tools/probe-retention.mjs ①④ · 본보기 쏙쏙) */
@media (orientation: landscape) and (max-height: 520px) {
  #home.gb-home { max-width: none; padding-inline: max(14px, calc((100vw - 900px) / 2)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 14px; row-gap: 8px; align-items: start; }
  #home.gb-home > * { grid-column: 1 / -1; max-width: none; }
  #home > .gb-home-top { grid-column: 1; grid-row: 1; }
  #home > #schoolRank { grid-column: 1; grid-row: 2 / span 4; }
  #home > #retGreet { grid-column: 2; grid-row: 1; align-self: end; }
  #home > #buddyCard { grid-column: 2; grid-row: 2; padding: 6px 12px; } #home > #buddyCard img { width: 48px; height: 48px; }
  #home > #btnPlay { grid-column: 2; grid-row: 3; }
  #home > #playSub { grid-column: 2; grid-row: 4; }
  #home .ret-greet { font-size: 13px; padding: 4px 10px; } #home .ret-greet img { width: 34px; height: 34px; }
}

/* 첫 화면에선 3D 구슬이 뒷배경일 뿐 — 캔버스가 손을 받지 않는다(순위 카드가 «떠서 캔버스를 덮는» 상태가 아니게 · 기본틀 B15) */
body:not(.playing) #world { pointer-events: none; }
/* @gb-story-css v1 — kit/story/story.js 대화창. 게임 스타일시트 끝에 붙인다(정본 = ~/.claude/skills/game-builder/kit/story/story.css).
   변수로 게임 색에 맞춘다: --gbs-box(대화창 바탕) --gbs-ink(글자) --gbs-accent(이름표·선택지 테두리) */
.gbs { position: fixed; inset: 0; z-index: 900; display: block; font-family: inherit; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.gbs[hidden] { display: none; }
.gbs-dim { position: absolute; inset: 0; background: linear-gradient(to top, rgba(10, 6, 20, .78) 0%, rgba(10, 6, 20, .35) 45%, rgba(10, 6, 20, .15) 100%); }
.gbs-stage { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; pointer-events: none; }
.gbs-face { position: absolute; bottom: calc(clamp(118px, 26vh, 190px) - 14px); height: min(62vh, 520px); max-width: 52vw; object-fit: contain; object-position: bottom; filter: brightness(.55) saturate(.8); transform: translateY(6px) scale(.97); transition: filter .18s, transform .18s; }
.gbs-face[hidden] { display: none; }
.gbs-face.left { left: max(2vw, 8px); transform-origin: bottom left; }
.gbs-face.right { right: max(2vw, 8px); transform-origin: bottom right; }
.gbs-face.speaking { filter: none; transform: none; }
.gbs-face.pop { animation: gbs-pop .22s ease-out; }
.gbs-face.speaking.talking { transition: filter .18s; transform: translateY(calc(var(--talk, 0) * -5px)) scale(calc(1 + var(--talk, 0) * .012), calc(1 + var(--talk, 0) * .022)); }   /* 말하는 얼굴 — 소리 크기만큼 들썩 */
@keyframes gbs-pop { 0% { transform: translateY(14px) scale(.94); opacity: .4; } 100% { transform: none; opacity: 1; } }
.gbs-box { position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(860px, calc(100vw - 24px)); min-height: clamp(104px, 22vh, 170px); box-sizing: border-box; padding: 26px 22px 18px; border-radius: 20px; background: var(--gbs-box, rgba(34, 22, 52, .95)); color: var(--gbs-ink, #fff6e6); box-shadow: 0 0 0 3px var(--gbs-accent, rgba(255, 214, 107, .75)), 0 14px 34px rgba(0, 0, 0, .45); }
.gbs-name { position: absolute; left: 18px; top: -18px; padding: 5px 16px; border-radius: 12px; background: var(--c, #ffd66b); color: #2a1a3d; font-weight: 800; font-size: 17px; }
.gbs-name[hidden] { display: none; }
.gbs-text { font-size: clamp(18px, 2.6vw, 23px); line-height: 1.55; font-weight: 700; min-height: 2.2em; white-space: pre-line; word-break: keep-all; }
.gbs.narr .gbs-text { font-style: italic; color: var(--gbs-narr, #e5d8ff); text-align: center; }
.gbs-next { position: absolute; right: 18px; bottom: 10px; width: 14px; height: 14px; border-right: 3px solid currentColor; border-bottom: 3px solid currentColor; transform: rotate(45deg); opacity: 0; }
.gbs.ready .gbs-next { opacity: .85; animation: gbs-bob 0.9s ease-in-out infinite; }
@keyframes gbs-bob { 50% { translate: 0 4px; } }
.gbs-choices { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.gbs-choices:empty { display: none; }
.gbs-choice { min-height: 52px; border-radius: 14px; border: 2px solid var(--gbs-accent, #ffd66b); background: rgba(255, 255, 255, .08); color: inherit; font: inherit; font-size: 19px; font-weight: 800; cursor: pointer; }
.gbs-choice:hover, .gbs-choice:focus-visible { background: rgba(255, 214, 107, .22); outline: none; }
/* 선택지 차례 — 빈 대사 칸·위 여백·«다음» 화살표를 걷어 단추 위아래 여백을 같게(10-20 사용자 «위아래 패딩이 너무 넓다») */
.gbs.choosing .gbs-box { min-height: 0; padding: 16px; }
.gbs.choosing .gbs-text:empty { display: none; }
.gbs.choosing .gbs-text:empty + .gbs-choices { margin-top: 0; }
.gbs.choosing .gbs-next { display: none; }
.gbs-tools { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; display: flex; gap: 8px; }
.gbs-btn { min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 12px; border: 0; background: rgba(34, 22, 52, .85); color: #fff6e6; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.gbs-log { position: absolute; inset: 8% 6%; z-index: 2; padding: 18px; border-radius: 18px; background: rgba(20, 12, 34, .96); color: #fff6e6; display: flex; flex-direction: column; gap: 10px; }
.gbs-log[hidden] { display: none; }
.gbs-log-in { flex: 1; overflow: auto; font-size: 17px; line-height: 1.6; }
.gbs-log-in b { color: var(--gbs-accent, #ffd66b); }
.gbs.out { opacity: 0; transition: opacity .18s; }
@media (max-aspect-ratio: 3/4) { .gbs-face { height: min(46vh, 420px); max-width: 64vw; } .gbs-face.left { left: -4vw; } .gbs-face.right { right: -4vw; } }
@media (prefers-reduced-motion: reduce) { .gbs-face, .gbs-face.pop, .gbs-face.talking, .gbs.ready .gbs-next { animation: none; transition: none; } }

/* 장면 그림(컷신) — 대사창 뒤 화면 가득 · 얼굴은 그 위 · 어둡게 깔던 막은 걷는다(그림이 보이게) */
.gbs-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; animation: gbs-bg-in .5s ease-out; }
.gbs-bg[hidden] { display: none; }
.gbs.has-bg .gbs-dim { background: linear-gradient(to top, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0) 45%); }
@keyframes gbs-bg-in { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .gbs-bg { animation: none; } }
/* @gb-juice-css v3 — kit/juice/juice.css. 게임 스타일시트 끝에 그대로 붙인다(CSP style-src 'self' 라 JS 가 <style> 을 넣지 않는다). */
.gbj-layer{position:fixed;inset:0;pointer-events:none;z-index:40;overflow:hidden}
.gbj-pop{position:absolute;transform:translate(-50%,-50%) scale(var(--s));font:900 22px/1 system-ui,sans-serif;text-shadow:0 2px 0 #0008,0 0 12px currentColor;white-space:nowrap;animation:gbjPop .9s cubic-bezier(.2,1.6,.4,1) forwards}
@keyframes gbjPop{0%{opacity:0;transform:translate(-50%,-50%) scale(calc(var(--s)*.3))}15%{opacity:1;transform:translate(-50%,-80%) scale(calc(var(--s)*1.35))}35%{transform:translate(calc(-50% + var(--dx)),-120%) scale(var(--s))}100%{opacity:0;transform:translate(calc(-50% + var(--dx)),-260%) scale(calc(var(--s)*.9))}}
.gbj-punch{animation:gbjPunch .32s cubic-bezier(.2,2,.4,1)}
@keyframes gbjPunch{0%{transform:scale(1)}30%{transform:scale(var(--gbj-p))}100%{transform:scale(1)}}
.gbj-flash{position:absolute;inset:0;opacity:0}
.gbj-flash.gbj-go{animation:gbjFlash .35s ease-out forwards}
@keyframes gbjFlash{to{opacity:0}}
/* 가운데 큰 글자 — 자리는 게임이 --gbj-banner-top 으로 옮긴다(HUD 배너·선택 카드와 겹치지 않게 · 2026-10-12 끝까지 진화 실측). 좁은 화면에서 넘치지 않게 vw 로 줄인다  · 튀어나올 때 1.25배라 폭은 76vw(2026-10-14 술래가 번진다: 92vw 면 412px 폰에서 양옆이 잘렸다 — banner-fit 실측) */
.gbj-banner{position:absolute;left:50%;top:var(--gbj-banner-top,40%);transform:translate(-50%,-50%);font:900 clamp(20px,6.4vw,40px)/1.1 system-ui,sans-serif;text-align:center;opacity:0;text-shadow:0 3px 0 #000a,0 0 24px currentColor;max-width:76vw;width:max-content}
.gbj-banner.gbj-go{animation:gbjBan var(--d,1.4s) cubic-bezier(.2,1.5,.4,1) forwards}
@keyframes gbjBan{0%{opacity:0;transform:translate(-50%,-50%) scale(.2) rotate(-8deg)}15%{opacity:1;transform:translate(-50%,-50%) scale(1.25) rotate(2deg)}30%{transform:translate(-50%,-50%) scale(1)}80%{opacity:1}100%{opacity:0;transform:translate(-50%,-70%) scale(1.05)}}
/* v3 타격 묶음(DOM 게임용 — 캔버스 게임은 콜백으로 직접 그린다): 찌그러짐·튕겨남·화면 흔들림·하얀 번쩍 */
/* 한 요소에 셋이 같이 걸린다 — animation 하나를 서로 덮지 않게 갈래마다 칸(--gbj-a1~3)을 따로 둔다 */
.gbj-squash,.gbj-knock,.gbj-hitflash{animation:var(--gbj-a1,none),var(--gbj-a2,none),var(--gbj-a3,none)}
.gbj-squash{--gbj-a1:gbjSquash .28s cubic-bezier(.2,2.2,.4,1)}
@keyframes gbjSquash{0%{transform:scale(1)}25%{transform:scale(1.3,.7)}55%{transform:scale(.88,1.12)}100%{transform:scale(1)}}
.gbj-knock{--gbj-a2:gbjKnock .4s cubic-bezier(.2,1.8,.4,1)}
@keyframes gbjKnock{0%{translate:0 0}25%{translate:var(--kx,14px) var(--ky,0)}60%{translate:calc(var(--kx,14px)*-.25) calc(var(--ky,0px)*-.25)}100%{translate:0 0}}
.gbj-shake{animation:gbjShake .3s linear}
@keyframes gbjShake{0%,100%{translate:0 0}20%{translate:calc(var(--sh,5px)*-1) var(--sh,5px)}40%{translate:var(--sh,5px) calc(var(--sh,5px)*-.6)}60%{translate:calc(var(--sh,5px)*-.6) calc(var(--sh,5px)*-.4)}80%{translate:calc(var(--sh,5px)*.4) calc(var(--sh,5px)*.3)}}
.gbj-hitflash{--gbj-a3:gbjWhite .16s steps(1,end)}
@keyframes gbjWhite{0%{filter:brightness(0) invert(1)}100%{filter:none}}
@media (prefers-reduced-motion:reduce){.gbj-pop,.gbj-banner.gbj-go,.gbj-punch,.gbj-squash,.gbj-knock,.gbj-shake,.gbj-hitflash{animation-duration:.01s}}
