/* 竜城戦記：画面の見た目。紺の地・金の縁・深紅の帯・羊皮紙の文字。見出しの書体は Zen Antique（SIL OFL）を同梱 */
@font-face { font-family: "ZenAntiqueLW"; src: url("assets/fonts/ZenAntique-subset.woff2") format("woff2"); font-display: swap; }
:root {
  --ink: #0a0f1f; --navy1: #1c2a4d; --navy2: #111a35; --navy3: #0b1228;
  --gold: #d9b45a; --gold2: #f4d98a; --gold3: #8a6a2a; --crim: #8e1d2c; --crim2: #5c1019; --ok: #7be0a0; --bad: #ff7a7a;
  --txt: #f3ecdc; --dim: #a9b4d0; --disp: "ZenAntiqueLW", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --body: "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --frame: linear-gradient(180deg, #1d2b50 0%, #121c39 55%, #0d1530 100%);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: var(--txt); font-family: var(--body); user-select: none; -webkit-user-select: none; touch-action: none; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
#errlog { position: fixed; left: 8px; bottom: 8px; max-width: 80vw; background: rgba(120, 0, 0, .85); color: #fff; font-size: 12px; padding: 8px; z-index: 99; white-space: pre-wrap; }
.hide { display: none !important; }
.ic { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
.gold { color: var(--gold2); } .xpc { color: #ffd76a; } .gemc { color: #8fe6ff; } .dim { color: var(--dim); }

/* ---- 枠（金の縁・四隅の飾り） ---- */
.panel, .frame {
  position: relative; background: var(--frame); border: 2px solid var(--gold); border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 235, 170, .25), 0 0 0 3px rgba(8, 12, 26, .9), 0 0 0 4px rgba(217, 180, 90, .45), 0 12px 36px rgba(0, 0, 0, .6);
}
.frame::before, .frame::after { content: ""; position: absolute; width: 22px; height: 22px; pointer-events: none; background: no-repeat center/contain url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'><path d='M2 20V8c0-3.300 2.700-6 6-6h12' fill='none' stroke='%23f4d98a' stroke-width='2.500' stroke-linecap='round'/><circle cx='4' cy='4' r='2' fill='%23f4d98a'/></svg>"); }
.frame::before { top: 3px; left: 3px; } .frame::after { right: 3px; bottom: 3px; transform: rotate(180deg); }
.panel.sm { border-radius: 10px; border-width: 1.5px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 235, 170, .2), 0 6px 18px rgba(0, 0, 0, .5); }

/* ---- 見出しの帯 ---- */
.ribbon { position: relative; margin: 0 auto 12px; width: max-content; max-width: 100%; padding: 8px 46px 9px; font: 400 clamp(20px, 3.2vw, 28px)/1.2 var(--disp); letter-spacing: .14em; color: var(--gold2); text-align: center; text-shadow: 0 2px 0 #3a0a10, 0 0 14px rgba(255, 190, 90, .45);
  background: linear-gradient(180deg, #b02a3a 0%, var(--crim) 45%, var(--crim2) 100%); clip-path: polygon(0 0, 100% 0, 96% 50%, 100% 100%, 0 100%, 4% 50%); filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .5)); }
.ribbon::before { content: ""; position: absolute; inset: 3px 12px; border-top: 1px solid rgba(244, 217, 138, .6); border-bottom: 1px solid rgba(244, 217, 138, .6); pointer-events: none; }
.sub { font: 400 15px var(--disp); letter-spacing: .12em; color: var(--gold2); margin: 14px 0 6px; padding-left: 12px; border-left: 4px solid var(--crim); display: flex; align-items: center; gap: 8px; }

/* ---- ボタン ---- */
button { font: inherit; color: var(--txt); cursor: pointer; }
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5em; padding: 10px 20px; min-height: 44px; font: 400 17px var(--disp); letter-spacing: .1em; color: var(--gold2); text-shadow: 0 1px 0 #000;
  background: linear-gradient(180deg, #2a3b6c 0%, #17234a 50%, #101a38 100%); border: 1.5px solid var(--gold); border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 235, 170, .35), inset 0 -3px 0 rgba(0, 0, 0, .35), 0 3px 0 #05080f, 0 6px 14px rgba(0, 0, 0, .45); transition: transform .08s, box-shadow .12s, filter .12s; }
.btn:hover:not(:disabled) { filter: brightness(1.2); box-shadow: inset 0 1px 0 rgba(255, 235, 170, .5), inset 0 -3px 0 rgba(0, 0, 0, .35), 0 3px 0 #05080f, 0 0 18px rgba(244, 217, 138, .4); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .5), 0 0 0 #05080f; }
.btn:focus-visible { outline: 2px solid var(--gold2); outline-offset: 3px; }
.btn:disabled { filter: grayscale(.85) brightness(.65); cursor: default; }
.btn.primary { background: linear-gradient(180deg, #c8402f 0%, #9a2420 50%, #6a1218 100%); border-color: var(--gold2); color: #fff3d0; font-size: clamp(19px, 2.6vw, 26px); padding: 14px 44px; letter-spacing: .2em; }
.btn.lg { font-size: 18px; padding: 12px 26px; min-height: 52px; }
.btn.block { width: 100%; }
.btn.good { background: linear-gradient(180deg, #2f8a5a 0%, #1e5e3c 55%, #123d27 100%); }
.btn .cost { display: inline-flex; align-items: center; gap: .25em; padding: 2px 10px; border-radius: 999px; background: rgba(0, 0, 0, .4); font: 700 15px var(--body); letter-spacing: 0; }
.iconbtn { width: 46px; height: 46px; padding: 0; border-radius: 50%; display: inline-grid; place-items: center; }
.iconbtn .ic { width: 22px; height: 22px; }

/* ---- 資源の表示 ---- */
.res { display: inline-flex; gap: 6px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 14px 5px 8px; border-radius: 999px; background: linear-gradient(180deg, #0a1020, #1a2548); border: 1.5px solid var(--gold3); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .6); font: 700 17px var(--body); }
.pill .ic { width: 22px; height: 22px; }

/* ---- 部品：スイッチ・つまみ・4つ並びのボタン ---- */
.sw { position: relative; display: inline-block; width: 62px; height: 32px; flex: none; }
.sw input { appearance: none; -webkit-appearance: none; position: absolute; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; z-index: 2; border-radius: 999px; background: linear-gradient(180deg, #0a1020, #23305a); border: 1.5px solid var(--gold3); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .7); transition: background .15s, border-color .15s; }
.sw::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; z-index: 3; pointer-events: none; background: radial-gradient(circle at 35% 30%, #fff4c8, #c79a3e 70%); box-shadow: 0 2px 4px rgba(0, 0, 0, .6); transition: transform .15s; }
.sw:has(input:checked)::after { transform: translateX(30px); }
.sw input:checked { background: linear-gradient(180deg, #1e6e46, #2fa066); border-color: var(--gold2); }
.sw.warn input:checked { background: linear-gradient(180deg, #8e1d2c, #c8402f); }
.sw input:focus-visible { outline: 2px solid var(--gold2); outline-offset: 3px; }
.rng { appearance: none; -webkit-appearance: none; width: 100%; height: 30px; margin: 0; background: transparent; cursor: pointer; --p: 50%; }
.rng::-webkit-slider-runnable-track { height: 10px; border-radius: 6px; border: 1.5px solid var(--gold3); background: linear-gradient(90deg, var(--gold) var(--p), #0a1020 var(--p)); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .7); }
.rng::-moz-range-track { height: 10px; border-radius: 6px; border: 1.5px solid var(--gold3); background: linear-gradient(90deg, var(--gold) var(--p), #0a1020 var(--p)); }
.rng::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 26px; height: 26px; margin-top: -9px; border-radius: 50%; border: 2px solid #5a3e12; background: radial-gradient(circle at 35% 30%, #fff4c8, #c79a3e 70%); box-shadow: 0 2px 5px rgba(0, 0, 0, .6); }
.rng::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #5a3e12; background: radial-gradient(circle at 35% 30%, #fff4c8, #c79a3e 70%); }
.rng:focus-visible { outline: 2px solid var(--gold2); outline-offset: 2px; border-radius: 8px; }
.seg { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 6px; }
.seg button { white-space: nowrap; padding: 9px 4px; font: 400 15px var(--disp); letter-spacing: .08em; border-radius: 8px; border: 1.5px solid var(--gold3); background: linear-gradient(180deg, #162040, #0c1430); color: var(--dim); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .4); transition: filter .1s, transform .08s; }
.seg button:hover { filter: brightness(1.25); } .seg button:active { transform: translateY(2px); }
.seg button.on { color: #2a1a00; background: linear-gradient(180deg, #f4d98a, #c79a3e); border-color: #fff0b8; text-shadow: 0 1px 0 rgba(255, 255, 255, .4); box-shadow: 0 0 14px rgba(244, 217, 138, .4); }
.seg button:disabled { opacity: .55; cursor: default; }
kbd { display: inline-block; min-width: 26px; padding: 2px 8px; margin: 1px; text-align: center; font: 700 13px var(--body); color: var(--gold2); background: linear-gradient(180deg, #25335f, #111a36); border: 1px solid var(--gold3); border-radius: 6px; box-shadow: 0 2px 0 #05080f; }

/* ---- 画面（タイトル・メニューなど） ---- */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 12px; overflow: auto; touch-action: pan-y; }
.screen.dim { background: radial-gradient(ellipse at center, rgba(6, 10, 24, .45), rgba(2, 4, 12, .88)); }
.screen.clear { background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .55)); }
.screen.top { justify-content: flex-start; padding-top: 3vh; }
.modal { width: min(640px, 96vw); max-height: 92vh; overflow: auto; padding: 22px 22px 18px; text-align: left; touch-action: pan-y; }
.modal > .ribbon { display: block; }
/* スクロールバー：細く目立たない見た目にし、角の白い四角を出さない */
::-webkit-scrollbar { width: 6px; height: 6px; } ::-webkit-scrollbar-thumb { background: rgba(217, 160, 53, .45); border-radius: 4px; } ::-webkit-scrollbar-thumb:hover { background: rgba(244, 217, 138, .7); } ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: rgba(217, 160, 53, .45) transparent; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }

/* タイトル */
.note, .screen p, .modal p { word-break: auto-phrase; text-wrap: pretty; }
.plink { color: var(--gold2); font-size: 13px; letter-spacing: .06em; text-decoration: underline; text-underline-offset: 3px; text-shadow: 0 1px 3px #000; } .plink:hover { color: #fff; }
.note { margin: 0; text-align: center; padding: 7px 18px; font-size: 13px; letter-spacing: .06em; color: var(--txt); background: rgba(6, 10, 26, .72); border: 1px solid rgba(217, 180, 90, .4); border-radius: 999px; text-shadow: 0 1px 3px #000; backdrop-filter: blur(2px); }
.logo { display: flex; flex-direction: column; align-items: center; gap: 2px; filter: drop-shadow(0 6px 20px rgba(0, 0, 0, .7)); }
.logo .emblem { width: clamp(70px, 11vw, 120px); height: auto; color: var(--gold2); filter: drop-shadow(0 0 16px rgba(255, 190, 90, .6)); }
.logo h1 { margin: 0; font: 400 clamp(46px, 9vw, 108px)/1.05 var(--disp); letter-spacing: .1em; color: transparent; background: linear-gradient(180deg, #fff7d8 0%, #f4d98a 40%, #c8872a 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-stroke: 1px rgba(80, 40, 0, .7); text-shadow: none; }
.logo p { margin: 0; font: 400 clamp(13px, 2.2vw, 20px) var(--disp); letter-spacing: .55em; color: var(--gold2); text-indent: .55em; }
.logo .rule { width: min(420px, 70vw); height: 12px; margin: 6px 0; background: no-repeat center/contain url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 420 12'><path d='M0 6h170M250 6h170' stroke='%23d9b45a' stroke-width='1.500'/><path d='M210 0l8 6-8 6-8-6z' fill='%23f4d98a'/><circle cx='186' cy='6' r='2.500' fill='%23d9b45a'/><circle cx='234' cy='6' r='2.500' fill='%23d9b45a'/></svg>"); }
.title-btns { display: grid; grid-template-columns: repeat(3, auto); gap: 12px; justify-content: center; }

/* メニュー */
.menu-grid { display: grid; grid-template-columns: repeat(3, minmax(170px, 230px)); gap: 14px; }
.card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 12px 14px; text-align: center; cursor: pointer; transition: transform .12s, filter .12s; }
.card:hover { transform: translateY(-4px); filter: brightness(1.15); } .card:active { transform: translateY(0); }
.card .medal { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: #2a1a00; background: radial-gradient(circle at 35% 28%, #fff4c8, #d9b45a 55%, #8a6a2a); box-shadow: 0 0 0 3px #3a2a10, 0 0 0 5px var(--gold), 0 6px 14px rgba(0, 0, 0, .5); }
.card .medal .ic { width: 34px; height: 34px; }
.card b { font: 400 21px var(--disp); letter-spacing: .12em; color: var(--gold2); } .card small { color: var(--dim); font-size: 12.5px; line-height: 1.4; }
.card .badge { position: absolute; top: 8px; right: 8px; padding: 2px 9px; border-radius: 999px; font: 700 11px var(--body); color: #fff; background: var(--crim); border: 1px solid var(--gold2); }
.card.hot { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6), 0 0 0 3px rgba(8, 12, 26, .9), 0 0 0 4px var(--gold2), 0 0 24px rgba(244, 217, 138, .45), 0 12px 36px rgba(0, 0, 0, .6); }
.card.wide { grid-column: span 3; flex-direction: row; justify-content: center; gap: 18px; padding: 14px; }
.card.wide .medal { width: 58px; height: 58px; }

/* 面の選択 */
.stage-wrap { width: min(980px, 98vw); max-height: 94vh; overflow: auto; padding: 22px 20px 18px; touch-action: pan-y; }
.chap-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.chap-tabs button { padding: 8px 4px 9px; border-radius: 8px; border: 1.5px solid var(--gold3); background: linear-gradient(180deg, #162040, #0c1430); color: var(--dim); font: 400 14px/1.25 var(--disp); letter-spacing: .06em; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .4); }
.chap-tabs button b { display: block; font-size: 12px; color: var(--gold3); } .stage-wrap .btn-row.sticky { position: sticky; bottom: -18px; z-index: 3; padding: 10px 0 6px; background: linear-gradient(180deg, rgba(14, 22, 48, 0), #0e1630 28%); }
.chap-tabs button { white-space: nowrap; }
.chap-tabs button.lock { opacity: .85; color: #8f98bd; filter: saturate(.5); border-style: dashed; } .chap-tabs button.lock b .ic { width: 11px; height: 11px; vertical-align: -1px; margin-right: 3px; } .chap-tabs button.on { color: #2a1a00; background: linear-gradient(180deg, #f4d98a, #c79a3e); border-color: #fff0b8; } .chap-tabs button.on b { color: #5a3a00; }
.stage-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 12px 0; }
.tile { position: relative; aspect-ratio: 1 / .82; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 12px; border: 2px solid var(--gold3); background: linear-gradient(180deg, #243562, #101a38); box-shadow: inset 0 1px 0 rgba(255, 235, 170, .3), inset 0 -3px 0 rgba(0, 0, 0, .35), 0 3px 0 #05080f; transition: transform .1s, filter .1s; }
.tile b { font: 400 clamp(22px, 3.4vw, 32px) var(--disp); color: var(--gold2); text-shadow: 0 2px 0 #000; } .tile small { font: 700 11px var(--body); color: var(--dim); display: inline-flex; gap: 3px; align-items: center; }
.tile:hover:not(:disabled) { transform: translateY(-3px); filter: brightness(1.2); }
.tile.clear { border-color: var(--gold); background: linear-gradient(180deg, #2c5a46, #123424); } .tile.clear small { color: #bff0d2; }
.tile.boss { border-color: #e05a4a; background: linear-gradient(180deg, #5a1c26, #2a0a12); } .tile.boss b { color: #ffc2a8; } .tile.boss small { color: #ffb0a0; }
.tile.cur { border-color: var(--gold2); box-shadow: inset 0 1px 0 rgba(255, 235, 170, .3), 0 0 0 3px rgba(244, 217, 138, .35), 0 0 20px rgba(244, 217, 138, .5); animation: pulse 1.6s infinite; }
.tile.sel { outline: 3px solid #fff0b8; outline-offset: 2px; }
.tile.lock { background: linear-gradient(180deg, #1a2035, #0d1222); border-color: #4a5470; cursor: not-allowed; } .tile.lock b { color: #8d99b8; text-shadow: none; } .tile.lock small { color: #9aa6c6; }
.detail { padding: 14px 16px; text-align: left; font-size: 15px; line-height: 1.7; }
.detail h3 { margin: 0 0 4px; font: 400 22px var(--disp); letter-spacing: .1em; color: var(--gold2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 7px; border-radius: 999px; font-size: 13px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(217, 180, 90, .45); }
.chip.red { border-color: #b04a4a; color: #ffd0c8; } .chip.red .ic { color: #ff8a7a; }
.chip.reward { font: 700 15px var(--body); }

/* 部隊 */
.units-wrap { position: fixed; left: 10px; top: 10px; bottom: 10px; width: min(360px, 46vw); display: flex; flex-direction: column; gap: 8px; padding: 14px 10px 10px; overflow: auto; touch-action: pan-y; }
.units-wrap .ribbon { font-size: 18px; padding: 6px 34px 7px; margin-bottom: 4px; }
.ucard { display: flex; align-items: center; gap: 10px; padding: 7px 10px 7px 7px; text-align: left; border-radius: 10px; border: 1.5px solid var(--gold3); background: linear-gradient(180deg, #1c2a4d, #0f1833); box-shadow: inset 0 1px 0 rgba(255, 235, 170, .2), 0 2px 0 #05080f; transition: filter .1s, transform .08s; }
.ucard:hover { filter: brightness(1.2); } .ucard:active { transform: translateY(2px); }
.ucard.sel { border-color: #fff0b8; background: linear-gradient(180deg, #3a4f8c, #1c2a55); box-shadow: 0 0 16px rgba(244, 217, 138, .4); }
.ucard.lock { opacity: .85; } .ucard.lock .nm { color: #9aa6c6; }
.ucard .nm { font: 400 17px var(--disp); letter-spacing: .06em; color: var(--gold2); display: block; } .ucard .meta { font-size: 12.5px; color: var(--dim); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.face { position: relative; flex: none; width: 58px; height: 58px; border-radius: 12px; border: 2px solid var(--fc, var(--gold)); background: radial-gradient(circle at 50% 35%, #46598f, #141d3c 75%); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .5); }
.face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.face.f1 { --fc: #7fd0ff; } .face.f2 { --fc: #ffd24a; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6), 0 0 14px rgba(255, 210, 74, .6); }
.face.sil { background: radial-gradient(circle, #1c2440, #0a0f20); border-color: #4a5470; display: grid; place-items: center; color: #7d88a8; } .face.sil .ic { width: 28px; height: 28px; }
.face.big { width: 120px; height: 120px; border-radius: 16px; }
.face .fi { position: absolute; left: 0; right: 0; bottom: 0; padding: 1px 0; text-align: center; font: 700 10px var(--body); background: rgba(0, 0, 0, .55); color: var(--gold2); letter-spacing: 1px; }
.udetail { position: fixed; right: 10px; bottom: 10px; top: 76px; width: min(390px, 52vw); padding: 16px 16px 14px; text-align: left; overflow: auto; touch-action: pan-y; }
.udetail h3 { margin: 0; font: 400 24px var(--disp); letter-spacing: .08em; color: var(--gold2); }
.uhead { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.role { display: inline-flex; gap: 5px; align-items: center; padding: 2px 10px; border-radius: 999px; background: rgba(142, 29, 44, .55); border: 1px solid #c8604a; font-size: 12.5px; color: #ffd8cc; }
.bars { display: grid; gap: 7px; margin: 10px 0; }
.bar-row { display: grid; grid-template-columns: 62px 1fr auto; gap: 8px; align-items: center; font-size: 13px; color: var(--dim); }
.bar-row .v { font: 700 18px var(--body); color: var(--txt); min-width: 58px; text-align: right; } .bar-row .v.w { font-size: 15px; min-width: 84px; } .bar-row .v i { font-style: normal; font-size: 12px; color: var(--ok); margin-left: 4px; }
.meter { position: relative; height: 12px; border-radius: 7px; background: #070b18; border: 1px solid #3a4468; overflow: hidden; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .7); }
.meter i { position: absolute; inset: 0 auto 0 0; border-radius: 7px; background: linear-gradient(180deg, #ffe9a0, #d9a035 60%, #a8741c); }
.meter i.next { background: rgba(123, 224, 160, .55); }
.meter.hp i { background: linear-gradient(180deg, #8af0b0, #2fa066); } .meter.atk i { background: linear-gradient(180deg, #ff9a8a, #c8402f); } .meter.spd i { background: linear-gradient(180deg, #a8dcff, #3f86d0); } .meter.rng i { background: linear-gradient(180deg, #e6c0ff, #8a50d0); }
.lvbar { margin: 6px 0 10px; font-size: 13px; color: var(--dim); display: flex; align-items: center; gap: 8px; } .lvbar .meter { flex: 1; }
.need { text-align: center; font-size: 12.5px; color: var(--bad); margin-top: 4px; min-height: 1.2em; }
.topright { position: fixed; right: 66px; top: 10px; display: flex; gap: 8px; padding: 4px 10px; align-items: center; }
.backbtn { position: fixed; right: 12px; bottom: 12px; }

/* 城の強化 */
.castle-list { width: min(620px, 96vw); padding: 22px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.crow { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--gold3); background: linear-gradient(180deg, #1c2a4d, #0f1833); text-align: left; }
.crow .medal { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: #2a1a00; background: radial-gradient(circle at 35% 28%, #fff4c8, #d9b45a 55%, #8a6a2a); box-shadow: 0 0 0 2px #3a2a10, 0 0 0 3px var(--gold); } .crow .medal .ic { width: 30px; height: 30px; }
.crow b { font: 400 19px var(--disp); letter-spacing: .08em; color: var(--gold2); } .crow small { display: block; color: var(--dim); font-size: 13px; margin: 2px 0 4px; }
.pips { display: flex; gap: 3px; flex-wrap: wrap; } .pips i { width: 12px; height: 8px; border-radius: 2px; background: #0a0f20; border: 1px solid #3a4468; } .pips i.on { background: linear-gradient(180deg, #ffe9a0, #c79a3e); border-color: #fff0b8; }

/* 結果 */
.result { width: min(560px, 96vw); padding: 24px 20px 20px; text-align: center; }
.result .verdict { margin: 0 0 6px; font: 400 clamp(44px, 9vw, 72px)/1.1 var(--disp); letter-spacing: .2em; text-indent: .2em; color: transparent; background: linear-gradient(180deg, #fff7d8, #f4d98a 45%, #c8872a); -webkit-background-clip: text; background-clip: text; -webkit-text-stroke: 1px rgba(80, 40, 0, .7); animation: pop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.result.lose .verdict { background: linear-gradient(180deg, #ffd8d0, #e06a5a 50%, #8e1d2c); -webkit-background-clip: text; background-clip: text; }
.stars-row { display: flex; justify-content: center; gap: 10px; margin: 4px 0 8px; } .st-s { width: 52px; height: 52px; color: #2a3558; opacity: .9; } .st-s .ic { width: 100%; height: 100%; } .st-s.on { color: var(--gold2); filter: drop-shadow(0 0 10px rgba(255, 210, 90, .8)); animation: starin .5s cubic-bezier(.2, 1.8, .4, 1) both; } .st-s.on:nth-child(2) { animation-delay: .35s; } .st-s.on:nth-child(3) { animation-delay: .7s; }
.rewards { display: grid; gap: 8px; margin: 10px auto; max-width: 340px; } .rw { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 10px; background: rgba(0, 0, 0, .4); border: 1px solid var(--gold3); font: 700 22px var(--body); animation: slide .4s both; } .rw:nth-child(2) { animation-delay: .25s; } .rw .ic { width: 28px; height: 28px; } .rw span { flex: 1; text-align: left; font: 400 15px var(--disp); letter-spacing: .1em; color: var(--dim); } .rw em { font-style: normal; font-variant-numeric: tabular-nums; }
.newally { display: flex; align-items: center; gap: 12px; justify-content: center; margin: 10px 0; padding: 10px; border-radius: 12px; background: linear-gradient(90deg, transparent, rgba(244, 217, 138, .2), transparent); border-top: 1px solid var(--gold3); border-bottom: 1px solid var(--gold3); animation: slide .5s .6s both; } .newally b { font: 400 20px var(--disp); color: var(--gold2); letter-spacing: .08em; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes starin { from { transform: scale(0) rotate(-120deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes slide { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse { 0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 235, 170, .3), 0 0 0 3px rgba(244, 217, 138, .3), 0 0 14px rgba(244, 217, 138, .4); } 50% { box-shadow: inset 0 1px 0 rgba(255, 235, 170, .3), 0 0 0 5px rgba(244, 217, 138, .5), 0 0 28px rgba(244, 217, 138, .7); } }

/* 設定・遊び方・クレジット */
.set-sec { margin: 12px 0 4px; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 52%); gap: 14px; align-items: center; padding: 11px 4px; border-bottom: 1px dashed rgba(217, 180, 90, .3); }
.set-row:last-of-type { border-bottom: 0; } .set-row .lb { display: flex; gap: 10px; align-items: center; } .set-row .lb .ic { width: 26px; height: 26px; color: var(--gold); } .set-row .lb b { display: block; font: 400 17px var(--disp); letter-spacing: .08em; color: var(--gold2); } .set-row .lb small { color: var(--dim); font-size: 12.5px; line-height: 1.4; display: block; }
.set-row .ctl { display: flex; align-items: center; gap: 12px; } .set-row .ctl.end { justify-content: flex-end; } .set-row .val { min-width: 46px; text-align: right; font: 700 15px var(--body); color: var(--gold2); }
.set-row.vert { grid-template-columns: 1fr; }
.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14px; align-items: start; } .help-grid > span { color: var(--txt); line-height: 1.5; }
.credits-sec { font-size: 13px; color: var(--dim); line-height: 1.65; } .credits-sec a { color: #8fd0ff; } .credits-sec table { width: 100%; border-collapse: collapse; margin: 4px 0 8px; } .credits-sec td { padding: 4px 6px; border-bottom: 1px solid rgba(217, 180, 90, .2); vertical-align: top; } .credits-sec td:nth-child(3), .credits-sec td:last-child { white-space: nowrap; } .medal .ic, .card .medal .ic { width: 60%; height: 60%; }
.credits-sec tr:nth-child(odd) td { background: rgba(255, 255, 255, .03); }

.loadbar { width: min(520px, 80vw); height: 16px; border-radius: 9px; background: #070b18; border: 1.5px solid var(--gold3); overflow: hidden; box-shadow: inset 0 2px 5px rgba(0, 0, 0, .7); } .loadbar > i { display: block; height: 100%; width: 0; background: linear-gradient(180deg, #ffe9a0, #d9a035 60%, #a8741c); transition: width .15s; }
.loadtxt { margin: 0; font: 400 clamp(20px, 3vw, 28px) var(--disp); letter-spacing: .15em; color: var(--gold2); text-shadow: 0 2px 0 #000; }

/* ---- 戦いの画面 ---- */
#topbar { position: fixed; left: 10px; right: 64px; top: calc(10px + env(safe-area-inset-top)); display: flex; gap: 10px; align-items: flex-start; pointer-events: none; }
#topbar > * { pointer-events: auto; }
.basebar { width: min(32vw, 340px); padding: 6px 12px 8px; } .basebar .hd { display: flex; align-items: center; gap: 7px; font: 400 13px var(--disp); letter-spacing: .1em; color: var(--gold2); } .basebar .hd .ic { width: 18px; height: 18px; } .basebar .hd b { margin-left: auto; font: 700 15px var(--body); color: var(--txt); letter-spacing: 0; }
.bar { height: 12px; border-radius: 7px; background: #070b18; border: 1px solid #3a4468; overflow: hidden; margin-top: 4px; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .7); } .bar i { display: block; height: 100%; width: 100%; transition: width .15s; border-radius: 6px; }
#pbar i { background: linear-gradient(180deg, #a8e0ff, #3f86d0); } #ebar i { background: linear-gradient(180deg, #ffb08a, #c8402f); float: right; } #pbar.low i { background: linear-gradient(180deg, #ff9a8a, #c8402f); }
.midtop { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; min-width: 0; } .midtop > * { pointer-events: auto; }
.plaque { padding: 5px 20px 6px; text-align: center; font: 400 15px var(--disp); letter-spacing: .12em; color: var(--gold2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ctrls { display: flex; gap: 5px; } .ctrls .btn { min-height: 34px; padding: 4px 12px; font: 700 14px var(--body); letter-spacing: 0; border-radius: 8px; } .ctrls .btn.on { color: #2a1a00; background: linear-gradient(180deg, #f4d98a, #c79a3e); border-color: #fff0b8; text-shadow: none; } .ctrls .btn .ic { width: 16px; height: 16px; }
#muteBtn { position: fixed; right: 10px; top: calc(10px + env(safe-area-inset-top)); z-index: 5; width: 46px; height: 46px; } #muteBtn.off { background: linear-gradient(180deg, #a02a3a, #5c1019); color: #ffd8d0; }
#qbusy { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; background: rgba(4, 8, 20, .45); pointer-events: auto; } #qbusy.show { display: grid; } #qnote { position: fixed; left: 50%; transform: translateX(-50%); top: calc(64px + env(safe-area-inset-top)); z-index: 40; display: none; padding: 3px 12px; border-radius: 999px; font-size: 12px; color: var(--dim); background: rgba(6, 10, 26, .6); border: 1px solid rgba(217, 180, 90, .35); pointer-events: none; } #qnote.show { display: block; } #qbusy span { padding: 12px 26px; border-radius: 12px; border: 1.5px solid var(--gold); background: linear-gradient(180deg, #1a2850, #0b1230); color: var(--gold2); font: 400 18px var(--disp); letter-spacing: .1em; box-shadow: 0 8px 30px rgba(0, 0, 0, .6); }
#camBtn { display: none; }
#units.more { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent); }
.evobox { margin-top: 10px; padding: 8px 10px 10px; border: 1px solid rgba(217, 180, 90, .45); border-radius: 12px; background: rgba(0, 0, 0, .28); } .evobox h4 { margin: 0 0 4px; font: 400 15px var(--disp); color: var(--gold2); display: flex; align-items: center; gap: 6px; } .evobox .btn { margin-top: 4px; white-space: nowrap; } .evobox .btn.primary { font-size: 17px; padding: 10px 8px; gap: 6px; }
.chip.okc { border-color: #4fae6a; color: #c8f2d4; } .chip.ngc { border-color: #b06a4a; color: #ffd8c0; }
#cams { position: fixed; right: 10px; top: calc(66px + env(safe-area-inset-top)); display: flex; flex-direction: column; gap: 5px; padding: 6px; border-radius: 12px; }
#cams button { display: grid; grid-template-columns: 22px 1fr; gap: 6px; align-items: center; padding: 5px 10px 5px 7px; border-radius: 8px; border: 1.5px solid var(--gold3); background: linear-gradient(180deg, #162040, #0c1430); color: var(--dim); font: 400 13px var(--disp); letter-spacing: .06em; text-align: left; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .4); transition: filter .1s; }
#cams button:hover { filter: brightness(1.3); } #cams button .ic { width: 18px; height: 18px; } #cams button.on { color: #2a1a00; background: linear-gradient(180deg, #f4d98a, #c79a3e); border-color: #fff0b8; }
#money { position: fixed; left: 10px; bottom: calc(112px + env(safe-area-inset-bottom)); padding: 6px 16px 8px 10px; display: flex; gap: 10px; align-items: center; min-width: 190px; }
#money .coinb { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #ffd76a; background: radial-gradient(circle at 40% 30%, #3a4a7c, #0d1530); box-shadow: 0 0 0 2px #3a2a10, 0 0 0 3px var(--gold); } #money .coinb .ic { width: 28px; height: 28px; }
#money b { display: block; font: 700 26px/1 var(--body); color: var(--gold2); font-variant-numeric: tabular-nums; } #money small { display: block; color: var(--dim); font-size: 12px; } #money .bar { height: 7px; margin-top: 3px; } #money .bar i { background: linear-gradient(180deg, #ffe9a0, #c79a3e); }
#units { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(8px + env(safe-area-inset-bottom)); display: flex; gap: 6px; padding: 8px 10px; max-width: 100vw; overflow-x: auto; touch-action: pan-x; }
.ub { position: relative; flex: none; width: 84px; padding: 5px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; border-radius: 10px; border: 1.5px solid var(--gold3); background: linear-gradient(180deg, #243562, #0f1833); overflow: hidden; box-shadow: inset 0 1px 0 rgba(255, 235, 170, .3), 0 3px 0 #05080f; transition: transform .08s, filter .1s; }
.ub:hover:not(.lock) { filter: brightness(1.2); } .ub:active:not(.lock) { transform: translateY(2px); }
.ub .face { width: 66px; height: 66px; } .ub .nm { font: 400 12px var(--disp); letter-spacing: .02em; color: var(--txt); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; } .ub .co { display: inline-flex; align-items: center; gap: 3px; font: 700 15px var(--body); color: var(--gold2); } .ub .co .ic { width: 15px; height: 15px; }
.ub .kb { position: absolute; top: 3px; left: 5px; z-index: 2; font: 700 11px var(--body); color: #fff; padding: 0 5px; background: rgba(0, 0, 0, .6); border-radius: 4px; }
.ub .cdv { position: absolute; inset: 0; pointer-events: none; background: rgba(4, 6, 14, .72); transform-origin: bottom; transform: scaleY(0); display: grid; place-items: center; font: 700 22px var(--body); color: #fff; } .ub .cdn { position: absolute; inset: 0; display: grid; place-items: center; font: 700 22px var(--body); color: #fff; text-shadow: 0 2px 4px #000; pointer-events: none; }
.ub.poor { filter: brightness(.55) saturate(.6); } .ub.poor .co { color: var(--bad); }
.ub.lock { opacity: .5; filter: grayscale(1); } .ub.ready { animation: none; }
#cannon { position: fixed; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); width: 92px; height: 92px; padding: 0; border-radius: 50%; border: 0; display: grid; place-items: center; background: conic-gradient(#5ee8ff var(--p, 0%), #0a1020 0); box-shadow: 0 0 0 3px var(--gold), 0 0 0 5px rgba(8, 12, 26, .9), 0 6px 16px rgba(0, 0, 0, .6); }
#cannon::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: radial-gradient(circle at 40% 30%, #2a3b6c, #0d1530); }
#cannon span { position: relative; display: flex; flex-direction: column; align-items: center; font: 400 14px var(--disp); letter-spacing: .08em; color: var(--gold2); line-height: 1.15; } #cannon .ic { width: 26px; height: 26px; } #cannon small { display: block; font: 700 11px var(--body); color: var(--dim); letter-spacing: 0; }
#cannon.ready { animation: cpulse 1s infinite; } #cannon.ready span { color: #b8f6ff; }
@keyframes cpulse { 0%, 100% { box-shadow: 0 0 0 3px var(--gold), 0 0 0 5px rgba(8, 12, 26, .9), 0 0 0 rgba(94, 232, 255, .7); } 50% { box-shadow: 0 0 0 3px var(--gold), 0 0 0 5px rgba(8, 12, 26, .9), 0 0 26px 8px rgba(94, 232, 255, .65); } }
#banner { z-index: 30; position: fixed; left: 0; right: 0; top: 22%; text-align: center; pointer-events: none !important; opacity: 0; transform: scale(.9); transition: opacity .35s, transform .35s; } #banner.show { opacity: 1; transform: none; }
#banner h2 { display: inline-block; margin: 0; padding: 10px 70px 12px; font: 400 clamp(26px, 6vw, 56px)/1.15 var(--disp); letter-spacing: .16em; color: var(--gold2); text-shadow: 0 3px 0 #3a0a10, 0 0 24px rgba(255, 190, 90, .55); background: linear-gradient(90deg, transparent, rgba(40, 8, 14, .85) 18%, rgba(40, 8, 14, .85) 82%, transparent); border-top: 2px solid var(--gold); border-bottom: 2px solid var(--gold); }
#banner p { display: table; margin-left: auto !important; margin-right: auto !important; padding: 3px 26px 4px; border-radius: 999px; background: rgba(20, 6, 12, .92); border: 1px solid rgba(240, 194, 74, .6); margin: 8px 0 0; color: var(--gold2); font: 400 clamp(14px, 2.4vw, 20px) var(--disp); letter-spacing: .1em; text-shadow: 0 2px 0 #000; } #banner.boss h2 { color: #ffb8a8; background: linear-gradient(90deg, transparent, rgba(110, 10, 16, .9) 18%, rgba(110, 10, 16, .9) 82%, transparent); border-color: #ff7a5a; text-shadow: 0 3px 0 #200000, 0 0 30px rgba(255, 60, 40, .9); }
#toast { position: fixed; left: 50%; top: 96px; transform: translateX(-50%) translateY(-8px); padding: 8px 22px; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none !important; font: 400 15px var(--disp); letter-spacing: .08em; color: var(--gold2); display: flex; gap: 8px; align-items: center; } #toast.show { opacity: 1; transform: translateX(-50%); } #toast .ic { color: #ff9a8a; }
#tip { position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 8px 18px; font-size: 14px; pointer-events: none !important; text-align: center; max-width: min(640px, 84vw); line-height: 1.5; color: var(--txt); }

@media (max-width: 1100px) { #cannon { bottom: calc(104px + env(safe-area-inset-bottom)); width: 78px; height: 78px; } #cannon .ic { width: 22px; height: 22px; } #money { bottom: calc(104px + env(safe-area-inset-bottom)); } }
@media (max-width: 760px), (max-height: 540px) {
  .btn { font-size: 15px; padding: 9px 14px; } .btn.primary { padding: 12px 28px; } .menu-grid { grid-template-columns: repeat(2, minmax(130px, 1fr)); gap: 10px; width: min(480px, 96vw); } .card.wide { grid-column: span 2; } .card b { font-size: 18px; } .card .medal { width: 54px; height: 54px; } .card small { font-size: 11.5px; }
  .title-btns { grid-template-columns: 1fr 1fr 1fr; gap: 8px; } .title-btns .btn { padding: 10px 4px; font-size: 13px; white-space: nowrap; }
  .stage-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; } .seg button { font-size: 13px; letter-spacing: 0; padding: 9px 2px; } .chap-tabs { gap: 5px; } .chap-tabs button { font-size: 11px; letter-spacing: 0; padding: 7px 1px 8px; } .chap-tabs button b { font-size: 10px; }
  .units-wrap { width: 48vw; padding: 10px 6px 6px; } .ucard { gap: 7px; padding: 5px; } .ucard .nm { font-size: 14px; } .face { width: 46px; height: 46px; } .udetail { width: 49vw; top: 66px; padding: 10px; } .udetail h3 { font-size: 18px; } .face.big { width: 74px; height: 74px; } .bar-row { grid-template-columns: 48px 1fr auto; font-size: 12px; } .bar-row .v { font-size: 15px; min-width: 46px; }
  .topright { right: 62px; top: 8px; padding: 2px 6px; } .crow { grid-template-columns: 44px 1fr; } .crow .btn { grid-column: 1 / 3; } .crow .medal { width: 44px; height: 44px; }
  #topbar { left: 6px; right: 60px; top: calc(6px + env(safe-area-inset-top)); gap: 6px; } .basebar { width: 27vw; padding: 4px 8px 6px; } .basebar .hd { font-size: 11px; } .basebar .hd b { font-size: 12px; } .plaque { font-size: 12px; padding: 3px 10px; } .ctrls .btn { padding: 3px 8px; min-height: 30px; font-size: 12px; }
  #muteBtn { right: 6px; top: calc(6px + env(safe-area-inset-top)); width: 42px; height: 42px; } #camBtn { display: grid; place-items: center; position: fixed; right: 6px; top: calc(54px + env(safe-area-inset-top)); width: 42px; height: 42px; padding: 0; z-index: 4; } #camBtn .ic { width: 22px; height: 22px; } #cams { display: none; } #cams.open { display: flex; } #cams { right: 6px; top: calc(102px + env(safe-area-inset-top)); padding: 4px; gap: 3px; } #cams button { padding: 3px 7px 3px 5px; font-size: 11px; grid-template-columns: 18px 1fr; } #cams button .ic { width: 15px; height: 15px; }
  .evobox .btn.primary { font-size: 14px; padding: 9px 4px; gap: 4px; } .stage-wrap { margin-top: 50px; max-height: calc(94vh - 50px); } .udetail { padding-bottom: 56px; } .evobox .chip { font-size: 11.5px; padding: 2px 8px 2px 6px; }
  .ub { width: 62px; padding: 3px 2px 4px; } .ub .face { width: 50px; height: 50px; border-radius: 9px; } .ub .nm { font-size: 10px; } .ub .co { font-size: 12px; } .ub .co .ic { width: 12px; height: 12px; } #units { padding: 5px 6px; gap: 4px; }
  #cannon { width: 62px; height: 62px; bottom: calc(112px + env(safe-area-inset-bottom)); right: 8px; } #cannon::before { inset: 5px; } #cannon span { font-size: 11px; } #cannon .ic { width: 18px; height: 18px; } #cannon small { font-size: 9px; }
  #money { left: 6px; bottom: calc(112px + env(safe-area-inset-bottom)); min-width: 0; padding: 4px 10px 6px 6px; gap: 7px; } #money .coinb { width: 32px; height: 32px; } #money .coinb .ic { width: 20px; height: 20px; } #money b { font-size: 19px; } #money small { font-size: 10px; }
  #tip { bottom: calc(180px + env(safe-area-inset-bottom)); font-size: 12px; } .basebar .hd span { display: none; } .basebar { width: 27vw; } .plaque { display: none; } .ctrls .btn { min-width: 38px; } .ctrls .btn[data-v]:not(.on) { display: none; } .udetail .btn { font-size: 15px; letter-spacing: .04em; padding: 10px 8px; white-space: nowrap; } .udetail .btn.primary { font-size: 15px; padding: 10px 8px; } #banner h2 { padding: 8px 30px 10px; } .modal { padding: 16px 12px 12px; } .ribbon { padding: 7px 34px 8px; font-size: 19px; } .set-row { grid-template-columns: 1fr; gap: 8px; } .set-row .ctl.end { justify-content: flex-start; } .help-grid { grid-template-columns: 1fr; gap: 2px 0; } .help-grid > span { margin-bottom: 8px; } .result { padding: 18px 12px; } .st-s { width: 42px; height: 42px; }
}
/* 高さの低い横画面（スマホの横向き 844×390・667×375 など）：部隊の欄を低くし、お金と面の選択を収める */
@media (max-height: 460px) and (min-aspect-ratio: 3 / 2) {
  .ub { width: 52px; padding: 2px 2px 3px; gap: 1px; } .ub .face { width: 38px; height: 38px; border-radius: 8px; } .ub .nm { display: none; } .ub .co { font-size: 11px; } .ub .co .ic { width: 11px; height: 11px; } #units { bottom: 4px; padding: 4px 6px; gap: 4px; }
  #money { left: 6px; top: calc(52px + env(safe-area-inset-top)); bottom: auto; } #cannon { bottom: 8px; width: 56px; height: 56px; } #tip { bottom: 84px; }
  .stage-wrap { margin-top: 0; max-height: 96vh; overflow-x: hidden; padding: 10px 12px 8px; width: min(980px, 98vw); } .stage-wrap .ribbon { font-size: 16px; padding: 4px 22px 5px; }
  .stage-wrap > div[style*="margin-bottom:8px"] { margin-bottom: 4px !important; } .stage-grid { grid-template-columns: repeat(6, 1fr); gap: 5px; margin: 6px 0; } .tile { aspect-ratio: auto; padding: 3px 0; border-radius: 8px; } .tile b { font-size: 17px; } .tile small { font-size: 9.5px; }
  .chap-tabs { margin: 6px 0; } .chap-tabs button { padding: 3px 1px 4px; font-size: 10.5px; } .seg button { padding: 5px 2px; font-size: 12px; } .detail { padding: 6px 10px; font-size: 12px; line-height: 1.4; } .detail h3 { font-size: 15px; }
  .stage-wrap .btn-row.sticky { bottom: -8px; padding: 6px 0 2px; margin-top: 4px !important; } .stage-wrap .btn-row .btn { padding: 6px 18px; font-size: 14px; }
  .screen { justify-content: safe center; padding: 6px; gap: 6px; } .modal { padding: 8px 14px 8px; } .ribbon { font-size: 15px; padding: 3px 22px 4px; margin-bottom: 4px; }
  .set-row { padding: 5px 4px; gap: 8px; } .set-row .lb .ic { width: 20px; height: 20px; } .set-row .lb small { font-size: 10.5px; } .modal .sub { margin: 4px 0 2px; font-size: 12px; } .modal .btn-row { margin-top: 6px !important; } .modal p { font-size: 12px; margin: 2px 0; }
  .crow { padding: 5px 8px; gap: 8px; } .crow .medal { width: 34px; height: 34px; } .crow b { font-size: 15px; } .crow small { font-size: 11px; margin: 0 0 2px; } .crow .btn { padding: 4px 10px; font-size: 13px; } .castle-list { max-height: 96vh; overflow: auto; }
  .result { padding: 8px 18px 8px; max-height: 96vh; overflow: auto; } .result .verdict { font-size: 30px; } .result .stars-row svg, .result .stars-row .ic { width: 22px; height: 22px; } .result .rewards { margin: 4px auto; gap: 4px; } .result .rw { padding: 4px 12px; font-size: 14px; } .result .btn { padding: 6px 14px; font-size: 13px; } .result .stack { gap: 6px; } .result .btn-row { margin-top: 4px !important; }
  .modal { max-height: 96vh; } .frame.units-wrap { top: 6px; bottom: 6px; } .udetail { top: 56px; bottom: 6px; }
}
