@font-face {
  font-family: "Hakgyoansim Boardmarker";
  src: url("assets/fonts/Hakgyoansim_BoardmarkerR.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root{--ink:#262b32;--muted:#82868d;--line:#e3e5e8;--paper:#fff;--red:#bd6645;--blue:#305e82;--desk:#fff6e4}*{box-sizing:border-box}body{margin:0;background:var(--desk);color:var(--ink);font-family:"Hakgyoansim Boardmarker",-apple-system,BlinkMacSystemFont,'Apple SD Gothic Neo','Noto Sans KR',sans-serif;font-size:14px;letter-spacing:-.25px}button,input,textarea,select{font:inherit}button,a{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{opacity:.35;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #d2ad62;outline-offset:3px}.desk-header{max-width:960px;margin:auto;padding:28px 26px 22px;display:flex;justify-content:space-between;align-items:center;gap:16px}.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--ink);font-size:26px;font-weight:850;letter-spacing:-1.6px;line-height:1.1}.brand>img{width:35px;height:40px;object-fit:contain}.brand .red{color:#bb7640}.brand small{display:block;font-size:10px;font-weight:450;letter-spacing:0;color:#95979b;margin-top:5px}.desk-header nav{display:flex;gap:7px}.paper-button{border:1px solid #dde0e3;border-radius:7px;padding:8px 11px;background:#fff;color:#666c73;font-size:11px;box-shadow:0 1px 1px #00000003}.paper-button:hover{border-color:#aaaeb5}.desk{display:grid;grid-template-columns:minmax(0,606px) 200px;gap:36px;max-width:940px;margin:auto;align-items:start;padding:0 24px}.game-sheet{position:relative;background:#fff;border:1px solid #e0e3e6;border-radius:14px;padding:19px 20px 10px;box-shadow:0 5px 20px #24313b05}.sheet-holes,.tape{display:none}.scorebar{display:flex;align-items:center;justify-content:space-between;min-height:86px;padding:12px 2px 2px;gap:12px}.scorebar label{display:block;font-size:10px;font-weight:600;color:#8d929a;margin-bottom:7px}.scorebar strong{font-size:36px;font-weight:750;line-height:1;color:#5d6570;font-variant-numeric:tabular-nums}.timebox{text-align:right;flex-shrink:0}.timebox small{font-size:11px;font-weight:450;color:#a2a6ac;margin-left:7px;vertical-align:middle}.timebox.urgent label,.timebox.urgent small{color:#c85d47}.progress-track{height:3px;background:#f0ede6;margin-bottom:14px;border-radius:2px;overflow:hidden}.progress-track>div{height:100%;width:0;background:#bca16d;transition:width .22s}.board-frame{padding:5px;border:1px solid #333b42;border-radius:9px;background:#41464c;box-shadow:0 3px 0 #292e33}#game-board-container{position:relative;overflow:hidden;border-radius:4px;background:#ebe5d7}#game-board{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:2px;padding:3px;background:#dbd3c2;touch-action:none;user-select:none}.grid-cell{aspect-ratio:1;min-width:0;display:flex;justify-content:center;align-items:center;background:#fffcf6;border-radius:4px;border:1px solid #ede6d8;position:relative;cursor:grab;contain:layout style}.grid-cell img{width:100%;height:100%;object-fit:contain;user-select:none;pointer-events:none}.grid-cell:hover{background:#fff}.grid-cell.selected{background:#f1d99d;box-shadow:inset 0 0 0 2px #bd9954}.grid-cell:active{cursor:grabbing}.hint{animation:hint 1.3s ease-in-out infinite}.shuffle-animation{animation:shuffle .22s ease-in-out}.fx-canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:7}#cover{position:absolute;inset:22% 16%;background:#fffdf7f5;border:1px solid #e1d9ca;border-radius:12px;z-index:9;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:18px;box-shadow:0 6px 30px #2b29251c}.start-pencil{width:55px;height:55px;object-fit:contain}#cover h1{font-size:23px;font-weight:750;letter-spacing:-.8px;margin:9px 0 20px}#cover small{font-size:10px;color:#95938a;margin-top:15px}.primary{background:#30363d;border:1px solid #30363d;border-radius:8px;color:#fff;padding:13px 24px;font-size:14px;font-weight:650;line-height:1.25;transition:background .15s}.primary:hover{background:#454e57}#start{background:#e9bd64;border-color:#d1a14d;color:#4c3921;font-size:16px;min-width:130px;padding:12px 28px}#start:hover{background:#f1cb7d}.primary:active{transform:translateY(1px)}.quiet{background:none;border:0;color:#8f959c;font-size:11px;cursor:pointer;padding:8px}.board-footer{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:7px;font-size:10px;color:#a0a5ac}.game-memo{padding:18px 0 0}.game-memo h2{font-size:14px;font-weight:700;margin:0 0 18px}.memo-rules{margin:0;padding-left:17px;font-size:12px;line-height:2.2;color:#818790}.memo-rules b{color:#515a64;font-weight:650}.hand-note{font-size:11px;color:#a1a5ac;line-height:1.8;margin:13px 0 23px}.special-guide{border-top:1px solid #dfe2e6;padding-top:19px}.special-guide h3{font-size:12px;font-weight:650;color:#5c6570;margin:0 0 12px}.special-guide>div{display:flex;align-items:center;gap:3px;margin:8px 0;font-size:11px;color:#89919a}.special-guide img{width:28px;height:28px;object-fit:contain}.special-guide span{margin-left:5px}.memo-link{display:block;background:none;border:0;text-decoration:none;padding:9px 0;margin-top:7px;color:#7c858e;font-size:11px;cursor:pointer}.memo-link:hover{color:#30363d}.mini-icons{display:flex;gap:4px;margin-top:19px}.mini-icons img{width:37px;height:37px;object-fit:contain}footer{text-align:center;color:#acb0b6;font-size:10px;margin:20px auto 27px}.modal{position:fixed;inset:0;background:#202832aa;z-index:30;display:grid;place-items:center;padding:20px;backdrop-filter:blur(3px)}.dialog{background:#fff;border:1px solid #e8eaed;border-radius:14px;padding:28px;max-width:430px;width:100%;max-height:90dvh;overflow:auto;box-shadow:0 24px 70px #10182030}.dialog h2{font-size:23px;font-weight:750;line-height:1.4;letter-spacing:-.7px;margin:15px 0 19px}.dialog p{font-size:13px;line-height:1.8;color:#828992}.dialog .primary{width:100%}.paper-tag{font-size:11px;font-weight:600;color:#959da7}.dialog-top{display:flex;justify-content:space-between;align-items:center}#quiz-clock{font-size:17px;font-weight:650;color:#b28b48}#answers{display:grid;gap:10px}#answers button{background:#fff;border:1px solid #dfe3e8;border-radius:8px;padding:15px;text-align:left;font-size:19px;font-weight:600;color:var(--ink)}#answers button.good{background:transparent;border-color:transparent}#answers button.bad{background:transparent;border-color:transparent}#answers button:disabled{opacity:1}#feedback{font-size:13px;color:#7d858e;line-height:1.9;margin:20px 0}.muted{color:#939aa3;font-size:12px;line-height:1.8}#result-title{margin-bottom:22px}#result-score{font-size:48px;font-weight:750;color:#30363d;justify-content:center;display:flex!important;min-height:59px;margin:7px 0 20px}#result-stats{text-align:center;border-bottom:1px solid #edf0f3;padding-bottom:21px;margin-bottom:22px;font-size:11px}#review p{font-size:15px;padding-left:10px;border-left:2px solid #d9dee3}.dialog label{font-size:12px;display:block;margin-top:19px;color:#707985}input{width:100%;border:1px solid #dfe4e9;border-radius:7px;background:#fff;padding:12px;color:var(--ink);font-size:14px;margin:8px 0 17px}input::placeholder{color:#b3b9c1}#again{display:block;margin:12px auto 0}.record-list{list-style:none;padding:0;margin:20px 0 25px}.record-list li{display:flex;justify-content:space-between;border-bottom:1px solid #edf0f3;padding:14px 0;font-size:13px}.empty{font-size:13px;line-height:1.9;color:#9aa1aa}.score-popup{position:absolute;pointer-events:none;z-index:8;color:#975a32;font-size:20px;font-weight:750;white-space:nowrap;animation:score-fly .6s ease-out forwards}.status-popup{position:absolute;top:9px;left:50%;transform:translateX(-50%);z-index:8;padding:5px 13px;border:1px solid #decda9;border-radius:6px;background:#fff4d9ee;pointer-events:none;font-size:15px;font-weight:700;white-space:nowrap;animation:ribbon .5s ease-out forwards}.hidden{display:none!important}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.has-digit-art{--numeral-height:36px;display:inline-flex!important;align-items:flex-end;vertical-align:middle;gap:1px;line-height:1;isolation:isolate}.digit-slot{display:block;position:relative;flex-shrink:0;height:var(--numeral-height);width:calc(var(--numeral-height)*var(--glyph-ratio,.78));transition:width .2s ease;perspective:250px}.number-digit{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:fill;backface-visibility:hidden;transform-origin:center center;image-rendering:auto}.number-sign{font-size:calc(var(--numeral-height)*.65);font-weight:750;line-height:1;margin:0 1px;color:#9c603d}.number-comma{font-size:calc(var(--numeral-height)*.42);align-self:flex-end;line-height:.85;margin:0 1px 2px;width:.2em;color:#955831}#result-score{--numeral-height:49px;gap:2px}.score-popup.has-digit-art{--numeral-height:22px;gap:0}.timebox .has-digit-art{--numeral-height:36px}
@keyframes score-fly{0%{opacity:0;transform:translate(-30%,4px) scale(.8)}20%{opacity:1;transform:translate(-30%,-6px) scale(1.04)}100%{opacity:0;transform:translate(-30%,-42px) scale(.95)}}@keyframes ribbon{0%{opacity:0;transform:translateX(-50%) scale(.85)}20%,70%{opacity:1;transform:translateX(-50%) scale(1)}100%{opacity:0;transform:translateX(-50%) translateY(-8px)}}@keyframes hint{50%{transform:scale(.92);box-shadow:inset 0 0 0 2px #ceb477}}@keyframes shuffle{50%{transform:scale(.88)}}
@media(max-width:740px){.desk-header{max-width:590px;padding:17px 14px 15px;gap:8px}.brand{font-size:24px;gap:7px}.brand>img{width:28px;height:33px}.brand small{font-size:8px;margin-top:4px}.desk-header nav{gap:4px}.paper-button{font-size:10px;padding:7px 6px}.desk{display:block;max-width:590px;padding:0 11px}.game-sheet{padding:13px 11px 7px;border-radius:11px}.scorebar{padding:12px 1px 1px;min-height:77px}.scorebar label{font-size:10px;margin-bottom:6px}.has-digit-art,.timebox .has-digit-art{--numeral-height:32px}.progress-track{margin-bottom:12px}.board-frame{padding:4px}.grid-cell{border:0;border-radius:3px}#game-board{gap:2px;padding:2px}.board-footer{font-size:9px;margin-top:6px}.quiet{font-size:10px}.game-memo{display:grid;grid-template-columns:1fr 1fr;gap:0 18px;padding:25px 10px 0}.game-memo h2{grid-column:1/-1;margin-bottom:9px;font-size:13px}.memo-rules{font-size:11px;line-height:2.2}.hand-note{font-size:10px;margin:8px 0 16px}.special-guide{grid-row:2/4;grid-column:2;border:0;padding:0}.special-guide h3{font-size:11px;margin-bottom:7px}.special-guide img{width:25px;height:25px}.special-guide>div{font-size:10px;margin:5px 0}.mini-icons{display:none}.memo-link{font-size:10px;margin:0}.dialog{padding:24px;max-width:380px}.dialog h2{font-size:21px}#result-score{--numeral-height:43px}#result-score[data-length="7"]{--numeral-height:37px}#cover{inset:19% 13%;padding:12px}#cover h1{font-size:21px;margin:5px 0 15px}.start-pencil{width:45px;height:45px}#cover small{font-size:9px;margin-top:12px}#start{font-size:15px;padding:10px 24px}footer{font-size:9px;margin:18px auto 23px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

/* Start panel uses the same neutral surface and charcoal action as dialogs. */
#cover{background:#fffffff5;border-color:#e3e6ea;box-shadow:0 8px 28px #1f29371a}#cover h1{color:#30363d}#cover small{color:#949ca6}#start{background:#30363d;border-color:#30363d;color:#fff}#start:hover{background:#474f58}
.combo-burst{position:absolute;left:50%;top:36%;transform:translate(-50%,-50%);z-index:10;pointer-events:none;font-size:clamp(25px,4vw,38px);font-weight:900;letter-spacing:-1px;color:#fff4d3;-webkit-text-stroke:1px #71492e;text-shadow:2px 3px 0 #764a30,0 5px 12px #5231193d;animation:combo-pop .65s ease-out forwards;white-space:nowrap}.combo-burst small{display:block;font-size:.45em;text-align:center;letter-spacing:1px;color:#fff;-webkit-text-stroke:0;text-shadow:0 1px 3px #50331b;margin-top:5px}.answer-correct{color:#4e8051!important;animation:answer-pop .32s ease-out}.answer-wrong{color:#ad6654!important;animation:answer-nudge .2s ease-out}
@keyframes combo-pop{0%{opacity:0;transform:translate(-50%,-50%) scale(.45) rotate(-8deg)}25%{opacity:1;transform:translate(-50%,-50%) scale(1.14) rotate(3deg)}45%,72%{opacity:1;transform:translate(-50%,-50%) scale(1) rotate(-2deg)}100%{opacity:0;transform:translate(-50%,-65%) scale(1.08)}}@keyframes answer-pop{40%{transform:scale(1.035)}}@keyframes answer-nudge{25%{transform:translateX(-3px)}75%{transform:translateX(3px)}}
@media(prefers-reduced-motion:reduce){.combo-burst,.answer-correct,.answer-wrong{animation:none!important}.combo-burst{opacity:1}}

.streak-art{position:absolute;display:flex;align-items:center;gap:2px;z-index:10;pointer-events:none;white-space:nowrap;transform:translate(-50%,-50%);filter:drop-shadow(0 3px 2px #4b301930)}.streak-art .streak-number{--numeral-height:calc(43px * var(--streak-scale));gap:0}.streak-word{width:calc(112px * var(--streak-scale));height:calc(43px * var(--streak-scale));object-fit:contain;display:block}.streak-art.is-high{filter:drop-shadow(0 0 7px #ffe4a2b3) drop-shadow(0 4px 2px #5a304533)}.streak-art.is-high::before{content:'';position:absolute;inset:-16px -22px;border-radius:50%;background:radial-gradient(ellipse,#ffdb842e,transparent 68%);z-index:-1;pointer-events:none}

.score-breakdown{margin:17px 0 13px;border-top:1px solid #e9edf0;padding-top:12px}.score-breakdown>div{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:7px 0;font-size:12px}.score-breakdown dt{color:#8b949f}.score-breakdown dd{margin:0;font-weight:650;font-variant-numeric:tabular-nums;color:#495563}#result-note:empty{display:none}.spacing-dialog{max-width:740px;max-height:94dvh}.spacing-dialog h2{margin-bottom:11px}.spacing-dialog .spacing-instruction{font-size:12px;color:#929ba5;line-height:1.8;margin-bottom:20px}#spacing-clock{font-size:20px;color:#b48340;font-weight:700;white-space:nowrap;font-variant-numeric:tabular-nums}.manuscript-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));margin:8px 10px 22px;border-top:1px solid #d7aaa2;border-left:1px solid #d7aaa2;background:#fffdfb}.manuscript-cell{position:relative;aspect-ratio:1;display:grid;place-items:center;border-right:1px solid #d7aaa2;border-bottom:1px solid #d7aaa2;min-width:0;font-size:23px;color:#343e48;user-select:none}.space-marker{position:absolute;width:24px;height:36px;right:-12px;top:50%;transform:translateY(-50%);padding:0;border:0;background:transparent;z-index:2;display:grid;place-items:center}.space-marker>span{display:grid;place-items:center;width:15px;height:18px;background:#fffdfb;color:#aab1ba;border:1px solid transparent;border-radius:3px;font-size:19px;line-height:1}.space-marker:hover>span{border-color:#c0c9d2}.space-marker.chosen>span{background:#5683a3;border-color:#5683a3;color:#fff;font-size:11px}.space-marker:disabled{opacity:1;cursor:default}.space-marker.gap-correct>span{background:#6b9271;border-color:#6b9271;color:#fff}.space-marker.gap-missed>span{background:#f7e1b9;border-color:#d9b477;color:#a77b37;font-size:12px}.space-marker.gap-extra>span{background:#edcbc2;border-color:#d9a093;color:#9e4f3e;font-size:14px}.spacing-preview-wrap{margin:0 0 20px;padding-top:14px;border-top:1px solid #edf0f3}.spacing-preview-wrap>span{font-size:10px;color:#98a1ab}.spacing-preview-wrap #spacing-preview{font-size:15px;line-height:1.9;color:#52606e;overflow-wrap:anywhere;margin:7px 0 0}.spacing-result{border-left:3px solid #c9a394;padding:1px 0 1px 14px;margin:0 0 21px}.spacing-result.spacing-success{border-color:#91b58a}.spacing-result #spacing-feedback{font-weight:650;color:#697785;font-size:13px}.spacing-result #spacing-solution{color:#4d6358;font-size:14px}.spacing-result #spacing-explanation{font-size:12px}#cover small{text-align:center;line-height:1.7;max-width:100%}
@media(max-width:740px){.spacing-dialog{max-width:540px;max-height:92dvh;padding:19px}.manuscript-grid{grid-template-columns:repeat(8,minmax(0,1fr));margin-left:8px;margin-right:8px}.manuscript-cell{font-size:21px}.spacing-dialog h2{font-size:20px}.spacing-dialog .paper-tag{font-size:10px}.spacing-dialog .spacing-instruction{font-size:11px}.spacing-preview-wrap #spacing-preview{font-size:14px}.spacing-result #spacing-solution{font-size:13px}.memo-rules{line-height:2}}

/* Keep answer targets stationary while the player races the clock. */
.fever-dialog #fever-title{margin-bottom:10px}
#fever-clock{font-size:22px;color:#89531e;font-variant-numeric:tabular-nums}
.fever-meter{height:5px;background:#f3e8d6;border-radius:8px;overflow:hidden;margin:0 0 15px}
#fever-fill{height:100%;background:#d89443;width:100%}
.fever-hud{display:flex;justify-content:space-between;align-items:center;min-height:38px;color:#89531e;font-weight:750}
#fever-score{--numeral-height:27px}
#fever-question{color:var(--ink);font-weight:750;font-size:clamp(17px,4vw,21px);min-height:3.6em;display:flex;align-items:center;margin:12px 0;line-height:1.55}
#fever-answers{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
#fever-answers button{min-height:58px;padding:8px 4px;font-size:clamp(14px,4vw,18px);font-weight:700;border:1px solid #ded8cb;border-radius:8px;background:#fffcf6;color:var(--ink)}

#fever-answers button.good{background:transparent;border-color:transparent;opacity:1}
#fever-answers button.bad{background:transparent;border-color:transparent;opacity:1}
#fever-feedback{min-height:2em;color:#80501d;font-weight:650;margin:12px 0}
#result-score[aria-hidden=true] .digit-slot{transition:none}
#fever-answers button:nth-child(3){grid-column:1/-1;min-height:38px}
#fever-answers .fever-unused{visibility:hidden}

.brand{min-width:0}.brand>.brand-title{display:block;width:clamp(108px,32vw,190px);max-width:100%;height:auto;object-fit:contain}.desk-header nav{flex-shrink:0}

/* One centered column, including the controls above the board. */
.desk-header,.desk{max-width:660px;padding-inline:clamp(10px,3vw,24px)}
.desk{display:block}
.desk-header{padding-block:12px;gap:6px}
.desk-header nav{margin-left:auto;flex:0 0 auto}
#help-modal .memo-rules{font-size:13px;line-height:1.9}
#help-modal .hand-note{margin:10px 0 14px}
#help-modal .special-guide{border-top:1px solid #dfe2e6;padding-top:12px}
#help-modal .memo-link{margin:8px 0 12px}
@media(max-width:480px){
  .desk-header .brand-title{width:clamp(76px,27vw,120px)}
  .desk-header .paper-button{white-space:nowrap;padding-inline:5px;min-height:32px}
  .game-sheet{padding-inline:7px}
}

.scorebar #score,.scorebar #timer{--numeral-height:clamp(28px,8vw,36px)}

.game-sheet .scorebar{padding-top:2px;min-height:72px}

/* Painted game surfaces. The text and button hit areas remain native controls. */
.board-frame {
  border: 8px solid transparent;
  border-image: url("assets/ui/frame.webp") 35 stretch;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
#cover, .dialog {
  background: none;
  border: 12px solid transparent;
  border-image: url("assets/ui/paper.webp") 60 fill stretch;
  border-radius: 12px;
}
#cover h1 { color: #543321; }
#cover small { color: #66482e; }
.primary, .paper-button, .scorebar label {
  background: transparent url("assets/ui/menu.webp") center / 100% 100% no-repeat;
  color: #35291e;
  border: 0;
}
.primary {
  background-image: url("assets/ui/action.webp");
  color: #382211;
}
.primary:hover, .paper-button:hover { background-color: transparent; filter: brightness(1.06); }
.paper-button { min-height: 32px; padding-inline: 10px; font-weight: 700; }
.scorebar label {
  display: inline-block;
  min-width: 46px;
  padding: 4px 9px;
  margin-bottom: 4px;
  text-align: center;
}
.progress-track, .fever-meter {
  height: 8px;
  background: url("assets/ui/track.webp") center / 100% 100% no-repeat;
}
.progress-track > div, #fever-fill {
  background: url("assets/ui/fill.webp") left center / 100% 100% no-repeat;
}
#start:not(:disabled) {
  width: clamp(112px, 32vw, 184px);
  min-width: 0;
  min-height: 44px;
  aspect-ratio: 3.2;
  padding: 0;
  font-size: 0;
  background: transparent url("assets/ui/start.webp") center / contain no-repeat;
  border: 0;
}
#start:disabled { background: url("assets/ui/action.webp") center / 100% 100% no-repeat; color: #382211; border: 0; }
@media (max-width: 480px) {
  .board-frame { border-width: 5px; }
  #cover { padding: 6px; border-width: 8px; }
}

.game-sheet {
  border: 0;
  padding: clamp(16px, 4vw, 25px) clamp(13px, 3.8vw, 25px) 17px;
  background: transparent url("assets/ui/cabinet.webp") center / 100% 100% no-repeat;
  box-shadow: none;
}
.board-frame {
  border: 4px solid #663411;
  border-radius: 9px;
  background: #f6d681;
}
.paper-button, .primary, #start:disabled {
  background: transparent url("assets/ui/chip-blue.webp") center / 100% 100% no-repeat;
  color: #132238;
}
.paper-button { min-height: 36px; padding-inline: 13px; }
.scorebar label, .timebox.urgent label {
  background: transparent url("assets/ui/chip-coral.webp") center / 100% 100% no-repeat;
  color: #4d251b;
  padding-inline: 10px;
}
#cover {
  inset: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 82%;
  min-height: 0;
  padding: 21px 14px;
  border: 0;
  background: transparent url("assets/ui/ready.webp") center / 100% 100% no-repeat;
  box-shadow: none;
}
#cover .start-pencil { display: none; }
#cover h1 { margin: 0 0 9px; }
#cover small { margin-top: 5px; }
.dialog { border-image: url("assets/ui/cabinet.webp") 84 fill stretch; }
@media (max-width: 480px) {
  .paper-button { padding-inline: 9px; }
  #cover { padding: 15px 9px; }
}

/* Keep painted corners and edges at a fixed size as the panel grows. */
.game-sheet {
  border: 15px solid transparent;
  border-image: url("assets/ui/cabinet.webp") 118 fill stretch;
  background: none;
  padding: 5px clamp(5px, 1.8vw, 12px) 6px;
}
#cover {
  width: min(78%, 370px);
  border: 12px solid transparent;
  border-image: url("assets/ui/cabinet.webp") 118 fill stretch;
  background: none;
  padding: 12px 8px;
}
.paper-button, .primary, #start:disabled, .scorebar label, .timebox.urgent label {
  border: 2px solid #61371e;
  border-radius: 8px;
  background: #fff2d0 url("assets/ui/cabinet.webp") center / 155% 220% no-repeat;
  color: #492a1a;
}
.scorebar label, .timebox.urgent label {
  background: none;
  border: 0;
  padding: 0;
  min-width: 0;
  display: block;
}
.board-footer { color: #60462e; }
.board-footer .quiet { color: #60462e; }
@media (max-width: 480px) {
  .game-sheet { border-width: 10px; }
  #cover { border-width: 9px; padding: 8px 5px; }
}

.game-sheet .progress-track { margin-top: 6px; }

/* Charcoal surfaces echo the title outline. The cream page uses the base styles. */
.charcoal-theme { --desk: #edf0f2; }
.charcoal-theme .game-sheet {
  border: clamp(7px, 2vw, 12px) solid #373b43;
  border-radius: 18px;
  background: #f7f8f9;
  padding: 8px clamp(7px, 2vw, 14px);
}
.charcoal-theme .board-frame {
  border-color: #373b43;
  background: #b9bdc4;
}
.charcoal-theme #game-board {
  gap: 1px;
  background: #d0d3d8;
}
.charcoal-theme .grid-cell { background: #fbfaf7; border-color: #dedfe2; }
.charcoal-theme #cover, .charcoal-theme .dialog {
  border: 3px solid #454a53;
  background: #f7f8f9;
  color: #252831;
  box-shadow: 0 5px 0 #25283135;
}
.charcoal-theme #cover h1, .charcoal-theme #cover small,
.charcoal-theme .board-footer, .charcoal-theme .board-footer .quiet {
  color: #40454e;
}
.charcoal-theme .paper-button, .charcoal-theme .primary, .charcoal-theme #start:disabled {
  background: #40454e;
  border-color: #2b2f36;
  color: #fff;
}
.charcoal-theme .scorebar label { color: #434955; }
.charcoal-theme .timebox.urgent label { color: #a64236; }
.charcoal-theme .progress-track, .charcoal-theme .fever-meter {
  background: #d6dae0;
  box-shadow: inset 0 1px 2px #272a3433;
}

.charcoal-theme .game-sheet {
  border: clamp(9px, 2vw, 15px) solid transparent;
  border-image: url("assets/ui/slate-cabinet.webp") 220 54 65 fill stretch;
  background: none;
}
.charcoal-theme #cover {
  border: 12px solid transparent;
  border-image: url("assets/ui/slate-ready.webp") 99 fill stretch;
  background: none;
  box-shadow: none;
}
.charcoal-theme .paper-button {
  background: transparent url("assets/ui/slate-menu.webp") center / 100% 100% no-repeat;
  border: 0;
  color: #fff;
  text-shadow: 0 1px 2px #20242c;
}
#ranking {
  margin: 8px 0 4px;
  padding: 2px 9px;
  color: #f4f5f7;
  border: 12px solid transparent;
  border-image: url("assets/ui/slate-display.webp") 68 fill stretch;
}
#ranking-title { margin: 0 0 6px; color: #ffd373; font-size: 14px; }
#ranking-status { margin: 0; font-size: 12px; }
#ranking-status:empty { display: none; }
#ranking-list { margin: 0; padding-left: 22px; }
#ranking-list li { padding: 3px 0; font-size: 13px; }
#ranking-list li strong { float: right; color: #ffd373; font-variant-numeric: tabular-nums; }
#ranking-list li span { overflow-wrap: anywhere; }
.charcoal-theme .board-footer { justify-content: flex-end; }

.charcoal-theme .game-sheet {
  border: 2px solid #454a53;
  border-radius: 18px;
  background: #f7f6f3;
  padding: 12px clamp(9px, 2.5vw, 20px);
}
.charcoal-theme .scorebar { background: transparent; }
.charcoal-theme .board-footer { display: none; }
.charcoal-theme #cover {
  width: min(78%, 370px);
  aspect-ratio: 2 / 1;
  border: 0;
  background: url("assets/ui/slate-ready.webp") center / contain no-repeat;
  padding: 8px;
}
.charcoal-theme .desk-header .paper-button {
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 0;
  background: transparent var(--menu-icon) center / 32px 32px no-repeat;
  background-size: 32px auto;
  box-shadow: none;
}
.charcoal-theme #help-open { --menu-icon: url("assets/ui/nav-help.webp"); }
.charcoal-theme #records-open { --menu-icon: url("assets/ui/nav-records.webp"); }
.charcoal-theme #sound { --menu-icon: url("assets/ui/nav-sound-off.webp"); }
.charcoal-theme #sound[aria-pressed="true"] { --menu-icon: url("assets/ui/nav-sound-on.webp"); }
@media (max-width: 420px) {
  .charcoal-theme #cover h1 { font-size: 16px; margin-bottom: 3px; }
  .charcoal-theme #cover small { font-size: 8px; margin-top: 1px; }
}

/* Reuse the painted button art at each dialog width without stretching its corners. */
.charcoal-theme .dialog .primary {
  display: block;
  width: fit-content;
  min-width: min(148px, 100%);
  max-width: 100%;
  min-height: 46px;
  margin-inline: auto;
  padding: 4px 12px;
  border: solid transparent;
  border-width: 15px 20px;
  border-image: url("assets/ui/action.webp") 62 76 fill stretch;
  background: none;
  color: #382211;
}

#records-modal .paper-tag img,
#records-title img,
#records-close img {
  display: block;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
#records-modal .paper-tag img { height: 13px; }
#records-title img { height: 27px; }
#records-close img { height: 19px; margin-inline: auto; }
#ranking-list { list-style: none; padding: 0; }
#ranking-list li, .record-list li {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}
#ranking-list .record-rank, .record-list .record-rank { --numeral-height: 15px; }
#ranking-list .record-score, .record-list .record-score { --numeral-height: 19px; margin-left: auto; }
.record-name { min-width: 0; overflow-wrap: anywhere; font-size: 15px; }

.record-medal { flex: none; width: 14px; height: 20px; object-fit: contain; margin-inline-start: -5px; }
#ranking-list .record-rank, .record-list .record-rank { min-width: 22px; justify-content: center; flex: none; }
[data-podium="1"] .record-score { filter: hue-rotate(19deg) saturate(1.35); }
[data-podium="2"] .record-score { filter: grayscale(1) brightness(1.1); }
[data-podium="3"] .record-score { filter: saturate(.72) brightness(.8); }

#help-title img {
  display: block;
  width: auto;
  height: 26px;
  max-width: 100%;
  object-fit: contain;
}
#answers button, #fever-answers button {
  border: 9px solid transparent;
  border-image: url("assets/ui/quiz-choice.webp") 36 60 fill stretch;
  background: none;
  color: #3e2817;
  padding: 7px 11px;
}
#answers button.good, #fever-answers button.good {
  background: none;
  filter: hue-rotate(52deg);
}
#answers button.bad, #fever-answers button.bad {
  background: none;
  filter: hue-rotate(-35deg) saturate(1.25);
}

/* Match the painted dialog action while keeping variable answer text readable. */
#answers button, #fever-answers button {
  border-width: 15px 20px;
  border-image: url("assets/ui/action.webp") 62 76 fill stretch;
  color: #382211;
  padding: 4px 10px;
}
#answers button.good, #fever-answers button.good {
  filter: hue-rotate(58deg) saturate(.72);
}
#answers button.bad, #fever-answers button.bad {
  filter: hue-rotate(-30deg) saturate(.85);
}
#answers button.good::before, #fever-answers button.good::before {
  content: "✓";
  margin-inline-end: .35em;
}
#answers button.bad::before, #fever-answers button.bad::before {
  content: "×";
  margin-inline-end: .35em;
}

/* Tint the painted surface independently of the answer text. */
#answers button, #fever-answers button {
  position: relative;
  isolation: isolate;
  border-image: none;
  color: #252e3c;
}
#answers button::after, #fever-answers button::after {
  content: "";
  position: absolute;
  inset: -15px -20px;
  z-index: -1;
  pointer-events: none;
  border: solid transparent;
  border-width: 15px 20px;
  border-image: url("assets/ui/action.webp") 62 76 fill stretch;
  filter: hue-rotate(180deg) saturate(.38) brightness(1.28);
}
#answers button.good, #answers button.bad,
#fever-answers button.good, #fever-answers button.bad { filter: none; }
#answers button.good::after, #fever-answers button.good::after {
  filter: hue-rotate(58deg) saturate(.52) brightness(1.14);
}
#answers button.bad::after, #fever-answers button.bad::after {
  filter: hue-rotate(-30deg) saturate(.58) brightness(1.17);
}
#answers button:hover:not(:disabled)::after,
#fever-answers button:hover:not(:disabled)::after {
  filter: hue-rotate(180deg) saturate(.38) brightness(1.34);
}

.manuscript-grid {
  grid-template-columns: repeat(var(--manuscript-columns, 12), minmax(0, 1fr));
  gap: 17px 0;
  margin: 18px 0 22px;
  border: 0;
  background: none;
}
.manuscript-cell {
  border: 0;
  background: url("assets/ui/manuscript-white-cell.png") center / 100% 100% no-repeat;
  margin-inline: -2.5%;
  font-size: clamp(13px, 4vw, 23px);
}
.manuscript-blank { z-index: 1; }
.manuscript-blank[hidden] { display: none; }
.manuscript-blank::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 50%;
  translate: -50% -50%;
  width: min(70%, 52px);
  aspect-ratio: 3 / 2;
  background: url("assets/ui/manuscript-pencil-red-v3.png") center / contain no-repeat;
  pointer-events: none;
}
.space-marker { width: 18px; right: calc(2.4% - 9px); }
.space-marker.chosen:not(.gap-extra) > span { background: transparent; border-color: transparent; color: transparent; }
.space-marker.chosen:focus-visible > span { border-color: #5683a3; }
.space-marker:disabled:not(.gap-extra):not(.gap-missed) { visibility: hidden; }
.spacing-result p:empty { display: none; }

.manuscript-period > span {
  justify-self: start;
  align-self: end;
  margin: 0 0 8% 16%;
}

#spacing-title img {
  display: block;
  height: 30px;
  max-width: 100%;
  object-fit: contain;
  object-position: left;
}
#spacing-clock {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}
#spacing-clock-digits { --digit-height: 27px; }
.space-marker:focus-visible {
  outline: 2px solid #5683a3;
  outline-offset: -4px;
}
.manuscript-solution .manuscript-blank::before {
  background-image: url("assets/ui/manuscript-pencil-lime.png");
}

.game-label {
  display: inline-block;
  width: auto;
  height: 26px;
  max-width: 100%;
  object-fit: contain;
  vertical-align: middle;
}
button .game-label { height: 19px; }
#fever-clock {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
#fever-clock-digits { --digit-height: 27px; }

#review-open { margin: 12px auto; }
#review-panel h2 { margin: 10px 0 16px; }
#review {
  padding: 16px;
  text-align: left;
  background: #fbfaf7;
  border: 1px solid #dce1e5;
  border-radius: 12px;
}
#review h3 { margin: 0 0 10px; font-size: 17px; overflow-wrap: anywhere; }
#review p { margin: 6px 0; line-height: 1.55; overflow-wrap: anywhere; }
.review-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.review-nav .review-arrow {
  width: 50px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent url("assets/ui/review-arrow-stone.png") center / 50px auto no-repeat;
}
#review-prev { transform: scaleX(-1); }
.review-arrow:hover:not([aria-disabled="true"]) { filter: brightness(1.08); }
#review-title img { display: block; width: auto; height: 27px; max-width: 100%; object-fit: contain; object-position: left; }
#review-position { --numeral-height: 16px; }
#review-position .number-sign { margin-inline: 3px; color: #526778; }

.review-nav button[aria-disabled="true"] { opacity: .4; cursor: default; }


.charcoal-theme .game-sheet {
  border: 14px solid transparent;
  border-radius: 21px;
  background-clip: border-box;
  padding: 8px clamp(5px, 1.3vw, 12px);
}
.charcoal-theme #cover {
  border: 18px solid transparent;
  background: none;
  isolation: isolate;
  padding: 0;
}
.charcoal-theme .game-sheet::after,
.charcoal-theme #cover::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-image: url("assets/ui/crayon-ui-frame.webp") 70 94 stretch;
  filter: url("assets/ui/crayon-wobble.svg?v=2#edge");
}
.charcoal-theme .game-sheet::after {
  inset: -14px;
  border-width: 19px;
  border-style: solid;
  border-color: transparent;
}
.charcoal-theme #cover::before {
  content: "";
  position: absolute;
  inset: -13px;
  border-radius: 24px;
  background: #d5dbe2;
  z-index: -2;
}
.charcoal-theme #cover::after {
  inset: -18px;
  border-width: 21px;
  border-style: solid;
  border-color: transparent;
  z-index: -1;
}
.timebox > strong {
  display: inline-flex;
  align-items: flex-end;
}
.timebox small { display: flex; }
.timer-unit-art {
  width: 15px;
  height: 13px;
  transform: rotate(-5deg);
}
#cover h1 .game-label {
  transform: scale(.98, 1.13);
}

.charcoal-theme .board-frame {
  position: relative;
  background: transparent;
  border-color: #373b43;
  border-image: url("assets/ui/crayon-ui-frame.webp") 70 94 / 11px 14px / 1px 0 stretch;
  box-shadow: none;
}

.progress-track,
#progress-fill {
  background-image: var(--gauge-wax),
    url("assets/ui/crayon-grid-grain.png");
  background-position: center;
  background-size: auto, 150px 9px;
  background-repeat: repeat;
}
.progress-track {
  --gauge-wax: linear-gradient(#d6dbe1e8, #aab3bfd6);
  height: 8px;
  border-radius: 3px 4px 3px 4px;
  background-color: #b6bcc3;
}
#progress-fill {
  --gauge-wax: linear-gradient(90deg, #fff38eeb, #ffd540d9 52%, #ffb92bdb);
  background-color: #ffbf49;
  border-radius: 3px 5px 4px 2px;
}

.review-stamp {
  float: right;
  width: clamp(60px, 20vw, 84px);
  height: auto;
  margin: 0 0 6px 10px;
}
#review { display: flow-root; }

#competition-status:not(:empty) {
  margin-top: 8px;
  color: #4b2222;
  font-size: 12px;
  text-align: center;
}
#ranking {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}
#ranking-title { margin: 0; white-space: nowrap; }
.ranking-ticker, #ranking-status { grid-column: 2; grid-row: 1; }
.ranking-ticker { overflow: hidden; container-type: inline-size; }
#ranking-list {
  display: flex;
  width: max-content;
  white-space: nowrap;
}
#ranking-list.is-moving {
  margin-left: 100%;
  animation: ranking-scroll var(--ticker-duration, 18s) linear infinite;
}
#ranking-list li {
  display: block;
  flex: none;
  padding: 0;
  border: 0;
  line-height: 22px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #ffd373;
}
.ranking-ticker:hover #ranking-list { animation-play-state: paused; }
@keyframes ranking-scroll {
  to { transform: translateX(calc(-100% - 100cqw)); }
}
@media (prefers-reduced-motion: reduce) {
  .ranking-ticker { overflow-x: auto; }
  #ranking-list.is-moving { animation: none; margin-left: 0; }
}

.charcoal-theme #message-open { --menu-icon: url("assets/ui/nav-message.svg?v=2"); }
#message-dialog::backdrop { background: #202832aa; backdrop-filter: blur(3px); }
#message-form select, #message-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #aab4bd;
  border-radius: 7px;
  color: var(--ink);
  background: white;
}
#message-form textarea { resize: vertical; }
#message-form label { margin-bottom: 7px; }
.message-actions { display: flex; justify-content: center; gap: 12px; }
.message-actions button {
  width: min(145px, 48%);
  aspect-ratio: 2.78;
  border: 0;
  padding: 0;
  background: transparent url("assets/ui/message-actions.webp") no-repeat;
  background-size: 243% auto;
}
#message-close { background-position: 9.7% center; filter: hue-rotate(148deg) saturate(.82); }
#message-send { background-position: 90.5% center; filter: hue-rotate(76deg) saturate(.8); }
.message-actions button:disabled { opacity: .5; }

#message-close { --message-color: hue-rotate(148deg) saturate(.82); }
#message-send { --message-color: hue-rotate(76deg) saturate(.8); }
#message-form .message-actions button { filter: var(--message-color); }
#message-form .message-actions button:not(:disabled):is(:hover, :focus-visible) {
  filter: var(--message-color) brightness(1.12);
}
#message-consent-label[hidden] { display: none; }
#message-form #message-consent-label:not([hidden]) {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
  cursor: pointer;
}
#message-form #message-consent {
  appearance: none;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  padding: 0;
  margin: 1px 0 0;
  border: 0;
  border-radius: 0;
  background: linear-gradient(#fafbf7, #e9eee4) center / 84% 84% no-repeat;
  outline: 1px solid #657060;
  outline-offset: -3px;
  cursor: pointer;
}
#message-form #message-consent:checked {
  background: url("assets/ui/message-check.png") center / contain no-repeat;
  outline: none;
}
#message-form #message-consent:focus-visible {
  outline: 2px solid #446738;
  outline-offset: 2px;
}
#message-question {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  color: var(--ink);
}
#review-report { color: #624035; text-decoration: underline; }

#message-question-card {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 7px;
  background: #e9edf0;
}
#message-question {
  margin: 5px 0 0;
  line-height: 1.5;
}

#message-form #message-consent-label:not([hidden]) {
  margin-top: 6px;
  font-size: 16px;
  word-break: keep-all;
}
#message-form #message-consent {
  background: url("assets/ui/message-check-off-v2.png") center / contain no-repeat;
  filter: grayscale(1) brightness(1.07);
  outline: none;
}
#message-form #message-consent:checked {
  background-image: url("assets/ui/message-check-on-v2.png");
  filter: none;
}
.result-art {
  display: block;
  width: min(145px, 48%);
  min-height: 44px;
  aspect-ratio: 2.97;
  padding: 0;
  border: 0;
  background: transparent var(--result-art) center / contain no-repeat;
}
.result-art:not(:disabled):hover { filter: brightness(1.1); }
#review-open { --result-art: url("assets/ui/result-review.webp"); }
#save { --result-art: url("assets/ui/result-save.webp"); }
.result-save-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.result-save-row input { flex: 1; min-width: 0; margin: 0; }
.result-save-row button { flex-shrink: 0; }
#save-status:empty { display: none; }

#result-summary { position: relative; }
#result-title { text-align: center; }
[data-podium="1"] .record-score, #result-score { filter: hue-rotate(19deg) saturate(1.35); }
.result-confetti {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}
.result-confetti i {
  position: absolute;
  left: var(--burst-x);
  top: var(--burst-y);
  width: 8px;
  height: 12px;
  border-radius: 2px;
}
.result-save-row #nickname {
  min-height: 46px;
  border: 2px solid #8a765b;
  border-radius: 17px;
  background: #fffdf8;
  box-shadow: inset 0 2px 3px #74533414;
  padding-inline: 14px;
}

.result-save-row #nickname:focus {
  outline: none;
  border-color: #59462e;
}

.charcoal-theme #notices-open { --menu-icon: url("assets/ui/nav-notices.svg"); }
#notices-dialog::backdrop { background: #202832aa; backdrop-filter: blur(3px); }
#notices-list details { padding: 12px 0; border-bottom: 1px solid #d9dee3; overflow-wrap: anywhere; }
#notices-list summary { cursor: pointer; font-size: 16px; }
#notices-list p { white-space: pre-wrap; color: var(--ink); }
#notices-status:empty { display: none; }
#notices-close { margin: 16px auto 0; }
@media (max-width: 420px) {
  .charcoal-theme .desk-header nav { gap: 2px; }
  .charcoal-theme .desk-header nav .paper-button { width: 32px; background-size: 26px auto; }
}

#notices-dialog #notices-close {
  display: block;
  width: min(148px, 100%);
  padding: 0;
  border: 0;
  background: none;
}
#notices-close img { display: block; width: 100%; height: auto; }
#notices-close:hover { filter: brightness(1.08); }
.charcoal-theme .desk-header :is(#message-open, #notices-open) { background-size: 39px auto; }
@media (max-width: 420px) {
  .charcoal-theme .desk-header :is(#message-open, #notices-open) { background-size: 32px auto; }
}

/* Notice board shares the game's paper cards and illustrated action button. */
#notices-dialog{width:min(560px,calc(100vw - 32px));max-height:85dvh;overflow:auto;padding:26px;background:#f5f6f7;border:3px solid #505760;border-radius:20px;box-sizing:border-box}
.notices-heading{display:flex;align-items:center;gap:12px;padding-bottom:18px;border-bottom:2px solid #d4d8dd;margin-bottom:18px}
.notices-heading img{width:36px;height:40px;object-fit:contain}
#notices-title{margin:0;font-size:25px}
#notices-list{display:grid;gap:12px}
#notices-list details{border:2px solid #d5d9de;border-radius:12px;padding:0;background:#fffdf8;overflow:hidden}
#notices-list summary{display:flex;gap:12px;align-items:center;padding:15px;list-style:none}
#notices-list summary::-webkit-details-marker{display:none}
#notices-list summary::after{content:'＋';margin-left:auto;color:#7b838c;flex-shrink:0}
#notices-list details[open] summary::after{content:'−'}
.notice-category{font-size:12px;background:#e7edf2;color:#526575;border-radius:6px;padding:4px 7px;flex-shrink:0}
.notice-headline{font-size:17px;overflow-wrap:anywhere}
#notices-list details[open] summary{border-bottom:1px dashed #d5d9de}
#notices-list p{padding:16px;margin:0;font-size:16px;line-height:1.8}
#notices-dialog #notices-close{width:148px;min-height:48px;box-sizing:border-box;margin:22px auto 0;padding:0 14px;border:solid transparent;border-width:13px 17px;border-image:url('assets/ui/action.webp') 42 50 fill / 13px 17px / 0 stretch;background:none}
#notices-dialog #notices-close img{width:auto;max-width:100%;height:19px;margin:auto;object-fit:contain}
@media(max-width:420px){#notices-dialog{padding:20px}.notice-headline{font-size:16px}#notices-list summary{padding:12px;gap:8px}}

.entry-notice{width:min(520px,calc(100vw - 32px));max-height:85dvh;overflow:auto;background:#f5f6f7;border:3px solid #505760;border-radius:20px;padding:26px}
.entry-notice::backdrop{background:#202832aa;backdrop-filter:blur(3px)}
.entry-notice h2{font-size:24px;margin:0 0 20px}
.entry-notice p{white-space:pre-wrap;overflow-wrap:anywhere;font-size:17px;line-height:1.8}
.entry-notice-actions{display:flex;justify-content:flex-end;gap:12px;flex-wrap:wrap;margin-top:22px}
.entry-notice-actions button{font:inherit;color:#382211;background:none;border:solid transparent;border-width:13px 17px;border-image:url('assets/ui/action.webp') 42 50 fill / 13px 17px / 0 stretch;min-height:48px;padding:0 8px}
.entry-notice-actions button:hover{filter:brightness(1.1)}

#help-modal .dialog{width:min(480px,calc(100vw - 32px));max-width:480px;max-height:90dvh;overflow:auto;padding:24px}
#help-modal .help-page{min-height:290px}
#help-modal .help-page[hidden]{display:none}
#help-modal .memo-rules{font-size:18px;line-height:1.9;margin:12px 0;padding-left:25px}
#help-modal .hand-note{font-size:15px;line-height:1.65;margin:16px 0;color:#68717c}
#help-modal .special-guide{border:0;padding:10px 0;display:block}
#help-modal .special-guide h3{font-size:20px;margin:0 0 18px}
#help-modal .special-guide>div{font-size:18px;margin:18px 0;display:flex;gap:9px;align-items:center}
#help-modal .special-guide img{width:34px;height:34px;object-fit:contain}
#help-modal #try-quiz{font-size:16px;margin-top:12px}
.help-pagination{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:12px 0 18px}
.help-pagination button{font:inherit;font-size:23px;color:#34424e;border:solid transparent;border-width:10px 14px;border-image:url('assets/ui/action.webp') 42 50 fill / 10px 14px / 0 stretch;background:none;filter:hue-rotate(170deg) saturate(.4);width:50px;height:44px;padding:0}
#help-page-number{font-size:16px;color:#68717c}
#help-modal #help-close{margin:0 auto}
@media(max-width:420px){#help-modal .dialog{padding:20px}#help-modal .memo-rules{font-size:17px}#help-modal .help-page{min-height:300px}}

.help-match-demo{display:flex;justify-content:center;margin:8px 0 12px}
.help-match-tiles{display:flex;gap:8px;padding:8px 14px;background:#edf0f2;border-radius:16px}
.help-demo-tile{position:relative;display:block;width:52px;height:52px;background:#fffdf5;border:2px solid #ded8ca;border-radius:10px}
.help-demo-tile img{display:block;width:100%;height:100%;object-fit:contain;animation:help-match-pop 3.4s ease-in-out infinite}
.help-demo-tile:nth-child(1){animation:none}
.help-demo-tile:nth-child(3){animation:none}
.help-demo-burst{position:absolute;inset:50%;width:5px;height:5px;border-radius:50%;background:#f5c84f;box-shadow:0 -12px #f5c84f,11px -5px #ee9873,11px 9px #8ebc6e,-10px 9px #ee9873,-11px -5px #8ebc6e;pointer-events:none;animation:help-match-burst 3.4s ease-out infinite}
@keyframes help-match-pop{
  0%,18%{transform:scale(.92);opacity:1}
  30%,40%{transform:scale(1);opacity:1}
  47%{transform:scale(1.15,.9);opacity:1}
  56%,76%{transform:scale(.15);opacity:0}
  88%,100%{transform:scale(.92);opacity:1}
}


@keyframes help-match-burst{0%,44%{transform:translate(-50%,-50%) scale(0);opacity:0}49%{opacity:1}65%{transform:translate(-50%,-50%) scale(2.3);opacity:0}100%{opacity:0}}
#help-modal .memo-rules{margin-top:0;font-size:17px;line-height:1.8;color:#535e6b}
#help-modal .hand-note{margin:12px 0;font-size:15px;color:#68717c}
@media(max-width:420px){.help-demo-tile{width:44px;height:44px}#help-modal .memo-rules{font-size:16px;line-height:1.75}#help-modal .hand-note{font-size:14px}}
@media(prefers-reduced-motion:reduce){.help-demo-tile,.help-demo-tile img{animation:none!important}.help-demo-burst{display:none}}

.modal-heading{display:flex;align-items:center;gap:12px;margin-bottom:22px}
.modal-heading h2{margin:0}
.modal-heading .modal-heading-icon{width:34px;height:34px;object-fit:contain}
#notices-title .modal-title-art,#message-title .modal-title-art,#records-title .modal-title-art{display:block;height:27px;width:auto;max-width:100%;object-fit:contain}
.notices-heading>#notices-title{min-width:0}
.help-match-demo{justify-content:flex-start}
#help-modal .special-combination-hint{display:flex;align-items:center;gap:9px;font-size:18px;line-height:1.6;color:#82868d;margin:18px 0}
.special-combination-hint img{width:34px;height:34px;object-fit:contain;flex-shrink:0}
#game-board-container{container-type:inline-size}
.charcoal-theme #game-board .grid-cell{
  background:#fffdf5;
  border:clamp(1px, calc(0.7cqw - 1.2px), 3.4px) solid #ded8ca;
  border-radius:clamp(5px, 1.7cqw, 11px);
}
@media(max-width:420px){#help-modal .special-combination-hint{font-size:16px}}

#notices-title .modal-title-art,
#message-title .modal-title-art,
#records-title .modal-title-art {
  height: 32px;
}
.modal-heading .modal-heading-icon,
.notices-heading > img {
  width: 38px;
  height: 38px;
}

#help-modal .special-guide > .special-combination-hint {
  font: inherit;
  font-size: 18px;
  line-height: 1.6;
  color: inherit;
  margin: 18px 0;
  gap: 9px;
}
#help-modal .special-guide > div { color: #82868d; line-height: 1.6; }

/* Match the demonstration tray so the cream tile outline stays distinct. */
.charcoal-theme #game-board,
.charcoal-theme #game-board-container { background: #edf0f2; }

/* Four fixed slots demonstrate one valid swap before a three-piece match. */
.help-match-tiles{--demo-step:60px}
.help-demo-tile img{animation:help-match-still 5s ease-in-out infinite}
.help-demo-tile:nth-child(3) img{animation:help-swap-book 5s ease-in-out infinite;position:relative;z-index:2}
.help-demo-tile:nth-child(4) img{animation:help-swap-pencil 5s ease-in-out infinite;position:relative;z-index:3}
.help-demo-burst{animation:help-swap-burst 5s ease-out infinite}
.help-demo-tile:nth-child(4) .help-demo-burst{display:none}
@keyframes help-match-still{
  0%,38%{transform:scale(1);opacity:1}
  45%{transform:scale(1.15,.9);opacity:1}
  55%,82%{transform:scale(.1);opacity:0}
  94%,100%{transform:scale(1);opacity:1}
}
@keyframes help-swap-book{
  0%,16%{transform:translateX(0);opacity:1}
  32%,70%{transform:translateX(var(--demo-step));opacity:1}
  80%{transform:translateX(var(--demo-step));opacity:0}
  82%{transform:translateX(0);opacity:0}
  94%,100%{transform:translateX(0);opacity:1}
}
@keyframes help-swap-pencil{
  0%,16%{transform:translateX(0) scale(1);opacity:1}
  32%,38%{transform:translateX(calc(-1 * var(--demo-step))) scale(1);opacity:1}
  45%{transform:translateX(calc(-1 * var(--demo-step))) scale(1.15,.9);opacity:1}
  55%,80%{transform:translateX(calc(-1 * var(--demo-step))) scale(.1);opacity:0}
  82%{transform:translateX(0) scale(.1);opacity:0}
  94%,100%{transform:translateX(0) scale(1);opacity:1}
}
@keyframes help-swap-burst{
  0%,44%{transform:translate(-50%,-50%) scale(0);opacity:0}
  49%{opacity:1}
  62%{transform:translate(-50%,-50%) scale(2.3);opacity:0}
  100%{opacity:0}
}
@media(max-width:420px){.help-match-tiles{--demo-step:52px}}
@media(prefers-reduced-motion:reduce){
 .help-demo-tile img{animation:none!important}
 .help-demo-tile:nth-child(3) img{transform:translateX(var(--demo-step))}
 .help-demo-tile:nth-child(4) img{transform:translateX(calc(-1 * var(--demo-step)))}
}

.standing-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.standing-filters[hidden], .standing-filters select[hidden] { display: none; }
.standing-filters button, .standing-filters select {
  padding: 7px 14px; border: 1px solid #aeb6be; border-radius: 9px;
  background: #fffdf6; color: #343b43;
}
.standing-filters button[aria-pressed="true"] { background: #ffe2aa; border-color: #b88439; }

.ticker-separator { color: #a8b8ce; }
