:root{color-scheme:light;--paper:#f4f0e5;--ink:#172923;--muted:#63726a;--accent:#bd4b32;--line:#d9d8c9}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-family:"Hiragino Kaku Gothic ProN","Yu Gothic",system-ui,sans-serif}a{color:inherit;text-underline-offset:5px}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;font-weight:700;min-height:52px;border:1px solid var(--ink);border-radius:7px;background:transparent;color:var(--ink);cursor:pointer;touch-action:manipulation}button:hover:not(:disabled){background:#e2e4d7}button:disabled{opacity:.4;cursor:default}.primary{background:var(--accent);color:#fff;border-color:var(--accent)}button.primary:hover:not(:disabled){background:#a73f2b}button:focus-visible,a:focus-visible,canvas:focus-visible{outline:3px solid var(--accent);outline-offset:4px}[hidden]{display:none!important}.eyebrow{font-size:12px;letter-spacing:.18em;font-weight:700}.home{max-width:1060px;margin:auto;padding:32px 28px}.masthead{display:flex;justify-content:space-between;border-bottom:1px solid var(--ink);padding-bottom:20px;font-size:13px}.home-intro{padding:65px 0 38px}.home-intro h1{font-family:serif;font-size:clamp(42px,7vw,72px);letter-spacing:.07em;line-height:1.2;margin:16px 0 24px}.home-intro p{line-height:1.9;color:var(--muted)}.game-card{display:grid;grid-template-columns:1fr 1fr;background:#e5e7dc;border:1px solid #d1d7c8;border-radius:12px;overflow:hidden}.card-image{display:flex;align-items:center;justify-content:center;min-height:360px;background:#d6dece}.card-image img{width:80%;height:320px;object-fit:contain;filter:drop-shadow(0 12px 7px #17292320)}.card-copy{padding:40px;align-self:center}.card-copy h2{font-size:32px;font-family:serif;margin:18px 0}.card-copy p{line-height:1.9}.tag{font-size:12px;border:1px solid #8e9c8f;border-radius:30px;padding:5px 12px}.play-link{display:inline-block;text-decoration:none;padding:16px 34px;border-radius:6px;font-weight:bold;margin-top:16px}.home footer{font-size:12px;color:var(--muted);padding:32px 0}.game-page{background:#dfe4d9}.game-shell{width:min(100%,520px);margin:0 auto;padding:12px 16px max(14px,env(safe-area-inset-bottom));background:var(--paper);min-height:100dvh}.game-header{display:flex;align-items:center;justify-content:space-between;gap:10px}.game-header a{font-size:12px;text-decoration:none}.game-header h1{font-family:serif;font-size:24px;margin:8px 0;white-space:nowrap}.small-label{font-size:10px;white-space:nowrap}.scorebar{display:flex;justify-content:space-around;border-top:1px solid var(--line);padding:12px 0 10px}.scorebar div{display:flex;flex-direction:column;text-align:center}.scorebar span{font-size:10px;color:var(--muted)}.scorebar strong{font-size:26px;font-variant-numeric:tabular-nums;line-height:1.3}.playfield{position:relative;width:100%;max-width:calc((100dvh - 265px)*480/700);min-width:220px;margin:auto;border:1px solid #c6cfc0;border-radius:8px;overflow:hidden;background:#e8ecdf}canvas{display:block;width:100%;height:auto;touch-action:none}.status{text-align:center;font-size:12px;min-height:18px;margin:10px 0}.controls{display:grid;grid-template-columns:1fr 1fr 1.3fr;gap:8px}.controls button{font-size:13px}.instructions{text-align:center;font-size:11px;line-height:1.8;margin:12px 0 0;color:var(--muted)}.instructions span{font-size:10px}.storage-note{font-size:11px;color:var(--accent)}.loading,.result{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;background:#f4f0e5ed;text-align:center;padding:20px}.result h2{font-family:serif;font-size:32px;margin:8px}.result>strong{font-size:70px;font-variant-numeric:tabular-nums}.result button{width:100%;max-width:250px;margin:14px 0}.result a{font-size:13px;margin-top:8px}@media(max-width:600px){.home{padding:24px 20px}.home-intro{padding:38px 0 24px}.game-card{grid-template-columns:1fr}.card-image{min-height:220px}.card-image img{height:210px}.card-copy{padding:24px}.card-copy h2{font-size:28px}.game-header h1{font-size:21px}}@media(max-height:550px){.playfield{max-width:250px}.game-shell{min-height:100vh}}

/* Results stay below the unobstructed tower. */
.result{position:static;inset:auto;display:grid;grid-template-columns:1fr 1fr;gap:8px 12px;background:transparent;padding:10px 0 0}
.result .eyebrow,.result>strong,.result>p:not(.eyebrow){display:none}
.result h2{grid-column:1/-1;font-size:18px;margin:0}
.result button{width:100%;max-width:none;margin:0}
.result a{margin:0;align-self:center}


/* Yokai measurement-chart presentation. */
.game-page .game-shell{width:min(100%,600px);padding:8px 10px max(12px,env(safe-area-inset-bottom))}
.game-page .game-header{min-height:44px;padding:0 4px}
.game-page .game-header h1{font-size:26px;letter-spacing:.08em;margin:4px 0}
.game-page .game-header a,.game-page .small-label{letter-spacing:.04em}
.game-page .scorebar{border-bottom:1px solid var(--line);padding:8px 0 7px;margin-bottom:8px}
.game-page .scorebar span{font-size:11px;letter-spacing:.05em}
.game-page .scorebar strong{font-family:Georgia,"Yu Mincho",serif;font-size:29px;line-height:1.2}
.game-page .scorebar div:first-child strong{position:relative}
.game-page .scorebar div:first-child strong::after{content:"";display:block;width:34px;height:2px;margin:1px auto 0;background:var(--accent)}
.game-page .playfield{max-width:calc((100dvh - 225px)*480/700);border:3px double #657365;border-radius:5px;background:#ebe9dc;box-shadow:0 5px 14px #17292318,inset 0 0 0 5px #f4f0e580}
.game-page .playfield::after{content:"";position:absolute;inset:6px;border:1px solid #81907d55;pointer-events:none;z-index:2}
.game-page .loading{z-index:3}
.game-page .status{width:fit-content;max-width:100%;min-height:25px;margin:8px auto;padding:3px 13px;border:1px solid #9ba493;border-radius:2px;background:#ece7d7;color:#425248;letter-spacing:.03em}
.game-page .controls{gap:7px}
.game-page .controls button{min-height:56px;border-radius:4px;box-shadow:0 2px 0 #17292322;font-size:14px}
.game-page .controls button:not(.primary){background:#eeeade}
.game-page .controls button:not(.primary):hover:not(:disabled){background:#e3dfd1}
.game-page .instructions{margin-top:9px}
@media(max-width:600px){
 .game-page .game-shell{padding-left:6px;padding-right:6px}
 .game-page .game-header{padding:0 6px}
 .game-page .game-header h1{font-size:24px}
 .game-page .playfield{width:100%;min-width:0}
}


/* Shared night theme: dark surroundings with the playfield kept as illuminated paper. */
body{background:
 radial-gradient(circle at 50% -15%,#2b3b32 0,#17231d 38%,#0d1512 100%);
 color:#eee8d8}
.home{color:#eee8d8}
.masthead{border-color:#65756a;color:#dcd7c8}
.home-intro .eyebrow{color:#cf5a40}
.home-intro p{color:#aeb9b0}
.game-card{background:#19261f;border-color:#3f5247;box-shadow:0 18px 46px #05090766}
.card-image{position:relative;background:
 radial-gradient(circle at 50% 44%,#d8d9c8 0,#8e9b89 42%,#26372e 76%,#17231d 100%)}
.card-image::after{content:"";position:absolute;inset:13px;border:1px solid #d4d8c233;pointer-events:none}
.card-image img{position:relative;z-index:1;filter:drop-shadow(0 14px 8px #05080680)}
.card-copy{color:#eee8d8}
.card-copy p{color:#b9c3bb}
.tag{color:#d6ddd6;border-color:#607568;background:#22342b}
.home footer{color:#8f9f94}
.play-link{box-shadow:0 5px 18px #05090766}

.game-page{background:#0d1512}
.game-page .game-shell{color:#eee8d8;background:
 linear-gradient(180deg,#18261f 0,#121c17 58%,#0e1713 100%);
 box-shadow:0 0 55px #0008}
.game-page .game-header{border-bottom:1px solid #34473d}
.game-page .game-header a,.game-page .small-label{color:#bbc6bd}
.game-page .scorebar{border-color:#34473d}
.game-page .scorebar span{color:#99a99d}
.game-page .scorebar strong{color:#f0eadb}
.game-page .playfield{box-shadow:0 8px 24px #0009,inset 0 0 0 5px #f4f0e580}
.game-page .status{border-color:#53685b;background:#1d2d25;color:#dce4dc;box-shadow:inset 0 0 0 1px #0a100d}
.game-page .controls button:not(.primary){border-color:#738479;background:#1b2922;color:#e8e4d7;box-shadow:0 3px 0 #070c09}
.game-page .controls button:not(.primary):hover:not(:disabled){background:#273a31}
.game-page .controls button:disabled{color:#859188;border-color:#536159;background:#16211c}
.game-page .instructions{color:#93a298}
.game-page .result{color:#eee8d8}
.game-page .result a{color:#d8dfd8}
.game-page .storage-note{color:#df806b}
.loading{color:#172923}

/* Keep the complete title yokai visible at every card width. */
.card-image{aspect-ratio:1/1;min-height:0;padding:clamp(22px,4vw,40px)}
.card-image img{display:block;width:100%;height:100%;max-width:360px;max-height:360px;object-fit:contain}
@media(max-width:600px){
 .card-image{min-height:0;padding:22px}
 .card-image img{width:100%;height:100%;max-width:none;max-height:none}
}
.game-preview{width:min(100%,220px);margin:22px auto 4px;border:1px solid #607568;border-radius:7px;overflow:hidden;background:#0d1512;box-shadow:0 10px 24px #05080680}
.game-preview img{display:block;width:100%;height:auto}




/* Text-only introduction and clearly separated game list. */
.home-intro{padding:38px 0 30px}
.home-intro .eyebrow{margin:0 0 12px}
.home-intro>p:last-child{margin:0}
.game-list{padding-top:25px;border-top:1px solid #526359}
.section-label{margin:0 0 13px;color:#9eaea3;font-size:11px;font-weight:700;letter-spacing:.2em}
.game-card{display:grid;grid-template-columns:minmax(0,1fr) 220px;gap:clamp(28px,6vw,70px);align-items:center;padding:36px clamp(30px,6vw,64px);background:#19261f;border:1px solid #3f5247;border-radius:12px;box-shadow:0 18px 46px #05090766}
.game-summary h2{margin:0 0 15px;color:#eee8d8;font-family:serif;font-size:32px}
.game-summary p{margin:0;color:#b9c3bb;line-height:1.9}
.card-actions{display:grid;gap:12px;width:220px;margin:0;justify-self:end}
.game-preview{position:relative;display:block;width:100%;min-height:0;margin:0;padding:0;overflow:hidden;border:1px solid #607568;border-radius:7px;background:#0d1512;box-shadow:0 10px 24px #05080680;color:#fff}
.game-preview:hover:not(:disabled){background:#0d1512}
.game-preview img{display:block;width:100%;height:auto}
.preview-zoom{position:absolute;z-index:1;right:9px;bottom:9px;padding:6px 8px;border:1px solid #ffffff88;border-radius:3px;background:#0d1512d9;color:#fff;font-size:11px;line-height:1}
.play-link{display:block;width:100%;margin:0;padding:15px 20px;text-align:center;text-decoration:none}
.preview-dialog{width:min(92vw,520px);max-width:none;max-height:92dvh;margin:auto;padding:0;overflow:visible;border:0;background:transparent}
.preview-dialog::backdrop{background:#050907e8;backdrop-filter:blur(3px)}
.preview-dialog img{display:block;width:auto;max-width:100%;height:auto;max-height:88dvh;margin:auto;border:1px solid #607568;border-radius:8px;box-shadow:0 20px 70px #000}
.preview-dialog form{position:absolute;z-index:2;top:-14px;right:-14px}
.dialog-close{display:grid;width:42px;min-height:42px;padding:0;place-items:center;border:1px solid #eee8d8;border-radius:50%;background:#18261f;color:#eee8d8;font-size:25px;line-height:1;box-shadow:0 4px 16px #000}
.dialog-close:hover:not(:disabled){background:#bd4b32}
@media(max-width:760px){
 .game-card{grid-template-columns:1fr;gap:22px;padding:28px 24px 30px}
 .game-summary{text-align:center}
 .game-summary h2{font-size:28px}
 .card-actions{justify-self:center}
}
@media(max-width:600px){
 .home-intro{padding:28px 0 20px}
 .home-intro>p:last-child{font-size:13px;line-height:1.75}
 .game-list{padding-top:20px}
 .card-actions{width:min(100%,220px)}
 .preview-dialog{width:min(88vw,420px)}
.preview-dialog form{top:-12px;right:-12px}
}
.text-only-card .card-actions{align-self:center}
