@import url('https://fonts.googleapis.com/css2?family=Zen+Kaku+Gothic+New:wght@400;500;700;900&family=Chivo+Mono:wght@400;500;700&family=Dela+Gothic+One&family=Shippori+Mincho+B1:wght@800&display=swap');

:root {
  --paper: #F2EFE7;
  --card: #FBFAF6;
  --ink: #17171B;
  --ink-2: #3A3934;
  --muted: #7A766B;
  --line: #DCD6C8;
  --line-2: #E8E3D7;
  --accent: #D9432B;      /* 朱 */
  --accent-soft: #F6DDD5;
  --gold: #B8892A;
  --pos: #1D7650;
  --neg: #B4372A;
  --night: #121216;
  --sans: 'Zen Kaku Gothic New', 'Hiragino Sans', sans-serif;
  --mono: 'Chivo Mono', ui-monospace, monospace;
  --display: 'Dela Gothic One', 'Zen Kaku Gothic New', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #E4E0D5; color: var(--ink); font-family: var(--sans); }
body { overscroll-behavior: none; }
/* 拡大禁止: ダブルタップ拡大を止める・文字の自動拡大を止める */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
* { touch-action: manipulation; }
button { font-family: inherit; color: inherit; cursor: pointer; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* ---- App shell: スマホ幅に固定、PCでは中央 ---- */
#root { height: 100%; display: flex; justify-content: center; }
.shell {
  position: relative; width: 100%; max-width: 440px; height: 100%;
  background: var(--paper); overflow: hidden; display: flex; flex-direction: column;
}
@media (min-width: 500px) {
  #root { padding: 20px 0; }
  .shell { height: min(920px, 100%); border-radius: 28px; box-shadow: 0 30px 80px -30px rgba(40,30,10,.35), 0 0 0 1px rgba(0,0,0,.06); }
}
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.scroll::-webkit-scrollbar { width: 0; }
.pad { padding: 0 16px; }

/* ---- Buttons ---- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; width: 100%; border: 0; border-radius: 14px;
  background: var(--ink); color: var(--paper); font-size: 17.5px; font-weight: 700; letter-spacing: .04em;
  transition: transform .12s ease, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn.accent { background: var(--accent); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.light { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn:disabled { opacity: .35; }
.link { background: none; border: 0; padding: 8px; font-size: 16px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

/* ---- Labels / tags ---- */
.eyebrow { font-size: 14px; letter-spacing: .14em; color: var(--muted); font-weight: 700; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 700; padding: 3px 7px; border-radius: 6px; background: var(--line-2); color: var(--ink-2); letter-spacing: .04em; white-space: nowrap; }
.tag.tmp { background: transparent; box-shadow: inset 0 0 0 1px var(--gold); color: var(--gold); }
.tag.acc { background: var(--accent); color: #fff; }
.tag.dark { background: var(--ink); color: var(--paper); }

/* ---- Title ---- */
.title-screen { display: flex; flex-direction: column; height: 100%; padding: calc(28px + var(--safe-t)) 24px calc(24px + var(--safe-b)); }
.wordmark { font-family: var(--display); font-size: 58px; line-height: 1; letter-spacing: -.02em; }
.wordmark .dot { color: var(--accent); }
.ticket-strip { display: flex; gap: 6px; margin: 22px 0 10px; }
.ticket-strip span { flex: 1; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 18px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--ink); }
.ticket-strip span.hit { background: var(--accent); color: #fff; box-shadow: none; }
.disclaimer { font-size: 14px; color: var(--muted); line-height: 1.7; border-top: 1px dashed var(--line); padding-top: 12px; text-wrap: pretty; }

/* ---- Gacha ---- */
.gacha-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.gacha-cell {
  aspect-ratio: 1; border-radius: 8px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line);
  display: grid; place-items: center; font-size: 13.5px; font-weight: 700; color: var(--ink-2); line-height: 1.05; text-align: center; padding: 2px;
  transition: background .08s, color .08s, transform .08s;
}
.gacha-cell.on { background: var(--ink); color: var(--paper); transform: scale(1.08); box-shadow: none; }
.gacha-cell.final { background: var(--accent); color: #fff; transform: scale(1.12); box-shadow: 0 6px 18px -4px rgba(217,67,43,.6); }
.gacha-cell.blank { background: transparent; box-shadow: none; }

/* ---- Main ---- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: calc(12px + var(--safe-t)) 16px 8px; }
.hero { padding: 6px 16px 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.age-big { font-family: var(--mono); font-weight: 700; font-size: 76px; line-height: .85; letter-spacing: -.06em; }
.age-big small { font-family: var(--sans); font-size: 20px; letter-spacing: 0; margin-left: 4px; font-weight: 700; }
.date-line { font-size: 16px; color: var(--ink-2); text-align: right; line-height: 1.5; }
.date-line .num { font-size: 17.5px; font-weight: 700; color: var(--ink); }

.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 12px; }
.m { background: var(--card); border-radius: 16px; padding: 12px 13px 12px; box-shadow: inset 0 0 0 1px var(--line-2); min-width: 0; position: relative; }
.m.wide { grid-column: span 2; }
.m-label { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 14.5px; font-weight: 700; color: var(--muted); min-height: 22px; }
.m-val { font-family: var(--mono); font-weight: 700; font-size: 21px; letter-spacing: -.03em; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-val .yen { font-family: var(--sans); font-size: 15px; margin-left: 2px; font-weight: 700; letter-spacing: 0; }
.m.wide .m-val { font-size: 30px; }
.m-sub { font-size: 13.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m.savings { background: var(--ink); color: var(--paper); box-shadow: none; }
.m.savings .m-label, .m.savings .m-sub { color: #A9A496; }
.m.flash { animation: flash .7s ease; }
@keyframes flash { 0% { box-shadow: inset 0 0 0 2px var(--accent); } 100% { box-shadow: inset 0 0 0 0 transparent; } }
.pnl { padding: 14px 14px 13px; }
.pnl-grid { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; margin-top: 8px; }
.pnl-k { font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.pnl-net { font-weight: 700; font-size: 30px; letter-spacing: -.04em; line-height: 1.05; white-space: nowrap; }
.pnl-rate { text-align: right; padding-left: 12px; border-left: 1px dashed var(--line); }
.pnl-rv { font-weight: 700; font-size: 30px; letter-spacing: -.04em; line-height: 1.05; }
.pnl-net .yen, .pnl-rv .yen { font-family: var(--sans); font-size: 17px; margin-left: 2px; font-weight: 700; letter-spacing: 0; }
.pnl-win { margin-top: 10px; height: 34px; border-radius: 10px; background: var(--accent-soft); overflow: hidden; }
.pnl-win-in { display: flex; align-items: center; gap: 8px; height: 100%; padding: 0 10px; font-size: 15px; animation: winIn .4s cubic-bezier(.2,.9,.3,1.2); }
.pnl-win-in.idle { animation: none; color: var(--muted); }
.pnl-win-in.idle .pnl-win-txt { color: #A8705F; font-weight: 500; }
.pnl-win-tag { flex: none; background: var(--accent); color: #fff; font-size: 13px; font-weight: 900; padding: 2px 6px; border-radius: 5px; }
.pnl-win-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; color: #7A2414; }
.pnl-win-amt { flex: none; font-weight: 700; font-size: 17px; color: var(--accent); }
@keyframes winIn { from { transform: translateY(100%); opacity: 0; } }
.pnl-bar { position: relative; height: 10px; border-radius: 99px; background: var(--line-2); margin-top: 12px; overflow: hidden; }
.pnl-bar { background: linear-gradient(to right, #F3DCD6 0 50%, #D6EADF 50% 100%) !important; }
.pnl-bar i { position: absolute; top: 0; bottom: 0; transition: left .3s, width .3s; }
.pnl-bar i.under { background: linear-gradient(to right, #E2543C, #F08A73); border-radius: 99px 0 0 99px; }
.pnl-bar i.over { background: linear-gradient(to right, #4FB384, #1D7650); border-radius: 0 99px 99px 0; }
.pnl-bar b { position: absolute; left: calc(50% - 1px); top: -2px; bottom: -2px; width: 2px; background: var(--ink); }
.pnl-scale { display: flex; justify-content: space-between; margin-top: 4px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.pnl-scale span:nth-child(2) { color: var(--ink); font-weight: 700; }
.pnl-sub { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.pnl-sub > div { background: var(--paper); border-radius: 12px; padding: 9px 10px; min-width: 0; }
.pnl-sk { display: flex; align-items: center; justify-content: space-between; gap: 4px; font-size: 14px; font-weight: 700; color: var(--muted); min-height: 22px; }
.pnl-sk .seg { background: var(--line-2); }
.pnl-sv { font-family: var(--mono); font-weight: 700; font-size: 18.5px; letter-spacing: -.03em; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pnl-sv .yen { font-family: var(--sans); font-size: 14px; margin-left: 2px; letter-spacing: 0; }
.pos { color: var(--pos); } .neg { color: var(--neg); }

.seg { display: inline-flex; background: var(--line-2); border-radius: 8px; padding: 2px; }
.seg button { border: 0; background: transparent; font-size: 13.5px; font-weight: 700; padding: 3px 7px; border-radius: 6px; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.m.savings .seg { background: #2A2A30; }

.section { padding: 18px 16px 4px; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.section-h h3 { margin: 0; font-size: 17px; font-weight: 900; letter-spacing: .04em; }

.flow { background: var(--card); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line-2); padding: 4px 14px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; font-size: 16px; border-bottom: 1px dashed var(--line); }
.row:last-child { border-bottom: 0; }
.row .k { color: var(--ink-2); }
.row .v { font-family: var(--mono); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row.total .k, .row.total .v { font-weight: 900; color: var(--ink); }

.progress { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--ink); border-radius: 99px; transition: width .3s; }
.progress.acc > i { background: var(--accent); }

.goal { background: var(--card); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line-2); padding: 13px 14px; }
.goal + .goal { margin-top: 8px; }
.goal-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.goal-name { font-weight: 900; font-size: 17px; display: flex; align-items: center; gap: 6px; }
.goal-note { font-size: 13.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }

.feed { background: var(--card); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line-2); overflow: hidden; }
.feed-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line-2); font-size: 15.5px; }
.feed-item:last-child { border-bottom: 0; }
.feed-item .chip { font-family: var(--mono); font-size: 13px; font-weight: 700; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--ink); color: var(--paper); }
.feed-item .amt { font-family: var(--mono); font-weight: 700; font-size: 17px; color: var(--accent); white-space: nowrap; }
.feed-item .meta { color: var(--muted); font-size: 14px; }
.empty { padding: 22px 14px; text-align: center; color: var(--muted); font-size: 15.5px; }

.ledger { width: 100%; border-collapse: collapse; font-size: 14px; }
.ledger th { text-align: right; color: var(--muted); font-weight: 700; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ledger th:first-child, .ledger td:first-child { text-align: left; }
.ledger td { font-family: var(--mono); text-align: right; padding: 7px 6px; border-bottom: 1px dashed var(--line-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---- Control dock + tabs ---- */
.dock { position: relative; z-index: 5; background: var(--paper); border-top: 1px solid var(--line); padding: 8px 12px 0; }
.ctrl { display: flex; align-items: center; gap: 8px; }
.play {
  width: 54px; height: 54px; flex: none; border-radius: 16px; border: 0; background: var(--accent); color: #fff;
  display: grid; place-items: center;
}
.play.paused { background: var(--ink); }
.speed { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--line-2); border-radius: 14px; padding: 3px; height: 54px; }
.speed button { border: 0; background: transparent; border-radius: 11px; font-family: var(--mono); font-weight: 700; font-size: 17px; color: var(--muted); }
.speed button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 0 calc(6px + var(--safe-b)); }
.tabs button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; min-height: 50px; font-size: 13.5px; font-weight: 700; color: var(--muted); position: relative; }
.tabs button.on { color: var(--ink); }
.tabs button.on::before { content: ''; position: absolute; top: 0; width: 22px; height: 3px; border-radius: 3px; background: var(--accent); }
.tabs svg { width: 22px; height: 22px; }
.badge { position: absolute; top: 4px; right: calc(50% - 18px); width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* ---- Sliders ---- */
.alloc-card { background: var(--card); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line-2); padding: 14px; }
.alloc-card + .alloc-card { margin-top: 8px; }
.alloc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.alloc-name { font-weight: 900; font-size: 17.5px; }
.alloc-pt { font-family: var(--mono); font-weight: 700; font-size: 22px; }
.alloc-pt small { font-size: 14px; color: var(--muted); margin-left: 2px; }
.alloc-out { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-top: 10px; }
.alloc-out div { background: var(--paper); border-radius: 10px; padding: 7px 9px; }
.alloc-out .k { font-size: 13px; color: var(--muted); font-weight: 700; }
.alloc-out .v { font-family: var(--mono); font-weight: 700; font-size: 17px; margin-top: 2px; white-space: nowrap; }
input[type=range].rng { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 4px 0 0; }
input[type=range].rng::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: linear-gradient(to right, var(--ink) var(--p, 50%), var(--line-2) var(--p, 50%)); }
input[type=range].rng::-moz-range-track { height: 8px; border-radius: 99px; background: var(--line-2); }
input[type=range].rng::-moz-range-progress { height: 8px; border-radius: 99px; background: var(--ink); }
input[type=range].rng::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; border-radius: 50%; background: var(--card); margin-top: -11px; box-shadow: 0 0 0 2px var(--ink), 0 3px 8px rgba(0,0,0,.18); }
input[type=range].rng::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: var(--card); border: 2px solid var(--ink); }
input[type=range].rng.acc::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--accent) var(--p, 50%), var(--line-2) var(--p, 50%)); }
input[type=range].rng.acc::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--accent), 0 3px 8px rgba(0,0,0,.18); }

.locked { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: transparent; box-shadow: inset 0 0 0 1.5px dashed var(--line); border: 1.5px dashed var(--line); color: var(--muted); font-size: 15.5px; }
.locked + .locked { margin-top: 6px; }
.locked b { color: var(--ink-2); }

.note { font-size: 14.5px; color: var(--muted); line-height: 1.7; text-wrap: pretty; }
.callout { background: var(--accent-soft); color: #7A2414; border-radius: 12px; padding: 10px 12px; font-size: 15px; line-height: 1.6; }

/* ---- Toast ---- */
.toast-wrap { position: absolute; left: 12px; right: 12px; top: calc(10px + var(--safe-t)); z-index: 30; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); border-radius: 14px; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 16px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); animation: toastIn .35s cubic-bezier(.2,.9,.3,1.3); }
.toast .num { color: #FF8A73; font-weight: 700; font-size: 17.5px; }
.toast.warn { background: #6B2116; }
@keyframes toastIn { from { transform: translateY(-20px) scale(.96); opacity: 0; } }

/* ---- Sheet ---- */
.screen-h { padding: calc(16px + var(--safe-t)) 16px 6px; }
.screen-h h2 { margin: 2px 0 0; font-size: 24px; font-weight: 900; letter-spacing: .02em; }

/* ---- Death / Result ---- */
.result { background: var(--night); color: #EDE9DF; }
.result .scroll { background: var(--night); }
.result .eyebrow { color: #8C877A; }
.result .flow, .result .goal { background: #1C1C22; box-shadow: inset 0 0 0 1px #2A2A31; color: #EDE9DF; }
.result .row { border-color: #2E2E36; }
.result .row .k { color: #A9A496; }
.result .progress { background: #2A2A31; }
.result .progress > i { background: #EDE9DF; }
.result .btn.ghost { color: #EDE9DF; box-shadow: inset 0 0 0 1.5px #EDE9DF; }
.result .pos { color: #5FCB97; } .result .neg { color: #F08470; }
.death-age { font-family: var(--mono); font-weight: 700; font-size: 104px; line-height: .85; letter-spacing: -.07em; }
.fade-up { animation: fadeUp .7s cubic-bezier(.2,.8,.2,1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }
.check { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 15px; font-weight: 900; }
.check.ok { background: #5FCB97; color: var(--night); }
.check.ng { background: #2A2A31; color: #8C877A; }

/* ---- Unlock animation ---- */
.unlock { position: absolute; inset: 0; z-index: 50; background: radial-gradient(circle at 50% 42%, #2A1410 0%, #0C0C0F 70%); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; overflow: hidden; }
.rays { position: absolute; left: 50%; top: 42%; width: 900px; height: 900px; margin: -450px 0 0 -450px; background: repeating-conic-gradient(from 0deg, rgba(217,67,43,.22) 0deg 6deg, transparent 6deg 18deg); animation: spin 18s linear infinite, raysIn 1s ease both; border-radius: 50%; mask: radial-gradient(circle, #000 0%, transparent 62%); -webkit-mask: radial-gradient(circle, #000 0%, transparent 62%); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes raysIn { from { opacity: 0; transform: scale(.4); } }
.uticket { position: relative; width: 260px; background: var(--paper); color: var(--ink); border-radius: 18px; padding: 22px 20px 20px; text-align: center; animation: ticketIn 1s cubic-bezier(.2,1.4,.3,1) .25s both; box-shadow: 0 30px 80px -20px rgba(217,67,43,.6); }
.uticket::before, .uticket::after { content: ''; position: absolute; top: 58%; width: 22px; height: 22px; border-radius: 50%; background: #120C0B; }
.uticket::before { left: -11px; } .uticket::after { right: -11px; }
.uticket .perf { border-top: 2px dashed var(--line); margin: 16px -20px 14px; }
.uticket .uname { font-family: var(--display); font-size: 30px; line-height: 1.1; margin-top: 10px; }
.uticket .ucode { font-family: var(--mono); font-weight: 700; font-size: 56px; letter-spacing: -.05em; color: var(--accent); line-height: 1; }
.stamp { position: absolute; top: -14px; right: -14px; background: var(--accent); color: #fff; font-family: var(--display); font-size: 17px; padding: 8px 10px; border-radius: 10px; transform: rotate(12deg); animation: stamp .5s cubic-bezier(.3,1.6,.4,1) 1.1s both; }
@keyframes ticketIn { from { opacity: 0; transform: translateY(60px) rotateX(70deg) scale(.6); } }
@keyframes stamp { from { opacity: 0; transform: rotate(12deg) scale(2.4); } }
.unlock .after { animation: fadeUp .6s ease 1.4s both; text-align: center; position: relative; }

/* ---- Records ---- */
.dex { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dex-card { border-radius: 14px; padding: 12px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2); min-height: 92px; display: flex; flex-direction: column; justify-content: space-between; }
.dex-card.lock { background: transparent; box-shadow: none; border: 1.5px dashed var(--line); color: var(--muted); }
.dex-card .dn { font-weight: 900; font-size: 17px; }
.dex-card .dc { font-family: var(--mono); font-weight: 700; font-size: 22px; letter-spacing: -.04em; }
.life-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line-2); font-size: 15.5px; }
.life-row:last-child { border-bottom: 0; }
.life-row .idx { font-family: var(--mono); font-weight: 700; font-size: 16px; width: 34px; height: 34px; border-radius: 10px; background: var(--line-2); display: grid; place-items: center; }

/* ---- Cash flow (simplified) ---- */
.cf { background: var(--card); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line-2); padding: 14px; }
.cf-bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--line-2); gap: 2px; }
.cf-bar i { display: block; height: 100%; transition: width .3s; }
.cf-bar i.cost, .dot.cost { background: #BDB6A6; }
.cf-bar i.lot, .dot.lot { background: var(--accent); }
.cf-eq { display: grid; grid-template-columns: 1fr auto 1fr auto 1.25fr; align-items: end; gap: 6px; margin-top: 12px; }
.cf-k { font-size: 13.5px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
.cf-v { font-weight: 700; font-size: 18.5px; letter-spacing: -.03em; margin-top: 2px; white-space: nowrap; }
.cf-v small { font-family: var(--sans); font-size: 13.5px; margin-left: 1px; }
.cf-op { font-family: var(--mono); font-weight: 700; color: var(--muted); font-size: 17.5px; padding-bottom: 2px; }
.cf-eq .hl { text-align: right; }
.cf-eq .hl .cf-k { justify-content: flex-end; }
.cf-eq .hl .cf-v { color: var(--accent); font-size: 20px; }
.cf-extras { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.cf-extras span { font-size: 13.5px; color: var(--ink-2); background: var(--paper); border-radius: 6px; padding: 3px 7px; }
.cf-extras span.neg { background: var(--accent-soft); color: var(--neg); }
.cf-buy { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.cf-item { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; padding: 4px 0; font-size: 15.5px; }
.cf-item .chip { font-family: var(--mono); font-size: 12.5px; font-weight: 700; width: 26px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--ink); color: var(--paper); }
.cf-name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-t { color: var(--muted); font-size: 15px; }
.cf-c { font-weight: 700; min-width: 72px; text-align: right; }
.cf-c small { font-family: var(--sans); font-size: 13px; margin-left: 1px; }
.cf-rem { font-size: 13.5px; color: var(--muted); margin-top: 4px; text-align: right; }

/* ---- Skill levels ---- */
.lv-badge { white-space: nowrap; font-family: var(--mono); font-weight: 700; font-size: 17px; padding: 5px 10px; border-radius: 9px; background: var(--line-2); color: var(--ink-2); display: inline-flex; align-items: center; }
.lv-badge.on { background: var(--accent); color: #fff; }
.lv-scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 13.5px; color: var(--muted); margin-top: -4px; }
.lv-list { background: var(--card); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line-2); overflow: hidden; }
.lv-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line-2); }
.lv-row:last-child { border-bottom: 0; }
.lv-n { white-space: nowrap; letter-spacing: -.04em; font-family: var(--mono); font-weight: 700; font-size: 16px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--line-2); color: var(--muted); }
.lv-row.cur .lv-n { background: var(--accent); color: #fff; }
.lv-row.got .lv-n { background: var(--ink); color: var(--paper); }
.lv-row.next .lv-n { background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); }
.lv-cond { font-size: 15.5px; font-weight: 700; }
.lv-row.lock .lv-cond { color: var(--muted); font-weight: 500; }
.lv-prog { font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.lv-max { text-align: right; font-size: 14px; font-weight: 700; color: var(--muted); }
.lv-max .num { font-size: 20px; color: var(--ink); }
.lv-row.lock .lv-max .num { color: var(--muted); }
.lv-st { font-size: 13px; color: var(--accent); }

.cf-bar i.re, .dot.re { background: var(--gold); }
.cf-eq4 { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: end; gap: 6px; margin-top: 12px; }
.cf-eq4 > div.off .cf-v, .cf-eq4 > div.off .cf-k { color: var(--muted); opacity: .6; }
.cf-res { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); }
.cf-res .cf-op { color: var(--accent); padding: 0; }
.cf-res .cf-k { color: #7A2414; font-size: 15px; }
.cf-rv { margin-left: auto; font-weight: 700; font-size: 24px; letter-spacing: -.04em; color: var(--accent); white-space: nowrap; }
.cf-rv small { font-family: var(--sans); font-size: 15px; margin-left: 2px; letter-spacing: 0; }
.cf-hint { font-size: 13.5px; color: var(--muted); margin-top: 6px; }

/* ---- Big win overlay (>100万) ---- */
.bigwin { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(12,10,9,.62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); overflow: hidden; animation: bwFade .25s ease; cursor: pointer; }
@keyframes bwFade { from { opacity: 0; } }
.bw-rays { position: absolute; left: 50%; top: 46%; width: 1000px; height: 1000px; margin: -500px 0 0 -500px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(233,180,76,.32) 0deg 5deg, transparent 5deg 15deg);
  mask: radial-gradient(circle, #000 0%, transparent 55%); -webkit-mask: radial-gradient(circle, #000 0%, transparent 55%);
  animation: spin 14s linear infinite, raysIn .6s ease both; }
.bw-confetti { position: absolute; inset: 0; pointer-events: none; }
.bw-confetti i { position: absolute; top: -24px; opacity: 0; animation-name: confettiFall, confettiFlip; animation-timing-function: cubic-bezier(.3,.1,.6,1), ease-in-out; animation-fill-mode: both, none; animation-iteration-count: 1, infinite; animation-direction: normal, alternate; }
@keyframes confettiFall {
  0%   { transform: translate(0, 0) rotate(var(--rot0)); opacity: 0; }
  8%   { opacity: 1; }
  25%  { transform: translate(calc(var(--drift) * .25 + var(--sway)), 28vh) rotate(calc(var(--rot0) + var(--rot) * .25)); }
  50%  { transform: translate(calc(var(--drift) * .5 - var(--sway)), 55vh) rotate(calc(var(--rot0) + var(--rot) * .5)); }
  75%  { transform: translate(calc(var(--drift) * .75 + var(--sway)), 82vh) rotate(calc(var(--rot0) + var(--rot) * .75)); opacity: 1; }
  100% { transform: translate(var(--drift), 108vh) rotate(calc(var(--rot0) + var(--rot))); opacity: .7; }
}
@keyframes confettiFlip { from { scale: 1 1; } to { scale: calc(var(--flip) * .2) 1; } }
.bw-card { position: relative; width: min(320px, 86%); text-align: center; color: var(--ink); background: var(--paper); border-radius: 22px; padding: 22px 18px 18px;
  box-shadow: 0 0 0 3px var(--gold), 0 0 0 7px rgba(233,180,76,.25), 0 30px 80px -10px rgba(217,67,43,.7);
  animation: bwPop .6s cubic-bezier(.2,1.5,.35,1) both; }
@keyframes bwPop { 0% { transform: scale(.4) rotate(-6deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.bw-eyebrow { display: inline-block; font-family: var(--display); font-size: 17.5px; letter-spacing: .1em; color: #fff; background: var(--accent); padding: 6px 14px; border-radius: 99px; transform: translateY(-36px); margin-bottom: -26px; box-shadow: 0 6px 16px -4px rgba(217,67,43,.7); animation: stamp .45s cubic-bezier(.3,1.6,.4,1) .25s both; }
.bw-prod { font-weight: 900; font-size: 17.5px; }
.bw-prod span { color: var(--accent); }
.bw-amt { font-weight: 700; font-size: 44px; letter-spacing: -.05em; line-height: 1.1; margin-top: 6px; white-space: nowrap;
  background: linear-gradient(180deg, #E05A3C, #A8301C); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bw-amt small { font-family: var(--sans); font-size: 18px; letter-spacing: 0; margin-left: 2px; }
.bw-balls { display: flex; justify-content: center; gap: 5px; margin-top: 12px; flex-wrap: wrap; }
.bw-balls span { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 17px; background: var(--ink); color: var(--paper); animation: ballIn .4s cubic-bezier(.3,1.6,.4,1) both; }
@keyframes ballIn { from { transform: scale(0); } }
.bw-jumbo { margin-top: 10px; font-weight: 700; font-size: 17.5px; }
.bw-note { margin-top: 12px; font-size: 14.5px; color: var(--muted); }
.bw-tap { position: relative; margin-top: 18px; font-size: 14px; color: rgba(255,255,255,.65); letter-spacing: .1em; animation: fadeUp .5s ease .8s both; }

/* ---- Retirement notice ---- */
.retire { position: absolute; inset: 0; z-index: 38; display: flex; align-items: center; justify-content: center; background: rgba(23,23,27,.45); animation: bwFade .3s ease; cursor: pointer; }
.rt-card { width: min(320px, 86%); background: var(--paper); border-radius: 22px; padding: 20px 18px 18px; text-align: center; box-shadow: 0 30px 70px -20px rgba(0,0,0,.5); animation: fadeUp .5s cubic-bezier(.2,.9,.3,1.1) both; }
.rt-age { font-weight: 700; font-size: 64px; letter-spacing: -.06em; line-height: 1; margin-top: 8px; }
.rt-age small { font-family: var(--sans); font-size: 18px; letter-spacing: 0; margin-left: 2px; }
.rt-title { font-weight: 900; font-size: 18px; margin-top: 8px; }
.rt-sub { font-size: 15px; color: var(--ink-2); margin-top: 4px; }
.rt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 14px; }
.rt-grid > div { background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2); border-radius: 12px; padding: 9px 8px; }
.rt-grid .k { font-size: 13px; font-weight: 700; color: var(--muted); }
.rt-grid .v { font-weight: 700; font-size: 17.5px; margin-top: 2px; }
.rt-note { font-size: 13.5px; color: var(--muted); margin-top: 10px; line-height: 1.6; text-wrap: pretty; }

/* ---- Cost detail sheet ---- */
.m.tappable { cursor: pointer; transition: transform .12s; }
.m.tappable:active { transform: scale(.98); }
.m.tappable .tag { background: var(--ink); color: var(--paper); }
.sheet-wrap { position: absolute; inset: 0; z-index: 35; background: rgba(23,23,27,.45); display: flex; align-items: flex-end; animation: bwFade .2s ease; }
.sheet { width: 100%; max-height: 88%; overflow-y: auto; background: var(--paper); border-radius: 22px 22px 0 0; padding: 8px 16px calc(18px + var(--safe-b)); animation: sheetUp .32s cubic-bezier(.2,.9,.3,1); box-shadow: 0 -20px 50px -20px rgba(0,0,0,.4); }
.sheet::-webkit-scrollbar { width: 0; }
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet-grip { width: 40px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto 10px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; }
.sheet-head .eyebrow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-head > div { min-width: 0; }
.sheet-head h3 { margin: 2px 0 0; font-size: 20px; font-weight: 900; }
.sheet-x { width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--line-2); font-size: 22px; line-height: 1; margin: -4px -4px 0 0; }
.cd-total { display: flex; align-items: baseline; gap: 4px; margin-top: 10px; }
.cd-total .num { font-weight: 700; font-size: 36px; letter-spacing: -.04em; }
.cd-total small { font-size: 16px; font-weight: 700; }
.cd-year { margin-left: auto; font-size: 14.5px; color: var(--muted); font-family: var(--mono); }
.cd-bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; gap: 2px; margin-top: 10px; }
.cd-bar i { display: block; height: 100%; }
.cd-list { background: var(--card); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line-2); padding: 2px 12px; margin-top: 12px; }
.cd-row { display: grid; grid-template-columns: 12px 1fr auto 92px; gap: 8px; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 16px; }
.cd-row:last-child { border-bottom: 0; }
.cd-dot { width: 10px; height: 10px; border-radius: 3px; }
.cd-name { font-weight: 700; }
.cd-pct { font-size: 14px; color: var(--muted); }
.cd-yen { font-weight: 700; text-align: right; }
.cd-yen small { font-family: var(--sans); font-size: 13px; margin-left: 1px; }
.cd-sec { font-size: 14px; font-weight: 900; letter-spacing: .08em; color: var(--muted); margin: 16px 2px 6px; }
.cd-formula { background: var(--card); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line-2); padding: 4px 12px; }
.cd-formula > div { display: flex; justify-content: space-between; padding: 7px 0; font-size: 15px; border-bottom: 1px dashed var(--line-2); }
.cd-formula > div:last-child { border-bottom: 0; }
.cd-formula .k { color: var(--ink-2); }
.cd-formula .v { font-weight: 700; }
.cd-formula .tot .k, .cd-formula .tot .v { font-weight: 900; color: var(--ink); }
.cd-cover { margin-top: 12px; background: var(--ink); color: var(--paper); border-radius: 14px; padding: 11px 12px; }
.cd-cover-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.cd-cover-top b { font-size: 20px; }
.cd-cover .neg { color: #F08470; }
.cd-cover-note { font-size: 14px; color: #A9A496; margin-top: 3px; }

/* ---- QOL ---- */
.m.qol { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 11px 13px; }
.qol-v { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }
.qol-v .num { font-weight: 700; font-size: 28px; letter-spacing: -.04em; line-height: 1; }
.qol-band { font-size: 14px; font-weight: 900; padding: 2px 7px; border-radius: 6px; color: #fff; }
.qol-band.b0 { background: #8E2A1E; } .qol-band.b1 { background: var(--accent); } .qol-band.b2 { background: var(--gold); }
.qol-band.b3 { background: #4FA07A; } .qol-band.b4 { background: var(--pos); }
.qol-meter { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; height: 10px; }
.qol-meter i { border-radius: 3px; opacity: .85; }
.qol-meter .s0 { background: #8E2A1E; } .qol-meter .s1 { background: var(--accent); } .qol-meter .s2 { background: var(--gold); }
.qol-meter .s3 { background: #4FA07A; } .qol-meter .s4 { background: var(--pos); }
.qol-meter b { position: absolute; top: -4px; width: 4px; height: 18px; margin-left: -2px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px var(--card); transition: left .4s; }
.qol-note { font-size: 13.5px; color: var(--muted); margin-top: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-qol { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 15px; font-weight: 700; }
.cd-qol b { font-size: 17.5px; }
.cd-qol > span, .cd-std > span, .cd-std > b { white-space: nowrap; }
.cd-frugal { background: var(--accent-soft); color: #7A2414; padding: 3px 8px; border-radius: 6px; font-size: 14px; }
.cd-std { display: flex; justify-content: space-between; margin-top: 6px; font-size: 14.5px; color: var(--muted); }
.cd-std b { color: var(--pos); }
.cd-save { grid-column: 2 / -1; font-size: 13.5px; color: var(--muted); margin-top: -4px; }
.cd-save b { color: var(--pos); }

/* ---- Ads (placeholder) ---- */
.ad-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.ad-label { align-self: stretch; font-size: 12.5px; font-weight: 700; letter-spacing: .14em; color: var(--muted); text-align: left; }
.ad-slot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 8px;
  background: repeating-linear-gradient(135deg, #ECE8DE 0 8px, #E4DFD3 8px 16px); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.ad-size { font-size: 14px; font-weight: 700; }
.ad-name { font-size: 13px; }
.ad-wrap.dark .ad-label { color: #8C877A; }
.ad-slot.dark, .ad-wrap.dark .ad-slot { background: repeating-linear-gradient(135deg, #1C1C22 0 8px, #22222A 8px 16px); box-shadow: inset 0 0 0 1px #2E2E36; color: #8C877A; }
.ad-anchor { position: relative; z-index: 5; display: flex; justify-content: center; padding: 4px 0 2px; background: var(--paper); border-top: 1px solid var(--line); }
.ad-anchor .ad-label { display: none; }
.ad-anchor .ad-slot::before { content: '広告'; position: absolute; left: 4px; top: 2px; font-size: 12.5px; font-weight: 700; letter-spacing: .1em; }
.ad-anchor + .dock { border-top: 0; }
.inter { position: absolute; inset: 0; z-index: 60; background: #0C0C0F; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 20px; animation: bwFade .25s ease; }
.inter-top { width: 320px; max-width: 100%; display: flex; justify-content: space-between; align-items: center; }
.inter-top .ad-label { align-self: center; }
.inter-skip { border: 0; min-height: 40px; padding: 0 14px; border-radius: 99px; background: #EDE9DF; color: var(--ink); font-size: 15.5px; font-weight: 700; }
.inter-skip:disabled { background: #2A2A31; color: #8C877A; }

/* ---- Price chip ---- */
.price-chip { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; max-width: 210px; white-space: normal !important; align-items: center; gap: 2px 5px; margin-top: 6px; padding: 4px 8px; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.price-chip b { font-size: 15px; }
.price-chip.deflation { background: #DCE6F0; color: #2F5478; }
.price-chip.stable { background: #DDEBE2; color: var(--pos); }
.price-chip.inflation { background: #F5E7CF; color: #8A5E12; }
.price-chip.high { background: var(--accent-soft); color: var(--neg); }

.rt-timer { height: 3px; border-radius: 99px; background: var(--line-2); margin-top: 12px; overflow: hidden; }
.rt-timer i { display: block; height: 100%; background: var(--ink); transform-origin: left; animation: rtTimer linear forwards; }
@keyframes rtTimer { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.bet-split { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; align-items: center; }
.bet-h { font-size: 13px; font-weight: 700; color: var(--muted); margin-right: 2px; }
.bet-c { font-size: 13.5px; background: var(--paper); border-radius: 6px; padding: 3px 7px; color: var(--ink-2); white-space: nowrap; }
.bet-c b { color: var(--ink); }

/* ---- Gacha live name ---- */
.gacha-now { display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 14px; margin-bottom: 10px; border-radius: 14px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2); overflow: hidden; }
.gacha-now-k { flex: none; font-size: 13.5px; font-weight: 900; letter-spacing: .1em; color: var(--muted); writing-mode: horizontal-tb; }
.gacha-now-v { flex: 1; min-width: 0; font-family: var(--display); font-size: 32px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gacha-now-r { flex: none; font-size: 14px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--line-2); color: var(--ink-2); }
.gacha-now.idle .gacha-now-v { color: var(--line); }
.gacha-now.spin { background: var(--ink); box-shadow: none; }
.gacha-now.spin .gacha-now-k { color: #A9A496; }
.gacha-now.spin .gacha-now-v { color: var(--paper); animation: gnTick .12s ease-out; }
.gacha-now.spin .gacha-now-r { background: #2A2A30; color: #A9A496; }
.gacha-now.done { background: var(--accent); box-shadow: 0 8px 20px -8px rgba(217,67,43,.6); }
.gacha-now.done .gacha-now-k { color: rgba(255,255,255,.75); }
.gacha-now.done .gacha-now-v { color: #fff; animation: gnPop .45s cubic-bezier(.3,1.6,.4,1); }
.gacha-now.done .gacha-now-r { background: rgba(255,255,255,.22); color: #fff; }
@keyframes gnTick { from { transform: translateY(-40%); opacity: .3; } }
@keyframes gnPop { from { transform: scale(1.35); } }

/* ---- 花吹雪（ひらひら） ---- */
.bw-confetti { perspective: 600px; }
.pf-fall { position: absolute; top: -30px; display: block; animation-name: pfFall; animation-timing-function: linear; animation-fill-mode: both; animation-iteration-count: 1; will-change: transform; }
.pf-sway { display: block; animation-name: pfSway; animation-timing-function: ease-in-out; animation-iteration-count: infinite; animation-direction: alternate; }
.pf-piece { display: block; transform-style: preserve-3d; animation-timing-function: linear; animation-iteration-count: infinite; box-shadow: inset 0 0 0 0.5px rgba(0,0,0,.06); }
.pf-piece.petal { border-radius: 100% 0 100% 0 / 100% 0 100% 0; }
.pf-piece.paper { border-radius: 1.5px; }
.pf-piece.dot { border-radius: 50%; }
@keyframes pfFall {
  0%   { transform: translate3d(0, 0, 0); opacity: 0; }
  6%   { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translate3d(var(--drift), 112vh, 0); opacity: 0; }
}
@keyframes pfSway {
  from { transform: translateX(calc(var(--sway) * -1)) rotate(calc(var(--tilt) * -1)); }
  to   { transform: translateX(var(--sway)) rotate(var(--tilt)); }
}
@keyframes pfFlipX { from { transform: rotate(var(--rot0)) rotateX(0deg); } to { transform: rotate(var(--rot0)) rotateX(360deg); } }
@keyframes pfFlipY { from { transform: rotate(var(--rot0)) rotateY(0deg); } to { transform: rotate(var(--rot0)) rotateY(360deg); } }

.demo-box { border: 1.5px dashed var(--line); border-radius: 14px; padding: 12px; }
.demo-h { font-size: 14px; font-weight: 900; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.demo-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.demo-btns .btn { min-height: 44px; font-size: 15.5px; }

/* ---- 再生エリアのスライド表示/非表示 ---- */
.ctrl-slide { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .32s cubic-bezier(.3,.8,.3,1); }
.ctrl-slide.open { grid-template-rows: 1fr; }
.ctrl-inner { overflow: hidden; min-height: 0; }
.ctrl-slide .ctrl { transform: translateY(110%); opacity: 0; transition: transform .32s cubic-bezier(.3,.8,.3,1), opacity .22s ease; }
.ctrl-slide.open .ctrl { transform: none; opacity: 1; }
.ctrl-slide:not(.open) .ctrl { pointer-events: none; }
.dock { padding-top: 0 !important; }
.ctrl-slide.open .ctrl-inner { padding-top: 8px; }
.ctrl-inner { transition: padding-top .32s cubic-bezier(.3,.8,.3,1); }

/* 当選帯: 待機中は今生の最高当選を表示 */
.pnl-win-in.best { animation: none; }
.pnl-win-tag.best { background: var(--ink); color: var(--paper); }
.pnl-win-in.best .pnl-win-txt { color: var(--ink-2); font-weight: 700; }
.pnl-win-in.best .pnl-win-amt { color: var(--ink); }
.pnl-win-date { font-weight: 500; color: var(--muted); font-size: 14px; }

/* 最高当選（常時表示） */
.pnl-best { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: var(--ink); color: var(--paper); animation: bestUp .5s cubic-bezier(.3,1.4,.4,1); }
.pnl-best-k { flex: none; font-size: 13px; font-weight: 900; letter-spacing: .06em; padding: 2px 6px; border-radius: 5px; background: var(--gold); color: #fff; }
.pnl-best-txt { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pnl-best .pnl-win-date { color: #A9A496; }
.pnl-best-amt { flex: none; font-weight: 700; font-size: 17.5px; color: #FFD978; }
.pnl-best-amt small { font-family: var(--sans); font-size: 13.5px; margin-left: 1px; }
@keyframes bestUp { 0% { box-shadow: 0 0 0 0 rgba(233,180,76,.7); } 100% { box-shadow: 0 0 0 10px rgba(233,180,76,0); } }
.pnl-best + .pnl-win { margin-top: 6px; }

.tag.hl { background: #3A2A26; color: #F6DDD5; }
.rt-card.hl { background: #1C1A19; color: #EDE9DF; }
.rt-card.hl .eyebrow, .rt-card.hl .rt-sub, .rt-card.hl .rt-note { color: #A9A496; }
.rt-card.hl .rt-grid > div { background: #26232A; box-shadow: inset 0 0 0 1px #34303A; }
.rt-card.hl .rt-grid .k { color: #8C877A; }
.rt-card.hl .rt-timer { background: #34303A; }
.rt-card.hl .rt-timer i { background: #F08470; }
.cd-frugal.hl { background: #3A2A26; color: #F6DDD5; }

/* ---- Badges ---- */
.medal { position: relative; flex: none; display: inline-grid; place-items: center; border-radius: 50%; font-family: var(--mono); font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.medal-in { display: grid; place-items: center; width: 76%; height: 76%; border-radius: 50%; white-space: nowrap; }
.medal.bronze { background: conic-gradient(from 200deg, #B87333, #E3A26B, #8A5222, #D58E55, #B87333); box-shadow: 0 2px 6px -2px rgba(138,82,34,.6); }
.medal.bronze .medal-in { background: radial-gradient(circle at 35% 30%, #F1C08F, #B87333); color: #4A2A10; }
.medal.silver { background: conic-gradient(from 200deg, #9EA3AA, #E9ECEF, #7D828A, #D3D7DC, #9EA3AA); box-shadow: 0 2px 6px -2px rgba(80,85,92,.6); }
.medal.silver .medal-in { background: radial-gradient(circle at 35% 30%, #FFFFFF, #AEB3BA); color: #2E3238; }
.medal.gold { background: conic-gradient(from 200deg, #C9971F, #FFE08A, #A8781A, #F5CC5A, #C9971F); box-shadow: 0 2px 8px -2px rgba(168,120,26,.7); }
.medal.gold .medal-in { background: radial-gradient(circle at 35% 30%, #FFF1B8, #D9A92C); color: #5A3E05; }
.medal.none { background: transparent; border: 1.5px dashed var(--line); }
.medal.none .medal-in { color: var(--line); }
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.badge-card { background: var(--card); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line-2); padding: 10px 6px 9px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; min-width: 0; }
.badge-card.lock { background: transparent; box-shadow: none; border: 1.5px dashed var(--line); }
.badge-name { font-size: 14px; font-weight: 900; line-height: 1.3; margin-top: 2px; }
.badge-card.lock .badge-name { color: var(--muted); }
.badge-desc { font-size: 12.5px; color: var(--muted); line-height: 1.35; text-wrap: pretty; }
.badge-when { font-size: 12.5px; font-family: var(--mono); color: var(--accent); font-weight: 700; }
.toast.badge { background: #2A2416; }
.res-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.res-badge { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 99px; background: #1C1C22; box-shadow: inset 0 0 0 1px #2A2A31; font-size: 15px; font-weight: 700; }

/* ---- バッジ獲得演出 ---- */
.bp-wrap { position: absolute; left: 0; right: 0; top: calc(64px + var(--safe-t)); z-index: 36; display: flex; justify-content: center; padding: 0 14px; pointer-events: none; }
.bp-card { pointer-events: auto; cursor: pointer; position: relative; overflow: hidden; width: 100%; max-width: 380px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; padding: 12px 14px 14px 12px; border-radius: 18px; background: #1B1A17; color: #F2EFE7; box-shadow: 0 18px 40px -12px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.06); animation: bpIn .55s cubic-bezier(.2,1.3,.35,1) both; }
.bp-card.gold { box-shadow: 0 18px 40px -12px rgba(168,120,26,.6), inset 0 0 0 1.5px #C9971F; }
.bp-card.silver { box-shadow: 0 18px 40px -12px rgba(0,0,0,.55), inset 0 0 0 1.5px #9EA3AA; }
.bp-card.bronze { box-shadow: 0 18px 40px -12px rgba(0,0,0,.55), inset 0 0 0 1.5px #B87333; }
.bp-medal { animation: bpMedal .7s cubic-bezier(.3,1.6,.4,1) .12s both; }
.bp-body { min-width: 0; }
.bp-k { display: flex; align-items: center; gap: 6px; font-family: var(--display); font-size: 15px; letter-spacing: .08em; color: #FFD978; }
.bp-k span { font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: .04em; color: #A9A496; }
.bp-name { font-size: 18.5px; font-weight: 900; margin-top: 3px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-desc { font-size: 14px; color: #A9A496; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-rest { position: absolute; top: 10px; right: 12px; font-family: var(--mono); font-size: 14px; font-weight: 700; color: #1B1A17; background: #FFD978; border-radius: 99px; padding: 2px 7px; }
.bp-shine { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,236,170,.28) 50%, transparent 65%); transform: translateX(-120%); animation: bpShine 1.1s ease .35s both; pointer-events: none; }
.bp-timer { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.08); }
.bp-timer i { display: block; height: 100%; background: #FFD978; transform-origin: left; animation: rtTimer linear forwards; }
@keyframes bpIn { 0% { transform: translateY(-24px) scale(.92); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes bpMedal { 0% { transform: scale(0) rotate(-200deg); } 100% { transform: none; } }
@keyframes bpShine { to { transform: translateX(120%); } }

.badge-card.mystery { position: relative; overflow: hidden; }
.badge-card.mystery::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(184,137,42,.14) 50%, transparent 70%); transform: translateX(-100%); animation: mysteryShine 3.2s ease-in-out infinite; pointer-events: none; }
.mystery-medal { animation: mysteryPulse 2.4s ease-in-out infinite; }
.mystery-medal .medal-in { font-size: 18px; color: var(--muted) !important; }
@keyframes mysteryShine { 0%, 40% { transform: translateX(-100%); } 80%, 100% { transform: translateX(100%); } }
@keyframes mysteryPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

.cf-extras span.save { background: #DDEBE2; color: var(--pos); }

.lv-n { display: flex !important; align-items: center; justify-content: center; }

/* ---- 常時表示ステータス（年齢・日付） ---- */
.dock-status { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 4px; margin-top: 4px; font-size: 15px; color: var(--ink-2); white-space: nowrap; }
.ds-age b { font-size: 17.5px; font-weight: 700; color: var(--ink); margin-right: 1px; }
.ds-sep { width: 1px; height: 14px; background: var(--line); }
.ds-date { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.ds-state { margin-left: auto; font-size: 13.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--line-2); color: var(--muted); }
.ds-state.on { background: var(--accent-soft); color: var(--accent); }
.ds-state.on::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 5px; vertical-align: 1px; animation: dsBlink 1.2s ease-in-out infinite; }
@keyframes dsBlink { 50% { opacity: .25; } }
.ctrl-slide.open .ctrl-inner { padding-top: 2px; }

/* ---- スクロール時の固定ステータス（年齢・日付） ---- */
.sticky-status { position: absolute; left: 0; right: 0; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  padding: calc(8px + var(--safe-t)) 16px 8px; background: rgba(242,239,231,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); font-size: 15px; color: var(--ink-2); white-space: nowrap;
  transform: translateY(-100%); opacity: 0; pointer-events: none; transition: transform .28s cubic-bezier(.3,.8,.3,1), opacity .2s ease; }
.sticky-status.show { transform: none; opacity: 1; pointer-events: auto; }
.ss-age b { font-size: 18px; font-weight: 700; color: var(--ink); margin-right: 1px; }
.ss-sep { width: 1px; height: 14px; background: var(--line); }
.ss-date { font-size: 17px; font-weight: 700; color: var(--ink); }
.ss-state { margin-left: auto; font-size: 13.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--line-2); color: var(--muted); }
.ss-state.on { background: var(--accent-soft); color: var(--accent); }
.ss-state.on::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 5px; vertical-align: 1px; animation: dsBlink 1.2s ease-in-out infinite; }

/* ---- ジャンボ枠貯金 ---- */
.jf-card { box-shadow: inset 0 0 0 1.5px var(--gold); }
.jf-top { display: flex; justify-content: space-between; align-items: flex-end; }
.jf-bal { font-weight: 700; font-size: 26px; letter-spacing: -.04em; margin-top: 2px; }
.jf-bal small { font-family: var(--sans); font-size: 15px; margin-left: 2px; }
.jf-sched { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 6px; }
.jf-row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 5px 0; }
.jf-row .chip { font-family: var(--mono); font-size: 12.5px; font-weight: 700; width: 26px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--gold); color: #fff; }
.jf-name { font-size: 15.5px; font-weight: 700; }
.jf-date { font-size: 13.5px; color: var(--muted); font-family: var(--mono); }
.jf-est { font-size: 15px; font-weight: 700; }
.cf-extras span.jumbo { background: #F5E7CF; color: #8A5E12; }

.cf-item.jf .chip { background: var(--gold); }
.cf-sub { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cf-item.jf.zero .cf-c, .cf-item.jf.zero .cf-t { color: var(--muted); }

.cf-item.zero .cf-c, .cf-item.zero .cf-t { color: var(--muted); }
.cf-item.zero .chip { opacity: .45; }
.cf-item.jf.zero .chip { opacity: 1; }

/* ---- トグルスイッチ ---- */
.tgl { position: relative; width: 46px; height: 28px; flex: none; border: 0; border-radius: 99px; background: var(--line); padding: 0; transition: background .2s; }
.tgl i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .22s cubic-bezier(.3,1.4,.5,1); }
.tgl.on { background: var(--gold); }
.tgl.on i { transform: translateX(18px); }
.jf-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.jf-row { min-height: 44px; }
.jf-row.off .chip { background: var(--line); }
.jf-row.off .jf-name, .jf-row.off .jf-date { color: var(--muted); }

.cf-item.jf-sub { padding-left: 14px; position: relative; }
.cf-item.jf-sub::before { content: ''; position: absolute; left: 4px; top: 0; bottom: 50%; width: 6px; border-left: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); border-bottom-left-radius: 4px; }
.cf-item.jf-sub .chip { background: var(--gold); width: 24px; height: 20px; font-size: 12.5px; }
.cf-item.jf-sub.zero .chip { opacity: .45; }
.cf-sub.win { color: var(--accent); font-weight: 700; }

.cf-item.jf-sub.plan .cf-c, .cf-item.jf-sub.plan .cf-t { color: #8A5E12; font-style: normal; }

.cf-c.grow { animation: potGrow .5s ease; }
@keyframes potGrow { 0% { color: var(--gold); transform: translateY(-2px); } 100% { transform: none; } }

/* =========================== 超高額当選演出 =========================== */
.jp-wrap { position: absolute; inset: 0; z-index: 70; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; color: #fff; text-align: center; padding: 24px; }
/* ゲート */
.jp-gate { background: #08080A; animation: jpFade .35s ease both; }
@keyframes jpFade { from { opacity: 0; } }
.jp-gate-glow { position: absolute; left: 50%; top: 46%; width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%; background: radial-gradient(circle, rgba(233,180,76,.35), rgba(217,67,43,.12) 40%, transparent 68%); animation: jpBreath 2.2s ease-in-out infinite; }
@keyframes jpBreath { 50% { transform: scale(1.12); opacity: .75; } }
.jp-gate-ring { position: absolute; left: 50%; top: 46%; width: 0; height: 0; }
.jp-gate-ring i { position: absolute; left: -110px; top: -110px; width: 220px; height: 220px; border-radius: 50%; border: 1.5px solid rgba(255,217,120,.5); animation: jpRing 2.4s ease-out infinite; }
.jp-gate-ring i:nth-child(2) { animation-delay: .8s; } .jp-gate-ring i:nth-child(3) { animation-delay: 1.6s; }
@keyframes jpRing { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.9); opacity: 0; } }
.jp-gate-k { position: relative; font-family: var(--display); font-size: 17px; letter-spacing: .5em; color: #E9B44C; margin-left: .5em; animation: fadeUp .6s ease .2s both; }
.jp-gate-t { position: relative; font-size: 17.5px; color: #A9A496; margin-top: 10px; animation: fadeUp .6s ease .45s both; }
.jp-gate-btn { position: relative; margin-top: 36px; min-width: 240px; min-height: 76px; border: 0; border-radius: 99px; padding: 0 34px;
  background: linear-gradient(180deg, #FFE08A, #D9A92C); color: #3A2600; font-family: var(--display); font-size: 26px; letter-spacing: .06em;
  box-shadow: 0 0 0 4px rgba(255,217,120,.25), 0 18px 50px -10px rgba(233,180,76,.8); animation: jpBtnIn .7s cubic-bezier(.3,1.6,.4,1) .7s both, jpBtnPulse 1.6s ease-in-out 1.5s infinite; overflow: hidden; }
.jp-gate-btn::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.6) 50%, transparent 65%); transform: translateX(-120%); animation: bpShine 1.6s ease 1.6s infinite; }
.jp-gate-btn:active { transform: scale(.97); }
@keyframes jpBtnIn { from { transform: scale(0); opacity: 0; } }
@keyframes jpBtnPulse { 50% { box-shadow: 0 0 0 12px rgba(255,217,120,.12), 0 18px 60px -6px rgba(233,180,76,.95); } }
.jp-gate-hint { position: relative; margin-top: 14px; font-size: 14px; letter-spacing: .12em; color: #8C877A; animation: fadeUp .5s ease 1.3s both; }

/* 発表 */
.jp-reveal { background: radial-gradient(circle at 50% 40%, #241A0C, #08080A 70%); cursor: pointer; animation: jpFade .3s ease both; }
.jp-reveal.second.rank, .jp-reveal.second.done { background: radial-gradient(circle at 50% 40%, #16202C, #08080A 70%); }
.jp-reveal.rank, .jp-reveal.done { cursor: default; }
.jp-prod { position: relative; font-size: 17.5px; font-weight: 900; color: #EDE9DF; letter-spacing: .06em; }
.jp-amt-k { position: relative; margin-top: 18px; font-size: 14px; letter-spacing: .3em; color: #8C877A; }
.jp-amt { position: relative; display: flex; align-items: flex-end; justify-content: center; margin-top: 8px; font-family: var(--mono); font-weight: 700; }
.jp-dg { display: inline-block; width: var(--cw); font-size: calc(var(--cw) * 1.6); line-height: 1.1; color: rgba(255,255,255,.28); text-align: center; }
.jp-dg.fix { color: #FFD978; animation: jpFix .32s cubic-bezier(.3,1.8,.4,1); text-shadow: 0 0 18px rgba(255,217,120,.55); }
.jp-reveal.second.rank .jp-dg.fix, .jp-reveal.second.done .jp-dg.fix { color: #F2F4F7; text-shadow: 0 0 18px rgba(200,215,235,.55); }
@keyframes jpFix { from { transform: translateY(-40%) scale(1.5); } }
.jp-comma { font-size: calc(var(--cw) * 1.1); color: rgba(255,255,255,.4); width: calc(var(--cw) * .4); }
.jp-yen { font-family: var(--sans); font-size: calc(var(--cw) * .7); margin-left: 4px; margin-bottom: 6px; color: #EDE9DF; }
.jp-count { position: relative; margin-top: 6px; font-size: 15px; color: #A9A496; }
.jp-rank-slot { position: relative; height: 150px; margin-top: 14px; display: flex; align-items: center; justify-content: center; }
.jp-rank { display: flex; align-items: flex-end; animation: jpRank .8s cubic-bezier(.2,1.6,.35,1) both; }
.jp-rank-n { font-family: var(--display); font-size: 140px; line-height: .9; background: linear-gradient(180deg, #FFF1B8, #E9B44C 55%, #A8781A); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 24px rgba(233,180,76,.6)); }
.jp-rank-t { font-family: var(--display); font-size: 48px; color: #FFD978; margin: 0 0 14px 6px; }
.jp-reveal.second .jp-rank-n { background: linear-gradient(180deg, #FFFFFF, #C9D1DB 55%, #7D8794); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 6px 24px rgba(200,215,235,.5)); }
.jp-reveal.second .jp-rank-t { color: #E9ECEF; }
@keyframes jpRank { 0% { transform: scale(3); opacity: 0; filter: blur(8px); } 60% { opacity: 1; filter: blur(0); } 100% { transform: none; } }
.jp-burst { position: absolute; left: 50%; top: 62%; width: 900px; height: 900px; margin: -450px 0 0 -450px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255,217,120,.22) 0deg 5deg, transparent 5deg 14deg);
  mask: radial-gradient(circle, #000 0%, transparent 60%); -webkit-mask: radial-gradient(circle, #000 0%, transparent 60%); animation: spin 16s linear infinite, raysIn .8s ease both; }
.jp-reveal.second.rank .jp-burst, .jp-reveal.second.done .jp-burst { background: repeating-conic-gradient(from 0deg, rgba(220,230,245,.18) 0deg 5deg, transparent 5deg 14deg); }
.jp-after { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; animation: fadeUp .6s ease both; width: 100%; max-width: 320px; }
.jp-balls { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.jp-balls span { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 16px; background: #F2EFE7; color: var(--ink); }
.jp-balls span.bonus { background: transparent; color: #FFD978; box-shadow: inset 0 0 0 1.5px #FFD978; }
.jp-jnum { font-size: 17.5px; font-weight: 700; color: #EDE9DF; }
.jp-note { font-size: 14.5px; color: #A9A496; }
.jp-close { margin-top: 8px; }
.jp-skip { position: absolute; bottom: calc(24px + var(--safe-b)); left: 0; right: 0; font-size: 14px; letter-spacing: .12em; color: #6E6A60; }

.jp-balls { flex-wrap: nowrap; gap: 4px; }
.jp-balls span { width: var(--bs, 32px); height: var(--bs, 32px); font-size: calc(var(--bs, 32px) * .4); flex: none; }

/* 10桁固定表示 */
.jp-dg.empty { color: transparent; animation: jpEmpty .3s ease; }
@keyframes jpEmpty { from { color: rgba(255,255,255,.28); transform: scale(.6); } }
.jp-comma { transition: opacity .25s; }
.jp-comma.gone { opacity: 0; }
.jp-balls { flex-wrap: nowrap; gap: 4px; }
.jp-balls span { width: var(--bs, 32px); height: var(--bs, 32px); font-size: calc(var(--bs, 32px) * .4); flex: none; }

.jp-dg.empty { animation: jpEmptyFast .18s ease both; }
@keyframes jpEmptyFast { from { color: rgba(255,255,255,.28); transform: scale(.7); opacity: 1; } to { opacity: 0; } }
.jp-comma { transition: opacity .15s; }

/* =========== 1億円超の1等: 豪華演出 =========== */
.jp-reveal.mega { background: radial-gradient(circle at 50% 40%, #3A2508, #0A0704 72%); }
.jp-reveal.mega.hold .jp-amt { animation: jpTremble .08s linear infinite; }
@keyframes jpTremble { 0% { transform: translate(0,0); } 25% { transform: translate(1px,-1px); } 50% { transform: translate(-1px,1px); } 75% { transform: translate(1px,1px); } }
.jp-reveal.mega.hold .jp-dg:not(.fix) { color: rgba(255,217,120,.55); }
.jp-hold-k { position: absolute; top: 22%; left: 0; right: 0; font-family: var(--display); font-size: 30px; color: #FFD978; animation: jpHoldK .5s ease infinite alternate; }
@keyframes jpHoldK { from { opacity: .4; transform: scale(.95); } to { opacity: 1; transform: scale(1.05); } }
.jp-reveal.mega.oku { animation: jpShake .5s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes jpShake { 10%, 90% { transform: translate(-2px, 1px); } 20%, 80% { transform: translate(4px, -2px); } 30%, 50%, 70% { transform: translate(-8px, 3px); } 40%, 60% { transform: translate(8px, -3px); } }
.jp-flash { position: absolute; inset: 0; background: #FFF7D6; z-index: 5; pointer-events: none; animation: jpFlash .7s ease-out both; }
@keyframes jpFlash { 0% { opacity: .95; } 100% { opacity: 0; } }
.jp-shock { position: absolute; left: 50%; top: 38%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 3px solid rgba(255,217,120,.9); z-index: 4; pointer-events: none; animation: jpShock .9s cubic-bezier(.2,.8,.3,1) both; }
@keyframes jpShock { from { transform: scale(.2); opacity: 1; } to { transform: scale(22); opacity: 0; border-width: 1px; } }
.jp-reveal.mega .jp-dg.fix { color: #FFE9A3; text-shadow: 0 0 10px #FFD978, 0 0 28px rgba(233,180,76,.9); }
.jp-reveal.mega .jp-burst { background: repeating-conic-gradient(from 0deg, rgba(255,217,120,.35) 0deg 4deg, transparent 4deg 10deg); }
.jp-burst.b2 { animation: spin 9s linear infinite reverse, raysIn .8s ease both !important; background: repeating-conic-gradient(from 7deg, rgba(217,67,43,.22) 0deg 3deg, transparent 3deg 16deg) !important; }
.jp-reveal.mega .jp-rank-n { font-size: 170px; filter: drop-shadow(0 0 26px rgba(255,217,120,.9)) drop-shadow(0 8px 40px rgba(217,67,43,.6)); animation: jpMegaGlow 1.4s ease-in-out infinite alternate; }
@keyframes jpMegaGlow { to { filter: drop-shadow(0 0 40px rgba(255,236,170,1)) drop-shadow(0 8px 50px rgba(217,67,43,.8)); } }
.jp-reveal.mega .jp-rank-slot { height: 190px; }
.jp-reveal.mega .jp-rank { position: relative; }
.jp-crown { position: absolute; left: 50%; top: -34px; transform: translateX(-60%); font-size: 46px; color: #FFD978; text-shadow: 0 0 18px rgba(255,217,120,.9); animation: jpCrown .9s cubic-bezier(.3,1.6,.4,1) .35s both; }
@keyframes jpCrown { from { transform: translate(-60%, -40px) scale(.3) rotate(-30deg); opacity: 0; } }
.jp-ribbon { position: relative; margin-bottom: 4px; padding: 8px 34px; background: linear-gradient(180deg, #E0563C, #A8301C); color: #FFF1B8; font-family: var(--display); font-size: 22px; letter-spacing: .2em; box-shadow: 0 10px 24px -8px rgba(217,67,43,.8); animation: jpRibbon .7s cubic-bezier(.3,1.5,.4,1) both; clip-path: polygon(0 0, 100% 0, 94% 50%, 100% 100%, 0 100%, 6% 50%); }
.jp-ribbon span { margin-left: .2em; }
@keyframes jpRibbon { from { transform: scaleX(0); } }
.jp-coins { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.jp-coin-fall { position: absolute; top: -40px; animation-name: jpCoinFall; animation-timing-function: cubic-bezier(.4,.1,.7,1); animation-iteration-count: infinite; animation-fill-mode: both; }
@keyframes jpCoinFall { from { transform: translateY(0); opacity: 0; } 8% { opacity: 1; } to { transform: translateY(112vh); opacity: .9; } }
.jp-coin { display: grid; place-items: center; border-radius: 50%; font-style: normal; font-family: var(--display); color: #8A5E12;
  background: radial-gradient(circle at 35% 30%, #FFF1B8, #E9B44C 55%, #A8781A); box-shadow: inset 0 0 0 2px rgba(138,94,18,.5), 0 2px 6px rgba(0,0,0,.35); animation: jpCoinSpin linear infinite; }
@keyframes jpCoinSpin { 0% { transform: rotateY(0); } 100% { transform: rotateY(360deg); } }

.jp-gate-k { font-size: 22px; letter-spacing: .3em; margin-left: .3em; }

/* 2等: 決定後にシルバーへ切り替え */
.jp-reveal { transition: background .6s ease; }
.jp-dg.fix { transition: color .6s ease, text-shadow .6s ease; }
.jp-reveal.second.rank .jp-dg.fix, .jp-reveal.second.done .jp-dg.fix { color: #F2F4F7; text-shadow: 0 0 18px rgba(200,215,235,.55); }

/* 8桁目の溜め（1等・2等共通） */
.jp-reveal.hold .jp-amt { animation: jpTremble .08s linear infinite; }
.jp-reveal.hold .jp-dg:not(.fix) { color: rgba(255,217,120,.55); }

/* ---- SNSシェア ---- */
.share-open { width: auto; padding: 0 16px; color: #EDE9DF; }
.share-wrap { z-index: 80; }
.share-sheet { color: var(--ink); }
.share-preview { margin-top: 10px; border-radius: 14px; overflow: hidden; background: #121216; aspect-ratio: 4 / 5; display: grid; place-items: center; box-shadow: 0 10px 30px -14px rgba(0,0,0,.5); }
.share-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.share-loading { color: #8C877A; font-size: 15px; }
.share-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 12px; }
.share-btn { border: 0; background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2); border-radius: 14px; min-height: 68px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px 2px; }
.share-btn b { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-size: 17.5px; }
.share-btn span { font-size: 12.5px; font-weight: 700; color: var(--ink-2); line-height: 1.2; text-align: center; }
.share-btn.x b { background: #000; }
.share-btn.line b { background: #06C755; font-family: var(--display); }
.share-btn.fb b { background: #1877F2; font-family: Georgia, serif; font-size: 20px; }
.share-btn:disabled { opacity: .4; }
.share-text { margin: 12px 0 0; padding: 10px 12px; background: var(--card); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line-2); font-family: var(--sans); font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; color: var(--ink-2); }
.share-msg { position: sticky; bottom: 8px; margin: 10px auto 0; width: max-content; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 99px; font-size: 15px; font-weight: 700; }

/* ---- 会員 / ログイン ---- */
.acct-chip { border: 0; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); border-radius: 99px; min-height: 36px; padding: 0 14px; font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.acct-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pos); }
.acct-row { width: 100%; border: 0; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--accent); }
.acct-row.on { box-shadow: inset 0 0 0 1px var(--line-2); }
.acct-row b { display: block; font-size: 17px; }
.acct-sub { display: block; font-size: 13.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-go { font-size: 15px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.acct-row.on .acct-go { color: var(--muted); }
.auth-avatar { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--paper); font-weight: 900; font-size: 18px; }
.auth-avatar.sm { width: 36px; height: 36px; font-size: 17.5px; }
.acct-row:not(.on) .auth-avatar { background: var(--line-2); color: var(--muted); }
.auth-wrap { z-index: 85; }
.auth-card { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 14px; border-radius: 14px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2); }
.auth-name { font-weight: 900; font-size: 17.5px; }
.auth-mail { font-size: 14.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-benefit { margin-top: 10px; padding: 14px; border-radius: 14px; background: var(--ink); color: var(--paper); }
.auth-reason { font-size: 15px; font-weight: 700; color: #FFD978; margin-bottom: 8px; }
.auth-b-h { font-size: 14px; font-weight: 900; letter-spacing: .08em; color: #A9A496; }
.auth-b-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.auth-chip { font-size: 14px; font-weight: 700; padding: 4px 9px; border-radius: 99px; background: #2A2A30; color: #F2EFE7; }
.auth-b-note { font-size: 14px; color: #A9A496; margin-top: 8px; }
.auth-seg { display: grid !important; grid-template-columns: 1fr 1fr; margin-top: 14px; padding: 3px; border-radius: 12px; }
.auth-seg button { min-height: 40px; font-size: 16px; border-radius: 10px; }
.auth-form { display: grid; gap: 10px; margin-top: 12px; }
.auth-form label { display: grid; gap: 4px; }
.auth-form label span { font-size: 14.5px; font-weight: 700; color: var(--ink-2); }
.auth-form input { min-height: 48px; border-radius: 12px; border: 0; box-shadow: inset 0 0 0 1.5px var(--line); background: var(--card); padding: 0 14px; font-size: 17.5px; font-family: var(--sans); color: var(--ink); }
.auth-form input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--ink); }
.auth-err { font-size: 15px; font-weight: 700; color: var(--neg); background: var(--accent-soft); padding: 8px 10px; border-radius: 10px; }
.member-gate { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); color: #7A2414; cursor: pointer; font-size: 15px; }
.member-gate b { font-size: 16px; }
.member-gate > div > div { margin-top: 2px; font-weight: 700; }
.member-gate.dark { background: #2A1C10; color: #FFD978; margin: 8px 0; }
.tag.mem { background: var(--accent); color: #fff; margin-left: 6px; font-size: 12.5px; padding: 2px 6px; }

/* ---- パスワード再設定 ---- */
.auth-forgot { justify-self: center; margin-top: -2px; min-height: 44px; }
.reset { margin-top: 10px; }
.reset-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 14px; }
.rs { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 700; color: var(--muted); position: relative; }
.rs i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-family: var(--mono); background: var(--line-2); color: var(--muted); font-size: 15px; }
.rs.on { color: var(--ink); } .rs.on i { background: var(--accent); color: #fff; }
.rs.done i { background: var(--ink); color: var(--paper); }
.rs:not(:last-child)::after { content: ''; position: absolute; top: 13px; left: calc(50% + 18px); right: calc(-50% + 18px); height: 2px; background: var(--line-2); }
.rs.done:not(:last-child)::after { background: var(--ink); }
.mock-mail { border: 1.5px dashed var(--gold); border-radius: 12px; padding: 10px 12px; background: #FBF5E8; }
.mock-mail-h { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.mock-mail-b { margin-top: 6px; font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.mock-mail-b b { font-size: 18px; letter-spacing: .15em; color: var(--ink); }
.mock-mail-b span { font-size: 13.5px; color: var(--muted); }
.code-in { letter-spacing: .5em; text-align: center; font-size: 22px !important; font-weight: 700; }
.reset-done { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0; }
.reset-check { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--pos); color: #fff; font-size: 30px; font-weight: 900; animation: bpMedal .5s cubic-bezier(.3,1.6,.4,1) both; }
.reset-done-t { font-size: 18.5px; font-weight: 900; margin-top: 4px; }

.back-btn { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin: -6px 0 2px -10px; padding: 0 12px 0 6px; border: 0; background: transparent; font-size: 17px; font-weight: 700; color: var(--ink-2); border-radius: 12px; }
.back-btn:active { background: var(--line-2); }
.back-btn:disabled { opacity: .35; }

.gacha-back { margin-top: 8px; min-height: 48px; font-size: 17px; }

/* ---- ログイン状態表示 ---- */
.topbar { gap: 8px; }
.mode-chip { flex: none; display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 10px; border: 0; border-radius: 99px; font-size: 14px; font-weight: 900; letter-spacing: .04em; }
.mode-chip i { width: 7px; height: 7px; border-radius: 50%; }
.mode-chip.member { background: #DDEBE2; color: var(--pos); } .mode-chip.member i { background: var(--pos); }
.mode-chip.guest { background: var(--line-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); } .mode-chip.guest i { background: var(--muted); }
.mode-chip.static { min-height: 26px; }
.mode-switch { display: grid; gap: 8px; }
.mode-now { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mode-desc { font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mode-seg { display: grid !important; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 12px; }
.mode-seg button { min-height: 40px; font-size: 15.5px; border-radius: 10px; }
.mode-effects { display: grid; gap: 2px; background: var(--card); border-radius: 10px; padding: 6px 10px; box-shadow: inset 0 0 0 1px var(--line-2); }
.mode-effects > div { display: flex; justify-content: space-between; font-size: 14.5px; padding: 3px 0; }
.mode-effects span { color: var(--ink-2); }

/* ---- SNS共有テストモード ---- */
.share-test { margin-top: 10px; padding: 10px; border-radius: 12px; border: 1.5px dashed var(--gold); background: #FBF5E8; }
.share-test-h { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.share-test-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.share-test-btns .btn { min-height: 44px; font-size: 15.5px; }
.post-mock { background: #fff; border-radius: 16px; box-shadow: inset 0 0 0 1px #E1E8ED; padding: 12px; color: #0F1419; }
.post-head { display: flex; align-items: center; gap: 10px; }
.post-ava { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 900; flex: none; }
.post-head b { display: block; font-size: 17px; }
.post-head span { font-size: 15px; color: #536471; }
.post-text { margin-top: 8px; font-size: 17px; line-height: 1.55; white-space: pre-wrap; }
.post-img { display: block; width: 100%; margin-top: 10px; border-radius: 14px; border: 1px solid #E1E8ED; }
.post-link { display: flex; margin-top: 10px; border: 1px solid #E1E8ED; border-radius: 14px; overflow: hidden; }
.post-link-img { flex: none; width: 96px; display: grid; place-items: center; background: #121216; color: #F2EFE7; font-family: var(--display); font-size: 17px; }
.post-link-img span { color: var(--accent); }
.post-link-body { padding: 8px 10px; min-width: 0; }
.post-link-body span { display: block; font-size: 14.5px; color: #536471; }
.post-link-body b { display: block; font-size: 15.5px; margin-top: 2px; line-height: 1.35; }

/* ---- 個別シェアページ ---- */
.sp-issue { min-height: 50px; font-size: 17px; }
.sp-issued { margin-top: 12px; padding: 12px; border-radius: 14px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--accent); display: grid; gap: 8px; }
.sp-issued-h { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 900; }
.sp-url, .spm-url { font-size: 14px; color: var(--ink-2); background: var(--paper); border-radius: 8px; padding: 8px 10px; word-break: break-all; line-height: 1.4; }
.sp-url-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sp-url-btns .btn, .spm-btns .btn { min-height: 44px; font-size: 15px; }
.spm { display: grid; gap: 8px; }
.spm-row { background: var(--card); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line-2); padding: 12px; display: grid; gap: 8px; }
.spm-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.spm-t { font-size: 16px; font-weight: 900; }
.spm-sub { font-size: 14px; color: var(--muted); margin-top: 2px; }
.spm-btns { display: grid; grid-template-columns: 1fr 1fr 1.4fr 1fr; gap: 5px; }
.spm-del { color: var(--neg); }

.spm-toggle { flex: none; display: flex; align-items: center; gap: 8px; min-height: 44px; }
.spm-toggle span { font-size: 14.5px; font-weight: 900; color: var(--muted); min-width: 3em; text-align: right; }
.spm-toggle span.on { color: var(--pos); }
.tgl.pub.on { background: var(--pos); }
.spm-btns { grid-template-columns: 1fr 1fr 1fr !important; }
.spm-row.private { opacity: .85; }

/* ---- シェアページ上限・短縮URL ---- */
.spm-count { font-size: 15px; font-weight: 700; color: var(--ink-2); display: flex; align-items: baseline; gap: 4px; padding: 0 2px; }
.spm-count .num { font-size: 17.5px; color: var(--ink); }
.spm-count span:last-child { margin-left: auto; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.spm-url-row { display: flex; align-items: center; gap: 6px; }
.spm-short { font-size: 14.5px; color: var(--ink-2); background: var(--paper); border-radius: 99px; padding: 5px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.spm-row { gap: 6px !important; padding: 10px 12px !important; }
.ovf { margin-top: 10px; padding: 12px; border-radius: 14px; background: #2A1C10; color: #F2EFE7; display: grid; gap: 10px; }
.ovf-h { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.55; color: #CFCABE; }
.ovf-h b { display: block; font-size: 17px; color: #FFD978; margin-bottom: 2px; }
.ovf-badge { flex: none; padding: 4px 8px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 16px; font-weight: 700; }
.ovf-list { display: grid; gap: 4px; max-height: 260px; overflow-y: auto; }
.ovf-row { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: #3A2A1A; color: #F2EFE7; text-align: left; font-size: 15px; }
.ovf-row.on { background: #5A2418; box-shadow: inset 0 0 0 1.5px #F08470; }
.ovf-row:disabled { opacity: .55; }
.ovf-check { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-style: normal; font-weight: 900; box-shadow: inset 0 0 0 1.5px #8C877A; }
.ovf-row.on .ovf-check { background: #F08470; color: #2A1C10; box-shadow: none; }
.ovf-t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ovf-d { font-size: 13.5px; color: #A9A496; }
.ovf-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ovf-btns .btn { min-height: 46px; font-size: 15px; }

/* 人生結果画面（暗いテーマ）内で開く共有シートでも、明るいシート用の配色を強制 */
.share-sheet .btn.sp-issue, .result .share-sheet .btn.sp-issue {
  background: var(--ink) !important; color: var(--paper) !important; box-shadow: none !important;
  min-height: 52px; font-size: 17.5px; font-weight: 900;
}
.share-sheet .btn.sp-issue .tag.mem { background: var(--accent); color: #fff; }
.result .share-sheet .btn.light { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.result .share-sheet .btn.ghost { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.result .share-sheet .eyebrow { color: var(--muted); }
.result .share-sheet .row { border-color: var(--line); }
.result .share-sheet .row .k { color: var(--ink-2); }

/* ---- 節約の極意 ---- */
.fs-modes { display: grid; gap: 6px; margin-top: 8px; }
.fs-modes.off { opacity: .5; }
.fs-mode { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; border: 0; border-radius: 12px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); text-align: left; }
.fs-mode b { font-size: 17px; }
.fs-mode span { font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.fs-mode.on { background: var(--ink); color: var(--paper); box-shadow: none; }
.fs-mode.on span { color: #A9A496; }

/* ---- 前回の結果 ---- */
.last-card { background: var(--card); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line-2); padding: 14px; }
.last-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.last-age { display: flex; align-items: baseline; gap: 4px; }
.last-age .num { font-size: 40px; font-weight: 700; letter-spacing: -.05em; line-height: 1; }
.last-age small { font-size: 15px; font-weight: 700; color: var(--ink-2); }
.last-share { flex: none; font-size: 13.5px; font-weight: 900; padding: 4px 9px; border-radius: 99px; white-space: nowrap; }
.last-share.pub { background: #DDEBE2; color: var(--pos); }
.last-share.priv { background: var(--line-2); color: var(--ink-2); }
.last-share.none { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.last-sub { font-size: 14.5px; color: var(--muted); margin-top: 4px; }
.last-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.last-grid > div { background: var(--paper); border-radius: 10px; padding: 7px 10px; min-width: 0; }
.last-grid span { display: block; font-size: 13px; font-weight: 700; color: var(--muted); }
.last-grid b { display: block; font-size: 17px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.last-url { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; color: var(--muted); }
.last-url .num { background: var(--paper); border-radius: 99px; padding: 4px 10px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* =========== スキル画面（登録制） =========== */
.sk-sum { display: grid; grid-template-columns: auto auto 1fr; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--ink); color: var(--paper); }
.sk-sum > div > span { display: block; font-size: 13px; font-weight: 700; color: #A9A496; letter-spacing: .06em; }
.sk-sum b { font-size: 24px; font-weight: 700; line-height: 1.1; }
.sk-sum b small { font-size: 15px; color: #A9A496; margin-left: 1px; }
.sk-sum b.on { color: #FF8A73; }
.sk-sum-chips { display: flex; justify-content: flex-end; gap: 5px; flex-wrap: wrap; }
.sk-dot { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-style: normal; font-size: 15px; font-weight: 900; color: #fff; }
.sk-dot.none { background: #2A2A30 !important; color: #6E6A60; }
.sk-filter { display: grid !important; grid-template-columns: repeat(3, 1fr); margin: 12px 0 10px; padding: 3px; border-radius: 12px; }
.sk-filter button { min-height: 38px; font-size: 15px; border-radius: 10px; }
.sk-list { display: grid; gap: 8px; }
.sk-card { background: var(--card); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line-2); overflow: hidden; position: relative; }
.sk-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line); }
.sk-card.on::before { background: var(--tone, var(--accent)); }
.sk-card.red { --tone: var(--accent); } .sk-card.green { --tone: var(--pos); } .sk-card.gold { --tone: var(--gold); }
.sk-card.lock { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.sk-head { width: 100%; border: 0; background: transparent; display: grid; grid-template-columns: auto 1fr auto 20px; gap: 10px; align-items: center; padding: 12px 12px 12px 16px; min-height: 64px; text-align: left; }
.sk-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-style: normal; font-size: 18.5px; font-weight: 900; color: #fff; }
.sk-ic.red, .sk-dot.red { background: var(--accent); } .sk-ic.green, .sk-dot.green { background: var(--pos); } .sk-ic.gold, .sk-dot.gold { background: var(--gold); }
.sk-ic.none { background: var(--line-2) !important; color: var(--muted); }
.sk-ttl { min-width: 0; }
.sk-ttl b { display: block; font-size: 17.5px; font-weight: 900; }
.sk-eff { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sk-card.on .sk-eff { color: var(--ink-2); }
.sk-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.sk-lv { font-size: 16px; font-weight: 700; }
.sk-lv small { font-size: 13px; color: var(--muted); }
.sk-st { font-size: 13px; font-weight: 900; padding: 2px 7px; border-radius: 99px; white-space: nowrap; }
.sk-st.on { background: var(--tone, var(--accent)); color: #fff; }
.sk-card.red .sk-st.on { background: var(--accent); } .sk-card.green .sk-st.on { background: var(--pos); } .sk-card.gold .sk-st.on { background: var(--gold); }
.sk-st.off { background: var(--line-2); color: var(--ink-2); }
.sk-st.next { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.sk-st.lock { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.sk-chev { font-size: 20px; font-weight: 300; color: var(--muted); text-align: center; }
.sk-body { padding: 0 14px 14px 16px; border-top: 1px dashed var(--line); }
.sk-desc { font-size: 15px; color: var(--ink-2); line-height: 1.6; padding-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sk-timing { font-size: 13px; font-weight: 900; padding: 2px 7px; border-radius: 6px; }
.sk-timing.now { background: #F5E7CF; color: #8A5E12; } .sk-timing.next { background: var(--line-2); color: var(--muted); }
.sk-ctl { margin-top: 10px; padding: 12px; border-radius: 12px; background: var(--paper); }
.sk-tgl-row { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin: -2px 0 6px; font-size: 14.5px; font-weight: 900; color: var(--ink-2); }
.sk-card.green .tgl.on { background: var(--pos); } .sk-card.gold .tgl.on { background: var(--gold); } .sk-card.red .tgl.on { background: var(--accent); }
.sk-ctl-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; font-weight: 700; color: var(--muted); }
.sk-ctl-h b { font-size: 22px; color: var(--ink); }
.sk-ctl-h b small { font-size: 14px; margin-left: 1px; }
.sk-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.sk-kv.three { grid-template-columns: 1fr 1fr 1fr; }
.sk-kv > div { background: var(--card); border-radius: 10px; padding: 7px 9px; min-width: 0; }
.sk-kv span { display: block; font-size: 13px; font-weight: 700; color: var(--muted); }
.sk-kv b { display: block; font-size: 16px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sk-dim { opacity: .4; pointer-events: none; }
.sk-lvrow { margin-top: 10px; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line-2); }
.sk-lvrow .lv-row { padding: 9px 12px; }
.sk-card .fs-mode { background: var(--card); }
.sk-card .fs-mode.on { background: var(--ink); }

.sk-filter { grid-template-columns: 1fr 1fr !important; }

.sk-lv.max { font-family: var(--display); font-size: 14px; letter-spacing: .08em; padding: 2px 7px; border-radius: 6px; background: linear-gradient(180deg, #FFE08A, #D9A92C); color: #3A2600; }
.lv-row .lv-n.max { background: linear-gradient(180deg, #FFE08A, #D9A92C) !important; color: #3A2600 !important; font-family: var(--display); font-size: 14px; letter-spacing: .06em; }

/* ---- 転生 ---- */
.rb-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: #1C1C22; box-shadow: inset 0 0 0 1px #2A2A31; font-size: 14.5px; color: #A9A496; }
.rb-card b { display: block; font-size: 17px; color: #EDE9DF; margin-bottom: 2px; }
.rb-card.over { box-shadow: inset 0 0 0 1.5px #F08470; }
.rb-card.over > div > div { color: #F08470; font-weight: 700; }
.rb-ic { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 900; }
.rb-go { flex: none; border: 0; min-height: 40px; padding: 0 12px; border-radius: 99px; background: #EDE9DF; color: var(--ink); font-size: 15px; font-weight: 900; }
.rb-pips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 8px; }
.rb-pips i { height: 8px; border-radius: 4px; background: var(--line-2); }
.rb-pips i.on { background: var(--accent); }
.theme-ticket .result .rb-card { background: var(--card); box-shadow: 0 14px 30px -16px rgba(0,0,0,.8); color: var(--muted); }
.theme-ticket .result .rb-card b { color: var(--ink); }
.theme-ticket .result .rb-go { background: var(--ink); color: var(--card); }

/* ---- 転生上限の選択シート ---- */
.re-wrap { z-index: 82; }
.re-head { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.re-head h3 { margin: 2px 0 0; font-size: 20px; font-weight: 900; }
.re-badge { flex: none; padding: 8px 10px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; font-size: 17.5px; }
.re-lead { font-size: 15.5px; color: var(--ink-2); line-height: 1.7; margin: 10px 0 0; }
.re-rec { margin-top: 12px; padding: 12px; border-radius: 14px; background: var(--ink); color: var(--paper); }
.re-rec-h { font-size: 13.5px; font-weight: 900; letter-spacing: .1em; color: #A9A496; }
.re-rec-g { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-top: 8px; }
.re-rec-g span { display: block; font-size: 13px; color: #A9A496; font-weight: 700; }
.re-rec-g b { display: block; font-size: 18.5px; font-weight: 700; margin-top: 1px; white-space: nowrap; }
.re-rec-g b small { font-family: var(--sans); font-size: 13px; color: #D8CFBD; margin: 0 4px 0 1px; }
.re-opt { width: 100%; border: 0; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; text-align: left; padding: 14px; border-radius: 16px; margin-top: 12px; min-height: 72px; }
.re-opt.member { background: var(--accent); color: #fff; box-shadow: 0 12px 24px -12px rgba(217,67,43,.8); }
.re-opt.restart { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.re-opt-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 17.5px; }
.re-opt.member .re-opt-ic { background: #fff; color: var(--accent); }
.re-opt.restart .re-opt-ic { background: var(--line-2); color: var(--ink-2); }
.re-opt-t b { display: block; font-size: 18px; font-weight: 900; }
.re-opt-t small { display: block; font-size: 14px; margin-top: 2px; opacity: .85; line-height: 1.4; }
.re-opt-go { font-size: 22px; font-weight: 300; }
.re-perks { list-style: none; margin: 8px 4px 0; padding: 0; display: grid; gap: 4px; }
.re-perks li { font-size: 14.5px; color: var(--ink-2); padding-left: 18px; position: relative; }
.re-perks li::before { content: '✓'; position: absolute; left: 2px; color: var(--accent); font-weight: 900; }
.tt-lockbtn { color: var(--muted) !important; }
.theme-ticket .re-sheet { background: var(--paper); }
.theme-ticket .re-badge, .theme-ticket .re-opt-ic { border-radius: 50%; }
.theme-ticket .re-head h3, .theme-ticket .re-opt-t b { font-family: var(--serif); font-weight: 800; }

/* ---- マイページ: データの管理（危険操作） ---- */
.danger { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.danger-h { font-size: 14px; font-weight: 900; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.danger-btn { background: transparent; color: var(--neg); box-shadow: inset 0 0 0 1.5px var(--neg); min-height: 48px; font-size: 17px; }
.danger-body { padding: 12px; border-radius: 12px; background: var(--accent-soft); color: #5A1A10; }
.danger-body p { margin: 0; font-size: 15px; line-height: 1.7; }
.danger-body label { display: grid; gap: 4px; margin-top: 10px; }
.danger-body label span { font-size: 14px; font-weight: 700; }
.danger-body input { min-height: 46px; border: 0; border-radius: 10px; padding: 0 12px; font-size: 17.5px; font-family: var(--sans); box-shadow: inset 0 0 0 1.5px #E3A99A; background: #fff; }
.danger-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.danger-btns .btn { min-height: 46px; font-size: 16px; }
.danger-go { background: var(--neg); color: #fff; }

.sk-st.mem { background: var(--accent); color: #fff; }
.sk-card.mem::before { background: var(--accent); opacity: .35; }
.sk-memtag { margin-left: 6px !important; vertical-align: 2px; font-family: var(--sans) !important; }
.auth-chip.sk { background: #3A2A1A; color: #FFD978; }

/* 今のデザイン: 横1行で表示（改行は使わない） */
.sv-stamp em { font-style: normal; }

/* ===== 人生結果: メイン3指標 ===== */
.rh { margin-top: 20px; border-radius: 20px; overflow: hidden; background: linear-gradient(160deg, #2A1E14, #17171C 60%); box-shadow: inset 0 0 0 1px #3A3026; }
.rh-main { padding: 18px 18px 14px; position: relative; }
.rh-main::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 0; border-bottom: 2px dashed rgba(255,255,255,.12); }
.rh-k { font-size: 14.5px; font-weight: 900; letter-spacing: .08em; color: #C9B48A; display: flex; align-items: center; gap: 6px; }
.rh-k small { font-size: 13px; font-weight: 900; padding: 2px 6px; border-radius: 4px; background: rgba(255,217,120,.15); color: #FFD978; letter-spacing: .04em; }
.rh-total { font-size: 44px; font-weight: 700; letter-spacing: -.05em; line-height: 1.05; margin-top: 6px; color: #FFD978; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 0 24px rgba(255,200,90,.25); }
.rh-total span, .rh-v span { font-family: var(--sans); font-size: 17.5px; margin-left: 3px; letter-spacing: 0; }
.rh-jp { font-size: 15px; font-weight: 700; color: #A9A496; margin-top: 2px; }
.rh-sub { display: grid; grid-template-columns: 1.25fr 1fr; }
.rh-sub > div { padding: 14px 16px 16px; min-width: 0; }
.rh-sub > div + div { border-left: 2px dashed rgba(255,255,255,.12); }
.rh-v { font-size: 26px; font-weight: 700; letter-spacing: -.04em; margin-top: 4px; color: #F2EFE7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rh-v span { font-size: 15px; }
.rh-m { font-size: 14px; font-weight: 700; color: #D8CFBD; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rh-m.dim { color: #8C877A; font-weight: 500; }
.res-share-big { margin-top: 10px; min-height: 52px; background: #EDE9DF; color: #17171C; gap: 8px; }
/* 宝くじ券テーマ: 金色の当選券 */
.theme-ticket .rh { background: var(--card); box-shadow: 0 16px 34px -16px rgba(0,0,0,.85); position: relative; }
.theme-ticket .rh::before { content: ''; position: absolute; inset: 7px; border: 1.5px solid var(--line); border-radius: 14px; pointer-events: none; }
.theme-ticket .rh-main::after, .theme-ticket .rh-sub > div + div { border-color: var(--line); }
.theme-ticket .rh-k { color: var(--muted); font-family: var(--serif); font-weight: 800; }
.theme-ticket .rh-k small { background: var(--accent); color: #fff; font-family: var(--sans); }
.theme-ticket .rh-total { color: var(--accent); text-shadow: none; font-size: 46px; }
.theme-ticket .rh-jp { color: var(--muted); }
.theme-ticket .rh-v { color: var(--ink); }
.theme-ticket .rh-m { color: var(--ink-2); }
.theme-ticket .rh-m.dim { color: var(--muted); }
.theme-ticket .rh-best .rh-v { color: var(--gold); }
.theme-ticket .res-share-big { background: var(--accent); color: #fff; box-shadow: 0 10px 22px -10px rgba(200,50,30,.8); }

/* ===== 人生結果: くわしい内訳（カテゴリ別） ===== */
.rd { display: grid; gap: 10px; margin-top: 8px; }
.rd-card { background: #1C1C22; border-radius: 16px; box-shadow: inset 0 0 0 1px #2A2A31; padding: 12px 14px 6px; color: #EDE9DF; }
.rd-h { display: flex; align-items: center; gap: 8px; }
.rd-h b { font-size: 17px; font-weight: 900; letter-spacing: .04em; }
.rd-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 15px; font-weight: 900; color: #fff; }
.rd-card.lot .rd-ic { background: var(--accent); }
.rd-card.asset .rd-ic { background: #3F8F68; }
.rd-card.life .rd-ic { background: #B08A2E; }
.rd-lead { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-top: 10px; padding-bottom: 10px; border-bottom: 1px dashed #34343C; }
.rd-lead > span { font-size: 14px; font-weight: 700; color: #A9A496; flex-basis: 100%; }
.rd-lead b { font-size: 26px; font-weight: 700; letter-spacing: -.04em; white-space: nowrap; }
.rd-lead small { font-size: 14px; color: #8C877A; font-weight: 700; }
.rd-rows { display: grid; }
.rd-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 0; border-bottom: 1px solid #2A2A31; font-size: 15px; }
.rd-row:last-child { border-bottom: 0; }
.rd-row span { color: #A9A496; min-width: 0; }
.rd-row b { font-size: 17px; font-weight: 700; white-space: nowrap; text-align: right; }
.rd .pos { color: #5FCB97; } .rd .neg { color: #F08470; }
/* 宝くじ券テーマ */
.theme-ticket .rd-card { background: var(--card); color: var(--ink); box-shadow: 0 14px 30px -16px rgba(0,0,0,.8); border-radius: 12px; position: relative; }
.theme-ticket .rd-card::before, .theme-ticket .rd-card::after { content: ''; position: absolute; top: 52px; width: 14px; height: 14px; border-radius: 50%; background: var(--night); }
.theme-ticket .rd-card::before { left: -7px; } .theme-ticket .rd-card::after { right: -7px; }
.theme-ticket .rd-h b { font-family: var(--serif); font-weight: 800; font-size: 17.5px; }
.theme-ticket .rd-ic { border-radius: 50%; background: transparent !important; box-shadow: inset 0 0 0 2px currentColor; }
.theme-ticket .rd-card.lot .rd-ic { color: var(--accent); }
.theme-ticket .rd-card.asset .rd-ic { color: var(--pos); }
.theme-ticket .rd-card.life .rd-ic { color: var(--gold); }
.theme-ticket .rd-lead { border-bottom: 2px dashed var(--line); }
.theme-ticket .rd-lead > span, .theme-ticket .rd-row span { color: var(--muted); }
.theme-ticket .rd-lead small { color: var(--muted); }
.theme-ticket .rd-row { border-bottom: 1px solid var(--line-2); }
.theme-ticket .rd .pos { color: var(--pos); } .theme-ticket .rd .neg { color: var(--neg); }

/* 桁数が多いときは文字を小さくして省略させない */
.rh-total.xl, .theme-ticket .rh-total.xl { font-size: 36px; }
.rh-v.xl { font-size: 21px; }
@media (max-width: 400px) { .rh-total.xl, .theme-ticket .rh-total.xl { font-size: 33px; } .rh-v.xl { font-size: 19px; } }

.rd-card.work .rd-ic { background: #3D6FB5; }
.rd .hl { color: #FFD978; }
.theme-ticket .rd-card.work .rd-ic { color: #2F5E9E; }
.theme-ticket .rd .hl { color: var(--gold); }
.rd-row b { white-space: normal; overflow-wrap: anywhere; max-width: 62%; }

/* ---- 速度ボタン: ロック・最高速度ラベル ---- */
.speed { overflow: visible; }
.speed button { position: relative; display: flex; align-items: center; justify-content: center; gap: 3px; }
.speed button.locked { color: var(--muted); opacity: .55; font-size: 15px; }
.speed button.locked svg { width: 12px; height: 12px; }
.speed-max { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); font-style: normal; font-family: var(--sans); font-size: 12.5px; font-weight: 900; letter-spacing: .04em; white-space: nowrap; color: var(--accent); background: var(--paper); padding: 1px 6px; border-radius: 99px; box-shadow: inset 0 0 0 1px var(--accent); }
.ctrl { padding-top: 12px; }
/* スキル画面の速度ステップ */
.spd-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding-top: 12px; }
.spd-step { position: relative; text-align: center; padding: 8px 4px; border-radius: 10px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--muted); }
.spd-step b { display: block; font-size: 17.5px; font-weight: 700; }
.spd-step span { display: block; font-size: 12.5px; font-weight: 700; margin-top: 2px; }
.spd-step.on { background: var(--ink); color: var(--card); box-shadow: none; }
.spd-step em { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 12.5px; font-weight: 900; white-space: nowrap; background: var(--accent); color: #fff; padding: 1px 6px; border-radius: 99px; }
.theme-ticket .speed-max { background: var(--card); }

/* ---- 速度ボタン: 4つ同じ大きさ・最高速度はボタン内 ---- */
.speed { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.speed button { flex-direction: column; gap: 1px; padding: 0 2px; min-width: 0; }
.speed button .speed-v { display: inline-flex; align-items: center; gap: 2px; font-size: 17px; line-height: 1; }
.speed button .speed-v svg { width: 11px; height: 11px; flex: none; }
.speed button.locked { font-size: inherit; }
.speed .speed-max { position: static; transform: none; background: none !important; box-shadow: none; padding: 0; font-size: 12.5px; line-height: 1; letter-spacing: 0; color: var(--accent); }
.speed button.on .speed-max { color: inherit; opacity: .8; }
.speed button.locked .speed-max { color: var(--muted); }
.ctrl { padding-top: 0; }

/* 速度ボタン: 汎用の .locked + .locked 余白を打ち消し、4つとも同じ高さに */
.speed button, .speed button.locked, .speed .locked + .locked { margin: 0 !important; align-self: stretch; height: auto; }

/* ×75の数字を他のボタンと同じ中央位置に。「最高速度」は数字の上に重ねて配置（数字の位置に影響させない） */
.speed button { position: relative; justify-content: center; }
.speed .speed-max { position: absolute !important; top: 6px; left: 0; right: 0; text-align: center; }
.speed .speed-max { top: 4px; }

/* ---- お問い合わせ導線 ---- */
.contact-link { display: block; text-align: center; margin: 4px auto 0; font-size: 15px; font-weight: 700; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; min-height: 32px; line-height: 32px; }
.help-links { display: flex; justify-content: center; gap: 18px; margin-top: 16px; }
.help-links a { font-size: 15px; font-weight: 700; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; min-height: 40px; line-height: 40px; }
.foot-links { display: flex; justify-content: center; gap: 18px; margin-top: 4px; }
.foot-links a { font-size: 15px; font-weight: 700; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; min-height: 36px; line-height: 36px; }
.help-links { flex-wrap: wrap; gap: 4px 16px; }

/* ===== 友達に教える（QR）オーバーレイ ===== */
.link-btn { border: 0; background: none; padding: 0; font: inherit; font-size: 15px; font-weight: 700; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; min-height: 36px; cursor: pointer; }
.help-links .link-btn { min-height: 40px; }
.qo-wrap { position: absolute; inset: 0; z-index: 90; background: rgba(20,16,10,.62); backdrop-filter: blur(3px); display: flex; align-items: flex-end; animation: fadeIn .2s ease; }
.qo { width: 100%; max-height: 94%; overflow-y: auto; background: #1A1712; color: #FFFCF4; border-radius: 22px 22px 0 0; padding: 16px 18px calc(18px + var(--safe-b)); animation: sheetUp .32s cubic-bezier(.2,.9,.3,1); }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } }
.qo-head { display: flex; justify-content: space-between; align-items: flex-start; }
.qo-eyebrow { font-size: 13.5px; font-weight: 700; letter-spacing: .22em; color: #A99F8C; }
.qo-ttl { font-family: 'Shippori Mincho B1', serif; font-weight: 800; font-size: 22px; margin-top: 2px; }
.qo-x { width: 44px; height: 44px; border: 0; border-radius: 50%; background: #2A241C; color: #FFFCF4; font-size: 22px; line-height: 1; }
.qo-lead { font-size: 15.5px; color: #CFC6B4; margin: 6px 0 0; }
.qo-tk-wrap { margin: 14px auto 0; max-width: 330px; filter: drop-shadow(0 18px 22px rgba(0,0,0,.55)); }
.qo-tk { background: #FFFCF4; color: #1A1712; border-radius: 16px; position: relative; padding: 14px 16px 0;
  -webkit-mask: radial-gradient(circle 11px at 0 calc(100% - 54px), transparent 10.5px, #000 11px) left / 51% 100% no-repeat, radial-gradient(circle 11px at 100% calc(100% - 54px), transparent 10.5px, #000 11px) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 11px at 0 calc(100% - 54px), transparent 10.5px, #000 11px) left / 51% 100% no-repeat, radial-gradient(circle 11px at 100% calc(100% - 54px), transparent 10.5px, #000 11px) right / 51% 100% no-repeat; }
.qo-tk::before { content: ''; position: absolute; inset: 7px 7px 61px; border: 1.5px solid #E2D9C6; border-radius: 10px; pointer-events: none; }
.qo-tk-h { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 0; }
.qo-logo { font-family: 'Shippori Mincho B1', serif; font-weight: 800; font-size: 19px; }
.qo-logo em { font-style: normal; color: #C8321E; }
.qo-tk-h small { font-family: var(--mono); font-size: 13px; color: #8A8172; letter-spacing: .08em; }
.qo-qr { position: relative; display: grid; place-items: center; margin: 10px auto 0; width: 100%; max-width: 236px; aspect-ratio: 1; border: 0; padding: 10px; background: #fff; border-radius: 10px; cursor: zoom-in; }
.qo-qr canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.qo-mid { position: absolute; width: 22%; aspect-ratio: 1; border-radius: 50%; background: #C8321E; color: #fff; display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 22px; box-shadow: 0 0 0 5px #fff; transform: rotate(-10deg); }
.qo-copy { text-align: center; font-family: 'Shippori Mincho B1', serif; font-weight: 800; font-size: 17px; margin: 10px 0 0; }
.qo-stub { margin: 10px -16px 0; height: 54px; border-top: 2px dashed #E2D9C6; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 18px; }
.qo-url { font-family: var(--mono); font-size: 15px; font-weight: 700; color: #3E382E; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qo-tap { flex: none; font-size: 13px; font-weight: 900; color: #C8321E; }
.qo-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.qo-acts .btn { min-height: 52px; font-size: 17px; gap: 8px; }
.qo-acts .btn.wide { grid-column: 1 / -1; }
.qo-acts svg { width: 18px; height: 18px; flex: none; }
.qo-dark { background: #2A241C; color: #FFFCF4; box-shadow: inset 0 0 0 1px #3E372C; }
.qo-full { position: absolute; inset: 0; z-index: 2; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; }
.qo-full canvas { width: min(86%, 400px); height: auto; aspect-ratio: 1; image-rendering: pixelated; }
.qo-full p { margin: 0; color: #1A1712; font-weight: 900; font-size: 17.5px; }
.qo-full small { color: #8A8172; font-size: 15px; }
.qo-toast { position: absolute; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%) translateY(16px); opacity: 0; z-index: 3; background: #FFFCF4; color: #1A1712; font-size: 16px; font-weight: 900; padding: 11px 18px; border-radius: 99px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.6); transition: .25s; pointer-events: none; white-space: nowrap; }
.qo-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* アカウント画面: 友達に教える */
.acct-invite { width: 100%; border: 0; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; text-align: left; margin-top: 10px; padding: 12px 14px; min-height: 64px; border-radius: 14px; background: var(--ink); color: var(--paper); cursor: pointer; }
.acct-invite-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--paper); color: var(--accent); font-family: var(--mono); font-weight: 700; font-size: 16px; box-shadow: inset 0 0 0 2px var(--accent); }
.acct-invite-t b { display: block; font-size: 17.5px; font-weight: 900; }
.acct-invite-t small { display: block; font-size: 14px; color: #A9A496; margin-top: 2px; }
.acct-invite-go { font-size: 22px; font-weight: 300; color: #A9A496; }
.theme-ticket .acct-invite { border-radius: 12px; }
.theme-ticket .acct-invite-t b { font-family: var(--serif); font-weight: 800; }

/* ===== 退会フロー ===== */
.wd-link { display: block; margin: 2px auto 0; font-size: 14.5px; color: var(--muted); }
.wd-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0 12px; }
.wd-steps span { text-align: center; font-size: 14px; font-weight: 900; color: var(--muted); padding-bottom: 6px; border-bottom: 3px solid var(--line); }
.wd-steps span.on { color: var(--neg); border-color: var(--neg); }
.wd-steps span.done { color: var(--ink); border-color: var(--ink); }
.wd-lead { font-size: 16px; line-height: 1.7; margin: 0 0 10px; color: var(--ink-2); }
.wd-lose { display: grid; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1.5px var(--line); }
.wd-lose > div { padding: 10px 12px; border-bottom: 1px dashed var(--line); }
.wd-lose > div:last-child { border-bottom: 0; }
.wd-lose b { display: block; font-size: 16px; font-weight: 900; }
.wd-lose span { display: block; font-size: 14.5px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.wd-alt { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--line-2); font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.wd-alt b { display: block; font-size: 15.5px; color: var(--ink); }
.wd-btns { display: grid; grid-template-columns: auto 1fr; gap: 8px; margin-top: 14px; }
.wd-btns .btn { min-height: 50px; font-size: 17px; }
.wd-btns .btn.light { padding: 0 18px; }
.wd-next { color: var(--neg) !important; box-shadow: inset 0 0 0 1.5px var(--neg) !important; }
.wd-h { font-size: 16px; font-weight: 900; margin-bottom: 8px; }
.wd-h small { font-size: 13.5px; font-weight: 700; color: var(--muted); margin-left: 4px; }
.wd-reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.wd-r { border: 0; min-height: 40px; padding: 0 12px; border-radius: 99px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); font: 700 12px var(--sans); color: var(--ink); }
.wd-r.on { background: var(--ink); color: var(--paper); box-shadow: none; }
.wd-ta { width: 100%; box-sizing: border-box; margin-top: 10px; min-height: 80px; border: 0; border-radius: 10px; padding: 10px 12px; font: 500 16px var(--sans); background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); resize: vertical; }
.wd-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); margin-top: 6px; cursor: pointer; }
.wd-opt.on { box-shadow: inset 0 0 0 2px var(--ink); }
.wd-opt input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }
.wd-opt b { display: block; font-size: 16px; }
.wd-opt small { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.wd-acc { padding: 10px 12px; border-radius: 10px; background: var(--line-2); }
.wd-acc span { display: block; font-weight: 900; font-size: 17px; }
.wd-acc small { font-size: 14.5px; color: var(--muted); }
.wd-pw { display: grid; gap: 4px; margin-top: 12px; }
.wd-pw span { font-size: 15px; font-weight: 900; }
.wd-pw input { min-height: 48px; border: 0; border-radius: 10px; padding: 0 12px; font: 500 16px var(--sans); background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); }
.wd-agree { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: 15.5px; line-height: 1.6; cursor: pointer; }
.wd-agree input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--neg); flex: none; }
.wd-agree b { color: var(--neg); }
.wd-go { background: var(--neg); color: #fff; }
.wd-done { text-align: center; padding: 10px 0 4px; }
.wd-stamp { width: 76px; height: 76px; margin: 6px auto 0; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 20px; color: var(--muted); box-shadow: inset 0 0 0 3px var(--muted), inset 0 0 0 6px var(--paper), inset 0 0 0 8px var(--muted); transform: rotate(-12deg); }
.wd-done h4 { margin: 14px 0 0; font-size: 18px; font-weight: 900; }
.wd-done p { font-size: 15.5px; line-height: 1.8; color: var(--ink-2); margin: 8px 0 14px; text-align: left; }
.wd-done .btn { width: 100%; min-height: 52px; }
.theme-ticket .wd-done h4, .theme-ticket .wd-stamp { font-family: var(--serif); font-weight: 800; }
.qo-img img { width: min(86%, 360px); height: auto; border-radius: 12px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); -webkit-touch-callout: default; user-select: auto; }
