/* サンタ ザ アスレチック style.css — 構造とクラス名は docs/design.md を参照 */

:root {
  --c-ink: #3b2f2f;
  --c-ink-sub: #7a6a5e;
  --c-paper: #fffdf7;
  --c-line: #eadcc0;
  --c-red: #e8413b;
  --c-red-deep: #b8302c;
  --c-gold: #ffc83d;
  --c-gold-deep: #d99a00;
  --c-sky: #4f9be0;
  --c-sky-deep: #2f6fb8;
  --c-sky-pale: #bfe3ff;
  --c-night: #1b2960;
  --c-night-deep: #0b1438;
  --c-aurora: #5ef2c8;
  --c-aurora-2: #8f7bff;
  --c-snow: #f4f9ff;
  --c-gift: #ff6fa3;
  --c-teal: #2bb5a6;
  --c-grape: #8f7bff;

  --font-base: "Hiragino Maru Gothic ProN", "Hiragino Maru Gothic Pro", "BIZ UDPGothic",
    "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --font-num: "Arial Rounded MT Bold", "Hiragino Maru Gothic ProN", "SF Pro Rounded",
    ui-rounded, system-ui, sans-serif;

  --radius-m: 18px;
  --radius-l: 28px;
  --btn-depth: 6px;
  
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  --dur-fast: 0.15s;
  --dur-mid: 0.35s;
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-base);
  color: var(--c-ink);
  background: var(--c-night-deep);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: none;
  line-height: 1.5;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  overflow: hidden;
}
button { font: inherit; color: inherit; }
.num { font-family: var(--font-num); font-weight: 900; font-variant-numeric: tabular-nums; }

.app { position: relative; width: 100%; height: 100dvh; overflow: hidden; background: linear-gradient(#3b4aa6, #f7a59b); }

/* ---------- 画面 ---------- */
.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  padding: calc(14px + var(--safe-top)) calc(16px + var(--safe-right)) calc(16px + var(--safe-bottom)) calc(16px + var(--safe-left));
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--dur-mid), visibility 0s linear var(--dur-mid); overflow: hidden auto;
}
.screen.is-active { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity var(--dur-mid); }
.screen__bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.screen:not(.screen--play) > :not(.screen__bg) { position: relative; z-index: 1; }

/* ---------- ボタン ---------- */
.btn {
  --btn-bg: var(--c-red); --btn-edge: var(--c-red-deep); --btn-fg: #fff;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 10px 24px; border: 3px solid var(--c-ink); border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg); font-size: 20px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; cursor: pointer;
  box-shadow: 0 var(--btn-depth) 0 var(--btn-edge), 0 var(--btn-depth) 0 3px var(--c-ink);
  transition: transform .08s, box-shadow .08s, filter var(--dur-fast);
}
.btn::after { content: ""; position: absolute; top: 5px; left: 18%; right: 18%; height: 6px; border-radius: 999px; background: rgba(255,255,255,.35); pointer-events: none; }
.btn:active, .btn.is-pressed { transform: translateY(var(--btn-depth)); box-shadow: 0 0 0 var(--btn-edge), 0 0 0 3px var(--c-ink); }
.btn--block { display: flex; width: 100%; }
.btn--sky { --btn-bg: var(--c-sky); --btn-edge: var(--c-sky-deep); }
.btn--gold { --btn-bg: var(--c-gold); --btn-edge: var(--c-gold-deep); --btn-fg: var(--c-ink); }
.btn--ghost { --btn-bg: var(--c-paper); --btn-edge: var(--c-line); --btn-fg: var(--c-ink); }
.btn--small { min-height: 44px; padding: 6px 14px; font-size: 15px; --btn-depth: 4px; }
.row { display: flex; gap: 10px; } .row > .btn { flex: 1; padding-inline: 8px; }
.icon-btn {
  flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 3px solid var(--c-ink); border-radius: 50%; background: var(--c-paper); font-size: 20px; font-weight: 900; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 0 var(--c-ink); transition: transform .08s, box-shadow .08s;
}
.icon-btn:active { transform: translateY(4px); box-shadow: none; }
.icon-btn--pause::before { content: ""; width: 12px; height: 14px; border-left: 4px solid var(--c-ink); border-right: 4px solid var(--c-ink); }
.icon-btn[aria-pressed="true"], .icon-btn.is-off { color: #b3a797; text-decoration: line-through; }
.btn:focus-visible, .icon-btn:focus-visible, .stage-card:focus-visible { outline: 4px solid var(--c-gold); outline-offset: 4px; }

/* ---------- タイトル ---------- */
.screen--title { align-items: center; justify-content: safe center; gap: clamp(8px, 2vh, 18px); text-align: center; }
.screen--title > .back-to-games {
  position: absolute !important; top: calc(12px + var(--safe-top)); left: calc(12px + var(--safe-left)); z-index: 6;
  padding: 6px 12px 7px; border: 3px solid var(--c-ink); border-radius: 999px; background: var(--c-paper); box-shadow: 0 3px 0 var(--c-ink);
  font: 800 13px/1 var(--font-base); color: var(--c-ink); text-decoration: none;
}
.screen--title > .back-to-games:active { transform: translateY(3px); box-shadow: none; }
.screen--title > .title__mute { position: absolute !important; top: calc(10px + var(--safe-top)); right: calc(12px + var(--safe-right)); }
.logo { margin: 0; font-weight: 900; line-height: 1.02; display: grid; justify-items: center; --fs: clamp(40px, min(13.5vw, 11vh), 92px); }
.logo__sub { padding: 2px 14px; margin-bottom: 10px; border: 3px solid var(--c-ink); border-radius: 999px; background: var(--c-paper); font-size: clamp(13px, 3.6vmin, 18px); line-height: 1.5; transform: rotate(-2deg); }
.logo__row { display: flex; gap: 2px; font-size: var(--fs); }
.logo__row--small { font-size: calc(var(--fs) * .52); margin: -2px 0; }
.logo__char {
  display: inline-block; color: var(--c-paper); -webkit-text-stroke: clamp(5px, 1.6vmin, 8px) var(--c-ink); paint-order: stroke fill; text-shadow: 0 5px 0 var(--c-ink);
  animation: hop 2.6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * .09s);
}
.logo__char--red { color: #ff655c; } .logo__char--gold { color: var(--c-gold); } .logo__char--sky { color: #8fdcff; }
@keyframes hop { 0%, 64%, 100% { translate: 0 0; } 72% { translate: 0 3px; scale: 1.06 .92; } 84% { translate: 0 -11px; scale: .96 1.06; } }
.title__scene { width: min(86vw, 460px); height: auto; aspect-ratio: 2.2; max-height: 32vh; }
.title__actions { display: grid; gap: 14px; justify-items: center; width: min(80vw, 320px); }
.title__best { margin: 0; padding: 2px 16px; border: 3px solid var(--c-ink); border-radius: 999px; background: var(--c-gold); font-size: 15px; font-weight: 900; }

/* ---------- ステージ選択 ---------- */
.screen--select { gap: 16px; }
.bar { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 980px; margin: 0 auto; }
.bar__title { flex: 1; margin: 0; color: #fff; font-size: clamp(19px, 5vmin, 26px); font-weight: 900; -webkit-text-stroke: 5px var(--c-ink); paint-order: stroke fill; }
.bar__stars { padding: 2px 14px; border: 3px solid var(--c-ink); border-radius: 999px; background: var(--c-gold); font-weight: 900; white-space: nowrap; }
.stages { flex: 1; display: grid; gap: 18px; width: 100%; max-width: 460px; margin: 0 auto; align-content: safe center; }
.stage-card {
  --accent: var(--c-red);
  position: relative; display: grid; grid-template-columns: 42% 1fr; grid-template-rows: auto auto auto; column-gap: 12px; align-content: center; align-items: center; justify-items: start;
  min-height: 128px; padding: 0 12px 0 0; border: 3px solid var(--c-ink); border-radius: 22px; background: var(--c-paper); box-shadow: 0 6px 0 var(--accent), 0 6px 0 3px var(--c-ink);
  overflow: hidden; text-align: left; cursor: pointer; transition: transform .08s, box-shadow .08s;
}
.stage-card[data-theme="workshop"] { --accent: var(--c-teal); } .stage-card[data-theme="tower"] { --accent: var(--c-grape); }
.stage-card:active:not(:disabled) { transform: translateY(6px); box-shadow: 0 0 0 3px var(--c-ink); }
.stage-card__pic { grid-row: 1 / -1; grid-column: 1; align-self: stretch; width: 100%; height: 100%; min-height: 122px; border-right: 3px solid var(--c-ink); background: #cfe6f7; }
.stage-card__no { position: absolute; left: 8px; top: 8px; display: grid; place-items: center; width: 34px; height: 34px; border: 3px solid var(--c-ink); border-radius: 50%; background: var(--accent); color: #fff; font-size: 18px; }
.stage-card__name { grid-column: 2; font-size: 20px; font-weight: 900; }
.stage-card__best { grid-column: 2; font-size: 13px; font-weight: 800; color: var(--c-ink-sub); }
.stage-card__lock { grid-column: 2; font-size: 12px; font-weight: 800; color: var(--c-ink-sub); }
.stage-card > .stars { grid-column: 2; }
.stage-card__ribbon { position: absolute; right: -34px; top: 14px; width: 130px; padding: 1px 0; border: 2px solid var(--c-ink); background: var(--c-gold); font-size: 11px; font-weight: 900; text-align: center; transform: rotate(35deg); }
.stage-card.is-locked { filter: saturate(.35); cursor: not-allowed; } .stage-card.is-locked .stars, .stage-card.is-locked .stage-card__best { display: none; }
.stars { display: inline-flex; gap: 4px; }
.star { flex: none; position: relative; width: 26px; height: 26px; }
.star::before, .star::after { content: ""; position: absolute; inset: 0; clip-path: polygon(50% 0, 63% 33%, 98% 36%, 71% 58%, 80% 93%, 50% 74%, 20% 93%, 29% 58%, 2% 36%, 37% 33%); background: var(--c-ink); }
.star::after { inset: 3px; background: #d8cfbf; } .star.is-on::after { background: var(--c-gold); }
.stars--big { gap: 8px; } .stars--big .star { width: 56px; height: 56px; } .stars--big .star::after { inset: 5px; }
.sheet.is-open .star.is-on { animation: star-in .5s var(--ease-pop) both; animation-delay: calc(.25s + var(--i, 0) * .18s); }
@keyframes star-in { from { transform: scale(0) rotate(-90deg); } to { transform: none; } }

/* ---------- プレイ ---------- */
.screen--play { padding: 0; overflow: hidden; touch-action: none; background: #1b2960; }
.play__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hud { position: absolute; z-index: 3; inset: 0 0 auto 0; display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-top)) calc(10px + var(--safe-right)) 0 calc(10px + var(--safe-left)); pointer-events: none; }
.hud > button { pointer-events: auto; } .hud__mute { margin-left: auto; }
.hud__time { display: grid; place-items: center; min-width: 84px; height: 44px; padding: 0 10px; border: 3px solid var(--c-ink); border-radius: 14px; background: var(--c-paper); box-shadow: 0 3px 0 var(--c-ink); font-size: 24px; line-height: 1; }
.hud__time.is-low { background: var(--c-red); color: #fff; animation: low .5s ease-in-out infinite alternate; }
@keyframes low { to { transform: scale(1.06); } }
.hud__lives { display: flex; align-items: center; gap: 3px; height: 40px; padding: 0 10px; border: 3px solid var(--c-ink); border-radius: 14px; background: rgba(255,253,247,.94); }
.hat { flex: none; position: relative; width: 22px; height: 20px; }
.hat::before { content: ""; position: absolute; left: 3px; bottom: 5px; width: 16px; height: 14px; border: 2px solid var(--c-ink); border-radius: 12px 10px 0 0; background: #cfc6b8; }
.hat::after { content: ""; position: absolute; left: 0; bottom: 1px; width: 22px; height: 7px; border: 2px solid var(--c-ink); border-radius: 5px; background: #fff; }
.hat.is-on::before { background: var(--c-red); } .hat:not(.is-on) { opacity: .55; }
.hud__combo { position: absolute; left: 50%; top: calc(86px + var(--safe-top)); padding: 0 14px; border: 3px solid var(--c-ink); border-radius: 999px; background: var(--c-gold); font-size: 15px; font-weight: 900; white-space: nowrap; transform: translateX(-50%) rotate(-2deg); }
.course { position: absolute; z-index: 2; left: calc(18px + var(--safe-left)); right: calc(22px + var(--safe-right)); top: calc(64px + var(--safe-top)); height: 12px; border: 3px solid var(--c-ink); border-radius: 99px; background: rgba(255,253,247,.9); pointer-events: none; }
.course__fill { position: absolute; inset: 0 auto 0 0; width: calc(var(--p, 0) * 100%); border-radius: 99px; background: var(--c-red); }
.course__tick { position: absolute; left: calc(var(--p) * 100%); top: 0; bottom: 0; width: 2px; background: rgba(59,47,47,.45); }
.course__me { position: absolute; left: calc(var(--p, 0) * 100%); top: 50%; width: 20px; height: 20px; border: 3px solid var(--c-ink); border-radius: 50%; background: radial-gradient(circle at 50% 70%, #ffdcbf 45%, var(--c-red) 48%); transform: translate(-50%, -50%); }
.course__drop { position: absolute; left: calc(var(--p) * 100%); bottom: 5px; font: 900 13px/1 var(--font-base); color: #9fd8ff; -webkit-text-stroke: 3px var(--c-ink); paint-order: stroke fill; transform: translateX(-50%); }
.course__goal { position: absolute; right: -13px; top: 50%; width: 24px; height: 24px; border: 3px solid var(--c-ink); border-radius: 50%; background: var(--c-gold); transform: translateY(-50%); }
.course__goal::after { content: ""; position: absolute; inset: 4px 5px 5px; border-radius: 6px 6px 2px 2px; background: var(--c-ink); }
.course--sheet { position: relative; inset: auto; margin: 22px 14px 10px 6px; height: 16px; }
.hint { position: absolute; z-index: 3; left: 50%; top: calc(112px + var(--safe-top)); max-width: calc(100% - 24px); padding: 8px 20px; border: 3px solid var(--c-ink); border-radius: 18px; background: var(--c-paper); box-shadow: 0 5px 0 var(--c-ink); font-size: clamp(17px, 4.6vmin, 24px); font-weight: 900; text-align: center; width: max-content; opacity: 0; pointer-events: none; transform: translateX(-50%) scale(.85); transition: opacity .15s, transform .25s var(--ease-pop); }
.hint.is-show { opacity: 1; transform: translateX(-50%); }
.caster { position: absolute; z-index: 3; left: calc(12px + var(--safe-left)); bottom: calc(14px + var(--safe-bottom)); max-width: calc(100% - 24px); display: flex; align-items: stretch; border: 3px solid var(--c-ink); border-radius: 14px; background: var(--c-paper); box-shadow: 0 4px 0 var(--c-ink); overflow: hidden; font-weight: 900; opacity: 0; pointer-events: none; transform: translateX(-24px); transition: opacity .15s, transform .25s var(--ease-pop); }
.caster.is-show { opacity: 1; transform: none; }
.caster__mark { display: grid; place-items: center; padding: 0 10px; background: var(--c-red); color: #fff; font-size: 13px; white-space: nowrap; }
.caster__text { padding: 6px 14px; font-size: clamp(14px, 4vmin, 18px); }
.ready { position: absolute; z-index: 4; left: 50%; top: 40%; color: #fff; font-size: clamp(30px, 9vmin, 64px); font-weight: 900; white-space: nowrap; -webkit-text-stroke: 8px var(--c-ink); paint-order: stroke fill; opacity: 0; pointer-events: none; transform: translate(-50%, -50%) scale(.7); transition: opacity .15s, transform .3s var(--ease-pop); }
.ready b { color: var(--c-gold); } .ready.is-show { opacity: 1; transform: translate(-50%, -50%) rotate(-3deg); }
.flash { position: absolute; inset: 0; z-index: 1; opacity: 0; pointer-events: none; box-shadow: inset 0 0 60px 14px var(--c-gold); }
.flash.is-perfect { animation: flash .3s ease-out; } @keyframes flash { from { opacity: .85; } to { opacity: 0; } }

/* ---------- シート・モーダル ---------- */
.card { width: min(100%, 400px); padding: 18px 18px 22px; border: 3px solid var(--c-ink); border-radius: 26px; background: var(--c-paper); box-shadow: 0 7px 0 var(--c-ink); text-align: center; }
.card__title { margin: 0 0 14px; font-size: 24px; font-weight: 900; }
.card__actions { display: grid; gap: 18px; }
.sheet, .modal { position: absolute; inset: 0; z-index: 20; display: flex; padding: calc(14px + var(--safe-top)) calc(14px + var(--safe-right)) calc(20px + var(--safe-bottom)) calc(14px + var(--safe-left)); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s, visibility 0s linear .2s; }
.sheet.is-open, .modal.is-open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .2s; }
.modal { align-items: center; justify-content: center; background: rgba(27,32,80,.6); }
.sheet { align-items: flex-end; justify-content: center; }
.sheet .card { position: relative; max-height: 100%; }
.sheet.is-open .card { animation: rise .4s var(--ease-pop) both; } .modal.is-open .card { animation: pop .3s var(--ease-pop) both; }
@keyframes rise { from { transform: translateY(60px); opacity: 0; } } @keyframes pop { from { transform: scale(.85); opacity: 0; } }
.sheet--clear .card { padding-top: 28px; }
.sheet__label { margin: 0; font-size: 16px; font-weight: 900; color: var(--c-ink-sub); }
.sheet__big { margin: 0; font-size: 26px; font-weight: 900; line-height: 1.35; } .sheet__big .num { margin: 0 3px; font-size: 38px; color: var(--c-red); }
.sheet__note { margin: 2px 0 14px; font-size: 14px; font-weight: 800; color: var(--c-ink-sub); }
.sheet__ribbon { position: absolute; left: 50%; top: -22px; padding: 3px 26px; border: 3px solid var(--c-ink); border-radius: 10px; background: linear-gradient(#ffe48a, var(--c-gold)); box-shadow: 0 4px 0 var(--c-ink); font-size: 18px; font-weight: 900; white-space: nowrap; transform: translateX(-50%) rotate(-2deg); }
.badge-new { display: inline-block; padding: 1px 10px; border: 2px solid var(--c-ink); border-radius: 99px; background: var(--c-red); color: #fff; font-size: 13px; vertical-align: middle; transform: rotate(4deg); }
.goals { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 8px; margin: 6px 0; padding: 0; list-style: none; font-size: 12px; font-weight: 800; }
.goals li { padding: 1px 10px; border: 2px solid #cfc3ae; border-radius: 99px; color: #a2947f; } .goals li.is-done { border-color: var(--c-ink); background: #fff2c4; color: var(--c-ink); }

/* ---------- エンディング ---------- */
.screen--ending { align-items: center; justify-content: space-between; text-align: center; cursor: pointer; }
.ending__text { margin-top: 9vh; }
.ending__title { margin: 0; color: var(--c-gold); font-size: clamp(34px, 10vmin, 72px); font-weight: 900; line-height: 1.2; -webkit-text-stroke: 8px var(--c-ink); paint-order: stroke fill; animation: pop .6s var(--ease-pop) both; }
.ending__time { display: inline-block; margin: 12px 0 0; padding: 4px 22px; border: 3px solid var(--c-ink); border-radius: 99px; background: var(--c-paper); box-shadow: 0 5px 0 var(--c-ink); font-size: 20px; font-weight: 900; }
.ending__skip { margin: 0; padding: 2px 14px; border-radius: 99px; background: rgba(27,20,56,.6); color: #fff; font-size: 14px; font-weight: 800; }
.toast { position: absolute; z-index: 40; left: 50%; bottom: calc(90px + var(--safe-bottom)); padding: 8px 20px; border: 3px solid var(--c-ink); border-radius: 99px; background: var(--c-paper); font-weight: 800; white-space: nowrap; transform: translateX(-50%); }

/* ---------- 横長 ---------- */
@media (min-width: 700px) and (orientation: landscape) {
  .stages { grid-template-columns: repeat(3, 1fr); max-width: 980px; }
  .stage-card { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto auto auto; padding: 0 0 12px; justify-items: center; row-gap: 2px; align-content: stretch; }
  .stage-card__pic { grid-row: 1; border-right: 0; border-bottom: 3px solid var(--c-ink); aspect-ratio: 16 / 10; height: auto; min-height: 0; max-height: 44vh; }
  .stage-card__name, .stage-card__best, .stage-card__lock, .stage-card > .stars { grid-column: 1; }
  .course { left: calc(330px + var(--safe-left)); right: calc(90px + var(--safe-right)); top: calc(25px + var(--safe-top)); }
  .course--sheet { left: auto; right: auto; top: auto; }
  .hud__combo { top: calc(62px + var(--safe-top)); } .hint { top: calc(66px + var(--safe-top)); }
}
@media (max-height: 520px) and (orientation: landscape) {
  .screen--title { display: grid; grid-template-columns: auto auto; justify-content: center; align-content: center; column-gap: 36px; }
  .logo { grid-row: 1 / 3; grid-column: 1; align-self: center; --fs: clamp(40px, min(8vw, 17vh), 78px); } .title__scene { grid-column: 2; width: min(38vw, 320px); max-height: 38vh; } .title__actions { grid-column: 2; width: min(38vw, 320px); }
  .sheet { justify-content: flex-end; align-items: center; } .sheet .card { width: min(46vw, 380px); padding: 20px 16px 16px; }
  .sheet__big { font-size: 20px; } .sheet__big .num { font-size: 28px; } .stars--big .star { width: 38px; height: 38px; } .sheet .btn--block { min-height: 46px; } .card__actions { gap: 10px; } .sheet__note { margin-bottom: 8px; } .sheet__ribbon { top: -12px; font-size: 14px; } .course--sheet { margin-top: 18px; }
  .caster { bottom: calc(8px + var(--safe-bottom)); }
}
@media (max-width: 380px) { .hud { gap: 5px; } .hud__time { min-width: 72px; font-size: 20px; padding: 0 6px; } .hud__lives { padding: 0 6px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } .flash.is-perfect { animation: none; } }

.ending__foot { display: flex; align-items: center; justify-content: center; gap: 16px; }
.app:has(.sheet.is-open) .hud__combo { visibility: hidden; }
@media (orientation: landscape) { .sheet { justify-content: flex-end; align-items: center; padding-right: calc(5vw + var(--safe-right)); } }
@media (max-height: 520px) and (orientation: landscape) {
  .sheet { padding-right: calc(14px + var(--safe-right)); }
  .sheet--clear .card { padding-top: 32px; margin-top: 12px; }
  .ending__text { margin-top: 0; } .ending__title { font-size: 30px; } .ending__time { margin-top: 2px; font-size: 16px; }
}

.hint, .hint.is-show { left: 0; right: 0; width: 100%; max-width: none; top: calc(84px + var(--safe-top)); padding: 7px 12px; border-width: 3px 0; border-radius: 0; background: var(--c-paper); box-shadow: 0 3px 0 rgba(59,47,47,.35); text-align: center; transform: none; }
.hud__combo { top: calc(136px + var(--safe-top)); }
.sheet__reason { margin: 2px 0; font-size: 19px; font-weight: 900; color: var(--c-red); }
.sheet__next { margin: -8px 0 12px; font-size: 14px; font-weight: 900; color: var(--c-sky-deep); }
.stage-card__ribbon.is-gold { background: linear-gradient(100deg, #fff3b0, #ffb700, #fff3b0); color: #8a3a00; }
@media (orientation: portrait) { .caster { top: var(--gy, 70vh); bottom: auto; } .caster__text { font-size: clamp(17px, 5vmin, 22px); } }
@media (min-width: 700px) and (orientation: landscape) {
  .hint, .hint.is-show { top: calc(58px + var(--safe-top)); left: 50%; right: auto; width: auto; min-width: 360px; border-width: 3px; border-radius: 14px; transform: translateX(-50%); }
  .hud__combo { left: calc(12px + var(--safe-left)); top: calc(62px + var(--safe-top)); transform: none; }
}
@media (max-height: 520px) and (orientation: landscape) { .sheet__next { margin: -4px 0 6px; font-size: 12px; } .sheet__reason { font-size: 15px; margin: 0; } .sheet__label { line-height: 1.2; } .sheet__note { margin-bottom: 6px; } }

.app:has(.sheet.is-open) .hud, .app:has(.sheet.is-open) .screen--play > .course { visibility: hidden; }

.ready { text-align: center; }
.ready small { display: block; font-size: .4em; -webkit-text-stroke-width: 6px; }
@media (orientation: portrait) and (max-height: 700px) {
  .sheet--clear .card { padding: 20px 14px 18px; } .sheet--clear .stars--big .star { width: 40px; height: 40px; }
  .sheet--clear .sheet__big { line-height: 1.1; } .sheet--clear .sheet__note { margin-bottom: 10px; } .sheet--clear .card__actions { gap: 12px; } .sheet--clear .btn--block { min-height: 48px; } .sheet--clear .goals { margin: 3px 0; }
}
