:root {
  --bg: #17142b;
  --bg2: #221d3f;
  --panel: #2a2450;
  --panel2: #332c60;
  --ink: #f6f1ff;
  --muted: #b3a9d6;
  --cream: #fff8ec;
  --cream-ink: #2b2340;
  --pos: #2fbf71;
  --neg: #ff5d73;
  --accent: #ffcd3c;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font-display: 'Fredoka', 'Segoe UI', system-ui, sans-serif;
  --font: 'Nunito', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); color: var(--ink);
  background: radial-gradient(1200px 700px at 15% -10%, #3b2f7a 0%, transparent 60%),
              radial-gradient(900px 600px at 110% 110%, #5a2456 0%, transparent 55%), var(--bg);
  background-attachment: fixed;
}
#app { min-height: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; }
.muted { color: var(--muted); }
.neg { color: var(--neg) !important; }
.pos { color: var(--pos) !important; }
.hint { color: var(--muted); font-size: .9rem; }

/* ---------- buttons ---------- */
.btn {
  border: 0; border-radius: 14px; padding: .7rem 1.2rem; background: var(--panel2);
  font-weight: 800; box-shadow: 0 4px 0 rgba(0, 0, 0, .35); transition: transform .08s, filter .15s;
}
.btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.btn.big { font-size: 1.1rem; padding: .9rem 1.6rem; }
.btn.primary { background: linear-gradient(180deg, #ffd85a, #ffb703); color: #3a2600; box-shadow: 0 4px 0 #b37a00; }
.btn.ghost { background: transparent; border: 2px solid rgba(255, 255, 255, .2); box-shadow: none; }
.icon-btn { background: rgba(255, 255, 255, .08); border: 0; border-radius: 10px; width: 38px; height: 38px; font-size: 1.1rem; }
.icon-btn:hover { background: rgba(255, 255, 255, .18); }

/* ---------- title ---------- */
.title-screen { min-height: 100vh; display: grid; place-items: center; position: relative; overflow: hidden; padding: 2rem 1rem; }
.floaters span { position: absolute; bottom: -60px; font-size: 2.4rem; opacity: .35; animation: floatUp linear infinite; }
@keyframes floatUp { to { transform: translateY(-115vh) rotate(25deg); } }
.title-box { position: relative; text-align: center; max-width: 620px; background: rgba(23, 20, 43, .7); backdrop-filter: blur(8px); padding: 2.5rem 2rem; border-radius: 28px; box-shadow: var(--shadow); border: 1px solid rgba(255, 255, 255, .08); }
.logo { font-family: var(--font-display); font-weight: 700; font-size: clamp(3rem, 9vw, 5rem); letter-spacing: -1px; line-height: 1; }
.logo span { color: var(--accent); }
.logo.small { font-size: 1.6rem; }
.tagline { font-size: 1.2rem; margin: .6rem 0 1rem; color: var(--muted); }
.pitch { line-height: 1.55; margin: 0 auto 1.6rem; max-width: 500px; }
.title-buttons { display: flex; flex-direction: column; gap: .7rem; align-items: center; }
.title-buttons .btn { min-width: 270px; }
.foot { margin-top: 1.3rem; color: var(--muted); font-size: .9rem; }

/* ---------- setup ---------- */
.setup-screen { max-width: 620px; margin: 0 auto; padding: 3rem 1rem; text-align: center; }
.setup-screen h1 { font-size: 2.3rem; }
.sub { color: var(--muted); }
.setup-list { display: flex; flex-direction: column; gap: .7rem; margin: 1.6rem 0 1rem; }
.setup-row { display: flex; gap: .6rem; align-items: center; background: var(--panel); padding: .6rem; border-radius: var(--radius); border-left: 6px solid var(--pc); }
.emoji-pick { font-size: 2rem; background: rgba(255, 255, 255, .07); border: 0; border-radius: 12px; width: 58px; height: 58px; }
.name-in { flex: 1; font: inherit; font-size: 1.2rem; font-weight: 700; padding: .7rem 1rem; border-radius: 12px; border: 2px solid transparent; background: var(--bg2); color: var(--ink); outline: none; }
.name-in:focus { border-color: var(--pc); }
.color-pick { width: 38px; height: 38px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .5); }
.mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: 1.2rem; }
.mode { background: var(--panel); border: 2px solid transparent; border-radius: var(--radius); padding: .8rem; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.mode b { font-family: var(--font-display); font-size: 1.1rem; }
.mode small { color: var(--muted); }
.mode.on { border-color: var(--accent); background: var(--panel2); }
.online-row { display: flex; gap: .7rem; flex-wrap: wrap; justify-content: center; }
.online-row .btn { min-width: 0 !important; }
.btn.online { background: linear-gradient(180deg, #7b6cff, #5a46d6); box-shadow: 0 4px 0 #3b2b9e; }
.net-screen .setup-row { margin-bottom: .8rem; }
.code-in { display: block; width: 100%; font: inherit; font-family: var(--font-display); font-size: 2.2rem; letter-spacing: .4em; text-align: center; text-transform: uppercase; padding: .6rem; border-radius: 16px; border: 2px dashed rgba(255,255,255,.25); background: var(--bg2); color: var(--accent); outline: none; }
.code-in:focus { border-color: var(--accent); }
.room-code { font-family: var(--font-display); font-size: clamp(2.6rem, 10vw, 4rem); letter-spacing: .3em; color: var(--accent); text-shadow: 0 0 30px rgba(255, 205, 60, .4); margin: .6rem 0; }
.share-row { display: flex; gap: .5rem; margin: .6rem 0; }
.share-link { flex: 1; min-width: 0; font: inherit; padding: .6rem .8rem; border-radius: 12px; border: 0; background: var(--bg2); color: var(--ink); }
.net-status { color: var(--muted); }
.net-error { color: #ff9aa8; background: rgba(255, 93, 115, .12); padding: .6rem .8rem; border-radius: 12px; }
.lobby-row { padding: .5rem .8rem; }
.lobby-row .emoji-pick { display: grid; place-items: center; }
.lobby-name { font-family: var(--font-display); font-size: 1.2rem; flex: 1; text-align: left; }
.lobby-name small { font-family: var(--font); font-size: .75rem; color: var(--muted); font-weight: 600; }
.lobby-wait { color: var(--muted); padding: .8rem; border: 2px dashed rgba(255,255,255,.12); border-radius: var(--radius); }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--muted); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: grayscale(.6); }
.net-locked { cursor: not-allowed !important; }
.opt.net-locked { opacity: .55; }
.net-bar { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 40; display: flex; gap: .9rem; align-items: center; background: rgba(23, 20, 43, .92); border: 1px solid rgba(255,255,255,.15); padding: .5rem 1rem; border-radius: 999px; font-size: .85rem; box-shadow: var(--shadow); backdrop-filter: blur(6px); white-space: nowrap; max-width: calc(100vw - 20px); overflow: hidden; }
.net-bar span { color: var(--muted); }
.net-bar .off { color: #ff9aa8; }
.net-bar.mine { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 205, 60, .25), var(--shadow); }
.net-bar.mine b { color: var(--accent); }
.setup-actions { display: flex; justify-content: space-between; margin-top: 2rem; }

/* ---------- birth ---------- */
.birth-screen { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.birth-card { background: var(--cream); color: var(--cream-ink); border-radius: 28px; padding: 2rem; max-width: 520px; width: 100%; text-align: center; box-shadow: var(--shadow); border-top: 10px solid var(--pc); animation: dealIn .5s cubic-bezier(.2, 1.4, .4, 1); }
.stork { font-size: 3rem; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-6deg); } }
.baby { display: flex; flex-direction: column; align-items: center; margin: .8rem 0; }
.baby span { font-size: 4rem; background: var(--pc); border-radius: 50%; width: 100px; height: 100px; display: grid; place-items: center; box-shadow: 0 0 0 6px #fff, 0 8px 20px rgba(0, 0, 0, .2); }
.baby b { font-family: var(--font-display); font-size: 1.7rem; margin-top: .5rem; }
.birth-card ul { list-style: none; padding: 0; text-align: left; }
.birth-card li { padding: .55rem .8rem; margin: .4rem 0; background: #fff; border-radius: 12px; opacity: 0; animation: fadeUp .5s forwards; }
.birth-stats, .birth-card .btn, .dream-pick { opacity: 0; animation: fadeUp .5s forwards; }
.birth-card .btn[disabled] { filter: grayscale(1); opacity: .5 !important; cursor: not-allowed; }
.dream-pick h3 { font-size: 1.1rem; margin: .4rem 0 .6rem; }
.dream-pick h3 small { display: block; font-family: var(--font); font-weight: 600; font-size: .8rem; color: #7b7193; }
.dreams { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1rem; }
.dream { display: flex; flex-direction: column; align-items: center; gap: 2px; background: #fff; border: 2px solid #ece3f7; border-radius: 14px; padding: .6rem .4rem; color: var(--cream-ink); transition: .15s; }
.dream:hover { transform: translateY(-2px); border-color: var(--pc); }
.dream.on { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 18%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc) 30%, transparent); }
.dream span { font-size: 1.6rem; }
.dream b { font-family: var(--font-display); font-weight: 600; font-size: .95rem; }
.dream small { font-size: .72rem; color: #6c6284; line-height: 1.25; }
.tag.dreamtag { background: rgba(255, 255, 255, .05); border: 1px dashed rgba(255, 255, 255, .3); }
.tag.dreamtag.met { background: rgba(47, 191, 113, .25); border-color: var(--pos); }
.obit-dream { background: #ffe0e5; padding: .4rem .7rem; border-radius: 10px; font-size: .9rem; }
.obit-dream.met { background: #d3f7e2; }
.birth-stats { margin: 1rem 0; text-align: left; }
.birth-card .bar b { color: var(--cream-ink); }
.birth-card .track { background: #e9e1f5; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- top bar & board ---------- */
.topbar { display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem; background: rgba(0, 0, 0, .25); border-bottom: 1px solid rgba(255, 255, 255, .06); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(6px); }
.top-actions { display: flex; gap: .4rem; }
.road { flex: 1; display: flex; align-items: center; justify-content: center; }
.road-node { display: flex; flex-direction: column; align-items: center; opacity: .45; transition: .3s; }
.road-node span { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); font-size: 1.15rem; border: 2px solid transparent; }
.road-node em { font-style: normal; font-size: .62rem; margin-top: 2px; color: var(--muted); white-space: nowrap; }
.road-node.done { opacity: .8; }
.road-node.done span { background: var(--sc); }
.road-node.now { opacity: 1; transform: scale(1.12); }
.road-node.now span { background: var(--sc); border-color: #fff; box-shadow: 0 0 18px var(--sc); }
.road-node.now em { color: #fff; font-weight: 800; }
.road-line { flex: 0 1 40px; height: 3px; background: rgba(255, 255, 255, .12); margin: 0 4px 14px; border-radius: 2px; }

.shell { display: flex; flex-direction: column; height: 100vh; width: 100%; overflow-x: hidden; }
.shell > * { min-width: 0; }
.board { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr) 270px; gap: 1rem; padding: 1rem; }
.players, .feed, .center { overflow-y: auto; scrollbar-width: thin; }
.players { display: flex; flex-direction: column; gap: .7rem; padding-right: 4px; }
.center { padding: 0 .3rem 2rem; }

/* ---------- player cards ---------- */
.pcard { position: relative; background: var(--panel); border-radius: var(--radius); padding: .8rem; border: 2px solid transparent; cursor: pointer; transition: .2s; }
.pcard:hover { background: var(--panel2); }
.pcard.active { border-color: var(--pc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pc) 25%, transparent), var(--shadow); }
.pcard.dead { filter: grayscale(.9); opacity: .6; }
.pc-head { display: flex; gap: .6rem; align-items: center; }
.avatar { width: 46px; height: 46px; flex: none; border-radius: 50%; background: var(--pc); display: grid; place-items: center; font-size: 1.6rem; box-shadow: 0 0 0 3px rgba(255, 255, 255, .85); }
.pc-name { display: flex; flex-direction: column; min-width: 0; }
.pc-name b { font-family: var(--font-display); font-size: 1.15rem; }
.pc-name span { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-money { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: .3rem; margin: .6rem 0; background: rgba(0, 0, 0, .2); border-radius: 12px; padding: .45rem .6rem; }
.pc-money small { display: block; font-size: .65rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.pc-money b { font-family: var(--font-display); font-size: 1rem; }
.pc-money div:first-child b { font-size: 1.2rem; color: var(--accent); }
.bars { display: flex; flex-direction: column; gap: 3px; }
.bar { display: grid; grid-template-columns: 22px 1fr 28px; align-items: center; gap: 6px; font-size: .78rem; }
.bar i { font-style: normal; font-size: .85rem; }
.bar b { text-align: right; font-size: .75rem; }
.track { height: 8px; background: rgba(0, 0, 0, .3); border-radius: 6px; overflow: hidden; }
.fill { height: 100%; border-radius: 6px; transition: width .8s cubic-bezier(.2, .9, .3, 1); }
.pc-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: .5rem; }
.tag { background: rgba(255, 255, 255, .08); border-radius: 8px; padding: 2px 6px; font-size: .85rem; }
.tag.ach { background: rgba(255, 205, 60, .2); }
.floater-fx { position: absolute; right: 8px; pointer-events: none; animation: fxFloat 2.2s ease-out forwards; z-index: 3; }
@keyframes fxFloat { 0% { opacity: 0; transform: translateY(10px) scale(.8); } 15% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-40px); } }

/* ---------- feed ---------- */
.feed { background: rgba(0, 0, 0, .18); border-radius: var(--radius); padding: .8rem; }
.feed h3 { font-size: 1rem; margin-bottom: .5rem; }
.log { font-size: .8rem; padding: .4rem .5rem; border-left: 3px solid var(--lc); margin-bottom: .35rem; background: rgba(255, 255, 255, .03); border-radius: 0 8px 8px 0; animation: fadeUp .4s; }

/* ---------- turn header & cards ---------- */
/* keep the main action reachable even when the board pushes the card down */
.outcome > .btn.primary, .yearend > .btn.primary { position: sticky; bottom: 64px; z-index: 6; box-shadow: 0 4px 0 #b37a00, 0 10px 30px rgba(0,0,0,.35); }
.bar-lbl { display: none; }
.labelled .bar-lbl { display: block; font-style: normal; font-weight: 700; font-size: .8rem; }
.birth-stats.labelled .bar { grid-template-columns: 22px 64px 1fr 28px; }
.board-wrap { margin: 0 auto .8rem; max-width: 820px; border-radius: var(--radius); overflow: hidden; }
.av-svg { overflow: hidden; display: grid; place-items: center; padding: 0 !important; background: transparent !important; }
.av-svg svg { width: 100%; height: 100%; display: block; }
.movie-cta { text-align: center; margin: -0.5rem 0 1.5rem; position: relative; }
.small-btn { font-size: .85rem; padding: .45rem .8rem; margin-top: .6rem; background: #efe7fb; color: #4b2fb3; box-shadow: 0 3px 0 #d6c8ef; }
.turn-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .8rem; }
.th-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--pc); display: grid; place-items: center; font-size: 1.5rem; box-shadow: 0 0 0 3px #fff; }
.turn-head b { font-family: var(--font-display); font-size: 1.2rem; display: block; }
.turn-head small { color: var(--muted); }
.th-label { margin-left: auto; background: var(--sc); color: #fff; font-weight: 800; padding: .35rem .8rem; border-radius: 999px; font-size: .85rem; text-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.decider { background: color-mix(in srgb, var(--pc) 30%, var(--panel)); border: 2px dashed var(--pc); padding: .6rem 1rem; border-radius: 14px; margin-bottom: .8rem; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--pc) 20%, transparent); } }

.card { background: var(--cream); color: var(--cream-ink); border-radius: 24px; padding: 1.4rem 1.5rem 1.5rem; box-shadow: var(--shadow); border-top: 12px solid var(--sc); max-width: 780px; margin: 0 auto; }
.card.event { background: linear-gradient(160deg, #fff8ec, #f3e9ff); border-top-style: dashed; }
.deal-in { animation: dealIn .45s cubic-bezier(.2, 1.3, .4, 1); }
.flip-in { animation: flipIn .7s cubic-bezier(.2, 1.1, .4, 1); transform-origin: center; }
@keyframes dealIn { from { opacity: 0; transform: translateY(30px) scale(.95) rotate(-2deg); } to { opacity: 1; transform: none; } }
@keyframes flipIn { 0% { transform: perspective(900px) rotateY(90deg) scale(.9); opacity: 0; } 60% { transform: perspective(900px) rotateY(-8deg); opacity: 1; } 100% { transform: none; } }
.card-top { display: flex; align-items: center; gap: .8rem; }
.card-icon { font-size: 2.4rem; width: 62px; height: 62px; display: grid; place-items: center; background: color-mix(in srgb, var(--sc) 22%, #fff); border-radius: 18px; flex: none; }
.card h2 { font-size: 1.7rem; }
.card-text { font-size: 1.08rem; line-height: 1.5; margin: .9rem 0 1.1rem; }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .7rem; }
.opt { position: relative; display: flex; gap: .6rem; align-items: flex-start; text-align: left; background: #fff; color: var(--cream-ink); border: 2px solid #ece3f7; border-radius: 16px; padding: .8rem .8rem .8rem .7rem; transition: .15s; box-shadow: 0 3px 0 #e0d6ee; }
.opt:hover:not(:disabled) { border-color: var(--sc); transform: translateY(-2px); box-shadow: 0 6px 0 color-mix(in srgb, var(--sc) 40%, #e0d6ee); }
.opt.locked { opacity: .5; cursor: not-allowed; }
.opt-key { position: absolute; top: 6px; right: 8px; font-size: .7rem; color: #b9aecb; font-weight: 800; }
.opt-icon { font-size: 1.7rem; line-height: 1; }
.opt-main { display: flex; flex-direction: column; gap: 2px; }
.opt-main b { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; }
.opt-main small { color: #6c6284; font-size: .85rem; line-height: 1.35; }
.opt-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.mini { font-size: .72rem; font-weight: 800; padding: 2px 7px; border-radius: 999px; }
.mini.cost { background: #ffe3e7; color: #c0263d; }
.mini.odds { background: linear-gradient(90deg, #c9f2da var(--o), #f1ecf7 var(--o)); color: #1f6b42; }
.mini.lock { background: #eee; color: #777; }

.dice-zone { display: flex; flex-direction: column; align-items: center; padding: 1.5rem; }
.d100 { width: 120px; height: 120px; border-radius: 26px; background: linear-gradient(145deg, #6d5bd0, #3b2f8a); color: #fff; font-family: var(--font-display); font-size: 3rem; display: grid; place-items: center; box-shadow: 0 8px 0 #251b63, var(--shadow); animation: shake .12s infinite; }
.d100.ok { animation: none; background: linear-gradient(145deg, #3ddc84, #1f9d57); box-shadow: 0 8px 0 #12683a, 0 0 40px #3ddc84; }
.d100.fail { animation: none; background: linear-gradient(145deg, #ff6b7f, #c92a42); box-shadow: 0 8px 0 #7f1426, 0 0 40px #ff5d73; }
@keyframes shake { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.dice-need { margin-top: 1rem; font-weight: 800; color: #6c6284; }

.outcome { animation: fadeUp .4s; }
.chosen { color: #6c6284; font-size: .9rem; }
.roll-result { display: inline-block; margin: .5rem 0; padding: .35rem .8rem; border-radius: 999px; font-weight: 700; font-size: .9rem; }
.roll-result.ok { background: #d3f7e2; color: #136b3c; }
.roll-result.fail { background: #ffe0e5; color: #a0172e; }
.out-text { font-size: 1.15rem; line-height: 1.5; }
.outcome.good .out-text::before { content: '✨ '; }
.outcome.bad .out-text::before { content: '💥 '; }
.fx { display: flex; flex-wrap: wrap; gap: .4rem; margin: .8rem 0 1.2rem; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: .3rem .65rem; border-radius: 999px; font-weight: 800; font-size: .85rem; white-space: nowrap; }
.chip.up { background: #d3f7e2; color: #136b3c; }
.chip.down { background: #ffe0e5; color: #a0172e; }
.chip.trait { background: #e4dcff; color: #4b2fb3; }
.chip.ach { background: #fff0b8; color: #7a5600; }
.chip-who { margin-right: 2px; }

/* draw */
.draw-zone { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 2rem 0; }
.draw-zone p { font-family: var(--font-display); font-size: 1.4rem; }
.deck { position: relative; width: 170px; height: 240px; cursor: pointer; }
.deck-card { position: absolute; inset: 0; border-radius: 18px; background: repeating-linear-gradient(45deg, #5b46c9 0 12px, #4a37b0 12px 24px); border: 6px solid #fff; box-shadow: var(--shadow); }
.deck-card.c3 { transform: rotate(-7deg) translate(-8px, 6px); }
.deck-card.c2 { transform: rotate(5deg) translate(6px, 2px); }
.deck-card.c1 { display: grid; place-items: center; align-content: center; transition: .2s; }
.deck-card.c1 span { font-size: 3.5rem; }
.deck-card.c1 b { font-family: var(--font-display); letter-spacing: 4px; color: #ffe08a; }
.deck:hover .c1 { transform: translateY(-10px) rotate(-2deg); }

/* year end */
.yearend .years { display: flex; align-items: baseline; justify-content: center; gap: .8rem; font-family: var(--font-display); margin-bottom: 1rem; flex-wrap: wrap; }
.yearend .years span { font-size: 3rem; font-weight: 700; color: var(--sc); }
.yearend .years i { font-style: normal; font-size: 2rem; }
.yearend .years small { flex-basis: 100%; text-align: center; color: #6c6284; font-family: var(--font); }
.ledger { background: #fff; border-radius: 14px; padding: .4rem .9rem; }
.lrow { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; border-bottom: 1px dashed #eadff5; font-size: .95rem; }
.lrow:last-child { border-bottom: 0; }
.lrow em { color: #9a8fb3; font-size: .8rem; }
.lrow.total { font-weight: 800; font-size: 1.05rem; border: 0; padding: .7rem .9rem; }
.ye-events { background: #fff4d6; border-radius: 14px; padding: .6rem .9rem; margin-top: .6rem; line-height: 1.6; }
.yearend .btn { margin-top: .5rem; }

/* handoff + stage intro */
.handoff, .stage-intro { text-align: center; padding: 3rem 1rem; max-width: 560px; margin: 0 auto; animation: dealIn .5s; }
.ho-avatar { font-size: 4.5rem; width: 130px; height: 130px; border-radius: 50%; background: var(--pc); margin: 0 auto 1rem; display: grid; place-items: center; box-shadow: 0 0 0 8px rgba(255, 255, 255, .9), 0 0 60px var(--pc); animation: bob 2.4s ease-in-out infinite; }
.handoff h2 { font-size: 2.4rem; }
.handoff p { color: var(--muted); }
.ho-teaser { background: rgba(255, 255, 255, .06); padding: .7rem; border-radius: 14px; color: var(--ink) !important; margin: 1rem 0 1.5rem; }
.standings { background: rgba(0, 0, 0, .25); border-radius: var(--radius); padding: .8rem; margin: 0 0 1.6rem; text-align: left; }
.standings h3 { font-size: 1rem; margin-bottom: .5rem; }
.st-row { display: flex; align-items: center; gap: .6rem; padding: .45rem .5rem; border-left: 4px solid var(--pc); background: rgba(255, 255, 255, .04); border-radius: 0 10px 10px 0; margin-bottom: .35rem; }
.st-row.dead { opacity: .5; }
.st-rank { font-family: var(--font-display); color: var(--muted); width: 1rem; }
.st-av { font-size: 1.5rem; }
.st-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.st-name small, .st-val small { color: var(--muted); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-val { text-align: right; display: flex; flex-direction: column; }
.st-val b { color: var(--accent); font-family: var(--font-display); }
.st-dream { font-size: 1.2rem; opacity: .5; }
.st-dream.met { opacity: 1; filter: drop-shadow(0 0 6px var(--pos)); }
.si-icon { font-size: 5rem; animation: bob 2.4s ease-in-out infinite; }
.si-kicker { color: var(--sc); font-weight: 800; letter-spacing: 1px; text-transform: uppercase; font-size: .85rem; }
.stage-intro h1 { font-size: 3.4rem; color: var(--sc); text-shadow: 0 4px 30px color-mix(in srgb, var(--sc) 60%, transparent); }
.stage-intro p { font-size: 1.2rem; line-height: 1.5; margin: 1rem 0 2rem; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(10, 6, 25, .7); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 50; padding: 1rem; animation: fadeUp .2s; }
.modal { background: var(--cream); color: var(--cream-ink); border-radius: 24px; padding: 1.6rem; max-width: 720px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal h2 { margin-bottom: .8rem; }
.modal h4 { margin: 1rem 0 .4rem; }
.howto li { margin-bottom: .6rem; line-height: 1.5; }
.stat-legend { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1rem 0; font-weight: 700; }
.pinfo { border-top: 10px solid var(--pc); }
.pinfo .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.pinfo .muted, .modal .muted { color: #7b7193; }
.pinfo .tag, .obit .tag { background: #efe7fb; }
.pinfo .tag small { color: #7b7193; }

/* ---------- end ---------- */
.end-screen { max-width: 1100px; margin: 0 auto; padding: 2rem 1rem 4rem; position: relative; }
.end-screen h1 { text-align: center; font-size: 2.8rem; margin-bottom: 1.5rem; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; animation: fall 4s linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: .2; } }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 1rem; margin-bottom: 2rem; position: relative; }
.pod { display: flex; flex-direction: column; align-items: center; width: 160px; animation: dealIn .8s; }
.pod-avatar { font-size: 3rem; width: 84px; height: 84px; border-radius: 50%; background: var(--pc); display: grid; place-items: center; box-shadow: 0 0 0 5px #fff; margin-bottom: .4rem; }
.pod b { font-family: var(--font-display); font-size: 1.3rem; }
.pod > span { color: var(--accent); font-weight: 800; }
.pod-block { width: 100%; margin-top: .5rem; background: linear-gradient(180deg, var(--pc), color-mix(in srgb, var(--pc) 50%, #000)); border-radius: 14px 14px 0 0; display: grid; place-items: start center; padding-top: .6rem; font-size: 2.2rem; }
.pod-1 .pod-block { height: 150px; }
.pod-2 .pod-block { height: 105px; }
.pod-3 .pod-block { height: 75px; }
.pod-1 .pod-avatar { width: 104px; height: 104px; font-size: 3.6rem; box-shadow: 0 0 0 5px gold, 0 0 40px gold; }
.awards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .7rem; margin-bottom: 1.5rem; position: relative; }
.award { background: var(--panel); border-radius: var(--radius); padding: .8rem; text-align: center; display: flex; flex-direction: column; }
.award span { font-size: 1.8rem; }
.award small { color: var(--muted); text-transform: uppercase; font-size: .7rem; letter-spacing: 1px; }
.award b { font-family: var(--font-display); font-size: 1.1rem; }
.award em { color: var(--accent); font-style: normal; font-size: .85rem; }
.chart-box { background: var(--panel); border-radius: var(--radius); padding: 1rem; margin-bottom: 1.5rem; position: relative; }
.tabs { display: flex; gap: .4rem; margin-bottom: .6rem; }
.tab { border: 0; background: rgba(255, 255, 255, .07); padding: .4rem .9rem; border-radius: 999px; font-weight: 700; }
.tab.on { background: var(--accent); color: #3a2600; }
.chart { width: 100%; height: auto; }
.chart .grid { stroke: rgba(255, 255, 255, .08); }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .draw { stroke-dasharray: 3000; stroke-dashoffset: 3000; animation: drawLine 2s ease-out forwards; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
.obits { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 1rem; position: relative; }
.obit { background: var(--cream); color: var(--cream-ink); border-radius: 22px; padding: 1.2rem; border-top: 10px solid var(--pc); box-shadow: var(--shadow); }
.obit-head { display: flex; gap: .7rem; align-items: center; }
.obit-head h3 { font-size: 1.4rem; }
.obit-head small { color: #6c6284; }
.obit-rank { font-family: var(--font-display); font-size: 1.4rem; color: #9a8fb3; }
.obit-score { margin-left: auto; text-align: center; font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: #4b2fb3; line-height: 1; }
.obit-score small { display: block; font-size: .65rem; font-family: var(--font); color: #9a8fb3; text-transform: uppercase; }
.score-parts { display: grid; grid-template-columns: repeat(6, 1fr); gap: .3rem; margin: .9rem 0; background: #fff; border-radius: 12px; padding: .5rem; text-align: center; }
.score-parts small { display: block; font-size: .68rem; color: #7b7193; }
.score-parts b { font-family: var(--font-display); font-size: 1.15rem; }
.epitaph { font-style: italic; color: #4e4466; line-height: 1.45; }
.obit-facts, .obit-traits, .obit-ach { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0; font-size: .85rem; }
.obit-facts span { background: #fff; padding: 2px 8px; border-radius: 8px; }
.obit-ach span { background: #fff0b8; padding: 2px 8px; border-radius: 8px; font-weight: 700; }
details summary { cursor: pointer; font-weight: 800; margin-top: .6rem; }
.timeline { list-style: none; padding: 0; margin: .5rem 0; max-height: 260px; overflow-y: auto; }
.timeline li { padding: .3rem 0 .3rem .5rem; border-left: 3px solid var(--pc, #b9aecb); margin-left: .4rem; font-size: .9rem; }
.timeline li b { display: inline-block; min-width: 26px; color: #9a8fb3; }
.end-actions { display: flex; justify-content: center; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; position: relative; }

/* ---------- responsive ---------- */
@media (max-width: 1150px) {
  .board { grid-template-columns: 260px minmax(0, 1fr); }
  .feed { display: none; }
}
@media (max-width: 800px) {
  .shell { height: auto; }
  .board { grid-template-columns: minmax(0, 1fr); padding: .6rem; }
  .topbar { gap: .4rem; padding: .5rem; }
  .road { min-width: 0; }
  .top-actions .icon-btn { width: 32px; height: 32px; }
  .players { flex-direction: row; overflow-x: auto; order: 2; padding-bottom: 6px; }
  .pcard { min-width: 250px; }
  .center { order: 1; overflow: visible; min-width: 0; }
  .card { max-width: 100%; }
  .road { overflow: hidden; justify-content: flex-start; }
  .th-label { font-size: .75rem; padding: .3rem .6rem; }
  .road-node em, .road-line { display: none; }
  .road-node span { width: 30px; height: 30px; font-size: .95rem; }
  .logo.small { display: none; }
  .card { padding: 1.1rem; }
  .card h2 { font-size: 1.35rem; }
  .pinfo .cols { grid-template-columns: 1fr; }
  .score-parts { grid-template-columns: repeat(3, 1fr); }
  .awards { grid-template-columns: 1fr 1fr; }
  .dreams { grid-template-columns: 1fr; }
}
