:root{color-scheme:dark;font-family:"Hiragino Kaku Gothic ProN","Yu Gothic",system-ui,sans-serif;background:#101419;color:#f4ead8}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:radial-gradient(circle at 50% 8%,#34404b 0,#192027 42%,#0e1216 100%)}
body{min-height:100dvh;overscroll-behavior:none}
[hidden]{display:none!important}
.game-page{display:flex;flex-direction:column}
.game-page .game-header,.game-page .game-scoreboard{flex:0 0 auto}
.game-page .game-field{margin:4px auto 0}
.game-field{position:relative;width:100%;overflow:hidden;border:1px solid #73808a;border-radius:10px;box-shadow:0 18px 50px #0009;touch-action:none;user-select:none;-webkit-user-select:none}
.game-field canvas{display:block;width:100%;height:auto;outline:none;touch-action:none}
button:disabled{opacity:.48;cursor:not-allowed}
html:has(.game-page),body:has(.game-page){width:100%;height:100%;overflow:hidden;overscroll-behavior:none}body:has(.game-page){position:fixed;inset:0;touch-action:none}.game-page{--game-fit-height:320px;--game-fit-width:252px;width:min(100%,620px);height:100dvh;min-height:0;margin:0 auto;padding:calc(env(safe-area-inset-top) + 6px) max(12px,env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 6px) max(12px,env(safe-area-inset-left));overflow:hidden;touch-action:none}.game-page [data-game-fit]{width:min(100%,var(--game-fit-width));max-height:var(--game-fit-height);flex:0 1 auto}.game-page [data-game-fit] canvas{display:block;width:100%;height:auto;max-height:var(--game-fit-height)}.game-page button,.game-page a{touch-action:manipulation}.game-page button{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.game-button{display:inline-grid;min-height:48px;padding:10px 18px;place-items:center;border:1px solid;border-radius:7px;font:700 14px/1.35 "Hiragino Kaku Gothic ProN","Yu Gothic",system-ui,sans-serif;text-decoration:none;cursor:pointer}.game-button--primary{border-color:#d49b79;background:#a94735;color:#fff6e7}.game-button--secondary{border-color:#607783;background:#29414d;color:#f5ead6}.game-button--close{border-color:#83929a;background:#26343b;color:#f5ead6}.game-button--retry{border-color:#d49b79;background:#a94735;color:#fff6e7}.game-button--link{border-color:transparent;background:transparent;color:#d8dfd8;font-size:12px;text-decoration:underline;text-underline-offset:4px}.game-start-actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}.game-start-actions .game-button{min-width:114px;min-height:44px;padding:7px 14px;font-size:13px}.game-scoreboard,[data-game-scoreboard]{display:grid;grid-template-columns:repeat(var(--game-scoreboard-columns,3),minmax(0,1fr));align-items:end;border-top:1px solid #54606a;padding:7px 2px;color:#bdc5c9;text-align:center}.game-scoreboard>[data-scoreboard-item]:first-child{text-align:left}.game-scoreboard>[data-scoreboard-item]:last-child{text-align:right}.game-scoreboard [data-scoreboard-label]{display:block;font-size:10px}.game-scoreboard [data-scoreboard-value]{display:block;color:#fff0d1;font:600 clamp(17px,4.8vw,24px)/1.2 Georgia,serif;font-variant-numeric:tabular-nums;white-space:nowrap}.game-shell-loading,.game-shell-modal{position:fixed;z-index:1000;inset:0;display:grid;place-items:center;padding:calc(env(safe-area-inset-top) + 18px) calc(env(safe-area-inset-right) + 18px) calc(env(safe-area-inset-bottom) + 18px) calc(env(safe-area-inset-left) + 18px);background:#10161be8;color:#f4ead8}.game-shell-loading__card,.game-shell-modal__dialog{width:min(100%,380px);padding:28px 22px;border:1px solid #73808a;border-radius:12px;background:#182128;box-shadow:0 16px 45px #0009;text-align:center}.game-shell-loading p{margin:0;font-weight:700}.game-shell-spinner{width:34px;height:34px;margin:18px auto 0;border:3px solid #60727e;border-top-color:#f0bc55;border-radius:50%;animation:game-shell-spin .8s linear infinite}.game-shell-loading button{margin-top:18px}.game-shell-modal{z-index:1050}.game-shell-modal__dialog{display:flex;max-height:100%;flex-direction:column;text-align:left}.game-shell-modal h2{margin:0 0 14px;text-align:center}.game-shell-modal__body{overflow:auto;overscroll-behavior:contain;touch-action:pan-y;font-size:12px;line-height:1.8;padding-right:4px}.game-shell-modal__body p{margin:0 0 1em}.game-shell-modal__close{align-self:center;margin-top:18px}@keyframes game-shell-spin{to{transform:rotate(360deg)}}.game-header{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;min-height:36px;gap:6px;color:#b8c0c5}.game-header__back{justify-self:start;display:flex;align-items:center;min-height:32px;padding:0 4px;color:#e5e8e7;font-size:12px;text-decoration:none;white-space:nowrap}.game-header__title{justify-self:center;min-width:0;max-width:56vw;margin:0;overflow:hidden;color:#f4ead8;font:600 clamp(16px,4.6vw,20px)/1.1 Georgia,"Yu Mincho",serif;letter-spacing:.04em;white-space:nowrap;text-overflow:ellipsis}.game-header__title ruby{ruby-position:over}.game-header__title rt{font-size:.42em;letter-spacing:.08em}.game-header__spacer{min-width:0;min-height:1px}.game-page>.game-scoreboard{margin-top:2px}.game-header__menu{justify-self:end;display:grid;min-width:32px;min-height:32px;padding:0 4px;place-items:center;border:0;background:transparent;color:#f4ead8;font:700 19px/1 system-ui;cursor:pointer;touch-action:manipulation}.game-shell-drawer-backdrop{position:fixed;z-index:1100;inset:0;background:#06101599}.game-shell-drawer{position:fixed;z-index:1101;top:0;right:0;bottom:0;width:min(84vw,320px);padding:calc(env(safe-area-inset-top) + 12px) max(14px,env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 14px) 14px;background:#182128;color:#f4ead8;box-shadow:-12px 0 34px #0008;display:flex;flex-direction:column;gap:12px}.game-shell-drawer__header{display:flex;align-items:center;justify-content:space-between;gap:10px}.game-shell-drawer__header h2{margin:0;font:600 18px/1.2 Georgia,"Yu Mincho",serif}.game-shell-drawer__close{min-width:36px;min-height:36px;padding:0;border:1px solid #607783;border-radius:7px;background:#26343b;color:#f5ead6;font:700 18px/1 system-ui;cursor:pointer}.game-shell-settings{display:grid;gap:12px}.game-shell-setting{display:grid;gap:5px;color:#e9e2d4;font-size:12px}.game-shell-setting--toggle{grid-template-columns:1fr auto;align-items:center}.game-shell-setting input[type="checkbox"]{inline-size:20px;block-size:20px;accent-color:#a94735}.game-shell-setting input[type="range"]{width:100%;accent-color:#a94735}.game-shell-setting input:disabled{cursor:not-allowed;opacity:.38}.game-shell-settings.is-sound-off .game-shell-setting:not(.game-shell-setting--toggle){color:#8c9294}.game-shell-share{margin-top:2px;padding-top:12px;border-top:1px solid #46535b}.game-shell-reload__button,.game-shell-share__button{display:flex;width:100%;min-height:44px;align-items:center;justify-content:center;gap:9px;padding:9px 12px;border:1px solid #607783;border-radius:7px;background:#26343b;color:#f5ead6;font:700 13px/1.3 system-ui;cursor:pointer;touch-action:manipulation}.game-shell-reload__button{margin-bottom:10px}.game-shell-reload__button:active,.game-shell-share__button:active{filter:brightness(1.1);translate:0 1px}.game-shell-reload__button:focus-visible,.game-shell-share__button:focus-visible{outline:3px solid #ffe08a;outline-offset:2px}.game-shell-share__button svg{width:20px;height:20px;fill:currentColor}.game-shell-share__status{min-height:1.3em;margin:5px 0 0;color:#d9cfbb;font-size:11px;text-align:center}
/* テスト／新ゲーム画面の戻り導線。既存寸法の内側に枠を描く。 */
.game-header__back{
  box-sizing:border-box;
  height:32px;
  min-height:32px;
  border-radius:7px;
  box-shadow:inset 0 0 0 1px #647080;
}

#storage-note{margin:6px 0 0;text-align:center;color:#efb58e;font-size:11px}


/* 新共通シェルのキーボードフォーカスと共通ボタン押下表示 */
.game-page button:focus-visible,.game-page a:focus-visible{outline:3px solid #ffe08a;outline-offset:2px}
.game-page .game-button:active:not(:disabled){filter:brightness(1.1);translate:0 1px}

/* Compact shared help layout and reward conditions. */
.game-shell-modal__dialog{width:min(100%,400px);padding:20px 18px}
.game-shell-modal h2{margin:0 0 10px;font-size:20px;line-height:1.25}
.game-shell-modal__body{font-size:clamp(11px,3vw,13px);line-height:1.65;padding-right:2px}
.game-shell-modal__body p{margin:0 0:.6em}
.game-shell-modal__close{margin-top:10px}
.game-help-reward{margin:10px 0 8px;padding-top:8px;border-top:1px solid #52616b;text-align:left}
.game-help-reward h3{margin:0 0 5px;font-size:1.05em;color:#f0d58b}
.game-help-reward dl{margin:0}
.game-help-reward dl>div{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;padding:4px 2px;border-top:1px solid #34424b}
.game-help-reward dl>div:first-child{border-top:0}
.game-help-reward dt,.game-help-reward dd{margin:0}
.game-help-reward dd{font-weight:700;color:#f4ead8}
