:root {
  color-scheme: dark;
  --ink: #1f2119;
  --muted: #aaa888;
  --light: #ddd1a5;
  --paper: #e6d9ad;
  --gold: #d9b575;
  --green: #a8ba8e;
  --wood: #47362a;
  --mono: "IBM Plex Mono", Consolas, "Courier New", monospace;
  --text: "Microsoft JhengHei", "PingFang TC", "Noto Sans CJK TC", system-ui, sans-serif;
  font-family: var(--text);
  background: #171b16;
  color: var(--light);
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 300px;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% 26%, #31392a 0%, transparent 70%),
    repeating-linear-gradient(0deg, #09100a26 0 1px, transparent 1px 4px),
    #171b16;
}
button, input { font: inherit; }
button { cursor: pointer; color: inherit; touch-action: manipulation; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible { outline: 2px dashed #e8bd6b; outline-offset: 3px; }
.doc button:focus-visible, .notice button:focus-visible, .title-folder button:focus-visible { outline-color: #704b2b; }
h1, h2, p { margin: 0; }
canvas { display: block; width: 100%; image-rendering: pixelated; }
#game { width: min(calc(100% - 76px), 1280px); margin: 0 auto; padding: 25px 0 18px; }
.masthead { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.wordmark { display: flex; align-items: center; gap: 13px; }
.grading-icon { width: 44px; height: 44px; flex: none; image-rendering: pixelated; box-shadow: 2px 2px #111610; }
.wordmark h1 { font: 900 clamp(17px, 2.6vw, 32px)/.98 var(--mono); letter-spacing: -.065em; color: #eee2b3; text-shadow: 2px 3px #171911; }
.wordmark h1 span { color: #bc755b; margin-inline-end: .08em; }
.wordmark p { margin-top: 6px; color: #b6b794; font-size: 12px; letter-spacing: .13em; }
.wordmark p span { color: #ad8152; margin-inline: 2px; }
.header-audio { display: flex; align-items: center; gap: 12px; flex: none; font-size: 12px; color: #e0d2a5; }
.header-audio label { display: flex; align-items: center; justify-content: end; gap: 5px; white-space: nowrap; }
.header-audio input { margin: 0; accent-color: #a8b98d; }
.header-audio input[type="range"] { width: clamp(80px, 12vw, 124px); height: 24px; }
.console-button, .book-tool {
  background: #343a2d; border: 1px solid #65664d; box-shadow: inset 0 1px #82806b, 2px 3px #151812;
  padding: 6px 11px; font-size: 13px; white-space: nowrap;
}
.console-button:not(:disabled):hover, .book-tool:hover { background: #50553d; }
.machine {
  border: 2px solid #787456; padding: 4px; background: #36392a;
  box-shadow: inset 0 0 0 2px #1c2118, 0 0 0 2px #141711, 7px 8px #10150f, 0 20px 50px #0b100b73;
}
.hall {
  position: relative; overflow: hidden; background: #4b5346;
  border: 2px solid #22271e; box-shadow: 0 2px #837658;
  height: clamp(139px, 15vw, 203px);
}
.hall-art { position: absolute; inset: 0; }
.hall canvas { width: 100%; height: 100%; }
.hall-caption, .queue {
  position: absolute; z-index: 1; background: #202920e8; color: #d0c69d;
  top: 8px; left: 14px; padding: 6px 9px; border: 1px solid #8a8361;
  box-shadow: 2px 2px #273125; font: 12px var(--mono); letter-spacing: .04em;
}
.hall-caption b, .queue { font-family: var(--text); }
.hall-caption span:not(.signal) { color: #97936e; }
.signal { display: inline-block; width: 7px; height: 7px; margin-right: 4px; background: #aac184; box-shadow: inset -2px -2px #74935f, 0 0 7px #98ac6870; }
.queue { left: auto; right: 14px; }
.queue:empty { display: none; }
.queue b { font: bold 13px var(--mono); margin-left: 3px; }
.station { display: grid; grid-template-columns: 23% minmax(0, 1fr) 16%; gap: 3px; margin-top: 4px; align-items: stretch; background: #25291f; }
.window {
  background: repeating-linear-gradient(0deg, #242b21 0 2px, transparent 2px 22px), #343b2d;
  border: 2px solid #1e241c; min-width: 0; overflow: hidden;
}
.booth-label, .press-head {
  height: 32px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; border-bottom: 3px solid #1d2219;
  background: linear-gradient(#737658 0 2px, #464d38 2px 85%, #363e2e 85%); color: #e0d2a5;
  font-weight: 800; font-size: 12px; letter-spacing: .15em;
}
.booth-label b { font: bold 13px var(--mono); background: #282e22; border: 1px solid #828266; padding: 2px 5px; }
.booth { position: relative; background: #28382c; overflow: hidden; }
.booth canvas { margin: 0 auto; }
.booth-shade { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 8px 0 #18261d55, inset 8px 0 #151d1744, inset -9px 0 #151d1744; }
.booth.arriving canvas { animation: arrive .38s steps(9, end) both; }
.booth.departing canvas { animation: depart .30s steps(8, end) both; }
@keyframes arrive { from { transform: translateX(48%); opacity: .25; } to { transform: none; opacity: 1; } }
@keyframes depart { to { transform: translateX(-63%); opacity: 0; } }
.sill {
  position: relative; height: 27px; background: linear-gradient(#a39e74 0 3px, #6b7355 3px 8px, #7b8060 8px 19px, #444d38 19px 24px, #232c20 24px);
  display: flex; gap: 4px; padding: 3px 7px 8px; align-items: stretch;
}
.sill i { width: 3px; background: #b3a77a; box-shadow: 2px 2px #51563f; opacity: .8; }
.sill span { flex: 1; margin: 7px 10px 2px; background: #31382a; border-bottom: 2px solid #9d9570; }
.student-info { padding: 13px 12px 12px; }
.student-id { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.student-id strong { font-size: 19px; color: #e5d4a3; letter-spacing: .04em; }
.student-id small { font-size: 11px; color: #b1ad88; }
.speech {
  position: relative; margin-top: 11px; color: #343329; font-size: 13px; font-weight: 700; line-height: 1.5;
  background: #cfc299; padding: 8px 10px; box-shadow: 2px 3px #20251c;
}
.speech::before { content: ""; position: absolute; top: -5px; left: 14px; width: 7px; height: 6px; background: #cfc299; clip-path: polygon(0 100%,0 67%,33% 67%,33% 33%,67% 33%,67% 0,100% 0,100% 100%); }
.talk, .skip { border: 0; background: none; padding: 6px 0 2px; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.lesson { border: 1px dashed #8d8057; background: #292e23; margin-top: 13px; padding: 8px; font-size: 12px; line-height: 1.45; color: #dad1aa; }
.lesson b { display: flex; justify-content: space-between; color: #e9bf82; font-size: 12px; }
.lesson b span { font: bold 12px var(--mono); }
.lesson p { margin-top: 3px; }
.skip { color: #c1ba95; }
.desk {
  position: relative; min-width: 0; min-height: max(527px, var(--sheet-space, 0px)); isolation: isolate;
  background:
    repeating-linear-gradient(0deg, #241b161e 0 1px, transparent 1px 5px),
    repeating-linear-gradient(92deg, #291d18 0 1px, #503b2a 1px 3px, transparent 3px 127px),
    repeating-linear-gradient(0deg, #201b164d 0 2px, transparent 2px 37px),
    radial-gradient(ellipse at 46% 28%, #6a5039 0, #47362a 69%, #3b2d24 100%);
  border: 2px solid #30291f;
  box-shadow: inset 0 2px #8a6d4d, inset 0 -7px #29221a, inset 2px 0 #68513a, inset -2px 0 #68513a;
}
.desk::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .46; z-index: -1;
  background:
    repeating-linear-gradient(177deg, transparent 0 21px, #99815b25 21px 22px, transparent 22px 30px),
    repeating-linear-gradient(13deg, transparent 0 7px, #31211930 7px 8px, transparent 8px 13px);
}
#papers { position: absolute; inset: 0; }
.desk:has(.feedback) { min-height: max(630px, var(--sheet-space, 0px)); }
.desk-inlay {
  position: absolute; inset: 20px 17px 21px 17px; pointer-events: none;
  background-color: #333c2b; background-image: radial-gradient(#7b7c523f 1px, transparent 1px), repeating-linear-gradient(0deg, #1b261c29 0 1px, transparent 1px 3px);
  background-size: 5px 5px, auto; border: 2px solid #252a1d; box-shadow: 0 1px #9c8153, inset 0 0 0 3px #687253, inset 0 0 0 5px #39412d;
}
.physical-tools { position: absolute; top: 42px; left: 31px; width: 87px; z-index: 4; display: grid; justify-items: start; gap: 12px; }
.pencil {
  display: block; position: relative; width: 9px; height: 76px;
  border: 1px solid #492b24; background: linear-gradient(90deg, #572d27 0 2px, #b05e50 2px 4px, #8f4034 4px 7px, #542e27 7px);
  box-shadow: 3px 3px #202419b0; transform: rotate(16deg);
}
.pencil::before { content: ""; position: absolute; top: -3px; left: -2px; width: 11px; height: 18px; background: linear-gradient(90deg,#67352c 0 2px,#a9584b 2px 7px,#522a22 7px); border-bottom: 2px solid #cd9f72; }
.pencil::after { content: ""; position: absolute; bottom: -6px; left: 0; width: 7px; height: 6px; background: #c7a174; clip-path: polygon(0 0,100% 0,100% 33%,72% 33%,72% 66%,57% 66%,57% 100%,43% 100%,43% 66%,27% 66%,27% 33%,0 33%); }
.book-tool { color: #e2d7ad; background: #3c4b37; font-size: 11px; padding: 7px 6px; }
.tray {
  position: absolute; bottom: 33px; right: 29px; width: 115px; height: 43px; z-index: 4; padding: 3px 7px;
  background: repeating-linear-gradient(90deg, #6c583840 0 2px, transparent 2px 9px), #39372a;
  border: 3px solid #75694b; border-bottom-width: 5px; box-shadow: 3px 3px #20261b, inset 0 3px #24271d;
  color: #d7be87; display: flex; align-items: center; justify-content: space-between; gap: 4px; font-weight: bold; font-size: 12px;
}
.tray small { font-family: var(--mono); font-size: 10px; color: #a6a383; }
.tray:not(:disabled), .tray.over { background-color: #58654a; border-color: #a0ab78; }
.press {
  min-width: 0; background: repeating-linear-gradient(90deg, #24281d44 0 2px, transparent 2px 13px), linear-gradient(90deg, #444a38 0 4%, #5d624b 4% 9%, #494f3d 9% 91%, #666850 91% 96%, #373b2e 96%);
  border: 2px solid #21251d; display: flex; flex-direction: column; align-items: stretch; box-shadow: inset 0 -4px #383d2d;
}
.press-head { padding: 0 8px; text-align: center; justify-content: space-between; gap: 3px; white-space: nowrap; }
.press-head i, .press-foot i { height: 5px; width: 5px; background: #a59a70; box-shadow: inset -2px -2px #595a44; }
.press-model { text-align: center; padding: 12px 2px 1px; color: #d7c79a; font: bold 10px var(--mono); }
.press-model span { color: #aaa384; }
.stamp-device {
  --pad: #566f44; --lit: #829960; --edge: #354a32;
  position: relative; min-height: 115px; margin: 5px 8px 1px; padding: 18px 7px 12px;
  border: 0; background: none; display: grid; align-items: end;
}
.stamp-device.returned { --pad: #8c4b3c; --lit: #ba7762; --edge: #572f2a; }
.stamp-device::before {
  content: ""; position: absolute; inset: 12px 2px 5px;
  background: repeating-linear-gradient(90deg, #303429 0 2px, transparent 2px 12px), #3a4132;
  border: 2px solid #73765a; border-right-color: #2e3428; border-bottom: 5px solid #292e24; box-shadow: 2px 4px #292e24;
}
.press-arm { position: absolute; inset: 14px 7px auto; height: 16px; border: 2px solid #77785b; border-bottom: 4px solid #252b22; background: #555b47; }
.press-pad {
  position: relative; display: grid; align-content: end; gap: 2px;
  min-height: 57px; padding: 11px 0 4px; text-align: center; white-space: nowrap;
  background: linear-gradient(180deg, var(--lit) 0 4px, var(--pad) 4px 63%, var(--edge) 63%);
  border: 2px solid var(--lit); border-right-color: var(--edge); border-bottom: 4px solid #22261e;
  box-shadow: 2px 5px #282e23, inset 0 -2px #a38c5437;
}
.press-pad b { color: #fff0c1; font-size: clamp(12px, 1.25vw, 16px); letter-spacing: .03em; text-shadow: 1px 2px #231d15; }
.press-pad small { color: #eee0b4; font: 800 clamp(7px, .75vw, 10px) var(--mono); line-height: 1; }
.grip-knob {
  position: absolute; width: 31px; height: 28px; top: -23px; left: calc(50% - 15px);
  background: linear-gradient(90deg,#373a2c 0 4px,#5e6049 4px 9px,#747458 9px 22px,#464934 22px 27px,#303426 27px);
  border-bottom: 4px solid #2e3428; box-shadow: 2px 2px #282f22;
  clip-path: polygon(0 17%,13% 17%,13% 6%,26% 6%,26% 0,74% 0,74% 6%,87% 6%,87% 17%,100% 17%,100% 86%,87% 86%,87% 100%,13% 100%,13% 86%,0 86%);
}
.grip-knob::after { content: ""; position: absolute; inset: 3px 6px auto; height: 7px; background: #969278; border: 2px solid #666a51; }
.ink-band { position: absolute; top: 13px; height: 2px; left: 5px; right: 5px; background: var(--edge); opacity: .7; }
.stamp-device:hover:not(:disabled) .press-pad { filter: brightness(1.16); transform: translateY(-2px); }
.stamp-device:disabled:not(.firing) { filter: saturate(.67) brightness(.87); }
.stamp-device.firing .press-pad { animation: press-down .27s steps(5, end) both; }
@keyframes press-down { 50% { transform: translateY(10px); box-shadow: 1px 1px #24241b; } }
.press-foot { margin: auto 9px 13px; display: flex; justify-content: space-between; padding: 7px 6px; border-block: 2px solid #727258; background: #343a2d; }
.doc {
  position: absolute; z-index: 5; color: #302f23; border: 2px solid #655d42;
  background: repeating-linear-gradient(0deg, #7d6b3b0a 0 1px, transparent 1px 4px), #e8dcb2;
  box-shadow: 2px 2px #b1a17a, 4px 4px #bfae80, 6px 7px #1c2118a8;
}
.doc.held { box-shadow: 2px 2px #b1a17a, 4px 4px #bfae80, 9px 11px #1c2118aa; }
.doc-grip {
  display: flex; align-items: center; gap: 6px; min-height: 32px; padding: 3px 8px;
  border-bottom: 2px solid #a5996f; background: #c3b58b;
  font-size: 12px; font-weight: 800; letter-spacing: .055em; color: #383a29;
  cursor: grab; touch-action: none; user-select: none;
}
.held .doc-grip { cursor: grabbing; }
.grip-lines { width: 13px; height: 9px; background: repeating-linear-gradient(0deg,#726d4f 0 1px, transparent 1px 3px); }
.doc-x { margin-left: auto; border: 1px solid #897955; color: #393729; background: #d8c99f; font-size: 14px; padding: 0 5px; min-width: 25px; min-height: 24px; box-shadow: 1px 1px #99845a; }
.doc-x.expand { font-size: 11px; }
.work-sheet { top: 30px; left: 111px; width: min(calc(100% - 154px), 545px); }
.work-sheet.expanded { top: 16px; left: 17px; width: calc(100% - 86px); }

.sheet-body { position: relative; padding: 10px 13px 8px; }
.paper-meta { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; border-bottom: 1px solid #a29773; gap: 8px; font-size: 11px; color: #585541; font-weight: 800; letter-spacing: .06em; }
.paper-meta i, .outside i { display: inline-block; width: 3px; height: 3px; background: #9f8a5c; vertical-align: middle; margin-inline: 4px; }
.paper-meta > b { font: bold 13px var(--mono); }
.paper-stamp { display: grid; place-items: center; width: 116px; height: 53px; }
.question { margin: 6px 0 10px; color: #383729; font-size: 15px; font-weight: 600; line-height: 1.48; }
.rows { border-top: 1px solid #afa27a; }
.answer-row { display: flex; border-bottom: 1px solid #afa27a; gap: 3px; min-height: 56px; }
.answer { position: relative; flex: 1; min-width: 0; display: grid; align-content: center; gap: 2px; border: 0; text-align: left; color: #333427; background: #fff6d224; padding: 4px 7px; }

.section-name { font: 800 11px var(--text); letter-spacing: .09em; color: #5f654e; }
.answer-text { overflow-wrap: anywhere; font-size: 13px; line-height: 1.45; }
.answer em { color: #68563d; font-style: normal; }
.step { display: grid; place-items: center; border: 1px solid #9b8c61; min-width: 25px; min-height: 26px; padding: 0; background: #d1c299; color: #332f24; box-shadow: 1px 1px #ae9b71; font: bold 16px var(--mono); }
.step:disabled { opacity: .5; }
.step:not(:disabled):hover, .doc-x:hover { background: #faf0ca; }
.clear { border-color: #a29470; background: #ded1a7; color: #4e4a32; }
.seal {
  --seal: #375b3b;
  transform: rotate(-12deg); padding: 2px 8px; border: 3px double var(--seal); color: var(--seal);
  font-weight: 900; text-align: center; white-space: nowrap; pointer-events: none; opacity: .86;
  text-shadow: 1px 0 #d6c996; background: #e5d9aa5e;
}
.seal.returned { --seal: #943e35; }
.seal b { display: block; letter-spacing: .12em; font-size: 16px; line-height: 1.15; }
.seal small { display: block; font: 900 9px var(--mono); letter-spacing: .07em; }
.seal.contact { animation: contact .20s steps(5, end) both; }
.seal.ink { animation: ink .24s steps(5, end) both; }
@keyframes contact { from { transform: rotate(-12deg) scale(1.5); opacity: 0; } to { transform: rotate(-12deg) scale(.97); opacity: .8; } }
@keyframes ink { from { filter: contrast(1.3); transform: rotate(-12deg) scale(.96); } to { filter: none; } }
.work-sheet.filing { animation: filing .3s steps(7, end) both; pointer-events: none; }
@keyframes filing { to { transform: translate(13%, 19%) scale(.84); opacity: 0; } }
.feedback { position: relative; z-index: 3; padding: 9px 11px 10px; background: #ccd0a2; border-top: 2px dashed #7a8660; color: #374a34; font-size: 12px; }
.feedback.bad { background: #e3bd9e; border-color: #a5644f; color: #713e32; }
.feedback > b { display: block; }
.feedback b { font-size: 13px; }
.feedback p { margin-top: 3px; line-height: 1.55; }
.feedback .primary { margin-top: 7px; padding: 4px 8px; min-height: 27px; font-size: 12px; }
.handbook { top: 126px; left: clamp(10px, 20%, 150px); width: min(270px, 76%); z-index: 8; background: #ded5a4; border-color: #77724d; }
.handbook .doc-grip { background: #a3a680; }
.book-page { position: relative; padding: 9px 10px 10px 16px; border-left: 8px solid #858464; }
.book-page::before { content: ""; position: absolute; inset: 5px auto 5px -7px; width: 9px; background: repeating-linear-gradient(0deg,#443e2b 0 2px,#8b805c 2px 4px,transparent 4px 12px); }
.chapter { color: #62684c; font: bold 11px var(--mono); }
.book-page h2 { font-size: 19px; letter-spacing: .08em; margin: 3px 0 6px; color: #3f4733; }
.book-page p { font-size: 13px; line-height: 1.55; }
.book-page p + p { margin-top: 5px; }
.page-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 11px; border-top: 1px dashed #948960; padding-top: 7px; font: bold 12px var(--mono); }
.notice, .title-folder { position: relative; color: #34362a; margin-inline: auto; box-shadow: 4px 4px #9d8c5d, 7px 8px #211f16a8; }
.notice {
  width: min(calc(100% - 72px), 510px); margin-top: 52px; padding: 16px 18px 19px;
  border: 2px solid #b7a577; background: repeating-linear-gradient(0deg,#fff3c636 0 1px,transparent 1px 4px), #ded0a2;
}
.notice-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid #9d916c; padding-bottom: 8px; font-size: 12px; color: #535a3f; font-weight: 800; letter-spacing: .065em; }
.notice-top b { font: 800 12px var(--mono); color: #5d5945; white-space: nowrap; }
.notice h2 { margin: 14px 0 9px; color: #343e2b; font-size: clamp(24px, 3vw, 37px); letter-spacing: .045em; }
.notice p { line-height: 1.62; font-size: 14px; }
.notice-rule { border: 1px dashed #93865b; background: #d1c291; padding: 9px 10px; margin-top: 14px; font-size: 14px; line-height: 1.55; }
.notice .notice-rule :is(h3, p) { margin: 0; font-size: inherit; line-height: inherit; }
.notice-rule h3 { color: #414831; }
.memo-expenses > span { white-space: nowrap; }
.notice-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: 12px; font-weight: 700; color: #554e38; }
.primary, .secondary {
  min-height: 36px; padding: 6px 10px; border: 1px solid #2e3927; font-size: 13px; font-weight: 800;
  background: #45553a; color: #f7e9bb; box-shadow: inset 0 2px #778260, 2px 3px #85774c;
}
.primary:hover { background: #596949; }
.secondary { background: #c0af7e; color: #353828; border-color: #837650; box-shadow: inset 0 2px #d7c89b, 2px 3px #88754a; }
.secondary:hover { background: #d1c28d; }
.stats { margin: 12px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 9px; }
.stats div { padding: 6px 2px; border-bottom: 1px solid #a99a70; }
.stats dt { font-size: 12px; color: #5c5c43; }
.stats dd { margin: 3px 0 0; font: 900 17px var(--mono); color: #34452f; }
.desktop-props { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.closed-book { position: absolute; width: 137px; height: 177px; left: 5%; top: 17%; padding: 15px 12px; border: 2px solid #8a8f66; border-left-width: 9px; transform: rotate(-12deg); color: #b4a275; background: repeating-linear-gradient(0deg,#93a08017 0 1px,transparent 1px 4px), #3a5140; box-shadow: 4px 4px #ad9e73, 6px 9px #22291e; }
.closed-book span { font: 900 12px var(--mono); }
.closed-book strong { display: block; margin-top: 5px; font-size: 16px; letter-spacing: .1em; }
.closed-book i { display: block; margin: 15px 0 0; width: 40px; height: 30px; border: 2px double #88855f; }
.desktop-props .pencil { position: absolute; top: 67%; right: 10%; transform: rotate(55deg); }
.idle-paper { position: absolute; right: 9%; top: 12%; width: 175px; height: 218px; transform: rotate(11deg); border: 3px solid #9e9063; box-shadow: 3px 5px #292319; opacity: .7; background: repeating-linear-gradient(0deg,#97835d 0 1px,transparent 1px 12px), #bdb089; }
.title-folder { z-index: 1; width: min(73%, 455px); margin-top: 83px; padding: 10px 12px 13px; background: #b5a272; border: 2px solid #d3bf87; transform: rotate(-1deg); }
.folder-tab { position: absolute; bottom: 100%; left: -2px; background: #b5a272; border: 2px solid #d3bf87; border-bottom: 0; padding: 6px 18px 4px 10px; font-size: 11px; font-weight: 900; }
.folder-content { padding: 12px 15px 15px; background: repeating-linear-gradient(0deg, #fef1c836 0 1px, transparent 1px 4px), #e4d5a7; border: 1px solid #97845a; }
.folder-content h2 { font: 900 clamp(26px, 4.7vw, 63px)/.91 var(--mono); letter-spacing: -.092em; color: #313b2a; text-shadow: 2px 2px #baac7e; margin: 16px 0 8px; }
.folder-content h2 span { color: #984f3e; }
.folder-content p { font-weight: 800; color: #53573f; font-size: 14px; letter-spacing: .12em; }
.title-actions { margin-top: 15px; display: flex; flex-wrap: wrap; gap: 6px; }
.console {
  margin-top: 4px; display: flex; align-items: stretch; justify-content: space-between; gap: 6px; padding: 7px 9px;
  background: repeating-linear-gradient(90deg,#272a2040 0 2px,transparent 2px 22px), #454733;
  border: 2px solid #262a20; box-shadow: inset 0 2px #717152;
}
.gauges { display: flex; align-items: stretch; gap: 5px; }
.gauge { display: grid; align-content: center; gap: 2px; min-width: 91px; background: #23291e; border: 1px solid #696849; box-shadow: inset 0 0 0 2px #2e3325; padding: 4px 7px; }
.gauge span { font-size: 10px; letter-spacing: .07em; color: #bcb38a; }
.gauge b { font: bold 17px var(--mono); color: #cad2a0; white-space: nowrap; }
.gauge.clock b { color: #ecc382; }
.gauge.clock b.urgent { color: #ec8b76; }
.console-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: end; }
.console-button { background: #3a4030; }
.console-button[aria-pressed=true] { color: #f1d8a5; background: #575b3e; }
.console-button:disabled { opacity: .5; }
.outside { display: flex; justify-content: space-between; gap: 5px; color: #aaa784; margin-top: 13px; padding: 0 3px; font: 10px var(--mono); letter-spacing: .12em; }
.modal-shade { position: fixed; z-index: 150; inset: 0; background: #151a14c9; display: grid; place-items: center; padding: 15px; }
.dialog { position: relative; width: min(100%, 430px); max-height: 90dvh; overflow: auto; padding: 19px; background: #363c2c; border: 2px solid #8d855b; box-shadow: 4px 5px #151911, inset 0 0 0 3px #4d523b; color: #e4d5a7; }
.dialog h2 { margin-bottom: 12px; font-size: 23px; }
.dialog p, .dialog li { line-height: 1.55; font-size: 14px; }
.dialog ol { padding-left: 22px; }
.dialog li + li { margin-top: 5px; }
.modal-x { position: absolute; top: 8px; right: 8px; background: #50533b; border: 1px solid #8d8562; width: 29px; height: 29px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }

@media (max-width: 1050px) {
  #game { width: calc(100% - 36px); }
  .station { grid-template-columns: 23% minmax(0, 1fr) 17%; }
  .work-sheet { left: 80px; width: calc(100% - 105px); }
  .physical-tools { left: 22px; width: 53px; }
  .book-tool { white-space: normal; }
  .stamp-device { margin-inline: 4px; }
  .gauge { min-width: 75px; }
}
@media (max-width: 820px) {
  #game { width: calc(100% - 22px); padding-top: 14px; }
  .masthead { margin-bottom: 11px; }
  .station { grid-template-columns: 175px minmax(0,1fr); }
  .press { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; padding-bottom: 2px; }
  .press-head { grid-column: 1 / -1; height: 24px; }
  .press-model, .press-foot { display: none; }
  .stamp-device { margin: 1px 4px; min-height: 78px; padding: 17px 6px 7px; }
  .stamp-device::before { inset: 3px 0 4px; }
  .press-arm { top: 5px; height: 11px; }
  .press-pad { min-height: 42px; }
  .press-pad b { font-size: 13px; }
  .press-pad small { font-size: 8px; }
  .grip-knob { top: -14px; height: 17px; width: 24px; left: calc(50% - 12px); }
  .grip-knob::after { top: 2px; height: 5px; }
  .work-sheet { top: 39px; left: 12px; width: calc(100% - 24px); }
  .physical-tools { top: 7px; left: 13px; right: 12px; display: flex; gap: 7px; width: auto; }
  .book-tool { width: auto; height: 25px; padding: 2px 6px; white-space: nowrap; }
  .tray { bottom: 16px; right: 13px; }
  .notice { margin-top: 32px; width: calc(100% - 39px); }
  .console-button { padding: 5px 7px; font-size: 12px; }
  .desk:has(.feedback) { min-height: max(620px, var(--sheet-space, 0px)); }
}
@media (max-width: 540px) {
  #game { width: calc(100% - 12px); padding-top: 10px; }
  .masthead { gap: 3px; }
  .wordmark { gap: 7px; }
  .grading-icon { width: 32px; height: 32px; }
  .wordmark h1 { font-size: clamp(14px,4.3vw,22px); }
  .wordmark p { font-size: 9px; letter-spacing: 0; margin-top: 4px; }
  .header-audio { flex-direction: column; align-items: end; gap: 1px; font-size: 11px; }
  .header-audio input[type="range"] { width: clamp(52px, 16vw, 86px); }
  .machine { padding: 2px; }
  .hall { height: 83px; }
  .hall-art { inset: 0; }
  .hall-caption, .queue { top: 4px; left: 5px; padding: 3px 5px; font-size: 9px; }
  .queue { left: auto; right: 5px; }
  .queue b { font-size: 10px; }
  .station { grid-template-columns: minmax(0, 1fr); }
  .window { display: grid; grid-template-columns: 94px minmax(0,1fr); min-height: 92px; }
  .booth-label, .sill { display: none; }
  .booth canvas { width: 110px; max-width: none; position: absolute; left: -9px; bottom: 0; }
  .student-info { padding: 6px 7px; }
  .student-id strong { font-size: 15px; }
  .student-id small { font-size: 10px; }
  .speech { font-size: 12px; margin-top: 5px; padding: 4px 6px; }
  .lesson { margin-top: 6px; padding: 4px; }
  .lesson b { font-size: 11px; }
  .lesson p, .skip { font-size: 11px; }
  .desk { min-height: max(432px, var(--sheet-space, 0px)); }
  .desk:has(.feedback) { min-height: max(580px, var(--sheet-space, 0px)); }
  .desk-inlay { inset: 9px 7px 10px; }
  .sheet-body { padding-inline: 8px; }
  .question { font-size: 13px; }
  .step { min-width: 30px; min-height: 33px; }
  .answer { padding-inline: 3px; }
  .work-sheet.expanded { width: calc(100% - 27px); left: 6px; top: 7px; }
  .expanded .answer-text, .expanded .question { font-size: 15px; }
  .tray { height: 32px; bottom: 10px; }
  .title-folder { margin-top: 54px; }
  .title-mode .desk { min-height: max(330px, var(--sheet-space, 0px)); }
  .notice { width: calc(100% - 26px); padding: 12px; margin-top: 20px; }
  .console { flex-wrap: wrap; justify-content: stretch; padding: 5px 4px; }
  .gauges { width: 100%; justify-content: space-between; gap: 3px; }
  .gauge { flex: 1; min-width: 0; padding: 4px; }
  .gauge b { font-size: 13px; }
  .console-tools { justify-content: end; width: 100%; }
  .outside { font-size: 8px; letter-spacing: .02em; margin-top: 8px; }
}
@media (max-height: 500px) and (orientation: landscape) and (max-width: 960px) {
  #game { width: calc(100% - 16px); padding-top: 7px; }
  .masthead { margin-bottom: 7px; }
  .hall { height: 70px; }
  .hall-art { bottom: -17px; }
  .station { grid-template-columns: 18% minmax(0,1fr) 17%; }
  .press { grid-column: auto; display: flex; }
  .press-head { height: 27px; }
  .press-foot { display: none; }
  .press-model { display: none; }
  .stamp-device { min-height: 76px; margin: 3px; padding: 17px 6px 7px; }
  .stamp-device::before { inset: 3px 0 4px; }
  .press-arm { top: 5px; height: 11px; }
  .press-pad { min-height: 42px; }
  .press-pad small { font-size: 8px; }
  .grip-knob { top: -14px; height: 17px; width: 24px; left: calc(50% - 12px); }
  .grip-knob::after { top: 2px; height: 5px; }
  .desk { min-height: max(428px, var(--sheet-space, 0px)); }
  .desk:has(.feedback) { min-height: max(575px, var(--sheet-space, 0px)); }
  .tray { bottom: 13px; right: 13px; height: 34px; }
  .work-sheet { top: 35px; left: 8px; width: calc(100% - 19px); }
  .physical-tools { top: 6px; left: 10px; display: flex; width: auto; }
  .book-tool { width: auto; height: 23px; padding: 3px 7px; }
  .student-info { padding: 7px; }
  .student-id strong { font-size: 16px; }
  .student-id small, .speech { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (min-width: 1060px) and (max-height: 950px) {
  #game { padding-top: 17px; }
  .masthead { margin-bottom: 14px; }
  .hall { height: clamp(148px, 20vh, 183px); }
  .desk { min-height: max(502px, var(--sheet-space, 0px)); }
  .desk:has(.feedback) { min-height: max(610px, var(--sheet-space, 0px)); }
}

.hall-board {
  position: absolute; top: 25.8%; left: 7.5%; width: 12.5%; height: 12.5%;
  display: grid; place-items: center; background: #c8b994; color: #3a3c2e;
  box-shadow: 1px 2px #40382a; font-size: min(1.8cqw, 10cqh); line-height: 1; letter-spacing: .02em; white-space: nowrap;
}
.hall-board::before, .hall-board::after {
  content: ""; position: absolute; top: 0; width: 3px; height: 3px; background: #895944;
}
.hall-board::before { left: 5px; }
.hall-board::after { right: 5px; }
.correction { display: grid; align-content: center; gap: 2px; width: min(57%, 206px); padding: 4px 5px; font-size: 12px; font-weight: 800; line-height: 1.45; }
.correction input, .correction select {
  display: block; min-width: 0; width: 100%; min-height: 33px; border: 1px solid #a3816a; border-radius: 0;
  background: #f2e2bd; color: #853c32; font: inherit; font-size: 16px; padding: 4px 5px;
}
@media (max-width: 820px) {
  .work-sheet { width: calc(100% - 33px); }
  .work-sheet.expanded { left: 7px; width: calc(100% - 19px); }
  .expanded .answer-text, .expanded .question { font-size: 15px; }
}
@media (max-width: 540px) {
  .hall-caption { font-size: 8px; top: 1px; }
}
@media (max-height: 500px) and (orientation: landscape) and (max-width: 960px) {
  .hall-caption, .queue { top: 2px; padding-block: 2px; font-size: 9px; }
}

#papers:has(.learning-sheet) { position: relative; inset: auto; display: flow-root; }
.notice.learning-sheet { width: calc(100% - 32px); margin: 20px auto 24px; font-size: 14px; line-height: 1.55; }
.learning-sheet :is(p, .review-body dd) { line-height: inherit; }
.learning-metrics { gap: 5px; }
.learning-metrics div { padding: 6px; background: #d9cb9d; border-block: 1px solid #aa9d74; }
.learning-metrics dt { font-size: inherit; }
.learning-metrics dd { white-space: nowrap; font-size: 16px; line-height: inherit; }
.learning-review { margin-top: 16px; }
.learning-review h3, .learning-title { color: #394530; font-size: 15px; margin: 0 0 6px; }
.learning-title { margin-top: 18px; }
.review-topic { border-block-start: 1px solid #a79a72; }
.review-topic:last-child { border-block-end: 1px solid #a79a72; }
.review-topic > summary {
  display: grid; align-items: center; grid-template-columns: minmax(0, 1fr) auto 14px;
  min-height: 44px; gap: 7px; padding: 4px 8px; list-style: none; font-weight: 800; cursor: pointer;
}
.review-topic > summary:focus-visible { outline: 2px solid #704b2b; outline-offset: 1px; }
.review-topic > summary::-webkit-details-marker { display: none; }
.review-topic > summary::after { content: "+"; font: bold 17px var(--mono); color: #48513b; }
.review-topic[open] > summary { background: #d1c291; }
.review-topic[open] > summary::after { content: "−"; }
.review-day { color: #4b513f; font: bold 12px var(--mono); }
.review-body { display: grid; gap: 6px; margin: 0; padding: 8px 8px 12px; font-size: 14px; }
.review-body dl { margin: 0; }
.review-body dl > div { display: grid; grid-template-columns: 3em minmax(0, 1fr); gap: 6px; }
.review-comparison { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.review-comparison > div { display: grid; align-content: start; padding: 6px 8px; gap: 3px; background: #dbcc9e; overflow-wrap: anywhere; }
.review-comparison > div:last-child { background: #c9cba3; }
.review-comparison b { color: #434b34; font-size: .86em; }
.grade-receipt, .topic-tools { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.grade-receipt span { white-space: nowrap; }
.topic-tools { margin-top: 10px; align-items: center; }
.topic-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 5px 10px; }
.topic-footer output { font-weight: bold; }
.topic-footer .topic-error { width: 100%; color: #ffd9b8; }
.topic-footer .topic-error:empty { display: none; }
#correction-hint { color: #813a29; line-height: 1.35; }
.topic-options label:has(:checked) { background: #e5d9af; box-shadow: inset 3px 0 #789060; }
.pause-actions { justify-content: center; }
.pause-actions .primary { flex-basis: 100%; }
.dialog .pause-event { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-block: 10px 4px; }
.pause-event strong { font: bold 22px var(--mono); }
.pause-event { padding: 8px 10px; border-left: 3px solid #e7b86a; background: #49452e; color: #ffe2a5; font-variant-numeric: tabular-nums; }
@media (max-width: 540px) {
  .review-comparison { grid-template-columns: minmax(0, 1fr); }
  .review-comparison > div { grid-template-columns: 5em minmax(0, 1fr); }
  .review-comparison span { grid-column: 2; }
}
.review-body dt { color: #4e553d; font-weight: 800; }
.review-body dd { margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
.ending-badge { padding: 4px 8px; border: 1px solid currentColor; }
.ending-badge.loss { color: #71332b; background: #dfb79b; }
.ending-badge.win { color: #304a2e; background: #ccd0a2; }
.ending-outcome .ending-reason { font-weight: 800; margin-bottom: 10px; }
.ending-numbers { margin: 0; padding: 7px 10px; border: 1px solid #a79a72; background: #d1c291; }
.ending-numbers > div, .ending-due dd { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ending-numbers > div { padding: 2px 0; }
.ending-numbers dd { margin: 0; }
.ending-numbers dd:not(:has(ul)), .ending-due dd > b { font: bold 16px/1.55 var(--mono); }
.ending-due dd { flex: 1; }
.ending-due ul {
  display: flex; flex-wrap: wrap; gap: 3px 8px; padding: 0; margin: 0; list-style: none;
  font: inherit;
}
.ending-due li, .ending-numbers > div:not(.ending-due) dd { white-space: nowrap; }
.ending-final { border-top: 1px solid #9d926a; font-weight: 800; }
.ending-final.loss { color: #71332b; }
.ending-final.win { color: #304a2e; }
.ending-outcome .ending-cash { margin-top: 7px; }
@media (max-width: 540px) {
  .notice.learning-sheet { width: calc(100% - 18px); margin: 12px auto 15px; }
  .learning-metrics div { padding-inline: 4px; }
}

.dock-utilities { display: none; }
.tray.over { background: #788655; border-color: #f0d488; outline: 2px dashed #f0d488; outline-offset: 3px; }
.feedback ul { padding-inline-start: 20px; margin: 6px 0; }
.feedback li + li { margin-top: 3px; }
.feedback li b { display: inline; }
#papers:has(.daily-sheet) { position: relative; inset: auto; display: flow-root; }
.notice.daily-sheet { margin-bottom: 24px; color: #302919; }
.daily-sheet .report-header h2 { margin: 0; font-size: 20px; }
.cash-sheet { margin-top: 10px; padding: 9px 11px; border: 1px solid #a49469; background: #d1c291; }
.cash-sheet h3, .rating-change h3 { margin: 0; font-size: 15px; }
.cash-sheet h3 { margin-bottom: 4px; }
.cash-ledger { margin: 0; }
.cash-ledger > div { display: grid; grid-template-columns: minmax(0, 1fr) 6em; gap: 6px; padding: 2px 0; }
.cash-ledger dd { display: grid; grid-template-columns: 1.2em 1fr; margin: 0; text-align: right; font: bold 16px var(--mono); }
.cash-ledger :is(dt, dd, span, b) { color: inherit; }
.cash-ledger .cash-credit, .cash-sheet .cash-paid { color: #304a2e; }
.cash-ledger .cash-total { border-top: 2px solid #786e4c; font-weight: 900; }
.cash-ledger .cash-total dd { font-size: 20px; }
.cash-ledger .cash-debit, .cash-sheet .cash-shortfall { color: #7e322b; }
.cash-sheet p { margin-top: 4px; font-size: 12px; }
.grading-counts > div { padding: 5px 8px; background: #d9cb9d; }
.rating-change { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; padding: 7px 10px; background: #d1c291; }
.rating-score { display: grid; grid-template-columns: max-content max-content; align-items: end; gap: 1px 10px; font: 800 16px/1.45 var(--mono); }
.rating-score.up { color: #304a2e; }
.rating-score.down { color: #7e322b; }
.rating-final { grid-column: 1; font-size: 23px; line-height: 1; }
.rating-start { grid-column: 1; color: #302919; }
.rating-start s { text-decoration: line-through 2px; }
.rating-score.up s { text-decoration-color: #304a2e; }
.rating-score.down s { text-decoration-color: #7e322b; }
.rating-delta { grid-column: 2; }
.daily-sheet .review-topic > summary { grid-template-columns: minmax(0, 1fr) 14px; }
.daily-sheet .notice-footer { justify-content: flex-end; }
.daily-sheet .notice-footer .primary { background: #c8b77d; color: #302919; border-color: #796b47; box-shadow: inset 0 2px #e0d19f, 2px 3px #85774c; }
.daily-sheet .notice-footer .primary:hover { background: #d8c68f; }

@media (max-width: 700px), (max-width: 820px) and (min-height: 501px) {
  #game.in-work { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  #game.in-work .press {
    position: fixed; z-index: 60; inset: auto 0 0; display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr);
    padding: 3px 5px calc(5px + env(safe-area-inset-bottom)); gap: 3px;
  }
  #game.in-work .press-head, #game.in-work .press-model, #game.in-work .press-foot { display: none; }
  #game.in-work .stamp-device { min-height: 58px; margin: 0; padding: 10px 4px 4px; }
  #game.in-work .press-arm { top: 1px; }
  #game.in-work .press-pad { min-height: 36px; padding-top: 8px; }
  #game.in-work .press-pad b { font-size: 12px; }
  #game.in-work .press-pad small { font-size: 7px; }
  #game.in-work .grip-knob { top: -10px; height: 13px; }
  #game.in-work #papers > .tray { display: none; }
  #game.in-work .dock-utilities {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px;
    align-content: center; color: #ead8a6; text-align: center;
  }
  .dock-clock { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 5px; background: #282e20; padding: 2px; }
  .dock-clock span { font-size: 10px; }
  .dock-clock b { font: bold 14px var(--mono); }
  .dock-clock .urgent { color: #f1ab88; }
  #game.in-work .dock-book, #game.in-work .dock-tray { min-height: 36px; padding: 2px; font-size: 11px; }
  #game.in-work .dock-tray { position: relative; inset: auto; width: auto; height: auto; display: block; }
  html:has(#game.in-work) { scroll-padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}


.answer-unit { color: #5e543e; font-size: 12px; }
.answer-text:has(.answer-unit), .work-sheet .answer-text { font: bold 22px var(--mono); }

.trial-event, .expired-file { padding: 7px 9px; margin-top: 10px; color: #653f2c; background: #ddc09a; border-inline-start: 3px solid #9f5e45; }
.expired-file { position: absolute; top: 4px; left: 14px; right: 14px; margin: 0; z-index: 3; font-size: 12px; }
.trial-files { position: absolute; top: 35px; left: 12px; right: 13px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 9px; }
.expired-file + .trial-files { top: 67px; }
.trial-files:has(.work-sheet:only-child) { grid-template-columns: minmax(0, 1fr); }
.trial-files .doc { position: relative; inset: auto; width: 100%; min-width: 0; }
.trial-files .doc-grip { flex-wrap: wrap; }
.trial-files .doc-grip .doc-x { margin-left: auto; }
.trial-files .question { overflow-wrap: anywhere; }
.urgent-file { display: inline-flex; gap: 4px; align-items: center; padding: 3px 5px; color: #ffebc5; background: #874d3d; }
.urgent-time { font: bold 14px var(--mono); }
.ordinary-file { color: #51583f; }
.waiting-file .waiting-answer { margin: 8px 0; }
.waiting-file .primary { margin-bottom: 4px; }
@media (max-width: 820px) {
  .trial-files { top: 42px; }
  .expired-file + .trial-files { top: 71px; }
}
@media (max-width: 600px) {
  .trial-files { grid-template-columns: minmax(0, 1fr); }
  .trial-files .waiting-file { order: -1; }
  .trial-files .waiting-file .sheet-body { padding-block: 3px; }
}

#papers:has(.memo-sheet) { position: relative; inset: auto; display: flow-root; }
.notice.memo-sheet { margin-bottom: 24px; }

.event-launcher { display: grid; gap: 9px; margin-bottom: 12px; padding: 10px 12px; border: 1px solid #767758; background: #292f23; }
.event-launcher h2 { font-size: 18px; }
.event-launcher p { font-size: 13px; }
.event-triggers, .event-actions, .event-choices, .event-extras { display: flex; gap: 7px; flex-wrap: wrap; }
.event-triggers button[aria-pressed=true] { background: #c8b77d; color: #302919; }
.event-triggers .event-tested::after { content: " ✓"; }
.desk:has(.event-panel) #papers { isolation: isolate; }
.event-panel {
  position: absolute; z-index: 45 !important; top: 15px; left: max(8px, calc(100% - 562px)); width: min(550px, calc(100% - 24px));
  max-height: min(72vh, calc(100% - 24px)); overflow: auto; color: #302919;
  background: repeating-linear-gradient(0deg,#fff3c636 0 1px,transparent 1px 4px), #ded0a2;
  border: 2px solid #766d4e; box-shadow: 3px 3px #a39160, 6px 6px #211f16a8;
}
.event-panel > header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 8px; background: #c3b58b; border-bottom: 1px solid #91845b; cursor: grab; touch-action: none; user-select: none; }
.event-panel.held > header { cursor: grabbing; }
.event-panel > header > div { display: flex; align-items: center; gap: 6px; }
.event-panel h2 { font-size: 17px; line-height: 1.3; }
.event-panel h3 { margin: 0 0 4px; font-size: 14px; }
.event-panel > header button { min-height: 30px; }
.event-panel [data-event-clock] { color: #7b352d; font: 800 15px var(--mono); white-space: nowrap; }
.event-body { padding: 9px 10px; font-size: 14px; line-height: 1.5; }
.event-body > p + p, .event-actions, .event-choices { margin-top: 7px; }
.event-note { padding: 7px 8px; background: #cfbf90; border: 1px solid #a08e62; }
.event-note p + p { margin-top: 4px; }
.event-note ul { margin: 0 0 5px; padding-inline-start: 20px; }
.event-order { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 8px; align-items: start; }
.event-order fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.event-order fieldset + fieldset { margin-top: 6px; }
.event-order legend { padding: 0; font-weight: 800; }
.event-option { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px; min-height: 32px; padding: 2px 3px; border-bottom: 1px solid #ab9c72; }
.event-option:has(input:checked) { background: #c3c69b; }
.event-body input { accent-color: #49613e; }
.event-extras label { display: flex; align-items: center; gap: 4px; }
.event-cart { display: flex; justify-content: space-between; margin-top: 6px; }
.event-body button:disabled { background: #c3b58b; color: #504731; border-color: #8b7e55; box-shadow: none; }
.event-outcome.good { color: #304a2e; font-weight: 800; }
.event-outcome.bad { color: #71332b; font-weight: 800; }
.event-log { padding: 6px 8px; background: #3e4630; color: #f4e6bb; }
.event-log[data-tone=bad] { background: #593a31; }
.event-panel.phone-screen {
  --phone-width: min(228px, calc(100% - 24px));
  top: 12px; left: calc(100% - var(--phone-width) - 16px); width: var(--phone-width); aspect-ratio: 1 / 2;
  max-height: none; overflow: hidden; border: 7px solid #17211b; border-radius: 25px;
  background: #f3e9c8; box-shadow: 0 0 0 2px #8a8970, 5px 6px #121910a8;
}
.event-panel.phone-screen:not([hidden]) { display: flex; flex-direction: column; }
.booth.with-bus-visitor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.booth.with-bus-visitor canvas { position: static; width: 100%; min-width: 0; margin: 0; }
.booth.with-bus-visitor #portrait { opacity: .74; }
.booth.with-bus-visitor #bus-portrait { animation: arrive .38s steps(9, end) both; }
.bus-visitor { margin-top: 12px; }
.bus-visitor .student-id strong { color: #f0a99a; }
.bus-visitor .student-id small { color: #eab4a5; }
.bus-visitor .speech { background: #d7a091; color: #492720; }
.bus-visitor .speech::before { background: #d7a091; }
.phone-status { position: relative; display: flex; justify-content: space-between; padding: 6px 8px 5px; font: 700 11px var(--mono); cursor: grab; touch-action: none; user-select: none; }
.phone-screen.held .phone-status { cursor: grabbing; }
.phone-screen > header { position: static; flex: none; padding: 5px 6px; gap: 4px; background: #394635; color: #f5e9c0; }
.phone-screen > header > div { gap: 4px; }
.phone-screen > header h2 { font-size: 14px; }
.phone-screen > header button { padding-inline: 5px; }
.phone-screen > header [data-event-clock] { color: #ffd398; }
.phone-screen .event-body { flex: 1; min-height: 0; overflow: auto; padding: 8px; }
.phone-screen .event-order { grid-template-columns: minmax(0, 1fr); }
.phone-screen .event-note { background: #e4d6ab; }
.phone-screen.chat-screen { background: #e9e5d9; color: #202d24; }
.chat-screen .phone-status, .chat-screen > header { background: #1f5846; color: #fcf6e5; }
.chat-screen > header { padding: 5px 6px; }
.chat-contact { min-width: 0; }
.chat-contact canvas { width: 31px; height: 31px; object-fit: cover; border-radius: 50%; }
.chat-contact h2 { overflow-wrap: anywhere; }
.chat-contact small { display: block; font-size: 10px; color: #d4e6d7; }
.chat-screen > header button { white-space: nowrap; }
.chat-screen .event-body { display: flex; flex-direction: column; padding: 0; }
.chat-thread { display: grid; align-content: start; gap: 6px; flex: 1; padding: 8px 6px; background: radial-gradient(#b4bda588 1px, transparent 1px), #e9e5d9; background-size: 11px 11px; }
.chat-bubble { width: fit-content; max-width: 94%; padding: 4px 7px; border-radius: 7px; background: #fffaf0; box-shadow: 0 1px #acb4a4; overflow-wrap: anywhere; }
.chat-bubble.sent { justify-self: end; background: #d4ecc8; }
.chat-bubble time { display: block; text-align: end; color: #4c6256; font-size: 10px; }
.chat-compose { display: grid; gap: 4px; padding: 6px; border-top: 1px solid #aebcab; background: #f4f2e8; }
.chat-compose .secondary, .chat-thread .secondary { min-height: 30px; padding: 4px 6px; border: 1px solid #9daf9f; border-radius: 5px; background: #f9faf3; color: #214939; text-align: left; box-shadow: none; }
.chat-compose .primary { background: #1f5846; border-color: #1f5846; }
.chat-invitation { display: grid; gap: 4px; }
.chat-invitation :is(.primary, .secondary) { min-height: 36px; font-size: 13px; font-weight: 800; line-height: 1.3; text-align: center; }
.chat-grade { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px; }
.chat-grade input { min-width: 0; width: 100%; padding: 4px 5px; border: 1px solid #9daf9f; border-radius: 4px; background: #fffdf5; color: #202d24; font: inherit; }
.repair-hint { color: #514331; font-size: 12px; }
.repair-slots { display: flex; flex-wrap: wrap; gap: 4px; }
.repair-slots .secondary { flex: 1; min-width: 44px; font: 700 12px var(--mono); text-align: center; }
.event-reference { top: 70px; left: 9px; width: min(255px, calc(100% - 244px)); z-index: 44 !important; color: #302919; }
.event-reference .reference-body { padding: 6px 7px; overflow-wrap: anywhere; }
.event-reference .reference-body p + p { margin-top: 5px; }
.event-reference ul { padding-inline-start: 18px; }
.event-reference table { width: 100%; border-collapse: collapse; text-align: left; }
.event-reference :is(th, td) { padding: 2px 3px; border-bottom: 1px solid #aa9a72; }
.repair-agenda td:first-child { font-family: var(--mono); }
.repair-agenda .available { color: #304a2e; background: #d1d4aa; font-weight: 800; }
.phone-screen .mobile-pairs button { min-width: 0; padding-inline: 0; }
.phone-screen .mobile-recyclable { font-size: 16px; gap: 6px; }
.phone-screen .recycle-bins { gap: 4px; }
.phone-screen .recycle-bin { padding-inline: 2px; min-width: 0; }
.phone-screen .recycle-bin-art { width: min(40px, 100%); }
.phone-screen .recycle-bin-art i { width: calc(100% + 4px); }
.phone-bottom { position: relative; flex: none; height: 13px; }
.phone-island, .phone-home { position: absolute; left: 50%; translate: -50% 0; border-radius: 10px; }
.phone-island { top: 6px; width: 29%; height: 8px; background: #121a16; }
.phone-island::after { content: ""; display: block; margin: 2px 3px 0 auto; width: 4px; height: 4px; border-radius: 50%; background: #34483e; }
.phone-home { bottom: 4px; height: 3px; width: 34%; background: currentColor; }
.event-phone {
  position: relative; align-self: center; width: min(108px, 80%); aspect-ratio: 1 / 1.8;
  margin: 10px auto 8px; padding: 0; border: 5px solid #171f19; border-radius: 16px;
  background: linear-gradient(145deg, #50705a, #213629 63%, #43573d); box-shadow: 0 0 0 2px #888a6c, 4px 5px #20251c;
  color: #f5e7b5; text-align: center;
}
.phone-lock-time { position: absolute; inset: 25px 0 auto; font: 800 21px var(--mono); }
.phone-notification { position: absolute; bottom: 18%; left: 50%; translate: -50% 0; width: 8px; height: 8px; border-radius: 50%; }
.event-phone.has-notification { background: linear-gradient(145deg, #718f60, #354f36 70%); box-shadow: 0 0 0 2px #e8c173, 0 0 14px #d5ad616b, 4px 5px #20251c; color: #fff3c4; }
.has-notification .phone-notification { background: #f0bc6b; box-shadow: 0 0 0 4px #f0bc6b33; }
.event-phone:disabled { background: #30382b; color: #b9b38a; }
.phone-mini { display: none; }
.event-panel.phone-screen.minimized:not([hidden]) {
  inset: 8px 9px auto auto !important;
  width: max-content;
  max-width: calc(100% - 18px);
  aspect-ratio: auto;
  border-width: 3px;
  border-radius: 8px;
}
.event-panel.minimized > :not(.phone-mini) { display: none; }
.event-panel.minimized .phone-mini { display: block; min-height: 40px; padding: 4px 12px; border: 0; background: #294738; color: #f4e6ba; }
.phone-alert { margin: 0 8px 8px; padding: 5px 7px; border: 1px solid #9e8251; background: #ebd5a1; color: #493821; font-size: 12px; line-height: 1.4; }
.phone-alert b { font-family: var(--mono); white-space: nowrap; }
.correction-controls { display: flex; align-items: stretch; gap: 4px; }
.correction-controls input, .correction-controls select { min-width: 0; }
.percent-key { min-width: 35px; padding: 0 5px; border: 1px solid #938157; background: #d4c398; color: #352e1c; font: 700 15px var(--mono); }
.event-register { margin-top: 9px; }
.event-register table { width: 100%; border-collapse: collapse; text-align: left; margin-top: 5px; }
.event-register :is(th, td) { padding: 2px 5px; border-bottom: 1px solid #aa9a72; }
.event-register summary { cursor: pointer; font-weight: 800; }
.tray-layer:empty { display: none; }
.tray:has([data-jam-paper]) { z-index: 46; }
.tray-layer { position: absolute; inset: 0; pointer-events: none; }
.tray-puzzle { position: absolute; inset: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
.tray-paper, .tray-paper-under { grid-area: 1 / 1; border: 1px solid #8a7854; background: #eee0b6; box-shadow: 2px 2px #a69568; }
.tray-paper-under { transform: translate(3px, 3px); }
.tray-paper { position: relative; display: grid; place-items: center; padding: 2px; color: #302919; font-size: 12px; line-height: 1.15; white-space: normal; touch-action: none; cursor: grab; pointer-events: auto; }
.tray-paper:active { cursor: grabbing; }
.tray-jam-status { position: absolute; bottom: calc(100% + 6px); right: 0; width: max-content; max-width: 175px; padding: 3px 6px; border: 1px solid #9f785f; background: #e5b7a0; color: #652e25; font-size: 11px; text-align: left; }
.dock-tray .tray-jam-status { bottom: calc(100% + 28px); }
.tray-jam-status.clear { background: #cdd0a5; color: #304a2e; }
.event-mobile h3 { margin-top: 5px; }
.event-mobile > p + p { margin-top: 5px; }
.mobile-progress, .mobile-message { margin-block: 6px; }
.mobile-recyclable, .mobile-timing, .mobile-pairs { background: #293728; color: #f6ebc7; }
.mobile-recyclable { display: flex; justify-content: center; align-items: center; gap: 12px; min-height: 65px; padding: 6px; font-size: 19px; }
.recycle-object { display: block; width: 25px; height: 32px; border: 2px solid #17241b; box-shadow: 2px 2px #111b13; }
.recycle-object.type-0 { transform: rotate(-9deg); background: repeating-linear-gradient(0deg,#6b6850 0 1px,#e6d7ad 1px 5px); }
.recycle-object.type-1 { border-radius: 4px; background: linear-gradient(#d5d1ad 0 17%,#ab5840 17% 83%,#d5d1ad 83%); }
.recycle-object.type-2 { clip-path: polygon(30% 0,70% 0,70% 18%,100% 33%,100% 100%,0 100%,0 33%,30% 18%); background: linear-gradient(#d9d7a2 0 18%,#82aeb0 18% 65%,#c8d4ae 65% 83%,#82aeb0 83%); }
.recycle-bins { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.recycle-bin { --bin: #387ca2; --lid: #73b5ca; display: grid; justify-items: center; gap: 3px; padding: 4px; border: 1px solid #82734f; background: #e4d5a6; color: #302919; font-weight: 800; }
.recycle-bin.yellow { --bin: #be942b; --lid: #f5cc63; }
.recycle-bin.brown { --bin: #875638; --lid: #bf8a5e; }
.recycle-bin-art { display: grid; justify-items: center; align-content: start; gap: 4px; width: 46px; height: 48px; color: #fff7da; background: var(--bin); border: 2px solid #423e30; box-shadow: inset -6px 0 #14140d22; }
.recycle-bin-art i { display: block; width: 48px; height: 11px; background: var(--lid); border: 2px solid #423e30; margin-top: -2px; box-shadow: inset 0 2px #fff8d866; }
.recycle-bin-art b { font-size: 19px; line-height: 1; }
.mobile-pairs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 7px; }
.mobile-pairs button { font-size: 21px; min-height: 42px; }
.mobile-pairs button.matched:disabled { color: #304a2e; background: #c8d0a6; }
.mobile-timing { position: relative; height: 32px; margin-bottom: 7px; overflow: hidden; }
.mobile-target { position: absolute; inset-block: 0; background: #76965a; }
.mobile-needle { position: absolute; inset-block: 2px; width: 3px; background: #fff7dc; }
@media (max-width: 540px) {
  .event-panel:not(.phone-screen) { top: 8px; left: 5px; width: calc(100% - 10px); }
  .event-order { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 540px), (max-height: 500px) {
  .event-panel.phone-screen { --phone-width: min(204px, calc(100% - 24px)); top: 8px; }
}
@media (max-width: 820px) {
  #game .press:has(.event-phone) { flex-wrap: wrap; }
  #game.in-work .press:has(.event-phone) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(104px, 1fr) auto; }
  .event-phone { width: 35px; height: 65px; aspect-ratio: auto; margin: 2px 4px; border-width: 3px; border-radius: 8px; }
  .event-phone .phone-island { top: 3px; height: 4px; }
  .event-phone .phone-island::after { display: none; }
  .event-phone .phone-lock-time { top: 14px; font-size: 9px; }
  .event-phone .phone-notification { width: 4px; height: 4px; bottom: 13px; }
  .event-phone .phone-home { bottom: 3px; height: 2px; }
  #game.in-work .press:has(.phone-alert:not([hidden])) .phone-alert { grid-column: 1 / -1; grid-row: 1; margin: 0; }
  html:has(#game.in-work .phone-alert:not([hidden])) { scroll-padding-bottom: calc(117px + env(safe-area-inset-bottom)); }
}
@media (max-width: 760px) {
  .event-reference { top: 28px; width: min(255px, calc(100% - 20px)); z-index: 46 !important; }
}
@media (pointer: coarse) {
  .event-panel button, .event-launcher button, .event-option, .event-extras label { min-height: 44px; }
}

.bank-link { color: #f4e6ba; text-underline-offset: 3px; align-self: center; }
.title-folder .bank-link { color: #354835; }
.topic-options { display: grid; gap: 4px; margin: 10px 0; }
.topic-options label { display: flex; align-items: center; gap: 9px; padding: 5px 7px; min-height: 42px; background: #d5c497; border: 1px solid #a19164; color: #1c1911; }
.topic-options input { accent-color: #3e5b3d; width: 17px; height: 17px; flex: none; }
.topic-options small { display: block; color: #514930; font-size: 12px; }
.topic-error { color: #793c31; }
.hall { container-type: size; }
.hall .hall-art { inset: 0; }
.dialog:has([data-topic-picker]) { display: flex; flex-direction: column; max-height: 90dvh; overflow: hidden; width: min(520px, calc(100% - 24px)); }
[data-topic-picker] { display: flex; flex-direction: column; min-height: 0; }
[data-topic-picker] .topic-options { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
[data-topic-picker] :is(.topic-tools, .topic-footer) { flex: none; }
.question-figure { max-width: 440px; margin: 8px 0; padding: 8px; border: 1px solid #ad9d74; background: #f0e5bf; color: #302919; overflow-wrap: anywhere; }
.question-figure figcaption { font-size: 12px; font-weight: 700; margin-bottom: 5px; }
.question-figure table { width: 100%; border-collapse: collapse; font-size: 13px; }
.question-figure :is(th, td) { border-bottom: 1px solid #b7a983; padding: 3px 5px; text-align: left; }
.question-figure th { background: #d8c99f; }
.figure-plot { display: block; width: 100%; max-width: 385px; height: auto; color: #353427; }
.figure-plot text { fill: currentColor; font: 12px var(--mono); }
.figure-plot .figure-grid { stroke: #a79b76; stroke-width: .65; }
.figure-plot .figure-axis { fill: none; stroke: currentColor; stroke-width: 1.3; }
.figure-key { display: flex; flex-wrap: wrap; padding: 0; gap: 3px 12px; margin: 0; list-style: none; font-size: 12px; }
.figure-key li { display: flex; align-items: center; gap: 5px; }
.figure-key i { background: var(--swatch); width: 10px; height: 10px; border: 1px solid #403a2b; flex: none; }
.figure-pie { width: min(128px, 85%); aspect-ratio: 1; border-radius: 50%; margin: 4px auto 8px; border: 1px solid #61573e; }
.stats-math { display: block math; margin-inline: .08em; font-family: "Cambria Math", math; font-size: inherit; font-weight: 400; math-style: normal; }
.stats-math mfrac > * { math-depth: 0; }
.math-scroll { display: inline-grid; max-inline-size: 100%; padding-block: .12em .4em; overflow: auto hidden; scrollbar-width: none; }
.event-reference .question-figure { padding: 3px; margin: 0; }
.event-reference .question-figure .figure-key { padding: 0; }
#game.question-bank { max-width: 1000px; }
.bank-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 13px; color: #f1e4bc; background: #303a2c; border: 1px solid #8e855b; }
.bank-header h1 { font-size: 25px; }
.bank-header p { font-size: 13px; }
.bank-filters { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 10px; margin-bottom: 12px; }
.bank-filters label { display: grid; gap: 4px; color: #f1e4bc; font-weight: 700; }
.bank-filters select { width: 100%; min-width: 0; min-height: 40px; padding: 4px 7px; color: #2e3323; background: #e7dbb2; border: 1px solid #908363; font: inherit; }
.bank-results-header { display: flex; align-items: end; justify-content: space-between; gap: 12px; color: #f1e4bc; margin: 0 0 8px; }
.bank-results-header p { font-size: 12px; }
.bank-results-header h2 { font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
.bank-results-header b { white-space: nowrap; }
.bank-items { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; padding: 0; margin: 0; list-style: none; }
.bank-item { padding: 11px 13px; color: #292e22; background: repeating-linear-gradient(0deg,#fff4d027 0 1px,transparent 1px 4px), #e8dab0; border: 1px solid #a3966a; box-shadow: 2px 2px #302f25; }
.bank-item-id { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 11px; letter-spacing: .03em; color: #504c33; }
.bank-prompt { margin: 5px 0 7px; font-size: 16px; line-height: 1.55; }
.bank-answers { display: flex; flex-wrap: wrap; gap: 5px 16px; border-top: 1px solid #b8ab82; padding: 5px 0; }
.bank-answers div { display: flex; gap: 6px; }
.bank-answers dt { font-size: 13px; }
.bank-answers dd { margin: 0; font-family: var(--mono); }
.bank-answers b { color: #2d5434; }
.bank-explanation { font-size: 14px; line-height: 1.75; }
.bank-prompt, .bank-explanation { overflow-wrap: anywhere; }
.bank-edit-button { min-height: 36px; padding: 3px 9px; border: 1px solid #8a7b52; background: #d8c99b; color: #302919; font: inherit; font-size: 13px; font-weight: 700; }
.bank-edit-button[aria-expanded="true"] { background: #3b553c; color: #f5e7bf; }
.bank-editor { display: grid; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid #b8ab82; }
.bank-editor[hidden] { display: none; }
.bank-editor label { display: grid; gap: 4px; font-size: 13px; font-weight: 700; }
.bank-editor textarea, .bank-editor input, .bank-editor select { width: 100%; min-width: 0; padding: 7px 8px; border: 1px solid #9f8c62; background: #f5e9c7; color: #302919; font: 400 16px/1.5 system-ui, sans-serif; }
.bank-editor textarea { resize: vertical; min-height: 70px; }
.bank-number-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bank-edit-hint, .bank-save-status { font-size: 13px; }
.bank-file-status { margin-bottom: 8px; color: #f1e4bc; font-size: 13px; }
.bank-file-status.bank-save-error { color: #ffc4ac; }
.bank-browser-copy pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.bank-save-status { color: #315535; }
.bank-save-error { color: #873931; }

@media (min-width: 821px) {
  #game:not(.question-bank, .event-testing) {
    height: 100dvh; display: flex; flex-direction: column; padding: 10px 0;
  }
  #game:not(.question-bank, .event-testing) > .masthead { flex: none; margin-bottom: 8px; }
  #game:not(.question-bank, .event-testing) > .outside { display: none; }
  #game:not(.question-bank, .event-testing) .machine {
    flex: 1; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  }
  #game:not(.event-testing) .hall { height: clamp(64px, 16dvh, 154px); }
  #game:not(.event-testing) .station { min-height: 0; grid-template-rows: minmax(0, 1fr); }
  #game:not(.event-testing) .desk { min-height: 0; }
  #game:not(.event-testing) #papers:has(.notice, .title-folder) { position: absolute; inset: 0; overflow: hidden; }
  #game:not(.event-testing) .notice {
    width: calc(100% - 28px); max-width: 650px; margin: 10px auto 12px; padding: 10px 12px;
    max-height: calc(100% - 24px); overflow: auto; overscroll-behavior: contain;
  }
  #game:not(.event-testing) .memo-sheet, #game:not(.event-testing) .daily-sheet, #game:not(.event-testing) .learning-sheet {
    display: flex; flex-direction: column; overflow: hidden;
  }
  #game:not(.event-testing) .notice-content { min-height: 0; overflow: auto; overscroll-behavior: contain; }
  #game:not(.event-testing) .notice-footer { flex: none; margin-top: 8px; }
  #game:not(.event-testing) .memo-sheet h2 { margin: 6px 0 4px; font-size: clamp(18px, 3.35dvh, 31px); }
  #game:not(.event-testing) .memo-sheet p { font-size: 13px; line-height: 1.4; }
  #game:not(.event-testing) .memo-sheet .notice-rule { margin-top: 7px; padding: 5px 8px; font-size: 13px; line-height: 1.4; }
  #game:not(.event-testing) .memo-rules:has(.notice-rule + .notice-rule) {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px;
  }
  #game:not(.event-testing) .memo-sheet .memo-expenses { display: inline; overflow-wrap: anywhere; }
  #game:not(.event-testing) .memo-sheet .memo-expenses > span { white-space: normal; }
  #game:not(.event-testing) .title-folder { margin-top: clamp(16px, 6dvh, 75px); }
  #game:not(.event-testing) .window { display: flex; flex-direction: column; overflow: hidden; container-type: size; }
  #game:not(.event-testing) .window > :is(.booth-label, .sill) { flex: none; }
  #game:not(.event-testing) .student-info { flex: none; overflow: visible; }
  #game:not(.event-testing) .booth { flex: 0 1 auto; min-height: 0; aspect-ratio: 148 / 113; }
  #game:not(.event-testing) .booth.with-bus-visitor { aspect-ratio: 296 / 113; }
  #game:not(.event-testing) .booth canvas {
    width: 100%; height: 100%; min-height: 0;
    object-fit: cover; object-position: center 39%;
  }
  #game:not(.event-testing) .stamp-device { min-height: clamp(66px, 10dvh, 115px); }
  #game:not(.event-testing) .press-model { padding-top: 4px; }
  #game:not(.event-testing) .press { container-type: size; }
  #game:not(.event-testing) .event-phone { width: min(102px, 75%, 18cqh); aspect-ratio: 1 / 2.12; flex: none; }
  #game:not(.event-testing) .event-panel.phone-screen { --phone-width: min(220px, calc((100cqh - 27px) / 2.12), calc(100% - 24px)); aspect-ratio: 1 / 2.12; }
  #game:not(.event-testing) .desk { container-type: size; }
  #game:not(.event-testing) .handbook { max-height: calc(100% - 16px); top: min(126px, 14%); display: flex; flex-direction: column; }
  #game:not(.event-testing) .handbook .book-page { overflow: auto; }
  #game:not(.event-testing) .work-sheet {
    max-height: calc(100% - 94px); display: flex; flex-direction: column; min-height: 0;
  }
  #game:not(.event-testing) .work-sheet .sheet-body { display: flex; flex-direction: column; min-height: 0; }
  #game:not(.event-testing) .work-sheet :is(.paper-meta, .rows) { flex: none; }
  #game:not(.event-testing) .work-sheet .question-reading { min-height: 2.7em; overflow: auto; }
  #game:not(.event-testing) .work-sheet .feedback { flex: none; max-height: min(136px, 43%); display: flex; flex-direction: column; }
  #game:not(.event-testing) .feedback .feedback-reading { min-height: 0; overflow: auto; }
  #game:not(.event-testing) .feedback .primary { align-self: flex-start; }
  #game:not(.event-testing) .trial-files { bottom: 64px; grid-template-rows: minmax(0, 1fr); }
  #game:not(.event-testing) .trial-files .work-sheet { max-height: 100%; }
  #game:not(.event-testing) .waiting-file { max-height: 100%; display: flex; flex-direction: column; }
  #game:not(.event-testing) .waiting-file .sheet-body { display: flex; flex-direction: column; min-height: 0; }
  #game:not(.event-testing) .waiting-file .question-reading { min-height: 0; overflow: auto; }
  #game:not(.event-testing) .waiting-file .primary { align-self: flex-start; flex: none; }
}
@media (min-width: 821px) and (max-height: 680px) {
  .hall-caption, .queue { top: 3px; padding-block: 3px; }
  #game:not(.event-testing) :is(.press-model, .press-foot) { display: none; }
  #game:not(.event-testing) .stamp-device { margin-block: 2px; }
  #game:not(.event-testing) .event-phone { margin-block: 5px; }
  #game:not(.event-testing) .memo-sheet { padding: 7px 9px; }
  #game:not(.event-testing) .memo-sheet h2 { margin-block: 3px; }
  #game:not(.event-testing) .memo-sheet p, #game:not(.event-testing) .memo-sheet .notice-rule { font-size: 12px; line-height: 1.32; }
}
@media (pointer: coarse) {
  .bank-edit-button { min-height: 44px; }
}
@media (max-width: 540px) {
  .bank-filters { grid-template-columns: minmax(0, 1fr); }
}

@media (orientation: landscape) and (max-height: 500px) and (min-width: 541px) and (max-width: 960px) {
  #game.in-work:not(.event-testing) { display: flex; flex-direction: column; height: 100dvh; padding-block: 3px; }
  #game.in-work:not(.event-testing) .outside { display: none; }
  #game.in-work:not(.event-testing) .masthead { margin-bottom: 2px; }
  #game.in-work:not(.event-testing) .grading-icon { width: 27px; height: 27px; }
  #game.in-work:not(.event-testing) .wordmark h1 { font-size: 16px; }
  #game.in-work:not(.event-testing) .wordmark p { display: none; }
  #game.in-work:not(.event-testing) .console { padding: 2px 4px; }
  #game.in-work:not(.event-testing) .gauge { padding: 2px 4px; min-width: 56px; }
  #game.in-work:not(.event-testing) .machine { flex: 1; min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
  #game.in-work:not(.event-testing) .hall { height: 28px; }
  #game.in-work:not(.event-testing) .station { min-height: 0; grid-template-rows: minmax(0,1fr); }
  #game.in-work:not(.event-testing) .desk { min-height: 0; }
  #game.in-work:not(.event-testing) .booth { max-height: 24%; }
  #game.in-work:not(.event-testing) .window { overflow: auto; }
  #game.in-work:not(.event-testing) .press { flex-wrap: nowrap; }
  #game.in-work:not(.event-testing) .stamp-device { min-height: 56px; margin-block: 2px; }
  #game.in-work:not(.event-testing) .work-sheet { display: flex; flex-direction: column; min-height: 0; max-height: calc(100% - 76px); }
  #game.in-work:not(.event-testing) .work-sheet.expanded { top: 4px; max-height: calc(100% - 49px); }
  #game.in-work:not(.event-testing) .work-sheet.expanded:not(.imprinted) { height: calc(100% - 49px); }
  #game.in-work:not(.event-testing) .expanded:not(.imprinted) .sheet-body { flex: 1; }
  #game.in-work:not(.event-testing) .expanded:not(.imprinted) .question-reading { flex: 1; }
  #game.in-work:not(.event-testing) .trial-files { bottom: 44px; grid-template-rows: minmax(0,1fr); }
  #game.in-work:not(.event-testing) .trial-files .work-sheet { top: auto; max-height: 100%; }
  #game.in-work:not(.event-testing) .work-sheet .sheet-body { display: flex; flex-direction: column; min-height: 0; padding-block: 3px; }
  #game.in-work:not(.event-testing) .work-sheet :is(.paper-meta,.rows,.doc-grip) { flex: none; }
  #game.in-work:not(.event-testing) .paper-stamp { height: 20px; position: relative; }
  #game.in-work:not(.event-testing) .paper-stamp:has(.seal) { height: 34px; }
  #game.in-work:not(.event-testing) .paper-stamp .seal { position: absolute; scale: .5; }
  #game.in-work:not(.event-testing) .work-sheet .answer-row { min-height: 43px; }
  #game.in-work:not(.event-testing) .work-sheet .correction { padding-block: 2px; }
  #game.in-work:not(.event-testing) .work-sheet .question-reading { min-height: 0; overflow: auto; overscroll-behavior: contain; }
  #game.in-work:not(.event-testing) .feedback { display: flex; flex-direction: column; flex: none; max-height: 40%; padding-block: 3px; }
  #game.in-work:not(.event-testing) .feedback-reading { min-height: 0; overflow: auto; }
  #game.in-work:not(.event-testing) .feedback .primary { align-self: flex-start; flex: none; }
}
@media (orientation: landscape) and (max-height: 500px) and (min-width: 541px) and (max-width: 700px) {
  #game.in-work:not(.event-testing) { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  #game.in-work:not(.event-testing) .station { grid-template-columns: 19% minmax(0,1fr); }
  #game.in-work:not(.event-testing) .work-sheet { top: 28px; max-height: calc(100% - 32px); }
  #game.in-work:not(.event-testing) .work-sheet.expanded { top: 4px; max-height: calc(100% - 12px); }
  #game.in-work:not(.event-testing) .work-sheet.expanded:not(.imprinted) { height: calc(100% - 12px); }
  #game.in-work:not(.event-testing) .trial-files .work-sheet { top: auto; max-height: 100%; }
}
