/* Player tablet view (/). Read at a distance: large type, high contrast.
   Ported from legacy index.html + style.css + inline styles in src/app.js. */
html, body { height: 100%; margin: 0; overflow: hidden; }
body.player { background: var(--night); color: var(--on-night); font-family: var(--font-display); }

#scene-bg {
  position: fixed; inset: 0; z-index: 0;
  background: var(--night) url("/images/background.jpg") no-repeat center / cover;
  transition: background-image 2s ease, filter 2.5s ease;
}
#scene-bg.dawn { filter: sepia(.3) brightness(.65) hue-rotate(-10deg); }
#scene-bg.dusk { filter: sepia(.4) brightness(.7) hue-rotate(12deg); }
#scene-bg.night { filter: brightness(.3) saturate(.5); }
#scene-bg::after { content: ""; position: fixed; inset: auto 0 0 0; height: 28%; background: linear-gradient(transparent, rgba(0,0,0,.6)); pointer-events: none; }

#weather { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.rain-drop { position: absolute; top: -80px; width: 2px; border-radius: 1px; background: linear-gradient(transparent, rgba(174,194,224,.75)); animation: rain-fall linear infinite; }
@keyframes rain-fall { to { transform: translateY(115vh) translateX(22px); } }
.snow-flake { position: absolute; top: -12px; border-radius: 50%; background: rgba(255,255,255,.88); animation: snow-fall linear infinite; }
@keyframes snow-fall { 0% { transform: translateY(0); opacity: 0 } 8% { opacity: .9 } 92% { opacity: .7 } 100% { transform: translateY(112vh) translateX(var(--drift, 40px)); opacity: 0 } }
.fog-layer { position: absolute; border-radius: 50%; background: radial-gradient(ellipse, rgba(200,212,220,.38) 0%, transparent 68%); animation: fog-drift linear infinite; }
@keyframes fog-drift { 0% { transform: translateX(-15%) translateY(var(--ydrift, 0%)); opacity: 0 } 18% { opacity: 1 } 82% { opacity: .7 } 100% { transform: translateX(115%) translateY(var(--ydrift, 0%)); opacity: 0 } }
.sand { position: absolute; border-radius: 2px; animation: sand-blow linear infinite; }
@keyframes sand-blow { from { transform: translateX(-8vw); opacity: 0 } 8% { opacity: .85 } 92% { opacity: .6 } to { transform: translateX(112vw); opacity: 0 } }
.weather-tint { position: absolute; inset: 0; }
.flash { position: absolute; inset: 0; background: rgba(255,255,255,.88); }

/* Location label sits at the top so it never collides with the win text at the bottom. */
#location {
  position: fixed; top: 3vh; left: 50%; transform: translateX(-50%); z-index: 3;
  font-size: clamp(20px, 2.6vw, 34px); color: #fff5d8; letter-spacing: .1em; white-space: nowrap; max-width: 85vw; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 8px rgba(0,0,0,.9); background: rgba(0,0,0,.5); padding: 8px 28px; border-radius: var(--radius-pill);
  border: 1px solid rgba(255,220,150,.2); opacity: 0; transition: opacity 1.8s ease; pointer-events: none;
}
#location.visible { opacity: 1; }

/* ── Slot machine ── */
.slots { position: relative; z-index: 10; height: 100%; display: flex; align-items: center; justify-content: center; }
.slot { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8vw; width: min(50vw, 980px); height: 75vh; }
@media (max-width: 1100px) { .slot { width: 72vw; } }
@media (orientation: portrait) { .slot { width: 92vw; height: 60vh; } }
.reel {
  position: relative; display: grid; grid-template-rows: repeat(3, 1fr); height: 100%; min-width: 0; padding: 0 4px; overflow: hidden;
  border-radius: var(--radius-l); border: 2px solid var(--line); perspective: 900px; transform-style: preserve-3d;
  background:
    radial-gradient(ellipse 100% 55% at 50% 50%, transparent 50%, rgba(80,60,30,.45) 100%),
    radial-gradient(120% 90% at 50% 30%, rgba(248,240,225,.9) 0%, rgba(235,225,210,.92) 60%, rgba(225,215,200,.95) 100%);
  box-shadow: inset 0 2px 20px rgba(200,180,150,.3), 0 4px 16px rgba(139,117,83,.2);
}
.reel::before {
  content: ""; position: absolute; inset: 0; z-index: 20; pointer-events: none; border-radius: var(--radius-l);
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.06) 40%, rgba(255,255,255,.14) 43%, rgba(255,255,255,.06) 46%, transparent 56%);
  animation: glare 5s ease-in-out infinite; animation-delay: var(--glare-delay, 0s);
}
.reel:nth-child(2) { --glare-delay: 1.8s; }
.reel:nth-child(3) { --glare-delay: 3.3s; }
@keyframes glare { 0%, 65% { transform: translateX(-120%); } 90%, 100% { transform: translateX(220%); } }
.cell { position: relative; overflow: hidden; min-height: 0; border-radius: 14px; }
.cell img {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  max-width: 98%; max-height: 98%; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(0,0,0,.35));
}
.cell.top, .cell.bot { opacity: .6; filter: brightness(.7); }
.cell.top { transform: perspective(1200px) rotateX(25deg) scale(.95); transform-origin: center bottom; }
.cell.bot { transform: perspective(1200px) rotateX(-25deg) scale(.95); transform-origin: center top; }
.cell.mid { border: 2px solid rgba(210,165,60,.75); box-shadow: 0 0 0 1px rgba(255,220,100,.25), 0 4px 20px rgba(180,130,40,.2); }
.cell.mid.win-pulse { border-color: rgba(255,210,60,1); animation: mid-win 0.8s ease-in-out 3; }
@keyframes mid-win { 0%, 100% { box-shadow: 0 0 0 3px rgba(255,210,60,.4), 0 0 24px 4px rgba(255,190,30,.35); } 50% { box-shadow: 0 0 0 5px rgba(255,220,80,.7), 0 0 40px 10px rgba(255,200,50,.6); } }
.reel.spinning .cell img { filter: blur(3px) drop-shadow(0 10px 14px rgba(0,0,0,.35)); }
.reel.spinning.slow .cell img { filter: blur(1.5px); }
.particle { position: fixed; border-radius: 50%; pointer-events: none; z-index: 9999; transform: translate(-50%,-50%); animation: particle-out .8s ease-out forwards; }
@keyframes particle-out { to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.2); opacity: 0; } }

/* Win text: tier colors are visible now (legacy suppressed them with !important). */
#win {
  position: fixed; bottom: 3vh; left: 50%; transform: translateX(-50%); z-index: 100; max-width: 90vw; text-align: center;
  font-size: clamp(32px, 5vh, 56px); padding: 12px 28px; border-radius: var(--radius-l); border: 3px solid var(--line);
  color: var(--ink); background: rgba(255,248,220,.94); box-shadow: 0 6px 24px rgba(0,0,0,.35);
}
#win:empty { display: none; }
#win:not(:empty) { animation: win-reveal .55s cubic-bezier(.22,1,.36,1); }
@keyframes win-reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
#win.tier-silber { color: #3e3e4e; border-color: #9a9ab0; background: linear-gradient(135deg, #e6e6f0, #cfcfe0); }
#win.tier-gold { color: #5e4a08; border-color: #c8a632; background: linear-gradient(135deg, #fff8b4, #ffe98c); }
#win.tier-ingredient { color: #22501a; border-color: #5c9a3a; background: linear-gradient(135deg, #dcf5d2, #c4ebb6); }
#win.tier-potion { color: #45166a; border-color: #8a4cc0; background: linear-gradient(135deg, #ecd8fa, #dcc8f5); }
#win.tier-magicItem { color: #64200e; border-color: #c0502a; background: linear-gradient(135deg, #ffe2c8, #ffd0b0); box-shadow: 0 4px 24px rgba(255,150,50,.5); }

/* ── Dashboard (image / handout) ── */
#dashboard {
  position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--night) url("/images/background.jpg") no-repeat center / cover;
}
#dashboard .img-only { max-width: 100vw; max-height: 100vh; object-fit: contain; }
#dashboard .img-hidden { display: flex; flex-direction: column; align-items: center; gap: 3vh; }
#dashboard .img-hidden img { max-width: 90vw; max-height: 78vh; object-fit: contain; filter: drop-shadow(0 0 20px rgba(0,0,0,.8)); }
#dashboard .title { margin: 0; font-size: clamp(44px, 5.5vw, 80px); text-align: center; max-width: 90vw; text-shadow: 3px 3px 6px rgba(0,0,0,.9), 0 0 30px rgba(0,0,0,.5); }
#dashboard .rarity-common { color: var(--rarity-common-glow); }
#dashboard .rarity-uncommon { color: var(--rarity-uncommon-glow); }
#dashboard .rarity-rare { color: var(--rarity-rare-glow); }
#dashboard .rarity-very-rare { color: var(--rarity-very-rare-glow); }
#dashboard .rarity-none { color: var(--gold); }
#dashboard .full { display: flex; gap: 4vw; width: 100%; max-width: 1600px; height: 100%; padding: 0 3vw; }
#dashboard .full > div { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
#dashboard .full img { max-width: 100%; max-height: 85vh; object-fit: contain; align-self: center; }
#dashboard .text { max-height: 85vh; overflow-y: auto; padding: 2vh 1vw; }
/* Description on a parchment card instead of black text with white glow over the photo. */
#dashboard .desc { color: var(--ink); background: rgba(255,248,235,.92); border-radius: var(--radius-l); padding: 2vh 2vw; font-family: var(--font-body); font-size: clamp(22px, 2.2vw, 34px); line-height: 1.6; }
@media (max-width: 900px), (orientation: portrait) { #dashboard .full { flex-direction: column; padding: 3vh 4vw; overflow-y: auto; } }
#handout {
  max-width: min(920px, 92vw); max-height: 88vh; overflow-y: auto; padding: clamp(24px, 4vw, 52px);
  background: linear-gradient(160deg, #f7ecd2, #efdfba); border: 3px solid #8b7355; border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0,0,0,.75), inset 0 0 60px rgba(139,115,85,.25);
  color: #3a2818; font-size: clamp(22px, 2vw, 32px); line-height: 1.7;
}
#handout h1 { margin: 0 0 20px; color: #3d2010; font-size: clamp(32px, 3.6vw, 52px); text-align: center; border-bottom: 3px double rgba(90,60,30,.4); padding-bottom: 14px; }
#handout h2, #handout h3 { color: #3d2010; }
#handout blockquote { margin: .8em 0 .8em 1.4em; font-style: italic; color: #5a4030; }

/* ── Quest board ── */
/* Above the image dashboard (9999), below combat (10500) and corruption (11000). */
#quest-board { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; background: rgba(8,5,2,.76); opacity: 0; pointer-events: none; transition: opacity .55s ease; }
#quest-board.visible { opacity: 1; pointer-events: auto; }
.board { position: relative; width: min(92vw, 1080px); max-height: 88vh; overflow-y: auto; padding: 28px; background: #a0783a; border: 6px solid #4a2e0e; border-radius: 6px; box-shadow: 0 24px 64px rgba(0,0,0,.75), inset 0 0 50px rgba(0,0,0,.25); }
.board h2 { text-align: center; font-size: clamp(30px, 3vw, 42px); color: var(--gold); text-shadow: 2px 2px 5px rgba(0,0,0,.65); margin: 0 0 22px; padding-bottom: 14px; border-bottom: 3px double rgba(245,217,138,.4); }
.board-close { position: absolute; top: 18px; right: 20px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(0,0,0,.35); color: var(--gold); font-size: 24px; cursor: pointer; }
.quest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.quest-card { position: relative; padding: 18px 20px; background: #f5e8c8; border-radius: 3px; border: 1px solid rgba(90, 60, 30, .25); box-shadow: 3px 4px 12px rgba(0,0,0,.45); transform: rotate(var(--rot, -1deg)); color: #3d2010; }
.quest-card.main { background: #fde9a8; }
.quest-card.personal { background: #dcefe6; }
.quest-card::before { content: ""; position: absolute; top: -9px; left: 50%; transform: translateX(-50%); width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 38% 34%, #ff7070, #cc0000); box-shadow: 0 2px 5px rgba(0,0,0,.55); }
.quest-type { font-family: var(--font-body); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #5a3a1a; margin-bottom: 8px; }
.quest-name { font-size: 22px; margin-bottom: 8px; line-height: 1.3; }
.quest-desc { font-family: var(--font-body); font-size: 17px; color: #4a3424; line-height: 1.5; }
.quest-giver { font-family: var(--font-body); font-size: 15px; color: #6a4434; margin-top: 10px; font-style: italic; }

/* ── Character toast ── */
#toast { position: fixed; bottom: 28px; right: 28px; z-index: 10100; width: min(400px, 90vw); padding: 20px; background: rgba(18,12,4,.95); border: 2px solid rgba(201,169,97,.55); border-radius: var(--radius-l); box-shadow: 0 10px 36px rgba(0,0,0,.75); transform: translateX(130%); transition: transform .5s cubic-bezier(.25, 1, .5, 1); }
#toast.visible { transform: translateX(0); }
#toast .x { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: rgba(255,255,255,.6); font-size: 22px; cursor: pointer; padding: 4px 8px; }
.toast-inner { display: flex; gap: 16px; align-items: flex-start; }
.toast-portrait { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; flex-shrink: 0; border: 2px solid rgba(201,169,97,.4); }
.toast-ph { width: 72px; height: 72px; border-radius: 8px; flex-shrink: 0; display: grid; place-items: center; font-size: 30px; background: rgba(201,169,97,.12); border: 2px solid rgba(201,169,97,.3); color: var(--gold); }
.toast-name { font-size: 24px; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast-class, .toast-stats { font-family: var(--font-body); font-size: 15px; color: rgba(255,255,255,.75); }
.toast-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.toast-stats strong { color: #fff; }
.hp-wrap { height: 10px; background: rgba(255,255,255,.12); border-radius: 5px; overflow: hidden; margin-top: 8px; }
.hp-bar { height: 100%; border-radius: 5px; transition: width .6s ease, background .3s; }
.cond { display: inline-block; font-family: var(--font-body); font-size: 13px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: rgba(200,70,70,.3); color: #ffc0b4; border: 1px solid rgba(200,70,70,.5); text-transform: uppercase; letter-spacing: .04em; margin: 6px 4px 0 0; }
.cond.buff { background: rgba(90,140,255,.25); color: #c4d8ff; border-color: rgba(90,140,255,.45); }

/* ── Combat overlay (legacy app.js:871-930) ── */
#combat { position: fixed; inset: 0; z-index: 10500; display: none; flex-direction: column; overflow: hidden; padding: clamp(10px,2vh,24px) clamp(12px,3vw,40px); background: radial-gradient(ellipse at top, var(--night-2) 0%, var(--night) 70%); color: var(--on-night); }
#combat.active { display: flex; }
.cfs-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 1.2vh; border-bottom: 2px solid rgba(240,192,96,.35); }
.cfs-title { font-size: clamp(26px, 4.5vw, 46px); color: #f0c060; letter-spacing: .08em; }
.cfs-round { font-size: clamp(20px, 3.5vw, 34px); color: #ffe0a0; background: rgba(180,140,60,.22); border: 2px solid rgba(180,140,60,.45); padding: 4px 18px; border-radius: var(--radius-pill); }
.cfs-hero { margin: 1.6vh 0; padding: clamp(10px,2vh,22px) clamp(14px,2.5vw,28px); border: 3px solid rgba(240,192,96,.65); border-radius: 18px; background: linear-gradient(135deg, rgba(240,192,96,.16), rgba(180,120,40,.1)); }
.cfs-label { font-family: var(--font-body); font-size: clamp(14px,1.8vw,18px); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #f0c060; }
.cfs-hero-flex { display: flex; align-items: center; gap: clamp(12px,2vw,24px); }
.cfs-hero-avatar { width: clamp(70px,13vmin,130px); height: clamp(70px,13vmin,130px); border-radius: 16px; object-fit: cover; border: 3px solid rgba(240,192,96,.75); flex-shrink: 0; }
.cfs-hero-name { font-size: clamp(32px,6vw,60px); line-height: 1.1; color: #fff5dc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cfs-sub { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 6px; font-family: var(--font-body); font-size: clamp(17px,2.6vw,24px); color: rgba(255,240,210,.9); }
.cfs-next { font-family: var(--font-body); font-size: clamp(15px,2.2vw,20px); color: rgba(255,240,210,.75); margin-top: 8px; }
.cfs-list { flex: 1; overflow-y: auto; display: grid; align-content: start; gap: clamp(5px,1vh,10px); }
.cfs-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: clamp(10px,2vw,20px); padding: clamp(7px,1.4vh,14px) clamp(10px,2vw,20px); border-radius: 14px; background: rgba(255,245,220,.06); border: 2px solid rgba(255,245,220,.12); }
.cfs-row.current { background: rgba(240,192,96,.16); border-color: rgba(240,192,96,.75); }
.cfs-row.defeated { opacity: .4; }
.cfs-row.defeated .cfs-name { text-decoration: line-through; }
.cfs-avatar { width: clamp(36px,6vw,58px); height: clamp(36px,6vw,58px); border-radius: 50%; object-fit: cover; border: 2px solid rgba(240,192,96,.4); background: rgba(0,0,0,.4); display: grid; place-items: center; font-size: clamp(18px,3vw,28px); color: #f0c060; }
.cfs-name { font-size: clamp(20px,3.4vw,34px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cfs-init { font-family: var(--font-body); font-size: clamp(15px,2.4vw,22px); font-weight: 800; color: #f0c060; background: rgba(180,140,60,.25); border: 1px solid rgba(180,140,60,.4); border-radius: 10px; padding: 3px 12px; }
.cfs-hpline { grid-column: 2 / 4; display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.cfs-bar-wrap { position: relative; flex: 1; height: clamp(10px,1.8vh,16px); background: rgba(255,255,255,.12); border-radius: var(--radius-pill); overflow: hidden; }
.cfs-bar { height: 100%; border-radius: var(--radius-pill); transition: width .5s ease, background .4s; }
.cfs-tbar { position: absolute; top: 0; height: 100%; background: rgba(90,140,255,.8); }
.cfs-hptext { font-family: var(--font-body); font-size: clamp(15px,2.4vw,22px); font-weight: 700; white-space: nowrap; }
.cfs-conds { grid-column: 2 / 4; }

/* ── Corruption level-up: legacy app.js:1012-1080 (styles kept, moved from JS) ── */
#corruption { position: fixed; inset: 0; z-index: 11000; display: none; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; opacity: 0; transition: opacity .7s ease;
  background: radial-gradient(ellipse at center, var(--cfx-bg1, rgba(30,8,40,.94)) 0%, var(--cfx-bg2, rgba(5,2,10,.99)) 75%); }
#corruption.visible { display: flex; opacity: 1; }
#corruption.fading { opacity: 0; }
#corruption::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 var(--cfx-vig, 28vmin) var(--cfx-vig-col, rgba(0,0,0,.95)); animation: cfx-breathe var(--cfx-breathe, 5s) ease-in-out infinite; }
@keyframes cfx-breathe { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
.cfx-particle { position: absolute; bottom: -14px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, var(--cfx-p1, rgba(170,60,220,.8)), var(--cfx-p2, rgba(60,200,200,.15)) 70%, transparent); animation: cfx-rise linear infinite; }
@keyframes cfx-rise { 0% { transform: translateY(0) scale(1); opacity: 0; } 12% { opacity: .85; } 85% { opacity: .4; } 100% { transform: translateY(-108vh) translateX(var(--sway, 30px)) scale(.4); opacity: 0; } }
.cfx-wrap { position: relative; width: clamp(160px,28vmin,300px); height: clamp(160px,28vmin,300px); margin-bottom: clamp(14px,3vh,30px); animation: cfx-throb var(--cfx-throb, 2.4s) ease-in-out infinite; }
@keyframes cfx-throb { 0%, 100% { transform: scale(1); } 50% { transform: scale(var(--cfx-throb-scale, 1.045)); } }
.cfx-ring { position: absolute; inset: -14px; border-radius: 50%; background: conic-gradient(from 0deg, #7a2aa0, #30c8c8, #2a1040, #a030c0, #106060, #7a2aa0); animation: cfx-spin var(--cfx-ring-speed, 7s) linear infinite; filter: blur(1.5px) var(--cfx-ring-fx, hue-rotate(0deg));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 11px), #000 calc(100% - 9px)); mask: radial-gradient(farthest-side, transparent calc(100% - 11px), #000 calc(100% - 9px)); }
@keyframes cfx-spin { to { transform: rotate(360deg); } }
.cfx-portrait { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; background: #16081e; border: 3px solid var(--cfx-border, rgba(160,60,200,.7)); box-shadow: 0 0 60px var(--cfx-glow, rgba(140,40,190,.55)), inset 0 0 40px rgba(20,0,30,.8); }
.cfx-portrait img, .cfx-fallback { width: 100%; height: 100%; object-fit: cover; }
.cfx-fallback { display: grid; place-items: center; font-size: clamp(70px,13vmin,130px); color: var(--cfx-accent, #c060e8); }
.cfx-title { font-family: var(--font-body); font-size: clamp(16px,2.6vmin,24px); font-weight: 800; letter-spacing: .5em; text-indent: .5em; text-transform: uppercase; color: var(--cfx-accent, #b060d0); text-shadow: 0 0 24px var(--cfx-glow); animation: cfx-flicker var(--cfx-flicker, 3.1s) infinite; }
@keyframes cfx-flicker { 0%, 88%, 100% { opacity: 1; } 91% { opacity: .45; } 94% { opacity: .95; } 96% { opacity: .6; } }
.cfx-name { font-size: clamp(30px,6vmin,58px); color: #efe0f8; margin: 6px 0 2px; text-align: center; max-width: 90vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 3px 20px rgba(0,0,0,.95); }
.cfx-level { font-size: clamp(40px,9vmin,92px); color: var(--cfx-accent, #c060e8); text-shadow: 0 0 40px var(--cfx-glow); animation: cfx-throb var(--cfx-throb, 2.4s) ease-in-out infinite; }
.cfx-stage { font-family: var(--font-body); font-size: clamp(16px,2.8vmin,26px); font-weight: 700; font-style: italic; letter-spacing: .24em; text-transform: uppercase; color: var(--cfx-accent, #b060d0); margin-top: 4px; text-align: center; }
.cfx-sub { font-family: var(--font-body); font-size: clamp(16px,2.6vmin,24px); color: rgba(225,200,245,.85); margin-top: clamp(8px,2vh,20px); font-style: italic; text-align: center; max-width: 84vw; }
.cfx-pips { display: flex; gap: clamp(5px,1vmin,10px); margin-top: clamp(10px,2.4vh,24px); }
.cfx-pip { width: clamp(14px,2.6vmin,26px); height: clamp(14px,2.6vmin,26px); border-radius: 50%; border: 2px solid rgba(160,60,200,.55); background: rgba(30,10,45,.7); }
.cfx-pip.filled { background: radial-gradient(circle at 35% 30%, var(--cfx-accent, #c060e8), var(--cfx-accent-dark, #5a1a80)); box-shadow: 0 0 14px var(--cfx-glow); }
@keyframes cfx-jitter { 0%, 100% { transform: translate(0,0); } 25% { transform: translate(1.6px,-1.2px); } 50% { transform: translate(-1.8px,1px); } 75% { transform: translate(1.2px,1.6px); } }
#corruption.severe .cfx-portrait { animation: cfx-jitter .46s steps(2, end) infinite; }
#corruption.death { background: radial-gradient(ellipse at center, rgba(45,5,10,.96) 0%, rgba(8,1,2,1) 75%); }
#corruption.death .cfx-ring { background: conic-gradient(from 0deg, #801020, #300508, #c02030, #1a0204, #801020); }
#corruption.death .cfx-title, #corruption.death .cfx-level, #corruption.death .cfx-stage { color: #e04050; }

/* ── Chrome: fullscreen button + connection dot ── */
#fs-btn { position: fixed; top: 14px; right: 14px; z-index: 12000; width: 56px; height: 56px; border-radius: 14px; border: 2px solid rgba(180,150,100,.7); background: linear-gradient(135deg, #f5e6cd, #e1c8a5); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: opacity .3s ease; }
#fs-btn.hidden { opacity: 0; pointer-events: none; }
#conn { position: fixed; left: 14px; bottom: 14px; z-index: 12000; display: flex; align-items: center; gap: 8px; font-family: var(--font-body); font-size: 15px; color: #fff; background: rgba(0,0,0,.6); padding: 6px 12px; border-radius: var(--radius-pill); }
#conn::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--warn); }
#conn[data-state="open"] { opacity: 0; transition: opacity 2s ease 3s; }
#conn[data-state="open"]::before { background: #3fb950; }
#conn[data-state="closed"]::before { background: #f85149; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
