/* All assets are local. No fonts, libraries or network requests are required. */
:root{--ink:#182236;--blue:#244ee8;--yellow:#ffdf42;--orange:#ff763b;--paper:#f7f8fc;--muted:#5c6579;--line:#dce1ed;--shadow:5px 5px 0 var(--ink);font-family:"Yu Gothic UI","Hiragino Kaku Gothic ProN",Meiryo,system-ui,sans-serif;color:var(--ink);background:var(--blue);font-synthesis:none}
*{box-sizing:border-box}body{margin:0;min-width:0;background-image:radial-gradient(#ffffff18 1.3px,transparent 1.3px);background-size:22px 22px}button,a{-webkit-tap-highlight-color:transparent;touch-action:manipulation}button{font:inherit;cursor:pointer;color:inherit}button:disabled{cursor:default}button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid var(--blue);outline-offset:4px}button:active:not(:disabled){transform:translate(2px,2px);box-shadow:none}a{color:inherit}h1,h2,h3,p{margin-top:0}h1:focus,h2:focus{outline:none}button{user-select:none;-webkit-user-select:none}svg{display:block}dialog{border:2px solid var(--ink);border-radius:22px;max-width:calc(100% - 30px);width:480px;padding:0;box-shadow:8px 8px 0 #111b36;margin:auto;max-height:calc(100vh - 36px);max-height:calc(100dvh - 36px);overflow:auto}dialog::backdrop{background:#101b44b8;backdrop-filter:blur(4px)}.dialog-inner{padding:28px}.dialog-inner h2{font-size:1.4rem}.dialog-inner p{line-height:1.7}.dialog-inner .primary-button{width:100%}.dialog-actions{display:flex;gap:12px}.dialog-actions>*{flex:1}.dialog-actions .primary-button{width:auto}.rules-list{padding-left:24px;line-height:1.65}.rules-list li{padding:7px 0}.rule-equation{font-weight:800;background:var(--yellow);border-radius:10px;padding:12px;font-size:.9rem}.fine-print{font-size:.8125rem;color:var(--muted);line-height:1.6}.site-wrap{width:min(1100px,100%);padding:24px 28px 16px;margin:auto;min-height:100vh;min-height:100svh;display:flex;flex-direction:column}.site-header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:26px;color:white}.brand{display:flex;align-items:center;gap:10px;text-decoration:none;font-size:1.3rem;letter-spacing:.025em;font-weight:900}.brand svg{width:33px;height:30px;color:var(--yellow)}.header-tag{font-family:monospace;font-size:.8rem;font-weight:800;letter-spacing:.07em;border:1.5px solid #ffffff80;border-radius:100px;padding:7px 12px;white-space:nowrap}#app{flex:1}.site-footer{display:flex;justify-content:space-between;gap:12px;color:#ffffffc7;font-size:.75rem;padding:24px 0 0;letter-spacing:.03em}.site-footer span:last-child{font-family:monospace;white-space:nowrap}.eyebrow{font-size:.75rem;letter-spacing:.12em;font-weight:900;display:block;margin-bottom:12px}.home-layout{display:grid;grid-template-columns:1fr 1.05fr;gap:28px;align-items:stretch}.intro{padding:34px 30px;background:var(--yellow);border:2.5px solid var(--ink);border-radius:24px;box-shadow:var(--shadow);display:flex;flex-direction:column;position:relative;overflow:hidden}.intro h1{font-size:clamp(2.35rem,5.8vw,3.75rem);line-height:1.27;letter-spacing:-.05em;font-weight:950;margin:5px 0 15px}.intro h1 .title-small{font-size:.47em;letter-spacing:.02em;display:block;line-height:1.6}.intro-copy{font-size:1rem;line-height:1.8;margin-bottom:22px;font-weight:650}.ticket{display:inline-flex;align-self:flex-start;gap:9px;padding:8px 12px;border:2px solid var(--ink);background:white;border-radius:6px;transform:rotate(-3deg);font-weight:800;font-size:.875rem;margin-bottom:22px}.display-demo{border:3px solid var(--ink);border-radius:15px;background:var(--ink);padding:20px;color:white;box-shadow:0 0 0 5px #fff8;margin:12px 0 25px}.demo-label{font-size:.8125rem;color:#c7d0e4;display:flex;justify-content:space-between;gap:8px;margin-bottom:10px}.demo-digits{font-family:Consolas,"SFMono-Regular",monospace;font-size:clamp(2rem,4vw,2.8rem);font-weight:800;letter-spacing:.1em;color:var(--yellow);white-space:nowrap}.demo-digits small{font:800 .875rem system-ui;letter-spacing:0;color:white;margin-left:6px}.demo-question{margin-top:14px;font-size:.9rem;font-weight:750}.intro-bottom{margin-top:auto;display:flex;gap:14px;align-items:center;justify-content:space-between}.intro-bottom span{font-size:.8125rem;font-weight:800}.text-button{border:0;background:transparent;text-decoration:underline;text-underline-offset:4px;padding:12px 6px;min-height:44px;font-weight:750}.mode-panel{padding:8px 0}.section-heading{display:flex;align-items:baseline;justify-content:space-between;color:white;gap:12px;margin-bottom:15px}.section-heading h2{font-size:1.1rem;margin:0}.section-heading span{font-size:.8125rem;color:#ffffffca}.mode-list{display:grid;gap:12px}.mode-button{min-height:94px;text-align:left;display:grid;grid-template-columns:44px 1fr auto;align-items:center;gap:12px;padding:15px 18px;border:2.5px solid var(--ink);border-radius:15px;background:white;box-shadow:4px 4px 0 var(--ink);transition:transform .12s,box-shadow .12s}.mode-button:hover{transform:translateY(-2px)}.mode-number{display:grid;place-items:center;width:40px;height:40px;border-radius:12px;font-family:Consolas,monospace;font-weight:900;font-size:1.1rem;background:var(--mode-color);border:1.5px solid var(--ink)}.mode-name{font-size:1.12rem;font-weight:950;letter-spacing:.03em;display:block;margin-bottom:4px}.mode-desc{font-size:.875rem;display:block;color:var(--muted);line-height:1.5}.mode-limit{font-size:.75rem;font-weight:900;white-space:nowrap;display:block;border:1px solid var(--line);padding:6px 8px;border-radius:6px}.mode-button.endless{background:var(--ink);color:white}.mode-button.endless .mode-desc{color:#d1d9ee}.mode-button.endless .mode-number{color:var(--ink)}.mode-button.endless .mode-limit{border-color:#63708b}.session-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 16px;color:white}.session-meta{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.mode-chip{font-size:.875rem;font-weight:900;letter-spacing:.06em;background:var(--yellow);color:var(--ink);border:2px solid var(--ink);border-radius:7px;padding:7px 11px}.question-count{font-family:Consolas,monospace;font-size:1.05rem;font-weight:750}.exit-button{background:transparent;border:1px solid #ffffff9e;color:white;font-size:.8125rem;border-radius:7px;padding:9px 12px;min-height:44px}.play-shell{background:var(--paper);border:2.5px solid var(--ink);border-radius:24px;box-shadow:var(--shadow);overflow:hidden}.status-bar{padding:16px 24px;display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:2px solid var(--ink);background:white}.status-label{font-size:.75rem;font-weight:850;letter-spacing:.07em}.timer{display:flex;gap:10px;align-items:baseline;white-space:nowrap}.timer-number{font-family:Consolas,"SFMono-Regular",monospace;font-size:2rem;font-weight:900;line-height:1}.timer-unit{font-size:.875rem;font-weight:800}.timer-track{height:5px;background:var(--line);overflow:hidden}.timer-fill{height:100%;width:100%;background:var(--blue);transform-origin:left;transition:background .2s}.timer.urgent{color:#c83812}.timer-fill.urgent{background:#e14318}.score-running{font-family:Consolas,monospace;font-size:1.2rem;font-weight:850}.score-running small{font:700 .75rem system-ui;color:var(--muted)}.hp-status{display:flex;gap:10px;align-items:center}.hp-value{font-family:Consolas,monospace;font-weight:800;font-size:1.2rem}.hp-track{width:90px;background:var(--line);height:10px;border:1px solid var(--ink);border-radius:20px;overflow:hidden}.hp-fill{height:100%;background:var(--orange)}.play-content{display:grid;grid-template-columns:1fr 1fr}.question-panel{padding:30px 26px;border-right:2px dashed #c9cfdf}.question-panel .eyebrow{color:var(--muted);margin-bottom:15px}.food-list{display:grid;gap:12px;margin-bottom:20px}.food{display:flex;align-items:center;gap:14px;border:1.5px solid var(--line);border-radius:12px;background:white;padding:16px}.food-symbol{font-size:1.6rem;line-height:1;background:#fff3d4;border-radius:10px;width:44px;height:44px;display:grid;place-items:center;flex-shrink:0}.food-label{font-size:.75rem;color:var(--muted);font-weight:700;display:block;margin-bottom:3px}.food-values{font-size:1.15rem;font-weight:850;line-height:1.4;display:flex;gap:12px;flex-wrap:wrap}.food-values .watt{color:var(--blue);font-family:Consolas,monospace}.target-block{padding-top:3px}.target-prefix{font-size:.9rem;font-weight:750;margin-bottom:5px}.target-question{font-size:1.4rem;line-height:1.45;margin:0;font-weight:850}.target-watts{font-family:Consolas,monospace;font-size:2.75rem;color:var(--blue);letter-spacing:-.06em;margin-right:7px}.target-watts small{font-size:1.5rem;letter-spacing:0;margin-left:4px}.game-note{font-size:.75rem;color:var(--muted);line-height:1.65;margin:16px 0 0}.answer-panel{padding:27px 26px 25px;position:relative;display:flex;flex-direction:column;justify-content:center}.answer-panel .eyebrow{margin-bottom:15px;color:var(--muted)}.answer-control{display:flex;justify-content:center;align-items:center;gap:7px;user-select:none;-webkit-user-select:none}.digit-column{width:64px;display:grid;gap:7px;text-align:center}.digit-button{height:48px;min-width:48px;border:1.5px solid var(--ink);border-radius:9px;background:white;box-shadow:0 3px 0 var(--ink);display:grid;place-items:center}.digit-button svg{width:18px;height:18px}.digit-button:disabled{opacity:.45;box-shadow:none}.digit-value{font-family:Consolas,"SFMono-Regular",monospace;font-size:3.4rem;line-height:1.25;font-weight:800;color:var(--yellow);background:var(--ink);border:2px solid var(--ink);border-radius:8px;min-height:70px;display:grid;place-items:center}.digit-unit{font-size:.9rem;font-weight:850;margin:0 2px}.answer-helper{text-align:center;font-size:.8125rem;color:var(--muted);min-height:22px;line-height:1.5;margin:16px 0 12px}.answer-helper.invalid{color:#b02b09;font-weight:750}.primary-button,.secondary-button{min-height:52px;border:2px solid var(--ink);border-radius:10px;padding:12px 22px;box-shadow:0 4px 0 var(--ink);font-weight:850;font-size:1rem;line-height:1.5}.primary-button{background:var(--orange)}.secondary-button{background:white}.primary-button:disabled{background:#e1e4ec;color:#636a7a;box-shadow:none;border-color:#a4abbc}.submit-button{width:100%;margin-top:2px;font-size:1.15rem;letter-spacing:.1em}.charge-overlay{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#f7f8fcf7;padding:25px;text-align:center;border-radius:0 0 24px 0}.charge-label{font-size:1.15rem;font-weight:900;margin-bottom:14px}.charge-sub{font-size:.875rem;color:var(--muted)}.charge-bars{display:flex;gap:5px;margin-bottom:17px;height:40px;align-items:center}.charge-bars i{display:block;width:9px;height:28px;border-radius:5px;background:var(--orange);animation:charge .65s ease-in-out infinite alternate}.charge-bars i:nth-child(2){animation-delay:.1s}.charge-bars i:nth-child(3){animation-delay:.2s}.charge-bars i:nth-child(4){animation-delay:.3s}.charge-bars i:nth-child(5){animation-delay:.4s}@keyframes charge{to{height:11px;background:var(--blue)}}.feedback-layout{padding:28px;display:grid;grid-template-columns:1.05fr .95fr;gap:28px}.feedback-heading{font-size:1.45rem;font-weight:900;margin:0 0 22px}.result-compare{display:grid;gap:10px}.compare-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 15px;background:white;border:1.5px solid var(--line);border-radius:10px}.compare-row.correct{background:#fff4b5;border-color:#e9cc54}.compare-row span{font-size:.875rem;font-weight:750}.compare-row strong{font-family:Consolas,"SFMono-Regular",Meiryo,monospace;font-size:1.35rem}.compare-row.error strong{font-size:1.05rem}.formula{font-size:.8125rem;color:var(--muted);margin-top:14px;line-height:1.6}.formula summary{cursor:pointer;min-height:36px;font-weight:750}.formula p{overflow-wrap:anywhere;margin:5px 0 0}.points-panel{background:var(--yellow);border:2px solid var(--ink);border-radius:16px;padding:26px 22px;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center}.points-panel .eyebrow{margin-bottom:9px}.points-number{font-family:Consolas,monospace;font-size:4.5rem;font-weight:900;line-height:1.1;letter-spacing:-.06em}.points-denom{font-family:Consolas,monospace;font-size:1.1rem;font-weight:700;margin:4px 0 18px}.points-panel .primary-button{width:100%;margin-top:auto}.damage-line{background:var(--ink);color:white;border-radius:8px;padding:9px 14px;font-weight:850;margin:0 0 12px}.damage-line strong{font-family:Consolas,monospace;font-size:1.35rem;color:var(--orange)}.hp-result{font-family:Consolas,monospace;font-size:1.2rem;font-weight:750;margin-bottom:18px}.summary-shell{max-width:760px;margin:auto;background:white;border:2.5px solid var(--ink);border-radius:24px;box-shadow:var(--shadow);overflow:hidden}.summary-hero{background:var(--yellow);padding:30px 28px;text-align:center;border-bottom:2px solid var(--ink)}.summary-hero.endless-hero{background:var(--ink);color:white}.summary-hero h1{font-size:1.2rem;letter-spacing:.08em;margin:0 0 18px}.summary-number{font-family:Consolas,monospace;font-size:clamp(4rem,12vw,6rem);font-weight:900;line-height:1.05;letter-spacing:-.07em}.summary-number small{font:850 1.25rem system-ui;letter-spacing:0;margin-left:8px}.summary-denom{font-family:Consolas,monospace;font-weight:750;margin:9px 0 0}.summary-body{padding:24px 28px}.summary-stats{display:flex;justify-content:center;gap:22px;margin-bottom:24px;flex-wrap:wrap;text-align:center}.stat-label{display:block;font-size:.8125rem;color:var(--muted);margin-bottom:5px}.stat-value{font-family:Consolas,monospace;font-size:1.4rem;font-weight:850}.stat-note{font-size:.75rem;color:var(--muted);display:block;margin-top:5px}.history-title{font-size:.875rem;margin:0 0 12px}.history-list{display:grid;gap:8px}.history-row{display:grid;grid-template-columns:28px 1fr auto;gap:10px;align-items:center;background:var(--paper);border:1px solid var(--line);border-radius:10px;padding:12px}.history-q{font-family:Consolas,monospace;font-size:.875rem;font-weight:850;color:var(--blue)}.history-time{font-size:.8125rem;line-height:1.5}.history-time span{display:block;color:var(--muted);font-size:.75rem}.history-score{font-family:Consolas,monospace;font-size:1.05rem;font-weight:850;white-space:nowrap}.summary-actions{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:22px}.boot-message{color:white;text-align:center;padding:60px 20px}.noscript{background:white;padding:20px;border-radius:12px}.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}
@media(min-width:850px){.home-layout{min-height:650px}.mode-list{gap:14px}.mode-button{min-height:100px}}
@media(max-width:760px){.site-wrap{padding:18px 18px 14px}.site-header{margin-bottom:22px}.brand{font-size:1.08rem}.header-tag{font-size:.65rem;padding:6px 8px}.home-layout{grid-template-columns:1fr;gap:24px}.intro{padding:24px}.intro h1{font-size:2.9rem;margin:0 0 10px}.intro .eyebrow{margin-bottom:8px}.intro-copy{margin-bottom:8px}.ticket{margin-bottom:12px}.display-demo{display:none}.intro-bottom{margin-top:8px}.mode-panel{padding:0}.mode-list{grid-template-columns:1fr 1fr;gap:12px}.mode-button{grid-template-columns:1fr;gap:8px;padding:14px;min-height:142px;align-content:start;position:relative}.mode-number{width:30px;height:30px;font-size:.9rem;border-radius:8px}.mode-name{font-size:.98rem;letter-spacing:0;margin-bottom:5px}.mode-desc{font-size:.8125rem}.mode-limit{position:absolute;top:15px;right:12px;font-size:.7rem;padding:4px 5px}.mode-button.endless{grid-column:1/-1;grid-template-columns:36px 1fr;min-height:92px;align-items:center;padding-right:78px}.endless .mode-limit{top:28px}.play-content{grid-template-columns:1fr}.question-panel{padding:22px;border-right:0;border-bottom:2px dashed #c9cfdf}.question-panel .eyebrow{margin-bottom:12px}.food-list{grid-template-columns:1fr 1fr;gap:10px;margin-bottom:15px}.food-list.single{grid-template-columns:1fr}.food{padding:12px;gap:9px}.food-list:not(.single) .food{align-items:flex-start;flex-direction:column}.food-symbol{width:34px;height:34px;font-size:1.25rem}.food-values{font-size:1rem;gap:5px 12px}.food-list:not(.single) .food-values{flex-direction:column;gap:2px}.target-prefix{font-size:.8125rem}.target-question{font-size:1.18rem}.target-watts{font-size:2.35rem}.game-note{margin-top:10px}.answer-panel{padding:21px 22px 25px}.answer-panel .eyebrow{margin-bottom:13px;text-align:center}.status-bar{padding:15px 20px}.charge-overlay{border-radius:0 0 22px 22px}.feedback-layout{grid-template-columns:1fr;padding:22px;gap:20px}.feedback-heading{margin-bottom:17px;font-size:1.3rem}.points-panel{padding:20px}.points-number{font-size:4rem}.points-denom{margin-bottom:14px}.summary-hero{padding:25px 20px}.summary-body{padding:22px 20px}.summary-actions{gap:10px}.summary-actions button{padding:12px 8px;font-size:.9rem}.site-footer{font-size:.6875rem}.question-count{font-size:.9rem}.session-meta{gap:8px}.mode-chip{font-size:.75rem;padding:6px 8px}.exit-button{font-size:.75rem;padding:8px}.hp-track{width:65px}.hp-status{gap:7px}.hp-value{font-size:1rem}}
@media(max-width:360px){.site-wrap{padding:14px 12px}.brand{font-size:1rem;gap:7px}.brand svg{width:27px;height:27px}.header-tag{font-size:.6rem;padding:5px}.intro{padding:21px}.intro h1{font-size:2.55rem}.intro-bottom{gap:8px}.intro-bottom span{font-size:.75rem}.mode-button{padding:13px 10px}.mode-name{font-size:.9rem}.mode-desc{font-size:.75rem}.mode-limit{right:9px;font-size:.65rem}.status-bar{padding:14px}.question-panel{padding:18px}.answer-panel{padding:20px 18px 24px}.digit-column{width:60px}.answer-control{gap:5px}.digit-unit{margin:0}.digit-value{font-size:3.15rem}.timer-number{font-size:1.8rem}.status-label{font-size:.6875rem}.score-running{font-size:1rem}.hp-track{width:48px}.compare-row{padding:12px}.compare-row strong{font-size:1.18rem}.summary-body{padding:20px 16px}.summary-stats{gap:18px}.dialog-inner{padding:22px}.site-footer span:first-child{max-width:140px;line-height:1.5}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}.charge-bars i:nth-child(even){height:16px}}
@media(forced-colors:active){.digit-value,.mode-chip,.points-panel,.summary-hero{border:2px solid CanvasText}.timer-fill,.hp-fill{background:Highlight}.charge-overlay{background:Canvas}}
.play-shell{overflow:visible}.live-status{position:sticky;top:8px;z-index:5;overflow:hidden;border-radius:21px 21px 0 0;background:white;box-shadow:0 2px 0 #18223618}


/* ===== V1.4 additions ===== */
.mode-best{display:inline-block;margin-top:6px;font:800 .7rem/1 Consolas,"SFMono-Regular",monospace;letter-spacing:.04em;background:var(--ink);color:var(--yellow);border-radius:5px;padding:4px 6px}
.endless .mode-best{background:var(--yellow);color:var(--ink)}
.digit-column{position:relative;border-radius:12px}
.digit-column.active .digit-value{box-shadow:0 0 0 3px var(--yellow),0 0 0 5px var(--ink)}
.key-hint{text-align:center;font-size:.72rem;color:var(--muted);margin:-4px 0 12px;letter-spacing:.02em}
@media (hover:none),(pointer:coarse){.key-hint{display:none}.digit-column.active .digit-value{box-shadow:none}}
.best-line{margin:12px 0 0;font-weight:850;font-size:.95rem}
.best-line.new{display:inline-block;background:var(--ink);color:var(--yellow);border-radius:100px;padding:6px 14px;animation:best-pop .5s cubic-bezier(.2,1.6,.4,1) both}
.endless-hero .best-line.new{background:var(--yellow);color:var(--ink)}
.best-line span{font-weight:700;font-size:.8rem;opacity:.85}
@keyframes best-pop{from{transform:scale(.6);opacity:0}}
.summary-actions .share-button{grid-column:1/-1}
.share-button{display:flex;align-items:center;justify-content:center;gap:8px;min-height:48px;border:2px dashed var(--ink);border-radius:10px;background:transparent;font-weight:850;font-size:.95rem}
.share-button svg{width:18px;height:18px}
.share-button:hover{background:var(--paper)}

/* Mobile: keep the whole question + answer + 決定 inside one screen during play. */
@media (max-width:760px){
  body[data-phase="answering"] .site-header,body[data-phase="grading-wait"] .site-header,
  body[data-phase="answering"] .site-footer,body[data-phase="grading-wait"] .site-footer{display:none}
  body[data-phase="answering"] .site-wrap,body[data-phase="grading-wait"] .site-wrap{padding-top:max(10px,env(safe-area-inset-top));padding-bottom:max(10px,env(safe-area-inset-bottom))}
  .session-top{margin-bottom:10px}
  .exit-button{min-height:38px}
  .status-bar{padding:10px 18px}
  .timer-number{font-size:1.7rem}
  .question-panel{padding:14px 18px 12px}
  .question-panel>.eyebrow{display:none}
  .food-list{margin-bottom:10px;gap:8px}
  .food{padding:8px 10px;gap:8px}
  .food-list:not(.single) .food{flex-direction:row;align-items:center}
  .food-symbol{width:30px;height:30px;font-size:1.05rem}
  .food-label{font-size:.68rem;margin-bottom:1px}
  .food-values{font-size:.95rem;line-height:1.3}
  .target-prefix{margin-bottom:0}
  .target-question{font-size:1.05rem;line-height:1.35}
  .target-watts{font-size:2.1rem}
  .question-panel .game-note{display:none}
  .answer-panel{padding:12px 18px 16px}
  .answer-panel>.eyebrow{display:none}
  .digit-column{gap:5px}
  .digit-button{height:44px}
  .digit-value{font-size:2.8rem;min-height:58px;line-height:1.15}
  .answer-helper{margin:8px 0 8px;min-height:20px}
  .submit-button{min-height:54px}
}
@media (max-width:760px) and (max-height:700px){
  .digit-button{height:40px}
  .digit-value{font-size:2.5rem;min-height:52px}
  .target-watts{font-size:1.9rem}
}
