/* 얌얌 국어 RPG — base layout. The stage is always 1280×720 and scaled to fit. */
:root {
  --ink: #2a2118;
  --paper: #fff8e7;
  --paper-edge: #c9a96b;
  --primary: #2f7d32;
  --primary-ink: #ffffff;
  --danger: #b3261e;
  --focus: #ffcc00;
  --muted: #6b5d4a;
  --shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #1b2430; overflow: hidden; }
/* tablets: no pinch/double-tap zoom, no pull-to-refresh, no long-press menus or text selection */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
body { position: fixed; inset: 0; overscroll-behavior: none; -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
body { font-family: "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; color: var(--ink); }

#stage {
  position: absolute; left: 50%; top: 50%;
  width: 1280px; height: 720px;
  transform-origin: center center;
  transform: translate(-50%, -50%);
  overflow: hidden;
  background: #8fd3ff;
}
#world {
  position: absolute; inset: 0; width: 1280px; height: 720px;
  image-rendering: pixelated; image-rendering: crisp-edges;
}
#actors {
  position: absolute; inset: 0; width: 1280px; height: 720px; pointer-events: none;
  image-rendering: pixelated; image-rendering: crisp-edges;
}
#ui { position: absolute; inset: 0; }

/* ---------- screens ---------- */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 40px; }
.screen[hidden] { display: none; }

.game-title { margin: 0 0 8px; text-align: center; line-height: 1.1; }
.title-small { display: block; font-size: 34px; color: #fff; text-shadow: 3px 3px 0 #2a5d2c; letter-spacing: 2px; }
.title-main {
  display: block; font-size: 96px; font-weight: 900; color: #ffe066;
  text-shadow: 6px 6px 0 #7a3e12, -3px -3px 0 #7a3e12, 3px -3px 0 #7a3e12, -3px 3px 0 #7a3e12;
  letter-spacing: 4px;
}

.menu { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.menu-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn {
  font: inherit; font-size: 28px; font-weight: 700;
  min-width: 200px; min-height: 64px; padding: 10px 28px;
  border: 4px solid var(--ink); border-radius: 14px;
  background: var(--paper); color: var(--ink);
  box-shadow: var(--shadow); cursor: pointer;
}
@media (hover: hover) { .btn:hover:not(:disabled) { background: #fff1c9; } }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25); }
.btn:focus-visible { outline: 6px solid var(--focus); outline-offset: 4px; }
.btn:disabled { background: #d9d2c2; color: #8a8170; border-color: #8a8170; cursor: not-allowed; box-shadow: none; }
.btn-big { font-size: 38px; min-width: 380px; min-height: 84px; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
@media (hover: hover) { .btn-primary:hover:not(:disabled) { background: #3a9440; } }
.btn-danger { background: var(--danger); color: #fff; }
@media (hover: hover) { .btn-danger:hover:not(:disabled) { background: #cc3a31; } }

.save-info {
  margin: -4px 0 6px; font-size: 22px; color: #fff; background: rgba(0, 0, 0, 0.35);
  padding: 4px 14px; border-radius: 8px; min-height: 30px;
}

.screen-placeholder, .screen-pause { background: transparent; color: #fff; text-align: center; }
.screen-placeholder h2, .screen-pause h2 { font-size: 60px; margin: 0; text-shadow: 4px 4px 0 #000; }
.placeholder-body, .screen-pause p { font-size: 30px; margin: 0; text-shadow: 2px 2px 0 #000; }
.placeholder-info { font-size: 24px; margin: 0; background: rgba(0, 0, 0, 0.4); padding: 6px 14px; border-radius: 8px; }
.placeholder-info:empty { display: none; }
.screen-pause { background: rgba(10, 20, 30, 0.7); z-index: 20; }

/* ---------- HUD ---------- */
.hud { position: absolute; top: 16px; right: 16px; z-index: 10; }
.hud[hidden] { display: none; }
.btn-pause { min-width: 0; min-height: 60px; font-size: 26px; padding: 6px 18px; display: flex; align-items: center; gap: 10px; }
.pause-icon { width: 22px; height: 26px; border-left: 8px solid currentColor; border-right: 8px solid currentColor; }

/* ---------- dialogs ---------- */
.dialog-layer { position: absolute; inset: 0; pointer-events: none; z-index: 30; }
.dialog-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); display: flex; align-items: center; justify-content: center; pointer-events: auto; }
.dialog {
  background: var(--paper); border: 6px solid var(--paper-edge); border-radius: 20px;
  padding: 32px 44px; max-width: 900px; text-align: center; box-shadow: 0 10px 0 rgba(0, 0, 0, 0.3);
}
.dialog h2 { font-size: 44px; margin: 0 0 16px; }
.dialog h3 { font-size: 28px; margin: 0 0 8px; }
.dialog p { font-size: 28px; margin: 0 0 24px; line-height: 1.5; }
.dialog .muted { color: var(--muted); font-size: 22px; }
.settings-block { border: 3px dashed var(--paper-edge); border-radius: 12px; padding: 16px 20px; margin-bottom: 24px; }

/* ---------- hero select ---------- */
.screen-hero { color: #fff; text-align: center; gap: 20px; }
.screen-heading { font-size: 52px; margin: 0; text-shadow: 4px 4px 0 #000; }
.hero-row { display: flex; gap: 56px; }
.hero-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--paper); border: 6px solid var(--ink); border-radius: 20px; padding: 16px 24px 14px;
  cursor: pointer; font: inherit; color: var(--ink); box-shadow: 0 8px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.12s;
}
@media (hover: hover) { .hero-card:hover { transform: translateY(-4px); } }
.hero-card:focus-visible { outline: 8px solid var(--focus); outline-offset: 4px; }
.hero-card.chosen { border-color: var(--primary); background: #e8f6e0; transform: translateY(-8px); box-shadow: 0 0 0 6px var(--focus), 0 12px 0 rgba(0, 0, 0, 0.35); }
.hero-canvas { width: 288px; height: 264px; image-rendering: pixelated; image-rendering: crisp-edges; }
.hero-name { font-size: 34px; font-weight: 700; }
.hero-card.chosen .hero-name::before { content: "✔ "; color: var(--primary); }
.hero-hint { font-size: 28px; margin: 0; min-height: 36px; text-shadow: 2px 2px 0 #000; }

/* ---------- save code ---------- */
.code-box { display: grid; grid-template-columns: repeat(4, auto); gap: 12px 16px; justify-content: center; margin: 8px 0 20px; }
.code-group {
  font-family: "Consolas", "D2Coding", monospace; font-size: 44px; font-weight: 700; letter-spacing: 6px;
  background: #fff; border: 3px solid var(--ink); border-radius: 10px; padding: 4px 12px 4px 8px;
  display: flex; align-items: center; gap: 10px;
}
.code-num {
  font-family: "Malgun Gothic", sans-serif; font-size: 18px; letter-spacing: 0; color: #fff; background: var(--muted);
  border-radius: 50%; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
}
.code-status:empty, .code-msg:empty { display: none; }
.code-input {
  width: 100%; font-family: "Consolas", "D2Coding", monospace; font-size: 36px; letter-spacing: 3px; text-transform: uppercase;
  padding: 12px 16px; border: 4px solid var(--ink); border-radius: 12px; margin-bottom: 12px; text-align: center;
}
.code-input:focus-visible { outline: 6px solid var(--focus); outline-offset: 2px; }
.code-msg { color: var(--danger); font-size: 26px; font-weight: 700; }
.dialog p { white-space: pre-line; }

/* ---------- toast ---------- */
.toast {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 40; pointer-events: none; max-width: 900px; text-align: center;
  background: #fff; border: 4px solid var(--ink); border-radius: 12px; padding: 12px 24px;
  font-size: 26px; box-shadow: var(--shadow); transition: opacity 0.5s;
}
.toast.hide { opacity: 0; }

/* ---------- small buttons, toggles ---------- */
.btn-small { font-size: 22px; min-width: 0; min-height: 52px; padding: 6px 16px; }
.toggle-row { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 18px; }
.toggle { min-width: 360px; }
.toggle.on { background: #e8f6e0; border-color: var(--primary); }

/* ---------- question ---------- */
.screen-question { padding: 18px 24px; z-index: 5; }
.q-panel {
  width: 1200px; height: 684px; background: rgba(255, 248, 231, 0.97); border: 6px solid var(--paper-edge); border-radius: 22px;
  padding: 16px 28px 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 10px 0 rgba(0, 0, 0, 0.3);
}
.screen-question.solved .q-panel { border-color: var(--primary); }
.q-top { display: flex; align-items: center; gap: 12px; min-height: 40px; padding-right: 130px; }
.q-tag { font-size: 22px; font-weight: 700; background: var(--ink); color: #fff; border-radius: 10px; padding: 4px 14px; }
.q-level { font-size: 22px; font-weight: 700; background: #ffcf4a; border: 3px solid var(--ink); border-radius: 10px; padding: 2px 12px; }
.q-level[hidden] { display: none; }
.q-spacer { flex: 1; }
.q-prompt { font-size: 38px; margin: 0; line-height: 1.3; text-align: center; }
.q-not { text-decoration: underline; text-decoration-thickness: 4px; text-underline-offset: 6px; color: var(--danger); }
.q-media { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.q-media[hidden] { display: none; }
.q-passage {
  font-size: 27px; line-height: 1.55; background: #fff; border: 3px solid var(--paper-edge); border-radius: 14px;
  padding: 10px 22px; white-space: pre-line; max-width: 1080px; text-align: left;
}
.q-show { display: flex; align-items: center; gap: 28px; }
.q-picture { font-size: 84px; line-height: 1; }
.q-display { font-size: 52px; font-weight: 900; letter-spacing: 4px; background: #fff; border: 4px solid var(--ink); border-radius: 14px; padding: 2px 24px; }
.q-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 0; }
.q-sub { font-size: 20px; color: var(--muted); margin: 0; }
.q-choices { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(220px, 1fr)); width: 100%; max-width: 1060px; }
.q-choices.n2 { grid-template-columns: repeat(2, minmax(220px, 360px)); justify-content: center; }
.q-choices.n4 { grid-template-columns: repeat(4, 1fr); }
.q-choices.n5 { grid-template-columns: repeat(5, 1fr); }
.q-choices.long { grid-template-columns: 1fr; max-width: 900px; gap: 12px; }
.q-choices.long.n4 { grid-template-columns: repeat(2, 1fr); }
.q-choice, .q-card, .q-slot, .q-match {
  position: relative; font: inherit; font-size: 36px; font-weight: 700; color: var(--ink);
  background: #fff; border: 5px solid var(--ink); border-radius: 18px; min-height: 96px; padding: 10px 18px;
  cursor: pointer; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25); display: flex; align-items: center; justify-content: center; gap: 10px;
}
.q-choices.long .q-choice { min-height: 70px; font-size: 30px; justify-content: flex-start; padding-left: 64px; }
.q-choice.short .q-text { font-size: 60px; }
@media (hover: hover) { .q-choice:hover:not(:disabled), .q-card:hover, .q-match:hover:not(.done) { background: #fff6d8; } }
.q-choice:focus-visible, .q-card:focus-visible, .q-slot:focus-visible, .q-match:focus-visible { outline: 6px solid var(--focus); outline-offset: 3px; }
.q-choice.picked { background: #dff3d4; border-color: var(--primary); }
.q-choice.wrong { background: #eee7dc; color: #8a8170; border-style: dashed; box-shadow: none; cursor: default; }
.q-num {
  position: absolute; left: 10px; top: 8px; font-size: 18px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--muted); color: #fff; display: flex; align-items: center; justify-content: center;
}
.q-choices.long .q-num { top: 50%; transform: translateY(-50%); left: 16px; }
.q-mark { position: absolute; right: 12px; top: 6px; font-size: 26px; }
.q-slots { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.q-slot { min-width: 190px; border-style: dashed; background: #fffdf6; color: var(--ink); }
.q-slot.filled { border-style: solid; background: #e8f3ff; }
.q-slot.locked { background: #dff3d4; border-color: var(--primary); cursor: default; }
.q-pool { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; min-height: 100px; }
.q-card { background: #fff3c4; font-size: 32px; }
.q-compose-row { display: flex; align-items: center; gap: 22px; }
.q-compose-parts { display: flex; gap: 8px; min-width: 260px; min-height: 96px; align-items: center; justify-content: center; background: #fff; border: 4px dashed var(--paper-edge); border-radius: 16px; padding: 6px 12px; }
.q-jamo { font-size: 52px; font-weight: 900; }
.q-arrow { font-size: 48px; }
.q-compose-result { font-size: 84px; font-weight: 900; min-width: 130px; min-height: 120px; display: flex; align-items: center; justify-content: center; background: #fff; border: 5px solid var(--ink); border-radius: 18px; }
.q-match-wrap { display: flex; align-items: center; gap: 30px; }
.q-match-col { display: flex; flex-direction: column; gap: 14px; }
.q-match { min-width: 240px; min-height: 84px; }
.q-match-pic .q-text { font-size: 56px; }
.q-match.picked { background: #fff1a8; border-color: #c48a00; }
.q-match.done { cursor: default; box-shadow: none; }
.q-match.p1 { background: #dff3d4; } .q-match.p2 { background: #dbeaff; } .q-match.p3 { background: #f6dcf0; } .q-match.p4 { background: #fff0cc; }
.q-match-mid { font-size: 48px; color: var(--muted); }
.q-msg { font-size: 27px; margin: 0; min-height: 40px; text-align: center; font-weight: 700; line-height: 1.35; }
.q-msg.wrong { color: #8a4a00; }
.q-msg.right { color: var(--primary); font-size: 32px; }
.q-msg.info { color: #1f5f99; }
.q-tools { display: flex; align-items: center; gap: 12px; }
.q-tools .btn[hidden] { display: none; }
.q-submit { min-width: 300px; }

/* ---------- exploration HUD ---------- */
.explore-hud { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.explore-hud[hidden] { display: none; }
.eh-top {
  position: absolute; left: 16px; top: 16px; display: flex; align-items: center; gap: 18px;
  background: rgba(255, 248, 231, 0.94); border: 4px solid var(--ink); border-radius: 14px; padding: 8px 18px; font-size: 26px; font-weight: 700;
}
.eh-dots { letter-spacing: 4px; color: #c0504d; }
.eh-bottom { position: absolute; left: 16px; right: 16px; bottom: 14px; display: flex; align-items: center; gap: 14px; pointer-events: auto; }
.eh-bottom[hidden] { display: none; }
.eh-move { min-width: 110px; min-height: 80px; font-size: 38px; touch-action: none; user-select: none; }
.eh-jump { font-size: 26px; }
.eh-guide { flex: 1; text-align: center; margin: 0; font-size: 24px; color: #fff; text-shadow: 2px 2px 0 #000; }
.eh-banner {
  position: absolute; left: 50%; top: 150px; transform: translateX(-50%); text-align: center;
  background: rgba(42, 33, 24, 0.85); color: #fff; border-radius: 18px; padding: 18px 40px; display: flex; flex-direction: column; gap: 6px;
}
.eh-banner[hidden] { display: none; }
.eh-banner strong { font-size: 48px; color: #ffe066; }
.eh-banner span { font-size: 28px; }
.eh-banner.fade { animation: bannerFade 3.6s forwards; }
@keyframes bannerFade { 0% { opacity: 0; } 10% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- boss intro / stage clear / ending ---------- */
.screen-boss { justify-content: flex-start; padding-top: 96px; }
.boss-card, .clear-card, .end-card {
  background: rgba(255, 248, 231, 0.97); border: 6px solid var(--paper-edge); border-radius: 22px; padding: 26px 48px; text-align: center;
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.3); display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.boss-title { font-size: 46px; margin: 0; color: #7a1f2b; }
.boss-text { font-size: 28px; margin: 0; white-space: pre-line; line-height: 1.5; }
.screen-clear { background: rgba(10, 20, 30, 0.45); }
.clear-title { font-size: 50px; margin: 0; }
.clear-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; }
.clear-list li { background: #fff; border: 4px solid var(--ink); border-radius: 14px; padding: 10px 24px; font-size: 28px; display: flex; gap: 12px; align-items: center; }
.clear-list strong { font-size: 34px; color: var(--primary); }
.clear-level { font-size: 28px; margin: 0; color: #8a4a00; font-weight: 700; }
.clear-level:empty, .clear-card .muted:empty { display: none; }
.clear-card .muted { font-size: 22px; margin: 0; color: var(--muted); }
.clear-card .btn[hidden] { display: none; }
.clear-card .btn-big, .end-card .btn-big { min-width: 300px; }
.end-title { font-size: 54px; margin: 0; color: #2f7d32; }
.end-text { font-size: 30px; margin: 0; white-space: pre-line; line-height: 1.6; }
.end-sum { font-size: 28px; margin: 0; white-space: pre-line; font-weight: 700; background: #fff; border: 4px solid var(--ink); border-radius: 14px; padding: 10px 30px; }

/* ---------- map ---------- */
.screen-map { flex-direction: row; align-items: stretch; justify-content: flex-start; gap: 18px; padding: 20px 20px 20px 20px; }
.map-side {
  width: 330px; display: flex; flex-direction: column; gap: 8px; align-items: stretch; max-height: 680px; overflow: hidden;
  background: rgba(255, 248, 231, 0.96); border: 5px solid var(--paper-edge); border-radius: 20px; padding: 14px;
}
.map-hero { display: flex; flex-direction: column; align-items: center; }
.map-hero-canvas { width: 120px; height: 110px; image-rendering: pixelated; image-rendering: crisp-edges; }
.map-info { width: 100%; text-align: center; }
.map-info p { margin: 2px 0; }
.map-title { font-size: 22px; color: #8a4a00; font-weight: 700; }
.map-name { font-size: 24px; font-weight: 700; }
.map-stats { font-size: 22px; font-weight: 700; }
.exp { margin: 4px 0; }
.exp-bar { height: 16px; background: #e6dcc6; border: 3px solid var(--ink); border-radius: 8px; overflow: hidden; }
.exp-fill { height: 100%; background: #5ab0ff; }
.exp-text { font-size: 18px; color: var(--muted); }
.map-points { min-width: 0; font-size: 24px; min-height: 56px; }
.map-points[hidden] { display: none; }
.map-village { display: flex; flex-direction: column; gap: 10px; border-top: 3px dashed var(--paper-edge); padding-top: 10px; }
.map-village h3 { margin: 0; font-size: 24px; text-align: center; }
.map-village .btn-big { min-width: 0; font-size: 26px; min-height: 64px; }
.map-main { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.map-nodes { position: relative; width: 880px; height: 600px; }
.map-path { position: absolute; inset: 0; width: 880px; height: 560px; }
.map-path polyline { fill: none; stroke: #fff3c4; stroke-width: 14; stroke-dasharray: 2 22; stroke-linecap: round; }
.map-node {
  position: absolute; width: 150px; height: 118px; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--paper); border: 5px solid var(--ink); border-radius: 18px; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px;
}
.map-node:focus-visible { outline: 6px solid var(--focus); outline-offset: 4px; }
@media (hover: hover) { .map-node:hover { transform: translateY(-3px); } }
.map-node-num { font-size: 30px; font-weight: 900; }
.map-node-name { font-size: 22px; font-weight: 700; }
.map-node-state { font-size: 17px; color: var(--muted); }
.map-node.open { background: #fff1a8; border-color: #c48a00; }
.map-node.open .map-node-state { color: #8a4a00; font-weight: 700; }
.map-node.cleared { background: #dff3d4; border-color: var(--primary); }
.map-node.cleared .map-node-state { color: var(--primary); font-weight: 700; }
.map-node.locked { background: #d9d2c2; color: #6b6255; }
.map-node.boss::after { content: "👑"; position: absolute; top: -18px; right: -10px; font-size: 28px; }
.region-dialog p { font-size: 26px; margin: 0 0 14px; }
.region-goal { font-weight: 700; }
.region-lock { color: var(--danger); font-weight: 700; }
.region-done { color: var(--primary); font-weight: 700; }

/* ---------- allocator ---------- */
.alloc-dialog { max-width: 1100px; }
.alloc-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.alloc-row { display: grid; grid-template-columns: 140px 64px 60px 64px 1fr; align-items: center; gap: 10px; background: #fff; border: 3px solid var(--paper-edge); border-radius: 12px; padding: 6px 12px; }
.alloc-name { font-size: 28px; font-weight: 700; text-align: left; }
.alloc-btn { min-width: 0; min-height: 56px; width: 64px; padding: 0; font-size: 34px; }
.alloc-val { font-size: 34px; font-weight: 900; }
.alloc-line { font-size: 20px; text-align: left; color: var(--muted); line-height: 1.3; }
.alloc-left { font-size: 28px !important; font-weight: 700; margin: 4px 0 16px !important; }
.alloc-dialog .btn-big { min-width: 220px; font-size: 30px; }

/* ---------- shop ---------- */
.shop-dialog { width: 1000px; max-width: 1000px; padding: 22px 30px; }
.shop-dialog h2 { margin-bottom: 6px; }
.shop-gold { font-size: 28px !important; font-weight: 700; margin: 0 0 10px !important; }
.shop-tabs { display: flex; gap: 10px; justify-content: center; margin-bottom: 12px; }
.shop-tab { min-width: 160px; font-size: 24px; min-height: 54px; }
.shop-tab.on { background: var(--ink); color: #fff; }
.shop-list { display: flex; flex-direction: column; gap: 8px; max-height: 380px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; margin-bottom: 14px; padding: 4px; }
.shop-item { display: grid; grid-template-columns: 70px 1fr 220px; align-items: center; gap: 12px; background: #fff; border: 3px solid var(--paper-edge); border-radius: 12px; padding: 6px 12px; text-align: left; }
.shop-item.wearing { border-color: var(--primary); background: #f0faea; }
.shop-icon { font-size: 44px; text-align: center; }
.shop-desc { display: flex; flex-direction: column; font-size: 20px; }
.shop-desc strong { font-size: 26px; }
.shop-ok { color: var(--primary); font-weight: 700; }
.shop-need { color: #8a4a00; font-weight: 700; }
.shop-item .btn { min-width: 0; font-size: 24px; min-height: 56px; }
.shop-list .muted { font-size: 20px !important; margin: 4px 0 0 !important; }

/* ---------- bestiary ---------- */
.best-dialog { width: 980px; max-width: 980px; padding: 22px 30px; }
.best-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 12px; }
.best-card { font: inherit; font-size: 20px; font-weight: 700; background: #fff; border: 4px solid var(--ink); border-radius: 14px; padding: 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.best-card.unknown { background: #e9e2d4; color: #6b6255; }
.best-card:focus-visible { outline: 6px solid var(--focus); outline-offset: 3px; }
.best-canvas { width: 120px; height: 130px; image-rendering: pixelated; image-rendering: crisp-edges; }
.best-detail { font-size: 24px !important; min-height: 72px; background: #fff; border: 3px dashed var(--paper-edge); border-radius: 12px; padding: 8px 14px; margin: 0 0 14px !important; }

.noscript { color: #fff; font-size: 24px; text-align: center; margin-top: 40vh; }

@media (prefers-reduced-motion: reduce) {
  .btn:active:not(:disabled) { transform: none; }
  .toast { transition: none; }
}

/* ---------- tablets ---------- */
#rotate { display: none; position: fixed; inset: 0; z-index: 1000; background: #1b2430; color: #fff;
  flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; font-size: 28px; padding: 24px; }
#rotate.show { display: flex; }
#rotate p { margin: 0; }
.rotate-icon { font-size: 80px; }
.fs-btn { position: absolute; left: 20px; bottom: 20px; z-index: 6; }
.fs-btn[hidden] { display: none; }
html.touch .btn-small { min-height: 60px; padding: 8px 20px; }
html.touch .eh-move { min-width: 150px; min-height: 110px; font-size: 48px; }
html.touch .eh-jump { font-size: 30px; }
html.touch .eh-guide { font-size: 22px; }
html.touch .q-choice, html.touch .q-card, html.touch .q-match { touch-action: manipulation; }
/* keep the code box above the on-screen keyboard */
html.touch .dialog-backdrop:has(input:focus) { align-items: flex-start; padding-top: 30px; }
