/* ===== SWING COUNTER — ナイター球場テーマ ===== */
:root {
  --bg: #060a18;
  --bg2: #0b1330;
  --panel: rgba(18, 30, 68, .78);
  --panel-2: rgba(10, 17, 40, .92);
  --line: rgba(88, 150, 255, .26);
  --text: #eaf2ff;
  --muted: #8fa3cf;
  --blue: #3cf0ff;
  --blue-2: #2d6bff;
  --orange: #ff7a1a;
  --gold: #ffd23f;
  --silver: #cfd8ea;
  --bronze: #e39152;
  --danger: #ff5470;
  --radius: 18px;
  --f-num: "Bebas Neue", "Oswald", Impact, "Arial Narrow", sans-serif;
  --f-head: "Dela Gothic One", "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
  --f-body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(45, 107, 255, .35), transparent 60%),
    radial-gradient(90% 50% at 50% 115%, rgba(255, 122, 26, .18), transparent 60%),
    repeating-linear-gradient(-55deg, rgba(255,255,255,.018) 0 2px, transparent 2px 14px),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; touch-action: manipulation; }
[hidden] { display: none !important; }

#app {
  max-width: 480px;
  margin: 0 auto;
  padding-inline: 16px;
  padding-block: env(safe-area-inset-top, 0) 0;
  min-height: 100vh;
}

/* ===== 共通パーツ ===== */
.card {
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.05);
  margin-block: 0 14px;
}
.card-title { display: block; font-family: var(--f-head); font-weight: 400; font-size: 15px; margin-bottom: 10px; letter-spacing: .02em; }
.view-title { font-family: var(--f-head); font-weight: 400; font-size: 22px; margin: 18px 0 14px; line-height: 1.2; }
.view-title span {
  display: block; font-family: var(--f-num); font-size: 15px; letter-spacing: .25em;
  color: var(--blue); text-shadow: 0 0 12px rgba(60,240,255,.6); margin-bottom: 2px;
}
.view-title em { font-style: normal; }
.note { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.note b { color: var(--gold); }

.btn {
  display: block; width: 100%;
  padding: 15px 18px; border-radius: 14px;
  font-family: var(--f-head); font-size: 16px; letter-spacing: .04em;
  transition: transform .08s ease, filter .15s ease, box-shadow .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, #ff9a2e, var(--orange) 45%, #ff4d1f);
  color: #1a0a00;
  box-shadow: 0 8px 24px rgba(255,122,26,.45), inset 0 1px 0 rgba(255,255,255,.5);
  transform: skewX(-6deg);
}
.btn-primary:active { transform: skewX(-6deg) scale(.97); }
.btn-ghost {
  background: rgba(60,240,255,.06);
  border: 1.5px solid rgba(60,240,255,.55);
  color: var(--blue);
  box-shadow: 0 0 16px rgba(60,240,255,.15) inset;
}
.btn-link { display: block; margin: 6px auto 0; padding: 10px; color: var(--muted); text-decoration: underline; font-size: 14px; }
.btn-link.danger { color: var(--danger); margin-top: 18px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.row-btns { display: flex; gap: 10px; }
.row-btns .btn { flex: 1; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-size: 22px; font-weight: 900;
  background: rgba(60,240,255,.08); border: 1px solid var(--line); color: var(--blue);
}
.icon-btn:active { transform: scale(.94); }

/* フォーム */
.form label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 14px; }
.form label small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.form input, .form textarea {
  display: block; width: 100%; margin-top: 6px;
  padding: 13px 14px; border-radius: 12px;
  background: rgba(3, 7, 20, .7); border: 1.5px solid var(--line);
  font-size: 17px; outline: none;
}
.form textarea { font-family: ui-monospace, Consolas, monospace; font-size: 13px; resize: vertical; word-break: break-all; }
.form input:focus, .form textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(60,240,255,.18); }
.code-input { font-family: var(--f-num) !important; font-size: 30px !important; letter-spacing: .35em; text-transform: uppercase; text-align: center; }
.form-error { color: var(--danger); font-size: 13px; font-weight: 700; min-height: 1em; margin: -4px 0 10px; }
.team-check { font-size: 14px; font-weight: 700; margin: -6px 0 12px; min-height: 1.4em; }
.team-check.ok { color: var(--blue); }
.team-check.ng { color: var(--danger); }

/* ===== はじめて画面 ===== */
.onboard { padding-bottom: 32px; }
.hero {
  position: relative; margin-inline: -16px; height: min(64vh, 520px); min-height: 380px; overflow: hidden;
}
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% center; max-width: none; }
.hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(6,10,24,.92) 0%, rgba(6,10,24,.55) 45%, rgba(6,10,24,0) 75%),
    linear-gradient(0deg, var(--bg) 0%, rgba(6,10,24,0) 40%);
}
.hero-text { position: absolute; left: 20px; right: 20px; bottom: 26px; }
.kicker { font-family: var(--f-num); letter-spacing: .3em; color: var(--orange); margin: 0 0 4px; font-size: 16px; text-shadow: 0 0 14px rgba(255,122,26,.7); }
.logo {
  font-family: var(--f-num); font-weight: 400; font-size: clamp(62px, 19vw, 88px); line-height: .86; margin: 0;
  transform: skewX(-8deg); letter-spacing: .02em;
  text-shadow: 0 0 22px rgba(60,240,255,.55), 3px 3px 0 var(--blue-2);
}
.logo span { color: var(--blue); text-shadow: 0 0 26px rgba(60,240,255,.8), 3px 3px 0 #0b2a8a; }
.lead { font-weight: 900; font-size: 16px; margin: 12px 0 0; text-shadow: 0 2px 8px rgba(0,0,0,.8); }
.onboard-actions { display: grid; gap: 12px; margin-top: 8px; }
.form-view { padding-top: 12px; }
.back { color: var(--muted); font-weight: 700; padding: 8px 0; }

.created { text-align: center; }
.created-label { font-weight: 700; margin: 0; }
.big-code {
  font-family: var(--f-num); font-size: 58px; letter-spacing: .22em; margin: 6px 0 0; line-height: 1.1;
  color: var(--gold); text-shadow: 0 0 20px rgba(255,210,63,.55);
  padding-left: .22em;
}
.big-code.small { font-size: 40px; text-align: center; margin: 0 0 12px; }
.created-team { color: var(--muted); margin: 0 0 14px; }
.created .btn { margin-top: 10px; }

/* ===== トップバー ===== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-inline: -16px; padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  background: linear-gradient(180deg, rgba(6,10,24,.96), rgba(6,10,24,.8));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(88,150,255,.14);
}
.me-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.me-text { min-width: 0; line-height: 1.25; }
.me-text strong { display: block; font-size: 16px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.jersey {
  flex: none; display: grid; place-items: center;
  width: 42px; height: 44px; padding-top: 6px;
  font-family: var(--f-num); font-size: 24px; color: #fff; line-height: 1;
  background: linear-gradient(160deg, var(--blue-2), #0c2a8f);
  clip-path: polygon(22% 0, 36% 8%, 64% 8%, 78% 0, 100% 16%, 90% 34%, 84% 30%, 84% 100%, 16% 100%, 16% 30%, 10% 34%, 0 16%);
  text-shadow: 0 1px 0 rgba(0,0,0,.4);
}
.sync { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: #3dff9a; box-shadow: 0 0 8px #3dff9a; }
.sync[data-state="sending"] i, .sync[data-state="pending"] i { background: var(--gold); box-shadow: 0 0 8px var(--gold); animation: blink 1s infinite; }
.sync[data-state="offline"] i { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
@keyframes blink { 50% { opacity: .3; } }

/* ===== ホーム ===== */
.tab-view { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
.date-line { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 4px; gap: 8px; }
.today-date { font-family: var(--f-head); font-size: 16px; }
.streak-chip {
  font-weight: 900; font-size: 13px; padding: 4px 12px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,122,26,.25), rgba(255,210,63,.18));
  border: 1px solid rgba(255,160,60,.6); color: #ffd6a3;
}

.counter { position: relative; width: min(300px, 82vw); aspect-ratio: 1; max-width: 100%; margin: 8px auto 0; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-track { fill: none; stroke: rgba(40, 64, 140, .45); stroke-width: 16; }
.ring-prog {
  fill: none; stroke: url(#g-blue); stroke-width: 16; stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(60,240,255,.8));
  transition: stroke-dashoffset .35s cubic-bezier(.2,.9,.3,1);
}
.counter.done .ring-prog { stroke: url(#g-fire); filter: drop-shadow(0 0 10px rgba(255,122,26,.9)); }
.ring-ticks line { stroke: rgba(140,180,255,.25); stroke-width: 2; }
.ring-ticks line.major { stroke: rgba(140,200,255,.55); stroke-width: 3; }
.counter.flash .ring-prog { animation: ringflash .5s ease; }
@keyframes ringflash { 40% { stroke-width: 24; filter: drop-shadow(0 0 22px #fff); } }

.swing-btn {
  position: absolute; inset: 15%; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(255,255,255,.14), transparent 45%),
    radial-gradient(circle at 50% 60%, #1c3b9a 0%, #0c1a4a 60%, #060d28 100%);
  border: 3px solid rgba(60,240,255,.85);
  box-shadow: 0 0 0 6px rgba(60,240,255,.08), 0 0 34px rgba(60,240,255,.45), inset 0 -10px 30px rgba(0,0,0,.5);
  user-select: none; -webkit-user-select: none;
  transition: transform .06s ease, box-shadow .15s ease;
}
.swing-btn.hit { transform: scale(.93); box-shadow: 0 0 0 10px rgba(60,240,255,.16), 0 0 60px rgba(60,240,255,.8), inset 0 -10px 30px rgba(0,0,0,.5); }
.counter.done .swing-btn { border-color: var(--gold); box-shadow: 0 0 0 6px rgba(255,210,63,.1), 0 0 40px rgba(255,140,40,.55), inset 0 -10px 30px rgba(0,0,0,.5); }
.swing-label { font-family: var(--f-num); letter-spacing: .28em; font-size: 14px; color: var(--orange); padding-left: .28em; }
.count {
  font-family: var(--f-num); font-size: clamp(64px, 22vw, 96px); line-height: .9; margin: 2px 0;
  transform: skewX(-6deg);
  text-shadow: 0 0 18px rgba(60,240,255,.7), 0 3px 0 rgba(0,0,0,.4);
  font-variant-numeric: tabular-nums;
}
.goal-text { color: var(--muted); font-size: 13px; font-weight: 700; }
.goal-text b { font-family: var(--f-num); font-size: 20px; font-weight: 400; color: var(--text); letter-spacing: .04em; }

.plus-fx {
  position: absolute; left: 50%; top: 42%; pointer-events: none; z-index: 5;
  font-family: var(--f-num); font-size: 34px; color: var(--gold);
  text-shadow: 0 0 14px rgba(255,210,63,.9);
  animation: plusup .7s ease-out forwards;
}
@keyframes plusup {
  from { transform: translate(-50%, 0) scale(.8); opacity: 1; }
  to { transform: translate(calc(-50% + var(--dx, 0px)), -90px) scale(1.25); opacity: 0; }
}

.quick { display: grid; grid-template-columns: 1fr 1fr 1fr 1.25fr; gap: 8px; margin-top: 16px; }
.qbtn {
  padding: 12px 0; border-radius: 12px;
  font-family: var(--f-num); font-size: 24px; letter-spacing: .04em; line-height: 1;
  background: linear-gradient(180deg, rgba(40,70,160,.55), rgba(16,28,70,.85));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.qbtn:active { transform: scale(.94); }
.qminus { color: var(--muted); }
.qedit { font-family: var(--f-body); font-size: 14px; font-weight: 900; color: var(--blue); }
.remain { text-align: center; font-weight: 900; margin: 12px 0 14px; font-size: 15px; }
.remain b { font-family: var(--f-num); font-weight: 400; font-size: 24px; color: var(--orange); margin: 0 2px; }
.remain.done { color: var(--gold); text-shadow: 0 0 12px rgba(255,210,63,.5); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stats-4 { grid-template-columns: repeat(2, 1fr); }
.stat {
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 8px; text-align: center; min-width: 0;
}
.stat-label { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }
.stat-num { font-size: 12px; font-weight: 700; white-space: nowrap; }
.stat-num b { font-family: var(--f-num); font-weight: 400; font-size: 30px; line-height: 1.1; margin-right: 2px; letter-spacing: .02em; }
.stat-num small { color: var(--muted); }

.rank-card { display: flex; align-items: center; gap: 14px; }
.shield {
  flex: none; width: 70px; height: 80px; display: grid; place-items: center; text-align: center;
  clip-path: polygon(50% 0, 100% 14%, 100% 58%, 50% 100%, 0 58%, 0 14%);
  background: linear-gradient(160deg, var(--rank-c1, #5a6b94), var(--rank-c2, #2a3556));
  font-family: var(--f-num); font-size: 15px; letter-spacing: .06em; line-height: 1; padding: 0 6px 10px;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.rank-info { flex: 1; min-width: 0; }
.rank-info small { display: block; color: var(--muted); font-size: 12px; }
.rank-info strong { font-family: var(--f-head); font-weight: 400; font-size: 20px; display: block; line-height: 1.3; }
.bar { height: 10px; border-radius: 99px; background: rgba(40,64,140,.45); overflow: hidden; margin: 6px 0 4px; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--blue-2), var(--blue)); box-shadow: 0 0 10px rgba(60,240,255,.7); transition: width .5s ease; }

/* ===== ランキング ===== */
.rank-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.rank-head .view-title { min-width: 0; }
.rank-head .view-title em { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-head .icon-btn { margin-bottom: 14px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: rgba(3,7,20,.7); border: 1px solid var(--line); border-radius: 14px; padding: 4px; margin-bottom: 16px; }
.seg button { padding: 9px 0; border-radius: 10px; font-weight: 900; font-size: 14px; color: var(--muted); }
.seg button.active { background: linear-gradient(135deg, var(--blue-2), #1b44c8); color: #fff; box-shadow: 0 0 16px rgba(45,107,255,.6); }

.podium { display: grid; grid-template-columns: 1fr 1.1fr 1fr; align-items: end; gap: 8px; margin-bottom: 14px; }
.pod { text-align: center; min-width: 0; }
.pod .crown { font-size: 22px; line-height: 1; display: block; margin-bottom: 2px; }
.pod .jersey { margin: 0 auto 4px; width: 50px; height: 52px; font-size: 28px; }
.pod-name { font-weight: 900; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod-score { font-family: var(--f-num); font-size: 26px; line-height: 1; }
.pod-block {
  margin-top: 6px; border-radius: 12px 12px 4px 4px;
  display: grid; place-items: center; font-family: var(--f-num); font-size: 34px; color: rgba(0,0,0,.55);
}
.pod-1 .pod-block { height: 92px; background: linear-gradient(180deg, #ffe27a, #d99a00); box-shadow: 0 0 26px rgba(255,210,63,.5); }
.pod-2 .pod-block { height: 66px; background: linear-gradient(180deg, #eef3ff, #97a3bd); }
.pod-3 .pod-block { height: 50px; background: linear-gradient(180deg, #f4b27c, #a85a22); }
.pod.me .pod-name { color: var(--blue); }
.pod.empty { visibility: hidden; }

.board { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.row {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 30px 42px 1fr auto; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 14px;
  background: linear-gradient(160deg, var(--panel), var(--panel-2)); border: 1px solid var(--line);
}
.row .fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, rgba(45,107,255,.22), rgba(45,107,255,0)); pointer-events: none; }
.row > *:not(.fill) { position: relative; }
.row.me { border-color: var(--blue); box-shadow: 0 0 18px rgba(60,240,255,.25); }
.row.me .fill { background: linear-gradient(90deg, rgba(60,240,255,.28), rgba(60,240,255,0)); }
.pos { font-family: var(--f-num); font-size: 26px; text-align: center; color: var(--muted); }
.row .jersey { width: 38px; height: 40px; font-size: 20px; }
.who { min-width: 0; line-height: 1.3; }
.who b { display: block; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { color: var(--muted); font-size: 12px; }
.score { font-family: var(--f-num); font-size: 28px; line-height: 1; text-align: right; }
.score small { font-family: var(--f-body); font-size: 11px; color: var(--muted); margin-left: 2px; }
.me-tag { font-size: 10px; font-weight: 900; background: var(--blue); color: #001; border-radius: 4px; padding: 0 5px; margin-left: 4px; vertical-align: 2px; }
.board-empty, .board-loading { text-align: center; color: var(--muted); padding: 24px 0; }
.invite-btn { margin-top: 6px; }

/* ===== きろく ===== */
.chart-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; margin-bottom: 10px; }
.chart-head strong { font-family: var(--f-head); font-weight: 400; }
.chart-head small { color: var(--muted); font-size: 11px; }
.chart { position: relative; display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; align-items: end; padding-top: 16px; }
.chart .goal-mark { position: absolute; left: 0; right: 0; border-top: 2px dashed rgba(255,122,26,.6); pointer-events: none; z-index: 1; }
.chart .goal-mark span { position: absolute; right: 0; top: -17px; font-size: 10px; color: var(--orange); font-weight: 900; }
.col { display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 0; }
.col .bw { height: 128px; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.col .val { font-family: var(--f-num); font-size: 12px; line-height: 1; color: var(--muted); margin-bottom: 3px; }
.col .b { width: 100%; max-width: 20px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--blue), var(--blue-2)); transition: height .4s ease; }
.col.hit .b { background: linear-gradient(180deg, var(--gold), var(--orange)); box-shadow: 0 0 10px rgba(255,122,26,.6); }
.col.zero .b { background: rgba(80,110,180,.35); }
.col .d { height: 28px; font-size: 10px; color: var(--muted); margin-top: 4px; line-height: 1.3; text-align: center; }
.col.today .d { color: var(--blue); font-weight: 900; }
.col.locked { cursor: default; }

.ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ladder li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(3,7,20,.45); color: var(--muted); }
.ladder li .mini { width: 30px; height: 34px; clip-path: polygon(50% 0, 100% 14%, 100% 58%, 50% 100%, 0 58%, 0 14%); background: linear-gradient(160deg, var(--rank-c1), var(--rank-c2)); flex: none; opacity: .4; }
.ladder li strong { flex: 1; font-weight: 900; }
.ladder li span { font-family: var(--f-num); font-size: 18px; }
.ladder li.got { color: var(--text); }
.ladder li.got .mini { opacity: 1; }
.ladder li.now { background: rgba(45,107,255,.2); border: 1px solid var(--blue); color: var(--text); }

/* ===== せってい ===== */
.goal-edit { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.goal-big { font-weight: 900; }
.goal-big b { font-family: var(--f-num); font-weight: 400; font-size: 54px; line-height: 1; color: var(--orange); margin-right: 4px; text-shadow: 0 0 16px rgba(255,122,26,.5); }
.presets { display: flex; gap: 6px; margin-top: 12px; }
.presets button { flex: 1; padding: 8px 0; border-radius: 10px; border: 1px solid var(--line); font-family: var(--f-num); font-size: 18px; background: rgba(3,7,20,.5); }
.presets button.active { border-color: var(--orange); color: var(--orange); }
.team-line { font-weight: 900; font-size: 17px; margin: 0; text-align: center; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; }
.switch { width: 56px; height: 32px; border-radius: 99px; background: rgba(80,110,180,.4); position: relative; transition: background .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--blue-2); box-shadow: 0 0 12px rgba(45,107,255,.7); }
.switch[aria-checked="true"] i { transform: translateX(24px); }
.token-box { background: rgba(3,7,20,.8); border: 1px dashed var(--gold); border-radius: 10px; padding: 10px; margin-bottom: 10px; }
.token-box code { font-size: 12px; word-break: break-all; color: var(--gold); }
.foot-note { color: var(--muted); font-size: 12px; text-align: center; margin: 4px 0 0; }

/* ===== タブバー ===== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: 480px; margin: 0 auto;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(10,17,40,.92), rgba(6,10,24,.98));
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(88,150,255,.25);
}
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; color: var(--muted); font-size: 11px; font-weight: 700; }
.tabbar svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button.active { color: var(--blue); }
.tabbar button.active svg { filter: drop-shadow(0 0 6px rgba(60,240,255,.9)); }

/* ===== モーダル・トースト・演出 ===== */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(2,4,12,.7); backdrop-filter: blur(4px); }
.modal-card { width: 100%; max-width: 360px; background: linear-gradient(160deg, #15245a, #0a1231); border: 1px solid var(--blue); border-radius: var(--radius); padding: 20px; box-shadow: 0 0 40px rgba(60,240,255,.25); }
.modal-card input { font-family: var(--f-num); font-size: 44px; text-align: center; letter-spacing: .06em; }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 10px 18px; border-radius: 12px;
  background: rgba(10,17,40,.96); border: 1px solid var(--blue); font-weight: 700; font-size: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.5); transition: opacity .2s, transform .2s; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.celebrate { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: radial-gradient(circle, rgba(255,122,26,.25), rgba(2,4,12,.85) 70%); overflow: hidden; }
.celebrate-text { text-align: center; animation: pop .5s cubic-bezier(.2,1.6,.4,1); padding-inline: 16px; }
.cele-big {
  font-family: var(--f-num); font-size: clamp(80px, 26vw, 128px); line-height: .9; margin: 0; transform: skewX(-8deg);
  background: linear-gradient(180deg, #fff6b0, var(--gold) 45%, var(--orange));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 20px rgba(255,160,40,.8)) drop-shadow(4px 4px 0 #7a2400);
}
.cele-sub { font-family: var(--f-head); font-size: 20px; margin: 10px 0 0; text-shadow: 0 2px 10px rgba(0,0,0,.8); }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

.demo-strip {
  margin-inline: -16px; padding: 6px 16px; text-align: center;
  font-size: 11px; font-weight: 700; color: #1a0a00;
  background: repeating-linear-gradient(-45deg, var(--gold) 0 12px, #ffc21a 12px 24px);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
