@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root { color-scheme: light; --orange: #f65c32; --ink: #231d1b; --paper: #f3f1ed; --muted: #6c655f; --line: #d9d4ce; font-family: 'Noto Sans JP', sans-serif; color: var(--ink); background: var(--orange); }
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #1460df; outline-offset: 6px; }
[hidden] { display: none !important; }
.console { max-width: 1256px; margin: 0 auto; padding: 0 48px 22px; }
.masthead { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; font: 700 23px 'Space Grotesk', sans-serif; letter-spacing: -.08em; text-decoration: none; color: var(--ink); }
.brand-mark { display: grid; place-items: center; background: var(--ink); color: var(--orange); border-radius: 50%; width: 25px; height: 25px; letter-spacing: 0; font-size: 19px; transform: rotate(-12deg); }
.top-actions { display: flex; align-items: center; gap: 25px; }
.text-button { border: 0; background: transparent; padding: 11px 0; font-size: .875rem; font-weight: 600; color: inherit; }
.text-button:hover { text-decoration: underline; text-underline-offset: 5px; }
.edition { font: 500 12px 'Space Grotesk', sans-serif; letter-spacing: .08em; }
.machine { background: var(--paper); border: 2px solid var(--ink); border-radius: 22px; overflow: hidden; box-shadow: 0 8px 0 #231d1b; }
.machine-heading { padding: 20px 30px 18px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.15rem); line-height: 1.4; font-weight: 900; letter-spacing: -.04em; }
.title-period { color: var(--orange); }
#title-word { display: inline-block; transition: color .2s; }
body.revealed #title-word { color: var(--orange); }
#hint { margin: 0; color: var(--muted); font-size: 1rem; font-weight: 500; }
.scene { position: relative; margin: 0 14px; height: clamp(290px, calc(100svh - 355px), 500px); overflow: hidden; border-radius: 12px; background: #e6e7e8; color: #2d353c; transition: color .35s; }
.scene.night { color: #f3f1ed; }
#world { display: block; width: 100%; height: 100%; }
.scene-top { position: absolute; top: 23px; left: 24px; right: 24px; display: flex; justify-content: space-between; gap: 12px; align-items: center; pointer-events: none; }
.location { display: inline-flex; gap: 8px; align-items: center; font-size: .875rem; font-weight: 600; }
.location-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.count { font-size: .875rem; display: flex; align-items: baseline; gap: 7px; background: #ffffffb8; color: var(--ink); padding: 5px 12px; border-radius: 30px; }
.count strong { font: 600 26px 'Space Grotesk', sans-serif; }
.measure { position: absolute; left: 24px; top: 73px; pointer-events: none; }
.measure-label { font-size: 12px; opacity: .7; }
.measure > div { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; max-width: 350px; }
.measure strong { font: 500 clamp(28px, 4vw, 43px) 'Space Grotesk', 'Noto Sans JP', sans-serif; line-height: 1.4; letter-spacing: -.04em; }
.measure #unit { font-size: .875rem; font-weight: 500; }
.caption { position: absolute; bottom: 19px; left: 16px; right: 16px; font-size: 1rem; line-height: 1.6; text-align: center; pointer-events: none; font-weight: 600; }
.reveal-note { position: absolute; right: 25px; top: 80px; background: var(--orange); color: var(--ink); padding: 10px 16px; border-radius: 4px; transform: rotate(5deg); font-weight: 900; font-size: 1rem; box-shadow: 3px 3px 0 #231d1b; animation: label-in .3s ease-out; }
.reveal-note span { text-decoration: line-through; opacity: .6; }
@keyframes label-in { from { opacity: 0; transform: scale(.8) rotate(-6deg); } to { opacity: 1; transform: scale(1) rotate(5deg); } }
.load-note { position: absolute; inset: 0; margin: 0; padding: 24px; display: grid; place-items: center; background: #e6e7e8; font-size: 1rem; text-align: center; }
.load-note button { display: block; padding: 12px 25px; background: var(--ink); color: white; border-radius: 8px; border: 0; margin: 12px auto 0; }
.controls { padding: 21px 30px 23px; }
.control-title { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; }
.control-title label { font-size: 1.125rem; font-weight: 800; }
#amount { font: 600 36px 'Space Grotesk', sans-serif; letter-spacing: -.04em; font-variant-numeric: tabular-nums; min-width: 100px; text-align: right; }
.percent { margin-left: 5px; font-size: 18px; color: var(--muted); }
.slider-wrap { display: flex; align-items: center; gap: 15px; margin: 4px 0 0; }
.end-label { font: 500 24px 'Space Grotesk', sans-serif; color: var(--muted); width: 18px; text-align: center; }
input[type='range'] { --fill: 12%; appearance: none; -webkit-appearance: none; height: 54px; flex: 1; min-width: 0; width: 100%; margin: 0; background: transparent; cursor: ew-resize; touch-action: pan-y; border-radius: 20px; }
input[type='range']::-webkit-slider-runnable-track { height: 10px; border-radius: 9px; background: linear-gradient(to right, var(--orange) 0 var(--fill), #d9d5cf var(--fill) 100%); }
input[type='range']::-moz-range-track { height: 10px; border-radius: 9px; background: #d9d5cf; }
input[type='range']::-moz-range-progress { height: 10px; border-radius: 9px; background: var(--orange); }
input[type='range']::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 36px; height: 36px; margin-top: -13px; background: var(--ink); border: 6px solid var(--paper); border-radius: 50%; box-shadow: 0 0 0 2px var(--ink); transition: transform .12s; }
input[type='range']::-moz-range-thumb { width: 24px; height: 24px; background: var(--ink); border: 6px solid var(--paper); border-radius: 50%; box-shadow: 0 0 0 2px var(--ink); }
input[type='range']:active::-webkit-slider-thumb { transform: scale(1.12); }
input[type='range']:disabled { opacity: .4; cursor: wait; }
.control-bottom { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; font-size: .875rem; line-height: 1.6; color: var(--muted); }
.control-bottom p { margin: 0; }
#one-cat { color: var(--ink); font-weight: 600; text-align: right; }
.under-machine { display: flex; justify-content: space-between; align-items: center; gap: 22px; padding-top: 30px; }
.scale-stops { display: flex; gap: 5px; }
.scale-stops button { display: flex; align-items: baseline; gap: 7px; padding: 10px 12px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink); font: 500 12px 'Space Grotesk', sans-serif; }
.scale-stops button span { font: 700 14px 'Noto Sans JP', sans-serif; }
.scale-stops button[aria-pressed='true'] { border-color: var(--ink); }
.scale-stops button:disabled { opacity: .45; }
.scale-stops button:not(:disabled):hover { background: #ffffff24; }
.bottom-actions { display: flex; align-items: center; gap: 22px; }
.save { display: flex; align-items: center; gap: 17px; padding: 13px 18px; background: var(--ink); color: var(--paper); border: 1px solid var(--ink); border-radius: 6px; font-size: .875rem; font-weight: 700; }
.save:hover { background: #40322c; }
.save:disabled { opacity: .5; }
.save span { font-size: 20px; line-height: 1; }
footer { display: flex; align-items: baseline; gap: 15px; flex-wrap: wrap; padding: 20px 0 0; color: #5b2c1e; }
footer p { margin: 0; font-size: .875rem; }
footer > span { margin-left: auto; font-size: 12px; }
#save-status { color: var(--ink); font-weight: 600; }
#save-status:empty { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.noscript { padding: 20px; background: var(--paper); color: var(--ink); }
@media (max-width: 900px) {
  .console { padding: 0 25px 22px; }
  .under-machine { flex-wrap: wrap; gap: 12px; }
  .bottom-actions { margin-left: auto; }
}
@media (max-width: 600px) {
  .console { padding: 0 14px 20px; }
  .masthead { min-height: 66px; }
  .wordmark { font-size: 20px; }
  .top-actions { gap: 14px; }
  .edition { display: none; }
  .machine { border-radius: 17px; box-shadow: 0 6px 0 #231d1b; }
  .machine-heading { padding: 20px 17px 18px; gap: 10px; }
  h1 { font-size: 1.5rem; }
  #hint { font-size: .875rem; text-align: right; max-width: 135px; }
  .scene { margin: 0 8px; height: clamp(360px, 49svh, 440px); border-radius: 9px; }
  .scene-top { top: 16px; left: 16px; right: 16px; }
  .measure { top: 60px; left: 16px; }
  .measure > div { max-width: 135px; }
  .measure strong { font-size: 29px; }
  .measure #unit { font-size: .875rem; width: 100%; }
  .caption { font-size: .875rem; bottom: 17px; }
  .reveal-note { top: 119px; right: 17px; font-size: .875rem; padding: 8px 12px; }
  .controls { padding: 15px 17px 17px; }
  #amount { font-size: 30px; }
  .control-title label { font-size: 1rem; }
  .slider-wrap { gap: 11px; }
  .control-bottom { gap: 10px; }
  #one-cat { max-width: 140px; }
  .under-machine { padding-top: 24px; justify-content: center; gap: 18px; }
  .scale-stops { justify-content: space-between; width: 100%; }
  .scale-stops button { padding: 9px 7px; gap: 5px; }
  .bottom-actions { width: 100%; margin-left: 0; justify-content: space-between; gap: 8px; }
  .save { padding: 12px 14px; gap: 10px; }
  footer { justify-content: center; padding-top: 22px; gap: 7px; text-align: center; }
  footer p { width: 100%; }
  footer > span { margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
