/* 052 水切り：夕方の湖。題名は月色の紙の札、結果は夕暮れ（夜は月夜）の湖面、ランキングは深い水。ボタンは平たい石（押すと水に沈んで波紋が広がる）。色はここだけに書く。 */
@font-face { font-family: "MZBrush"; src: url("yuji.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "MZBody"; src: url("zenmaru.woff2") format("woff2"); font-display: swap; }
:root { --ink: #1E2440; --paper: #FFF4E2; --paper2: #F1E3C8; --sky: #33406E; --sky2: #24305C; --dusk: #C9708A; --sun: #F7B27A; --gold: #FFD36E; --water: #2B5F73; --deep: #1C3F55; --deep2: #132C3E; --foam: #E8F4F2; --coral: #E8574A; --coral2: #B83F36; --stone: #8FA3AE; --stone2: #5F7480; --pebble: #E6DED0; --pebble2: #B9AE9C; --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px); --spring: cubic-bezier(.3, 1.5, .55, 1); --pebble-r: 46% 54% 50% 50% / 58% 52% 48% 42%; }
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; background: var(--sky); overflow: hidden; overscroll-behavior: none; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; font-family: "MZBody", "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif; font-weight: 700; color: var(--ink); }
#lg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
[hidden] { display: none !important; }
button, a, input { font: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* 題名：月色の紙の札（角が少しいびつな、手で切った紙） */
.panel { position: fixed; left: 50%; top: calc(var(--safe-t) + 14px); transform: translateX(-50%); width: min(88vw, 400px); max-height: calc(100dvh - var(--safe-t) - var(--safe-b) - 24px); padding: 14px 20px 10px; display: flex; flex-direction: column; align-items: stretch; gap: 9px; color: var(--ink); background: radial-gradient(120% 70% at 50% 0%, var(--paper) 55%, var(--paper2) 100%); border: 3px solid var(--ink); border-radius: 26px 30px 24px 34px / 28px 24px 32px 26px; box-shadow: 0 6px 0 var(--ink), 0 18px 30px rgba(19, 44, 62, .35); }
/* ロゴ：筆の「水切り」。上を石が跳ねていく弧と、だんだん小さくなる波紋 */
h1 { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 2px; font-weight: 400; line-height: 1; }
h1 .arc { width: min(70vw, 270px); height: auto; margin-bottom: -16px; overflow: visible; }
h1 .arc path { fill: none; stroke: var(--stone2); stroke-width: 2.4; stroke-dasharray: 2 7; stroke-linecap: round; }
h1 .arc ellipse { fill: none; stroke: var(--water); stroke-width: 2.6; }
h1 .logo { display: flex; align-items: flex-end; gap: .02em; font: 400 clamp(60px, 18vw, 82px)/1 "MZBrush", serif; color: var(--ink); }
h1 .logo i { font-style: normal; display: inline-block; }
h1 .logo i:nth-child(2) { font-size: .86em; transform: translateY(-.04em) rotate(4deg); }
h1 .logo i:nth-child(3) { font-size: .66em; color: var(--coral); transform: translateY(-.12em) rotate(8deg); animation: hop 2.6s ease-in-out infinite; }
@keyframes hop { 0%, 60%, 100% { translate: 0 0; } 72% { translate: 0 -.18em; } 84% { translate: 0 0; } 90% { translate: 0 -.06em; } }
.how { font-size: 16px; line-height: 27px; text-align: center; color: var(--ink); }

/* ボタン：平たい石。主ボタンは夕日の赤い石、押すと水に沈む（縦につぶれて、下の影＝石の厚みが消える）→ 離すと浮いて少しゆれる */
.big, .sub, .ghost, .tab, .link, .tog, #pause-btn { position: relative; cursor: pointer; transition: transform 90ms ease-out, box-shadow 90ms ease-out, background-color 120ms ease-out; -webkit-tap-highlight-color: transparent; }
.big { min-height: 70px; padding: 8px 16px; background: radial-gradient(90% 120% at 35% 20%, #F2766A 0%, var(--coral) 55%, #D24A3E 100%); color: var(--paper); border: 3px solid var(--ink); border-radius: var(--pebble-r); font: 400 clamp(32px, 9.4vw, 40px)/1.1 "MZBrush", serif; box-shadow: inset 0 -6px 0 rgba(30, 36, 64, .18), 0 8px 0 var(--coral2), 0 8px 0 3px var(--ink); text-shadow: 0 2px 0 var(--coral2), 0 0 1px var(--ink); letter-spacing: .12em; }
.big::after { content: ""; position: absolute; left: 22%; right: 46%; top: 12px; height: 6px; border-radius: 3px; background: rgba(255, 244, 226, .45); }
.big.press { transform: translateY(7px) scale(1.03, .9); box-shadow: inset 0 -3px 0 rgba(30, 36, 64, .18), 0 1px 0 var(--coral2), 0 1px 0 3px var(--ink); }
.sub { display: flex; align-items: center; justify-content: center; flex: 1 1 0; min-height: 54px; padding: 8px 10px; background: radial-gradient(100% 120% at 30% 20%, #F4EEE4 0%, var(--pebble) 60%, #D8CEBE 100%); color: var(--ink); border: 3px solid var(--ink); border-radius: var(--pebble-r); font-size: 17px; text-decoration: none; box-shadow: 0 6px 0 var(--pebble2), 0 6px 0 3px var(--ink); }
.sub.press { transform: translateY(5px) scale(1.04, .9); box-shadow: 0 1px 0 var(--pebble2), 0 1px 0 3px var(--ink); }
.ghost { min-height: 44px; padding: 8px 18px; background: transparent; color: var(--paper); border: 3px solid var(--paper); border-radius: var(--pebble-r); font-size: 15px; }
.ghost.press { transform: scale(.94); }
.link { align-self: center; min-height: 44px; padding: 8px 16px; background: none; border: 0; color: var(--ink); font-size: 16px; text-decoration: underline; text-decoration-style: wavy; text-decoration-color: var(--water); text-decoration-thickness: 1.5px; text-underline-offset: 6px; }
.link.press { transform: scale(.93); }
.rel { animation: bob 520ms var(--spring); }
@keyframes bob { 0% { transform: translateY(6px) scale(1.03, .9); } 35% { transform: translateY(-4px) scale(.98, 1.04); } 60% { transform: translateY(1px) rotate(-1deg); } 80% { transform: rotate(.6deg); } 100% { transform: none; } }
/* 押した所から広がる波紋（楕円＝水面を斜めから見た形） */
.wave { position: fixed; z-index: 40; width: var(--w); height: calc(var(--w) * .34); margin: calc(var(--w) * -.17) 0 0 calc(var(--w) * -.5); border-radius: 50%; border: 2px solid var(--foam); box-shadow: 0 0 0 1px rgba(30, 36, 64, .25); pointer-events: none; transform: scale(.08); opacity: 0; animation: wave 780ms cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes wave { 0% { transform: scale(.08); opacity: .95; } 100% { transform: scale(1); opacity: 0; } }
.row { display: flex; gap: 12px; }

/* 音の設定：ON/OFF の札と、水面の線の上を石がすべる音量 */
.snd { display: flex; align-items: center; gap: 12px; }
.tog { flex: 0 0 auto; display: inline-flex; align-items: baseline; gap: 6px; min-height: 44px; padding: 6px 14px; background: var(--ink); color: var(--paper); border: 3px solid var(--ink); border-radius: 14px 18px 14px 18px; font-size: 15px; }
.tog b { color: var(--gold); min-width: 2.4em; text-align: left; }
.tog.press { transform: scale(.93); }
.snd.off .tog { background: var(--paper); color: var(--ink); } .snd.off .tog b { color: var(--coral2); }
.vol { flex: 1 1 auto; display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 14px; color: var(--ink); }
.vol span { flex: 0 0 auto; }
.vol input { -webkit-appearance: none; appearance: none; flex: 1 1 auto; min-width: 0; height: 44px; margin: 0; background: transparent; cursor: pointer; touch-action: none; }
.vol input::-webkit-slider-runnable-track { height: 10px; border-radius: 5px; border: 2px solid var(--ink); background: linear-gradient(90deg, var(--water) var(--v, 80%), var(--paper) var(--v, 80%)); }
.vol input::-moz-range-track { height: 6px; border-radius: 5px; border: 2px solid var(--ink); background: linear-gradient(90deg, var(--water) var(--v, 80%), var(--paper) var(--v, 80%)); }
.vol input::-webkit-slider-thumb { -webkit-appearance: none; width: 34px; height: 20px; margin-top: -7px; border-radius: 50% / 46%; background: radial-gradient(80% 90% at 35% 25%, #B9C8D0, var(--stone) 60%, var(--stone2)); border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink); transition: transform 140ms var(--spring); }
.vol input:active::-webkit-slider-thumb { transform: scale(1.12, .86) translateY(1px); box-shadow: 0 1px 0 var(--ink); }
.vol input::-moz-range-thumb { width: 30px; height: 16px; border-radius: 50% / 46%; background: var(--stone); border: 2px solid var(--ink); }
.snd.off .vol input { opacity: .45; }
.links { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 4px; margin-top: -4px; }
.links .link { padding: 8px 10px; font-size: 15px; }

/* 遊ぶ：岸から何 m（大きく）・跳ねた回数・ひとやすみだけ */
#hud { position: fixed; left: calc(var(--safe-l) + 14px); right: calc(var(--safe-r) + 14px); top: calc(var(--safe-t) + 14px); display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; pointer-events: none; }
#score { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
#score .m { display: flex; align-items: baseline; gap: 4px; padding: 0 14px 2px; white-space: nowrap; background: rgba(255, 244, 226, .94); border: 3px solid var(--ink); border-radius: 18px 22px 18px 24px; box-shadow: 0 4px 0 var(--ink); line-height: 1; }
#score .m b { font-size: clamp(36px, min(11vw, 7vh), 52px); line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
#score .m small { font-size: 18px; }
#skips { display: flex; align-items: baseline; gap: 5px; padding: 3px 12px 4px; background: var(--ink); color: var(--paper); border-radius: 12px; font-size: 14px; line-height: 1.2; white-space: nowrap; }
#skips b { font-size: 22px; color: var(--gold); display: inline-block; min-width: 1ch; text-align: center; font-variant-numeric: tabular-nums; }
#skips b.bump { animation: bump 380ms var(--spring); }
#jumps { display: flex; align-items: center; gap: 5px; padding: 3px 12px 4px; background: var(--ink); color: var(--paper); border-radius: 12px; font-size: 13px; line-height: 1.2; white-space: nowrap; }
#jumps i { display: inline-block; width: 15px; height: 10px; margin-left: 1px; background: var(--gold); border: 2px solid var(--gold); border-radius: var(--pebble-r); box-shadow: inset 0 -2px 0 rgba(30, 36, 64, .35); transition: background 240ms, transform 240ms var(--spring); }
#jumps i.used { background: transparent; border-color: var(--pebble2); box-shadow: none; transform: translateY(2px) scale(.9); }
#jumps i.pop { animation: jumppop 420ms var(--spring); }
@keyframes jumppop { 0% { transform: translateY(0) scale(1); } 40% { transform: translateY(-7px) scale(1.25); } 100% { transform: translateY(2px) scale(.9); } }
@keyframes bump { 0% { transform: none; } 30% { transform: translateY(-7px) scale(1.25); } 100% { transform: none; } }
#pause-btn { pointer-events: auto; flex: 0 0 auto; white-space: nowrap; min-height: 44px; padding: 8px 14px; background: rgba(255, 244, 226, .94); color: var(--ink); border: 3px solid var(--ink); border-radius: var(--pebble-r); font-size: 14px; box-shadow: 0 4px 0 var(--ink); }
#pause-btn.press { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }

#word { position: fixed; left: 0; right: 0; top: 30%; text-align: center; font: 400 clamp(40px, 12vw, 76px)/1 "MZBrush", serif; color: var(--paper); text-shadow: 0 3px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink), 0 6px 18px rgba(19, 44, 62, .5); pointer-events: none; opacity: 0; white-space: nowrap; }
#word.on { animation: pop 1.2s ease-out; }
#word.funny { color: var(--sun); }
#word.near { color: var(--foam); }
#word.big, #word.gold { color: var(--gold); }
#word.count { color: var(--gold); font-size: clamp(56px, 16vw, 96px); }
@keyframes pop { 0% { opacity: 0; transform: translateY(14px) scale(.7); } 12% { opacity: 1; transform: translateY(-4px) scale(1.08); } 22% { transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-16px); } }

/* 全画面 */
.screen { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 28px) calc(var(--safe-r) + 26px) calc(var(--safe-b) + 30px) calc(var(--safe-l) + 26px); overflow: hidden; }
.screen > * { position: relative; }
.screen.scrim { background: rgba(19, 44, 62, .62); align-items: center; justify-content: center; }
.scrim .stack { display: flex; flex-direction: column; align-items: stretch; gap: 16px; width: min(84vw, 400px); padding: 22px; color: var(--ink); background: radial-gradient(120% 70% at 50% 0%, var(--paper) 55%, var(--paper2) 100%); border: 3px solid var(--ink); border-radius: 26px 30px 24px 34px / 28px 24px 32px 26px; box-shadow: 0 6px 0 var(--ink); animation: dlg 300ms var(--spring) both; }
@keyframes dlg { from { opacity: 0; transform: translateY(18px) scale(.94); } to { opacity: 1; transform: none; } }
.scrim h2 { font: 400 clamp(30px, 8.6vw, 36px)/1.2 "MZBrush", serif; text-align: center; }
.scrim .line { color: var(--ink); text-align: center; margin-top: -6px; font-size: 16px; }
#confirm .big { background: var(--ink); color: var(--paper); text-shadow: none; box-shadow: 0 8px 0 #0E1430, 0 8px 0 3px var(--ink); }
#confirm .big.press { box-shadow: 0 1px 0 #0E1430, 0 1px 0 3px var(--ink); }

/* 結果：夕暮れの湖面（空の帯・夕日・水の線）。夜は月夜 */
.lake { color: var(--paper); background: radial-gradient(38vmax 16vmax at 72% 34%, rgba(255, 227, 163, .55), transparent 70%), linear-gradient(180deg, var(--sky) 0%, #6E4F80 26%, var(--dusk) 40%, var(--sun) 47%, #B96A6A 48.5%, var(--water) 49%, var(--deep) 75%, var(--deep2) 100%); }
.lake::before { content: ""; position: absolute; left: 0; right: 0; top: 49%; bottom: 0; background: repeating-linear-gradient(180deg, transparent 0 14px, rgba(232, 244, 242, .07) 14px 16px); pointer-events: none; }
.lake::after { content: ""; position: absolute; left: 64%; width: 16%; top: 49%; height: 22%; background: repeating-linear-gradient(180deg, rgba(255, 226, 168, .38) 0 2px, transparent 2px 10px); -webkit-mask: radial-gradient(50% 100% at 50% 0%, #000 30%, transparent 100%); mask: radial-gradient(50% 100% at 50% 0%, #000 30%, transparent 100%); pointer-events: none; }
body.night .lake { background: radial-gradient(10vmax 10vmax at 70% 22%, rgba(255, 241, 201, .9) 0 40%, rgba(255, 241, 201, .15) 42%, transparent 70%), linear-gradient(180deg, #0E1430 0%, var(--sky2) 30%, #47557E 47%, var(--deep) 49%, var(--deep2) 100%); }
body.night .lake::after { background: repeating-linear-gradient(180deg, rgba(255, 211, 110, .7) 0 3px, transparent 3px 11px); }
#result { justify-content: space-between; align-items: center; }
#result .hero { display: flex; flex-direction: column; align-items: center; text-align: center; width: 100%; max-width: 560px; flex: 1 1 auto; justify-content: center; min-height: 0; }
.best { padding: 4px 14px; border: 2px solid var(--gold); border-radius: 12px; color: var(--gold); font-size: 15px; margin-bottom: 6px; animation: dlg 400ms var(--spring) both; }
.num { position: relative; display: flex; align-items: baseline; line-height: 1; white-space: nowrap; color: var(--paper); text-shadow: 0 4px 0 var(--ink), 0 10px 30px rgba(19, 44, 62, .45); animation: rise 520ms var(--spring) both; }
.num b { font-size: min(30vw, 19vh, 160px); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.num small { font-size: min(10vw, 6vh, 48px); margin-left: 8px; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.hops { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; font-size: clamp(16px, 4.4vw, 20px); color: var(--foam); }
.hops b { font-size: clamp(26px, 7vw, 34px); color: var(--gold); }
#trail { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 6px; max-width: min(86vw, 460px); min-height: 18px; margin-top: 8px; }
#trail.none { display: none; }
#trail i { width: calc(22px * var(--s)); height: calc(8px * var(--s)); border-radius: 50%; border: 2px solid var(--foam); opacity: 0; animation: ring 420ms ease-out forwards; }
body.night #trail i { border-color: var(--gold); }
@keyframes ring { from { opacity: 0; transform: scale(.3); } to { opacity: .95; transform: none; } }
#result h2 { font: 400 clamp(36px, 10.6vw, 52px)/1.15 "MZBrush", serif; margin-top: min(2.2vh, 16px); color: var(--paper); text-shadow: 0 3px 0 var(--ink); }
#result .line { font-size: clamp(16px, 4.4vw, 19px); line-height: 1.5; margin-top: 8px; color: var(--paper); text-shadow: 0 2px 0 rgba(19, 44, 62, .6); }
#result h2, #result .line, #result .small, .how, .scrim .line { word-break: keep-all; overflow-wrap: anywhere; text-wrap: balance; }
.small { font-size: clamp(13px, 3.6vw, 15px); line-height: 1.5; margin-top: 6px; color: var(--foam); opacity: .9; }
.actions { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 480px; flex: 0 0 auto; }
.lake .link { color: var(--paper); text-decoration-color: var(--foam); margin-top: -4px; min-height: 40px; padding: 6px 16px; }

/* ランキング：深い水（石を岸に並べた列） */
.deep { align-items: center; color: var(--paper); background: linear-gradient(180deg, var(--water) 0%, var(--deep) 40%, var(--deep2) 100%); }
.deep::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(180deg, transparent 0 22px, rgba(232, 244, 242, .05) 22px 24px); pointer-events: none; }
#rank > * { width: 100%; max-width: 560px; }
.rhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.rhead h2 { font: 400 clamp(32px, 9vw, 42px)/1.1 "MZBrush", serif; color: var(--paper); }
.tabs { display: flex; gap: 0; border: 3px solid var(--paper); border-radius: 16px; overflow: hidden; flex: 0 0 auto; }
.tab { flex: 1 1 0; min-height: 46px; background: transparent; color: var(--paper); border: 0; border-radius: 0; font-size: 17px; }
.tab[aria-selected="true"] { background: var(--paper); color: var(--ink); }
.tab.press { transform: scale(.97); }
#rows { list-style: none; padding: 0; margin-top: 10px; overflow-y: auto; flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; touch-action: pan-y; }
#rows li { display: grid; grid-template-columns: 2.6em minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 50px; padding: 0 12px; border-bottom: 2px dashed rgba(232, 244, 242, .18); font-size: 18px; }
#rows li.me { background: linear-gradient(180deg, transparent 14%, rgba(255, 211, 110, .22) 14% 88%, transparent 88%); border-radius: 12px; }
#rows .r { display: inline-flex; align-items: center; justify-content: center; width: 2.2em; height: 1.5em; border-radius: 50% / 46%; background: radial-gradient(80% 90% at 35% 25%, #B9C8D0, var(--stone) 60%, var(--stone2)); border: 2px solid var(--ink); color: var(--ink); font-size: 16px; }
#rows li:nth-child(1) .r { background: radial-gradient(80% 90% at 35% 25%, #FFE9A8, var(--gold) 60%, #C99A2E); }
#rows .n { overflow-wrap: anywhere; line-height: 1.2; }
#rows .s { font-variant-numeric: tabular-nums; color: var(--gold); }
#rows-msg { text-align: center; padding: 20px 0; flex: 1 1 auto; }
#name-form { display: flex; gap: 10px; margin-top: 12px; flex: 0 0 auto; }
#name { flex: 1 1 auto; min-width: 0; height: 56px; padding: 0 16px; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); border-radius: 16px; font-size: 17px; font-weight: 700; user-select: text; -webkit-user-select: text; }
#name-form .sub { flex: 0 0 auto; padding: 8px 18px; }

#load { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: linear-gradient(180deg, var(--sky) 0%, var(--dusk) 48%, var(--sun) 50%, var(--water) 51%, var(--deep) 100%); transition: opacity .25s ease; }
#load.done { opacity: 0; pointer-events: none; }
#load p { font: 400 clamp(52px, 15vw, 76px)/1.1 "MZBrush", serif; color: var(--paper); text-shadow: 0 3px 0 var(--ink); }
#bar { width: min(60vw, 260px); height: 12px; border: 2px solid var(--paper); border-radius: 6px; }
#fill { width: 4%; height: 100%; background: var(--gold); border-radius: 4px; transition: width .12s linear; }
#err { font: 700 14px/1.5 sans-serif; color: var(--paper); padding: 0 24px; text-align: center; }

@media (min-width: 900px) { .panel { left: 6vw; transform: none; width: 400px; top: calc(var(--safe-t) + 7vh); } }
@media (max-height: 640px) and (orientation: portrait) {
  .panel { top: calc(var(--safe-t) + 8px); padding: 8px 14px 6px; gap: 5px; }
  h1 .arc { width: 200px; margin-bottom: -12px; } h1 .logo { font-size: 54px; } .links .link { min-height: 36px; padding: 4px 8px; font-size: 14px; } .snd .tog { min-height: 40px; }
  .how { font-size: 14px; line-height: 22px; }
  .big { min-height: 56px; font-size: 28px; }
  .screen { padding-top: calc(var(--safe-t) + 18px); padding-bottom: calc(var(--safe-b) + 22px); }
  .num b { font-size: min(26vw, 15vh); } #trail { margin-top: 4px; }
  #result h2 { font-size: 30px; margin-top: 6px; } #result .line { font-size: 14px; margin-top: 4px; } .small { font-size: 12px; margin-top: 4px; }
  .actions { gap: 10px; } .sub { min-height: 46px; font-size: 15px; } .lake .link { min-height: 34px; padding: 3px 16px; font-size: 14px; margin-top: -2px; }
  #rows li { min-height: 42px; font-size: 16px; } #name { height: 48px; }
}
/* スマホ横持ち：左に数字、右に言葉とボタン */
@media (max-height: 500px) and (orientation: landscape) {
  .panel { left: calc(var(--safe-l) + 12px); transform: none; top: calc(var(--safe-t) + 8px); width: 380px; padding: 6px 14px 6px; gap: 4px; max-height: calc(100dvh - var(--safe-t) - var(--safe-b) - 12px); }
  h1 { flex-direction: row; justify-content: flex-start; padding: 0; } h1 .arc { display: none; } h1 .logo { font-size: 44px; }
  .links { justify-content: flex-start; margin-top: -6px; } .links .link { min-height: 32px; padding: 2px 8px; font-size: 13px; } .tog { min-height: 36px; padding: 3px 10px; font-size: 13px; } .vol input { height: 36px; }
  .scrim .stack { gap: 8px; padding: 12px 18px; width: min(70vw, 420px); } .scrim h2 { font-size: 24px; }
  .how { font-size: 13px; text-align: left; line-height: 20px; }
  .big { min-height: 48px; font-size: 24px; box-shadow: 0 6px 0 var(--coral2), 0 6px 0 3px var(--ink); } .big::after { top: 8px; height: 4px; }
  .big.press { transform: translateY(4px) scale(1.03, .92); }
  .screen { padding: calc(var(--safe-t) + 18px) calc(var(--safe-r) + 26px) calc(var(--safe-b) + 18px) calc(var(--safe-l) + 26px); }
  #result { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); column-gap: 18px; align-items: center; justify-items: center; }
  #result .hero { display: contents; }
  .best { grid-column: 1; grid-row: 1; align-self: end; margin: 0; } .num { grid-column: 1; grid-row: 2 / span 2; align-self: center; } .hops { grid-column: 1; grid-row: 4; margin: 0; } #trail { grid-column: 1; grid-row: 5; margin-top: 2px; max-width: 100%; }
  #result h2, #result .line, .small { grid-column: 2; margin-top: 0; text-align: center; }
  #result h2 { grid-row: 1; font-size: 28px; align-self: end; } #result .line { grid-row: 2; font-size: 13px; line-height: 1.35; } .small { grid-row: 3; font-size: 12px; line-height: 1.3; }
  .actions { grid-column: 2; grid-row: 4 / span 2; gap: 8px; margin-top: 6px; }
  .sub { min-height: 42px; font-size: 13px; box-shadow: 0 4px 0 var(--pebble2), 0 4px 0 3px var(--ink); } .lake .link { min-height: 34px; padding: 4px 12px; font-size: 13px; margin: 0; }
  .rhead { margin-bottom: 4px; } .rhead h2 { font-size: 26px; } .ghost { min-height: 36px; padding: 4px 12px; font-size: 13px; }
  .tab { min-height: 34px; font-size: 14px; } #rows { margin-top: 4px; } #rows li { min-height: 30px; font-size: 14px; } #rows .r { font-size: 12px; }
  #name { height: 38px; font-size: 14px; } #name-form { margin-top: 4px; } #name-form .sub { padding: 2px 12px; min-height: 38px; }
  .num b { font-size: min(13vw, 30vh); } .num small { font-size: min(4vw, 8vh); } .hops { font-size: 14px; } .hops b { font-size: 22px; }
  #score .m b { font-size: 34px; } #word { top: 18%; }
}
@media (max-width: 360px) { .links .link { padding: 6px 5px; font-size: 13px; } .vol span { display: none; } #score .m b { font-size: 34px; } #pause-btn { padding: 8px 10px; font-size: 13px; } h1 .logo { font-size: 58px; } }
@media (prefers-reduced-motion: reduce) { .scrim .stack, .rel, .num, h1 .logo i, #skips b.bump, .wave, #trail i, .best { animation: none; } #trail i { opacity: .95; } .big, .sub, .ghost, .tab, .link, #pause-btn { transition: none; } }

/* 初回だけの横投げの見本。操作をふさがず、石を手放したら消える。 */
#first-guide { position: fixed; z-index: 3; left: 50%; top: 48%; transform: translate(-50%, -50%); width: min(88vw, 310px); pointer-events: none; color: var(--ink); text-align: center; }
#first-guide svg { display: block; width: 220px; height: 62px; margin: auto; overflow: visible; filter: drop-shadow(0 2px 0 var(--ink)); }
.guide-arrow { fill: none; stroke: var(--paper); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.guide-stone { fill: var(--gold); stroke: var(--ink); stroke-width: 2; animation: guide-swipe 2.2s ease-in-out infinite; }
#first-guide p { padding: 9px 10px; background: var(--paper); border: 2px solid var(--ink); border-radius: 16px; font-size: 16px; white-space: nowrap; }
@keyframes guide-swipe { 0%, 18% { transform: translateX(0); opacity: 1; } 55% { transform: translateX(-140px); opacity: 1; } 70%, 100% { transform: translateX(-140px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .guide-stone { animation: none; transform: translateX(-70px); } }

/* 横向きの圧縮レイアウトでも押す領域は44pxを下回らせない。 */
.sub, .ghost, .tab, .link, .tog, .snd .tog, #pause-btn, .links .link, .lake .link, #name-form .sub { min-height: 44px; }
.vol input { min-height: 44px; height: 44px; }
#name { min-height: 44px; }
