/* Wake the Sun — night-and-ember interface */
@font-face { font-family: 'Fraunces'; src: url('fonts/fraunces.woff2') format('woff2'); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('fonts/fraunces-italic.woff2') format('woff2'); font-weight: 300 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('fonts/outfit.woff2') format('woff2'); font-weight: 300 700; font-style: normal; font-display: swap; }

:root {
  --night0: #04061a; --night1: #0a0e2c; --night2: #121841; --night3: #1c2459;
  --ink: #f7ecd4; --dim: #9aa1cc; --faint: #666d9c;
  --amber: #ffb347; --gold: #ffd98a; --ember: #ff7a3d; --rose: #ff8fb0; --dust: #9fd8ff; --violet: #b69cff; --green: #8fe6a8;
  --glass: rgba(9, 13, 40, 0.74); --glass2: rgba(20, 26, 68, 0.6); --line: rgba(255, 217, 138, 0.14); --line2: rgba(255, 217, 138, 0.3);
  --r: 16px;
  --serif: 'Fraunces', Georgia, serif; --sans: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
html, body { margin: 0; height: 100%; background: var(--night0); color: var(--ink); font-family: var(--sans); overflow: hidden; overscroll-behavior: none; -webkit-font-smoothing: antialiased; }
body { touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input { font: inherit; }
.hidden { display: none !important; }
.dim { color: var(--dim); font-weight: 400; } .small { font-size: 12px; }
.col { display: flex; flex-direction: column; min-width: 0; }
img.ic { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
img.ic.inl { width: 1.25em; height: 1.25em; vertical-align: -0.28em; }

/* boot splash */
#wts-boot { position: fixed; inset: 0; z-index: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: radial-gradient(circle at 50% 55%, #1a1440 0%, var(--night0) 60%); transition: opacity 0.9s ease; }
#wts-boot.gone { opacity: 0; pointer-events: none; }
.wts-boot-ember { width: 18px; height: 18px; border-radius: 50%; background: #ffd98a; box-shadow: 0 0 18px 8px rgba(255, 150, 60, 0.8), 0 0 70px 30px rgba(255, 110, 40, 0.35); animation: emberPulse 1.6s ease-in-out infinite; }
.wts-boot-text { font-family: var(--serif); font-style: italic; letter-spacing: 0.3em; color: var(--gold); opacity: 0.8; font-size: 15px; }
@keyframes emberPulse { 0%, 100% { transform: scale(0.85); opacity: 0.75; } 50% { transform: scale(1.15); opacity: 1; } }

#wts-app { position: fixed; inset: 0; }
#wts-scene { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; cursor: pointer; touch-action: none; }

/* ------------------------------------------------------------------ shared controls */
.btn { padding: 10px 18px; border-radius: 999px; background: var(--glass2); border: 1px solid var(--line2); color: var(--ink); font-weight: 500; letter-spacing: 0.02em; transition: transform 0.12s, background 0.2s, box-shadow 0.2s, opacity 0.2s; white-space: nowrap; }
.btn:hover { background: rgba(40, 48, 110, 0.8); box-shadow: 0 0 18px rgba(255, 179, 71, 0.18); }
.btn:active { transform: scale(0.96); }
.btn.primary { background: linear-gradient(180deg, #ffc76a, #ff9838); color: #2a1404; border-color: #ffe2a8; font-weight: 600; box-shadow: 0 0 24px rgba(255, 150, 60, 0.4); }
.btn.primary:hover { background: linear-gradient(180deg, #ffd58a, #ffa64a); box-shadow: 0 0 34px rgba(255, 150, 60, 0.6); }
.btn.big { padding: 13px 26px; font-size: 17px; } .btn.wide { width: 100%; }
.btn.small { padding: 6px 12px; font-size: 12.5px; opacity: 0.75; }
.btn.small.can { opacity: 1; border-color: var(--amber); color: var(--gold); }
.btn.ember { opacity: 0.6; } .btn.ember.can { opacity: 1; border-color: var(--ember); color: #ffd0b0; }
.btn.ember.glow { background: linear-gradient(180deg, #ff9a5a, #e2511f); color: #fff; box-shadow: 0 0 26px rgba(255, 110, 50, 0.6); animation: breathe 1.8s ease-in-out infinite; }
.linkbtn { color: var(--dim); text-decoration: underline; font-size: 12.5px; margin-top: 10px; align-self: flex-start; }
.inp { background: rgba(4, 6, 26, 0.7); border: 1px solid var(--line2); color: var(--ink); border-radius: 12px; padding: 10px 14px; outline: none; min-width: 0; user-select: text; -webkit-user-select: text; }
.inp:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.15); }
.inp.shake { animation: shake 0.4s; }
.codechip { font-family: var(--sans); font-weight: 600; letter-spacing: 0.16em; background: rgba(255, 179, 71, 0.12); color: var(--gold); border: 1px solid var(--line2); border-radius: 8px; padding: 2px 8px; font-size: 12.5px; }
.codechip.big { font-size: 15px; padding: 5px 12px; } .codechip .copy { opacity: 0.6; letter-spacing: 0; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes breathe { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.22); } }
.logo-mark { width: 74px; height: 74px; background: url('art/logo.png') center/contain no-repeat; filter: drop-shadow(0 0 18px rgba(255, 150, 60, 0.7)); }
.logo-mark.small { width: 30px; height: 30px; flex: none; }

/* ------------------------------------------------------------------ lobby */
.lobby { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 4vh 16px 40px; box-sizing: border-box; background: radial-gradient(ellipse at 50% 60%, rgba(4, 6, 26, 0.25) 0%, rgba(4, 6, 26, 0.78) 75%); }
.lobby.busy { pointer-events: none; opacity: 0.7; }
@media (min-width: 1100px) { .lobby { justify-content: flex-start; padding-left: 5vw; background: linear-gradient(90deg, rgba(4, 6, 26, 0.82) 0%, rgba(4, 6, 26, 0.55) 45%, rgba(4, 6, 26, 0) 75%); } .lobby-card { width: min(560px, 100%); } }
.lobby-card { width: min(640px, 100%); display: flex; flex-direction: column; gap: 16px; padding: 30px 30px 22px; border-radius: 26px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.lobby-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.title { font-family: var(--serif); font-weight: 600; font-size: clamp(40px, 8vw, 64px); margin: 4px 0 0; letter-spacing: -0.01em; background: linear-gradient(180deg, #fff3cf 20%, #ffb347 70%, #ff7a3d); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 26px rgba(255, 150, 60, 0.45)); line-height: 1.05; }
.tagline { font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--gold); margin: 6px 0 0; }
.sub { color: var(--dim); font-size: 14.5px; line-height: 1.5; max-width: 500px; margin: 8px 0 0; }
.lobby-me { display: flex; align-items: center; gap: 18px; padding: 14px 16px; border-radius: var(--r); background: rgba(4, 6, 26, 0.45); border: 1px solid var(--line); }
.lobby-me .col { gap: 10px; flex: 1; }
.wisp-preview { width: 34px; height: 34px; border-radius: 50%; flex: none; margin: 0 12px; background: radial-gradient(circle, #fff 0%, var(--c) 35%, transparent 70%); box-shadow: 0 0 26px 10px color-mix(in srgb, var(--c) 55%, transparent); animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(-4px); } 50% { transform: translateY(4px); } }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; background: var(--c); opacity: 0.55; transition: transform 0.15s, opacity 0.15s; }
.swatch:hover { opacity: 0.9; transform: scale(1.12); }
.swatch.on { opacity: 1; box-shadow: 0 0 0 2px var(--night0), 0 0 0 4px var(--c), 0 0 16px var(--c); }
.invite { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: var(--r); background: rgba(255, 179, 71, 0.1); border: 1px solid var(--line2); }
.lobby-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lobby-col { display: flex; flex-direction: column; gap: 9px; padding: 14px; border-radius: var(--r); background: rgba(4, 6, 26, 0.35); border: 1px solid var(--line); }
.lobby h3 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 16px; color: var(--gold); }
.inp.code { letter-spacing: 0.3em; text-transform: uppercase; font-weight: 600; text-align: center; }
.lobby-err { min-height: 18px; color: #ff9a8a; font-size: 13.5px; text-align: center; }
.fires-h { margin-top: 2px !important; }
.fires { display: flex; flex-direction: column; gap: 6px; }
.fires-empty { color: var(--faint); font-style: italic; font-size: 14px; padding: 6px 2px; }
.fire { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(4, 6, 26, 0.4); border: 1px solid transparent; text-align: left; transition: border-color 0.2s, background 0.2s; }
.fire:hover { border-color: var(--line2); background: rgba(30, 36, 90, 0.6); }
.fire-dot { width: 9px; height: 9px; border-radius: 50%; background: #444a75; flex: none; }
.fire-dot.on { background: var(--amber); box-shadow: 0 0 10px 3px rgba(255, 150, 60, 0.7); }
.fire-name { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fire-meta { color: var(--dim); font-size: 12.5px; white-space: nowrap; }
.lobby-foot { text-align: center; color: var(--faint); font-size: 12.5px; font-style: italic; font-family: var(--serif); padding-top: 4px; }
/* Shorter windows (most laptops, or a game frame with a bar above it): keep the lobby on one screen. */
.lobby { scrollbar-width: thin; scrollbar-color: rgba(255, 220, 160, 0.22) transparent; }
@media (max-height: 880px) {
  .lobby { padding-top: 2.5vh; padding-bottom: 20px; }
  .lobby-card { gap: 12px; padding-top: 22px; padding-bottom: 16px; }
  .lobby-head .logo-mark { width: 46px; height: 46px; }
  .lobby-head .title { font-size: clamp(36px, 6.5vw, 52px); }
}
@media (max-height: 800px) { .lobby-head .logo-mark { display: none; } }
@media (max-height: 680px) { .lobby-head .sub, .lobby-foot { display: none; } }

/* ------------------------------------------------------------------ game frame */
.game { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.game > * { pointer-events: auto; }
.panel { position: absolute; top: 92px; bottom: 14px; display: flex; flex-direction: column; background: var(--glass); border: 1px solid var(--line); border-radius: 20px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04); overflow: hidden; }
.panel.left { left: 14px; width: 368px; } .panel.right { right: 14px; width: 328px; }

.top { position: absolute; left: 14px; right: 14px; top: 10px; height: 72px; display: grid; grid-template-columns: 368px 1fr 328px; align-items: center; gap: 14px; pointer-events: none; }
.top > * { pointer-events: auto; }
.top-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 19px; color: var(--gold); white-space: nowrap; }
.world { color: var(--dim); font-size: 12.5px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.world:hover { color: var(--gold); border-color: var(--line2); }
.top-r { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.iconbtn { width: 36px; height: 36px; border-radius: 50%; background: var(--glass); border: 1px solid var(--line); font-size: 16px; display: grid; place-items: center; }
.iconbtn:hover { border-color: var(--line2); }
.crewchip { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 8px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); font-weight: 600; }
.crewchip img { width: 24px; height: 24px; }
.netbadge { display: none; font-size: 12px; color: #ffb09a; padding: 4px 10px; border-radius: 999px; background: rgba(120, 30, 20, 0.5); }
.netbadge.show { display: block; animation: breathe 1s infinite; }

.flamebar { justify-self: center; width: min(620px, 100%); text-align: center; padding: 8px 18px 9px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.fb-title { font-family: var(--serif); font-weight: 500; font-size: 17px; color: var(--gold); letter-spacing: 0.02em; }
.fb-track { position: relative; height: 10px; margin: 7px 4px 6px; border-radius: 999px; background: rgba(4, 6, 26, 0.85); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6); }
.fb-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 999px; background: linear-gradient(90deg, #c2381a, #ff7a3d 35%, #ffc64d 80%, #fff3c4); box-shadow: 0 0 14px rgba(255, 150, 60, 0.7); transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.fb-glow { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: radial-gradient(circle, #fff 0%, #ffe07a 40%, transparent 70%); transition: left 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); animation: emberPulse 1.4s infinite; }
.fb-pip { position: absolute; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; transform: rotate(45deg); background: #1b2152; border: 1.5px solid #5c6399; box-sizing: border-box; transition: all 0.4s; }
.fb-pip.done { background: #fff3c4; border-color: #fff; box-shadow: 0 0 10px #ffc64d; }
.fb-end { position: absolute; right: -4px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; border: 2px solid #8a7a52; background: var(--night1); box-sizing: border-box; }
.flamebar.ready .fb-end { background: #fff3c4; border-color: #fff; box-shadow: 0 0 16px 4px #ffc64d; animation: emberPulse 1s infinite; }
.fb-sub { font-size: 12.5px; color: var(--dim); min-height: 16px; }

/* ------------------------------------------------------------------ personal panel */
.res { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 4px; gap: 8px; }
.res-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.res-ic { width: 46px !important; height: 46px !important; flex: none; filter: drop-shadow(0 0 10px rgba(255, 179, 71, 0.6)); }
.res-num { font-size: 31px; font-weight: 600; line-height: 1; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; color: #fff4d8; text-shadow: 0 0 22px rgba(255, 179, 71, 0.5); }
.res-rate { font-size: 13.5px; color: var(--gold); margin-top: 4px; font-variant-numeric: tabular-nums; }
.res-rate.boost { color: #fff; text-shadow: 0 0 12px var(--amber); }
.res-side { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.chip { display: flex; align-items: center; gap: 5px; padding: 3px 9px 3px 5px; border-radius: 999px; background: rgba(4, 6, 26, 0.6); border: 1px solid var(--line); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chip img { width: 20px; height: 20px; } .chip.dust { color: var(--dust); } .chip.ember { color: #ffb08a; }
.res-mult { padding: 2px 16px 10px; font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs { display: flex; gap: 4px; padding: 0 10px; border-bottom: 1px solid var(--line); }
.tab { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 4px 10px; font-size: 13px; font-weight: 500; color: var(--dim); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.2s; }
.tab img { width: 20px; height: 20px; opacity: 0.6; transition: opacity 0.2s; }
.tab:hover { color: var(--ink); } .tab.on { color: var(--gold); border-bottom-color: var(--amber); } .tab.on img { opacity: 1; }
.badge { display: none; position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 8px; background: var(--ember); color: #fff; font-size: 10.5px; font-weight: 700; font-style: normal; line-height: 16px; text-align: center; box-shadow: 0 0 10px rgba(255, 110, 50, 0.8); }
.badge.show { display: block; }
.pages { flex: 1; min-height: 0; position: relative; }
.page { position: absolute; inset: 0; display: none; flex-direction: column; overflow-y: auto; padding: 10px; gap: 8px; scrollbar-width: thin; scrollbar-color: #3a4180 transparent; }
.page.on { display: flex; }
.page::-webkit-scrollbar { width: 6px; } .page::-webkit-scrollbar-thumb { background: #3a4180; border-radius: 3px; }
.list { display: flex; flex-direction: column; gap: 6px; }
.empty { color: var(--faint); font-family: var(--serif); font-style: italic; text-align: center; padding: 34px 20px; line-height: 1.5; }
.p-title { font-family: var(--serif); font-size: 16px; color: var(--gold); margin-top: 4px; }
.p-note { font-size: 12.5px; color: var(--dim); line-height: 1.45; }
.modes { display: flex; gap: 5px; align-items: center; }
.mode { padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--dim); background: rgba(4, 6, 26, 0.5); border: 1px solid var(--line); }
.mode.on { color: #2a1404; background: var(--amber); border-color: var(--gold); }
.mode.appr { margin-left: auto; }

.gen, .up, .calling, .perk, .node, .crewrow, .mastery { display: flex; align-items: center; gap: 11px; text-align: left; padding: 9px 11px; border-radius: 14px; background: rgba(4, 6, 26, 0.42); border: 1px solid transparent; transition: background 0.15s, border-color 0.15s, transform 0.1s, opacity 0.2s; }
.gen, .up { opacity: 0.62; }
.gen.can, .up.can { opacity: 1; border-color: var(--line); background: rgba(22, 28, 74, 0.6); }
.gen.can:hover, .up.can:hover, .calling:hover { border-color: var(--amber); background: rgba(40, 46, 106, 0.75); box-shadow: 0 0 20px rgba(255, 179, 71, 0.12); }
.gen:active, .up:active { transform: scale(0.985); }
.gen.locked { opacity: 0.4; border: 1px dashed var(--line); }
.g-ic { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; background: radial-gradient(circle, rgba(255, 179, 71, 0.13), transparent 70%); }
.g-ic.q { font-family: var(--serif); font-size: 24px; color: var(--faint); }
.g-ic.big { width: 60px; height: 60px; }
.g-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.g-name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-n { color: var(--amber); font-weight: 500; }
.g-sub { font-size: 12px; color: var(--dim); line-height: 1.35; }
.g-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.g-count { font-size: 20px; font-weight: 600; color: #cfd3f5; font-variant-numeric: tabular-nums; line-height: 1; }
.g-cost { font-size: 12.5px; font-weight: 600; color: #b98b6a; font-variant-numeric: tabular-nums; white-space: nowrap; }
.can .g-cost { color: var(--gold); }
.up-head, .sky-head, .invite-row, .rk-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.calling { --c: var(--amber); align-items: flex-start; border-color: var(--line); }
.calling .g-name { color: var(--c); font-size: 16px; }
.calling.chosen { background: linear-gradient(135deg, color-mix(in srgb, var(--c) 14%, transparent), rgba(4, 6, 26, 0.4)); border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.c-tag { font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--ink); opacity: 0.8; }
.pipsline { color: var(--amber); letter-spacing: 2px; font-size: 11px; }
.mastery { justify-content: space-between; }
.rk { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; background: linear-gradient(160deg, rgba(255, 110, 50, 0.12), rgba(4, 6, 26, 0.4)); border: 1px solid rgba(255, 122, 61, 0.25); }
.rk-gain { font-size: 13px; color: #ffc9a8; }

/* crew */
.crew-total { font-size: 12px; color: var(--dim); }
.crewrow { padding: 8px 10px; } .crewrow.me { border-color: var(--line2); background: rgba(40, 46, 106, 0.5); } .crewrow.off { opacity: 0.45; }
.c-dot { width: 16px; height: 16px; border-radius: 50%; flex: none; background: radial-gradient(circle, #fff 0%, var(--c) 45%, transparent 75%); box-shadow: 0 0 12px 3px color-mix(in srgb, var(--c) 60%, transparent); }
.c-call { font-weight: 400; font-size: 11.5px; }
.c-bar { height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.07); margin-top: 3px; } .c-bar i { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--ember), var(--gold)); transition: width 0.6s; }
.giftbtn { width: 34px; height: 34px; border-radius: 50%; flex: none; color: var(--rose); border: 1px solid rgba(255, 143, 176, 0.4); background: rgba(255, 143, 176, 0.08); font-size: 15px; transition: transform 0.15s, box-shadow 0.2s; }
.giftbtn:hover { transform: scale(1.12); box-shadow: 0 0 16px rgba(255, 143, 176, 0.5); }
.giftbtn.cd { color: var(--faint); border-color: var(--line); font-size: 11px; background: none; }
/* sky */
.con { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 14px; background: rgba(20, 30, 80, 0.3); border: 1px solid rgba(159, 216, 255, 0.14); }
.con.complete { border-color: rgba(159, 216, 255, 0.5); box-shadow: inset 0 0 30px rgba(159, 216, 255, 0.08); }
.con.locked { opacity: 0.5; border-style: dashed; }
.con-name { font-family: var(--serif); font-size: 16px; color: var(--dust); } .con-lore { font-family: var(--serif); font-style: italic; font-size: 12.5px; color: var(--dim); margin-top: -3px; }
.node { padding: 7px 9px; } .node.done { opacity: 0.75; } .node.done .g-name { color: var(--dust); }
.n-prog { display: flex; align-items: center; gap: 8px; margin-top: 3px; } .n-bar { flex: 1; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); } .n-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, #5f8fe0, #cfeaff); box-shadow: 0 0 8px rgba(159, 216, 255, 0.6); transition: width 0.5s; }
.n-txt { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; } .n-lit { color: var(--dust); font-size: 12px; white-space: nowrap; }
.btn.small.dustbtn.can { border-color: var(--dust); color: var(--dust); }
/* chat */
.page[data-page='chat'] { padding-bottom: 8px; }
.chatlist { flex: 1; min-height: 60px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; line-height: 1.4; user-select: text; -webkit-user-select: text; scrollbar-width: thin; scrollbar-color: #3a4180 transparent; }
.msg { overflow-wrap: anywhere; } .msg.sys { color: var(--gold); font-family: var(--serif); font-style: italic; font-size: 13px; opacity: 0.85; }
.emotes { display: flex; justify-content: space-between; } .emote { font-size: 19px; padding: 3px; border-radius: 8px; transition: transform 0.12s; } .emote:hover { transform: scale(1.3); }
.chatrow { display: flex; gap: 6px; } .chatrow .inp { flex: 1; padding: 8px 12px; font-size: 13.5px; }

/* ------------------------------------------------------------------ centre */
.center { position: absolute; left: 396px; right: 356px; bottom: 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; }
.center > * { pointer-events: auto; }
.coach { opacity: 0; transform: translateY(6px); transition: opacity 0.5s, transform 0.5s; font-family: var(--serif); font-style: italic; font-size: 16px; color: #fff3cf; text-align: center; padding: 8px 18px; border-radius: 999px; background: rgba(9, 13, 40, 0.72); border: 1px solid var(--line2); max-width: 92%; pointer-events: none; text-shadow: 0 0 14px rgba(255, 179, 71, 0.5); }
.coach:empty { display: none; }
.coach.show { opacity: 1; transform: none; animation: breathe 2.4s ease-in-out infinite; }
.buffs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 0; pointer-events: none; }
.buff { --c: var(--amber); display: flex; align-items: center; gap: 6px; padding: 4px 11px 4px 5px; border-radius: 999px; background: rgba(9, 13, 40, 0.8); border: 1px solid var(--c); color: var(--c); font-size: 12.5px; font-weight: 600; box-shadow: 0 0 16px color-mix(in srgb, var(--c) 35%, transparent); animation: popIn 0.3s cubic-bezier(0.2, 1.6, 0.4, 1); }
.buff img { width: 20px; height: 20px; } .b-t { color: var(--ink); font-weight: 400; font-variant-numeric: tabular-nums; }
@keyframes popIn { from { transform: scale(0.6); opacity: 0; } }
.actions { display: flex; align-items: flex-start; gap: 14px; }
.ability { margin-top: -8px; }
.feedwrap { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.feed { position: relative; overflow: hidden; width: 290px; height: 62px; border-radius: 999px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(180deg, rgba(60, 34, 30, 0.9), rgba(30, 14, 22, 0.92)); border: 1.5px solid #ffb347; box-shadow: 0 0 26px rgba(255, 150, 60, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1); transition: transform 0.12s, box-shadow 0.2s; }
.feed:hover { box-shadow: 0 0 40px rgba(255, 150, 60, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1); }
.feed.pouring { transform: scale(0.97); box-shadow: 0 0 60px rgba(255, 170, 70, 0.85); }
.feed-fill { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, #e2511f, #ffb347 70%, #fff3c4); transition: transform 0.15s linear; opacity: 0.85; }
.feed-t { position: relative; font-family: var(--serif); font-weight: 600; font-size: 20px; color: #fff3cf; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }
.feed-s { position: relative; font-size: 11.5px; color: #f4d6a8; opacity: 0.85; letter-spacing: 0.04em; }
.tithe { display: flex; align-items: center; gap: 5px; font-size: 12px; padding: 4px 8px; border-radius: 999px; background: rgba(9, 13, 40, 0.7); }
.ignite { width: 330px; height: 68px; border-radius: 999px; font-family: var(--serif); font-weight: 600; font-size: 23px; color: #2a1000; background: linear-gradient(180deg, #fff3c4, #ffc64d 45%, #ff8a2b); border: 2px solid #fff; box-shadow: 0 0 50px rgba(255, 190, 90, 0.9), 0 0 120px rgba(255, 140, 50, 0.5); animation: ignitePulse 1.1s ease-in-out infinite; }
.ignite.wait, .ignite.sent { filter: grayscale(0.6) brightness(0.7); animation: none; pointer-events: none; }
@keyframes ignitePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.ability { --c: var(--amber); position: relative; width: 78px; height: 78px; border-radius: 50%; background: rgba(9, 13, 40, 0.88); border: 2px solid color-mix(in srgb, var(--c) 45%, #333); opacity: 0.8; transition: transform 0.12s, box-shadow 0.2s, opacity 0.2s; }
.ability.ready { opacity: 1; border-color: var(--c); box-shadow: 0 0 26px color-mix(in srgb, var(--c) 60%, transparent); animation: breathe 1.6s infinite; }
.ability.ready:hover { transform: scale(1.07); } .ability:active { transform: scale(0.94); }
.ability.active { box-shadow: 0 0 44px var(--c), inset 0 0 22px color-mix(in srgb, var(--c) 60%, transparent); }
.ab-ic { position: absolute; inset: 10px; } .ab-cd { position: absolute; inset: -2px; border-radius: 50%; background: conic-gradient(rgba(4, 6, 26, 0.82) calc(var(--p, 0) * 360deg), transparent 0); pointer-events: none; }
.ab-label { position: absolute; left: 50%; bottom: -19px; transform: translateX(-50%); font-size: 11.5px; font-weight: 600; white-space: nowrap; color: var(--c); text-shadow: 0 1px 4px #000; }

/* ------------------------------------------------------------------ overlays */
.overlays { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.overlays > * { pointer-events: auto; }
.toasts { position: absolute; left: 396px; bottom: 236px; display: flex; flex-direction: column; gap: 7px; align-items: flex-start; pointer-events: none !important; max-width: min(420px, calc(100vw - 800px)); }
.toast { display: flex; align-items: center; gap: 9px; padding: 8px 14px 8px 8px; border-radius: 14px; background: rgba(9, 13, 40, 0.9); border: 1px solid var(--line2); font-size: 13.5px; line-height: 1.35; opacity: 0; transform: translateX(-16px); transition: opacity 0.35s, transform 0.35s; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); }
.toast.in { opacity: 1; transform: none; } .toast img { width: 30px; height: 30px; flex: none; }
.trial { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); width: min(460px, calc(100vw - 28px)); padding: 12px 18px 12px; border-radius: 18px; text-align: center; background: rgba(40, 20, 8, 0.86); border: 1.5px solid var(--amber); box-shadow: 0 0 50px rgba(255, 150, 60, 0.45); animation: popIn 0.35s cubic-bezier(0.2, 1.6, 0.4, 1); }
.trial.shade { background: rgba(18, 8, 44, 0.9); border-color: var(--violet); box-shadow: 0 0 50px rgba(140, 100, 255, 0.5); }
.tr-title { font-family: var(--serif); font-weight: 600; font-size: 21px; color: #fff3cf; }
.trial.shade .tr-title { color: #e6dcff; }
.tr-bar { height: 14px; margin: 8px 0 6px; border-radius: 999px; background: rgba(0, 0, 0, 0.6); overflow: hidden; }
.tr-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #ff7a3d, #ffc64d, #fff3c4); box-shadow: 0 0 16px #ffb347; transition: width 0.35s; }
.trial.shade .tr-bar i { background: linear-gradient(90deg, #4a2aa0, #b69cff); box-shadow: 0 0 16px #8a6cff; }
.tr-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; color: var(--ink); }
.tr-time { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; } .tr-time.urgent { color: #ff8a7a; animation: breathe 0.5s infinite; }
.tr-top { font-size: 11.5px; color: var(--dim); margin-top: 3px; min-height: 14px; }
.trial.won { border-color: #fff; box-shadow: 0 0 80px rgba(255, 240, 200, 0.8); } .trial.lost { filter: saturate(0.4); }
.vote { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); width: min(640px, calc(100vw - 28px)); padding: 12px 14px 14px; border-radius: 20px; background: rgba(9, 13, 40, 0.92); border: 1px solid var(--line2); box-shadow: 0 20px 70px rgba(0, 0, 0, 0.6), 0 0 40px rgba(255, 179, 71, 0.15); animation: popIn 0.4s cubic-bezier(0.2, 1.4, 0.4, 1); }
.v-head { display: flex; align-items: center; gap: 12px; font-family: var(--serif); font-size: 17px; color: var(--gold); margin-bottom: 10px; }
.v-timer { flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); overflow: hidden; } .v-timer i { display: block; height: 100%; width: 100%; background: var(--amber); transform-origin: left; transition: transform 0.2s linear; }
.v-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.v-card { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 12px 10px 10px; border-radius: 16px; background: rgba(22, 28, 74, 0.6); border: 1.5px solid var(--line); transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s; }
.v-card:hover { transform: translateY(-3px); border-color: var(--amber); } .v-card.mine { border-color: var(--gold); box-shadow: 0 0 26px rgba(255, 179, 71, 0.4); background: rgba(60, 44, 40, 0.7); }
.v-ic { width: 64px; height: 64px; } .v-name { font-family: var(--serif); font-weight: 600; font-size: 16px; color: var(--gold); } .v-desc { font-size: 12.5px; color: var(--ink); opacity: 0.85; line-height: 1.35; } .v-count { color: var(--amber); letter-spacing: 2px; min-height: 16px; font-size: 12px; }
.intro { position: absolute; left: 50%; top: 24%; transform: translate(-50%, 16px); width: min(560px, calc(100vw - 40px)); text-align: center; opacity: 0; transition: opacity 0.9s, transform 0.9s; cursor: pointer; padding: 26px 30px; border-radius: 26px; background: radial-gradient(ellipse at center, rgba(4, 6, 26, 0.9) 0%, rgba(4, 6, 26, 0.72) 60%, rgba(4, 6, 26, 0) 100%); }
.intro.in { opacity: 1; transform: translate(-50%, 0); }
.intro-act { letter-spacing: 0.5em; font-size: 12px; color: var(--amber); text-transform: uppercase; padding-left: 0.5em; }
.intro-name { font-family: var(--serif); font-weight: 600; font-size: clamp(34px, 6vw, 54px); line-height: 1.1; margin: 6px 0; background: linear-gradient(180deg, #fff3cf, #ffb347); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 22px rgba(255, 150, 60, 0.5)); }
.intro-blurb { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--gold); } .intro-text { font-size: 15.5px; line-height: 1.6; color: var(--ink); margin-top: 12px; text-shadow: 0 1px 8px #000; } .intro-skip { font-size: 11px; color: var(--faint); margin-top: 12px; letter-spacing: 0.1em; }
.modal-wrap { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(2, 3, 14, 0.6); opacity: 0; transition: opacity 0.25s; padding: 16px; box-sizing: border-box; overflow-y: auto; }
.modal-wrap.in { opacity: 1; }
.modal-wrap:has(.modal.end), .modal-wrap:has(.modal.help) { place-items: start center; }
.modal { width: min(460px, 100%); padding: 24px 26px; border-radius: 22px; background: rgba(12, 16, 48, 0.96); border: 1px solid var(--line2); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7); display: flex; flex-direction: column; gap: 12px; transform: translateY(10px); transition: transform 0.25s; }
.modal-wrap.in .modal { transform: none; }
.modal h2 { margin: 0; font-family: var(--serif); font-weight: 600; color: var(--gold); font-size: 22px; } .modal p { margin: 0; line-height: 1.55; color: var(--ink); font-size: 14.5px; }
.modal-ic { width: 72px; height: 72px; align-self: center; } .modal-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 14.5px; } .set-row input[type='range'] { flex: 1; max-width: 220px; accent-color: var(--amber); } .set-row input[type='checkbox'] { width: 18px; height: 18px; accent-color: var(--amber); } .set-row .inp { max-width: 200px; padding: 7px 12px; }
.modal.end { width: min(820px, 100%); text-align: center; align-items: center; background: linear-gradient(180deg, rgba(60, 40, 30, 0.93), rgba(14, 16, 48, 0.96) 55%); border-color: var(--gold); box-shadow: 0 0 120px rgba(255, 190, 90, 0.35); }
.end-sun { width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, #fff 0%, #fff3c4 30%, #ffc64d 60%, transparent 72%); box-shadow: 0 0 80px 30px rgba(255, 190, 90, 0.55); animation: emberPulse 3s infinite; }
.end-title { font-family: var(--serif); font-size: clamp(34px, 6vw, 52px); margin: 6px 0 0; background: linear-gradient(180deg, #fff, #ffd98a 60%, #ff9838); -webkit-background-clip: text; background-clip: text; color: transparent; }
.end-sub { color: var(--ink) !important; opacity: 0.9; max-width: 600px; } .end-names { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; font-weight: 600; }
.awards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 9px; width: 100%; }
.award { padding: 10px; border-radius: 14px; background: rgba(4, 6, 26, 0.5); border: 1px solid var(--line); } .aw-title { font-family: var(--serif); font-style: italic; color: var(--gold); font-size: 14px; } .aw-name { font-weight: 700; font-size: 17px; margin: 2px 0; } .aw-desc { font-size: 11.5px; color: var(--dim); }
.end-chart { position: relative; width: 100%; min-height: 40px; }
.jr-legend { display: flex; flex-wrap: wrap; gap: 2px 18px; padding: 0 18px 2px 54px; font-size: 12px; color: var(--ink); opacity: 0.85; } .jr-legend span, .jr-tip div { display: flex; align-items: center; gap: 7px; }
.jr-k1, .jr-k2 { flex: none; width: 20px; height: 3px; border-radius: 2px; background: var(--amber); } .jr-k2 { height: 2px; background: #7fd8ff; } .jr-tip i { width: 10px; }
.jr-plot { touch-action: pan-y; cursor: crosshair; } .jr-plot svg { display: block; max-width: 100%; } .jr-plot text { fill: var(--dim); font: 11px var(--sans); } .jr-plot .jr-axis { letter-spacing: 0.04em; } .jr-plot .jr-roman { fill: var(--gold); font-family: var(--serif); }
.jr-plot path { fill: none; } .jr-grid { stroke: rgba(255, 255, 255, 0.07); } .jr-act { stroke: rgba(255, 217, 138, 0.35); stroke-dasharray: 4 4; } .jr-cross { stroke: rgba(247, 236, 212, 0.45); }
.jr-light { stroke: var(--amber); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 5px rgba(255, 179, 71, 0.55)); } .jr-crew { stroke: #7fd8ff; stroke-width: 1.5; stroke-linejoin: round; } .jr-plot .jr-area { fill: rgba(255, 179, 71, 0.12); } .jr-plot .jr-area2 { fill: rgba(127, 216, 255, 0.1); }
.jr-sun { fill: #ffe9a8; } .jr-halo { fill: rgba(255, 190, 90, 0.3); } .jr-dot1 { fill: var(--amber); stroke: #0e1030; stroke-width: 2; } .jr-dot2 { fill: #7fd8ff; stroke: #0e1030; stroke-width: 2; }
.jr-tip { position: absolute; top: 40px; pointer-events: none; padding: 7px 11px; border-radius: 10px; background: rgba(4, 6, 26, 0.94); border: 1px solid var(--line2); font-size: 12.5px; text-align: left; white-space: nowrap; color: var(--ink); opacity: 0; transition: opacity 0.12s; } .jr-tip.in { opacity: 1; } .jr-when { color: var(--dim); font-size: 11.5px; margin-bottom: 2px; }
.modal.help { width: min(560px, 100%); } .help-list { display: flex; flex-direction: column; gap: 4px; max-height: 62vh; overflow-y: auto; }
.help-row { display: flex; gap: 10px; align-items: flex-start; padding: 5px 2px; } .help-row .g-ic { width: 36px; height: 36px; } .help-row .g-sub { font-size: 12.5px; }
.mtabs { display: none; }

/* ------------------------------------------------------------------ medium screens */
@media (max-width: 1280px) {
  .panel.left { width: 320px; } .panel.right { width: 280px; }
  .top { grid-template-columns: 320px 1fr 280px; } .brand { display: none; }
  .center { left: 348px; right: 308px; } .toasts { left: 348px; }
  .feed { width: 240px; } .ignite { width: 280px; font-size: 20px; }
}
/* ------------------------------------------------------------------ phones / narrow */
@media (max-width: 900px) {
  #wts-scene { height: 46vh; height: 46dvh; }
  .top { left: 8px; right: 8px; top: 6px; height: auto; grid-template-columns: 1fr auto; gap: 6px; }
  .top-l { display: none; } .flamebar { width: auto; justify-self: stretch; padding: 5px 12px 6px; border-radius: 14px; } .fb-title { font-size: 14px; } .fb-sub { font-size: 11px; } .fb-track { margin: 5px 4px 4px; height: 8px; }
  .top-r { flex-direction: row; flex-wrap: wrap; width: 68px; gap: 4px; } .top-r .iconbtn { width: 30px; height: 30px; font-size: 13px; } .crewchip { width: 100%; box-sizing: border-box; justify-content: center; } .crewchip { height: 28px; padding: 0 9px 0 5px; font-size: 13px; } .crewchip img { width: 18px; height: 18px; }
  .panel { top: 46vh; top: 46dvh; bottom: 54px; left: 0 !important; right: 0 !important; width: auto !important; border-radius: 18px 18px 0 0; border-bottom: 0; background: rgba(9, 12, 38, 0.97); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .game[data-mside='left'] .panel.right, .game[data-mside='right'] .panel.left { display: none; }
  .panel .tabs { display: none; }
  .panel.right { padding-top: 6px; }
  .res { padding: 9px 14px 2px; } .res-num { font-size: 25px; } .res-ic { width: 36px !important; height: 36px !important; } .res-side { flex-direction: row; } .res-mult { padding-bottom: 6px; }
  .mtabs { display: flex; position: absolute; left: 0; right: 0; bottom: 0; height: 54px; background: #070a22; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .mtab { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 10px; color: var(--dim); } .mtab img { width: 24px; height: 24px; opacity: 0.55; } .mtab.on { color: var(--gold); } .mtab.on img { opacity: 1; filter: drop-shadow(0 0 6px var(--amber)); }
  .mtab .badge { right: 12%; }
  .center { left: 0; right: 0; bottom: calc(54dvh + 8px); gap: 6px; } .coach { font-size: 13.5px; padding: 6px 14px; }
  .feed { width: 200px; height: 50px; } .feed-t { font-size: 17px; } .feed-s { font-size: 10px; } .ignite { width: 250px; height: 54px; font-size: 18px; }
  .ability { width: 58px; height: 58px; } .ab-label { bottom: -15px; font-size: 10px; } .tithe { display: none; }
  .toasts { left: 8px; right: 8px; bottom: auto; top: 76px; max-width: none; } .toast { font-size: 12.5px; padding: 6px 10px 6px 6px; } .toast img { width: 22px; height: 22px; }
  .trial, .vote { top: 70px; } .tr-title { font-size: 17px; } .v-cards { gap: 6px; } .v-ic { width: 44px; height: 44px; } .v-desc { font-size: 11px; } .v-name { font-size: 14px; }
  .intro { top: 9%; padding: 16px; } .intro-text { font-size: 13.5px; }
  .lobby-cols { grid-template-columns: 1fr; } .lobby-card { padding: 22px 18px 16px; } .fire-meta.dim { display: none; }
}
