/* 本番・プレビュー共通。スタイルはすべてゲーム専用ルート内に限定する。 */
#rhythm-forge { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif; color: #eeeee6; color-scheme: dark; line-height: 1.5; text-align: left; }
#rhythm-forge h1, #rhythm-forge h2 { background: none; border: 0; padding: 0; color: inherit; }
#rhythm-forge button { box-shadow: none; background-image: none; }
#rhythm-forge, #rhythm-forge * { box-sizing: border-box; }
#rhythm-forge [hidden] { display: none !important; }
#rhythm-forge button, #rhythm-forge input { font: inherit; }
#rhythm-forge button { border: 1px solid #687577; border-radius: 6px; background: #e5e7dc; color: #172125; min-height: 46px; padding: 12px 20px; cursor: pointer; font-weight: 650; touch-action: manipulation; }
#rhythm-forge button:hover { background: #fff7e6; }
#rhythm-forge button:disabled { cursor: default; opacity: .55; }
#rhythm-forge button:focus-visible, #rhythm-forge summary:focus-visible, #rhythm-forge a:focus-visible { outline: 2px solid #ffab76; outline-offset: 4px; }
#rhythm-forge { max-width: 1120px; margin: auto; padding: 0 24px; }
#rhythm-forge .stage { position: relative; width: 100%; height: min(790px, 88svh); min-height: 620px; overflow: hidden; background: #172226; border: 1px solid #354247; border-radius: 6px; touch-action: none; user-select: none; }
#rhythm-forge canvas { width: 100%; height: 100%; display: block; }
#rhythm-forge .hud { position: absolute; top: 24px; left: 26px; right: 26px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#rhythm-forge .hud small { display: block; color: #a4b2b3; font-size: 10px; letter-spacing: .12em; margin-top: 5px; }
#rhythm-forge .hud button { color: #d7dddc; background: #1d2a2e; padding: 8px 12px; font-size: 12px; }
#rhythm-forge .combo { text-align: center; }
#rhythm-forge .combo strong { font-size: 28px; font-variant-numeric: tabular-nums; }
#rhythm-forge .overlay { position: absolute; inset: 0; text-align: center; padding: 40px 24px 24px; display: flex; flex-direction: column; align-items: center; }
#rhythm-forge .eyebrow { font-size: 12px; letter-spacing: .16em; color: #bdc8c6; margin: 0 0 18px; }
#rhythm-forge h1 { margin: 0; font-size: clamp(36px, 5vw, 58px); font-weight: 650; letter-spacing: .13em; }
#rhythm-forge h1 span { display: block; font-size: 12px; letter-spacing: .38em; margin-top: 10px; color: #acbab9; }
#rhythm-forge h2 { margin: 0 0 10px; font-size: 38px; letter-spacing: .13em; }
#rhythm-forge p { line-height: 1.8; }
#rhythm-forge .lead { font-size: 14px; color: #c6d0cd; }
#rhythm-forge .intro-bottom, #rhythm-forge .result-bottom { margin-top: auto; width: min(100%, 340px); }
#rhythm-forge .intro-bottom button, #rhythm-forge .result-bottom button { width: 100%; }
#rhythm-forge .track { font-size: 10px; letter-spacing: .2em; color: #b0c0be; }
#rhythm-forge .help { font-size: 11px; color: #a3b5b4; margin: 10px 0 0; }
#rhythm-forge .play-instructions { position: absolute; left: 24px; right: 24px; bottom: 22px; text-align: center; }
#rhythm-forge .turn { font-size: 27px; font-weight: 650; letter-spacing: .13em; margin: 0; }
#rhythm-forge .hint { color: #afc0be; font-size: 12px; margin: 4px 0; }
#rhythm-forge .feedback { height: 30px; font-size: 19px; margin: 4px 0 12px; color: #ffbb8d; font-variant-numeric: tabular-nums; }
#rhythm-forge .strike { width: min(100%, 340px); background: #283b41; border-color: #829596; color: #edf1e7; }
#rhythm-forge .strike span { font-size: 10px; margin-left: 14px; letter-spacing: .1em; color: #bac8c3; }
#rhythm-forge .solid { background: #182327; justify-content: center; gap: 18px; }
#rhythm-forge .solid p { color: #b3c3c1; font-size: 13px; }
#rhythm-forge .solid button { min-width: 220px; }
#rhythm-forge .secondary { color: #c1cecb; background: #1b292e; margin-top: 8px; }
#rhythm-forge .secondary:hover { background: #314349; }
#rhythm-forge .result { padding-top: 28px; }
#rhythm-forge .result > p { font-size: 12px; margin: 0; }
#rhythm-forge .result .score { font-size: 28px; margin: 0; font-variant-numeric: tabular-nums; }
#rhythm-forge dl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; border-top: 1px solid #435256; border-bottom: 1px solid #435256; padding: 12px 0; margin: 10px 0 15px; }
#rhythm-forge dt { font-size: 10px; color: #acbfbd; }
#rhythm-forge dd { margin: 6px 0 0; font-size: 21px; }
#rhythm-forge footer { max-width: 600px; margin: 18px auto 30px; font-size: 12px; color: #a6b7b5; }
#rhythm-forge .status { min-height: 22px; }
#rhythm-forge summary { cursor: pointer; padding: 12px 0; border-top: 1px solid #354247; }
#rhythm-forge .settings { display: grid; gap: 15px; padding: 16px 0; }
#rhythm-forge .settings label { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
#rhythm-forge .settings p { margin: 0; font-size: 11px; }
#rhythm-forge input[type="number"] { width: 90px; padding: 6px; background: #1e2b30; color: #fff; border: 1px solid #697b7d; border-radius: 4px; }
#rhythm-forge input { accent-color: #eaa67d; }
#rhythm-forge .privacy { font-size: 10px; }
@media (max-width: 600px) {
#rhythm-forge { padding: 0 10px; }
#rhythm-forge .stage { height: 78svh; min-height: 600px; max-height: 780px; }
#rhythm-forge .overlay { padding: 30px 16px 20px; }
#rhythm-forge .hud { left: 18px; right: 18px; top: 20px; }
#rhythm-forge .play-instructions { left: 16px; right: 16px; } }
#rhythm-forge .stage-shell { --forge-bottom-reserve: var(--popomee-fixed-menu-height, 0px); display: grid; grid-template-rows: auto minmax(0, 1fr); height: min(850px, calc(100svh - 18px - var(--forge-bottom-reserve) - env(safe-area-inset-bottom, 0px))); min-height: 440px; margin-bottom: calc(var(--forge-bottom-reserve) + env(safe-area-inset-bottom, 0px)); }
#rhythm-forge .stage-shell .stage { height: 100%; min-height: 0; max-height: none; }
#rhythm-forge .player-controls { display: flex; align-items: center; justify-content: flex-end; padding: 6px 0 8px; }
#rhythm-forge [data-fullscreen] { display: inline-flex; align-items: center; gap: 9px; background: #203035; color: #dce5df; border-color: #53696e; min-height: 44px; font-size: 12px; padding: 8px 12px; }
#rhythm-forge [data-fullscreen]:hover { background: #2c4147; }
#rhythm-forge [data-fullscreen] svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
#rhythm-forge .collapse-icon { display: none; }
#rhythm-forge [data-fullscreen][aria-pressed="true"] .expand-icon { display: none; }
#rhythm-forge [data-fullscreen][aria-pressed="true"] .collapse-icon { display: inline; }
#rhythm-forge .stage-shell:fullscreen, #rhythm-forge .stage-shell[data-expanded="true"] { width: 100%; height: 100dvh; min-height: 0; max-height: none; margin: 0; background: #111719; padding: env(safe-area-inset-top, 0px) max(8px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + var(--forge-bottom-reserve)) max(8px, env(safe-area-inset-left, 0px)); }
#rhythm-forge .stage-shell[data-expanded="true"] { position: fixed; inset: 0; z-index: 2147483646; }
#rhythm-forge .stage-shell:fullscreen .player-controls, #rhythm-forge .stage-shell[data-expanded="true"] .player-controls { padding: 6px 4px; }
#rhythm-forge .pause-volume { display: flex; align-items: center; gap: 16px; font-size: 12px; }
@media (max-width: 600px) {
#rhythm-forge .stage-shell { height: calc(100svh - 14px - var(--forge-bottom-reserve) - env(safe-area-inset-bottom, 0px)); min-height: 400px; } }
@media (max-height: 700px) {
#rhythm-forge .overlay { padding-top: 16px; padding-bottom: 12px; }
#rhythm-forge .eyebrow { margin-bottom: 8px; font-size: 10px; }
#rhythm-forge h1 { font-size: 30px; }
#rhythm-forge h1 span { font-size: 9px; margin-top: 6px; }
#rhythm-forge .lead { margin: 10px 0; font-size: 11px; }
#rhythm-forge .track { margin: 6px 0; }
#rhythm-forge .help { margin-top: 6px; font-size: 10px; }
#rhythm-forge .hud { top: 12px; }
#rhythm-forge .play-instructions { bottom: 12px; }
#rhythm-forge .turn { font-size: 23px; }
#rhythm-forge .feedback { margin-bottom: 4px; }
#rhythm-forge .solid { gap: 8px; }
#rhythm-forge .solid p { margin: 6px 0; }
#rhythm-forge .result { padding-top: 14px; }
#rhythm-forge .result h2 { font-size: 30px; margin-bottom: 2px; }
#rhythm-forge .result .score { font-size: 22px; }
#rhythm-forge .result dl { padding: 7px 0; margin: 5px 0 10px; }
#rhythm-forge .result dd { font-size: 17px; } }
/* 難易度は色・均一な境界・文字の太さで選択状態を明確にする。 */
#rhythm-forge .levels { display: flex; gap: 6px; flex-wrap: wrap; }
#rhythm-forge .levels button { flex: 1 1 76px; width: auto; padding: 10px 6px; min-height: 44px; font-size: 12px; font-weight: 400; color: #c6d3d1; background: #1c2b30; border-color: #62777c; }
#rhythm-forge .levels button[aria-pressed="true"] { background: #e3e9dc; color: #152329; border-color: #fff6d8; font-weight: 750; }
#rhythm-forge .level-help { font-size: 11px; color: #c3d0c9; margin: 5px 0; }
#rhythm-forge [data-result-level] { color: #c6d5d0; }
@media (max-height: 700px) {
#rhythm-forge .intro .lead { margin: 7px 0; }
#rhythm-forge .intro .eyebrow { margin-bottom: 5px; }
#rhythm-forge .intro .track { font-size: 9px; margin: 4px 0; }
#rhythm-forge .intro .help { font-size: 9px; }
#rhythm-forge .level-help { margin: 3px 0; font-size: 10px; }
}

#rhythm-forge .policy-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 12px 0; font-size: 12px; }
#rhythm-forge .policy-links a { color: #adc5ca; }
#rhythm-forge[lang="en"] h1 { font-size: clamp(27px, 4vw, 48px); letter-spacing: .02em; }
#rhythm-forge[lang="en"] .hint { font-size: 11px; }
#rhythm-forge[lang="en"] .hud > div:first-child { max-width: 42%; font-size: 12px; }
#rhythm-forge .stage-shell:fullscreen { --forge-bottom-reserve: 0px; }
