/* GLOAMWAKE — UI. Dark fantasy: obsidian & aged gold, gothic type. Limbo (black, grain, silhouettes) ×
   tarot-card choices × GTA V (HUD, phone, banners). */
:root {
  --ink: #0c0612;
  --night: #07040c;
  --obsidian: #130b1b;
  --obsidian2: #1c1128;
  --slate: #26183a;
  --slate2: #34224d;
  --parch: #eadcbf;
  --parch-dim: #b8a684;
  --muted: #9a8a73;
  --gold: #d9a944;
  --gold-hi: #ffe39a;
  --gold-lo: #7e5419;
  --blood: #c3122f;
  --blood-hi: #ff3b52;
  --magenta: #ff3fb4;
  --teal: #35d6c8;
  --green: #46f08a;
  --cash: #9fe870;
  --blue: #4aa8ff;
  --red: #ff3f5e;
  --violet: #9b5cff;
  --orange: #ff8a3d;
  --f-hud: 'Grenze', 'Anton', Impact, 'Arial Narrow Bold', sans-serif;
  --f-goth: 'Grenze Gotisch', 'Grenze', 'Palatino Linotype', Georgia, serif;
  --f-ui: 'Alegreya Sans', 'Gill Sans', 'Segoe UI', system-ui, sans-serif;
  --f-title: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --shadow: 0 12px 34px rgba(0, 0, 0, .6);
  --frame: linear-gradient(180deg, #f6d98c, #b8862f 45%, #6e4714 100%);
  --panel-bg: radial-gradient(120% 80% at 50% 0%, rgba(120, 60, 170, .18), transparent 60%), linear-gradient(180deg, #1d1229, #0f0816);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--night); color: var(--parch); font-family: var(--f-ui); user-select: none; -webkit-user-select: none; }
#stage { position: fixed; inset: 0; display: block; transition: filter .6s ease; }
#stage.wasted { filter: grayscale(1) contrast(1.15) brightness(.85); }
#stage.eclipse { filter: grayscale(1) contrast(1.6) brightness(.5); }
img { -webkit-user-drag: none; }
button { font-family: inherit; cursor: pointer; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: none; }
.hud * , #overlay *, #deadscr *, #phone *, #panel *, #modal *, #toasts * { pointer-events: auto; }
.icon { width: 1.4em; height: 1.4em; object-fit: contain; vertical-align: middle; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .7)); }
.goth { font-family: var(--f-goth); }
.gold-text { background: linear-gradient(180deg, #fff1c4 10%, #e8b955 55%, #a8721f 95%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- HUD text (GTA weight, gothic serif) ---------- */
.gta { font-family: var(--f-hud); font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: #f6ecd6;
  text-shadow: -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink), 0 3px 0 var(--ink), 0 6px 16px rgba(0, 0, 0, .65); }

/* ---------- HUD top-left: run ---------- */
#hud-tl { position: absolute; left: 22px; top: 14px; width: min(440px, 42vw); }
.depth-line { display: flex; align-items: baseline; gap: 12px; }
.depth-big { font-size: 58px; line-height: 1; }
.depth-big small { font-size: 24px; color: var(--gold-hi); margin-right: 8px; letter-spacing: .12em; }
.biome-name { font-size: 20px; color: #9fe9e2; margin-top: 2px; letter-spacing: .06em; }
.biome-name .sep { color: #fff6; margin: 0 6px; }
.xp-pill { margin-top: 8px; display: flex; align-items: center; gap: 10px; background: linear-gradient(180deg, rgba(28, 17, 40, .92), rgba(12, 6, 18, .92)); border: 1px solid var(--gold-lo); box-shadow: inset 0 0 0 1px rgba(255, 227, 154, .12), var(--shadow); border-radius: 4px; padding: 4px 12px 4px 4px; width: max-content; min-width: 260px; }
.lvl-badge { background: var(--frame); color: #1a0d05; font-family: var(--f-hud); font-weight: 800; border-radius: 3px; padding: 1px 10px; font-size: 15px; letter-spacing: .05em; box-shadow: 0 2px 0 #000; }
.xp-track { flex: 1; height: 8px; background: rgba(0, 0, 0, .55); border: 1px solid #3a2a12; min-width: 150px; }
.xp-fill { height: 100%; background: linear-gradient(90deg, #a8721f, #ffe39a); box-shadow: 0 0 10px rgba(255, 210, 120, .5); transition: width .25s; }
.strip { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; max-width: 440px; cursor: pointer; }
.strip .chip { position: relative; width: 34px; height: 34px; border-radius: 4px; background: radial-gradient(circle, #2a1a3c, #0c0612); border: 1px solid #5a4020; box-shadow: inset 0 0 0 1px rgba(255, 227, 154, .1); display: grid; place-items: center; }
.strip .chip img { width: 26px; height: 26px; object-fit: contain; }
.strip .chip.relic { border-color: var(--gold); box-shadow: 0 0 8px rgba(217, 169, 68, .45); }
.strip .chip b { position: absolute; right: -4px; bottom: -4px; font-size: 11px; font-family: var(--f-hud); background: var(--blood); border: 1px solid #ff8a9a; border-radius: 3px; padding: 0 4px; color: #fff; }
.run-flags { margin-top: 6px; display: flex; gap: 8px; font-size: 13px; color: var(--parch); }
.run-flags span { background: rgba(10, 5, 16, .8); border-radius: 3px; padding: 2px 10px; border: 1px solid #4a3418; font-family: var(--f-hud); letter-spacing: .04em; }

/* ---------- HUD top-right: money ---------- */
#hud-tr { position: absolute; right: 24px; top: 12px; text-align: right; }
.cash { font-size: 48px; line-height: 1.05; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.cash .icon { width: 40px; height: 40px; }
.cash-sub { font-size: 25px; display: flex; align-items: center; justify-content: flex-end; gap: 6px; line-height: 1.25; }
.cash-sub .icon { width: 26px; height: 26px; }
.cash-sub.ash { color: #d9c8ff; }
.cash-sub.ember { color: #ffb36b; }
.cash-sub.steel { color: #a9c6ff; }
.cash-sub.shard { color: var(--gold-hi); }
.cash-pop { position: absolute; right: 0; top: 52px; font-size: 30px; color: var(--cash); animation: cashpop 1.1s ease-out forwards; pointer-events: none; white-space: nowrap; }
@keyframes cashpop { 0% { opacity: 0; transform: translateY(8px) scale(.8); } 15% { opacity: 1; transform: translateY(0) scale(1.1); } 100% { opacity: 0; transform: translateY(-26px) scale(1); } }

/* ---------- HUD top-center: boss / wave ---------- */
#hud-top { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); width: min(620px, 46vw); text-align: center; }
.wave-pips { display: inline-flex; gap: 8px; align-items: center; font-size: 22px; letter-spacing: .1em; }
.wave-pips i { width: 12px; height: 12px; transform: rotate(45deg); background: rgba(0, 0, 0, .5); border: 1px solid var(--gold-lo); display: inline-block; margin: 0 2px; }
.wave-pips i.on { background: var(--gold-hi); box-shadow: 0 0 10px var(--gold); }
.boss-bar { margin-top: 2px; }
.boss-name { font-family: var(--f-goth); font-size: 30px; font-weight: 700; text-transform: none; letter-spacing: .02em; color: #ffc2cf; }
.boss-track { position: relative; height: 18px; border: 1px solid #c8953a; background: #1a0508; overflow: hidden; box-shadow: 0 0 0 2px #000, 0 6px 18px rgba(0, 0, 0, .6); }
.boss-ghost { position: absolute; inset: 0; background: #f2dcb0; transition: width .6s ease .2s; }
.boss-fill { position: absolute; inset: 0; background: linear-gradient(180deg, #ff5a6e, #9b0a22); transition: width .12s; }
.boss-shield { position: absolute; left: 0; top: 0; height: 5px; background: #8ff; }
.gloom { margin-top: 6px; font-family: var(--f-goth); font-size: 24px; text-transform: none; color: #ff7ad9; animation: throb .6s ease-in-out infinite alternate; }
@keyframes throb { from { transform: scale(1); opacity: .8; } to { transform: scale(1.06); opacity: 1; } }

/* ---------- HUD bottom-left: GTA radar ---------- */
#hud-bl { position: absolute; left: 22px; bottom: 20px; width: 270px; }
.radar { position: relative; height: 150px; border-radius: 6px; background: radial-gradient(120% 120% at 30% 20%, rgba(60, 28, 90, .9), rgba(8, 3, 14, .95)); border: 1px solid #c8953a; box-shadow: 0 0 0 2px #000, inset 0 0 0 1px rgba(255, 227, 154, .15), inset 0 0 30px rgba(0, 0, 0, .7), var(--shadow); overflow: hidden; }
.radar::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 6px); pointer-events: none; }
.radar svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.radar-label { position: absolute; left: 12px; top: 8px; font-size: 15px; color: var(--parch); }
.radar-label b { color: var(--gold-hi); }
.radar-n { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; transform: rotate(45deg); background: rgba(8, 3, 14, .9); border: 1px solid #5a4020; display: grid; place-items: center; }
.radar-n img { width: 22px; height: 22px; object-fit: contain; transform: rotate(-45deg); }
.radar-n.done { border-color: #7fc08a; opacity: .7; }
.radar-n.cur { border-color: var(--gold-hi); box-shadow: 0 0 0 3px rgba(217, 169, 68, .3), 0 0 16px var(--gold); animation: pulse 1s ease-in-out infinite alternate; }
.radar-n.future { opacity: .45; }
@keyframes pulse { from { transform: rotate(45deg) scale(1); } to { transform: rotate(45deg) scale(1.12); } }
.gta-bars { display: flex; gap: 6px; margin-top: 6px; }
.gta-bar { height: 10px; background: rgba(0, 0, 0, .7); border: 1px solid #000; outline: 1px solid #4a3418; position: relative; overflow: hidden; }
.gta-bar.hp { flex: 2; } .gta-bar.sh { flex: 1; }
.gta-bar i { position: absolute; inset: 0; transition: width .2s; }
.gta-bar.hp i { background: linear-gradient(180deg, #8bf0a2, #24894a); }
.gta-bar.sh i { background: linear-gradient(180deg, #a8dcff, #2f6fc0); }

/* ---------- HUD bottom-center: party medallions ---------- */
#hud-bc { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 16px; align-items: flex-end; }
.pbub { position: relative; width: 84px; height: 84px; border-radius: 50%; cursor: pointer; transition: transform .2s, filter .2s; }
.pbub:hover { transform: translateY(-4px); filter: drop-shadow(0 0 10px rgba(255, 210, 120, .45)); }
.pbub .ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--green) calc(var(--hp) * 1%), rgba(0, 0, 0, .7) 0); box-shadow: 0 0 0 2px #000, 0 0 0 4px #b8862f, 0 0 0 5px #000, 0 10px 20px rgba(0, 0, 0, .6); }
.pbub .face { position: absolute; inset: 6px; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 35%, #4a2a66, #12081c 75%); border: 2px solid #1a0f08; box-shadow: inset 0 0 12px rgba(0, 0, 0, .8); }
.pbub .face img { width: 100%; height: 160%; object-fit: cover; object-position: 50% 8%; }
.pbub .face img.portrait { height: 100%; object-position: 50% 20%; }
.pbub .cd { position: absolute; inset: -7px; border-radius: 50%; background: conic-gradient(rgba(255, 220, 130, .95) calc(var(--cd) * 1%), transparent 0); -webkit-mask: radial-gradient(circle, transparent 60%, #000 61%); mask: radial-gradient(circle, transparent 60%, #000 61%); }
.pbub .lv { position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%); background: linear-gradient(180deg, #2c1c3e, #120a1a); color: var(--gold-hi); font-family: var(--f-hud); font-weight: 700; font-size: 13px; letter-spacing: .06em; border: 1px solid #b8862f; border-radius: 3px; padding: 0 8px; box-shadow: 0 2px 0 #000; white-space: nowrap; text-transform: uppercase; }
.pbub.dead .face { filter: grayscale(1) brightness(.45); }
.pbub.dead::after { content: '✝'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 36px; color: #e9dcc0; text-shadow: 0 2px 0 #000; }
.pbub.sum { width: 58px; height: 58px; }
.pbub .ready { display: none; }

/* ---------- HUD bottom-right: controls + phone ---------- */
#hud-br { position: absolute; right: 22px; bottom: 20px; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.ctrl-row { display: flex; gap: 8px; }
.pill { position: relative; border: 1px solid #b8862f; border-radius: 4px; padding: 7px 16px; font-family: var(--f-hud); font-weight: 700; font-size: 15px; letter-spacing: .07em; text-transform: uppercase; color: var(--parch); background: linear-gradient(180deg, #3b2754 0%, #22152f 55%, #170d21 100%); box-shadow: inset 0 1px 0 rgba(255, 227, 154, .25), inset 0 0 0 1px rgba(0, 0, 0, .6), 0 2px 0 #000, 0 6px 14px rgba(0, 0, 0, .5); transition: transform .08s, filter .15s, box-shadow .15s; display: inline-flex; align-items: center; gap: 6px; text-shadow: 0 1px 0 #000; }
.pill:hover { filter: brightness(1.18); box-shadow: inset 0 1px 0 rgba(255, 227, 154, .35), inset 0 0 0 1px rgba(0, 0, 0, .6), 0 2px 0 #000, 0 0 14px rgba(217, 169, 68, .35); }
.pill:active { transform: translateY(2px); }
.pill.on { background: linear-gradient(180deg, #f6d98c, #c39236 55%, #8a5c1c); color: #1a0d05; text-shadow: 0 1px 0 rgba(255, 240, 200, .5); border-color: #ffe9b0; }
.pill.dark { background: linear-gradient(180deg, #24172f, #0d0713); }
.pill.red { background: linear-gradient(180deg, #d42a45, #8a0b20 60%, #5c0614); border-color: #ff8a9a; color: #fff; }
.pill.green { background: linear-gradient(180deg, #3fae6a, #1d6b3c 60%, #0f4325); border-color: #9fe8b0; color: #f2fff4; }
.pill.violet { background: linear-gradient(180deg, #8a52e0, #4d21a0 60%, #2c0f66); border-color: #d6b8ff; color: #fff; }
.pill.big { font-size: 19px; padding: 11px 26px; }
.pill:disabled { filter: grayscale(.85) brightness(.6); cursor: not-allowed; }
.phone-btn { position: relative; width: 74px; height: 110px; border-radius: 14px; border: 2px solid #b8862f; background: linear-gradient(160deg, #2c1a40, #0b0612); box-shadow: 0 0 0 2px #000, 0 8px 0 #000, 0 14px 30px rgba(0, 0, 0, .7); display: grid; place-items: center; cursor: pointer; transition: transform .15s; }
.phone-btn:hover { transform: translateY(-4px) rotate(-3deg); }
.phone-btn::before { content: ''; position: absolute; top: 7px; width: 22px; height: 4px; border-radius: 4px; background: #000; }
.phone-btn img { width: 46px; height: 46px; }
.phone-btn .lbl { position: absolute; bottom: 6px; font-size: 10px; letter-spacing: .14em; color: var(--gold-hi); font-family: var(--f-hud); font-weight: 700; }
.badge { position: absolute; top: -8px; right: -8px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--blood); color: #fff; font-family: var(--f-hud); font-weight: 800; font-size: 13px; display: grid; place-items: center; border: 2px solid #ffd7a0; box-shadow: 0 2px 0 #000, 0 0 10px rgba(195, 18, 47, .6); }
.badge:empty { display: none; }

/* ---------- choice overlay: tarot cards ---------- */
#overlay { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); width: min(1120px, 96vw); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ov-head { display: flex; align-items: center; gap: 12px; }
.ov-title { font-family: var(--f-goth); font-weight: 700; font-size: 30px; color: var(--gold-hi); background: linear-gradient(180deg, rgba(30, 18, 44, .95), rgba(10, 5, 16, .95)); padding: 6px 30px; border: 1px solid #b8862f; border-radius: 3px; box-shadow: 0 0 0 2px #000, inset 0 0 0 1px rgba(255, 227, 154, .14), var(--shadow); text-shadow: 0 2px 0 #000; display: flex; align-items: center; gap: 10px; }
.ov-timer { width: 240px; height: 6px; background: rgba(0, 0, 0, .6); border: 1px solid #5a4020; overflow: hidden; }
.ov-timer i { display: block; height: 100%; background: linear-gradient(90deg, #a8721f, #ffe39a); box-shadow: 0 0 8px rgba(255, 210, 120, .6); }
.ov-auto { font-family: var(--f-goth); font-size: 17px; color: var(--parch); background: rgba(10, 5, 16, .85); border: 1px solid #4a3418; border-radius: 3px; padding: 3px 14px; }
.cards { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; perspective: 1200px; }
.card { --cc: #b8862f; position: relative; width: 210px; min-height: 300px; color: var(--parch); border-radius: 8px; padding: 14px 14px 14px; display: flex; flex-direction: column; align-items: center; text-align: center; cursor: pointer;
  background: radial-gradient(120% 70% at 50% 18%, color-mix(in srgb, var(--cc) 38%, transparent), transparent 62%), linear-gradient(180deg, #23152f 0%, #120a1a 70%, #0b0611 100%);
  border: 1px solid #c8953a; box-shadow: 0 0 0 3px #0a0510, 0 0 0 4px #6e4714, inset 0 0 0 1px rgba(255, 227, 154, .18), inset 0 0 40px rgba(0, 0, 0, .55), 0 18px 34px rgba(0, 0, 0, .65);
  transition: transform .2s ease, box-shadow .2s ease; animation: tarotin .55s cubic-bezier(.2, .8, .3, 1) both; overflow: hidden; transform-style: preserve-3d; }
.card::before { content: ''; position: absolute; inset: 7px; border: 1px solid rgba(217, 169, 68, .45); border-radius: 5px; pointer-events: none; }
.card.framed { overflow: visible; border-color: transparent; border-radius: 4px; width: 232px !important; padding: 30px 32px 42px; margin: 10px 10px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, .55), 0 18px 34px rgba(0, 0, 0, .65); }
.card.framed::after { content: ''; position: absolute; inset: -18px -24px -22px; background: url('../assets/sprites/kit_frame.webp') center / 100% 100% no-repeat; pointer-events: none; z-index: 1; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .7)); }
.card.framed::before { display: none; }
.card.framed:hover { box-shadow: inset 0 0 40px rgba(0, 0, 0, .45), 0 0 30px color-mix(in srgb, var(--cc) 55%, transparent), 0 22px 40px rgba(0, 0, 0, .7); }
.card.framed .cname { font-size: 22px; }
.card.framed .cdesc { font-size: 14px; }
.card.framed .stack { top: 30px; right: 26px; }
.card.framed .cnew { top: 30px; left: 26px; }
.card.framed .cimg { margin-top: 6px; width: 96px; height: 96px; }
.cards:has(.framed) { gap: 34px; }
.card:hover { transform: translateY(-8px); box-shadow: 0 0 0 3px #0a0510, 0 0 0 4px #d9a944, inset 0 0 0 1px rgba(255, 227, 154, .3), inset 0 0 40px rgba(0, 0, 0, .45), 0 0 26px color-mix(in srgb, var(--cc) 60%, transparent), 0 22px 40px rgba(0, 0, 0, .7); }
.card:active { transform: translateY(-2px); }
.card .cimg { position: relative; width: 104px; height: 104px; margin-top: 10px; display: grid; place-items: center; }
.card .cimg::before { content: ''; position: absolute; inset: -6px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--cc) 45%, transparent), transparent 70%); }
.card .cimg img { position: relative; max-width: 100%; max-height: 100%; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .7)); }
.card .cname { position: relative; margin-top: 10px; font-family: var(--f-goth); font-weight: 700; font-size: 25px; line-height: 1.05; background: linear-gradient(180deg, #fff1c4 10%, #e8b955 55%, #a8721f 95%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 #000); }
.card .crar { position: relative; font-family: var(--f-hud); font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--crar, var(--parch-dim)); margin-top: 3px; }
.card .cdesc { position: relative; margin-top: 8px; font-size: 15px; color: #d9cbad; line-height: 1.32; }
.card .cfoot { position: relative; margin-top: auto; padding-top: 10px; font-family: var(--f-hud); font-weight: 700; font-size: 17px; letter-spacing: .05em; display: flex; align-items: center; gap: 6px; color: var(--gold-hi); }
.card .sep-line { position: relative; width: 70%; height: 1px; margin-top: 8px; background: linear-gradient(90deg, transparent, #c8953a, transparent); }
.card.sold { opacity: .4; filter: grayscale(.8); pointer-events: none; }
.card.poor .cfoot { color: var(--red); }
.card .stack { position: absolute; top: 12px; right: 14px; background: rgba(0, 0, 0, .6); border: 1px solid #5a4020; border-radius: 3px; font-family: var(--f-hud); font-size: 12px; font-weight: 700; padding: 0 7px; color: var(--gold-hi); z-index: 2; }
.card .cnew { position: absolute; top: 12px; left: 14px; background: var(--frame); border-radius: 3px; font-family: var(--f-hud); font-size: 11px; font-weight: 800; letter-spacing: .1em; padding: 0 7px; color: #1a0d05; z-index: 2; }
/* tarot art cards (doors) */
.card.tarot { padding: 0; width: 200px; min-height: 0; background: #0b0611; }
.card.tarot::before { display: none; }
.card.tarot .tart { position: relative; width: 100%; aspect-ratio: 3 / 5; }
.card.tarot { animation-name: tarotflip; animation-duration: .75s; animation-timing-function: ease-in-out; }
.card.tarot .tback { position: absolute; inset: 0; background: url('../assets/sprites/node_back.webp') center / 100% 100% no-repeat; z-index: 4; pointer-events: none; animation: tbackhide .75s step-end both; animation-delay: inherit; }
.card.tarot.in .tback, #overlay.static .card.tarot .tback { display: none; }
@keyframes tarotflip { 0% { opacity: 0; transform: translateY(22px) scaleX(1); } 14% { opacity: 1; transform: translateY(14px) scaleX(1); } 50% { transform: translateY(6px) scaleX(.02); } 100% { opacity: 1; transform: none; } }
@keyframes tbackhide { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 0; } }
.card.tarot .tart img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card.tarot .tname { position: absolute; left: 0; right: 0; bottom: 5.5%; height: 13%; display: grid; place-items: center; font-family: var(--f-goth); font-weight: 700; font-size: 24px; color: var(--gold-hi); text-shadow: 0 2px 0 #000, 0 0 12px rgba(0, 0, 0, .9); }
.card.tarot .tcap { padding: 8px 12px 12px; font-size: 14px; color: #d9cbad; line-height: 1.3; min-height: 54px; background: linear-gradient(180deg, #160d20, #0b0611); border-top: 1px solid #6e4714; }
@keyframes tarotin { from { opacity: 0; transform: translateY(26px) rotateY(80deg) scale(.92); } to { opacity: 1; transform: none; } }
.ov-actions { display: flex; gap: 10px; }
.event-card { width: min(680px, 94vw); background: var(--panel-bg); color: var(--parch); border-radius: 6px; padding: 20px 24px; border: 1px solid #c8953a; box-shadow: 0 0 0 3px #0a0510, 0 0 0 4px #6e4714, inset 0 0 0 1px rgba(255, 227, 154, .14), var(--shadow); animation: tarotin .5s cubic-bezier(.2, .8, .3, 1) both; display: grid; grid-template-columns: 170px 1fr; gap: 18px; align-items: start; }
.event-card img { width: 170px; height: auto; max-height: 230px; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .7)); }
.event-card img.icon-art { width: 120px; height: 120px; margin: 20px auto; }
.event-card h3 { margin: 0 0 6px; font-family: var(--f-goth); font-weight: 700; font-size: 32px; color: var(--gold-hi); text-shadow: 0 2px 0 #000; }
.event-card p { margin: 0 0 12px; font-size: 17px; color: #d9cbad; line-height: 1.45; font-style: italic; }
.opt { display: block; width: 100%; text-align: left; margin-top: 8px; padding: 10px 16px; border-radius: 4px; border: 1px solid #6e4714; background: linear-gradient(180deg, #2a1a3a, #150c1f); box-shadow: inset 0 1px 0 rgba(255, 227, 154, .12), 0 2px 0 #000; color: var(--parch); font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.opt b { display: block; font-family: var(--f-goth); font-weight: 700; font-size: 21px; color: var(--gold-hi); }
.opt span { font-size: 14px; color: var(--parch-dim); }
.opt:hover { border-color: var(--gold); box-shadow: inset 0 1px 0 rgba(255, 227, 154, .2), 0 0 14px rgba(217, 169, 68, .35); }

/* ---------- banners ---------- */
#banner { position: absolute; left: 0; right: 0; top: 30%; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.bn { text-align: center; animation: bn 2.6s ease forwards; }
.bn .t { font-family: var(--f-goth); font-weight: 900; font-size: clamp(42px, 6vw, 84px); line-height: 1; text-transform: none; letter-spacing: .01em; }
.bn .s { font-size: 24px; margin-top: 6px; color: var(--parch); font-family: var(--f-ui); font-weight: 500; font-style: italic; text-shadow: 0 2px 0 #000, 0 0 12px rgba(0, 0, 0, .9); }
.bn.gold .t { color: var(--gold-hi); }
.bn.boss .t { color: #ff4a62; }
.bn.feat .t { color: #b8f08a; font-size: clamp(34px, 4.5vw, 58px); }
.bn-stripe { background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .78) 20%, rgba(0, 0, 0, .78) 80%, transparent); padding: 14px 90px; border-top: 1px solid rgba(217, 169, 68, .35); border-bottom: 1px solid rgba(217, 169, 68, .35); }
@keyframes bn { 0% { opacity: 0; transform: scale(1.4); filter: blur(6px); } 10% { opacity: 1; transform: scale(1); filter: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(.98); } }
.biome-card { position: fixed; inset: 0; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; animation: biomecard 3.2s ease forwards; z-index: 5; }
.biome-card .num { font-family: var(--f-title); font-size: 22px; letter-spacing: .6em; color: #bbb; }
.biome-card .nm { font-family: var(--f-title); font-weight: 400; font-size: clamp(32px, 5.5vw, 68px); letter-spacing: .25em; color: #f2f2f2; margin-top: 10px; text-align: center; }
.biome-card .ln { width: 0; height: 1px; background: #888; margin-top: 18px; animation: line 2s ease .3s forwards; }
@keyframes line { to { width: 340px; } }
@keyframes biomecard { 0% { opacity: 0; } 15% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

/* ---------- EXTINGUISHED ---------- */
#deadscr { position: absolute; inset: 0; z-index: 3; }
#deadscr:empty { display: none; }
.wasted-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; background: radial-gradient(circle, rgba(0, 0, 0, .15), rgba(0, 0, 0, .75)); pointer-events: auto; }
.wasted { font-family: var(--f-goth); font-weight: 900; font-size: clamp(58px, 9.5vw, 128px); white-space: nowrap; color: #d61f3a; letter-spacing: .02em; text-shadow: -3px -3px 0 #000, 3px -3px 0 #000, -3px 3px 0 #000, 3px 3px 0 #000, 0 8px 30px rgba(0, 0, 0, .9); animation: wasted 1.2s ease-out both; }
.wasted.ret { color: #e8dcc0; }
@keyframes wasted { 0% { opacity: 0; transform: scale(2.2); } 40% { opacity: 1; transform: scale(1); } 100% { transform: scale(1.04); } }
.summary { width: min(620px, 92vw); background: var(--panel-bg); color: var(--parch); border-radius: 6px; border: 1px solid #c8953a; box-shadow: 0 0 0 3px #0a0510, 0 0 0 4px #6e4714, var(--shadow); overflow: hidden; animation: tarotin .55s cubic-bezier(.2, .8, .3, 1) .9s both; }
.summary .hd { background: linear-gradient(180deg, #2c1a3e, #150c1f); border-bottom: 1px solid #6e4714; color: var(--gold-hi); padding: 10px 22px; font-family: var(--f-goth); font-weight: 700; font-size: 24px; display: flex; justify-content: space-between; }
.summary .bd { padding: 16px 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; }
.summary .row { display: flex; justify-content: space-between; font-size: 17px; border-bottom: 1px solid rgba(217, 169, 68, .18); padding-bottom: 6px; }
.summary .row b { font-family: var(--f-hud); font-weight: 700; color: var(--gold-hi); letter-spacing: .04em; }
.summary .ft { padding: 0 22px 18px; display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.summary .ups { grid-column: 1 / -1; font-size: 14px; color: #c9a8ff; }

/* ---------- toasts ---------- */
#toasts { position: absolute; right: 22px; top: 230px; width: 330px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 10px; background: linear-gradient(180deg, rgba(34, 21, 48, .96), rgba(14, 8, 20, .96)); color: var(--parch); border-radius: 4px; padding: 8px 14px 8px 8px; border: 1px solid #4a3418; border-left: 4px solid var(--tcol, var(--gold)); box-shadow: 0 0 0 1px #000, var(--shadow); animation: toastin .35s cubic-bezier(.2, .9, .3, 1) both, toastout .4s ease 4.2s forwards; max-width: 330px; }
.toast img { width: 40px; height: 40px; object-fit: contain; }
.toast b { display: block; font-family: var(--f-goth); font-weight: 700; font-size: 18px; color: var(--gold-hi); }
.toast span { font-size: 13px; color: var(--parch-dim); }
@keyframes toastin { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes toastout { to { opacity: 0; transform: translateX(30px); } }

/* ---------- Grimoire phone (GTA) ---------- */
#phone { position: absolute; right: 22px; bottom: 150px; width: 300px; height: 560px; border-radius: 36px; background: #0a0610; padding: 12px; box-shadow: 0 0 0 2px #b8862f, 0 0 0 4px #000, 0 30px 60px rgba(0, 0, 0, .75); transform: translateY(calc(100% + 220px)) rotate(6deg); transition: transform .35s cubic-bezier(.2, 1, .4, 1); }
#phone.open { transform: none; pointer-events: auto; }
.ph-screen { position: relative; width: 100%; height: 100%; border-radius: 26px; overflow: hidden; background-color: #120822; background-size: cover; background-position: center; }
.ph-top { display: flex; justify-content: space-between; padding: 12px 20px 4px; font-size: 13px; color: var(--parch); font-family: var(--f-hud); letter-spacing: .05em; }
.ph-clock { text-align: center; font-family: var(--f-title); font-size: 44px; color: #fff; margin-top: 8px; text-shadow: 0 2px 12px #000; }
.ph-date { text-align: center; font-size: 12px; letter-spacing: .3em; color: var(--gold-hi); margin-bottom: 14px; font-family: var(--f-hud); }
.ph-apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 10px; padding: 6px 14px; }
.app { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; border: 0; background: none; color: var(--parch); font-size: 13px; font-family: var(--f-hud); font-weight: 600; letter-spacing: .04em; text-shadow: 0 1px 2px #000; }
.app .ic { width: 62px; height: 62px; border-radius: 14px; display: grid; place-items: center; background: var(--ac); border: 1px solid #c8953a; box-shadow: 0 0 0 2px #000, inset 0 0 18px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .25), 0 6px 10px rgba(0, 0, 0, .5); transition: transform .12s; }
.app:hover .ic { transform: translateY(-3px); filter: brightness(1.15); }
.app .ic img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .6)); }
.app .badge { top: -6px; right: 6px; }
.ph-home { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); width: 110px; height: 4px; border-radius: 4px; background: #e9dcc088; }

/* ---------- big panel (dark tome) ---------- */
#panel { position: absolute; left: 50%; top: 50%; width: min(1120px, 94vw); height: min(760px, 88vh); transform: translate(-50%, -46%) scale(.96); opacity: 0; visibility: hidden; transition: transform .25s cubic-bezier(.2, .9, .3, 1), opacity .2s, visibility 0s .25s;
  background: var(--panel-bg); color: var(--parch); border-radius: 8px; border: 1px solid #c8953a; box-shadow: 0 0 0 3px #0a0510, 0 0 0 4px #6e4714, inset 0 0 0 1px rgba(255, 227, 154, .12), 0 30px 80px rgba(0, 0, 0, .75); display: flex; flex-direction: column; overflow: hidden; }
#panel.open { transform: translate(-50%, -50%); opacity: 1; visibility: visible; pointer-events: auto; transition: transform .25s cubic-bezier(.2, .9, .3, 1), opacity .2s; }
.pn-head { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 24px; background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(0, 0, 0, .25)), color-mix(in srgb, var(--pc, #4d21a0) 30%, #140b1d); border-bottom: 1px solid #6e4714; box-shadow: inset 0 -1px 0 rgba(255, 227, 154, .15); }
.pn-head img { width: 52px; height: 52px; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .6)); }
.pn-title { font-family: var(--f-goth); font-weight: 700; font-size: 36px; line-height: 1; background: linear-gradient(180deg, #fff1c4 10%, #e8b955 55%, #a8721f 95%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 #000); }
.pn-sub { font-size: 15px; color: var(--parch-dim); font-style: italic; margin-top: 2px; }
.pn-cur { margin-left: auto; display: flex; gap: 10px; align-items: center; background: rgba(0, 0, 0, .45); border: 1px solid #5a4020; border-radius: 3px; padding: 5px 14px; font-family: var(--f-hud); font-weight: 700; font-size: 18px; letter-spacing: .04em; color: var(--gold-hi); }
.pn-cur .icon { width: 26px; height: 26px; }
.pn-close { width: 42px; height: 42px; border-radius: 4px; border: 1px solid #b8862f; background: linear-gradient(180deg, #3b2754, #170d21); color: var(--gold-hi); font-size: 20px; font-weight: 700; box-shadow: 0 2px 0 #000; }
.pn-close:hover { filter: brightness(1.2); }
.pn-tabs { display: flex; gap: 6px; padding: 12px 24px 6px; flex-wrap: wrap; }
.tab { border: 1px solid #4a3418; border-radius: 3px; padding: 6px 16px; background: linear-gradient(180deg, #24172f, #120a1a); color: var(--parch-dim); font-family: var(--f-hud); font-weight: 700; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.tab.on { color: #1a0d05; background: var(--frame); border-color: #ffe9b0; }
.pn-body { flex: 1; overflow-y: auto; padding: 10px 24px 24px; }
.pn-body::-webkit-scrollbar { width: 10px; } .pn-body::-webkit-scrollbar-thumb { background: #5a4020; border-radius: 2px; } .pn-body::-webkit-scrollbar-track { background: #0c0612; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tile { position: relative; background: linear-gradient(180deg, #22152f, #130b1b); border: 1px solid #4a3418; border-radius: 5px; padding: 14px; box-shadow: inset 0 0 0 1px rgba(255, 227, 154, .06), 0 4px 12px rgba(0, 0, 0, .45); display: flex; flex-direction: column; gap: 6px; }
.tile.locked { background: linear-gradient(180deg, #161019, #0d0811); color: #7a6c5a; border-color: #2c2018; }
.tile.maxed { border-color: #c8953a; box-shadow: inset 0 0 0 1px rgba(255, 227, 154, .14), 0 0 14px rgba(217, 169, 68, .15); }
.tile .th { display: flex; gap: 10px; align-items: center; }
.tile .th img { width: 50px; height: 50px; object-fit: contain; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .6)); }
.tile .tn { font-family: var(--f-goth); font-weight: 700; font-size: 21px; line-height: 1.05; color: var(--gold-hi); }
.tile.locked .tn { color: #7a6c5a; }
.tile .tl { font-size: 13px; color: var(--parch-dim); font-family: var(--f-hud); letter-spacing: .05em; }
.tile .td { font-size: 14px; color: #d0c2a4; line-height: 1.35; flex: 1; }
.tile .td b { color: var(--parch); }
.tile .tf { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; font-family: var(--f-hud); letter-spacing: .03em; }
.tile .pill { padding: 6px 14px; font-size: 14px; }
.lvbar { height: 6px; background: rgba(0, 0, 0, .6); border: 1px solid #3a2a12; overflow: hidden; }
.lvbar i { display: block; height: 100%; background: linear-gradient(90deg, #6d2bd6, #ff3fb4); }
.sec { font-family: var(--f-goth); font-weight: 700; font-size: 26px; margin: 18px 0 10px; display: flex; align-items: center; gap: 12px; color: var(--gold-hi); }
.sec::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, #c8953a, transparent); }
.sec small { font-family: var(--f-ui); font-weight: 400; font-size: 14px; color: var(--parch-dim); font-style: italic; }
.note { background: rgba(0, 0, 0, .35); border: 1px solid #3a2a12; border-left: 3px solid var(--gold); border-radius: 3px; padding: 10px 14px; font-size: 14px; color: #d0c2a4; margin: 6px 0 12px; }
.note.warn { border-left-color: var(--blood); color: #ffc2c8; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px; font-size: 14px; }
.kv div { display: flex; justify-content: space-between; border-bottom: 1px solid rgba(217, 169, 68, .15); padding: 2px 0; color: var(--parch-dim); }
.kv b { font-family: var(--f-hud); font-weight: 700; color: var(--parch); letter-spacing: .03em; }

/* hero rows */
.hero-row { display: grid; grid-template-columns: 150px 1fr 240px; gap: 16px; background: linear-gradient(180deg, #22152f, #130b1b); border: 1px solid #4a3418; border-radius: 6px; padding: 14px; box-shadow: inset 0 0 0 1px rgba(255, 227, 154, .06); margin-bottom: 14px; align-items: start; }
.hero-row.locked { background: linear-gradient(180deg, #161019, #0d0811); }
.hero-art { width: 150px; height: 170px; border-radius: 4px; border: 1px solid #6e4714; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--hc, #9b5cff) 55%, transparent), #0c0612 75%); display: grid; place-items: end center; overflow: hidden; position: relative; box-shadow: inset 0 0 20px rgba(0, 0, 0, .7); }
.hero-art img { width: 92%; height: 92%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 6px 4px rgba(0, 0, 0, .6)); }
.hero-row.locked .hero-art img { filter: brightness(0) drop-shadow(0 0 6px #fff3); }
.hero-art .slot { position: absolute; top: 6px; left: 6px; background: var(--frame); color: #1a0d05; font-family: var(--f-hud); font-weight: 800; font-size: 12px; letter-spacing: .08em; padding: 0 8px; border-radius: 2px; z-index: 1; }
.hname { font-family: var(--f-goth); font-weight: 700; font-size: 30px; color: var(--gold-hi); line-height: 1; }
.hname small { font-family: var(--f-hud); }
.htitle { color: var(--parch-dim); font-style: italic; font-size: 15px; }
.hskill { margin-top: 6px; font-size: 14px; background: rgba(0, 0, 0, .35); border: 1px solid #3a2a12; border-radius: 3px; padding: 8px 10px; color: #d0c2a4; }
.hskill b { color: #d6b8ff; }
.talents { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.talent { padding: 4px 10px; border-radius: 3px; background: rgba(0, 0, 0, .3); border: 1px solid #2c2018; color: #7a6c5a; }
.talent.on { background: linear-gradient(90deg, rgba(217, 169, 68, .22), rgba(155, 92, 255, .12)); border-color: #6e4714; color: var(--parch); }
.talent b { font-weight: 700; color: inherit; }
.talent.on b { color: var(--gold-hi); }
.hside { display: flex; flex-direction: column; gap: 8px; }

/* gear */
.gear-wrap { display: grid; grid-template-columns: 340px 1fr; gap: 18px; }
.hero-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.hero-tab { width: 54px; height: 54px; border-radius: 50%; border: 2px solid #4a3418; background: radial-gradient(circle at 50% 35%, #4a2a66, #12081c 75%); overflow: hidden; padding: 0; }
.hero-tab img { width: 100%; height: 150%; object-fit: cover; object-position: 50% 5%; }
.hero-tab img.portrait { height: 100%; object-position: 50% 20%; }
.hero-tab.on { border-color: var(--gold-hi); box-shadow: 0 0 12px rgba(217, 169, 68, .5); }
.slotcard { display: flex; gap: 10px; align-items: center; background: linear-gradient(180deg, #22152f, #130b1b); border: 1px solid #4a3418; border-radius: 4px; padding: 10px; margin-bottom: 10px; cursor: pointer; }
.slotcard:hover { border-color: #c8953a; }
.slotcard.empty { color: var(--muted); }
.slotcard b { font-family: var(--f-goth); font-weight: 700; font-size: 18px; }
.ibox { position: relative; width: 58px; height: 58px; border-radius: 4px; background: radial-gradient(circle, #2e1c44, #0c0612); border: 2px solid var(--rc, #8a8070); box-shadow: inset 0 0 12px rgba(0, 0, 0, .7), 0 0 8px color-mix(in srgb, var(--rc, #000) 35%, transparent); display: grid; place-items: center; flex: none; cursor: pointer; }
.ibox img { width: 44px; height: 44px; object-fit: contain; }
.ibox .il { position: absolute; left: 3px; bottom: 0; font-size: 11px; color: #fff; font-family: var(--f-hud); font-weight: 700; text-shadow: 0 1px 0 #000; }
.ibox .up { position: absolute; right: 3px; top: 0; font-size: 12px; color: var(--gold-hi); font-family: var(--f-hud); font-weight: 800; text-shadow: 0 1px 0 #000; }
.ibox.sel { box-shadow: 0 0 0 2px var(--gold-hi), 0 0 14px rgba(217, 169, 68, .6); }
.ibox .better { position: absolute; right: -6px; bottom: -6px; width: 18px; height: 18px; border-radius: 50%; background: #2fa84f; color: #eaffea; font-size: 11px; font-weight: 900; display: grid; place-items: center; border: 1px solid #000; }
.inv { display: grid; grid-template-columns: repeat(auto-fill, 58px); gap: 8px; }
.idetail { background: rgba(0, 0, 0, .35); border: 1px solid #4a3418; border-radius: 4px; padding: 14px; margin-top: 10px; }
.iname { font-family: var(--f-goth); font-weight: 700; font-size: 22px; }
.affix { font-size: 14px; color: #d0c2a4; }
.affix.main { font-family: var(--f-hud); font-weight: 700; color: var(--parch); letter-spacing: .03em; }
.delta-up { color: #7fe39a; font-weight: 700; } .delta-down { color: #ff7a8a; font-weight: 700; }

/* codex */
.codex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px; }
.cx { background: linear-gradient(180deg, #22152f, #130b1b); border: 1px solid #4a3418; border-radius: 4px; padding: 8px; text-align: center; font-size: 12px; color: var(--parch); }
.cx img { width: 60px; height: 60px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .6)); }
.cx.unk img { filter: brightness(0) opacity(.4); }
.cx.unk { color: #6a5d4c; }
.feat { display: flex; align-items: center; gap: 12px; background: linear-gradient(180deg, #22152f, #130b1b); border: 1px solid #4a3418; border-radius: 4px; padding: 10px 14px; }
.feat .ck { width: 32px; height: 32px; transform: rotate(45deg); display: grid; place-items: center; background: #0c0612; border: 1px solid #4a3418; font-weight: 900; color: #6a5d4c; flex: none; }
.feat .ck { font-family: var(--f-hud); }
.feat.on { border-color: #6e4714; }
.feat.on .ck { background: var(--frame); color: #1a0d05; border-color: #ffe9b0; }
.feat b { display: block; font-family: var(--f-goth); font-weight: 700; font-size: 18px; color: var(--gold-hi); }
.feat:not(.on) b { color: var(--parch-dim); }
.feat span { font-size: 13px; color: var(--parch-dim); }

/* eclipse */
.eclipse-hero { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: center; background: linear-gradient(135deg, #0d0614, #2a1640); color: var(--parch); border: 1px solid #6e4714; border-radius: 6px; padding: 18px 22px; }
.sun { width: 180px; height: 180px; border-radius: 50%; background: #000; box-shadow: 0 0 0 6px #000, 0 0 40px 14px #ff3fd0, 0 0 90px 30px #9b5cff; margin: 10px auto; animation: sunpulse 3s ease-in-out infinite alternate; }
@keyframes sunpulse { to { box-shadow: 0 0 0 6px #000, 0 0 60px 20px #ff3fd0, 0 0 120px 44px #9b5cff; } }
.eclipse-hero h3 { margin: 0; font-size: 30px; font-family: var(--f-title); letter-spacing: .14em; color: var(--gold-hi); }
.eclipse-hero p { color: #d0c2a4; font-size: 15px; line-height: 1.45; }
.eclipse-hero p b { color: var(--parch); }
.asc-ctrl { display: flex; align-items: center; gap: 10px; font-family: var(--f-hud); font-weight: 700; font-size: 22px; flex-wrap: wrap; }
.asc-ctrl .n { min-width: 60px; text-align: center; color: var(--gold-hi); }

/* settings */
.toggle-row { display: flex; align-items: center; justify-content: space-between; background: linear-gradient(180deg, #22152f, #130b1b); border: 1px solid #4a3418; border-radius: 4px; padding: 10px 14px; margin-bottom: 8px; gap: 10px; }
.toggle-row b { font-family: var(--f-goth); font-weight: 700; font-size: 18px; color: var(--gold-hi); }
.toggle-row span { font-size: 13px; color: var(--parch-dim); display: block; }
.sw { width: 54px; height: 26px; border-radius: 3px; background: #0c0612; border: 1px solid #4a3418; position: relative; flex: none; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 18px; border-radius: 2px; background: linear-gradient(180deg, #6a5a48, #3a3026); box-shadow: 0 1px 0 #000; transition: left .15s, background .15s; }
.sw.on { border-color: #c8953a; background: rgba(217, 169, 68, .18); }
.sw.on::after { left: 29px; background: var(--frame); }
input[type=range] { accent-color: var(--gold); }
textarea.save { width: 100%; height: 90px; border-radius: 3px; border: 1px solid #4a3418; background: #0c0612; color: var(--parch); padding: 8px; font-family: monospace; font-size: 11px; resize: none; user-select: text; -webkit-user-select: text; }
select.sel { border-radius: 3px; padding: 6px 12px; border: 1px solid #6e4714; font-family: var(--f-hud); font-weight: 600; font-size: 14px; letter-spacing: .04em; color: var(--parch); background: #170d21; }

/* modal */
#modal { position: absolute; inset: 0; display: none; place-items: center; background: rgba(4, 0, 8, .7); }
#modal.open { display: grid; pointer-events: auto; }
.mbox { width: min(560px, 92vw); background: var(--panel-bg); color: var(--parch); border-radius: 6px; border: 1px solid #c8953a; box-shadow: 0 0 0 3px #0a0510, 0 0 0 4px #6e4714, var(--shadow); overflow: hidden; animation: tarotin .45s cubic-bezier(.2, .8, .3, 1) both; }
.mbox .hd { padding: 12px 22px; background: linear-gradient(180deg, #2c1a3e, #150c1f); border-bottom: 1px solid #6e4714; color: var(--gold-hi); font-family: var(--f-goth); font-weight: 700; font-size: 28px; }
.mbox .bd { padding: 16px 22px; font-size: 16px; line-height: 1.5; color: #d9cbad; }
.mbox .bd b { color: var(--parch); }
.mbox .ft { padding: 0 22px 18px; display: flex; gap: 10px; justify-content: flex-end; }
.away-t { font-family: var(--f-goth); font-weight: 900; font-size: 52px; text-align: center; color: var(--gold-hi); text-shadow: 0 3px 0 #000; }

#tip { position: absolute; z-index: 30; max-width: 280px; background: #0c0612; color: var(--parch); border: 1px solid #6e4714; border-radius: 3px; padding: 8px 12px; font-size: 13px; line-height: 1.35; display: none; box-shadow: var(--shadow); }

/* ---------- title (Limbo) ---------- */
#title { position: fixed; inset: 0; background: #000; display: flex; align-items: center; justify-content: center; z-index: 50; transition: opacity 1.2s ease; cursor: pointer; }
#title.gone { opacity: 0; pointer-events: none; }
.title-art { position: absolute; inset: 0; background: url('../assets/sprites/keyart.jpg') center 40% / cover no-repeat; filter: saturate(1.15) brightness(.85); animation: kb 30s ease-in-out infinite alternate; }
@keyframes kb { from { transform: scale(1.05); } to { transform: scale(1.14) translateY(-1.5%); } }
#title::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, transparent 30%, rgba(0, 0, 0, .85) 80%), linear-gradient(180deg, rgba(0, 0, 0, .55), transparent 30%, transparent 60%, rgba(0, 0, 0, .9)); }
.title-grain { position: absolute; inset: -50%; z-index: 2; opacity: .12; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); animation: grain .4s steps(4) infinite; }
@keyframes grain { 0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -1%); } }
.title-inner { position: relative; z-index: 3; text-align: center; margin-top: -18vh; padding: 40px 80px; }
.title-inner::before { content: ''; position: absolute; inset: -20px -120px; z-index: -1; background: radial-gradient(ellipse at center, rgba(0, 0, 0, .72), rgba(0, 0, 0, .45) 45%, transparent 70%); }
.title-name { font-family: var(--f-title); font-weight: 400; font-size: clamp(48px, 9vw, 120px); letter-spacing: .32em; color: #f4f4f4; text-shadow: 0 0 30px rgba(255, 63, 208, .45), 0 4px 30px #000; padding-left: .32em; }
.title-sub { font-family: var(--f-title); font-size: 16px; letter-spacing: .6em; color: #cfc6dd; margin-top: 8px; text-transform: uppercase; }
.title-load { width: 260px; height: 2px; background: #ffffff22; margin: 40px auto 0; }
.title-bar { width: 0; height: 100%; background: #fff; transition: width .2s; }
.title-press { margin-top: 16px; font-family: var(--f-title); letter-spacing: .5em; font-size: 14px; color: #ddd; text-transform: uppercase; animation: blink 2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* ---------- gothic ornament kit (Codex art) ---------- */
.pbub .orn { position: absolute; inset: -15px; background: url('../assets/sprites/kit_ring.webp') center / contain no-repeat; pointer-events: none; z-index: 2; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .7)); }
.pbub .lv { z-index: 3; }
.pbub .ring { box-shadow: 0 0 0 2px #000, 0 10px 20px rgba(0, 0, 0, .6); }
.ov-title { isolation: isolate; background: none; border: 0; box-shadow: none; padding: 16px 64px 18px; }
.ov-title::before { content: ''; position: absolute; inset: 14px 30px; background: linear-gradient(180deg, rgba(30, 18, 44, .96), rgba(10, 5, 16, .96)); z-index: -1; }
.ov-title::after { content: ''; position: absolute; inset: 0; background: url('../assets/sprites/kit_plaque.webp') center / 100% 100% no-repeat; pointer-events: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .6)); }
.ov-title { position: relative; }
.event-card h3::after { content: ''; display: block; height: 18px; margin: 4px 0 2px; background: url('../assets/sprites/kit_divider.webp') left center / auto 100% no-repeat; }
#panel::before, #panel::after { content: ''; position: absolute; width: 86px; height: 86px; background: url('../assets/sprites/kit_corner.webp') center / contain no-repeat; pointer-events: none; z-index: 4; bottom: 4px; opacity: .9; }
#panel::before { left: 4px; transform: scaleY(-1); }
#panel::after { right: 4px; transform: rotate(180deg); }
.summary, .mbox { position: relative; }

/* ---------- card states: entrance pinning + "can't afford" stamp ---------- */
.card.in, #overlay.static .card { animation: none; }
.card.deny, #overlay.static .card.deny { animation: cardshake .42s ease; }
.card.deny::after { content: "✕"; position: absolute; left: 50%; top: 14px; transform: translateX(-50%); font: 900 104px/1 var(--f-ui); color: var(--red); text-shadow: 0 5px 0 #5c0614, 0 0 24px rgba(0, 0, 0, .6); pointer-events: none; animation: xstamp .32s cubic-bezier(.2, 1.7, .4, 1) both; background: none; opacity: 1; inset: auto; z-index: 3; }
.card.deny .cimg img { filter: grayscale(1) brightness(.6); }
.card.deny .cfoot { color: var(--red); font-size: 15px; }
@keyframes cardshake { 0%, 100% { transform: none; } 20% { transform: translateX(-9px) rotate(-2deg); } 40% { transform: translateX(9px) rotate(2deg); } 60% { transform: translateX(-5px) rotate(-1deg); } 80% { transform: translateX(5px); } }
@keyframes xstamp { from { opacity: 0; transform: translateX(-50%) scale(1.8); } to { opacity: 1; transform: translateX(-50%) scale(1); } }

@media (max-width: 900px) {
  .depth-big { font-size: 42px; } .cash { font-size: 36px; } .card { width: 170px; min-height: 240px; } .card.tarot { width: 160px; } .card .cimg { width: 80px; height: 80px; }
  .hero-row { grid-template-columns: 110px 1fr; } .hero-row .hside { grid-column: 1 / -1; } .hero-art { width: 110px; height: 130px; }
  .gear-wrap { grid-template-columns: 1fr; } #hud-bl { width: 200px; } .radar { height: 120px; } .pbub { width: 66px; height: 66px; }
  .event-card { grid-template-columns: 1fr; } .event-card img { margin: 0 auto; }
}
