/* Renban Games #000 トップ（2026-10-12 作り直し）
   方向: 「番号札の発券機」。連番＝数字が回って増えていく、羊が番号札をつけて並ぶ、ゲームは1枚ずつの切符。
   主役は1つだけ: 入口のカウンター（#000 → いまの本数へ数字が回る）。ほかは静かに、押したときだけ大きく返す。
   スマホの縦画面が主（360〜430）。広い画面では中央にスマホ幅の画面、周りは群青の台紙に大きな番号。
   外のフォント・画像・スクリプトは使わない（CSP: style-src 'self' / img-src 'self'）。数字は端末の細身の字（DIN / Bahnschrift）。 */

:root {
  color-scheme: light dark;

  --blue: #2B3BD1;        /* 群青（ブランドの番号のインク） */
  --blue-deep: #1C27A0;
  --blue-ink: #2B3BD1;    /* 地の上で文字に使う群青 */
  --sun: #FFC83D;         /* 遊ぶボタン・王冠 */
  --sun-deep: #D99A0B;
  --grass: #2F9E5B;       /* 増えた・上がった */
  --scarf: #E5483A;       /* NEW（ひつじかくれんぼの赤いスカーフ） */
  --silver: #B9C2D6;
  --bronze: #D9925B;

  --paper: #EFF3EC;       /* 地紙（切符の淡い緑がかった灰） */
  --card: #FFFFFF;
  --ink: #18203D;
  --ink-soft: #4C5574;
  --line: #D5DCD2;
  --shadow: 0 1px 0 rgba(24, 32, 61, .06), 0 10px 24px -12px rgba(24, 32, 61, .28);

  --f-jp: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", "Yu Gothic UI", "Yu Gothic", YuGothic, Meiryo, "Noto Sans JP", "Noto Sans CJK JP", system-ui, sans-serif;
  --f-en: "Avenir Next", "Segoe UI", "Helvetica Neue", Roboto, Arial, var(--f-jp);
  --f-num: "DIN Condensed", "Bahnschrift Condensed", Bahnschrift, "DIN Alternate", "Roboto Condensed", "Arial Narrow", sans-serif;

  --app: 440px;
  --gut: 16px;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --tabs-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --blue: #3445E0;
    --blue-deep: #1A2496;
    --blue-ink: #A3AEFF;
    --paper: #0D1230;
    --card: #182048;
    --ink: #EDF0FA;
    --ink-soft: #A9B2D2;
    --line: #2C3664;
    --silver: #8F9AB8;
    --bronze: #B9774A;
    --grass: #4CC77E;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 28px -14px rgba(0, 0, 0, .8);
  }
}
:root[data-theme="dark"] {
  --blue: #3445E0;
  --blue-deep: #1A2496;
  --blue-ink: #A3AEFF;
  --paper: #0D1230;
  --card: #182048;
  --ink: #EDF0FA;
  --ink-soft: #A9B2D2;
  --line: #2C3664;
  --silver: #8F9AB8;
  --bronze: #B9774A;
  --grass: #4CC77E;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 28px -14px rgba(0, 0, 0, .8);
}

/* ---- 土台 ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 12px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-jp);
  font-size: 1rem;
  line-height: 1.7;
  overflow-wrap: break-word;
  -webkit-tap-highlight-color: transparent;
}
:lang(en) { font-family: var(--f-en); }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 10px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--sun); color: #18203D; padding: .6rem 1rem; border-radius: 12px; font-weight: 800; text-decoration: none;
}
.skip:focus { top: 12px; }

/* 数字の字（Windows の Bahnschrift は wdth で細くする） */
.num, .odo, .no, .pod-rank, .pod-pts, .rk, .val, .t-rank, .t-num, .tab-badge, .stage-num {
  font-family: var(--f-num);
  font-stretch: condensed;
  font-variation-settings: "wdth" 75;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: .01em;
}

/* ---- 台紙（広い画面だけ） ---- */
.stage { display: none; }

.app {
  position: relative;
  max-width: var(--app);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--paper);
  padding-bottom: calc(var(--tabs-h) + 24px + env(safe-area-inset-bottom));
  overflow-x: clip;
}

/* ---- 上の帯 ---- */
.bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) var(--gut) 10px;
  background: var(--blue);
  color: #fff;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.0625rem; letter-spacing: .01em; min-height: 44px; }
.brand img { border-radius: 10px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }
.bar-share {
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer;
  transition: transform .25s var(--spring), background .2s;
}
.bar-share svg { width: 22px; height: 22px; fill: currentColor; }
.bar-share:active { transform: scale(.88); background: rgba(255, 255, 255, .26); }

/* ---- 入口（カウンター） ---- */
.hero {
  position: relative;
  background: var(--blue);
  color: #fff;
  padding: 0 0 64px;
  border-radius: 0 0 32px 32px;
  overflow: hidden;
  isolation: isolate;
}
/* 一番上の大きな1枚（Blender で描いたキービジュアル）。上の空に番号のカウンターを重ね、下は群青へ溶かす */
.kv { position: relative; aspect-ratio: 864 / 1040; overflow: hidden; background: #3F86F0; }
.kv-img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
@media (max-width: 374px) { .kv-img { object-position: 50% 0%; } } /* 狭い画面では絵の空を上に残し、札をカウンターから離す */
.kv::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 11%;
  background: linear-gradient(rgba(43, 59, 209, 0), var(--blue));
  pointer-events: none;
}
.kv-over { position: absolute; left: 0; right: 0; top: 0; padding: 8px var(--gut) 0; z-index: 1; }
.kv-over .counter-label, .kv-over .counter-next { text-shadow: 0 1px 3px rgba(10, 30, 110, .45); }
.kv-over .counter-next { background: rgba(28, 39, 160, .28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-color: rgba(255, 255, 255, .75); }
.hero-text { padding: 0 var(--gut); }
.counter { display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 14px; }
.counter-label { grid-column: 1 / -1; font-size: .875rem; font-weight: 700; opacity: .88; }
.counter-label [lang="en"] { margin-left: .4em; font-weight: 600; opacity: .8; font-size: .8125rem; }
.odo {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 76px; line-height: 1;
  margin: 4px 0 2px;
}
.odo-hash { color: rgba(255, 255, 255, .5); font-size: .62em; margin-right: 2px; align-self: center; }
.odo-d {
  position: relative;
  display: block;
  width: .66em; height: 1.06em;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  color: var(--blue);
  box-shadow: inset 0 -6px 0 rgba(43, 59, 209, .12), 0 6px 0 rgba(0, 0, 0, .18);
}
.odo-d::after { /* 札の真ん中の折り目 */
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: rgba(43, 59, 209, .16);
}
.odo-d { color: rgba(43, 59, 209, .32); }
.odo-d.lit { color: #2B3BD1; }
.odo-strip {
  display: flex; flex-direction: column; align-items: center;
  transform: translateY(calc(var(--d, 0) * -1.06em));
  transition: transform 1.5s cubic-bezier(.2, .9, .25, 1.12);
  transition-delay: var(--delay, 0s);
}
.odo-strip > span { display: block; height: 1.06em; line-height: 1.12em; }
.counter-next {
  align-self: center;
  justify-self: start;
  display: inline-flex; flex-direction: column;
  padding: 8px 12px;
  border: 2px dashed rgba(255, 255, 255, .5);
  border-radius: 14px;
  font-size: .8125rem; font-weight: 700; line-height: 1.35;
}
.counter-next .num { font-size: 1.75rem; line-height: 1; color: var(--sun); }
.counter-next [lang="en"] { display: block; font-weight: 600; opacity: .85; }
.hero-lead { position: relative; z-index: 1; margin: 6px var(--gut) 0; font-size: .9375rem; font-weight: 700; line-height: 1.6; font-feature-settings: "palt"; }
.hero-lead.en { margin-top: 2px; font-size: .8125rem; font-weight: 500; opacity: .88; }

/* ---- 段 ---- */
.sec { padding: 28px var(--gut) 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sec h2 {
  display: flex; align-items: center; flex-wrap: wrap; column-gap: 8px;
  font-size: 1.3125rem; font-weight: 800; line-height: 1.35; letter-spacing: .02em; font-feature-settings: "palt";
}
.sec h2 .sub { font-size: .8125rem; font-weight: 600; color: var(--ink-soft); letter-spacing: 0; }
.h-ico { width: 26px; height: 26px; flex: none; }
.h-ico.star { fill: var(--sun); }
.h-ico.rise { fill: var(--grass); }
.h-ico.crown { fill: var(--sun); width: 30px; }
.h-ico.trophy { fill: var(--blue-ink); }
.sec-hint { font-size: .8125rem; color: var(--ink-soft); font-weight: 700; white-space: nowrap; }
.sec-hint [lang="en"] { font-weight: 600; margin-left: .3em; }
.note { margin-top: 10px; font-size: .875rem; line-height: 1.65; color: var(--ink-soft); }
.note [lang="en"] { display: block; font-size: .8125rem; }
.more { margin-top: 14px; }

.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 44px; padding: 0 18px;
  border: 2px solid var(--blue-ink); border-radius: 999px;
  background: transparent; color: var(--blue-ink);
  font-weight: 800; font-size: .9375rem; text-decoration: none; cursor: pointer;
  transition: transform .3s var(--spring), background .2s;
}
.pill [lang="en"] { font-weight: 600; font-size: .8125rem; }
.pill:active { transform: scale(.94); }

/* ---- 最新のゲーム（切符のカルーセル） ---- */
.sec-works { margin-top: -52px; position: relative; z-index: 2; padding-top: 0; }
.sec-works .sec-head { color: #fff; padding: 0 2px; }
.sec-works .sec-head .sub, .sec-works .sec-hint { color: rgba(255, 255, 255, .85); }
.deck {
  display: flex; gap: 12px;
  margin: 0 calc(var(--gut) * -1);
  padding: 4px var(--gut) 18px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding: 0 var(--gut);
  scrollbar-width: none;
}
.deck::-webkit-scrollbar { display: none; }
.deck > li { flex: 0 0 86%; scroll-snap-align: start; }
.deck > li:only-child { flex-basis: 100%; }

.p-card { position: relative; }
.p-card-link {
  display: flex; flex-direction: column; height: 100%;
  text-decoration: none; color: var(--ink);
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .35s var(--spring);
}
.p-card-link:active { transform: scale(.975); }
.p-card-img { position: relative; display: block; aspect-ratio: 16 / 10; background: #2F7A3E; overflow: hidden; }
.p-card-img img { width: 100%; height: 100%; object-fit: cover; }
.p-card-img::after { /* 絵の下を少し暗くして番号を読みやすく */
  content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(10, 14, 40, .55));
}
.p-card-no {
  position: absolute; left: 14px; bottom: 6px; z-index: 1;
  color: #fff; font-size: 3.5rem; line-height: 1;
  text-shadow: 0 2px 0 rgba(10, 14, 40, .35);
}
.no .dim { opacity: .55; }
.p-card-no .dim { opacity: .78; }
.p-tags { position: absolute; left: 12px; top: 12px; z-index: 1; display: flex; gap: 6px; }
.p-tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .92); color: #18203D;
  font-size: .75rem; font-weight: 800; line-height: 1.5;
}
.p-tag.new { background: var(--scarf); color: #fff; font-family: var(--f-en); letter-spacing: .04em; animation: wiggle 2.8s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes wiggle { 0%, 86%, 100% { transform: rotate(0); } 90% { transform: rotate(-7deg); } 95% { transform: rotate(6deg); } }

/* 切符の切り取り線（絵と文の境） */
.p-card-body { position: relative; display: flex; flex-direction: column; flex: 1; padding: 16px 18px 18px; }
.p-card-body::before {
  content: ""; position: absolute; left: 18px; right: 18px; top: 0;
  border-top: 2px dashed var(--line);
}
.p-card-title { font-size: 1.25rem; word-break: keep-all; overflow-wrap: anywhere; font-weight: 800; line-height: 1.35; letter-spacing: .02em; font-feature-settings: "palt"; }
.p-card-en { margin-top: 2px; font-size: .8125rem; font-weight: 600; color: var(--ink-soft); }
.p-modes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.p-mode {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px 3px 7px; border-radius: 999px;
  font-size: .8125rem; font-weight: 800; line-height: 1.4;
  background: color-mix(in srgb, var(--mc) 14%, transparent); color: var(--mc-ink, var(--mc));
}
.p-mode svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.p-mode.m-solo { --mc: var(--grass); }
.p-mode.m-friends { --mc: var(--scarf); }
.p-mode.m-rank { --mc: var(--blue-ink); }
.p-mode.m-stream { --mc: #8A3FD1; }
:root[data-theme="dark"] .p-mode.m-stream { --mc: #C79BFF; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .p-mode.m-stream { --mc: #C79BFF; } }
/* 2026-10-14 #005 から: スマホは横向き */
.p-mode.m-landscape { --mc: var(--ink-soft); }
.p-card.small .p-modes { gap: 4px; margin-top: 6px; }
.p-card.small .p-mode { padding: 2px 6px; }
.p-card.small .p-mode span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.p-card-line { margin-top: 10px; font-size: .9375rem; line-height: 1.65; }
.p-card-line.en { margin-top: 4px; font-size: .8125rem; line-height: 1.55; color: var(--ink-soft); }

.p-play {
  margin-top: auto;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px;
  border-radius: 18px;
  background: var(--sun); color: #18203D;
  font-size: 1.125rem; font-weight: 900; letter-spacing: .06em;
  box-shadow: 0 5px 0 var(--sun-deep);
  transform: translateY(0);
  transition: transform .12s ease-out, box-shadow .12s ease-out;
}
.p-card-row { display: flex; align-items: center; gap: 12px; }
.p-card-tb { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.p-card-row .p-play { margin-top: 0; flex: none; flex-direction: column; gap: 0; min-width: 92px; min-height: 60px; padding: 4px 14px; line-height: 1.15; }
.p-card-row .p-play svg { display: none; }
.p-card-row .p-play [lang="en"] { font-size: .75rem; }
.p-card.small .p-card-row { flex-direction: column; align-items: stretch; gap: 8px; }
.p-card.small .p-card-row .p-play { flex-direction: row; gap: 6px; min-height: 44px; }
.p-card.small .p-card-row .p-play svg { display: block; width: 18px; height: 18px; }
.p-play svg { width: 22px; height: 22px; fill: currentColor; }
.p-play [lang="en"] { font-size: .875rem; font-weight: 700; letter-spacing: .02em; opacity: .75; }
.p-card-link:active .p-play { transform: translateY(5px) scale(.98); box-shadow: 0 0 0 var(--sun-deep); }
.p-card-link:hover .p-play { filter: brightness(1.05); }

.p-star {
  position: absolute; right: 10px; top: 10px; z-index: 3;
  width: 46px; height: 46px; display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .94); color: #8A93AE;
  box-shadow: 0 4px 12px -4px rgba(10, 14, 40, .45);
  font-size: 0; cursor: pointer;
  transition: transform .35s var(--spring);
}
.p-star svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.p-star.on { color: var(--sun-deep); }
.p-star.on svg { fill: var(--sun); stroke: var(--sun-deep); }
.p-star:active { transform: scale(.82); }
.p-star.pop { animation: pop .5s var(--spring); }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* 次の番号（まだ空の切符） */
.p-next-box {
  height: 100%; min-height: 320px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 3px dashed var(--line); border-radius: 24px;
  background: color-mix(in srgb, var(--card) 55%, transparent);
  text-align: center; padding: 24px;
}
.p-next-box .no { font-size: 5rem; line-height: 1; color: var(--blue-ink); opacity: .35; }
.p-next-q { width: 72px; height: 60px; color: var(--card); fill: var(--ink-soft); opacity: .45; }
.p-next-text { font-weight: 800; font-size: 1rem; }
.p-next-text [lang="en"] { display: block; font-size: .8125rem; font-weight: 600; color: var(--ink-soft); }

.dots { display: flex; justify-content: center; gap: 6px; margin-top: -4px; }
.dots i { width: 8px; height: 8px; border-radius: 99px; background: var(--line); transition: width .35s var(--spring), background .2s; }
.dots i.on { width: 24px; background: var(--blue-ink); }

/* 最初の1回だけ: 切符が右から配られる */
.deck.deal > li { animation: deal .7s var(--spring) both; }
.deck.deal > li:nth-child(2) { animation-delay: .08s; }
.deck.deal > li:nth-child(3) { animation-delay: .16s; }
@keyframes deal { from { opacity: 0; transform: translateX(60px) rotate(2deg); } to { opacity: 1; transform: none; } }

/* ---- お気に入り ---- */
.favs { display: flex; gap: 10px; overflow-x: auto; margin: 0 calc(var(--gut) * -1); padding: 2px var(--gut) 8px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.favs::-webkit-scrollbar { display: none; }
.favs > li { flex: 0 0 min(64%, 250px); scroll-snap-align: start; }
.p-card.small .p-card-link { border-radius: 18px; }
.p-card.small .p-card-no { font-size: 2.25rem; left: 10px; }
.p-card.small .p-card-body { padding: 10px 12px 12px; }
.p-card.small .p-card-body::before { left: 12px; right: 12px; }
.p-card.small .p-card-title { font-size: 1rem; }
.p-card.small .p-play { min-height: 44px; font-size: 1rem; border-radius: 14px; box-shadow: 0 4px 0 var(--sun-deep); }
.p-card.small .p-card-body .p-play { margin-top: 10px; }
.p-card.small .p-star { width: 44px; height: 44px; right: 6px; top: 6px; }

/* ---- もこの きせかえ（共通のコイン「けだま」の入口。2026-10-17） ---- */
.p-kise {
  display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 12px;
  padding: 10px 14px 10px 8px;
  background: var(--card); border-radius: 22px; box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink);
  transition: transform .3s var(--spring);
}
.p-kise:active { transform: scale(.97); }
.p-kise:focus-visible { outline: 3px solid var(--blue-ink); outline-offset: 3px; }
.p-kise-img { width: 96px; height: 96px; object-fit: contain; display: block; }
.p-kise-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.p-kise-title { font-size: 1.125rem; font-weight: 900; }
.p-kise-title .sub { font-size: .8125rem; font-weight: 600; color: var(--ink-soft); margin-left: .3em; }
.p-kise-line { font-size: .875rem; line-height: 1.55; color: var(--ink-soft); }
.p-kise-coin { display: inline-flex; align-items: center; gap: 5px; font-size: .9375rem; font-weight: 800; }
.p-kise-coin[hidden] { display: none; }
.p-kise-coin img { width: 22px; height: 22px; display: block; }

/* ---- 人気急上昇 ---- */
.trend { display: grid; gap: 10px; }
.t-link {
  display: grid; grid-template-columns: 34px 60px 1fr; align-items: center; gap: 12px;
  padding: 10px 14px 10px 10px;
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink);
  transition: transform .3s var(--spring);
}
.t-link:active { transform: scale(.97); }
.t-rank { font-size: 2rem; line-height: 1; text-align: center; color: var(--blue-ink); }
.t-thumb { width: 60px; height: 60px; border-radius: 14px; overflow: hidden; background: #2F7A3E; }
.t-thumb img { width: 100%; height: 100%; object-fit: cover; }
.t-name { display: block; font-weight: 800; font-size: 1rem; line-height: 1.35; }
.t-name .no { color: var(--ink-soft); margin-right: 4px; font-size: 1.0625rem; }
.t-stat { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 4px; font-size: .8125rem; color: var(--ink-soft); font-weight: 700; }
.t-rise {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 9px 1px 6px; border-radius: 99px;
  background: color-mix(in srgb, var(--grass) 16%, transparent); color: var(--grass);
}
.t-rise svg { width: 16px; height: 16px; fill: currentColor; }
.t-rise .t-num { font-size: 1rem; }

/* ---- いまのRenban王（表彰台） ---- */
.podium {
  display: grid; grid-template-columns: 1fr 1.2fr 1fr; align-items: end; gap: 8px;
  padding: 16px 12px 0;
  border-radius: 24px;
  background: var(--card); box-shadow: var(--shadow);
  overflow: hidden;
  text-align: center;
}
.pod { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.pod-1 { grid-column: 2; grid-row: 1; }
.pod-2 { grid-column: 1; grid-row: 1; }
.pod-3 { grid-column: 3; grid-row: 1; }
.pod-crown { width: 58px; height: 44px; fill: var(--sun); filter: drop-shadow(0 3px 0 var(--sun-deep)); animation: crown 3.2s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes crown { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-4px) rotate(4deg); } }
.pod-cap { margin-top: 2px; font-size: .75rem; font-weight: 700; color: var(--ink-soft); line-height: 1.4; }
.pod-cap [lang="en"] { display: block; font-size: .75rem; font-weight: 600; }
.pod-name { margin-top: 4px; font-weight: 800; font-size: .8125rem; line-height: 1.35; overflow-wrap: anywhere; }
.pod-1 .pod-name { font-size: 1rem; }
.pod-pts { font-size: 1.25rem; line-height: 1.1; color: var(--blue-ink); margin-bottom: 8px; }
.pod-1 .pod-pts { font-size: 1.75rem; }
.pod-pts:empty { display: none; }
.pod-block { width: 100%; border-radius: 14px 14px 0 0; display: grid; place-items: center; color: #18203D; }
.pod-1 .pod-block { height: 84px; background: linear-gradient(var(--sun), color-mix(in srgb, var(--sun) 70%, var(--sun-deep))); }
.pod-2 .pod-block { height: 60px; background: var(--silver); }
.pod-3 .pod-block { height: 44px; background: var(--bronze); }
.pod-rank { font-size: 2.75rem; line-height: 1; color: #18203D; }
.pod-2 .pod-rank, .pod-3 .pod-rank { font-size: 2rem; }
.podium.solo { grid-template-columns: 1fr; }
.podium.solo .pod-1 { grid-column: 1; }
.podium.solo .pod-1 .pod-block { max-width: 200px; }
.pod.me .pod-name::after { content: "（あなた）"; color: var(--grass); }

/* 順位の行（Renban王の4〜5位・ゲームごと） */
.rows { margin-top: 10px; display: grid; gap: 6px; }
.p-rank li {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 0 10px;
  min-height: 48px; padding: 6px 14px 6px 8px;
  border-radius: 14px;
  background: var(--card);
}
.rows li { box-shadow: var(--shadow); }
.rk { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-size: 1.25rem; line-height: 1; color: var(--ink-soft); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.rk.r1 { background: var(--sun); color: #18203D; }
.rk.r2 { background: var(--silver); color: #18203D; }
.rk.r3 { background: var(--bronze); color: #18203D; }
.nick { font-weight: 700; font-size: .9375rem; line-height: 1.35; min-width: 0; }
.val { font-size: 1.125rem; color: var(--blue-ink); white-space: nowrap; }
.val.jp { grid-column: 2 / -1; grid-row: 2; font-family: var(--f-jp); font-size: .8125rem; font-weight: 700; white-space: normal; line-height: 1.4; font-stretch: normal; font-variation-settings: normal; }
.p-rank li .rk { grid-row: 1 / span 2; }
.p-rank li:has(.val.jp) { row-gap: 0; padding-top: 8px; padding-bottom: 8px; }
.p-rank li.me { background: color-mix(in srgb, var(--sun) 26%, var(--card)); box-shadow: inset 0 0 0 2px var(--sun); }
.p-rank li.me .nick::after { content: "（あなた）"; color: var(--ink-soft); font-weight: 700; }
.p-empty, .p-loading { display: block !important; padding: 12px 14px; color: var(--ink-soft); font-size: .875rem; }

/* ---- ゲームごとのランキング（横にめくる） ---- */
.boards { display: flex; gap: 12px; overflow-x: auto; margin: 12px calc(var(--gut) * -1) 0; padding: 2px var(--gut) 12px; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gut); scrollbar-width: none; }
.boards::-webkit-scrollbar { display: none; }
.p-board { flex: 0 0 88%; scroll-snap-align: start; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.boards .p-board:only-child { flex-basis: 100%; }
.b-head { position: relative; height: 88px; background: #2F7A3E; overflow: hidden; }
.b-head img { width: 100%; height: 100%; object-fit: cover; }
.b-head::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 14, 40, .78), rgba(10, 14, 40, .1)); }
.p-board-title { position: absolute; left: 14px; bottom: 10px; right: 14px; z-index: 1; color: #fff; font-size: 1.0625rem; font-weight: 800; line-height: 1.3; }
.p-board-title .no { display: block; font-size: 1.75rem; line-height: 1; }
.p-board-sub { padding: 10px 14px 0; font-size: .8125rem; font-weight: 700; color: var(--ink-soft); }
.p-board .p-rank { padding: 8px 8px 0; display: grid; gap: 2px; }
.p-board .p-rank li { background: transparent; padding-right: 8px; }
.p-board .p-rank li.me { background: color-mix(in srgb, var(--sun) 26%, var(--card)); }
.p-board .more { margin: auto 14px 14px; padding-top: 10px; }
.p-board .more .pill { width: 100%; }

/* ---- 遊ぶ前に ---- */
.facts { display: grid; gap: 10px; }
.fact { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: start; padding: 14px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); font-size: .9375rem; line-height: 1.65; }
.fact strong { display: block; font-size: 1rem; font-weight: 800; margin-bottom: 2px; }
.fact .en { display: block; margin-top: 4px; font-size: .8125rem; color: var(--ink-soft); line-height: 1.55; }
.fact a { color: var(--blue-ink); font-weight: 700; margin-left: .3em; }
.fact-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; }
.fact-ico svg { width: 30px; height: 30px; }
.f-solo .fact-ico { background: color-mix(in srgb, var(--grass) 20%, transparent); }
.f-solo .fact-ico svg { width: 36px; }
.f-solo .fact-ico svg { color: #fff; fill: #18203D; filter: drop-shadow(0 1px 0 rgba(24, 32, 61, .35)); }
.f-live .fact-ico { background: color-mix(in srgb, var(--scarf) 16%, transparent); fill: var(--scarf); }
.f-name .fact-ico { background: color-mix(in srgb, var(--sun) 28%, transparent); fill: var(--sun-deep); }

/* ---- 下の情報 ---- */
.foot { margin-top: 32px; padding: 24px var(--gut) 8px; text-align: center; border-top: 2px dashed var(--line); }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 4px; margin-top: 16px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; font-size: .875rem; font-weight: 700; color: var(--ink-soft); text-decoration: none; }
.foot-links a [lang="en"] { margin-left: .3em; font-weight: 600; font-size: .8125rem; }
.foot-links a:hover { color: var(--blue-ink); text-decoration: underline; }
.mail a { display: inline-flex; min-height: 44px; align-items: center; color: var(--blue-ink); font-weight: 700; font-size: .9375rem; }
.copy { font-size: .8125rem; color: var(--ink-soft); }
.noscript { display: grid; gap: 8px; }
.noscript a { display: block; padding: 14px; border-radius: 16px; background: var(--card); font-weight: 800; }

/* ---- 下に固定の切り替え ---- */
.tabs {
  position: fixed; z-index: 30;
  left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(100%, var(--app));
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--card) 88%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.tab {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; padding: 0;
  border: 0; background: none; cursor: pointer;
  color: var(--ink-soft); text-decoration: none;
  font-size: .75rem; font-weight: 800; line-height: 1.2;
}
.tab svg { width: 34px; height: 26px; padding: 2px 6px; border-radius: 99px; fill: currentColor; transition: background .25s, transform .35s var(--spring); }
.tab.on { color: var(--blue-ink); }
.tab.on svg { background: color-mix(in srgb, var(--blue-ink) 16%, transparent); width: 52px; }
.tab:active svg { transform: scale(.85); }
.tab-badge {
  position: absolute; top: 2px; left: calc(50% + 8px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--scarf); color: #fff; font-size: .8125rem; line-height: 18px; text-align: center;
}

.toast {
  position: fixed; z-index: 40; left: 50%; bottom: calc(var(--tabs-h) + 18px + env(safe-area-inset-bottom));
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  width: max-content; max-width: min(92vw, 400px);
  padding: 10px 16px; border-radius: 14px;
  background: #18203D; color: #fff; font-size: .875rem; font-weight: 700; line-height: 1.5; text-align: center;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5);
  transition: opacity .2s, transform .35s var(--spring);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 自分がランキングに入っているとき（良いときに大きく） */
.cheer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cheer i { position: absolute; top: -10px; width: 8px; height: 12px; border-radius: 2px; animation: fall 1.6s ease-in forwards; }
@keyframes fall { to { transform: translateY(260px) rotate(540deg); opacity: 0; } }
.podium { position: relative; }

/* ---- 広い画面: 中央にスマホ幅の画面、周りは群青の台紙 ---- */
@media (min-width: 600px) {
  body { background: #1C27A0; }
  .stage {
    display: block; position: fixed; inset: 0; z-index: 0; overflow: hidden;
    background:
      radial-gradient(circle at 20% 15%, rgba(255, 255, 255, .10), transparent 40%),
      radial-gradient(circle at 85% 90%, rgba(255, 200, 61, .14), transparent 45%),
      #1C27A0;
  }
  .stage-kv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 60%; }
  .stage::after { /* 左の文字が読めるよう、左を群青で沈める */
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(20, 30, 140, .88) 0%, rgba(20, 30, 140, .55) 32%, rgba(20, 30, 140, .05) 62%, rgba(20, 30, 140, .15) 100%);
  }
  .stage-num, .stage-side { z-index: 1; }
  .stage-num {
    position: absolute; margin: 0; line-height: .8; color: transparent;
    -webkit-text-stroke: 2px rgba(255, 255, 255, .14);
    font-size: 40vh; user-select: none;
    animation: drift 18s ease-in-out infinite alternate;
  }
  .stage-num.n1 { left: -4vw; top: 2vh; }
  .stage-num.n2 { right: -6vw; top: 30vh; animation-delay: -6s; -webkit-text-stroke-color: rgba(255, 200, 61, .22); }
  .stage-num.n3 { left: 8vw; bottom: -10vh; animation-delay: -12s; }
  @keyframes drift { from { transform: translateY(0); } to { transform: translateY(-3vh); } }
  /* 広い画面では、スマホの画面のように中だけが動く（下の切り替えは画面の底に付く） */
  .app {
    z-index: 1;
    margin: 28px auto;
    height: calc(100vh - 56px);
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    padding-bottom: 0;
    border-radius: 36px;
    box-shadow: 0 0 0 10px rgba(255, 255, 255, .08), 0 40px 80px -30px rgba(0, 0, 0, .7);
  }
  .app::-webkit-scrollbar { display: none; }
  .tabs { position: sticky; left: auto; bottom: 0; transform: none; width: 100%; margin-top: 24px; border: 0; box-shadow: 0 -1px 0 var(--line); }
  .toast { bottom: calc(var(--tabs-h) + 46px); }
  .stage-side { display: none; }
}
@media (min-width: 1120px) {
  .stage-side {
    display: block; position: absolute; top: 50%; transform: translateY(-50%);
    right: calc(50% + var(--app) / 2 + 56px); width: 340px;
    color: #fff; text-align: right;
  }
  .stage-brand { font-size: 1rem; font-weight: 700; opacity: .8; }
  .stage-copy { margin-top: 10px; font-size: 2rem; font-weight: 800; line-height: 1.45; font-feature-settings: "palt"; }
  .stage-copy.en { font-size: 1.125rem; font-weight: 600; opacity: .8; line-height: 1.5; }
  .stage-tip { margin-top: 24px; font-size: .9375rem; font-weight: 700; color: var(--sun); line-height: 1.6; }
}
@media (min-width: 600px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body, :root:not([data-theme="light"]) .stage { background-color: #080B20; }
}

/* 動きを減らす設定では、すべて止める（数字はすぐに着く） */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
