:root {
  --navy: #0a1430;
  --navy2: #111f48;
  --navy3: #1a2c60;
  --gold: #d9b45a;
  --gold2: #f6e3a1;
  --gold3: #a8852f;
  --red: #ff3b3b;
  --green: #2ee87a;
  --white: #f4f1e8;
  --muted: #9aa6c7;
  --rainbow: linear-gradient(90deg, #ff4d4d, #ffb84d, #fff04d, #4dff88, #4dc3ff, #9a4dff, #ff4dd2, #ff4d4d);
  --mincho: 'Zen Old Mincho', 'Yu Mincho', 'YuMincho', 'Hiragino Mincho ProN', 'Noto Serif JP', serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(ellipse at top, #1b2d66 0%, var(--navy) 55%, #050a1c 100%) fixed;
  color: var(--white);
  font-family: system-ui, -apple-system, 'Hiragino Sans', 'Noto Sans JP', 'Yu Gothic UI', sans-serif;
  min-height: 100vh; min-height: 100dvh;
  overscroll-behavior: none;
  user-select: none; -webkit-user-select: none;
}
button { font-family: inherit; cursor: pointer; border: none; }
#app { max-width: 480px; margin: 0 auto; padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); min-height: 100dvh; display: flex; flex-direction: column; }

/* ---------- タイトルロゴ ---------- */
.top { display: flex; align-items: center; justify-content: center; position: relative; padding: 6px 0 2px; }
.logo { margin: 0; font-family: var(--mincho); font-weight: 900; text-align: center; line-height: 1; }
.logo-sub { display: block; font-size: 15px; letter-spacing: .5em; color: var(--gold2); margin-bottom: 4px; padding-left: .5em; }
.logo-main {
  display: block; font-size: 38px; letter-spacing: .04em;
  background: linear-gradient(180deg, #fff8d8 0%, #f3d27a 40%, #b8892b 60%, #f7e08f 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 6px rgba(255, 210, 100, .65)) drop-shadow(0 2px 0 #3a2a05);
  animation: logoGlow 2.4s ease-in-out infinite;
}
@keyframes logoGlow { 50% { filter: drop-shadow(0 0 14px rgba(255, 220, 120, .95)) drop-shadow(0 2px 0 #3a2a05); } }
.icon-btn { position: absolute; right: 0; top: 8px; width: 40px; height: 40px; border-radius: 50%; background: var(--navy3); color: var(--gold2); font-size: 18px; border: 1px solid var(--gold3); }
.icon-btn.off { color: #556; text-decoration: line-through; }

.screen { display: none; flex: 1; flex-direction: column; }
.screen.active { display: flex; }

/* ---------- タイトル画面 ---------- */
.title-card { margin-top: 14px; padding: 20px 18px; border: 1px solid var(--gold3); border-radius: 14px; background: linear-gradient(180deg, rgba(26, 44, 96, .85), rgba(10, 20, 48, .9)); box-shadow: 0 0 0 3px rgba(217, 180, 90, .15) inset; text-align: center; }
.lead { font-family: var(--mincho); font-size: 17px; line-height: 1.7; margin: 0 0 6px; }
.lead.strong { font-size: 20px; font-weight: 900; color: var(--gold2); }
.rules { text-align: left; font-size: 13px; line-height: 1.7; color: #d7dcf0; padding-left: 1.2em; margin: 14px 0; }
.odds { font-size: 13px; color: var(--muted); line-height: 1.7; }
.odds b { color: var(--gold2); font-size: 15px; }
.lifecount { color: var(--muted); font-size: 12px; margin: 10px 0 0; }
.c-red { color: var(--red); } .c-green { color: var(--green); }
.c-rainbow { background: var(--rainbow); -webkit-background-clip: text; background-clip: text; color: transparent; }

.big-btn {
  display: block; width: 100%; padding: 16px; margin-top: 10px; border-radius: 12px;
  font-family: var(--mincho); font-size: 22px; font-weight: 900; letter-spacing: .1em; color: #2a1c00;
  background: linear-gradient(180deg, #fff1b8, #e7bd4f 45%, #b98a26 55%, #f2d27a);
  box-shadow: 0 4px 0 #6b4c0c, 0 0 18px rgba(255, 210, 100, .45);
}
.big-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #6b4c0c; }

/* ---------- ゲーム画面 ---------- */
.status { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: 6px; }
.st-age b { font-size: 34px; font-family: var(--mincho); color: var(--gold2); }
.st-age span { font-size: 14px; margin-left: 2px; }
.st-age small { display: block; font-size: 11px; color: var(--muted); }
.st-rank { font-family: var(--mincho); font-weight: 900; font-size: 22px; padding: 6px 16px; border-radius: 8px; border: 2px solid var(--gold); background: linear-gradient(180deg, #2a3d7a, #141f48); color: var(--gold2); box-shadow: 0 0 12px rgba(217, 180, 90, .35); text-align: center; min-width: 110px; }
.st-rank.up { animation: rankUp .9s ease-out; }
.st-rank.long { font-size: 17px; padding: 8px 10px; }
.banner span small { display: block; font-size: 24px; margin-top: 4px; }
@keyframes rankUp { 0% { transform: scale(1.6); box-shadow: 0 0 40px #fff3b0; } 100% { transform: scale(1); } }
.st-life { text-align: right; font-size: 12px; color: var(--muted); }

.ladder { display: grid; grid-template-columns: repeat(9, 1fr); gap: 2px; margin: 10px 0 4px; }
.ladder span { font-size: 9px; text-align: center; padding: 3px 0; border-radius: 3px; background: #1a2550; color: #5b6890; writing-mode: horizontal-tb; white-space: nowrap; overflow: hidden; }
.ladder span.done { background: var(--gold3); color: #2a1c00; }
.ladder span.now { background: var(--gold2); color: #2a1c00; font-weight: 700; box-shadow: 0 0 8px var(--gold2); }
.tags { min-height: 20px; display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.tags span { font-size: 11px; padding: 1px 8px; border-radius: 10px; background: #1d2a58; color: #c9d1ee; border: 1px solid #33427a; }
.tags span.bad { border-color: #7a3333; color: #ffb0b0; }
.tags span.good { border-color: var(--gold3); color: var(--gold2); }

/* ---------- スロット筐体 ---------- */
.machine { position: relative; margin-top: 8px; padding: 30px 10px 12px; border-radius: 16px; background: linear-gradient(180deg, #0d1838, #070d22); border: 3px solid var(--gold3); box-shadow: 0 0 0 2px #000 inset, 0 0 20px rgba(217, 180, 90, .25); }
.machine.rush { border-color: transparent; background: linear-gradient(#0d1838, #070d22) padding-box, var(--rainbow) border-box; background-size: 100% 100%, 300% 100%; animation: rushBorder 1.2s linear infinite; box-shadow: 0 0 30px rgba(255, 120, 255, .5); }
@keyframes rushBorder { to { background-position: 0 0, 300% 0; } }
.rush-banner { position: absolute; top: 6px; left: 0; right: 0; text-align: center; font-family: var(--mincho); font-weight: 900; font-size: 14px; color: var(--gold2); letter-spacing: .08em; }
.machine.rush .rush-banner { background: var(--rainbow); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: rushBorder 1s linear infinite; font-size: 16px; }
.reels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.card { perspective: 600px; height: 92px; }
.card .inner { position: relative; width: 100%; height: 100%; border-radius: 10px; background: #fbf8ee; color: #182a5a; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 3px 0 #9a9481, 0 0 0 2px #cfc6a8 inset; overflow: hidden; transition: transform .15s; }
.card .nm { font-size: 12px; font-weight: 700; letter-spacing: .1em; opacity: .8; }
.card .val { font-family: var(--mincho); font-size: 30px; font-weight: 900; line-height: 1.1; }
.card .tot { font-size: 11px; opacity: .7; }
.card .sp { position: absolute; top: 3px; right: 5px; font-size: 10px; font-weight: 700; }
.card.spinning .val { filter: blur(2px); opacity: .6; }
.card.spinning .inner { animation: reelShake .08s linear infinite; }
@keyframes reelShake { 50% { transform: translateY(2px); } }
.card.stop .inner { animation: stopBounce .25s ease-out; }
@keyframes stopBounce { 0% { transform: translateY(-8px) rotateX(40deg); } 100% { transform: none; } }
.card.r-red .inner { background: radial-gradient(circle at 50% 40%, #ff7a6a, #c40d0d 70%); color: #fff; box-shadow: 0 0 16px #ff3b3b, 0 0 0 2px #ffd0c0 inset; animation: redPulse .7s ease-in-out infinite alternate; }
@keyframes redPulse { to { box-shadow: 0 0 28px #ff2020, 0 0 0 2px #fff inset; } }
.card.r-green .inner { background: radial-gradient(circle at 50% 40%, #7dffb3, #0b9a4a 75%); color: #022; box-shadow: 0 0 16px #2ee87a, 0 0 0 2px #c8ffe0 inset; }
.card.r-rainbow .inner { background: var(--rainbow); background-size: 300% 100%; color: #fff; text-shadow: 0 0 4px #000, 0 0 8px #000; animation: rushBorder 1s linear infinite; box-shadow: 0 0 26px #fff; }
.machine.flash-hit { animation: hitFlash .4s; }
@keyframes hitFlash { 50% { box-shadow: 0 0 50px #ff5050; } }

/* ---------- ログ ---------- */
.log { margin-top: 10px; flex: 1 1 96px; min-height: 96px; max-height: 190px; overflow: hidden; display: flex; flex-direction: column; gap: 3px; }
.log p { margin: 0; font-size: 13px; line-height: 1.35; padding: 3px 8px; border-radius: 6px; background: rgba(255, 255, 255, .04); border-left: 3px solid #556; animation: logIn .3s ease-out; }
.log p:nth-child(n+2) { opacity: .6; }
.log p:nth-child(n+3) { opacity: .4; }
.log p.r-red { border-color: var(--red); color: #ffd2cc; }
.log p.r-green { border-color: var(--green); color: #c8ffe0; }
.log p.r-rainbow { border-color: #fff; background: linear-gradient(90deg, rgba(255, 77, 77, .25), rgba(77, 195, 255, .25), rgba(154, 77, 255, .25)); }
.log p.r-gold { border-color: var(--gold); color: var(--gold2); }
@keyframes logIn { from { transform: translateX(-10px); opacity: 0; } }

/* ---------- 操作ボタン ---------- */
.controls { margin-top: auto; padding-top: 10px; display: grid; grid-template-columns: 1fr 84px; gap: 8px; }
.spin-btn { height: 78px; border-radius: 16px; font-family: var(--mincho); font-weight: 900; color: #2a1c00; background: linear-gradient(180deg, #fff1b8, #e7bd4f 45%, #b98a26 55%, #f2d27a); box-shadow: 0 5px 0 #6b4c0c, 0 0 22px rgba(255, 210, 100, .5); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.spin-btn span { font-size: 30px; letter-spacing: .3em; padding-left: .3em; }
.spin-btn small { font-size: 12px; font-family: system-ui, sans-serif; font-weight: 700; opacity: .75; }
.spin-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #6b4c0c; }
.spin-btn:disabled { filter: grayscale(.6) brightness(.7); }
.auto-btn { border-radius: 16px; background: var(--navy3); color: var(--muted); font-weight: 800; font-size: 15px; border: 2px solid #33427a; }
.auto-btn.on { color: #2a1c00; background: var(--gold2); border-color: var(--gold); box-shadow: 0 0 14px var(--gold); }

/* ---------- オーバーレイ ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(3, 6, 18, .78); backdrop-filter: blur(2px); padding: 20px; }
.overlay[hidden] { display: none; }
.ev-box { width: 100%; max-width: 400px; border-radius: 14px; padding: 18px; background: linear-gradient(180deg, #1c2c64, #0c1536); border: 2px solid var(--gold3); text-align: center; animation: pop .25s ease-out; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
.ev-box.r-red { border-color: var(--red); box-shadow: 0 0 24px rgba(255, 60, 60, .6); }
.ev-box.r-green { border-color: var(--green); box-shadow: 0 0 24px rgba(46, 232, 122, .5); }
.ev-box.r-rainbow { border-color: transparent; background: linear-gradient(180deg, #1c2c64, #0c1536) padding-box, var(--rainbow) border-box; background-size: 100%, 300% 100%; animation: pop .25s ease-out, rushBorder 1s linear infinite; box-shadow: 0 0 30px rgba(255, 255, 255, .5); }
.ev-name { margin: 0 0 8px; font-family: var(--mincho); font-weight: 900; font-size: 22px; color: var(--gold2); }
.ev-text { margin: 0; font-size: 16px; line-height: 1.6; min-height: 1.6em; }
.ev-choices { display: grid; gap: 8px; margin-top: 14px; }
.ev-choices:empty { display: none; }
.ev-hint { margin: 12px 0 0; color: var(--muted); font-size: 12px; animation: blink 1s steps(2) infinite; }
.ev-hint[hidden] { display: none; }
.ev-choices button { padding: 14px; border-radius: 10px; font-size: 16px; font-weight: 700; background: var(--navy3); color: var(--white); border: 1px solid var(--gold3); }
.ev-choices button:active { background: var(--gold3); }
.ev-box.gacha .ev-text { animation: gachaRoll .12s linear 4; }
@keyframes gachaRoll { 50% { transform: translateY(-6px); opacity: .3; } }

/* ---------- 辞令の封筒 ---------- */
.reach-text { font-family: var(--mincho); font-weight: 900; font-size: 30px; margin: 0 0 24px; min-height: 40px; text-align: center; letter-spacing: .08em; }
.reach-text.lv-white { color: #fff; }
.reach-text.lv-red { color: var(--red); text-shadow: 0 0 12px var(--red); }
.reach-text.lv-gold { color: var(--gold2); text-shadow: 0 0 16px var(--gold); font-size: 36px; }
.reach-text.lv-rainbow { background: var(--rainbow); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 38px; animation: rushBorder 1s linear infinite; filter: drop-shadow(0 0 8px #fff); }
.envelope { position: relative; width: 280px; height: 180px; }
.env-back, .env-front, .flap { position: absolute; left: 0; right: 0; }
.env-back { inset: 0; border-radius: 6px; background: #e9e1c8; }
.env-front { inset: 0; border-radius: 6px; z-index: 3; background: linear-gradient(160deg, #fbf6e6, #e4dbbd); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); display: flex; align-items: center; justify-content: center; clip-path: polygon(0 28%, 50% 62%, 100% 28%, 100% 100%, 0 100%); }
.env-title { font-family: var(--mincho); font-weight: 900; font-size: 34px; color: #1a1a1a; letter-spacing: .4em; padding-left: .4em; margin-top: 100px; }
.seal { position: absolute; left: 50%; top: 60%; transform: translate(-50%, -50%); width: 48px; height: 48px; border-radius: 50%; border: 2px solid #ffd27a; background: radial-gradient(circle, #d32020, #8a0000); color: #ffdede; font-family: var(--mincho); font-weight: 900; font-size: 13px; display: flex; align-items: center; justify-content: center; z-index: 5; box-shadow: 0 2px 4px rgba(0, 0, 0, .4); }
.flap { top: 0; height: 62%; z-index: 4; background: linear-gradient(180deg, #efe7cf, #d8cda9); clip-path: polygon(0 0, 100% 0, 100% 45%, 50% 100%, 0 45%); transform-origin: top; transition: transform .5s ease-in; }
.envelope.open .flap { transform: rotateX(180deg); z-index: 1; }
.envelope.open .seal { opacity: 0; transition: opacity .2s; }
.letter { position: absolute; left: 14px; right: 14px; top: 10px; height: 160px; z-index: 2; background: #fffdf6; border-radius: 4px; box-shadow: 0 0 0 1px #d8cfb0 inset; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--mincho); color: #1a1a1a; transition: transform .6s cubic-bezier(.2, 1.4, .4, 1) .35s; }
.letter small { font-size: 14px; letter-spacing: .3em; }
.letter b { font-size: 38px; font-weight: 900; margin: 6px 0 2px; }
.letter span { font-size: 16px; font-weight: 700; }
.letter em { font-style: normal; font-size: 11px; margin-top: 10px; color: #555; }
.envelope.open .letter { transform: translateY(-120px); }
.envelope.pass .letter b { color: #b00000; }
.envelope.fail .letter b { color: #555; font-size: 30px; }
.envelope.lv-red .env-front { background: linear-gradient(160deg, #ffdede, #e88); }
.envelope.lv-red .flap { background: linear-gradient(180deg, #ffe8e8, #e99); }
.envelope.lv-gold .env-front { background: linear-gradient(160deg, #fff6c8, #d9b45a); }
.envelope.lv-gold .flap { background: linear-gradient(180deg, #fff1b0, #c79b3a); }
.envelope.lv-rainbow .env-front, .envelope.lv-rainbow .flap { background: var(--rainbow); background-size: 300% 100%; animation: rushBorder 1s linear infinite; }
.envelope.shake { animation: envShake .09s linear infinite; }
.envelope.shake-hard { animation: envShake .05s linear infinite; }
@keyframes envShake { 25% { transform: translate(-3px, 1px) rotate(-1deg); } 75% { transform: translate(3px, -1px) rotate(1deg); } }
.tap-hint { margin-top: 140px; color: var(--muted); font-size: 13px; animation: blink 1s steps(2) infinite; }
.tap-hint[hidden] { display: none; }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- 大きな文字 ---------- */
.banner { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.banner[hidden] { display: none; }
.banner span { font-family: var(--mincho); font-weight: 900; font-size: 44px; text-align: center; line-height: 1.2; background: var(--rainbow); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 10px #fff) drop-shadow(0 0 2px #000); animation: bannerIn .5s cubic-bezier(.2, 1.6, .4, 1), rushBorder 1s linear infinite; padding: 0 10px; }
.banner.gold span { background: linear-gradient(180deg, #fff8d8, #f3d27a 45%, #b8892b 60%, #f7e08f); -webkit-background-clip: text; background-clip: text; }
.banner.red span { background: linear-gradient(180deg, #fff, #ff5b5b 50%, #a00); -webkit-background-clip: text; background-clip: text; }
@keyframes bannerIn { from { transform: scale(3); opacity: 0; } }
.flash { position: fixed; inset: 0; z-index: 80; pointer-events: none; opacity: 0; }
.flash.on { animation: flashAll 1.2s ease-out; }
@keyframes flashAll { 0% { opacity: 1; background: #fff; } 30% { opacity: .9; background: var(--rainbow); } 100% { opacity: 0; background: var(--rainbow); } }
.flash.red.on { animation: flashRed .5s ease-out; }
@keyframes flashRed { 0% { opacity: .6; background: #ff2020; } 100% { opacity: 0; background: #ff2020; } }

/* ---------- 結果画面 ---------- */
.result { margin-top: 8px; padding: 18px 16px; border-radius: 14px; border: 2px solid var(--gold3); background: linear-gradient(180deg, rgba(28, 44, 100, .9), rgba(8, 14, 36, .95)); text-align: center; }
.res-life { margin: 0; font-size: 12px; color: var(--muted); }
.res-ending { margin: 4px 0 0; font-size: 14px; color: var(--gold2); }
.res-title-wrap { margin: 12px 0 6px; }
.res-title-label { margin: 0; font-size: 11px; color: var(--muted); letter-spacing: .3em; }
.res-title { margin: 4px 0 0; font-family: var(--mincho); font-weight: 900; font-size: 30px; line-height: 1.25; animation: bannerIn .6s cubic-bezier(.2, 1.6, .4, 1); }
.res-title.r-white { color: #fff; text-shadow: 0 0 8px rgba(255, 255, 255, .4); }
.res-title.r-red { color: #ff5050; text-shadow: 0 0 14px #ff2020; }
.res-title.r-green { color: var(--green); text-shadow: 0 0 14px #0a6; }
.res-title.r-rainbow { background: var(--rainbow); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: bannerIn .6s cubic-bezier(.2, 1.6, .4, 1), rushBorder 1s linear infinite; filter: drop-shadow(0 0 8px rgba(255, 255, 255, .7)); }
.res-rank { margin: 10px 0; }
.res-rank span { display: block; font-size: 11px; color: var(--muted); }
.res-rank b { font-family: var(--mincho); font-size: 34px; color: var(--gold2); }
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.res-grid div { background: rgba(255, 255, 255, .05); border-radius: 8px; padding: 8px 4px; }
.res-grid span { display: block; font-size: 11px; color: var(--muted); }
.res-grid b { font-size: 19px; }
.settei.s-hi { color: #ff5050; text-shadow: 0 0 10px #ff2020; }
.settei.s-6 { background: var(--rainbow); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: rushBorder 1s linear infinite; font-size: 24px; }
.res-summary { text-align: left; font-size: 13px; line-height: 1.6; margin: 14px 0 6px; padding-left: 1.4em; color: #dfe4f7; }
.res-top { font-size: 12px; color: var(--muted); margin: 4px 0; }
.res-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; margin: 8px 0; font-size: 10px; color: var(--muted); }
.res-stats b { display: block; font-size: 14px; color: var(--white); }
.res-btns { display: grid; gap: 8px; margin-top: 10px; }
.share-btn { padding: 14px; border-radius: 12px; background: #000; color: #fff; font-size: 17px; font-weight: 800; border: 1px solid #555; }
.res-log { text-align: left; margin-top: 12px; font-size: 12px; color: #c9d1ee; }
.res-log summary { cursor: pointer; color: var(--muted); }
.res-log ul { padding-left: 1.2em; line-height: 1.6; }

/* ---------- フッター ---------- */
.foot { text-align: center; font-size: 11px; color: #6c789d; padding: 14px 0 4px; display: flex; flex-direction: column; gap: 2px; }
.foot a { color: var(--gold2); font-size: 13px; }

@media (max-height: 700px) {
  .card { height: 78px; } .card .val { font-size: 26px; }
  .logo-main { font-size: 32px; } .spin-btn { height: 66px; }
  .log { min-height: 74px; }
}
/* 章（若手・中堅・ベテラン） */
.phases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 8px 0 0; }
.phases > div { border: 1px solid #243566; border-radius: 6px; padding: 3px 4px 4px; text-align: center; background: #101a40; color: #5b6890; line-height: 1.2; }
.phases b { display: block; font-family: var(--mincho); font-size: 13px; }
.phases small { font-size: 9px; }
.phases span { display: flex; justify-content: center; gap: 3px; margin-top: 2px; }
.phases i { width: 6px; height: 6px; border-radius: 50%; background: #243566; }
.phases i.on { background: var(--gold2); }
.phases .now { border-color: var(--gold); color: var(--gold2); box-shadow: 0 0 8px rgba(217, 180, 90, .4); }
.phases .done { color: var(--gold3); }
.ev-name { white-space: pre-line; }

/* ---------- イベントカード（止まらない・大きな文字） ---------- */
.toasts { position: fixed; left: 0; right: 0; top: 30%; z-index: 55; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 12px; }
.evcard { width: 100%; max-width: 420px; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: rgba(4, 8, 24, .96); border: 3px solid var(--gold3); box-shadow: 0 8px 30px rgba(0, 0, 0, .7); animation: cardIn 4.2s ease-out forwards; }
.evcard > div { flex: 1; text-align: center; }
.evcard b { display: block; font-family: var(--mincho); font-weight: 900; color: var(--gold2); font-size: 15px; letter-spacing: .08em; margin-bottom: 4px; }
.evcard span { display: block; font-size: 21px; font-weight: 900; line-height: 1.45; color: #fff; text-shadow: 0 2px 4px #000; }
.evcard.r-red { border-color: #ff5b5b; box-shadow: 0 0 26px rgba(255, 60, 60, .6), 0 8px 30px rgba(0, 0, 0, .7); }
.evcard.r-green { border-color: var(--green); box-shadow: 0 0 26px rgba(46, 232, 122, .45), 0 8px 30px rgba(0, 0, 0, .7); }
.evcard.r-rainbow { border-color: transparent; background: linear-gradient(180deg, #0a1236, #04081a) padding-box, var(--rainbow) border-box; box-shadow: 0 0 30px rgba(255, 255, 255, .5); }
.evcard.bad { border-color: #6b7aa8; }
.evcard.bad span { color: #d6defa; }
/* 名前入りの特別カード */
.evcard.staff { border-width: 4px; }
.evcard .mark { flex: 0 0 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-style: normal; font-family: var(--mincho); font-weight: 900; font-size: 18px; color: #fff; border: 3px solid #fff; }
.evcard.c-gold { border-color: var(--gold2); box-shadow: 0 0 30px rgba(243, 210, 122, .7); }
.evcard.c-gold .mark { background: radial-gradient(circle, #f3d27a, #a8771a); color: #2a1c00; }
.evcard.c-blue { border-color: #5ab8ff; box-shadow: 0 0 30px rgba(90, 184, 255, .6); }
.evcard.c-blue .mark { background: radial-gradient(circle, #5ab8ff, #1d4f9c); }
.evcard.c-red { border-color: #ff6b6b; box-shadow: 0 0 30px rgba(255, 90, 90, .6); }
.evcard.c-red .mark { background: radial-gradient(circle, #ff7a7a, #a01818); }
.evcard.staff b { font-size: 17px; }
@keyframes cardIn { 0% { opacity: 0; transform: translateY(14px) scale(.9); } 6% { opacity: 1; transform: none; } 88% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }

/* スキルの一言 */
.comment { margin: 8px 0 0; min-height: 44px; padding: 6px 10px; border-radius: 10px; text-align: center; font-size: 15px; font-weight: 800; line-height: 1.4; color: #fff; opacity: 0; transition: opacity .3s; background: rgba(0, 0, 0, .55); }
.comment.on { opacity: 1; animation: logIn .3s ease-out; }
.comment b { display: block; font-size: 13px; color: #ff8a8a; }
.comment.r-rainbow b { color: #fff3a0; }

/* 特別演出 */
.blackout { position: fixed; inset: 0; z-index: 65; background: #000; animation: fadeIn .5s ease-out; }
.blackout[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.flash.rainbow.on { animation: flashAll 1.6s ease-out; }
.flash.pink.on { animation: flashPink 2.2s ease-out; }
@keyframes flashPink { 0% { opacity: 1; background: #fff; } 20% { opacity: .95; background: radial-gradient(circle, #ffd1ec, #ff5fb0); } 100% { opacity: 0; background: #ff5fb0; } }
.banner.kakutei span { font-size: 96px; background: var(--rainbow); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; }
.banner.pink span { background: linear-gradient(180deg, #fff, #ff8fcf 50%, #e0218a); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 0 14px #ff5fb0) drop-shadow(0 0 2px #000); }
.banner.legend span { font-size: 48px; filter: drop-shadow(0 0 18px #fff) drop-shadow(0 0 2px #000); }
.banner.dim span { font-size: 40px; background: none; color: #fff; -webkit-text-fill-color: #fff; filter: drop-shadow(0 0 12px #fff); }
.banner span small { -webkit-text-fill-color: #fff; color: #fff; font-size: 20px; line-height: 1.5; }
.card.glow .inner { box-shadow: 0 0 0 3px #fff, 0 0 24px #fff, 0 0 40px #9a4dff; animation: rushBorder 1s linear infinite; }

/* 結果画面 */
.badge-sora { display: inline-block; margin: 6px 0 2px; padding: 6px 16px; border-radius: 999px; font-family: var(--mincho); font-weight: 900; font-size: 16px; color: #2a1c00; background: var(--rainbow); background-size: 200% 100%; animation: rushBorder 2s linear infinite; box-shadow: 0 0 18px rgba(255, 255, 255, .6); }
.badge-sora[hidden] { display: none; }
.issue-btn { padding: 16px; border-radius: 12px; font-family: var(--mincho); font-size: 20px; font-weight: 900; letter-spacing: .1em; color: #fff; background: linear-gradient(180deg, #d83a2a, #8e1710); border: 2px solid #ffb4a6; box-shadow: 0 4px 0 #4f0a06; }
.sub-btn { padding: 12px; border-radius: 12px; font-size: 15px; font-weight: 700; color: var(--white); background: transparent; border: 1px solid var(--gold3); }

/* ---------- 辞令書 ---------- */
#screen-doc { padding-top: 8px; }
.doc-name { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.doc-name input { flex: 0 1 200px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--gold3); background: #0c1536; color: #fff; font-size: 16px; }
.jirei-doc { position: relative; margin: 0 auto; max-width: 380px; aspect-ratio: 1 / 1.414; padding: 34px 30px 22px; color: #1b1308; font-family: var(--mincho); text-align: center; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(ellipse at 20% 15%, rgba(255, 255, 255, .7), transparent 45%),
    radial-gradient(ellipse at 85% 80%, rgba(214, 196, 150, .35), transparent 50%),
    repeating-linear-gradient(83deg, rgba(160, 130, 80, .05) 0 2px, transparent 2px 7px),
    repeating-linear-gradient(-12deg, rgba(160, 130, 80, .04) 0 1px, transparent 1px 11px),
    #f6efdc;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .55), inset 0 0 0 8px #f6efdc, inset 0 0 0 10px #b52a1c, inset 0 0 0 13px #f6efdc, inset 0 0 0 14px #b52a1c; border-radius: 2px; }
.jd-title { margin: 0; font-size: 44px; font-weight: 900; letter-spacing: .3em; }
.jd-to { margin: 0; font-size: 24px; font-weight: 900; text-align: left; border-bottom: 1px solid #8a7a5a; padding-bottom: 4px; }
.jd-body { margin: 0; font-size: 20px; font-weight: 700; line-height: 2; }
.jd-body b { display: block; font-size: 38px; font-weight: 900; color: #8e1710; letter-spacing: .08em; line-height: 1.3; }
.jirei-doc.long .jd-body b { font-size: 28px; letter-spacing: 0; }
.jd-shogo { margin: 0; font-size: 17px; font-weight: 700; }
.jd-shogo span { font-weight: 900; }
.jd-date { margin: 0; font-size: 15px; text-align: left; }
.jd-from { position: relative; text-align: right; font-size: 17px; font-weight: 900; line-height: 1.7; padding-right: 8px; }
.jd-from p { margin: 0; }
.jd-seal { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; margin-left: 10px; vertical-align: middle; border: 3px solid #c8281a; border-radius: 50%; color: #c8281a; font-size: 18px; font-weight: 900; letter-spacing: -.05em; transform: rotate(-8deg); opacity: .88; box-shadow: inset 0 0 0 2px rgba(200, 40, 26, .3); }
.jd-life { margin: 6px 0 0; font-size: 10px; color: #7a6a4a; font-family: sans-serif; }
#screen-doc .res-btns { max-width: 380px; margin: 14px auto 0; }

/* ===== 派手演出（名前パネル・紙吹雪・揺れ） ===== */
.banner.panel { --nm: #ffb300; }
.banner.p-gold { --nm: #ffa800; }
.banner.p-pink { --nm: #ff2f9a; }
.banner.p-legend { --nm: #8a6bff; }
.banner.p-bad { --nm: #ff3030; }
.banner.panel::before { content: ''; position: absolute; left: 50%; top: 50%; width: 200vmax; height: 200vmax; margin: -100vmax 0 0 -100vmax; background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .16) 0 7deg, transparent 7deg 18deg); animation: raysSpin 8s linear infinite; }
.banner.p-bad::before { display: none; }
@keyframes raysSpin { to { transform: rotate(360deg); } }
.banner.panel span { position: relative; font-size: 30px; line-height: 1.35; padding: 22px 20px 20px; margin: 0 12px; border-radius: 22px; max-width: 400px;
  background: linear-gradient(180deg, rgba(10, 8, 30, .92), rgba(0, 0, 0, .88)); -webkit-background-clip: border-box; background-clip: border-box;
  color: #fff; -webkit-text-fill-color: #fff; filter: none; text-shadow: 0 3px 0 #000;
  border: 4px solid var(--nm); box-shadow: 0 0 40px var(--nm), 0 0 0 2px #fff inset;
  animation: bannerIn .5s cubic-bezier(.2, 1.6, .4, 1); }
.banner.p-legend span { border-color: transparent; background: linear-gradient(180deg, rgba(10, 8, 30, .94), rgba(0, 0, 0, .9)) padding-box, var(--rainbow) border-box; }
.banner .nm { display: block; font-style: normal; font-size: 76px; line-height: 1.1; margin: 2px 0 6px; letter-spacing: .04em;
  color: #fff; -webkit-text-fill-color: #fff; -webkit-text-stroke: 2px var(--nm); paint-order: stroke fill;
  text-shadow: 0 0 14px var(--nm), 0 0 30px var(--nm), 0 5px 0 #000;
  animation: nmPop .7s .15s cubic-bezier(.2, 1.8, .4, 1) both, nmPulse .9s .9s ease-in-out infinite alternate; }
.banner.p-pink .nm { font-size: 64px; }
.banner.p-legend .nm { font-size: 60px; }
.banner.p-bad .nm { font-size: 64px; }
@keyframes nmPop { from { transform: scale(2.6) rotate(-8deg); opacity: 0; } }
@keyframes nmPulse { to { transform: scale(1.07); text-shadow: 0 0 22px var(--nm), 0 0 50px var(--nm), 0 5px 0 #000; } }
.banner.panel small { font-size: 18px; margin-top: 10px; color: #ffe9a8; -webkit-text-fill-color: #ffe9a8; }
.banner.panel small.pre { font-size: 22px; margin: 0 0 2px; color: #fff; -webkit-text-fill-color: #fff; }
.banner.panel small .big { display: inline-block; margin-top: 6px; font-size: 34px; color: #fff; -webkit-text-fill-color: #fff; text-shadow: 0 0 16px var(--nm), 0 3px 0 #000; animation: nmPulse .6s ease-in-out infinite alternate; }

.confetti { position: fixed; inset: 0; z-index: 75; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; animation: confFall 2s cubic-bezier(.3, .6, .6, 1) forwards; }
@keyframes confFall { to { transform: translate(var(--dx), 110vh) rotate(var(--r)); } }

#app.shake { animation: appShake .5s; }
@keyframes appShake { 15% { transform: translate(-6px, 3px); } 30% { transform: translate(6px, -3px); } 45% { transform: translate(-5px, -2px); } 60% { transform: translate(4px, 3px); } 80% { transform: translate(-2px, 1px); } }

/* イベントカード：ポップイン＋光の帯 */
.evcard { position: relative; overflow: hidden; animation: cardPop 4.2s ease-out forwards; }
.evcard::after { content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent); transform: skewX(-20deg); animation: shine 1.1s .25s ease-out; pointer-events: none; }
.evcard.bad::after { display: none; }
@keyframes shine { to { left: 130%; } }
@keyframes cardPop { 0% { opacity: 0; transform: scale(.4); } 5% { opacity: 1; transform: scale(1.12); } 9% { transform: scale(.97); } 12% { transform: none; } 88% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }
.evcard.r-red, .evcard.r-rainbow, .evcard.staff:not(.bad) { animation: cardPop 4.2s ease-out forwards, cardGlow .7s .5s ease-in-out 5 alternate; }
@keyframes cardGlow { to { filter: brightness(1.25) drop-shadow(0 0 12px rgba(255, 255, 255, .6)); } }
.evcard.bad { animation: cardPop 4.2s ease-out forwards, cardBad .4s .1s; }
@keyframes cardBad { 25% { margin-left: -8px; } 75% { margin-left: 8px; } }
.evcard.r-red span, .evcard.r-rainbow span { font-size: 23px; }

/* 安倍さん（パトカー）・琉斗のやらかし */
.flash.police.on { animation: flashPolice 1.8s linear; }
@keyframes flashPolice { 0%, 24%, 50%, 74% { opacity: .75; background: #ff1a1a; } 12%, 37%, 62%, 87% { opacity: .75; background: #1a5cff; } 100% { opacity: 0; background: #1a5cff; } }
.banner.siren span { font-size: 44px; animation: bannerIn .5s cubic-bezier(.2, 1.6, .4, 1), sirenText .3s steps(1) infinite; }
@keyframes sirenText { 0% { -webkit-text-fill-color: #ff4a4a; color: #ff4a4a; filter: drop-shadow(0 0 16px #ff2020); } 50% { -webkit-text-fill-color: #5a9bff; color: #5a9bff; filter: drop-shadow(0 0 16px #2a6bff); } }
.banner.siren span small { -webkit-text-fill-color: #fff; color: #fff; font-size: 18px; margin-top: 10px; }
.banner.p-police { --nm: #2a7bff; }
.banner.p-police span { animation: bannerIn .5s cubic-bezier(.2, 1.6, .4, 1), policeBorder .4s steps(1) infinite; font-size: 26px; }
@keyframes policeBorder { 0% { border-color: #ff2a2a; box-shadow: 0 0 44px #ff2a2a, 0 0 0 2px #fff inset; } 50% { border-color: #2a7bff; box-shadow: 0 0 44px #2a7bff, 0 0 0 2px #fff inset; } }
.banner.panel .txt { display: block; margin-top: 10px; font-size: 21px; line-height: 1.5; color: #fff; -webkit-text-fill-color: #fff; text-align: left; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .08); }
.banner .nm { white-space: nowrap; }
.banner.p-pink .nm, .banner.p-police .nm { font-size: 56px; }
.banner.p-legend .nm { font-size: 46px; }

/* 人の名前が出るイベント：タップで次へ */
.read-hint { position: fixed; left: 0; right: 0; bottom: 12%; z-index: 85; margin: 0 auto; width: max-content; padding: 10px 22px; border-radius: 999px; background: rgba(0, 0, 0, .75); border: 2px solid #fff; color: #fff; font-weight: 900; font-size: 18px; pointer-events: none; animation: blink 1.1s infinite; }
.read-hint[hidden] { display: none; }
@keyframes cardPopHold { 0% { opacity: .6; transform: scale(.4); } 40% { opacity: 1; transform: scale(1.12); } 70% { transform: scale(.97); } 100% { opacity: 1; transform: none; } }
@keyframes cardOut { to { opacity: 0; transform: translateY(-10px); } }
/* イベントカードは「回す」を押すまで表示 */
#toasts .evcard.hold { animation: cardPopHold .5s ease-out forwards; }
#toasts .evcard.hold.r-red, #toasts .evcard.hold.r-rainbow, #toasts .evcard.hold.staff:not(.bad) { animation: cardPopHold .5s ease-out forwards, cardGlow .7s .5s ease-in-out 6 alternate; }
#toasts .evcard.hold.bad { animation: cardPopHold .5s ease-out forwards, cardBad .4s .1s; }
#toasts .evcard.out { animation: cardOut .25s ease-in forwards; }
