/* おかいものクエスト style.css — 構造とクラス名は docs/design.md を参照 */

:root {
  --c-ink: #3b2f2f;
  --c-ink-sub: #7a6a5e;
  --c-paper: #fffdf7;
  --c-cream: #fff4dc;
  --c-line: #eadcc0;
  --c-red: #e8413b;
  --c-red-deep: #b8302c;
  --c-green: #3fa66a;
  --c-green-deep: #2b7a4b;
  --c-orange: #ff8a3d;
  --c-orange-deep: #d9651c;
  --c-gold: #ffc83d;
  --c-gold-deep: #d99a00;
  --c-blue: #4fa8ff;
  --c-blue-deep: #2a6fc0;
  --c-lock: #a7a9b8;
  --c-bg: #ffe9b8;
  --c-bg-stripe: #ffdf9c;

  --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-s: 12px;
  --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);

  --list-w: clamp(180px, 26vw, 260px); /* 横画面のリスト幅 */
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  word-break: auto-phrase;
  font-family: var(--font-base);
  color: var(--c-ink);
  background: var(--c-bg);
  -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: fixed;
  inset: 0;
  overflow: hidden;
  background:
    repeating-linear-gradient(135deg, var(--c-bg) 0 22px, var(--c-bg-stripe) 22px 44px);
}

/* ---------- 画面切替 ---------- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: calc(16px + 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;
  transform: translateY(12px);
  transition: opacity var(--dur-mid) ease, transform var(--dur-mid) ease, visibility 0s linear var(--dur-mid);
  overflow-y: auto;
  touch-action: pan-y;
}
.screen.is-active {
  opacity: 1; visibility: visible; pointer-events: auto; transform: none;
  transition: opacity var(--dur-mid) ease, transform var(--dur-mid) ease, visibility 0s;
}
.screen > * { flex-shrink: 0; }

/* ---------- ボタン（押すと沈む） ---------- */
.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: 12px 28px;
  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: 0.04em;
  cursor: pointer;
  box-shadow: 0 var(--btn-depth) 0 var(--btn-edge), 0 var(--btn-depth) 0 3px var(--c-ink);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter var(--dur-fast);
  margin-bottom: var(--btn-depth);
}
.btn::after {
  content: ""; position: absolute; top: 5px; left: 18%; right: 18%; height: 6px;
  border-radius: 999px; background: rgba(255, 255, 255, 0.35); pointer-events: none;
}
.btn:hover { filter: brightness(1.05); }
.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:disabled { filter: grayscale(0.8) opacity(0.6); cursor: not-allowed; }
.btn--block { display: flex; width: 100%; }
.btn--green { --btn-bg: var(--c-green); --btn-edge: var(--c-green-deep); }
.btn--orange { --btn-bg: var(--c-orange); --btn-edge: var(--c-orange-deep); }
.btn--blue { --btn-bg: var(--c-blue); --btn-edge: var(--c-blue-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: 40px; padding: 6px 16px; font-size: 15px; --btn-depth: 4px; }

.icon-btn {
  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: 18px; font-weight: 900; line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--c-ink);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.icon-btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--c-ink); }
.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--back::before { content: "‹"; font-size: 26px; margin-top: -3px; }
.btn:focus-visible, .icon-btn:focus-visible, .store-card:focus-visible, .shoplist__toggle:focus-visible, .get-btn:focus-visible {
  outline: 4px solid var(--c-blue); outline-offset: 4px;
}

/* ---------- 星 ---------- */
.star {
  display: inline-block; width: 18px; height: 18px;
  background: var(--c-line);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.star.is-on { background: var(--c-gold); }

/* ---------- 吹き出し・カード ---------- */
.card {
  width: min(100%, 380px);
  padding: 20px 18px 22px;
  border: 3px solid var(--c-ink);
  border-radius: var(--radius-l);
  background: var(--c-paper);
  box-shadow: 0 8px 0 var(--c-ink);
  text-align: center;
}
.card__title { margin: 0 0 12px; font-size: 22px; font-weight: 900; }
.card__sub { margin: -6px 0 14px; color: var(--c-ink-sub); font-size: 13px; }
.card__actions { display: flex; flex-direction: column; gap: 12px; }

/* ---------- タイトル ---------- */
.screen--title { align-items: center; justify-content: center; gap: 14px; text-align: center; }
.logo { margin: 0; font-weight: 900; line-height: 1.05; }
.logo__sub {
  display: inline-block; padding: 2px 14px;
  border: 3px solid var(--c-ink); border-radius: 999px;
  background: var(--c-green); color: #fff;
  font-size: clamp(14px, 3.6vmin, 19px);
  transform: rotate(-3deg);
}
.logo__main {
  display: flex; flex-direction: column; align-items: center;
  margin-top: 8px;
  font-size: clamp(36px, 10.5vmin, 64px);
}
.logo__row { display: flex; gap: 2px; }
.logo__char {
  display: inline-block;
  color: var(--c-paper);
  -webkit-text-stroke: 3px var(--c-ink);
  paint-order: stroke fill;
  text-shadow: 0 5px 0 var(--c-ink);
  animation: hop 2.2s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.1s);
}
.logo__char--red { color: var(--c-red); }
.logo__char--orange { color: var(--c-orange); }
.logo__char--green { color: #5fd18a; }
.logo__char--gold { color: var(--c-gold); }
.logo__char--blue { color: #7cc4ff; }
@keyframes hop {
  0%, 55%, 100% { transform: translateY(0) scale(1, 1); }
  62% { transform: translateY(2px) scale(1.08, 0.9); }
  72% { transform: translateY(-12px) scale(0.95, 1.06); }
  84% { transform: translateY(0) scale(1.05, 0.95); }
}
.title__scene {
  width: min(72vw, 300px, 34vh); height: auto; aspect-ratio: 1;
  border: 3px solid var(--c-ink); border-radius: var(--radius-l);
  background: var(--c-paper); box-shadow: 0 6px 0 var(--c-ink);
}
.title__actions { display: flex; flex-direction: column; gap: 10px; width: min(80vw, 320px); }
.title__note { margin: 0; font-size: 12px; color: var(--c-ink-sub); }

/* 横画面: ロゴ・絵 | ボタン */
@media (orientation: landscape) and (max-height: 560px) {
  .screen--title { flex-direction: row; flex-wrap: wrap; align-content: center; gap: 12px 32px; }
  .screen--title .logo { width: 100%; }
  .logo__main { flex-direction: row; justify-content: center; gap: 8px; font-size: clamp(30px, 9vh, 52px); }
  .title__scene { width: min(36vh, 200px); }
  .title__actions { width: min(40vw, 300px); }
}

/* ---------- モーダル（ルール・ポーズ） ---------- */
.modal {
  position: absolute; inset: 0; z-index: 20;
  display: grid; place-items: center;
  padding: calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));
  background: rgba(59, 47, 47, 0.55);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--dur-mid) ease, visibility 0s linear var(--dur-mid);
  overflow-y: auto;
}
.modal.is-open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity var(--dur-mid) ease, visibility 0s; }
.modal.is-open .card { animation: pop-in var(--dur-mid) var(--ease-pop) both; }
@keyframes pop-in { from { transform: scale(0.85); opacity: 0; } to { transform: none; opacity: 1; } }
.card--pause .card__title { font-size: 26px; }

/* 初回ルール */
.rules { display: grid; gap: 10px; margin: 0 0 16px; padding: 0; list-style: none; text-align: left; }
.rules__item {
  display: grid; grid-template-columns: 56px 1fr; align-items: center; gap: 12px;
  padding: 8px 10px;
  border: 3px solid var(--c-ink); border-radius: var(--radius-m);
  background: #fff;
}
.rules__pic { width: 56px; height: 56px; border: 2px solid var(--c-ink); border-radius: 12px; background: var(--c-cream); }
.rules__text { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.45; }
.rules__text b { color: var(--c-red); }
.rules__key {
  display: inline-block; padding: 0 8px; border: 2px solid var(--c-ink); border-radius: 8px;
  background: var(--c-gold); font-size: 12px; font-weight: 900;
}
@media (orientation: landscape) and (max-height: 560px) {
  .card--rules { width: min(100%, 680px); }
  .card--rules .rules { grid-template-columns: 1fr 1fr; }
}

/* ---------- 店えらび ---------- */
.screen--stores { gap: 12px; }
.stores__head { display: flex; align-items: center; gap: 10px; }
.stores__title {
  flex: 1; margin: 0; font-size: 20px; font-weight: 900; white-space: nowrap;
  color: var(--c-ink);
}
.stores__total {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 12px;
  border: 3px solid var(--c-ink); border-radius: 999px; background: var(--c-paper); font-size: 15px;
}
.stores__list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px;
  margin: 0; padding: 0 0 12px; list-style: none;
}
.store-card {
  --store-color: var(--c-red);
  position: relative; width: 100%;
  display: grid; grid-template-columns: 76px 1fr auto; grid-template-rows: auto auto auto; align-items: center; column-gap: 12px;
  padding: 10px 14px 10px 10px;
  border: 3px solid var(--c-ink); border-radius: var(--radius-m);
  background: var(--c-paper); text-align: left; cursor: pointer;
  box-shadow: 0 5px 0 var(--c-ink);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  animation: card-in 0.4s var(--ease-pop) both; animation-delay: calc(var(--i, 0) * 0.05s);
}
.store-card:active { transform: translateY(5px); box-shadow: 0 0 0 var(--c-ink); }
@keyframes card-in { from { transform: translateY(14px); opacity: 0; } }
.store-card__pic {
  grid-row: 1 / 4; width: 76px; height: 64px;
  border: 2px solid var(--c-ink); border-radius: 10px;
  background: color-mix(in srgb, var(--store-color) 22%, #fff);
}
.store-card__num {
  position: absolute; top: -10px; left: -8px;
  display: grid; place-items: center; width: 30px; height: 30px;
  border: 3px solid var(--c-ink); border-radius: 50%; background: var(--store-color); color: #fff; font-size: 15px;
}
.store-card__name { grid-column: 2 / 4; font-size: 17px; font-weight: 900; line-height: 1.25; }
.store-card__meta { grid-column: 2; font-size: 12px; color: var(--c-ink-sub); font-weight: 700; }
.store-card__stars { grid-column: 3; grid-row: 2 / 4; display: flex; gap: 2px; }
.store-card__stars .star { width: 20px; height: 20px; }
.store-card__best { grid-column: 2; font-size: 13px; font-weight: 800; }
.store-card__best .num { font-size: 16px; }
.store-card__badge {
  position: absolute; top: -10px; right: 10px; padding: 0 8px;
  border: 2px solid var(--c-ink); border-radius: 999px; background: var(--c-gold); font-size: 11px; font-weight: 900;
}
.store-card.is-locked { cursor: not-allowed; background: #ecebe6; box-shadow: 0 5px 0 var(--c-lock); border-color: var(--c-lock); }
.store-card.is-locked:active { transform: none; box-shadow: 0 5px 0 var(--c-lock); }
.store-card.is-locked .store-card__pic { filter: grayscale(1) opacity(0.5); }
.store-card.is-locked .store-card__name, .store-card.is-locked .store-card__meta { color: var(--c-lock); }
.store-card.is-locked .store-card__stars, .store-card.is-locked .store-card__best { visibility: hidden; }
.store-card.is-locked::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 22px; height: 18px; margin-top: -4px;
  border: 3px solid var(--c-lock); border-radius: 4px; background: #fff;
}
.store-card.is-locked::before {
  content: ""; position: absolute; right: 20px; top: 50%; width: 14px; height: 14px; margin-top: -16px;
  border: 3px solid var(--c-lock); border-bottom: 0; border-radius: 8px 8px 0 0;
}
.store-card__lock-note { grid-column: 2 / 4; font-size: 11px; color: var(--c-lock); font-weight: 800; }

/* ---------- プレイ ---------- */
.screen--play { padding: 0; overflow: hidden; touch-action: none; background: #333; }
.play__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hud {
  position: absolute; inset: 0; pointer-events: none;
  padding: calc(8px + var(--safe-top)) calc(8px + var(--safe-right)) calc(8px + var(--safe-bottom)) calc(8px + var(--safe-left));
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr;
  gap: 8px;
}
.hud > * { pointer-events: auto; }
.hud__top { grid-column: 2; grid-row: 1; display: flex; align-items: flex-start; gap: 8px; }
.hud__chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 4px 14px;
  border: 3px solid var(--c-ink); border-radius: 999px;
  background: var(--c-paper); box-shadow: 0 4px 0 var(--c-ink);
  font-weight: 900;
}
.hud__timer .num { font-size: 22px; min-width: 3.6em; text-align: right; }
.hud__timer.is-penalty { animation: penalty 0.5s ease; background: #ffe0dc; }
@keyframes penalty { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.hud__penalty { color: var(--c-red); font-size: 13px; }
.hud__cart { background: #dff0ff; font-size: 13px; }

/* 買い物リスト（縦: 上 / 横: 左） */
.shoplist {
  grid-column: 1; grid-row: 1;
  justify-self: start; width: min(100%, 520px);
  border: 3px solid var(--c-ink); border-radius: var(--radius-m);
  background: var(--c-paper); box-shadow: 0 4px 0 var(--c-ink);
  overflow: hidden;
}
.shoplist__toggle {
  display: flex; align-items: center; gap: 8px; width: 100%;
  min-height: 40px; padding: 4px 12px;
  border: 0; border-bottom: 3px solid var(--c-ink);
  background: var(--c-gold); font-weight: 900; font-size: 15px; cursor: pointer; text-align: left;
}
.shoplist__count { margin-left: auto; font-size: 16px; }
.shoplist__toggle::after {
  content: ""; width: 10px; height: 10px; border-right: 3px solid var(--c-ink); border-bottom: 3px solid var(--c-ink);
  transform: rotate(-135deg) translate(-2px, -2px); transition: transform var(--dur-fast);
}
.shoplist.is-collapsed .shoplist__toggle { border-bottom: 0; }
.shoplist.is-collapsed .shoplist__toggle::after { transform: rotate(45deg); }
.shoplist.is-collapsed .shoplist__items { display: none; }
.shoplist__items {
  display: flex; flex-wrap: wrap; gap: 4px 6px;
  margin: 0; padding: 6px 8px 8px; list-style: none;
  max-height: 30vh; overflow-y: auto;
}
.shoplist__item {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px 2px 4px;
  border: 2px solid var(--c-ink); border-radius: 999px;
  background: #fff; font-size: 14px; font-weight: 800; line-height: 1.3;
}
.shoplist__icon { width: 26px; height: 26px; flex: none; }
.shoplist__check {
  position: relative; width: 18px; height: 18px; flex: none;
  border: 2px solid var(--c-ink); border-radius: 5px; background: #fff;
}
.shoplist__item.is-got { background: #e3f6e9; color: var(--c-ink-sub); }
.shoplist__item.is-got .shoplist__name { text-decoration: line-through 2px; }
.shoplist__item.is-got .shoplist__check { background: var(--c-green); }
.shoplist__item.is-got .shoplist__check::after {
  content: ""; position: absolute; left: 4px; top: 0; width: 5px; height: 10px;
  border-right: 3px solid #fff; border-bottom: 3px solid #fff; transform: rotate(40deg);
}
.shoplist__item.is-just { animation: got 0.5s var(--ease-pop); }
@keyframes got { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
.shoplist__goal { width: 100%; margin: 2px 0 0; font-size: 12px; font-weight: 800; color: var(--c-red-deep); }

@media (orientation: landscape) {
  .hud { grid-template-columns: var(--list-w) 1fr auto; grid-template-rows: auto 1fr; }
  .shoplist { grid-column: 1; grid-row: 1 / 3; align-self: start; width: 100%; max-height: 100%; display: flex; flex-direction: column; }
  .shoplist__items { flex-direction: column; flex-wrap: nowrap; max-height: none; overflow-y: auto; }
  .shoplist__item { border-radius: 10px; }
  .hud__top { grid-column: 3; }
}

/* プレイ中の通知（「まだ 2こ たりないよ」等） */
.play__toast {
  position: absolute; left: 50%; top: 38%; z-index: 4;
  padding: 8px 18px; border: 3px solid var(--c-ink); border-radius: 999px;
  background: var(--c-paper); box-shadow: 0 4px 0 var(--c-ink);
  font-size: 17px; font-weight: 900; white-space: nowrap;
  transform: translate(-50%, 8px); opacity: 0; pointer-events: none;
  transition: opacity var(--dur-fast), transform var(--dur-fast) var(--ease-pop);
}
.play__toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.play__toast--bad { background: #ffe0dc; color: var(--c-red-deep); }
.play__hint {
  position: absolute; left: 50%; bottom: calc(18px + var(--safe-bottom)); transform: translateX(-50%);
  margin: 0; padding: 4px 14px; border-radius: 999px; background: rgba(59, 47, 47, 0.75); color: #fff;
  font-size: 13px; font-weight: 800; white-space: nowrap; pointer-events: none;
}

/* スマホ操作（タッチ端末のみ表示。JS で .is-touch を .app に付けてもよい） */
.pad { display: none; }
@media (hover: none) and (pointer: coarse) { .pad { display: block; } .play__hint { display: none; } }
.app.is-touch .pad { display: block; }
.stick {
  position: absolute; left: calc(18px + var(--safe-left)); bottom: calc(18px + var(--safe-bottom)); z-index: 3;
  width: 132px; height: 132px; border-radius: 50%;
  border: 3px solid var(--c-ink); background: rgba(255, 253, 247, 0.55);
  touch-action: none;
}
.stick::before {
  content: ""; position: absolute; inset: 18px; border-radius: 50%; border: 2px dashed rgba(59, 47, 47, 0.35);
}
.stick__knob {
  position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px;
  border: 3px solid var(--c-ink); border-radius: 50%;
  background: var(--c-paper); box-shadow: 0 4px 0 var(--c-ink);
  transform: translate(calc(var(--sx, 0) * 36px), calc(var(--sy, 0) * 36px));
}
.stick.is-active .stick__knob { background: var(--c-gold); }
.get-btn {
  position: absolute; right: calc(18px + var(--safe-right)); bottom: calc(24px + var(--safe-bottom)); z-index: 3;
  width: 112px; height: 112px; padding: 0;
  border: 4px solid var(--c-ink); border-radius: 50%;
  background: var(--c-red); color: #fff;
  font-size: 24px; font-weight: 900; letter-spacing: 0.02em;
  -webkit-text-stroke: 1px var(--c-ink); paint-order: stroke fill;
  box-shadow: 0 8px 0 var(--c-red-deep), 0 8px 0 4px var(--c-ink);
  touch-action: none; cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}
.get-btn.is-ready { background: var(--c-orange); animation: ready 0.9s ease-in-out infinite; }
.get-btn:active, .get-btn.is-pressed { transform: translateY(8px); box-shadow: 0 0 0 var(--c-red-deep), 0 0 0 4px var(--c-ink); animation: none; }
.get-btn__sub { display: block; font-size: 11px; -webkit-text-stroke: 0; margin-top: -2px; }
@keyframes ready { 50% { filter: brightness(1.12); transform: scale(1.04); } }
@media (orientation: landscape) and (max-height: 500px) {
  .stick { width: 112px; height: 112px; left: calc(var(--list-w) + 24px + var(--safe-left)); }
  .stick__knob { width: 52px; height: 52px; margin: -26px 0 0 -26px; transform: translate(calc(var(--sx, 0) * 30px), calc(var(--sy, 0) * 30px)); }
  .get-btn { width: 96px; height: 96px; font-size: 21px; }
}

/* ---------- 結果 ---------- */
.screen--result {
  align-items: center; justify-content: center; gap: 12px; text-align: center;
  background: rgba(59, 47, 47, 0.6); z-index: 5;
}
.result__card { width: min(100%, 400px); padding: 0 18px 20px; overflow: visible; }
.result__ribbon {
  margin: -18px -30px 10px; padding: 8px 12px;
  border: 3px solid var(--c-ink); border-radius: 14px;
  background: var(--c-red); color: #fff; font-size: 22px; font-weight: 900;
  box-shadow: 0 4px 0 var(--c-ink);
}
.result__store { margin: 0; font-size: 14px; font-weight: 800; color: var(--c-ink-sub); }
.result__time { margin: 2px 0 0; font-size: 15px; font-weight: 900; }
.result__time .num { font-size: 52px; line-height: 1.05; }
.result__penalty { display: block; font-size: 12px; color: var(--c-red-deep); font-weight: 800; }
.result__stars { display: flex; align-items: flex-end; justify-content: center; gap: 6px; margin: 8px 0 4px; }
.result__stars .star { width: 50px; height: 50px; }
.result__stars .star:nth-child(2) { width: 64px; height: 64px; }
.result__stars .star.is-on { animation: star-pop 0.5s var(--ease-pop) both; animation-delay: calc(0.25s + var(--i, 0) * 0.22s); }
@keyframes star-pop { 0% { transform: scale(0) rotate(-40deg); } 70% { transform: scale(1.25) rotate(8deg); } 100% { transform: none; } }
.result__new {
  display: inline-block; margin: 2px 0; padding: 2px 14px;
  border: 3px solid var(--c-ink); border-radius: 999px; background: var(--c-gold);
  font-weight: 900; transform: rotate(-3deg);
  animation: new-bounce 1s var(--ease-pop) infinite alternate;
}
@keyframes new-bounce { to { transform: rotate(3deg) scale(1.06); } }
.result__best { margin: 0; font-size: 13px; font-weight: 800; color: var(--c-ink-sub); }
.result__next-star {
  margin: 6px 0 0; padding: 6px 10px;
  border: 2px dashed var(--c-ink); border-radius: 12px; background: #fff7dc;
  font-size: 14px; font-weight: 800;
}
.result__next-star .num { color: var(--c-red); font-size: 18px; }
.result__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.result__actions .btn--next { grid-column: 1 / 3; }
.result__share { --btn-bg: var(--c-blue); --btn-edge: var(--c-blue-deep); }
@media (orientation: landscape) and (max-height: 560px) {
  .result__card {
    width: min(100%, 640px);
    display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; align-items: center;
  }
  .result__ribbon { grid-column: 1 / 3; }
  .result__summary { grid-column: 1; }
  .result__actions { grid-column: 2; margin-top: 0; }
  .result__time .num { font-size: 40px; }
  .result__stars .star { width: 38px; height: 38px; }
  .result__stars .star:nth-child(2) { width: 48px; height: 48px; }
}

/* ---------- 小さい画面 ---------- */
@media (max-height: 640px) and (orientation: portrait) {
  .title__scene { display: none; }
  .btn { min-height: 48px; font-size: 18px; }
}

/* ---------- ゲーム一覧へ戻る（himaratsu.com/games/ 配下のときだけ表示） ---------- */
.back-to-games {
  position: absolute; top: calc(10px + var(--safe-top)); left: calc(10px + var(--safe-left)); z-index: 2;
  padding: 2px 12px; border: 2px solid var(--c-ink); border-radius: 999px; background: var(--c-paper);
  font-size: 12px; font-weight: 800; color: var(--c-ink); text-decoration: none;
}

/* ---------- 動きを減らす ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .logo__char, .result__new, .get-btn.is-ready, .store-card, .hud__timer.is-penalty { animation: none !important; }
  .screen { transform: none; }
}
