/* ==========================================================================
   HikaRecap スタイルシート
   色は光鯖公式サイト (hikariserver.com) の変数をそのまま持ってきている。
   フォントは Content-Security-Policy を 'self' だけに保ちたいので外部読み込みをせず、
   OS 標準の和文フォントに寄せてある。
   ========================================================================== */

:root {
  /* 光鯖の配色 */
  --bg-primary: #FFF9C4;
  --bg-secondary: #FFFDF0;
  --bg-tertiary: #FFFFFF;

  --primary: #f57c00;
  --primary-glow: rgba(245, 124, 0, 0.15);
  --secondary: #FF8F00;
  --accent: #d84315;
  --accent-soft: rgba(216, 67, 21, 0.08);

  --text-primary: #1A0F00;
  --text-secondary: #4E3616;
  --text-muted: #8D7355;

  --grad-primary: linear-gradient(135deg, #FFCC00 0%, #FF8F00 100%);
  --grad-accent: linear-gradient(135deg, #ff9100 0%, #ffc837 100%);

  --border: rgba(78, 54, 22, 0.14);
  --border-strong: rgba(78, 54, 22, 0.28);
  --card: #FFFFFF;

  --shadow-sm: 0 1px 2px rgba(78, 54, 22, 0.06);
  --shadow-md: 0 4px 14px rgba(78, 54, 22, 0.10);
  --shadow-lg: 0 12px 32px rgba(78, 54, 22, 0.14);

  --radius: 14px;
  --radius-sm: 9px;

  --font-ja: 'M PLUS 2', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Noto Sans JP',
             'Yu Gothic UI', 'Meiryo', system-ui, sans-serif;
  --font-num: 'SF Mono', 'DejaVu Sans Mono', 'Roboto Mono', ui-monospace, monospace;

  --transition: 0.18s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 16px;
  scrollbar-color: var(--secondary) var(--bg-primary);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(900px 420px at 12% -8%, rgba(255, 204, 0, 0.55), transparent 62%),
    radial-gradient(760px 380px at 92% 2%, rgba(255, 143, 0, 0.22), transparent 58%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-ja);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap { width: min(1280px, 100% - 2rem); margin-inline: auto; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--card); padding: 0.6rem 1rem; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 253, 240, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: 62px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; flex: none;
  filter: drop-shadow(0 2px 5px var(--primary-glow));
}
.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.brand-text strong { font-size: 1.16rem; letter-spacing: 0.02em; }
.brand-text small { font-size: 0.72rem; color: var(--text-muted); }

.nav { display: flex; gap: 0.15rem; flex-wrap: wrap; margin-left: 0.5rem; }
.nav-link {
  padding: 0.4rem 0.85rem; border-radius: 999px;
  font-size: 0.9rem; font-weight: 600; text-decoration: none;
  color: var(--text-secondary); transition: var(--transition);
}
.nav-link:hover { background: var(--accent-soft); color: var(--accent); }
.nav-link[aria-current='page'] { background: var(--grad-primary); color: #3a2400; box-shadow: var(--shadow-sm); }

.header-side { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }

.online-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.28rem 0.7rem; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border);
  font-size: 0.85rem; font-variant-numeric: tabular-nums;
}
.online-pill .muted { color: var(--text-muted); font-size: 0.78rem; }
/* display を指定した要素には UA の [hidden]{display:none} が効かないので、
   自分で消す。接続状況はメンバー以外に見せないため、ここが効かないと
   「— / —」という空のピルが残ってしまう。 */
.online-pill[hidden] { display: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); flex: none; }
.dot.up { background: #2e9e4f; box-shadow: 0 0 0 3px rgba(46, 158, 79, 0.18); }
.dot.down { background: #c0392b; }

.lang-toggle {
  font: inherit; font-size: 0.82rem; font-weight: 600;
  padding: 0.3rem 0.75rem; border-radius: 999px; cursor: pointer;
  background: var(--card); color: var(--text-secondary);
  border: 1px solid var(--border); transition: var(--transition);
}
.lang-toggle:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Discord ログイン ---------- */
/* 公式サイト (hikariserver.com) の LOGIN ボタンに形をそろえてある。 */
.auth-slot { display: flex; align-items: center; }
.auth-anchor { position: relative; }

.login-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font: inherit; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.04em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  min-height: 32px; padding: 0.28rem 0.85rem;
  border-radius: 999px; border: 1.5px solid var(--primary);
  background: var(--card); color: var(--primary);
  transition: var(--transition);
}
.login-btn:hover { background: var(--primary); color: #fff; box-shadow: 0 4px 12px var(--primary-glow); }
.login-btn.is-user { font-weight: 600; letter-spacing: 0; }
/* ロールを持っていない状態。押せるが、開くと理由が出る。 */
.login-btn.is-user:not(.is-member) { border-color: var(--border-strong); color: var(--text-muted); }
.login-btn.is-user:not(.is-member):hover { background: var(--bg-secondary); color: var(--text-primary); }

.discord-mark { width: 17px; height: 17px; flex: none; }
.auth-avatar { width: 20px; height: 20px; border-radius: 50%; flex: none; }
.login-label { max-width: 8.5rem; overflow: hidden; text-overflow: ellipsis; }

.auth-menu {
  position: absolute; z-index: 30; top: calc(100% + 8px); right: 0;
  width: max-content; max-width: min(19rem, 86vw); padding: 0.75rem;
  background: var(--card); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.auth-menu[hidden] { display: none; }
.auth-note { font-size: 0.78rem; color: var(--text-muted); line-height: 1.55; margin-bottom: 0.6rem; }
.auth-note.warn { color: var(--accent); }
.auth-logout {
  width: 100%; font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer;
  padding: 0.35rem 0.8rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-secondary);
  transition: var(--transition);
}
.auth-logout:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 画面下に出る短い知らせ（トースト） ---------- */
/* 本文を押し下げないよう画面に固定で重ねる。数秒で自動的に消える。 */
.toast-host {
  position: fixed; left: 0; right: 0; bottom: clamp(24px, 9vh, 72px);
  z-index: 60; display: flex; justify-content: center;
  padding-inline: 1rem; pointer-events: none;
}

.toast {
  display: inline-flex; align-items: center; gap: 0.6rem;
  max-width: min(30rem, 100%);
  padding: 0.55rem 1.1rem 0.55rem 0.6rem;
  border-radius: 999px;
  background: var(--card); color: var(--text-primary);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem; line-height: 1.5;
  pointer-events: auto;
  animation: toast-in 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
.toast.is-leaving { animation: toast-out 0.24s ease forwards; }
.toast-text { min-width: 0; white-space: pre-line; }

/* 記号は丸の中に入れる。色で成否が分かるようにする。 */
.toast-mark {
  flex: none; display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--grad-primary); color: #3a2400;
}
.toast-icon { width: 15px; height: 15px; }
.toast-ok .toast-mark { background: #2e9e4f; color: #fff; }
.toast-warn .toast-mark { background: var(--accent); color: #fff; }
.toast-warn { border-color: rgba(216, 67, 21, 0.35); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(8px) scale(0.98); }
}

/* ---------- 共通パーツ ---------- */
main { flex: 1 0 auto; padding: 1.6rem 0 3rem; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}

.section { margin-bottom: 2.2rem; }
.section-head {
  display: flex; align-items: baseline; gap: 0.75rem;
  flex-wrap: wrap; margin-bottom: 0.9rem;
}
.section-head h2 { font-size: 1.22rem; letter-spacing: 0.01em; }
.section-head p { font-size: 0.85rem; color: var(--text-muted); }
.section-head .spacer { margin-left: auto; }

.muted { color: var(--text-muted); }
.num { font-variant-numeric: tabular-nums; font-family: var(--font-num); }

.badge {
  display: inline-block; padding: 0.06rem 0.44rem; border-radius: 999px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.03em;
  border: 1px solid var(--border-strong); color: var(--text-muted);
  vertical-align: middle;
}
.badge.op { background: var(--accent-soft); color: var(--accent); border-color: rgba(216, 67, 21, 0.3); }
.badge.bot { background: rgba(78, 54, 22, 0.07); }
.badge.excluded { background: rgba(78, 54, 22, 0.07); }
.badge.ns { background: #efe7ff; border-color: #cdb8f5; color: #5b3ea8; }
.badge.online { background: rgba(46, 158, 79, 0.12); color: #1e6b36; border-color: rgba(46, 158, 79, 0.35); }

.loading { display: grid; place-items: center; gap: 1rem; padding: 5rem 1rem; color: var(--text-muted); }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------- ヒーロー ---------- */
.hero {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem;
  margin-bottom: 1.8rem;
}
/* 接続状況を出さない相手には右の枠ごと消えるので、左を横いっぱいに広げる。 */
.hero.hero-wide { grid-template-columns: 1fr; }

@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }

.hero-main {
  padding: 1.5rem 1.6rem;
  background: linear-gradient(135deg, #fff 0%, #FFFDF0 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.hero-main h1 { font-size: 1.85rem; line-height: 1.25; letter-spacing: 0.01em; }
.hero-main h1 em { font-style: normal; background: var(--grad-primary); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-main > p { margin-top: 0.5rem; color: var(--text-secondary); font-size: 0.93rem; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: 1.2rem; }
.hero-fact strong { display: block; font-size: 1.5rem; font-family: var(--font-num); line-height: 1.1; }
.hero-fact span { font-size: 0.78rem; color: var(--text-muted); }

.hero-online { padding: 1.2rem 1.3rem; }
.hero-online h2 { font-size: 1rem; margin-bottom: 0.7rem; }
.online-list { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.online-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.25rem 0.65rem 0.25rem 0.28rem; border-radius: 999px;
  background: var(--bg-secondary); border: 1px solid var(--border);
  font-size: 0.84rem; text-decoration: none; transition: var(--transition);
}
.online-chip:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.online-chip .avatar { width: 22px; height: 22px; border-radius: 6px; }
.online-unlisted { color: var(--text-muted); cursor: default; }

/* ---------- アバター ---------- */
.avatar {
  width: 32px; height: 32px; border-radius: 8px; flex: none;
  image-rendering: pixelated; background: var(--bg-secondary);
  border: 1px solid var(--border); object-fit: cover;
}
.avatar-fallback {
  display: grid; place-items: center;
  font-size: 0.78rem; font-weight: 800; color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); border: none;
}

/* ---------- 指標カード ---------- */
.stat-grid {
  display: grid; gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
}
.stat-card {
  display: block; text-decoration: none; padding: 1rem 1.1rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: var(--transition); position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: var(--grad-primary); opacity: 0; transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.stat-card:hover::before { opacity: 1; }
.stat-card .label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }
.stat-card .value {
  font-family: var(--font-num); font-size: 1.62rem; font-weight: 700;
  line-height: 1.2; margin-top: 0.15rem; word-break: break-all;
}
.stat-card .value .unit { font-size: 0.78rem; color: var(--text-muted); margin-left: 0.2rem; font-weight: 500; }
.stat-card .leader {
  display: flex; align-items: center; gap: 0.4rem;
  margin-top: 0.6rem; padding-top: 0.55rem;
  border-top: 1px dashed var(--border); font-size: 0.8rem; color: var(--text-secondary);
}
.stat-card .leader .avatar { width: 20px; height: 20px; border-radius: 6px; }
.stat-card .leader .crown { color: var(--secondary); }

/* ---------- テーブル ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); }
table.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.table th, table.table td { padding: 0.55rem 0.8rem; text-align: left; }
table.table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  font-size: 0.76rem; letter-spacing: 0.04em; color: var(--text-muted);
  text-transform: uppercase; white-space: nowrap;
}
table.table tbody tr { border-bottom: 1px solid rgba(78, 54, 22, 0.07); }
table.table tbody tr:last-child { border-bottom: none; }
table.table tbody tr:hover { background: rgba(255, 204, 0, 0.1); }
table.table td.num, table.table th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-num); }
td.rank { width: 3.4rem; font-family: var(--font-num); color: var(--text-muted); font-weight: 700; }
tr.me td.rank, td.rank.top1 { color: var(--accent); }

.player-cell { display: flex; align-items: center; gap: 0.55rem; min-width: 0; }
.player-cell a { text-decoration: none; font-weight: 600; }
.player-cell a:hover { color: var(--primary); text-decoration: underline; }

.medal { font-size: 1rem; }
.bar-cell { width: 30%; min-width: 120px; }
.bar { height: 7px; border-radius: 999px; background: rgba(78, 54, 22, 0.1); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--grad-primary); }

/* ---------- ランキング画面 ---------- */
.ranking-layout { display: grid; grid-template-columns: 300px 1fr; gap: 1.1rem; align-items: start; }
@media (max-width: 1000px) { .ranking-layout { grid-template-columns: 1fr; } }

.metric-panel { padding: 0.9rem; position: sticky; top: 78px; max-height: calc(100vh - 100px); overflow: auto; }
/* 指標パネルの開閉ボタンは狭い画面専用。広い画面ではパネルが常に出ているので出さない。 */
.metric-toggle { display: none; }

@media (max-width: 1000px) {
  .metric-panel { position: static; max-height: 58vh; }
  /* 畳んでいるときはパネルごと消す。広い画面ではこの規則が効かないので、
     state.metricPanelOpen が false のままでもパネルは出たままになる。 */
  .metric-panel.collapsed { display: none; }

  .metric-toggle {
    display: flex; align-items: center; gap: 0.5rem; width: 100%;
    font: inherit; font-size: 0.9rem; cursor: pointer; text-align: left;
    min-height: 44px; padding: 0.5rem 0.9rem; margin-bottom: 0.6rem;
    border-radius: var(--radius); border: 1px solid var(--border);
    background: var(--card); color: var(--text-primary); box-shadow: var(--shadow-sm);
  }
  .metric-toggle-label { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }
  .metric-toggle-current { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .metric-toggle .dd-caret { margin-left: auto; }
  .metric-toggle[aria-expanded='true'] .dd-caret { transform: rotate(180deg); }
}
.metric-group { margin-bottom: 0.9rem; }
.metric-group > h3 {
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 0.3rem; padding-inline: 0.35rem;
}
.metric-item {
  display: block; width: 100%; text-align: left; font: inherit; font-size: 0.86rem;
  padding: 0.34rem 0.55rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: none; cursor: pointer;
  color: var(--text-secondary); transition: var(--transition);
}
.metric-item:hover { background: var(--bg-secondary); color: var(--text-primary); }
.metric-item[aria-pressed='true'] {
  background: var(--grad-primary); color: #3a2400; font-weight: 700; box-shadow: var(--shadow-sm);
}
.metric-item small { display: block; font-size: 0.7rem; opacity: 0.75; font-weight: 400; }
.metric-more { text-decoration: none; color: var(--primary); font-weight: 600; }
.metric-hint { font-size: 0.74rem; padding: 0 0.35rem 0.5rem; }

/* 検索欄は固定し、結果だけがスクロールする。入力中に一覧が動かないようにする。 */
.metric-panel { display: flex; flex-direction: column; gap: 0.55rem; overflow: hidden; }
.metric-panel .field-search { flex: none; width: 100%; }
.metric-groups { overflow-y: auto; flex: 1 1 auto; min-height: 0; }

.back-row { margin-bottom: 0.7rem; }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
  margin-bottom: 0.9rem;
}
.field {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.26rem 0.8rem;
}
.field input, .field select {
  font: inherit; font-size: 0.86rem; border: none; background: none;
  color: inherit; min-width: 8rem; outline: none;
}
.field label { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }

/* 検索欄。入力欄を枠いっぱいに伸ばし、× は枠の右端に固定する。
   ブラウザ標準の × は input の右端に出るため、入力欄が枠より狭いと
   枠の途中に浮いて見える。標準のものは消して自前のものを置く。 */
.field-search { flex: 1 1 22rem; max-width: 100%; padding-right: 0.35rem; }
.field-search input { flex: 1 1 auto; min-width: 0; }
.field-search input::-webkit-search-cancel-button,
.field-search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.field-clear {
  flex: none; display: grid; place-items: center;
  width: 22px; height: 22px; padding: 0; margin-left: 0.25rem;
  font: inherit; font-size: 0.95rem; line-height: 1; cursor: pointer;
  border: none; border-radius: 50%;
  background: rgba(78, 54, 22, 0.08); color: var(--text-muted);
  transition: var(--transition);
}
.field-clear:hover { background: var(--accent-soft); color: var(--accent); }
.field-clear[hidden] { display: none; }
.chip-toggle {
  font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer;
  padding: 0.3rem 0.8rem; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border); color: var(--text-secondary);
  transition: var(--transition);
}
.chip-toggle[aria-pressed='true'] { background: var(--accent-soft); border-color: rgba(216, 67, 21, 0.35); color: var(--accent); }

.metric-headline { padding: 1rem 1.2rem; margin-bottom: 0.9rem; }
.metric-headline h2 { font-size: 1.3rem; }
.metric-headline .sub { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.15rem; }
.metric-headline .totals { display: flex; gap: 1.6rem; margin-top: 0.8rem; flex-wrap: wrap; }
.metric-headline .totals div strong { display: block; font-family: var(--font-num); font-size: 1.25rem; line-height: 1.15; }
.metric-headline .totals div span { font-size: 0.75rem; color: var(--text-muted); }

/* ---------- 種類別 ---------- */
.cat-tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1rem; }
.cat-tab {
  font: inherit; font-size: 0.86rem; font-weight: 600; cursor: pointer;
  padding: 0.38rem 0.9rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card); color: var(--text-secondary);
  transition: var(--transition);
}
.cat-tab:hover { border-color: var(--primary); color: var(--primary); }
.cat-tab[aria-pressed='true'] { background: var(--grad-primary); color: #3a2400; border-color: transparent; box-shadow: var(--shadow-sm); }
.cat-tab .count { font-size: 0.72rem; opacity: 0.7; margin-left: 0.3rem; font-weight: 500; }

.type-row > td { background: var(--bg-secondary); }
.type-detail { padding: 0 !important; }
.type-detail-inner { padding: 0.7rem 1rem 1rem 3.4rem; }
.type-detail-inner h4 { font-size: 0.86rem; margin-bottom: 0.4rem; color: var(--text-secondary); }
.expand-btn {
  font: inherit; font-size: 0.78rem; cursor: pointer; font-weight: 600;
  padding: 0.16rem 0.6rem; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--border); background: var(--card); color: var(--text-secondary);
}
.expand-btn:hover { border-color: var(--primary); color: var(--primary); }

.id-cell { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.id-cell .name { font-weight: 600; }
.id-cell code { font-size: 0.72rem; color: var(--text-muted); font-family: var(--font-num); }

/* ---------- メンバー一覧 ---------- */
.member-grid { display: grid; gap: 0.85rem; grid-template-columns: repeat(auto-fill, minmax(262px, 1fr)); }
.member-card {
  display: block; text-decoration: none; padding: 0.95rem 1.05rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: var(--transition);
}
.member-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.member-card .top { display: flex; align-items: center; gap: 0.65rem; }
.member-card .top .avatar { width: 42px; height: 42px; border-radius: 10px; }
.member-card .name { font-weight: 700; font-size: 1rem; overflow-wrap: anywhere; }
.member-card .sub { font-size: 0.75rem; color: var(--text-muted); }
.member-card .mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; margin-top: 0.75rem; }
.member-card .mini div { text-align: center; }
.member-card .mini strong { display: block; font-family: var(--font-num); font-size: 0.95rem; line-height: 1.2; }
.member-card .mini span { font-size: 0.66rem; color: var(--text-muted); }

/* ---------- 採掘・設置の日次推移 ---------- */
/* 見出しと「総数 / 変化」は枠の外。中身だけを白いカードに載せる。 */
.trend-card { padding: 1.05rem 1.15rem 1.2rem; }
.trend-controls { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0 0 0.3rem; }
.trend-controls .cat-tab { font-size: 0.8rem; padding: 0.3rem 0.78rem; }
.trend-controls .cat-tab:disabled { opacity: 0.48; cursor: not-allowed; }
.trend-cadence { color: var(--text-secondary); font-size: 0.76rem; margin-bottom: 0.8rem; }
.trend-gate-note { color: var(--text-muted); font-size: 0.76rem; margin: -0.5rem 0 0.85rem; }
.trend-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.trend-metric {
  min-width: 0; padding: 0.8rem 0.85rem 0.65rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #fff, var(--bg-secondary));
  border-top: 3px solid var(--trend-color);
}
.trend-metric-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.4rem; }
.trend-metric-name { font-size: 0.78rem; font-weight: 700; color: var(--text-secondary); }
.trend-metric-head strong { font-size: 1.12rem; }
/* 総数 / 変化 の切り替え。 */
.trend-modes { display: flex; gap: 0.4rem; flex-wrap: wrap; }
/* 未選択のときは数字の札ごと出さない（選んでいないのに選択中に見えるため）。 */
.trend-readout[hidden] { display: none; }
/* ---------- 折れ線グラフ ----------
   線と目盛り線だけ SVG。点・目盛りの数字・日付は HTML を割合で置いている。
   SVG に文字を入れるとカード幅に合わせて縮み、スマートフォンで読めなくなるため。 */
.trend-figure {
  position: relative;
  margin: 1.2rem 0 0;
  padding-left: 3.2rem;
  /* 指でなぞったときに選択モードへ入らないようにする。縦スクロールは残す。 */
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  touch-action: pan-y;
}

.trend-plotbox {
  position: relative;
  height: 116px;
  /* 図の上でカーソルの形を変えない。crosshair にすると「何か描けそう」に見えるが、
     ここは読むだけの図で、押しても点が 1 つ選ばれるだけ。 */
  cursor: default;
}
.trend-plot {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  overflow: visible;
}
.trend-gridline { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.trend-line {
  stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* 目盛りの数字。上・中・下の 3 段。 */
.trend-yaxis { position: absolute; left: 0; top: 0; width: 3rem; height: 116px; }
.trend-tick {
  position: absolute; right: 0; transform: translateY(-50%);
  font: 0.68rem/1 var(--font-num); color: var(--text-muted);
  white-space: nowrap;
}

/* 点。なぞっている点だけ大きくする。 */
.trend-dot {
  position: absolute; width: 7px; height: 7px; border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 1.5px solid var(--card);
  transition: width 0.12s ease, height 0.12s ease;
  pointer-events: none;
}
.trend-dot.is-active { width: 13px; height: 13px; box-shadow: 0 0 0 3px var(--primary-glow); }

/* なぞった位置の縦線。 */
.trend-guide {
  position: absolute; top: -2px; bottom: -2px; width: 1px;
  background: var(--border-strong);
  transform: translateX(-50%);
  pointer-events: none;
}
.trend-guide[hidden] { display: none; }

/* 読み取り表示。何も触れていないときは最新の値を出しておく。
   枠の内側に置き、点が上寄りなら下、下寄りなら上へ逃がして線と重ねない。 */
.trend-readout {
  position: absolute; top: 2px; transform: translateX(-50%);
  display: flex; align-items: baseline; gap: 0.35rem;
  padding: 0.14rem 0.5rem; border-radius: 999px;
  background: rgba(255, 255, 255, 0.92); border: 1px solid var(--border);
  white-space: nowrap; pointer-events: none;
  max-width: 100%;
}
.trend-readout.is-low { top: auto; bottom: 2px; }
.trend-readout.is-start { transform: none; }
.trend-readout.is-end { transform: translateX(-100%); }
.trend-readout.is-pinned { border-color: var(--trend-color); box-shadow: var(--shadow-sm); }
.trend-readout-date { font-size: 0.68rem; color: var(--text-muted); }
.trend-readout-value { font-size: 0.78rem; font-weight: 700; }

/* 横軸の日付。 */
.trend-xaxis { position: relative; height: 1.1rem; margin-top: 0.3rem; }
.trend-xlabel {
  position: absolute; transform: translateX(-50%);
  font: 0.68rem/1 var(--font-num); color: var(--text-muted);
  white-space: nowrap;
}
/* 端の目盛りは枠の外へはみ出さないよう内側へ寄せる。 */
.trend-xlabel:first-child { transform: none; }
.trend-xlabel:last-child { transform: translateX(-100%); }

.trend-empty { padding: 2rem 1rem; text-align: center; color: var(--text-muted); font-size: 0.86rem; }
.trend-empty .expand-btn { margin-top: 0.55rem; }

/* ---------- プレイヤー詳細 ---------- */
.profile-head {
  display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap;
  padding: 1.3rem 1.5rem; margin-bottom: 1.2rem;
  background: linear-gradient(135deg, #fff 0%, #FFFDF0 100%);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md);
}
.profile-head .avatar { width: 76px; height: 76px; border-radius: 16px; }
.profile-head h1 { font-size: 1.7rem; line-height: 1.2; overflow-wrap: anywhere; }
.profile-head .meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }
.profile-head .spacer { margin-left: auto; }
.profile-facts { display: flex; gap: 1.3rem; flex-wrap: wrap; }
.profile-facts div strong { display: block; font-family: var(--font-num); font-size: 1.3rem; line-height: 1.15; }
.profile-facts div span { font-size: 0.73rem; color: var(--text-muted); }

.mining-card { padding: 1.1rem 1.25rem; }
/* 指で扇に触れたときに、文字選択や iOS の吹き出しが出ないようにする。
   これが無いと「長押ししないと反応しないのに、長押しすると選択モードになる」
   という状態になり、スマートフォンでは事実上さわれない。 */
.mining-chart {
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
.mining-slice, .mining-legend li { -webkit-tap-highlight-color: transparent; }
.mining-controls { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.mining-chart {
  display: grid; grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.4fr);
  align-items: center; gap: 1.4rem;
}
/* 扇ごとに反応させるため SVG で描いている。中央を抜いたドーナツ。 */
.mining-pie-wrap { position: relative; width: min(100%, 260px); margin-inline: auto; }
.mining-pie {
  display: block; width: 100%; aspect-ratio: 1;
  filter: drop-shadow(0 4px 14px rgba(78, 54, 22, 0.12));
}
.mining-slice {
  transition: opacity 0.16s ease, stroke-width 0.16s ease;
  cursor: default;
}
/* どれかに触れている間は、それ以外を薄くして目当ての扇だけを残す。
   縁を足したり拡大したりするより、隣との境目がはっきりする。 */
.mining-pie.is-focused .mining-slice { opacity: 0.28; }
.mining-pie .mining-slice.is-active {
  opacity: 1;
  stroke: rgba(255, 255, 255, 0.96);
  stroke-width: 2.2px;
  stroke-linejoin: round;
}

/* 触れている項目の名前・数・割合。穴の中に置くので扇を隠さない。 */
.mining-center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.1rem; width: 48%; text-align: center; pointer-events: none;
  line-height: 1.25;
}
.mining-center-name {
  font-size: 0.72rem; font-weight: 700; color: var(--text-secondary);
  overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.mining-center-value { font-size: 1.02rem; font-weight: 700; }
.mining-center-note { font-size: 0.7rem; color: var(--text-muted); }

.mining-legend {
  display: grid; grid-template-columns: 1fr; gap: 0.35rem;
  list-style: none; max-height: 18rem; overflow: auto; padding: 0.1rem 0.25rem 0.1rem 0;
}
.mining-legend li {
  cursor: pointer;
  display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto;
  align-items: center; gap: 0.55rem; min-width: 0;
  padding: 0.35rem 0.45rem; border-radius: var(--radius-sm);
  background: var(--bg-secondary); font-size: 0.82rem;
  border: 1px solid transparent; transition: var(--transition);
}
/* 凡例と扇は連動させる。どちらに触れても両方が反応する。 */
.mining-legend li.is-active {
  border-color: var(--primary);
  background: var(--card);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.mining-swatch { width: 11px; height: 11px; border-radius: 3px; }
.mining-label { overflow-wrap: anywhere; }
.mining-value, .mining-percent { font-size: 0.76rem; color: var(--text-secondary); }
.mining-percent { min-width: 3.6rem; text-align: right; }
.mining-empty { padding: 1.25rem; text-align: center; }


.adv-bar { height: 9px; border-radius: 999px; background: rgba(78, 54, 22, 0.1); overflow: hidden; margin-top: 0.3rem; width: 190px; }
.adv-bar > span { display: block; height: 100%; background: var(--grad-accent); }

.summary-grid { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); }
.summary-item {
  padding: 0.65rem 0.8rem; border-radius: var(--radius-sm);
  background: var(--card); border: 1px solid var(--border);
}
.summary-item .label { font-size: 0.74rem; color: var(--text-muted); }
.summary-item .value { font-family: var(--font-num); font-size: 1.12rem; font-weight: 700; line-height: 1.25; }
.summary-item .rankchip { font-size: 0.7rem; color: var(--secondary); font-weight: 700; }
/* 1 位の数は指標ではなく「その人の立ち位置」なので、他の枠と見分けが付くようにする。 */
.summary-item.is-highlight {
  border-color: rgba(255, 143, 0, 0.5);
  background: linear-gradient(135deg, rgba(255, 204, 0, 0.16), rgba(255, 143, 0, 0.08));
  transition: var(--transition);
}
.summary-item.is-highlight:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.summary-item .crown { font-size: 0.78rem; }

/* ---------- 進捗の一覧 ---------- */
.adv-group { margin-bottom: 1.1rem; }
.adv-tab {
  font-size: 0.78rem; letter-spacing: 0.06em; color: var(--text-muted);
  margin-bottom: 0.45rem; text-transform: uppercase;
}
.adv-grid {
  display: grid; gap: 0.5rem; align-items: start;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
}
/* 開いた進捗だけは行いっぱいに広げる。詳細を 1 列幅に押し込むと読めないため。 */
.adv-item.is-open { grid-column: 1 / -1; }

.adv-card {
  display: flex; align-items: center; gap: 0.6rem; width: 100%;
  font: inherit; text-align: left; cursor: pointer;
  padding: 0.55rem 0.75rem; border-radius: var(--radius-sm);
  background: var(--card); border: 1px solid var(--border); color: inherit;
  transition: var(--transition);
}
.adv-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.adv-item.is-open .adv-card {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow);
  border-bottom-left-radius: 0; border-bottom-right-radius: 0;
}
/* 未達成のものは、あることは分かるが目立たない程度に落とす。 */
.adv-card.is-locked { background: transparent; border-style: dashed; opacity: 0.62; }
.adv-card.is-locked:hover { opacity: 1; }

/* アイコンはゲームのテクスチャそのもの。拡大しても輪郭が保たれるようにする。 */
.adv-icon {
  display: block; flex: none;
  background-repeat: no-repeat;
  image-rendering: pixelated;
}
.adv-icon.is-missing { width: 30px; height: 30px; background: rgba(78, 54, 22, 0.08); border-radius: 4px; }

.adv-icon-wrap {
  position: relative; flex: none; display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 8px;
  background: rgba(78, 54, 22, 0.06); border: 2px solid var(--border-strong);
}
/* ゲーム内の枠と同じ考え方で、目標は金色、挑戦は紫の枠にする。 */
.adv-card.frame-goal .adv-icon-wrap { border-color: #e0a300; border-radius: 12px; }
.adv-card.frame-challenge .adv-icon-wrap { border-color: #7d3fd0; border-radius: 4px; }
.adv-card.is-locked .adv-icon-wrap { opacity: 0.55; filter: grayscale(0.85); }

.adv-check {
  position: absolute; right: -6px; bottom: -6px;
  display: grid; place-items: center; width: 17px; height: 17px;
  border-radius: 50%; background: #2e9e4f; color: #fff;
  font-size: 0.62rem; font-weight: 800; line-height: 1;
  border: 2px solid var(--card);
}

.adv-detail-head { display: flex; gap: 0.7rem; align-items: flex-start; margin-bottom: 0.6rem; }
.adv-detail-head .adv-icon { margin-top: 2px; }
.adv-detail-name { font-size: 0.95rem; margin-bottom: 0.2rem; }

.adv-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.adv-name { font-size: 0.88rem; font-weight: 700; overflow-wrap: anywhere; }
.adv-meta { font-size: 0.7rem; color: var(--text-muted); }

/* 開いたときの詳細 */
.adv-detail {
  padding: 0.8rem 0.95rem 0.9rem;
  border: 1px solid var(--primary); border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--bg-secondary);
}
.adv-desc { font-size: 0.86rem; color: var(--text-secondary); }
.adv-facts {
  display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; align-items: center;
  font-size: 0.75rem; margin-bottom: 0.7rem;
}
.adv-facts code { font-family: var(--font-num); font-size: 0.7rem; }
.adv-frame {
  padding: 0.08rem 0.5rem; border-radius: 999px; font-weight: 700;
  border: 1px solid var(--border-strong); color: var(--text-muted);
}
.adv-frame.frame-challenge { background: #f3e8ff; border-color: #cdb8f5; color: #5b3ea8; }
.adv-frame.frame-goal { background: rgba(255, 204, 0, 0.22); border-color: rgba(255, 143, 0, 0.5); color: #8a5a00; }
.adv-frame.frame-hidden { background: rgba(78, 54, 22, 0.08); }

.adv-sub { font-size: 0.8rem; margin-bottom: 0.45rem; }
.adv-holders { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.adv-holder {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.2rem 0.6rem 0.2rem 0.25rem; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border);
  font-size: 0.8rem; text-decoration: none; transition: var(--transition);
}
.adv-holder:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.adv-holder.is-self { border-color: var(--primary); background: rgba(255, 204, 0, 0.16); font-weight: 700; }

/* ---------- 1 位を取っている統計 ---------- */
.first-group { margin-bottom: 0.9rem; }
.first-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.first-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.75rem; border-radius: 999px; text-decoration: none;
  background: var(--card); border: 1px solid var(--border);
  font-size: 0.83rem; transition: var(--transition);
}
.first-chip:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.first-chip .crown { font-size: 0.85rem; }
.first-label { font-weight: 600; }
.first-value { color: var(--text-muted); font-size: 0.78rem; }

.more-btn { margin-top: 0.55rem; }

/* 枠の中だけをスクロールさせる表。
   プレイヤーページの種類別の内訳のように、全部並べると数百行になるが
   ページ全体を伸ばしたくないところで使う。高さはおおよそ 12 行ぶん。

   **縦だけスクロールさせる。** 横に溢れると値の桁が切れて読めなくなるので、
   溢れさせるのではなく名前側を折り返して幅に収める。 */
.scroll-box {
  max-height: 26rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* html 側の指定（オレンジ）を引き継ぐと表の中で主張しすぎるので、控えめにする。 */
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.scroll-box::-webkit-scrollbar { width: 9px; }
.scroll-box::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
.scroll-box::-webkit-scrollbar-track { background: transparent; }

/* 幅に収めるための内訳。
   table-layout: auto のままだと、列幅が中身の最大幅で決まってしまい
   （「深層岩タイルのハーフブロック」のような長い名前が縮まない）、
   枠からはみ出して値の桁が切れる。fixed にして順位と値の幅を決め打ちし、
   余りを名前へ回して折り返させる。 */
.scroll-box table.table { width: 100%; table-layout: fixed; }
.scroll-box td.rank { width: 2.6rem; }
.scroll-box td.num { width: 8.6rem; white-space: nowrap; padding-left: 0.4rem; }
.scroll-box .id-cell { overflow-wrap: anywhere; word-break: break-word; }
.scroll-box .id-cell code { overflow-wrap: anywhere; }

.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 1rem; }

.empty { padding: 2.5rem 1rem; text-align: center; color: var(--text-muted); }

/* ---------- フッター ---------- */
.site-footer {
  flex-shrink: 0; border-top: 1px solid var(--border);
  background: rgba(255, 253, 240, 0.75); padding: 1.1rem 0; font-size: 0.8rem;
}
.footer-inner p { color: var(--text-secondary); }
.footer-inner code { font-family: var(--font-num); font-size: 0.75rem; color: var(--text-muted); }

/* ---------- JS 無しのときの表 ---------- */
.noscript-fallback h2 { font-size: 1.1rem; margin: 1.2rem 0 0.5rem; }
.noscript-fallback table.table { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }

/* ---------- 自作プルダウン ---------- */
.dd { display: inline-flex; align-items: center; gap: 0.45rem; }
.dd-label { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }
.dd-anchor { position: relative; }

.dd-button {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font: inherit; font-size: 0.86rem; cursor: pointer;
  min-height: 34px; padding: 0.24rem 0.7rem 0.24rem 0.9rem;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--text-primary);
  transition: var(--transition);
}
.dd-button:hover { border-color: var(--primary); }
.dd-button[aria-expanded='true'] { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.dd-caret {
  width: 0; height: 0; flex: none;
  border-left: 4.5px solid transparent;
  border-right: 4.5px solid transparent;
  border-top: 5px solid var(--text-muted);
  transition: transform var(--transition);
}
.dd-button[aria-expanded='true'] .dd-caret { transform: rotate(180deg); }

.dd-list {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0;
  min-width: 100%; width: max-content; max-width: min(19rem, 86vw);
  max-height: 16rem; overflow-y: auto; padding: 0.3rem;
  background: var(--card); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.dd-list[hidden] { display: none; }
.dd-option {
  padding: 0.42rem 0.7rem; border-radius: 7px; cursor: pointer;
  font-size: 0.86rem; color: var(--text-secondary); white-space: nowrap;
}
.dd-option:hover, .dd-option.active { background: var(--bg-secondary); color: var(--text-primary); }
.dd-option[aria-selected='true'] { background: var(--grad-primary); color: #3a2400; font-weight: 700; }

/* ---------- 画面幅への対応 ----------
   1000px 未満  ランキングの 2 段組みを解く（上のレイアウト定義側）
    760px 未満  表から「1 位の値」「記録者」を落とす
    640px 未満  ナビを横スクロールにし、カードを 2 列に詰める
    420px 未満  さらに 1 列へ
   表の列を消すのは display:none なので、開いた行の colspan はそのままでよい。 */

@media (max-width: 760px) {
  .trend-grid { grid-template-columns: 1fr; }
  .col-leadval, .col-count { display: none; }
  table.table th, table.table td { padding: 0.5rem 0.6rem; }
  .two-col { grid-template-columns: 1fr; }
  .profile-head { gap: 0.8rem; }
  .profile-head .spacer { margin-left: 0; width: 100%; }
  .profile-head .avatar { width: 60px; height: 60px; border-radius: 13px; }
  .profile-head h1 { font-size: 1.4rem; }
  .metric-panel { max-height: 58vh; }
  .mining-chart { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  /* **SVG ではなく外枠を縮めること。** 中央の文字は外枠を基準に中央寄せしているので、
     SVG だけ細くすると円の中心と文字の中心がずれる。 */
  .mining-pie-wrap { width: min(68vw, 240px); }
  .mining-legend { max-height: 15rem; }
}

@media (max-width: 640px) {
  html { font-size: 15px; }
  .wrap { width: min(1280px, 100% - 1.6rem); }
  main { padding: 1.1rem 0 2.2rem; }

  /* ナビは折り返さず横スクロール。ヘッダーが 3 段になるのを防ぐ。 */
  .header-inner { min-height: 56px; row-gap: 0.35rem; padding-bottom: 0.35rem; }
  .nav {
    order: 3; width: 100%; margin-left: 0; flex-wrap: nowrap;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-link { white-space: nowrap; padding: 0.35rem 0.75rem; }
  .brand-text strong { font-size: 1.05rem; }
  .login-btn { padding: 0.28rem 0.7rem; }
  .login-btn.is-user .login-label { max-width: 5rem; }

  .hero-main { padding: 1.15rem 1.1rem; }
  .hero-main h1 { font-size: 1.4rem; }
  .hero-facts { gap: 0.9rem 1.2rem; }
  .hero-fact strong { font-size: 1.2rem; }

  .stat-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; }
  .stat-card { padding: 0.8rem 0.85rem; }
  .stat-card .value { font-size: 1.2rem; }
  .stat-card .leader { font-size: 0.74rem; }

  .summary-grid { grid-template-columns: repeat(auto-fill, minmax(144px, 1fr)); gap: 0.45rem; }
  .adv-grid { grid-template-columns: 1fr; gap: 0.4rem; }
  .summary-item { padding: 0.5rem 0.6rem; }
  .summary-item .value { font-size: 1rem; }
  .member-grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 0.6rem; }
  .member-card { padding: 0.75rem 0.8rem; }
  .member-card .top .avatar { width: 34px; height: 34px; }
  .member-card .name { font-size: 0.9rem; }

  /* 割合の棒と 1 位の列はここで落とす。
     種類別の表は「順位・種類・合計・開く」の 4 列に切り詰めると
     375px でも横スクロール無しで収まる。1 位が誰かは行を開けば分かる。 */
  .col-share, .col-leader { display: none; }
  table.table { font-size: 0.85rem; }
  table.table th, table.table td { padding: 0.45rem 0.5rem; }
  td.rank { width: 2.2rem; }
  .id-cell { overflow-wrap: anywhere; }
  .id-cell code { font-size: 0.68rem; }
  .expand-btn { padding: 0.14rem 0.45rem; font-size: 0.72rem; }
  .col-action { width: 1%; white-space: nowrap; }
  .type-detail-inner { padding: 0.6rem 0.5rem 0.9rem; }
  .scroll-box { max-height: 21rem; }
  /* 狭い画面では値の欄を詰めて、名前に幅を回す。 */
  .scroll-box td.num { width: 7.9rem; }
  .scroll-box td.rank { width: 2rem; }

  /* カテゴリのタブと絞り込みも横スクロールに寄せる。 */
  .cat-tabs {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    padding-bottom: 0.2rem; margin-inline: -0.1rem;
  }
  .cat-tabs::-webkit-scrollbar { display: none; }
  .cat-tab { white-space: nowrap; }

  .toolbar { gap: 0.4rem; }
  .toolbar .field { flex: 1 1 100%; }
  .field input { min-width: 0; width: 100%; }
  .dd { flex: 1 1 auto; }
  .dd-list { left: auto; right: 0; }

  .metric-headline { padding: 0.85rem 0.9rem; }
  .metric-headline h2 { font-size: 1.1rem; }
  .metric-headline .totals { gap: 1rem; }
  .section-head h2 { font-size: 1.08rem; }
}

@media (max-width: 420px) {
  .stat-grid, .member-grid, .summary-grid { grid-template-columns: 1fr; }
  .hero-facts { gap: 0.8rem 1rem; }
  .online-pill { padding: 0.24rem 0.55rem; }
  /* 名前は隠してアイコンだけにする。横に 4 つ並ぶとヘッダーが折り返すため。 */
  .login-btn.is-user .login-label { display: none; }
}

/* タップ操作では hover の見た目を出さない。
   スマートフォンでは一度触った要素に :hover が残り続けるため、
   「日本語」の枠がオレンジのまま戻らない、といった見え方になる。
   ここで触っていない状態の見た目に書き戻す。
   選択中（aria-pressed / aria-current / is-self など）の見た目は消さないよう、
   :not() で避けてある。 */
@media (hover: none) {
  .nav-link:hover:not([aria-current='page']) { background: none; color: var(--text-secondary); }
  .lang-toggle:hover { border-color: var(--border); color: var(--text-secondary); }
  .login-btn:hover { background: var(--card); color: var(--primary); box-shadow: none; }
  .login-btn.is-user:not(.is-member):hover { background: var(--card); color: var(--text-muted); }
  .auth-logout:hover { border-color: var(--border); color: var(--text-secondary); }
  .online-chip:hover { border-color: var(--border); box-shadow: none; }

  .stat-card:hover, .member-card:hover {
    transform: none; box-shadow: var(--shadow-sm); border-color: var(--border);
  }
  .stat-card:hover::before { opacity: 0; }
  table.table tbody tr:hover { background: none; }
  .player-cell a:hover { color: inherit; text-decoration: none; }

  .metric-item:hover:not([aria-pressed='true']) { background: none; color: var(--text-secondary); }
  .cat-tab:hover:not([aria-pressed='true']) { border-color: var(--border); color: var(--text-secondary); }
  .chip-toggle:hover:not([aria-pressed='true']) { border-color: var(--border); color: var(--text-secondary); }
  .expand-btn:hover { border-color: var(--border); color: var(--text-secondary); }
  .field-clear:hover { background: rgba(78, 54, 22, 0.08); color: var(--text-muted); }
  .dd-button:hover:not([aria-expanded='true']) { border-color: var(--border); }
  .dd-option:hover:not(.active):not([aria-selected='true']) { background: none; color: var(--text-secondary); }

  .summary-item.is-highlight:hover { border-color: rgba(255, 143, 0, 0.5); box-shadow: none; }
  .adv-card:hover { border-color: var(--border); box-shadow: none; }
  .adv-card.is-locked:hover { opacity: 0.62; }
  .adv-holder:hover:not(.is-self) { border-color: var(--border); box-shadow: none; }
  .first-chip:hover { border-color: var(--border); box-shadow: none; }
}

/* ---------- Bot 登録（運営ロール限定） ---------- */
.bot-toggle-row { margin-top: 0.55rem; }
.bot-toggle { padding: 0.24rem 0.8rem; }
.bot-toggle:disabled { opacity: 0.55; cursor: progress; }
.bot-toggle.is-on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
@media (hover: hover) {
  .bot-toggle:not(:disabled):hover { border-color: var(--primary); color: var(--primary); }
}

/* ---------- Discord 連携 ---------- */
.discord-tag { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.3rem; }
.discord-avatar { border-radius: 50%; flex: none; }
.discord-name { font-weight: 600; color: var(--text-secondary); }
.discord-user { color: var(--text-muted); font-size: 0.78rem; }
.auth-unlink {
  font: inherit; font-size: 0.8rem; cursor: pointer; width: 100%;
  padding: 0.35rem 0.6rem; border-radius: var(--radius-sm); margin-bottom: 0.35rem;
  border: 1px solid var(--border); background: var(--card); color: var(--text-secondary);
}
@media (hover: hover) {
  .auth-unlink:hover { border-color: var(--accent); color: var(--accent); }
}

/* ==========================================================
   ポイントと HikaRecet
   ========================================================== */
.wallet-slot { display: flex; align-items: center; }
.wallet-chips { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.wallet-chip {
  display: inline-flex; align-items: baseline; gap: 0.35rem; text-decoration: none;
  padding: 0.2rem 0.62rem; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--border); background: var(--card); color: var(--text-secondary);
  font-size: 0.78rem; transition: var(--transition);
}
.wallet-chip .wallet-label { font-weight: 700; font-size: 0.7rem; letter-spacing: 0.02em; }
.wallet-chip .wallet-value { font-family: var(--font-num); font-weight: 700; color: var(--text-primary); }
.wallet-chip .wallet-unit { font-size: 0.68rem; color: var(--text-muted); }
.wallet-chip.is-point { border-color: rgba(245, 124, 0, 0.35); }
.wallet-chip.is-ticket {
  border-color: rgba(216, 67, 21, 0.4); background: var(--grad-accent); color: #3a1c00;
}
.wallet-chip.is-ticket .wallet-value { color: #3a1c00; }
@media (hover: hover) {
  .wallet-chip:hover { border-color: var(--primary); transform: translateY(-1px); }
}
.wallet-chips.is-large .wallet-chip { font-size: 0.95rem; padding: 0.42rem 1rem; }
.wallet-chips.is-large .wallet-value { font-size: 1.28rem; }
.wallet-next { font-size: 0.74rem; color: var(--text-muted); }

.wallet-box {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 1rem 1.2rem; margin-bottom: 1.6rem;
  border-left: 4px solid var(--primary);
}
.wallet-box.is-page { margin-bottom: 0; }
.wallet-box-main { flex: 1 1 16rem; min-width: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.wallet-box-main h2 { font-size: 1rem; letter-spacing: 0.01em; }
.wallet-box-main p { font-size: 0.84rem; }
.wallet-stats { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.wallet-stat { display: flex; flex-direction: column; line-height: 1.25; }
.wallet-stat strong { font-size: 1rem; }
.wallet-stat span { font-size: 0.7rem; color: var(--text-muted); }
.warn-text { color: var(--accent); }

.play-btn {
  display: inline-flex; align-items: center; gap: 0.45rem; text-decoration: none;
  font: inherit; font-weight: 700; font-size: 0.92rem; cursor: pointer; white-space: nowrap;
  padding: 0.6rem 1.35rem; border-radius: 999px; border: 0;
  background: var(--grad-primary); color: #3a1c00;
  box-shadow: 0 4px 14px rgba(245, 124, 0, 0.3);
  transition: var(--transition);
}
.play-btn.is-quiet { background: var(--card); color: var(--text-secondary); border: 1px solid var(--border); box-shadow: none; }
.play-btn.is-go { width: 100%; justify-content: center; padding: 0.8rem 1.4rem; font-size: 1.02rem; }
.play-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.play-btn-icon { font-size: 1.1rem; }
@media (hover: hover) {
  .play-btn:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 7px 20px rgba(245, 124, 0, 0.4); }
}

/* 付与の知らせ */
.grant-notice {
  display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
  padding: 0.9rem 1.1rem; margin-bottom: 1.4rem;
  border-radius: var(--radius); border: 1px solid rgba(245, 124, 0, 0.4);
  background: linear-gradient(120deg, rgba(255, 204, 0, 0.18), rgba(255, 143, 0, 0.1));
  animation: grant-in 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.grant-notice > div { flex: 1 1 14rem; min-width: 0; }
.grant-notice strong { font-size: 0.98rem; }
.grant-notice p { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.1rem; }
.grant-spark { font-size: 1.5rem; animation: grant-spark 1.6s ease-in-out infinite; }
@keyframes grant-in { from { opacity: 0; transform: translateY(-8px); } }
@keyframes grant-spark { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.18) rotate(12deg); } }

/* ==========================================================
   ゲーム
   ========================================================== */
.game-grid { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.game-card {
  position: relative; overflow: hidden; text-decoration: none;
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
  padding: 1.5rem 1rem 1.2rem; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); transition: var(--transition);
}
.game-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--grad-primary);
}
.game-card.is-horse::before { background: linear-gradient(90deg, #43a047, #8bc34a); }
.game-card.is-pachinko::before { background: linear-gradient(90deg, #e53935, #ff7043); }
.game-card.is-pachislot::before { background: linear-gradient(90deg, #8e24aa, #d81b60); }
.game-card.is-chinchiro::before { background: linear-gradient(90deg, #6d4c41, #ffb300); }
.game-card.is-slot::before { background: linear-gradient(90deg, #3fbfc8, #1e88e5); }
.game-card.is-roulette::before { background: linear-gradient(90deg, #f57c00, #c2352b); }
.game-icon { font-size: 2.4rem; line-height: 1; }
.game-name { font-weight: 700; color: var(--text-primary); }
.game-tag { font-size: 0.74rem; color: var(--text-muted); text-align: center; }
@media (hover: hover) {
  .game-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
  .game-card:hover .game-icon { transform: scale(1.12) rotate(-6deg); transition: transform 0.2s; }
}

.game-card-table { display: flex; flex-direction: column; gap: 1rem; padding: 1.2rem; }
.game-stage {
  position: relative; min-height: 190px; border-radius: var(--radius-sm);
  background: radial-gradient(circle at 50% 0%, #2b1d10, #140d06);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 1rem;
}

.game-outcome {
  display: flex; align-items: center; gap: 0.6rem; min-height: 2.2rem;
  padding: 0.4rem 0.9rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-size: 0.9rem;
}
.game-outcome.is-win { border-color: rgba(47, 168, 79, 0.5); background: rgba(47, 168, 79, 0.1); }
.game-outcome.is-lose { border-color: var(--border); background: var(--bg-secondary); }
.game-outcome.is-push { border-color: var(--border); background: var(--bg-secondary); }
.outcome-mark { font-size: 1.15rem; }
.game-outcome.is-win .outcome-text strong { color: #1e7b38; font-size: 1.15rem; }

.stake-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.stake-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }
.stake-chips { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.stake-chip, .bet-chip {
  font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer;
  padding: 0.28rem 0.7rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card); color: var(--text-secondary);
  transition: var(--transition);
}
.stake-chip[aria-pressed='true'], .bet-chip[aria-pressed='true'] {
  background: var(--grad-primary); color: #3a1c00; border-color: transparent; font-weight: 700;
}
.stake-chip:disabled { opacity: 0.4; cursor: not-allowed; }
.stake-current { margin-left: auto; font-size: 1.1rem; font-weight: 700; }
.stake-current small { font-size: 0.7rem; color: var(--text-muted); margin-left: 0.15rem; }

.bet-controls { display: flex; flex-direction: column; gap: 0.7rem; }
.bet-chips, .bet-modes { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.bet-chip.is-red[aria-pressed='true'] { background: #c2352b; color: #fff; }
.bet-chip.is-black[aria-pressed='true'] { background: #2b2b2b; color: #fff; }
.bet-numbers { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 0.22rem; }
.bet-num {
  font: 0.75rem var(--font-num); font-weight: 700; cursor: pointer; padding: 0.3rem 0;
  border-radius: var(--radius-sm); border: 1px solid transparent; color: #fff;
  transition: var(--transition);
}
.bet-num.is-red { background: #c2352b; }
.bet-num.is-black { background: #2b2b2b; }
.bet-num.is-zero { background: #2fa84f; }
.bet-num[aria-pressed='true'] { outline: 3px solid var(--primary); outline-offset: 1px; transform: scale(1.1); }

.bet-horses { display: grid; gap: 0.35rem; }
.bet-horse {
  display: grid; grid-template-columns: 1.7rem minmax(0, 1fr) auto; align-items: center; gap: 0.6rem;
  font: inherit; font-size: 0.86rem; cursor: pointer; text-align: left;
  padding: 0.42rem 0.6rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-primary);
  transition: var(--transition);
}
.bet-horse[aria-pressed='true'] { border-color: var(--silk); background: var(--card); box-shadow: 0 0 0 3px var(--primary-glow); }
.bet-horse-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.55rem; height: 1.55rem; border-radius: 50%;
  background: var(--silk); color: #fff; font-weight: 700; font-size: 0.78rem;
}
.bet-horse-odds { font-weight: 700; color: var(--accent); }

.odds-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.odds-table th, .odds-table td { padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border); text-align: left; }
.odds-table th { font-size: 0.74rem; color: var(--text-muted); font-weight: 700; }
.odds-table td.num { text-align: right; font-family: var(--font-num); }

/* ---------- スロット ---------- */
.slot-machine { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.slot-window {
  display: flex; gap: 0.5rem; padding: 0.7rem;
  border-radius: var(--radius-sm); background: #0d0904;
  box-shadow: inset 0 0 0 2px rgba(255, 204, 0, 0.35), inset 0 6px 18px rgba(0, 0, 0, 0.7);
}
.slot-reel {
  width: 74px; height: 88px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #fff9e6, #f3e3bd);
  box-shadow: inset 0 -8px 14px rgba(0, 0, 0, 0.16), inset 0 8px 14px rgba(255, 255, 255, 0.7);
  overflow: hidden;
}
.slot-face { font-size: 2.3rem; line-height: 1; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25)); }
.slot-reel.is-spinning .slot-face { animation: reel-blur 0.12s linear infinite; }
.slot-reel.is-landed { animation: reel-land 0.34s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes reel-blur { from { transform: translateY(-70%); opacity: 0.35; } to { transform: translateY(70%); opacity: 0.35; } }
@keyframes reel-land { 0% { transform: translateY(-14px); } 60% { transform: translateY(5px); } 100% { transform: none; } }
.slot-line {
  position: absolute; left: 0; right: 0; top: 50%; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 82, 82, 0.85), transparent);
}
.slot-machine.is-reach .slot-window { animation: reach-shake 0.28s ease-in-out infinite; box-shadow: inset 0 0 0 2px #ff5252, 0 0 26px rgba(255, 82, 82, 0.55); }
.slot-machine.is-win .slot-window { animation: win-glow 0.7s ease-in-out 3; }
@keyframes reach-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@keyframes win-glow {
  0%, 100% { box-shadow: inset 0 0 0 2px rgba(255, 204, 0, 0.35), inset 0 6px 18px rgba(0, 0, 0, 0.7); }
  50% { box-shadow: inset 0 0 0 3px #ffd54f, 0 0 40px rgba(255, 213, 79, 0.75); }
}

/* ---------- パチスロ ---------- */
.pslot { display: flex; flex-direction: column; align-items: center; gap: 0.55rem; width: 100%; }
.pslot-panel { display: flex; align-items: center; gap: 0.6rem; }
.pslot-lamp {
  width: 14px; height: 14px; border-radius: 50%;
  background: #4a3520; box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.6);
}
.pslot.is-win .pslot-lamp { background: #ffd54f; box-shadow: 0 0 16px #ffd54f; animation: lamp 0.45s steps(2) infinite; }
.pslot.is-bonus .pslot-lamp { background: #ff5252; box-shadow: 0 0 22px #ff5252; }
@keyframes lamp { 50% { opacity: 0.3; } }
.pslot-flag {
  font: 0.8rem var(--font-num); font-weight: 700; letter-spacing: 0.08em;
  color: #ffd54f; text-shadow: 0 0 10px rgba(255, 213, 79, 0.5);
}
.pslot-window {
  display: flex; gap: 0.35rem; padding: 0.6rem;
  border-radius: var(--radius-sm); background: #120a14;
  box-shadow: inset 0 0 0 2px rgba(216, 27, 96, 0.5), inset 0 6px 18px rgba(0, 0, 0, 0.8);
}
.pslot-reel {
  width: 66px; height: 80px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #2a1930, #170d1c);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.pslot-face { font-size: 2.1rem; line-height: 1; }
.pslot-reel.is-spinning .pslot-face { animation: reel-blur 0.1s linear infinite; }
.pslot-reel.is-landed { animation: reel-land 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.pslot.is-lever .pslot-window { transform: translateY(3px); }
.pslot.is-reach .pslot-window { animation: reach-shake 0.22s ease-in-out infinite; box-shadow: inset 0 0 0 2px #ff5252, 0 0 30px rgba(255, 82, 82, 0.6); }
.pslot-counter { font-size: 1.5rem; font-weight: 700; color: #ffd54f; min-height: 1.6rem; }
.pslot-counter.is-pop { animation: pop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* ---------- パチンコ ---------- */
.pachi { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; width: 100%; }
.pachi-board {
  position: relative; width: min(100%, 300px); height: 130px;
  border-radius: var(--radius-sm);
  background: radial-gradient(circle at 50% 10%, #1d3350, #0b1524);
  box-shadow: inset 0 0 0 2px rgba(120, 180, 255, 0.28);
  overflow: hidden;
}
.pachi-peg { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #9fc4ef; opacity: 0.7; }
.pachi-ball {
  position: absolute; top: -12px; left: 50%; width: 11px; height: 11px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #b0bec5);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
}
.pachi-ball.is-falling { animation: ball-fall 0.9s cubic-bezier(0.5, 0, 0.8, 1) forwards; }
@keyframes ball-fall {
  0% { top: -12px; }
  30% { transform: translateX(-10px); }
  55% { transform: translateX(12px); }
  80% { transform: translateX(-6px); }
  100% { top: 104px; left: 50%; transform: translateX(-50%); }
}
.pachi-pocket {
  position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%);
  width: 46px; height: 16px; border-radius: 0 0 20px 20px;
  border: 2px solid #ffd54f; border-top: 0;
}
.pachi-digits { display: flex; gap: 0.4rem; }
.pachi-digit {
  width: 52px; height: 64px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; font-weight: 700; color: #ffe082;
  background: #100d1a; box-shadow: inset 0 0 0 2px rgba(255, 224, 130, 0.3);
}
.pachi-digit.is-set { animation: reel-land 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.pachi-digit.is-respin { animation: respin 0.5s ease-in-out; }
@keyframes respin { 0% { transform: rotateX(0); } 50% { transform: rotateX(180deg); } 100% { transform: rotateX(360deg); } }
.pachi.is-reach .pachi-digits { animation: reach-shake 0.2s ease-in-out infinite; }
.pachi.is-reach .pachi-digit { box-shadow: inset 0 0 0 2px #ff5252, 0 0 20px rgba(255, 82, 82, 0.55); }
.pachi.is-hit .pachi-digit { color: #fff; background: linear-gradient(180deg, #ff5252, #ff8f00); animation: win-pulse 0.5s ease-in-out infinite alternate; }
@keyframes win-pulse { to { box-shadow: 0 0 32px rgba(255, 143, 0, 0.9); } }
.pachi-message { min-height: 1.4rem; font-weight: 700; font-size: 1rem; color: #ffd54f; letter-spacing: 0.06em; }
.pachi.is-hit .pachi-message { font-size: 1.3rem; color: #fff; text-shadow: 0 0 16px #ff8f00; animation: pop 0.4s ease-out; }
.pachi-rounds { display: flex; gap: 0.3rem; flex-wrap: wrap; justify-content: center; }
.pachi-round {
  font: 0.7rem var(--font-num); padding: 0.12rem 0.5rem; border-radius: 999px;
  background: rgba(255, 213, 79, 0.18); color: #ffe082;
  animation: grant-in 0.25s ease-out;
}

/* ---------- ルーレット ---------- */
.roul { position: relative; width: 210px; height: 210px; }
.roul-wheel {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, #3a2a18, #1d150c 50%, #3a2a18);
  box-shadow: inset 0 0 0 6px #6b4f2a, 0 8px 26px rgba(0, 0, 0, 0.5);
}
.roul-cell {
  position: absolute; left: 50%; top: 50%; width: 22px; height: 22px;
  margin-left: -11px; margin-top: -11px;
  transform-origin: 50% 50%;
  display: flex; align-items: center; justify-content: center;
  font: 0.62rem var(--font-num); font-weight: 700; text-align: center; color: #fff;
}
.roul-cell.is-red { color: #ff7a6e; }
.roul-cell.is-black { color: #cfd8dc; }
.roul-cell.is-zero { color: #7de08a; }
.roul-ball {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
}
.roul-ball::after {
  content: ''; position: absolute; left: 50%; top: 7%;
  width: 10px; height: 10px; margin-left: -5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #cfd8dc);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
}
.roul-pin {
  position: absolute; left: 50%; top: -4px; transform: translateX(-50%);
  border-left: 8px solid transparent; border-right: 8px solid transparent;
  border-top: 14px solid #ffd54f;
}
.roul-result {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 58px; height: 58px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700; color: #fff;
  background: #1d150c; box-shadow: inset 0 0 0 3px #6b4f2a;
}
.roul-result.is-red { background: #c2352b; }
.roul-result.is-black { background: #222; }
.roul-result.is-green { background: #2fa84f; }
.roul.is-done .roul-result { animation: pop 0.34s cubic-bezier(0.34, 1.56, 0.64, 1); }

@media (max-width: 600px) {
  .slot-reel { width: 60px; height: 72px; }
  .slot-face { font-size: 1.9rem; }
  .pslot-reel { width: 54px; height: 66px; }
  .pslot-face { font-size: 1.7rem; }
  .pachi-digit { width: 44px; height: 54px; font-size: 1.8rem; }
  .roul { width: 176px; height: 176px; }
  .wallet-chips.is-large .wallet-value { font-size: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .slot-reel.is-spinning .slot-face,
  .pslot-reel.is-spinning .pslot-face,
  .grant-spark { animation: none; }
}

/* メンバー一覧のポイント／チケット */
.member-wallet {
  display: flex; gap: 0.8rem; margin-top: 0.5rem; padding-top: 0.5rem;
  border-top: 1px dashed var(--border); font-size: 0.74rem;
}
.member-point, .member-ticket { display: inline-flex; align-items: baseline; gap: 0.3rem; }
.member-point-label { color: var(--text-muted); font-weight: 700; font-size: 0.68rem; }
.member-point .num { font-weight: 700; color: var(--text-secondary); }
.member-ticket .num { font-weight: 700; color: var(--accent); }

/* メンバー一覧の Discord 表示 */
.member-discord {
  display: flex; align-items: center; gap: 0.3rem; margin-top: 0.5rem;
  font-size: 0.72rem; min-width: 0;
}
.member-discord .discord-name { font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.member-discord .discord-user {
  color: var(--text-muted); font-size: 0.68rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.member-discord + .member-wallet { margin-top: 0.35rem; padding-top: 0.35rem; }

/* ==========================================================
   演出
   当たったときだけ出す飾り。段（tier）が上がるほど部品が増える。
   どれも transform / opacity だけで動かす（描き直しを起こさない）。
   ========================================================== */
.fx-layer {
  position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden;
  contain: strict;
}

/* ---------- 紙吹雪・リボン ---------- */
.fx-confetti {
  position: absolute; width: 10px; height: 16px; opacity: 0;
  animation: fx-fall linear forwards;
}
.fx-confetti.is-ribbon { width: 5px; height: 30px; border-radius: 3px; }
.fx-confetti.is-burst { animation-name: fx-burst; }
@keyframes fx-fall {
  0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0); }
  100% { opacity: 0; transform: translate3d(var(--drift), var(--fall), 0) rotate(var(--spin)); }
}
@keyframes fx-burst {
  0% { opacity: 1; transform: translate3d(-50%, -50%, 0) scale(0.2) rotate(0); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(calc(-50% + var(--drift) * 2.4), calc(-50% + var(--fall) * 0.8), 0) scale(1.1) rotate(var(--spin)); }
}

/* ---------- 火花 ---------- */
.fx-spark {
  position: absolute; line-height: 1; opacity: 0;
  animation: fx-spark 1.3s cubic-bezier(0.15, 0.8, 0.3, 1) forwards;
  text-shadow: 0 0 12px currentColor;
}
@keyframes fx-spark {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.3) rotate(0); }
  60% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.4) rotate(220deg); }
}

/* ---------- 花火 ---------- */
.fx-firework {
  position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  background: radial-gradient(circle, var(--c1), var(--c2));
  animation: fx-firework 1s ease-out forwards;
}
@keyframes fx-firework {
  0% { opacity: 1; transform: scale(0.4); box-shadow: 0 0 0 0 var(--c1); }
  100% { opacity: 0; transform: scale(4); box-shadow: 0 0 60px 30px transparent; }
}

/* ---------- 衝撃波 ---------- */
/* 拡大率を上げすぎると線が太って円盤に見えるので、元を大きく・倍率を控えめに。 */
.fx-shock {
  position: absolute; left: 50%; top: 45%; width: 220px; height: 220px;
  margin: -110px 0 0 -110px; border-radius: 50%;
  border: 3px solid #fff;
  animation: fx-shock 0.9s cubic-bezier(0.1, 0.7, 0.2, 1) forwards;
}
@keyframes fx-shock {
  0% { opacity: 0.9; transform: scale(0.15); border-width: 6px; }
  100% { opacity: 0; transform: scale(7); border-width: 1px; }
}

/* ---------- 放射光（集中線） ---------- */
.fx-rays {
  position: absolute; left: 50%; top: 45%; width: 220vmax; height: 220vmax;
  margin: -110vmax 0 0 -110vmax; opacity: 0;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 255, 255, 0.5) 0deg 3deg,
    transparent 3deg 9deg);
  animation: fx-rays linear forwards;
}
.fx-rays.is-hue {
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 213, 79, 0.62) 0deg 3deg,
    rgba(255, 64, 129, 0.45) 3deg 6deg,
    transparent 6deg 12deg);
}
@keyframes fx-rays {
  0% { opacity: 0; transform: rotate(0) scale(0.3); }
  12% { opacity: 0.62; }
  75% { opacity: 0.34; }
  100% { opacity: 0; transform: rotate(160deg) scale(1); }
}

/* ---------- 虹色の洗い ---------- */
.fx-wash {
  position: absolute; inset: -20%;
  background: conic-gradient(#ff5252, #ffd54f, #69f0ae, #18ffff, #7c4dff, #e040fb, #ff5252);
  mix-blend-mode: hue; opacity: 0;
  animation: fx-wash linear forwards;
}
/* かけすぎると下の数字が読めなくなる。色が回っているのが分かる程度に留める。 */
@keyframes fx-wash {
  0% { opacity: 0; transform: rotate(0); }
  15% { opacity: 0.5; }
  70% { opacity: 0.28; }
  100% { opacity: 0; transform: rotate(180deg); }
}

/* ---------- 画面の縁が光る ---------- */
.fx-edge {
  position: absolute; inset: 0;
  box-shadow: inset 0 0 0 0 transparent;
  animation: fx-edge ease-in-out infinite alternate;
}
@keyframes fx-edge {
  0% { box-shadow: inset 0 0 40px 6px rgba(255, 213, 79, 0.55); }
  100% { box-shadow: inset 0 0 110px 26px rgba(255, 64, 129, 0.75); }
}

/* ---------- コイン・宝石 ---------- */
.fx-coin {
  position: absolute; top: -10vh; line-height: 1; opacity: 0;
  animation: fx-coin linear forwards;
  filter: drop-shadow(0 2px 8px rgba(255, 180, 0, 0.8));
}
@keyframes fx-coin {
  0% { opacity: 0; transform: translate(0, 0) rotate(0); }
  8% { opacity: 1; }
  100% { opacity: 0.85; transform: translate(var(--sway), 118vh) rotate(900deg); }
}

/* ---------- フラッシュ ---------- */
.fx-flash { position: absolute; inset: 0; opacity: 0; animation: fx-flash 0.62s ease-out forwards; }
@keyframes fx-flash { 0% { opacity: 0.95; } 100% { opacity: 0; } }

/* ---------- 特大の文字 ---------- */
/* 素の状態で「そのまま見える」ようにしておく。動きは is-live が持つ。
   こうしておけば、アニメーションが間引かれても文字だけは必ず出る。 */
.fx-cutin {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  text-align: center; white-space: nowrap;
}
.fx-cutin.is-live { animation: fx-cutin 2.1s cubic-bezier(0.18, 0.9, 0.3, 1) forwards; }
.fx-cutin-main {
  display: inline-flex;
  font-size: min(clamp(2.6rem, 12vw, 6.4rem), var(--fit, 99rem)); font-weight: 900; letter-spacing: 0.02em; line-height: 1;
  color: #ffd54f;
  -webkit-text-stroke: 3px #3a1c00; paint-order: stroke fill;
}
.fx-ch { display: inline-block; }
.fx-cutin.is-live .fx-ch { animation: fx-ch 0.6s cubic-bezier(0.34, 1.8, 0.5, 1) backwards; }
@keyframes fx-ch {
  0% { transform: translateY(-60px) scale(2.2) rotate(-14deg); opacity: 0; }
  60% { transform: translateY(6px) scale(0.92) rotate(3deg); opacity: 1; }
  100% { transform: none; opacity: 1; }
}
.fx-cutin-sub {
  font-size: clamp(1rem, 3.8vw, 1.8rem); font-weight: 800; color: #fff;
  -webkit-text-stroke: 2px #3a1c00; paint-order: stroke fill;
}
.fx-cutin.is-live.is-mid .fx-cutin-main {
  color: #ffe082; filter: drop-shadow(0 0 18px rgba(255, 213, 79, 0.9));
}
.fx-cutin.is-live.is-chance .fx-cutin-main {
  color: #ff5252; filter: drop-shadow(0 0 20px rgba(255, 82, 82, 0.9));
  animation: fx-cutin-chance 0.28s steps(2) infinite;
}
@keyframes fx-cutin-chance { 50% { color: #fff; } }
/* 大勝ちは文字そのものを虹色に流す。 */
/* 背後で色が回っていても読めるよう、文字の下に暗い板を敷く。 */
.fx-cutin::before {
  content: ''; position: absolute; inset: -14% -8%;
  background: radial-gradient(ellipse at center, rgba(28, 14, 0, 0.55), transparent 72%);
  z-index: -1;
}
.fx-cutin.is-live.is-big .fx-cutin-main,
.fx-cutin.is-live.is-mega .fx-cutin-main {
  background: linear-gradient(100deg, #fff6b0, #ffb300 25%, #ff4081 50%, #7c4dff 75%, #18ffff);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 26px rgba(255, 193, 7, 0.95));
  animation: fx-slide 1.1s linear infinite;
}
.fx-cutin.is-live.is-mega .fx-cutin-main {
  font-size: min(clamp(2.8rem, 14vw, 7.6rem), var(--fit, 99rem));
  filter: drop-shadow(0 0 38px rgba(255, 64, 129, 0.95));
  animation: fx-slide 0.7s linear infinite, fx-mega-pulse 0.5s ease-in-out infinite alternate;
}
@keyframes fx-slide { to { background-position: 300% 0; } }
@keyframes fx-mega-pulse { to { transform: scale(1.07); } }
@keyframes fx-cutin {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.55) rotate(-5deg); }
  14% { opacity: 1; transform: translate(-50%, -50%) scale(1.2) rotate(2deg); }
  24% { transform: translate(-50%, -50%) scale(0.97) rotate(0); }
  32% { transform: translate(-50%, -50%) scale(1.05); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -64%) scale(1.12); }
}

/* ---------- 画面を揺らす・寄る ---------- */
.fx-shake-1 { animation: fx-shake 0.4s ease-in-out; }
.fx-shake-2 { animation: fx-shake 0.6s ease-in-out; --amp: 9px; }
.fx-shake-3 { animation: fx-shake 0.8s ease-in-out; --amp: 17px; }
@keyframes fx-shake {
  0%, 100% { transform: translate(0, 0); }
  12% { transform: translate(calc(var(--amp, 5px) * -1), 3px) rotate(-0.6deg); }
  26% { transform: translate(var(--amp, 5px), -3px) rotate(0.6deg); }
  40% { transform: translate(calc(var(--amp, 5px) * -0.8), 2px) rotate(-0.4deg); }
  54% { transform: translate(calc(var(--amp, 5px) * 0.8), -2px) rotate(0.4deg); }
  70% { transform: translate(calc(var(--amp, 5px) * -0.4), 1px); }
  86% { transform: translate(calc(var(--amp, 5px) * 0.2), 0); }
}
.fx-zoom { animation: fx-zoom 0.6s cubic-bezier(0.22, 1.4, 0.4, 1); }
@keyframes fx-zoom {
  0% { transform: scale(1); }
  22% { transform: scale(1.055); }
  100% { transform: scale(1); }
}

/* ---------- 台そのものの光り方 ---------- */
.fx-glow-1 { box-shadow: inset 0 0 0 2px rgba(255, 213, 79, 0.7), 0 0 26px rgba(255, 213, 79, 0.5); }
.fx-glow-2 {
  box-shadow: inset 0 0 0 3px #ffd54f, 0 0 46px rgba(255, 193, 7, 0.7);
  animation: fx-glow 0.5s ease-in-out 5;
}
.fx-glow-3 { animation: fx-glow-big 0.36s linear 11; }
.fx-glow-4 { animation: fx-glow-big 0.2s linear 22; }
@keyframes fx-glow { 50% { box-shadow: inset 0 0 0 5px #fff3b0, 0 0 78px rgba(255, 213, 79, 1); } }
@keyframes fx-glow-big {
  0% { box-shadow: inset 0 0 0 4px #ff5252, 0 0 70px rgba(255, 82, 82, 0.9); }
  25% { box-shadow: inset 0 0 0 4px #ffd54f, 0 0 70px rgba(255, 213, 79, 0.95); }
  50% { box-shadow: inset 0 0 0 4px #69f0ae, 0 0 70px rgba(105, 240, 174, 0.95); }
  75% { box-shadow: inset 0 0 0 4px #7c4dff, 0 0 70px rgba(124, 77, 255, 0.95); }
  100% { box-shadow: inset 0 0 0 4px #ff5252, 0 0 70px rgba(255, 82, 82, 0.9); }
}

/* ---------- ゲームごとの煽り ---------- */
.slot-machine.is-superreach .slot-window {
  animation: reach-shake 0.12s ease-in-out infinite;
  box-shadow: inset 0 0 0 3px #ffd54f, 0 0 56px rgba(255, 213, 79, 0.95);
}
.slot-machine.is-superreach .slot-reel.is-spinning .slot-face { animation-duration: 0.06s; }
.pachi.is-superreach .pachi-board { animation: fx-shake 0.28s ease-in-out infinite; --amp: 5px; }
.pachi.is-superreach .pachi-digit {
  box-shadow: inset 0 0 0 3px #ff5252, 0 0 34px rgba(255, 82, 82, 0.9);
  animation: fx-cutin-chance 0.2s steps(2) infinite;
}
.roul.is-settling .roul-ball::after { animation: fx-ball-bounce 0.28s ease-in-out infinite; }
@keyframes fx-ball-bounce { 50% { transform: translateY(6px) scale(1.2); } }
.roul-cell.is-hit {
  background: #ffd54f; color: #3a1c00; border-radius: 50%;
  box-shadow: 0 0 22px #ffd54f; animation: pop 0.4s ease-out;
}
@keyframes fx-goal { 50% { box-shadow: 0 0 30px #fff; } }

/* 動きを控える設定の人には、光り方と揺れを出さない。 */
@media (prefers-reduced-motion: reduce) {
  .fx-cutin.is-live { animation: none; opacity: 1; }
  .fx-cutin.is-live .fx-ch { animation: none; }
  .fx-shake-1, .fx-shake-2, .fx-shake-3, .fx-zoom,
  .fx-glow-2, .fx-glow-3, .fx-glow-4,
  .slot-machine.is-superreach .slot-window,
  .pachi.is-superreach .pachi-board,
  .pachi.is-superreach .pachi-digit,
  }

/* ---------- ポイントの内訳 ---------- */
.point-card { padding: 1.05rem 1.15rem 0.4rem; }
.point-rate-row {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding-bottom: 0.85rem; margin-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.point-rate-main { display: flex; flex-direction: column; gap: 0.12rem; }
.point-rate-label { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.02em; }
.point-rate-main strong { font-size: 1rem; color: var(--primary); }
.point-rate-facts { display: flex; gap: 1.2rem; margin-left: auto; }
.point-rate-facts > div { display: flex; flex-direction: column; line-height: 1.25; }
.point-rate-facts strong { font-size: 1.05rem; font-family: var(--font-num); }
.point-rate-facts span { font-size: 0.68rem; color: var(--text-muted); }

.point-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; table-layout: fixed; }
.point-table th, .point-table td {
  padding: 0.42rem 0.4rem; border-bottom: 1px solid var(--border); text-align: left;
}
.point-table th { font-size: 0.7rem; color: var(--text-muted); font-weight: 700; }
.point-table .num { text-align: right; font-family: var(--font-num); }
/* 幅を決めておく。数字の桁で列が動くと読みにくい。 */
.point-table th:nth-child(2), .point-table td:nth-child(2) { width: 30%; }
.point-table th:nth-child(3), .point-table td:nth-child(3) { width: 4.6rem; }
.point-table th:nth-child(4), .point-table td:nth-child(4) { width: 30%; }
.point-name { display: block; overflow-wrap: anywhere; }
.point-note { display: block; font-size: 0.66rem; color: var(--text-muted); }
.point-rate { color: var(--text-muted); }

/* 稼ぎの大きさを棒で見せる。数字だけだと差が掴みにくい。 */
.point-gain { position: relative; }
.point-bar {
  position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%);
  height: 1.35rem; border-radius: 4px;
  background: linear-gradient(90deg, rgba(245, 124, 0, 0.12), rgba(245, 124, 0, 0.32));
}
.point-gain-value { position: relative; font-weight: 700; }
.point-table tfoot td {
  border-bottom: 0; padding-top: 0.6rem; font-weight: 700; font-size: 0.92rem;
}
.point-table tfoot td:last-child { color: var(--primary); }

@media (max-width: 560px) {
  .point-table { font-size: 0.78rem; }
  .point-table th:nth-child(2), .point-table td:nth-child(2) { width: 26%; }
  .point-table th:nth-child(3), .point-table td:nth-child(3) { width: 3.6rem; }
  .point-rate-facts { margin-left: 0; }
}

/* ==========================================================
   虹色の演出（追加分）
   ========================================================== */

/* 当たりの瞬間、ページ全体の色相を回す。 */
.fx-hue { animation: fx-hue var(--fx-hue-ms, 3000ms) linear; }
@keyframes fx-hue {
  0% { filter: hue-rotate(0deg) saturate(1); }
  10% { filter: hue-rotate(60deg) saturate(1.8) brightness(1.08); }
  50% { filter: hue-rotate(200deg) saturate(2.2) brightness(1.12); }
  90% { filter: hue-rotate(340deg) saturate(1.6); }
  100% { filter: hue-rotate(360deg) saturate(1); }
}

/* 画面の縁を回る虹の枠。 */
.fx-frame {
  position: absolute; inset: 0; opacity: 0;
  padding: 10px;
  background: conic-gradient(from 0deg, #ff5252, #ffd54f, #69f0ae, #18ffff, #7c4dff, #e040fb, #ff5252);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: fx-frame linear forwards;
  filter: blur(1px) drop-shadow(0 0 18px #fff);
}
@keyframes fx-frame {
  0% { opacity: 0; filter: hue-rotate(0deg) blur(1px); }
  8% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; filter: hue-rotate(720deg) blur(1px); }
}

.fx-emoji { filter: drop-shadow(0 3px 10px rgba(255, 255, 255, 0.7)); }

/* 放射光を虹色に。 */
.fx-rays.is-hue {
  background: repeating-conic-gradient(
    from 0deg,
    hsla(0, 100%, 65%, 0.55) 0deg 3deg,
    hsla(60, 100%, 60%, 0.5) 3deg 6deg,
    hsla(150, 100%, 60%, 0.45) 6deg 9deg,
    hsla(220, 100%, 65%, 0.5) 9deg 12deg,
    hsla(290, 100%, 65%, 0.5) 12deg 15deg,
    transparent 15deg 20deg);
}

/* WIN!! も虹色に流す。 */
.fx-cutin.is-live.is-mid .fx-cutin-main {
  background: linear-gradient(100deg, #ffe082, #ff4081, #7c4dff, #18ffff, #69f0ae, #ffe082);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(255, 64, 129, 0.8));
  animation: fx-slide 0.9s linear infinite;
}

/* ---------- 特大の数え上げ ---------- */
.fx-count {
  position: absolute; left: 50%; top: 62%; transform: translate(-50%, -50%);
  display: flex; align-items: baseline; gap: 0.35rem; white-space: nowrap;
  font-weight: 900; line-height: 1;
  -webkit-text-stroke: 3px #2a1200; paint-order: stroke fill;
  color: #fff6b0;
}
.fx-count::before {
  content: ''; position: absolute; inset: -30% -12%; z-index: -1;
  background: radial-gradient(ellipse at center, rgba(28, 10, 0, 0.6), transparent 70%);
}
.fx-count-num {
  font-family: var(--font-num);
  background: linear-gradient(100deg, #fff6b0, #ffb300, #ff4081, #7c4dff, #18ffff, #69f0ae, #fff6b0);
  background-size: 400% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: fx-slide 0.8s linear infinite;
  filter: drop-shadow(0 0 20px rgba(255, 213, 79, 0.9));
}
.fx-count-plus { color: #ffd54f; }
.fx-count-unit { font-size: 0.32em; color: #fff; -webkit-text-stroke: 1.5px #2a1200; }
.fx-count.is-small { font-size: clamp(1.8rem, 7vw, 3rem); top: 58%; }
.fx-count.is-mid { font-size: clamp(2.4rem, 10vw, 4.6rem); }
.fx-count.is-big { font-size: clamp(3rem, 13vw, 6.4rem); }
.fx-count.is-mega { font-size: clamp(3.4rem, 15vw, 7.6rem); }
.fx-count.is-live { animation: fx-count-in 0.35s cubic-bezier(0.34, 1.7, 0.5, 1); }
.fx-count.is-done { animation: fx-count-done 1.5s ease-out forwards; }
@keyframes fx-count-in {
  from { transform: translate(-50%, -50%) scale(0.3); }
  to { transform: translate(-50%, -50%) scale(1); }
}
@keyframes fx-count-done {
  0% { transform: translate(-50%, -50%) scale(1); }
  12% { transform: translate(-50%, -50%) scale(1.25); }
  24% { transform: translate(-50%, -50%) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(1.05); }
}

/* ---------- 連勝 ---------- */
.fx-combo {
  position: absolute; left: 50%; top: 18%; transform: translate(-50%, -50%);
  display: flex; align-items: baseline; gap: 0.3rem;
  font-weight: 900; white-space: nowrap; color: #fff;
  -webkit-text-stroke: 2px #2a1200; paint-order: stroke fill;
}
.fx-combo-n { font-size: clamp(2.6rem, 9vw, 4.2rem); color: #ffd54f; }
.fx-combo-label { font-size: clamp(1.1rem, 4vw, 1.8rem); }
.fx-combo.is-hot .fx-combo-n {
  background: linear-gradient(100deg, #ff5252, #ffd54f, #69f0ae, #18ffff, #e040fb, #ff5252);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: fx-slide 0.6s linear infinite;
}
.fx-combo.is-live { animation: fx-combo 1.55s cubic-bezier(0.2, 1.4, 0.4, 1) forwards; }
@keyframes fx-combo {
  0% { transform: translate(-50%, -50%) scale(0.2) rotate(-12deg); }
  18% { transform: translate(-50%, -50%) scale(1.25) rotate(4deg); }
  30% { transform: translate(-50%, -50%) scale(1) rotate(0); }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -110%) scale(1); }
}

/* ---------- フィーバー（連勝中の台） ---------- */
.game-stage.is-fever { position: relative; }
.game-stage.is-fever::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  padding: 4px;
  background: conic-gradient(from var(--fever-a, 0deg), #ff5252, #ffd54f, #69f0ae, #18ffff, #7c4dff, #e040fb, #ff5252);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: fx-fever 1.4s linear infinite;
}
@keyframes fx-fever { to { filter: hue-rotate(360deg); } }
.fever-badge {
  position: absolute; top: 8px; right: 10px; z-index: 2;
  font: 900 0.8rem/1 var(--font-num); letter-spacing: 0.12em;
  padding: 0.3rem 0.6rem; border-radius: 999px; color: #fff;
  background: linear-gradient(90deg, #ff5252, #ffd54f, #69f0ae, #18ffff, #7c4dff, #e040fb);
  background-size: 300% 100%;
  animation: fx-slide 1s linear infinite;
  -webkit-text-stroke: 0.6px #2a1200;
}

/* ---------- 今回の遊び（収支・連勝・履歴） ---------- */
.session-bar {
  display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap;
  padding: 0.55rem 0.8rem; border-radius: var(--radius-sm);
  background: var(--bg-secondary); border: 1px solid var(--border);
  font-size: 0.8rem;
}
.session-fact { display: flex; flex-direction: column; line-height: 1.2; }
.session-fact strong { font-family: var(--font-num); font-size: 1rem; }
.session-fact span { font-size: 0.66rem; color: var(--text-muted); }
.session-fact.is-up strong { color: #1e7b38; }
.session-fact.is-down strong { color: var(--accent); }
.session-history { display: flex; gap: 3px; flex-wrap: wrap; margin-left: auto; }
.session-chip {
  min-width: 1.9rem; padding: 0.12rem 0.3rem; border-radius: 5px; text-align: center;
  font: 700 0.64rem/1.4 var(--font-num); color: #fff; background: #9e9e9e;
}
.session-chip.is-win { background: #2fa84f; }
.session-chip.is-big {
  background: linear-gradient(90deg, #ff5252, #ffd54f, #69f0ae, #18ffff, #7c4dff);
  background-size: 300% 100%; animation: fx-slide 1.2s linear infinite;
}
.session-chip.is-push { background: #bdbdbd; }

.game-tools { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.tool-btn {
  font: inherit; font-size: 0.78rem; font-weight: 700; cursor: pointer;
  padding: 0.32rem 0.8rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card); color: var(--text-secondary);
}
.tool-btn[aria-pressed='true'] { background: var(--grad-primary); color: #3a1c00; border-color: transparent; }
.tool-btn.is-stop { background: var(--accent); color: #fff; border-color: transparent; }
.tool-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.tool-hint { font-size: 0.7rem; color: var(--text-muted); margin-left: auto; }

@media (prefers-reduced-motion: reduce) {
  .fx-hue, .game-stage.is-fever::after, .fx-combo.is-live, .fx-count.is-live, .fx-count.is-done { animation: none; }
}
.stage-wrap { position: relative; }

/* ==========================================================
   ルーレットの盤面
   ========================================================== */
.rt-hint { font-size: 0.74rem; color: var(--text-muted); }
.rt-table {
  display: grid; gap: 3px;
  grid-template-columns: 1.1fr repeat(12, 1fr);
  grid-template-rows: repeat(3, 2.6rem) 2.2rem 2.2rem;
  padding: 6px; border-radius: var(--radius-sm);
  background: radial-gradient(circle at 50% 30%, #1f6b3a, #0f3d20);
  box-shadow: inset 0 0 0 3px #6b4f2a;
}
.rt-cell {
  grid-column: var(--c); grid-row: var(--r);
  position: relative; display: flex; align-items: center; justify-content: center;
  font: 700 0.82rem/1 var(--font-num); color: #fff; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 4px;
  background: transparent; transition: transform 0.08s ease, box-shadow 0.12s ease;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.rt-cell.is-red { background: #b3261e; }
.rt-cell.is-black { background: #1f1f1f; }
.rt-cell.is-zero { background: #1c8a45; font-size: 1rem; }
.rt-cell.is-outside { background: rgba(255, 255, 255, 0.06); font-size: 0.74rem; }
.rt-cell.is-red-bet .rt-label { color: #ff5252; font-size: 1.1rem; }
.rt-cell.is-black-bet .rt-label { color: #000; font-size: 1.1rem; text-shadow: 0 0 2px #fff; }
.rt-cell:not(:disabled):active { transform: scale(0.94); }
@media (hover: hover) {
  .rt-cell:not(:disabled):hover { box-shadow: inset 0 0 0 2px #ffd54f; }
}
.rt-cell.is-hit {
  box-shadow: inset 0 0 0 3px #ffd54f, 0 0 16px #ffd54f; z-index: 1;
  animation: rt-hit 0.6s ease-in-out 4;
}
@keyframes rt-hit { 50% { box-shadow: inset 0 0 0 3px #fff, 0 0 26px #fff176; } }
.rt-chip {
  position: absolute; right: 2px; bottom: 2px; min-width: 1.35rem; height: 1.35rem; padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px; font-size: 0.64rem; color: #3a1c00;
  background: radial-gradient(circle at 35% 30%, #fff6b0, #ffb300);
  border: 2px dashed #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  animation: pop 0.2s ease-out;
}
.rt-tools { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.rt-total { margin-right: auto; font-size: 0.86rem; }
.rt-total strong { font-size: 1.1rem; }
/* 狭い画面では縦に並べる（本物のアプリと同じ向き）。 */
@media (max-width: 640px) {
  .rt-table {
    grid-template-columns: repeat(3, 1fr) 1.3fr 1.3fr;
    grid-template-rows: 2.3rem repeat(12, 2.2rem);
  }
  .rt-cell { grid-column: var(--mc); grid-row: var(--mr); }
  .rt-cell.is-outside { writing-mode: vertical-rl; font-size: 0.7rem; }
}

/* ==========================================================
   競馬の出走表
   ========================================================== */
.hf-note { font-size: 0.78rem; color: var(--text-secondary); }
.hf-table { display: grid; gap: 3px; }
.hf-head, .hf-row {
  display: grid; align-items: center; gap: 0.5rem;
  grid-template-columns: 1.8rem minmax(0, 1.6fr) 3.4rem 4.6rem 4.6rem 3rem 2.4rem;
}
.hf-head { font-size: 0.66rem; color: var(--text-muted); font-weight: 700; padding: 0 0.5rem; }
.hf-row {
  font: inherit; text-align: left; cursor: pointer;
  padding: 0.45rem 0.5rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-primary);
  transition: var(--transition);
}
.hf-row.is-picked { background: var(--card); border-color: var(--silk); box-shadow: 0 0 0 3px var(--primary-glow); }
@media (hover: hover) { .hf-row:hover { border-color: var(--silk); } }
.hf-no {
  width: 1.6rem; height: 1.6rem; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--silk); color: #fff; font: 700 0.8rem var(--font-num);
}
.hf-name { display: flex; flex-direction: column; min-width: 0; }
.hf-name strong { font-size: 0.84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hf-name small { font-size: 0.66rem; color: var(--text-muted); }
.hf-cond { font-size: 0.72rem; font-weight: 700; text-align: center; padding: 0.1rem 0; border-radius: 4px; }
.hf-cond.is-0 { background: #ffebee; color: #c62828; }
.hf-cond.is-1 { background: #fff3e0; color: #e65100; }
.hf-cond.is-2 { background: #f1f1f1; color: #616161; }
.hf-cond.is-3 { background: #e3f2fd; color: #1565c0; }
.hf-stat { display: flex; flex-direction: column; font-size: 0.72rem; color: #f5a623; letter-spacing: -0.05em; }
.hf-stat small { font-size: 0.58rem; color: var(--text-muted); letter-spacing: 0; }
.hf-odds { font-weight: 700; color: var(--accent); text-align: right; }
.hf-mark { font-weight: 800; color: var(--primary); text-align: center; font-size: 0.8rem; }
.hf-ticket {
  padding: 0.55rem 0.8rem; border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #fff8e1, #fff); border: 1px dashed var(--primary);
  font-size: 0.9rem;
}
.hf-ticket-odds { font-weight: 800; color: var(--accent); }
@media (max-width: 640px) {
  .hf-head, .hf-row { grid-template-columns: 1.6rem minmax(0, 1fr) 3rem 2.6rem 2rem; }
  .hf-head span:nth-child(4), .hf-head span:nth-child(5),
  .hf-row .hf-stat { display: none; }
}

/* ==========================================================
   ハイ＆ロー
   ========================================================== */
.hl-table {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; justify-items: center;
  gap: 0.8rem; width: 100%; padding: 0.6rem 0;
}
.hl-slot { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.hl-slot-label { font: 800 0.7rem var(--font-num); letter-spacing: 0.2em; color: #ffd54f; }
.hl-vs { font: 900 1.4rem var(--font-num); color: #fff; opacity: 0.6; }
.hl-card {
  position: relative; width: 96px; height: 136px; border-radius: 10px;
  background: linear-gradient(160deg, #fff, #f1ede4); color: #1a1a1a;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5), inset 0 0 0 2px #e0d6c2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.hl-card.is-red { color: #c62828; }
.hl-corner { position: absolute; top: 6px; left: 8px; font: 800 0.86rem var(--font-num); }
.hl-rank { font: 900 2.6rem/1 var(--font-num); }
.hl-suit { font-size: 1.8rem; line-height: 1; }
.hl-card.is-back {
  background: repeating-linear-gradient(45deg, #7c4dff 0 8px, #5e35b1 8px 16px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5), inset 0 0 0 4px #fff;
  color: #fff;
}
.hl-back-mark { font: 900 2.6rem var(--font-num); text-shadow: 0 0 12px #e040fb; }
.hl-card.is-tense { animation: reach-shake 0.1s ease-in-out infinite; box-shadow: 0 0 30px #e040fb, inset 0 0 0 4px #fff; }
.hl-card.is-flip { animation: hl-flip 0.26s ease-in forwards; }
.hl-card.is-reveal { animation: hl-reveal 0.3s cubic-bezier(0.34, 1.6, 0.5, 1); }
@keyframes hl-flip { to { transform: rotateY(90deg) scale(1.05); } }
@keyframes hl-reveal { from { transform: rotateY(-90deg) scale(1.1); } to { transform: none; } }
.hl-table.is-win .hl-next .hl-card { box-shadow: 0 0 36px #ffd54f, inset 0 0 0 3px #ffd54f; }
.hl-table.is-lose .hl-next .hl-card { filter: grayscale(0.5); }
.hl-message { grid-column: 1 / -1; min-height: 1.6rem; font: 900 1.2rem var(--font-num); color: #fff; text-shadow: 0 0 12px #ff4081; }
.hl-guesses { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.hl-guess {
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  font: inherit; cursor: pointer; padding: 0.8rem; border-radius: var(--radius);
  border: 0; color: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2); transition: var(--transition);
}
.hl-guess strong { font: 900 1.25rem var(--font-num); letter-spacing: 0.06em; }
.hl-guess .num { font-size: 0.95rem; opacity: 0.95; }
.hl-guess.is-high { background: linear-gradient(135deg, #ff5252, #ff8f00); }
.hl-guess.is-low { background: linear-gradient(135deg, #2979ff, #00bfa5); }
.hl-guess:disabled { opacity: 0.4; cursor: not-allowed; }
@media (hover: hover) { .hl-guess:not(:disabled):hover { transform: translateY(-2px) scale(1.02); } }

/* ---------- ダブルアップ ---------- */
.double-offer {
  display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap;
  padding: 0.7rem 0.9rem; border-radius: var(--radius);
  background: linear-gradient(110deg, #311b92, #6a1b9a 45%, #ad1457);
  color: #fff; box-shadow: 0 6px 20px rgba(106, 27, 154, 0.35);
  animation: grant-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.double-icon { font-size: 1.8rem; animation: grant-spark 1.2s ease-in-out infinite; }
.double-text { display: flex; flex-direction: column; flex: 1 1 12rem; }
.double-text strong { font-size: 1rem; }
.double-text span { font-size: 0.8rem; opacity: 0.9; }
.double-offer .expand-btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.play-btn.is-double {
  background: linear-gradient(90deg, #ffd54f, #ff4081, #7c4dff, #ffd54f);
  background-size: 300% 100%; animation: fx-slide 1.6s linear infinite; color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.dbl-backdrop {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  padding: 1rem; background: rgba(10, 4, 20, 0.72); backdrop-filter: blur(4px);
  animation: grant-in 0.25s ease-out;
}
.dbl-modal {
  width: min(460px, 100%); display: flex; flex-direction: column; gap: 0.8rem;
  padding: 1.1rem; border-radius: 18px;
  background: linear-gradient(160deg, #1a0b2e, #2d0f3f);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 0 0 2px rgba(224, 64, 251, 0.5);
  color: #fff;
}
.dbl-title {
  text-align: center; font: 900 1.6rem var(--font-num); letter-spacing: 0.2em;
  background: linear-gradient(90deg, #ffd54f, #ff4081, #7c4dff, #18ffff, #ffd54f);
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: fx-slide 1.4s linear infinite;
}
.dbl-info { display: flex; align-items: baseline; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.dbl-info strong { font-size: 1.6rem; color: #ffd54f; }
.dbl-streak { font-weight: 800; color: #18ffff; }
.dbl-lost { color: #ff8a80; font-weight: 700; }
.dbl-stage { min-height: 170px; }
.dbl-actions { display: flex; flex-direction: column; gap: 0.5rem; }
.dbl-actions .expand-btn { align-self: center; background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.dbl-actions .play-btn { justify-content: center; }

/* ==========================================================
   競馬（走り）
   ========================================================== */
.game-stage.is-horse { padding: 0.6rem; align-items: stretch; }
.rc { width: 100%; display: flex; flex-direction: column; gap: 0.5rem; }
.rc-top { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.rc-commentary {
  flex: 1 1 14rem; min-height: 1.6rem; padding: 0.3rem 0.7rem; border-radius: 6px;
  background: rgba(0, 0, 0, 0.45); color: #fff; font-weight: 800; font-size: 0.86rem;
  box-shadow: inset 0 0 0 1px rgba(255, 213, 79, 0.4);
}
.rc-standings { display: flex; gap: 3px; }
.rc-pos {
  width: 1.5rem; height: 1.5rem; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font: 800 0.72rem var(--font-num); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
  transition: order 0.2s;
}
.rc-track {
  position: relative; display: grid; gap: 2px; padding: 6px 44px 6px 6px; border-radius: 8px; overflow: hidden;
  background: #2e7d32;
  box-shadow: inset 0 3px 0 #fff, inset 0 -3px 0 #fff;
}
/* 走っているあいだ、地面の縞が後ろへ流れて速さが出る。 */
.rc-ground {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 40px, rgba(0, 0, 0, 0.06) 40px 80px);
}
.rc.is-running .rc-ground { animation: rc-ground 0.5s linear infinite; }
@keyframes rc-ground { to { background-position: -80px 0; } }
.rc-lane {
  position: relative; height: 30px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.28);
}
.rc-runner {
  position: absolute; top: 50%;
  left: calc(var(--x) * (100% - 40px));
  transform: translateY(-50%);
  display: flex; align-items: center; gap: 2px;
  will-change: left;
}
/* 🏇 は左を向いて描かれていることが多いので、右向きに直す。 */
.rc-horse { display: inline-block; font-size: 1.55rem; line-height: 1; transform: scaleX(-1); }
.rc.is-running .rc-horse { animation: rc-gallop 0.24s ease-in-out infinite; }
@keyframes rc-gallop {
  0%, 100% { transform: scaleX(-1) translateY(0) rotate(0); }
  50% { transform: scaleX(-1) translateY(-4px) rotate(-4deg); }
}
.rc-bib {
  width: 1.15rem; height: 1.15rem; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--silk); color: #fff; font: 800 0.62rem var(--font-num); box-shadow: 0 0 0 1.5px #fff;
}
/* 自分が選んだ馬。レーンごと金色に光らせ、馬の後ろに光の輪、走っている間は光の尾を引く。
   6 頭が同じ絵なので、ひと目で「自分の馬はどれか」が分かるようにする。 */
.rc-lane.is-mine {
  z-index: 1; border-radius: 5px;
  background: linear-gradient(90deg, rgba(255, 213, 79, 0.06), rgba(255, 213, 79, 0.34));
  box-shadow: inset 0 0 0 1.5px rgba(255, 240, 170, 0.9), 0 0 14px rgba(255, 213, 79, 0.6);
  animation: rc-mine-lane 1s ease-in-out infinite;
}
@keyframes rc-mine-lane {
  50% { box-shadow: inset 0 0 0 1.5px #fffbe0, 0 0 24px rgba(255, 213, 79, 0.95); }
}
.rc-runner.is-mine { isolation: isolate; z-index: 2; }
.rc-runner.is-mine::before {
  content: ''; position: absolute; z-index: -1; left: 60%; top: 50%; width: 58px; height: 58px;
  border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 250, 200, 0.95) 0%, rgba(255, 213, 79, 0.55) 35%, rgba(255, 160, 0, 0) 70%);
  animation: rc-halo 0.6s ease-in-out infinite alternate;
}
@keyframes rc-halo { to { transform: translate(-50%, -50%) scale(1.25); opacity: 0.75; } }
.rc.is-running .rc-runner.is-mine::after {
  content: ''; position: absolute; z-index: -1; right: 80%; top: 50%; width: 90px; height: 8px;
  border-radius: 4px; transform: translateY(-50%); filter: blur(1.5px);
  background: linear-gradient(90deg, rgba(255, 213, 79, 0), rgba(255, 245, 190, 0.95));
}
.rc-runner.is-mine .rc-horse {
  filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 7px #ffd54f) drop-shadow(0 0 14px #ffab00);
}
.rc-runner.is-mine .rc-bib {
  box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #ffd54f, 0 0 14px 3px #ffd54f;
  animation: rc-bib 0.6s ease-in-out infinite alternate;
}
@keyframes rc-bib { to { transform: scale(1.18); } }
.rc-pos.is-mine { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #ffd54f, 0 0 12px 3px #ffd54f; z-index: 1; }
.rc-commentary.is-new { animation: rc-talk 0.25s ease-out; }
@keyframes rc-talk { from { transform: scale(1.06); filter: brightness(1.8); } }
.rc-credit { align-self: flex-end; font-size: 0.66rem; color: var(--muted, rgba(255, 255, 255, 0.55)); }
.rc-runner.is-first .rc-horse { animation: rc-win 0.5s ease-in-out 4; }
@keyframes rc-win { 50% { transform: scaleX(-1) scale(1.35) translateY(-4px); } }
.rc-finish {
  position: absolute; right: 40px; top: 0; bottom: 0; width: 6px;
  background: repeating-linear-gradient(180deg, #fff 0 6px, #111 6px 12px);
}
.rc.is-stretch .rc-track { box-shadow: inset 0 3px 0 #ffd54f, inset 0 -3px 0 #ffd54f, 0 0 26px rgba(255, 213, 79, 0.6); }
.rc.is-stretch .rc-commentary { background: rgba(198, 40, 40, 0.8); animation: reach-shake 0.2s ease-in-out infinite; }
.rc-result { display: flex; gap: 0.8rem; flex-wrap: wrap; justify-content: center; min-height: 1.5rem; }
.rc-place { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.82rem; color: rgba(255, 255, 255, 0.85); }
.rc-place.is-mine { color: #ffd54f; font-weight: 800; }
.rc-place-no {
  width: 1.2rem; height: 1.2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font: 800 0.66rem var(--font-num);
}

/* ==========================================================
   リール（自分で止める）
   ========================================================== */
.rl-machine { --cell: 58px; --reel-w: 78px; }
.rl-window {
  position: relative; width: var(--reel-w); height: calc(var(--cell) * 3); overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff9e6, #f3e3bd);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25);
}
.pslot .rl-window { background: linear-gradient(180deg, #2a1930, #170d1c); }
/* 上下の段は暗くして、真ん中の段に目が行くようにする。 */
.rl-window::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 30%, transparent 70%, rgba(0, 0, 0, 0.55));
}
.rl-strip { display: flex; flex-direction: column; will-change: transform; }
.rl-cell {
  height: var(--cell); flex: none; display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--cell) * 0.62); line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}
.rl-window.is-spinning .rl-strip { filter: blur(1.4px); }
.rl-window.is-landed { animation: rl-land 0.3s ease-out; }
@keyframes rl-land { 30% { box-shadow: inset 0 0 0 3px #ffd54f, 0 0 16px #ffd54f; } }
.slot-window, .pslot-window { display: flex; gap: 0.45rem; padding: 0.6rem; }
.slot-line { top: calc(0.6rem + var(--cell) * 1.5); }

.rl-stops { display: flex; gap: 0.45rem; justify-content: center; }
.rl-stop {
  width: var(--reel-w); padding: 0.55rem 0; border-radius: 999px; border: 0; cursor: pointer;
  font: 900 0.86rem var(--font-num); letter-spacing: 0.08em; color: #fff;
  background: radial-gradient(circle at 50% 30%, #ff6f6f, #c62828);
  box-shadow: 0 4px 0 #7f1414, 0 6px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.06s ease, box-shadow 0.06s ease;
  -webkit-tap-highlight-color: transparent;
}
.rl-stop:not(:disabled):active { transform: translateY(3px); box-shadow: 0 1px 0 #7f1414, 0 2px 6px rgba(0, 0, 0, 0.4); }
.rl-stop:disabled { background: #6d6d6d; box-shadow: 0 4px 0 #3a3a3a; opacity: 0.55; cursor: default; }
.rl-machine.is-waiting .rl-stop:not(:disabled), .pslot .rl-stop:not(:disabled) { animation: rl-stop-glow 0.8s ease-in-out infinite; }
@keyframes rl-stop-glow { 50% { box-shadow: 0 4px 0 #7f1414, 0 0 18px #ff5252; } }

/* パチスロの告知ランプと「7 を狙え」 */
.pslot-gogo {
  font: 900 0.9rem var(--font-num); letter-spacing: 0.1em; color: #4a3520;
  padding: 0.1rem 0.5rem; border-radius: 6px; background: #2a1a10;
}
.pslot.is-gogo .pslot-gogo {
  color: #fff; background: linear-gradient(90deg, #ff5252, #ffd54f, #ff4081);
  box-shadow: 0 0 22px #ff4081; animation: lamp 0.3s steps(2) infinite;
}
.pslot.is-aim .rl-window:first-child { box-shadow: inset 0 0 0 3px #ffd54f, 0 0 24px #ffd54f; animation: reach-shake 0.25s ease-in-out infinite; }
.pslot.is-aim .rl-stop:first-child { background: radial-gradient(circle at 50% 30%, #fff176, #ff8f00); color: #3a1c00; }

@media (max-width: 600px) {
  .rl-machine { --cell: 48px; --reel-w: 64px; }
}
.bonus-banner {
  display: flex; flex-direction: column; gap: 0.15rem; padding: 0.6rem 0.9rem; border-radius: var(--radius-sm);
  color: #fff; background: linear-gradient(90deg, #c62828, #ff4081, #7c4dff, #c62828);
  background-size: 300% 100%; animation: fx-slide 2s linear infinite;
  box-shadow: 0 0 20px rgba(255, 64, 129, 0.5);
}
.bonus-banner strong { font-size: 1.05rem; letter-spacing: 0.04em; }
.bonus-banner span { font-size: 0.8rem; }

/* ---------- パチンコの保留と連打 ---------- */
.pachi-holds { display: flex; gap: 8px; min-height: 20px; }
.pachi-hold {
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.25);
  transition: transform 0.15s ease;
}
.pachi-hold.is-on { transform: scale(1.1); animation: pop 0.25s ease-out; }
.pachi-hold.is-white { background: #f5f5f5; box-shadow: 0 0 6px #fff; }
.pachi-hold.is-green { background: #43d17a; box-shadow: 0 0 10px #43d17a; }
.pachi-hold.is-red { background: #ff3d3d; box-shadow: 0 0 14px #ff3d3d; animation: lamp 0.5s steps(2) infinite; }
.pachi-hold.is-gold { background: radial-gradient(circle at 35% 30%, #fff6b0, #ffb300); box-shadow: 0 0 18px #ffd54f; animation: lamp 0.35s steps(2) infinite; }
.pachi-hold.is-rainbow {
  background: conic-gradient(#ff5252, #ffd54f, #69f0ae, #18ffff, #7c4dff, #e040fb, #ff5252);
  box-shadow: 0 0 22px #e040fb; animation: fx-fever 0.8s linear infinite;
}
.pachi-ball.is-shot {
  top: -12px; animation: pachi-shot 0.7s cubic-bezier(0.5, 0, 0.8, 1) forwards;
}
@keyframes pachi-shot {
  0% { top: -12px; }
  35% { transform: translateX(var(--wob)); }
  70% { transform: translateX(calc(var(--wob) * -0.6)); }
  100% { top: 104px; left: 50%; transform: translateX(-50%); }
}
.play-btn.is-pachi { touch-action: manipulation; }

/* ==========================================================
   スロット（連鎖）— 6 × 5 のマスに鉱石が降る
   ========================================================== */
.vs { width: min(100%, 470px); display: flex; flex-direction: column; gap: 0.5rem; }
.vs-top { display: flex; align-items: center; gap: 0.5rem; min-height: 1.9rem; }
.vs-mode {
  font: 900 0.78rem var(--font-num); letter-spacing: 0.14em; color: #ffd54f;
  padding: 0.25rem 0.6rem; border-radius: 999px; background: rgba(0, 0, 0, 0.35);
}
.vs-acc { font: 900 1.05rem var(--font-num); color: #e1b6ff; text-shadow: 0 0 12px #b000ff; }
.vs-win { margin-left: auto; font: 900 1.15rem var(--font-num); color: #fff; text-shadow: 0 0 12px #ff8f00; }
.vs-win.is-pop, .vs-acc.is-pop { animation: pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); }
.vs-grid {
  position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 6px;
  border-radius: 10px; overflow: hidden;
  background: linear-gradient(180deg, #3b2a1e, #1f140d);
  box-shadow: inset 0 0 0 2px rgba(255, 213, 79, 0.35), 0 8px 24px rgba(0, 0, 0, 0.35);
}
.vs-cell {
  --ore: #888; position: relative; aspect-ratio: 1; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.25)),
    color-mix(in srgb, var(--ore) 28%, #2a1d14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.vs-sym { font-size: clamp(1.25rem, 5.4vw, 1.9rem); line-height: 1; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)); }
.vs-cell.is-drop { animation: vs-drop var(--dur, 300ms) cubic-bezier(0.3, 0.9, 0.4, 1.15) var(--delay, 0ms) both; }
@keyframes vs-drop { from { transform: translateY(calc((100% + 4px) * var(--fall) * -1)); } to { transform: none; } }
.vs-cell.is-hit { z-index: 1; animation: vs-hit 0.25s ease-in-out infinite alternate; box-shadow: 0 0 0 2px #fff, 0 0 18px 4px var(--ore); }
@keyframes vs-hit { to { transform: scale(1.12); filter: brightness(1.5); } }
.vs-cell.is-pop { animation: vs-pop 0.3s ease-in forwards; }
@keyframes vs-pop {
  40% { transform: scale(1.3) rotate(8deg); filter: brightness(2.2); }
  100% { transform: scale(0.2) rotate(-20deg); opacity: 0; }
}
.vs-cell.is-tnt { background: radial-gradient(circle, #ff7043 0%, #7a1d0d 75%); }
.vs-cell.is-mult {
  background: radial-gradient(circle, #d58cff 0%, #4a0f73 80%);
  box-shadow: 0 0 12px #c56bff, inset 0 0 0 1px #f3d9ff;
}
.vs-cell.is-mult .vs-sym { font: 900 clamp(0.85rem, 3.8vw, 1.15rem) var(--font-num); color: #fff; text-shadow: 0 0 8px #fff; }
.vs-cell.is-glow { z-index: 1; animation: vs-hit 0.18s ease-in-out infinite alternate; box-shadow: 0 0 0 2px #fff, 0 0 24px 8px #ffd54f; }
.vs.is-tease .vs-grid { animation: reach-shake 0.2s ease-in-out infinite; box-shadow: inset 0 0 0 3px #ff5252, 0 0 30px rgba(255, 82, 82, 0.7); }
.vs.is-free .vs-grid {
  background: linear-gradient(180deg, #2b0f45, #120622);
  box-shadow: inset 0 0 0 2px #c56bff, 0 0 30px rgba(197, 107, 255, 0.55);
}
.vs.is-free .vs-mode { color: #fff; background: linear-gradient(90deg, #ff4081, #7c4dff); }
.vs.is-done .vs-grid { animation: win-glow 0.7s ease-in-out 2; }
.vs-msg { min-height: 1.6rem; display: flex; flex-wrap: wrap; gap: 0.35rem 0.7rem; justify-content: center; }
.vs-hit { font-size: 0.86rem; color: rgba(255, 255, 255, 0.9); }
.vs-hit strong { color: #ffd54f; font-family: var(--font-num); }
.vs-chain { font: 900 0.95rem var(--font-num); color: #18ffff; text-shadow: 0 0 10px #18ffff; animation: pop 0.3s ease-out; }

/* ==========================================================
   パチンコ — 液晶・予告・SP リーチ・PUSH・RUSH
   ========================================================== */
.pachi-lcd {
  position: relative; width: min(100%, 380px); padding: 0.6rem 0.5rem 0.7rem; border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  background: radial-gradient(circle at 50% 30%, #243b6b, #0b1022);
  box-shadow: inset 0 0 0 2px rgba(120, 180, 255, 0.35), 0 0 18px rgba(80, 140, 255, 0.25);
}
.pachi-mode { font: 900 0.72rem var(--font-num); letter-spacing: 0.18em; color: #9fc4ef; }
.pachi-steps { display: flex; gap: 4px; min-height: 1.1rem; }
.pachi-stepup {
  font: 800 0.6rem var(--font-num); padding: 0.1rem 0.35rem; border-radius: 4px;
  color: transparent; background: rgba(255, 255, 255, 0.06);
}
.pachi-stepup.is-on { color: #fff; animation: pop 0.25s ease-out; }
.pachi-stepup.is-on[data-step="1"] { background: #607d8b; }
.pachi-stepup.is-on[data-step="2"] { background: #1e88e5; }
.pachi-stepup.is-on[data-step="3"] { background: #43a047; }
.pachi-stepup.is-on[data-step="4"] { background: #e53935; box-shadow: 0 0 10px #ff5252; }
.pachi-stepup.is-on[data-step="5"] {
  background: linear-gradient(90deg, #ff5252, #ffd54f, #69f0ae, #18ffff, #e040fb);
  box-shadow: 0 0 14px #fff; color: #000;
}
.pachi-battle { display: none; align-items: center; gap: 0.6rem; }
.pachi.is-sp .pachi-battle { display: flex; }
.pb-side { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pb-face { font-size: 1.9rem; line-height: 1; }
.pachi.is-sp .is-boss .pb-face { animation: reach-shake 0.3s ease-in-out infinite; }
.pb-hp { width: 64px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.pb-hp i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #69f0ae, #ffd54f); transition: width 0.3s ease; }
.is-boss .pb-hp i { background: linear-gradient(90deg, #e040fb, #ff5252); }
.pb-vs { font: 900 1rem var(--font-num); color: #ffd54f; text-shadow: 0 0 8px #ff8f00; }
.pachi.is-sp .pachi-lcd { background: radial-gradient(circle at 50% 30%, #4a1a6b, #12051f); box-shadow: inset 0 0 0 2px #e040fb, 0 0 26px rgba(224, 64, 251, 0.6); }
.pachi.is-all .pachi-lcd { animation: fx-fever 0.6s linear infinite; box-shadow: inset 0 0 0 3px #fff, 0 0 34px #fff; }
.pachi.is-rush .pachi-lcd { background: radial-gradient(circle at 50% 30%, #8a1010, #2a0505); box-shadow: inset 0 0 0 3px #ffd54f, 0 0 34px rgba(255, 82, 82, 0.8); }
.pachi.is-rush .pachi-mode { color: #ffd54f; font-size: 0.9rem; text-shadow: 0 0 10px #ff5252; animation: lamp 0.5s steps(2) infinite; }
.pachi-swarm { position: absolute; inset: 0; pointer-events: none; }
.pachi-creeper { position: absolute; left: -12%; font-size: 1.4rem; opacity: 0; }
.pachi-swarm.is-live .pachi-creeper { animation: pachi-swarm 0.9s linear forwards; }
@keyframes pachi-swarm { 0% { left: -12%; opacity: 1; } 100% { left: 110%; opacity: 1; } }
.pachi-cut {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.4);
  padding: 0.35rem 1rem; border-radius: 8px; font: 900 1.3rem var(--font-num); white-space: nowrap;
  color: #fff; opacity: 0; pointer-events: none;
}
.pachi-cut.is-live { animation: pachi-cut 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
@keyframes pachi-cut {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  25%, 80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.15); }
}
.pachi-cut.is-blue { background: #1565c0; box-shadow: 0 0 16px #42a5f5; }
.pachi-cut.is-green { background: #2e7d32; box-shadow: 0 0 16px #69f0ae; }
.pachi-cut.is-red { background: #c62828; box-shadow: 0 0 22px #ff5252; }
.pachi-cut.is-gold { background: linear-gradient(135deg, #ffb300, #fff176, #ff8f00); color: #3a2400; box-shadow: 0 0 26px #ffd54f; }
.pachi-cut.is-rainbow {
  background: linear-gradient(90deg, #ff5252, #ffd54f, #69f0ae, #18ffff, #7c4dff, #e040fb);
  color: #fff; text-shadow: 0 0 6px #000; box-shadow: 0 0 34px #fff;
}
.pachi-push {
  display: none; position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  padding: 0.55rem 1.6rem; border: 0; border-radius: 999px; cursor: pointer;
  font: 900 1.25rem var(--font-num); letter-spacing: 0.08em; color: #fff;
  background: radial-gradient(circle at 50% 30%, #ff8a80, #d50000);
  box-shadow: 0 5px 0 #7f0000, 0 0 24px #ff5252;
}
.pachi-push.is-live { display: block; animation: pachi-push 0.35s ease-in-out infinite alternate; }
.pachi-push.is-pressed { display: block; transform: translateX(-50%) translateY(4px); box-shadow: 0 1px 0 #7f0000, 0 0 40px #fff; }
@keyframes pachi-push { to { transform: translateX(-50%) scale(1.12); box-shadow: 0 5px 0 #7f0000, 0 0 40px #ffeb3b; } }
.play-btn.is-pachi.is-held { transform: scale(0.97); box-shadow: 0 0 0 3px #ffd54f, 0 0 22px #ff8f00; }
.play-btn.is-pachi { user-select: none; -webkit-user-select: none; }

.dbl-lock { margin: 0; text-align: center; font-size: 0.78rem; color: rgba(255, 255, 255, 0.7); }

@media (prefers-reduced-motion: reduce) {
  .vs-cell.is-drop, .vs-cell.is-hit, .vs-cell.is-pop, .pachi-push.is-live, .pachi-cut.is-live { animation: none; }
}
.pachi.is-sp .pachi-lcd { padding-bottom: 3.6rem; }

/* ==========================================================
   チンチロ — 丼とサイコロ
   ========================================================== */
.cc {
  width: min(100%, 460px); display: grid; gap: 0.6rem;
  grid-template-columns: 1fr; justify-items: center;
}
.cc-side {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.6rem; border-radius: 10px; background: rgba(0, 0, 0, 0.3);
}
.cc-who { font: 900 0.8rem var(--font-num); letter-spacing: 0.1em; color: #ffd54f; }
.cc-side.is-player .cc-who { color: #18ffff; }
.cc-history { display: flex; gap: 6px; flex-wrap: wrap; min-height: 22px; }
.cc-roll-mini { display: inline-flex; gap: 2px; padding: 2px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); }
.cc-roll-mini .cc-die { width: 18px; height: 18px; padding: 2px; gap: 1px; border-radius: 3px; }
.cc-hand { font: 900 1rem var(--font-num); color: #fff; min-width: 5.5em; text-align: right; }
.cc-bowl {
  position: relative; width: 230px; height: 150px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #f5ecd9 0%, #e2d3b5 45%, #b7916a 72%, #5d3a1a 100%);
  box-shadow: inset 0 10px 22px rgba(0, 0, 0, 0.45), 0 10px 24px rgba(0, 0, 0, 0.45), 0 0 0 5px #3e2410;
}
.cc-bowl.is-land { animation: cc-land 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes cc-land { 40% { transform: scale(1.04, 0.96); } }
.cc-dice { display: flex; gap: 10px; }
.cc-die {
  width: 42px; height: 42px; padding: 5px; border-radius: 8px; box-sizing: border-box;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 2px;
  background: linear-gradient(145deg, #ffffff, #e6e6e6);
  box-shadow: 0 3px 0 #bdbdbd, 0 5px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.08s ease;
}
.cc-die i { border-radius: 50%; }
.cc-die i.is-on { background: #1a1a1a; }
/* 1 の目は赤くて大きい（和ダイスの見た目） */
.cc-die[data-v="1"] i.is-on { background: #d50000; transform: scale(1.7); }
.cc-message { min-height: 1.6rem; font: 900 1.05rem var(--font-num); color: #fff; text-align: center; text-shadow: 0 0 10px rgba(255, 143, 0, 0.8); }
.cc.is-win .cc-message { color: #ffd54f; animation: pop 0.35s ease-out; }
.cc.is-lose .cc-message { color: #ff8a80; }
.cc.is-strong .cc-bowl { box-shadow: inset 0 10px 22px rgba(0, 0, 0, 0.45), 0 0 30px #ff1744, 0 0 0 5px #b71c1c; }
.cc.is-turn .cc-side.is-player { box-shadow: 0 0 0 2px #18ffff, 0 0 16px rgba(24, 255, 255, 0.5); }
.cc-roll {
  display: none; padding: 0.6rem 2rem; border: 0; border-radius: 999px; cursor: pointer;
  font: 900 1.2rem var(--font-num); color: #3a2400;
  background: radial-gradient(circle at 50% 30%, #fff59d, #ffb300);
  box-shadow: 0 5px 0 #a86b00, 0 0 20px rgba(255, 213, 79, 0.7);
}
.cc-roll.is-live { display: block; animation: cc-roll 0.4s ease-in-out infinite alternate; }
@keyframes cc-roll { to { transform: scale(1.1); box-shadow: 0 5px 0 #a86b00, 0 0 34px #fff59d; } }
.period-tabs { margin-top: 0.4rem; }
@media (max-width: 480px) {
  .cc-bowl { width: 200px; height: 130px; }
  .cc-die { width: 36px; height: 36px; padding: 4px; }
}

/* ==========================================================
   パチンコ — 盤面・台選び・ハンドル
   ========================================================== */
.pb-board {
  position: relative; width: min(100%, 380px); aspect-ratio: 1 / 1.05; border-radius: 50% 50% 14px 14px / 30% 30% 14px 14px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #1d3350, #0b1524 75%);
  box-shadow: inset 0 0 0 3px rgba(255, 213, 79, 0.5), inset 0 0 30px rgba(0, 0, 0, 0.6), 0 8px 20px rgba(0, 0, 0, 0.4);
}
.pb-rail {
  position: absolute; left: 1.5%; top: 3%; bottom: 2%; width: 20%;
  border-left: 2px solid rgba(255, 255, 255, 0.25); border-top: 2px solid rgba(255, 255, 255, 0.25);
  border-top-left-radius: 100% 40%; pointer-events: none;
}
.pb-pin {
  position: absolute; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #b0bec5); opacity: 0.85;
}
.pb-pocket {
  position: absolute; transform: translate(-50%, -50%); width: 9%; height: 5%;
  border: 2px solid rgba(255, 255, 255, 0.5); border-top: 0; border-radius: 0 0 12px 12px;
  display: flex; align-items: flex-end; justify-content: center;
}
.pb-pocket b { position: absolute; top: 105%; font: 800 0.55rem var(--font-num); color: rgba(255, 255, 255, 0.7); white-space: nowrap; }
.pb-pocket.is-heso { width: 11%; border-color: #ffd54f; box-shadow: 0 0 12px rgba(255, 213, 79, 0.5); }
.pb-pocket.is-heso b { color: #ffd54f; }
.pb-pocket.is-denchu { width: 12%; height: 6%; border-color: #69f0ae; opacity: 0.45; }
.pachi.is-rush .pb-pocket.is-denchu { opacity: 1; box-shadow: 0 0 16px #69f0ae; animation: lamp 0.5s steps(2) infinite; }
.pb-pocket.is-hit { animation: pb-hit 0.45s ease-out; }
@keyframes pb-hit { 0% { box-shadow: 0 0 0 0 #fff, 0 0 30px #fff; background: rgba(255, 255, 255, 0.6); } 100% { background: transparent; } }
.pb-right {
  position: absolute; right: 3%; top: 32%; writing-mode: vertical-rl; font: 900 0.7rem var(--font-num);
  color: rgba(105, 240, 174, 0.35); letter-spacing: 0.1em;
}
.pachi.is-rush .pb-right { color: #69f0ae; text-shadow: 0 0 10px #69f0ae; animation: lamp 0.4s steps(2) infinite; }
.pb-ball {
  position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; z-index: 2;
  background: radial-gradient(circle at 35% 30%, #fff, #9e9e9e); box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
  pointer-events: none;
}
.pb-guide { position: absolute; left: 0; right: 0; bottom: 1.5%; height: 6px; pointer-events: none; }
.pb-dot {
  position: absolute; bottom: 0; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}
.pb-dot.is-in { background: #ffd54f; box-shadow: 0 0 6px #ffd54f; }
.pt-tables { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; margin-bottom: 0.6rem; }
.pt-table {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 0.4rem 0.5rem;
  border: 1px solid var(--line, rgba(0, 0, 0, 0.12)); border-radius: 10px; background: var(--card, #fff);
  font-size: 0.7rem; cursor: pointer; text-align: left; color: inherit;
}
.pt-table strong { font-size: 0.85rem; }
.pt-table .is-hot { color: #e53935; font-weight: 800; }
.pt-table.is-on { border-color: #ff8f00; box-shadow: 0 0 0 2px #ffb300 inset; background: #fff8e1; }
.pt-table:disabled { opacity: 0.45; cursor: not-allowed; }
.pachi-controls { display: grid; gap: 0.6rem; margin-top: 0.7rem; }
.pachi-status { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.pachi-status > div { display: flex; align-items: baseline; gap: 0.35rem; }
.pachi-status span { font-size: 0.78rem; color: var(--muted, #777); }
.pachi-status strong { font-size: 1.5rem; }
.pachi-rush-badge {
  padding: 0.2rem 0.6rem; border-radius: 999px; font: 900 0.8rem var(--font-num); color: #fff;
  background: linear-gradient(90deg, #ff5252, #ff8f00); animation: lamp 0.6s steps(2) infinite;
}
.pachi-handle { display: flex; align-items: center; gap: 0.4rem; }
.pachi-handle label { min-width: 6.5em; font-size: 0.85rem; }
.pachi-handle input[type=range] { flex: 1; accent-color: #ff8f00; height: 28px; }
.pachi-aims { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.pachi-aim-warn { font-size: 0.8rem; font-weight: 800; color: #e53935; animation: lamp 0.8s steps(2) infinite; }
.pachi-buy { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.pachi-buy small { opacity: 0.7; }
.play-btn.is-pachi { touch-action: none; }
.pachi-cash { justify-self: start; }
@media (max-width: 560px) {
  .pt-tables { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================
   帳簿・貸し借り
   ========================================================== */
.loan-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.3em; height: 1.3em; margin-left: 0.35em;
  padding: 0 0.35em; border-radius: 999px; font-size: 0.72rem; font-weight: 800; color: #fff; background: #e53935;
}
.loan-badge.is-overdue { background: #6d4c41; }
.ledger-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.ledger-chip { display: inline-flex; gap: 0.4rem; align-items: baseline; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.78rem; background: rgba(0, 0, 0, 0.05); }
.ledger-chip.is-up strong, .ledger-table .is-up { color: #2e7d32; }
.ledger-chip.is-down strong, .ledger-table .is-down { color: #c62828; }
.ledger-card { overflow-x: auto; }
.ledger-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.ledger-table th, .ledger-table td { padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line, rgba(0, 0, 0, 0.08)); text-align: left; }
.ledger-table .num { text-align: right; white-space: nowrap; font-family: var(--font-num); }
.ledger-table td:first-child { white-space: nowrap; }
.loan-summary { display: flex; gap: 1.5rem; padding: 0.8rem 1rem; }
.loan-form { display: grid; gap: 0.6rem; padding: 1rem; }
.loan-form h3, .loan-group h3 { margin: 0; font-size: 0.95rem; }
.loan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.5rem; }
.loan-grid label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.78rem; color: var(--muted, #666); }
.loan-grid label.is-wide { grid-column: 1 / -1; }
.loan-input {
  padding: 0.45rem 0.55rem; border: 1px solid var(--line, rgba(0, 0, 0, 0.18)); border-radius: 8px;
  font: inherit; font-size: 0.9rem; background: var(--card, #fff); color: inherit; min-width: 0;
}
.loan-group { display: grid; gap: 0.5rem; margin-top: 1rem; }
.loan-card { display: grid; gap: 0.4rem; padding: 0.8rem 1rem; }
.loan-card.is-overdue { box-shadow: 0 0 0 2px #e53935 inset; }
.loan-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.loan-status { margin-left: auto; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.72rem; font-weight: 800; background: rgba(0, 0, 0, 0.06); }
.loan-status.is-pending { background: #fff3cd; color: #8a6100; }
.loan-status.is-active { background: #e3f2fd; color: #1565c0; }
.loan-status.is-repaid { background: #e8f5e9; color: #2e7d32; }
.loan-card.is-overdue .loan-status { background: #ffebee; color: #c62828; }
.loan-terms { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.84rem; }
.loan-note { margin: 0; font-size: 0.82rem; color: var(--muted, #666); }
.loan-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.loan-actions .loan-input { width: 8em; }
.play-btn.loan-btn { width: auto; padding: 0.5rem 1.1rem; font-size: 0.9rem; }

/* この回の収支（見出し＋賭けた/戻った＋ダブルアップ） */
.game-outcome .outcome-text { display: flex; flex-direction: column; gap: 0.15rem; }
.outcome-head { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.outcome-label { font-size: 0.75rem; color: var(--text-muted); }
.outcome-head strong { font-size: 1.2rem; }
.outcome-verdict { font-size: 0.75rem; font-weight: 800; padding: 0.05rem 0.5rem; border-radius: 999px; background: rgba(0, 0, 0, 0.06); }
.game-outcome.is-win .outcome-verdict { background: #2fa84f; color: #fff; }
.game-outcome.is-lose .outcome-head strong { color: #c62828; }
.game-outcome.is-lose .outcome-verdict { background: #c62828; color: #fff; }
.outcome-line { font-size: 0.8rem; color: var(--text-muted); }
.outcome-line.is-double { color: #6a1b9a; font-weight: 700; }
.outcome-line.is-double.is-lost { color: #c62828; }
.session-sub { font-size: 0.62rem; color: var(--text-muted); }
.session-chip.is-double { outline: 2px solid #ab47bc; outline-offset: -2px; }

/* 自作のプルダウン */
.cs { position: relative; min-width: 0; }
.cs-button {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 0.4rem;
  padding: 0.4rem 0.6rem; min-height: 2.4rem; border: 1px solid var(--border, rgba(0, 0, 0, 0.18)); border-radius: 10px;
  background: var(--card, #fff); color: inherit; font: inherit; font-size: 0.9rem; cursor: pointer; text-align: left;
}
.cs.is-open .cs-button, .cs-button:focus-visible { border-color: #ff8f00; box-shadow: 0 0 0 3px rgba(255, 143, 0, 0.2); outline: none; }
.cs-caret { font-size: 0.8rem; color: var(--text-muted); transition: transform 0.15s ease; }
.cs.is-open .cs-caret { transform: rotate(180deg); }
.cs-placeholder { color: var(--text-muted); }
.cs-face { display: inline-flex; align-items: center; gap: 0.45rem; min-width: 0; }
.cs-face .avatar { flex: none; border-radius: 6px; }
.cs-icon { width: 22px; text-align: center; }
.cs-label { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.cs-label small { font-size: 0.7rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-panel {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); min-width: 220px;
  padding: 0.35rem; border-radius: 12px; background: var(--card, #fff);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.06);
  animation: cs-in 0.12s ease-out;
}
@keyframes cs-in { from { opacity: 0; transform: translateY(-4px); } }
.cs-search {
  width: 100%; box-sizing: border-box; margin-bottom: 0.3rem; padding: 0.4rem 0.55rem;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.15)); border-radius: 8px; font: inherit; font-size: 0.85rem;
  background: var(--bg-secondary, #fafafa); color: inherit;
}
.cs-list { max-height: 260px; overflow-y: auto; display: grid; gap: 2px; }
.cs-option {
  display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; width: 100%;
  padding: 0.4rem 0.5rem; border: 0; border-radius: 8px; background: transparent; color: inherit;
  font: inherit; font-size: 0.88rem; text-align: left; cursor: pointer;
}
.cs-option.is-active { background: rgba(255, 143, 0, 0.12); }
.cs-option.is-selected { font-weight: 800; }
.cs-check { color: #ff8f00; font-weight: 900; }
.cs-empty { margin: 0.4rem; font-size: 0.82rem; color: var(--text-muted); }
.loan-field { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.78rem; color: var(--text-muted); min-width: 0; }
.loan-field.is-wide { grid-column: 1 / -1; }
.loan-status.is-gift { background: #fce4ec; color: #ad1457; }

/* 自作の確認ダイアログ */
.cf-backdrop {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(0, 0, 0, 0.45); animation: cs-in 0.12s ease-out;
}
.cf-modal {
  width: min(100%, 420px); padding: 1.1rem 1.2rem; border-radius: 16px; background: var(--card, #fff);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3); display: grid; gap: 0.5rem;
}
.cf-modal h3 { margin: 0; font-size: 1.05rem; }
.cf-modal p { margin: 0; font-size: 0.88rem; line-height: 1.55; }
.cf-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.4rem; }
.cf-actions .play-btn { width: auto; padding: 0.55rem 1.2rem; }
.play-btn.is-danger { background: linear-gradient(135deg, #ec407a, #ab47bc); color: #fff; }

/* ==========================================================
   ダブルアップの煽り（heat 0〜8 で段階的に熱くなる）
   ========================================================== */
.dbl-modal { position: relative; overflow: hidden; isolation: isolate; transition: box-shadow 0.4s ease; }
.dbl-modal::before {
  content: ''; position: absolute; inset: -40% -10% 0; z-index: -1; opacity: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 30% 45% at 20% 100%, rgba(255, 110, 0, 0.9), transparent 70%),
    radial-gradient(ellipse 28% 50% at 50% 100%, rgba(255, 40, 0, 0.9), transparent 70%),
    radial-gradient(ellipse 30% 45% at 80% 100%, rgba(255, 180, 0, 0.85), transparent 70%);
  filter: blur(8px); animation: dbl-fire 0.9s ease-in-out infinite alternate;
}
@keyframes dbl-fire { from { transform: translateY(6%) scaleY(0.9); } to { transform: translateY(-4%) scaleY(1.12); } }
.dbl-modal[data-heat="1"] { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 0 0 2px #40c4ff, 0 0 30px rgba(64, 196, 255, 0.5); }
.dbl-modal[data-heat="2"] { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 0 0 3px #69f0ae, 0 0 36px rgba(105, 240, 174, 0.6); }
.dbl-modal[data-heat="3"] { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 0 0 3px #ffd54f, 0 0 44px rgba(255, 213, 79, 0.7); }
.dbl-modal[data-heat="3"]::before { opacity: 0.35; }
.dbl-modal[data-heat="4"] { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 0 0 3px #ff5252, 0 0 54px rgba(255, 82, 82, 0.85); animation: dbl-pulse 0.9s ease-in-out infinite; }
.dbl-modal[data-heat="4"]::before { opacity: 0.55; }
.dbl-modal[data-heat="5"], .dbl-modal[data-heat="6"], .dbl-modal[data-heat="7"], .dbl-modal[data-heat="8"] {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 70px rgba(255, 64, 129, 0.95);
  animation: dbl-pulse 0.6s ease-in-out infinite;
}
/* 5 連から、枠だけが虹色に流れる（中身の色は変えない。カードの赤黒が分からなくなるので） */
.dbl-modal::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 4px; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, #ff5252, #ffd54f, #69f0ae, #18ffff, #7c4dff, #e040fb, #ff5252) 0 0 / 300% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: dbl-ring 1.2s linear infinite;
}
@keyframes dbl-ring { to { background-position: 300% 0; } }
.dbl-modal[data-heat="5"]::after, .dbl-modal[data-heat="6"]::after, .dbl-modal[data-heat="7"]::after, .dbl-modal[data-heat="8"]::after { opacity: 1; }
.dbl-modal[data-heat="7"]::after, .dbl-modal[data-heat="8"]::after { padding: 6px; animation-duration: 0.6s; }
/* 負けたあと。火が消えて、冷たい赤黒になる */
.dbl-modal.is-bust { background: linear-gradient(160deg, #1a0606, #0d0d0d); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), inset 0 0 0 2px #5d1a1a; animation: none; }
.dbl-modal.is-bust::before, .dbl-modal.is-bust::after { opacity: 0; }
.dbl-modal[data-heat="5"]::before, .dbl-modal[data-heat="6"]::before { opacity: 0.8; }
.dbl-modal[data-heat="7"]::before, .dbl-modal[data-heat="8"]::before { opacity: 1; animation-duration: 0.5s; }
@keyframes dbl-pulse { 50% { transform: scale(1.012); } }
.dbl-line { display: flex; align-items: baseline; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.dbl-amount.is-up { animation: pop 0.5s cubic-bezier(0.34, 1.8, 0.5, 1); text-shadow: 0 0 18px #ffd54f; }
.dbl-danger {
  padding: 0.1rem 0.55rem; border-radius: 6px; font: 900 0.75rem var(--font-num); letter-spacing: 0.1em;
  color: #fff; background: #d50000; box-shadow: 0 0 14px #ff1744; animation: lamp 0.4s steps(2) infinite;
}
.dbl-ladder { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin-top: 0.45rem; }
.dbl-step {
  height: 20px; border-radius: 4px; display: flex; align-items: center; justify-content: center;
  font: 800 0.62rem var(--font-num); color: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.07);
}
.dbl-step.is-done { color: #1a0b2e; background: linear-gradient(180deg, #fff59d, #ffb300); box-shadow: 0 0 10px rgba(255, 213, 79, 0.8); }
.dbl-step.is-done:nth-child(n+4) { background: linear-gradient(180deg, #ff8a80, #ff1744); color: #fff; box-shadow: 0 0 12px #ff1744; }
.dbl-step.is-done:nth-child(n+6) { background: conic-gradient(#ff5252, #ffd54f, #69f0ae, #18ffff, #7c4dff, #e040fb, #ff5252); color: #000; }
.dbl-step.is-next { color: #fff; box-shadow: inset 0 0 0 2px #fff; animation: lamp 0.5s steps(2) infinite; }
.hl-potential { font-size: 0.72rem; opacity: 0.85; }

/* 溜め：カードの震えは heat に合わせて強く、台ごとぐっと寄る */
.hl-table { transition: transform 0.4s ease; }
.hl-table.is-tension { transform: scale(calc(1.02 + var(--heat, 0) * 0.012)); }
.hl-card.is-tense { animation: hl-tense 0.08s linear infinite; box-shadow: 0 0 calc(24px + var(--heat, 0) * 6px) #e040fb, inset 0 0 0 4px #fff; }
@keyframes hl-tense {
  0% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(var(--shake, 3px), 0) rotate(1deg); }
  75% { transform: translate(calc(var(--shake, 3px) * -1), 0) rotate(-1deg); }
}
.hl-card.is-peek { animation: none; transform: perspective(600px) rotateY(62deg); transition: transform 0.25s ease; box-shadow: 0 0 40px #fff; }

/* 画面の縁が暗く赤く脈打つ */
.fx-vignette {
  position: fixed; inset: 0; z-index: 85; pointer-events: none; opacity: 0; transition: opacity 0.35s ease;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(60, 0, 0, calc(0.45 + var(--heat, 0) * 0.05)) 75%, rgba(0, 0, 0, 0.85) 100%);
}
.fx-vignette.is-on { opacity: 1; animation: fx-vignette calc(0.9s - var(--heat, 0) * 0.07s) ease-in-out infinite; }
@keyframes fx-vignette { 50% { filter: brightness(1.5) saturate(1.6); } }

/* 割れたカードの破片 */
.fx-shard {
  position: fixed; z-index: 70; pointer-events: none; background: linear-gradient(135deg, #fff, #e0e0e0 60%, #bdbdbd);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
  animation: fx-shard 1.3s cubic-bezier(0.3, 0.1, 0.7, 1) forwards;
}
@keyframes fx-shard {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}

/* 負けたとき、画面の色が抜ける */
body.fx-drain #app, body.fx-drain .dbl-modal { animation: fx-drain 1.6s ease-out forwards; }
@keyframes fx-drain { 0% { filter: grayscale(1) brightness(0.6); } 70% { filter: grayscale(1) brightness(0.85); } 100% { filter: none; } }
.fx-cutin.is-live.is-lose .fx-cutin-main {
  color: #ff1744; text-shadow: 0 4px 0 #000, 0 0 30px rgba(255, 23, 68, 0.9); animation-duration: 0.9s;
}
.fx-cutin.is-live.is-lose .fx-cutin-sub { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .dbl-modal, .dbl-modal::before, .hl-card.is-tense, .fx-vignette.is-on { animation: none; }
}

/* ==========================================================
   全ゲーム共通の盛り上げ（巨大文字・スポットライト・稲妻・ビート・湧き上がる言葉）
   ========================================================== */
.fx-marquee { position: absolute; inset: 0; pointer-events: none; overflow: hidden; mix-blend-mode: screen; }
.fx-marquee-row {
  position: absolute; left: 0; white-space: nowrap; font: 900 clamp(2.6rem, 10vw, 7rem)/1 var(--font-num);
  letter-spacing: 0.04em; opacity: 0.85;
  background: linear-gradient(90deg, #ff5252, #ffd54f, #69f0ae, #18ffff, #7c4dff, #e040fb, #ff5252) 0 0 / 50% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 2px rgba(255, 255, 255, 0.7);
  animation: fx-marquee 1.8s linear infinite;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.6));
}
.fx-marquee-row.is-rev { animation-name: fx-marquee-rev; }
@keyframes fx-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes fx-marquee-rev { from { transform: translateX(-50%); } to { transform: translateX(0); } }
.fx-spots { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; }
.fx-spot {
  position: absolute; bottom: -10%; width: 22vw; height: 130vh; transform-origin: 50% 100%;
  background: linear-gradient(0deg, var(--c), transparent 85%); opacity: 0.35; filter: blur(6px);
  clip-path: polygon(45% 100%, 55% 100%, 100% 0, 0 0);
  animation: fx-spot 1.3s ease-in-out infinite alternate;
}
@keyframes fx-spot { from { transform: rotate(-28deg); } to { transform: rotate(28deg); } }
.fx-bolt { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; animation: fx-bolt 0.42s ease-out forwards; }
.fx-bolt polyline { fill: none; stroke: #fff; stroke-width: 0.9; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 6px #80d8ff) drop-shadow(0 0 16px #b388ff); }
.fx-bolt polyline { stroke-width: 5px; }
@keyframes fx-bolt { 0%, 30% { opacity: 1; } 15% { opacity: 0.2; } 100% { opacity: 0; } }
#app.fx-beat { animation: fx-beat var(--beat, 0.47s) ease-out infinite; }
@keyframes fx-beat { 0% { transform: scale(1.018); filter: brightness(1.25) saturate(1.3); } 60%, 100% { transform: scale(1); filter: none; } }
.fx-word {
  position: absolute; bottom: -10%; font-weight: 900; white-space: nowrap; pointer-events: none;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35), 0 0 16px currentColor;
  animation: fx-word 2.2s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
@keyframes fx-word {
  0% { transform: translateY(0) rotate(var(--rot)) scale(0.4); opacity: 0; }
  15% { opacity: 1; transform: translateY(-20vh) rotate(var(--rot)) scale(1.2); }
  100% { transform: translateY(-95vh) rotate(calc(var(--rot) * -1)) scale(1); opacity: 0; }
}
.fx-press {
  position: absolute; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%;
  border: 3px solid #fff; box-shadow: 0 0 20px #ffd54f; animation: fx-press 0.55s ease-out forwards;
}
@keyframes fx-press { to { transform: scale(9); opacity: 0; } }
.game-stage.fx-loss { animation: fx-loss 0.45s ease-out; }
@keyframes fx-loss {
  0% { transform: translateX(0); box-shadow: inset 0 0 0 3px rgba(255, 23, 68, 0.9); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(5px); }
  100% { transform: none; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  #app.fx-beat, .fx-marquee-row, .fx-spot, .fx-word, .game-stage.fx-loss { animation: none; }
}
.loan-terms-form { display: grid; gap: 0.4rem; padding: 0.6rem; border-radius: 10px; background: rgba(255, 143, 0, 0.07); }
.loan-status.is-requested { background: #ede7f6; color: #5e35b1; }

/* ==========================================================
   商売（出店・依頼・取引・公開コメント）
   ========================================================== */
.m-lock {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; margin-bottom: 0.8rem;
  padding: 0.7rem 1rem; border-radius: 12px; background: #fff3e0; box-shadow: inset 0 0 0 2px #ffb74d;
}
.m-lock strong { color: #e65100; }
.m-lock span { font-size: 0.85rem; flex: 1 1 18rem; }
.m-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.play-btn.m-start { width: auto; padding: 0.6rem 1.3rem; font-size: 0.95rem; }
.m-tabs { margin-bottom: 0; }
.m-empty { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem 1rem; flex-wrap: wrap; padding: 1rem 1.2rem; }
.m-empty p { margin: 0; }
.m-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.7rem; }
.m-card { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.9rem; color: inherit; text-decoration: none; transition: transform 0.15s ease, box-shadow 0.15s ease; }
@media (hover: hover) { .m-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); } }
.m-card.is-closed { opacity: 0.6; }
.m-card-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.m-person { display: inline-flex; align-items: center; gap: 0.35rem; }
.m-person .avatar { border-radius: 6px; }
.m-price { font: 900 1.5rem var(--font-num); color: #e65100; }
.m-price small { font-size: 0.75rem; color: var(--text-muted); font-weight: 700; }
.m-text { margin: 0; font-size: 0.88rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.m-text.is-full { display: block; -webkit-line-clamp: unset; overflow: visible; font-size: 0.95rem; }
.m-meta { display: flex; gap: 0.7rem; flex-wrap: wrap; font-size: 0.75rem; margin-top: auto; }
.m-hot { color: #e65100; font-weight: 800; }
.m-status { padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.7rem; font-weight: 800; background: rgba(0, 0, 0, 0.06); }
.m-status.is-active { background: #fff3e0; color: #e65100; }
.m-status.is-quoted { background: #ede7f6; color: #5e35b1; }
.m-status.is-completed { background: #e8f5e9; color: #2e7d32; }
.m-status.is-closed, .m-status.is-cancelled, .m-status.is-declined { background: #eceff1; color: #546e7a; }
.m-type { padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 800; background: #fff3e0; color: #e65100; }
.m-type.is-request { background: #e3f2fd; color: #1565c0; }
.m-item { display: grid; gap: 0.5rem; padding: 1rem 1.1rem; }
.m-apply, .m-deals, .m-thread-card { display: grid; gap: 0.5rem; padding: 1rem 1.1rem; margin-top: 0.7rem; }
.m-deals { padding: 0; background: none; box-shadow: none; }
.m-apply h3, .m-deals h3, .m-thread-card h3 { margin: 0; font-size: 0.95rem; }
.m-textarea { width: 100%; box-sizing: border-box; resize: vertical; line-height: 1.5; }
.m-small { width: 8em; }
.m-warn { margin: 0; font-size: 0.82rem; color: #c62828; font-weight: 700; }
.m-danger { color: #c62828; }
.m-deal { display: grid; gap: 0.45rem; padding: 0.7rem 0.9rem; }
.m-deal.is-mine { box-shadow: inset 0 0 0 2px #ffb74d; }
.m-proposal { font-size: 0.8rem; font-weight: 800; color: #5e35b1; }
.m-deal-list { display: grid; gap: 0.5rem; }
.m-deal-row { display: grid; grid-template-columns: auto auto 1fr auto auto; align-items: center; gap: 0.6rem; padding: 0.6rem 0.9rem; color: inherit; text-decoration: none; }
.m-role { font-size: 0.72rem; font-weight: 800; padding: 0.1rem 0.5rem; border-radius: 6px; background: rgba(0, 0, 0, 0.06); }
.m-excerpt { font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.m-thread { display: grid; gap: 0.6rem; max-height: 70vh; overflow-y: auto; padding-right: 0.2rem; }
.m-comment { display: flex; gap: 0.5rem; align-items: flex-start; }
.m-comment .avatar { flex: none; border-radius: 7px; }
.m-bubble { flex: 1; min-width: 0; padding: 0.5rem 0.7rem; border-radius: 4px 12px 12px 12px; background: var(--bg-secondary, #f6f6f6); }
.m-comment.is-owner .m-bubble { background: #fff8e1; }
.m-comment.is-event .m-bubble { box-shadow: inset 3px 0 0 #ffb74d; }
.m-bubble-head { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; font-size: 0.8rem; }
.m-owner { font-size: 0.65rem; font-weight: 800; padding: 0 0.4rem; border-radius: 4px; background: #ffb74d; color: #fff; }
.m-event { margin-top: 0.2rem; font-size: 0.84rem; font-weight: 800; }
.m-says { margin: 0.2rem 0 0; font-size: 0.9rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.m-composer { display: flex; gap: 0.5rem; align-items: flex-end; }
.m-composer .m-textarea { flex: 1; }
.m-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.m-choice {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 1rem 0.6rem;
  border: 2px solid var(--border, rgba(0, 0, 0, 0.12)); border-radius: 14px; background: var(--card, #fff);
  cursor: pointer; font: inherit; color: inherit;
}
.m-choice:hover { border-color: #ff8f00; box-shadow: 0 6px 16px rgba(255, 143, 0, 0.2); }
.m-choice-icon { font-size: 2rem; }
.m-choice small { font-size: 0.75rem; color: var(--text-muted); text-align: center; }
.m-compose { width: min(100%, 520px); }
@media (max-width: 600px) {
  .m-deal-row { grid-template-columns: auto 1fr auto; }
  .m-deal-row .m-excerpt, .m-deal-row .m-role { display: none; }
}

/* 電球の縁・コインの噴水・画面ぐるっと */
.fx-bulbs { position: absolute; inset: 6px; pointer-events: none; }
.fx-bulb {
  position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 10px var(--c), 0 0 22px var(--c);
  animation: fx-bulb 0.56s steps(2) infinite;
}
@keyframes fx-bulb { 50% { opacity: 0.15; box-shadow: none; } }
.fx-fountain {
  position: absolute; pointer-events: none; line-height: 1;
  filter: drop-shadow(0 0 6px rgba(255, 213, 79, 0.9));
  animation: fx-fountain 2s cubic-bezier(0.25, 0.6, 0.5, 1) both;
}
@keyframes fx-fountain {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
  10% { opacity: 1; }
  45% { transform: translate(calc(-50% + var(--dx) * 0.55), calc(-50% + var(--up))) rotate(calc(var(--spin) * 0.5)) scale(1.1); }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + 70vh)) rotate(var(--spin)) scale(0.9); opacity: 0; }
}
#app.fx-spin { animation: fx-spin 0.85s cubic-bezier(0.3, 1.4, 0.5, 1); }
@keyframes fx-spin {
  0% { transform: none; }
  35% { transform: scale(0.92) rotate(-4deg); filter: brightness(1.8) saturate(2); }
  60% { transform: scale(1.05) rotate(2deg); }
  100% { transform: none; filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .fx-bulb, .fx-fountain, #app.fx-spin { animation: none; }
}

/* ==========================================================
   ゲーム・商売の入口（財布の下に並ぶタブ）
   ========================================================== */
.hub-head { margin-bottom: 1.4rem; }
.hub-head .wallet-box { align-items: flex-start; }
.hub-head.is-compact .wallet-box { padding: 0.7rem 1rem; }
.hub-tabs {
  display: flex; gap: 0.3rem; margin-top: 0.8rem; padding: 0.3rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow-sm);
  overflow-x: auto; scrollbar-width: none;
}
.hub-tabs::-webkit-scrollbar { display: none; }
.hub-tab {
  position: relative; flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.55rem 1rem; border-radius: 999px; white-space: nowrap;
  font-size: 0.92rem; font-weight: 700; color: var(--text-secondary); text-decoration: none;
  transition: var(--transition);
}
.hub-tab-icon { font-size: 1.05rem; line-height: 1; }
.hub-tab .loan-badge { margin-left: 0; }
.hub-tab[aria-current='page'] { background: var(--grad-primary); color: #3a2400; box-shadow: var(--shadow-sm); }
.hub-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (hover: hover) {
  .hub-tab:hover:not([aria-current='page']) { background: var(--accent-soft); color: var(--accent); }
}
/* 狭い画面では 4 つとも横に収める（絵文字を上、名前を下に積む）。 */
@media (max-width: 560px) {
  .hub-tabs { border-radius: 18px; overflow: visible; }
  .hub-tab {
    position: relative; flex: 1 1 0; min-width: 0; flex-direction: column; gap: 0.15rem;
    padding: 0.45rem 0.2rem; border-radius: 14px; font-size: 0.78rem;
  }
  .hub-tab-icon { font-size: 1.2rem; }
  .hub-tab .loan-badge { position: absolute; top: 0.2rem; left: calc(50% + 0.55rem); }
  .hub-tab .loan-badge + .loan-badge { top: auto; bottom: -0.45rem; left: 50%; transform: translateX(-50%); white-space: nowrap; }
}
