@font-face { font-family: "Cormorant"; src: url(fonts/cormorant.woff2) format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url(fonts/cormorant-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: 100 900; font-style: normal; font-display: swap; }

:root {
  --ink: #0b0c10;
  --stone: #14161d;
  --stone2: #1c1f28;
  --line: rgba(217, 165, 90, .28);
  --line2: rgba(217, 165, 90, .55);
  --brass: #d9a55a;
  --brass2: #f1c987;
  --porcelain: #f3eee6;
  --muted: #9a958c;
  --sun: #ffcf7a;
  --glass: #8fe3ff;
  --danger: #ff5a5a;
  --good: #7dffb2;
  --serif: "Cormorant", "Cormorant Garamond", Georgia, serif;
  --sans: "Outfit", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--porcelain); font-family: var(--sans); overflow: hidden; -webkit-font-smoothing: antialiased; user-select: none; }
canvas#view { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
canvas#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: none; pointer-events: none; }
body.ingame canvas#gl { display: block; }
body.playing:not(.uiopen) { cursor: none; }
body.playing.uiopen button, body.playing.uiopen .pick, body.playing.uiopen .card { cursor: pointer; }
.hidden { display: none !important; }
button { font-family: inherit; }
input { font-family: inherit; }

/* ---------- generic ---------- */
.screen { position: fixed; inset: 0; z-index: 10; }
.overlay { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(11, 12, 16, .72), rgba(5, 5, 8, .92)); backdrop-filter: blur(3px); animation: fadeIn .35s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.panel { background: linear-gradient(180deg, rgba(28, 31, 40, .92), rgba(16, 17, 23, .94)); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 230, 190, .06); padding: 22px; }
.eyebrow { font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: var(--brass); font-weight: 500; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: .01em; }
h2 { font-size: 38px; }
h3 { font-size: 21px; color: var(--brass2); margin: 14px 0 10px; }
h4 { font-size: 20px; color: var(--brass2); margin-bottom: 6px; }
.muted { color: var(--muted); }
kbd { font-family: var(--sans); font-size: 11px; padding: 2px 7px; border-radius: 5px; border: 1px solid var(--line2); background: rgba(255, 255, 255, .05); color: var(--brass2); }

.btn { appearance: none; border: 1px solid var(--line2); background: linear-gradient(180deg, rgba(255, 240, 210, .07), rgba(255, 240, 210, .02)); color: var(--porcelain); padding: 10px 18px; border-radius: 10px; font-size: 15px; font-weight: 500; letter-spacing: .02em; cursor: pointer; transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s; }
.btn:hover { border-color: var(--brass2); background: linear-gradient(180deg, rgba(255, 220, 160, .14), rgba(255, 220, 160, .04)); box-shadow: 0 0 0 1px rgba(241, 201, 135, .2), 0 6px 24px rgba(217, 165, 90, .15); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.primary { background: linear-gradient(180deg, #f3c77c, #c98d3c); color: #1a1208; border-color: #ffdf9e; font-weight: 600; box-shadow: 0 8px 30px rgba(217, 165, 90, .25), inset 0 1px 0 rgba(255, 255, 255, .4); }
.btn.primary:hover { background: linear-gradient(180deg, #ffd690, #d99b48); box-shadow: 0 10px 40px rgba(255, 190, 100, .38), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn.big { padding: 14px 26px; font-size: 17px; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.danger { border-color: rgba(255, 90, 90, .5); color: #ffb3b3; }
.btn.danger:hover { background: rgba(255, 90, 90, .12); box-shadow: 0 6px 24px rgba(255, 90, 90, .15); }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; padding: 4px; transition: color .2s; }
.link:hover { color: var(--brass2); }

/* ---------- title ---------- */
#title { display: block; }
body.titlegl canvas#gl { display: block; }
body.titlegl canvas#view { opacity: 0; }
#title::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(6, 6, 9, .78) 0%, rgba(6, 6, 9, .42) 30%, rgba(6, 6, 9, 0) 55%), linear-gradient(0deg, rgba(6, 6, 9, .55), rgba(6, 6, 9, 0) 30%); }
.t-brand { position: absolute; left: clamp(28px, 7vw, 120px); top: clamp(48px, 13vh, 150px); display: flex; flex-direction: column; align-items: flex-start; }
.t-emblem { width: 58px; height: 58px; color: #e9c58a; margin: 0 0 14px 2px; filter: drop-shadow(0 0 10px rgba(255, 190, 110, .35)); animation: tFade 2.4s .2s var(--ease) both; }
.t-emblem ellipse:first-of-type { transform-origin: 60px 60px; animation: tOrbit 40s linear infinite; }
@keyframes tOrbit { to { transform: rotate(338deg); } }
.t-logo { position: relative; margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5.6vw, 82px); line-height: 1; letter-spacing: .34em; color: #f1e8da;
  text-shadow: 0 0 1px rgba(255, 240, 220, .5), 0 0 28px rgba(255, 196, 120, .22), 0 2px 16px rgba(0, 0, 0, .7); animation: tLogo 2.6s .1s var(--ease) both; }
.t-logo::after { content: attr(data-text); position: absolute; inset: 0; padding-left: inherit; color: transparent; pointer-events: none; text-shadow: none; animation-fill-mode: both;
  background: linear-gradient(105deg, transparent 0%, transparent 42%, rgba(255, 236, 200, .95) 50%, transparent 58%, transparent 100%); background-size: 260% 100%; background-position: 130% 0;
  -webkit-background-clip: text; background-clip: text; animation: tSweep 11s 3s ease-in-out infinite; }
@keyframes tSweep { 0% { background-position: 130% 0; } 30%, 100% { background-position: -30% 0; } }
@keyframes tLogo { from { opacity: 0; letter-spacing: .5em; filter: blur(6px); } to { opacity: 1; letter-spacing: .34em; filter: none; } }
.t-rule { display: flex; align-items: center; gap: 10px; margin-top: 20px; width: min(420px, 60vw); animation: tFade 2s 1s var(--ease) both; }
.t-rule span { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(233, 197, 138, .7), rgba(233, 197, 138, 0)); }
.t-rule i { width: 6px; height: 6px; transform: rotate(45deg); border: 1px solid rgba(233, 197, 138, .8); }
.t-rule i:last-child { display: none; }
@keyframes tFade { from { opacity: 0; } to { opacity: 1; } }
.t-menu { position: absolute; left: clamp(28px, 7vw, 120px); bottom: clamp(70px, 14vh, 150px); display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 280px; }
.t-item { position: relative; appearance: none; background: none; border: 0; padding: 7px 0 7px 0; color: rgba(241, 232, 218, .62); font-family: var(--serif); font-size: clamp(24px, 2.3vw, 32px); letter-spacing: .04em; cursor: pointer; text-align: left;
  transition: color .25s, transform .35s var(--ease), text-shadow .3s; animation: tItem .9s var(--ease) both; }
.t-item::before { content: ""; position: absolute; left: -34px; top: 50%; width: 0; height: 1px; background: linear-gradient(90deg, rgba(233, 197, 138, 0), #e9c58a); transition: width .35s var(--ease); }
.t-item::after { content: ""; position: absolute; left: -8px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; transform: rotate(45deg) scale(0); background: #ffd99a; box-shadow: 0 0 10px #ffb460; transition: transform .3s var(--ease); }
.t-item:hover, .t-item:focus-visible, .t-item.on { color: #fff6e6; transform: translateX(10px); text-shadow: 0 0 22px rgba(255, 200, 120, .35); outline: none; }
.t-item:hover::before, .t-item:focus-visible::before, .t-item.on::before { width: 26px; }
.t-item:hover::after, .t-item:focus-visible::after, .t-item.on::after { transform: rotate(45deg) scale(1); }
.t-item.minor { font-family: var(--sans); font-size: 13px; letter-spacing: .24em; text-transform: uppercase; padding: 6px 0; color: rgba(241, 232, 218, .45); }
.t-item.minor:hover, .t-item.minor:focus-visible, .t-item.minor.on { color: #f1e8da; }
.t-item .t-badge { font-family: var(--sans); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: #e9c58a; margin-left: 12px; vertical-align: middle; opacity: .85; }
.t-menu > :nth-child(1) { animation-delay: 1.1s; } .t-menu > :nth-child(2) { animation-delay: 1.2s; } .t-menu > :nth-child(3) { animation-delay: 1.3s; }
.t-menu > :nth-child(6) { animation-delay: 1.5s; } .t-menu > :nth-child(7) { animation-delay: 1.55s; } .t-menu > :nth-child(8) { animation-delay: 1.6s; }
@keyframes tItem { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; } }
.t-sep { width: 34px; height: 1px; background: rgba(233, 197, 138, .35); margin: 14px 0 8px; animation: tFade 1s 1.4s both; }
.t-join { width: min(340px, 80vw); padding: 6px 0 4px 10px; display: flex; flex-direction: column; gap: 8px; animation: tFade .4s both; }
.t-name { position: absolute; right: clamp(20px, 3vw, 44px); top: clamp(18px, 3vh, 34px); display: flex; align-items: baseline; gap: 12px; animation: tFade 1.5s 1.8s both; }
.t-name span { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: rgba(233, 197, 138, .75); }
.t-name input { width: 170px; background: none; border: 0; border-bottom: 1px solid rgba(233, 197, 138, .35); padding: 4px 2px; color: #f1e8da; font-family: var(--serif); font-size: 22px; outline: none; transition: border-color .2s; }
.t-name input:focus { border-color: #e9c58a; }
@media (max-width: 700px) {
  .t-brand { left: 50%; transform: translateX(-50%); align-items: center; top: 9vh; }
  .t-logo { letter-spacing: .24em; padding-left: .24em; }
  .t-rule { justify-content: center; } .t-rule i:last-child { display: block; } .t-rule span { background: rgba(233, 197, 138, .5); }
  .t-menu { left: 50%; transform: translateX(-50%); align-items: center; bottom: 15vh; min-width: 0; }
  .t-item { text-align: center; } .t-item::before, .t-item::after { display: none; }
  .t-item:hover, .t-item.on { transform: none; }
  .t-name { left: 50%; right: auto; transform: translateX(-50%); top: auto; bottom: calc(14px + 4.5vh); }
  #title .title-foot { left: 0; right: 0; justify-content: center; }
  #title::before { background: linear-gradient(0deg, rgba(6, 6, 9, .75), rgba(6, 6, 9, .1) 55%, rgba(6, 6, 9, .5)); }
}
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.field input, #chatInput { background: rgba(10, 11, 15, .7); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--porcelain); font-size: 16px; outline: none; transition: border-color .2s, box-shadow .2s; letter-spacing: normal; text-transform: none; }
.field input:focus, #chatInput:focus { border-color: var(--brass2); box-shadow: 0 0 0 3px rgba(217, 165, 90, .15); }
.join-row { display: flex; gap: 14px; align-items: flex-end; }
.join-row input { flex: 1; min-width: 0; background: none; border: 0; border-bottom: 1px solid rgba(233, 197, 138, .45); border-radius: 0; padding: 6px 4px; color: #f1e8da; font-family: var(--serif); font-size: 24px; letter-spacing: .5em; text-transform: uppercase; text-align: left; outline: none; transition: border-color .2s; }
.join-row input::placeholder { color: rgba(241, 232, 218, .3); letter-spacing: .4em; }
.join-row input:focus { border-color: #e9c58a; }
.join-row .btn { padding: 8px 18px; }
.open-rooms { display: flex; flex-direction: column; gap: 6px; max-height: 150px; overflow: auto; }
.open-rooms .room { width: 100%; color: var(--porcelain); font-family: var(--sans); text-align: left; display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--line); background: rgba(8, 8, 11, .6); font-size: 14px; cursor: pointer; transition: background .2s, border-color .2s; }
.open-rooms .room:hover { background: rgba(217, 165, 90, .1); border-color: var(--line2); }
.open-rooms .room b { color: var(--brass2); letter-spacing: .2em; }
.title-foot { position: absolute; bottom: 14px; right: 20px; display: flex; justify-content: flex-end; font-size: 11px; letter-spacing: .06em; color: #6f6a62; animation: tFade 2s 2s both; }
.title-foot a { color: #8a847a; text-decoration: none; }
.title-foot a:hover { color: var(--brass2); }

/* ---------- lobby ---------- */
#lobby { display: flex; flex-direction: column; padding: 28px clamp(16px, 4vw, 56px); gap: 18px; background: radial-gradient(ellipse at 50% 120%, rgba(255, 190, 110, .1), transparent 60%); overflow: auto; }
.lobby-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.lobby-head h2 { font-size: 44px; }
.code-box { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.code { font-family: var(--serif); font-size: 44px; letter-spacing: .3em; color: var(--sun); font-weight: 700; text-shadow: 0 0 22px rgba(255, 200, 110, .45); line-height: 1; }
.lobby-grid { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 18px; flex: 1; min-height: 0; }
.lobby-grid > .panel { overflow: auto; min-height: 0; }
@media (max-width: 900px) { .lobby-grid { grid-template-columns: 1fr; } }
.crew-list { display: flex; flex-direction: column; gap: 8px; }
.crew-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .05); animation: fadeUp .4s var(--ease) both; }
.crew-row .dot { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 12px currentColor; flex: none; background: currentColor; }
.crew-row .nm { flex: 1; font-weight: 500; }
.crew-row .kit { font-size: 12px; color: var(--muted); }
.crew-row .tag { font-size: 10px; letter-spacing: .15em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line); color: var(--brass2); }
.crew-row .tag.ready { border-color: rgba(125, 255, 178, .4); color: var(--good); }
.crew-row.empty { opacity: .35; border-style: dashed; justify-content: center; font-size: 13px; color: var(--muted); }
.toggle { display: flex; gap: 10px; align-items: center; margin-top: 14px; font-size: 13px; color: var(--muted); cursor: pointer; }
.toggle input { accent-color: var(--brass); width: 16px; height: 16px; }
.kit-panel { display: grid; grid-template-columns: 260px 1fr; gap: 22px; }
@media (max-width: 1100px) { .kit-panel { grid-template-columns: 1fr; } }
.kit-preview { display: flex; flex-direction: column; align-items: center; gap: 12px; }
#kitCanvas { width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 210, 140, .08), transparent 70%); }
.colors { display: grid; grid-template-columns: repeat(4, 26px); gap: 10px; justify-content: center; }
.colors button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform .15s, border-color .15s; }
.colors button:hover { transform: scale(1.15); }
.colors button.sel { border-color: #fff; box-shadow: 0 0 14px currentColor; }
.colors button.taken { opacity: .2; pointer-events: none; }
.pick-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pick-row.mods { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.pick { text-align: left; padding: 12px 14px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .07); background: rgba(255, 255, 255, .025); color: var(--porcelain); cursor: pointer; transition: border-color .2s, background .2s, transform .15s; position: relative; }
.pick:hover { border-color: var(--line2); background: rgba(217, 165, 90, .07); transform: translateY(-1px); }
.pick.sel { border-color: var(--brass2); background: linear-gradient(180deg, rgba(241, 201, 135, .16), rgba(241, 201, 135, .04)); box-shadow: 0 0 0 1px rgba(241, 201, 135, .25), 0 8px 26px rgba(217, 165, 90, .12); }
.pick .pn { font-family: var(--serif); font-size: 20px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.pick .ps { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.pick .sw { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 10px currentColor; background: currentColor; }
.lobby-foot { display: flex; gap: 12px; align-items: center; position: sticky; bottom: -28px; z-index: 2; margin: 0 calc(-1 * clamp(16px, 4vw, 56px)) -28px; padding: 14px clamp(16px, 4vw, 56px) 28px;
  background: linear-gradient(180deg, rgba(8, 9, 12, 0), rgba(8, 9, 12, .95) 35%); }
.lobby-status { flex: 1; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
#hud .draft-btn, #hud #chatInput { pointer-events: auto; }
#crewHud { position: absolute; top: 16px; left: 16px; display: flex; flex-direction: column; gap: 6px; }
.chud { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 7px; border-radius: 9px; background: rgba(10, 11, 15, .55); border: 1px solid rgba(255, 255, 255, .06); font-size: 13px; min-width: 150px; transition: opacity .3s; }
.chud .dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.chud .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.chud .hp { display: flex; gap: 2px; }
.chud .hp i { width: 6px; height: 9px; border-radius: 2px; background: var(--porcelain); opacity: .9; }
.chud .hp i.off { opacity: .15; }
.chud.dead { opacity: .55; }
.chud.dead .nm::after { content: " · rebuilding"; color: var(--sun); font-size: 11px; }
.chud.dead.held .nm::after { content: " · broken until the room is quiet"; color: #ff8a7a; }
.chud.off .nm::after { content: " · offline"; color: var(--muted); font-size: 11px; }
#topCenter { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(560px, 70vw); }
.stage-card { text-align: center; opacity: 0; transition: opacity 1.2s; }
.stage-card.show { opacity: 1; }
.sc-sub { font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: var(--brass); }
.sc-name { font-family: var(--serif); font-size: 34px; font-weight: 600; text-shadow: 0 2px 20px rgba(0, 0, 0, .8); }
.lockdown { width: 100%; }
.lk-label { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .3em; color: #ffb4a0; margin-bottom: 4px; text-shadow: 0 0 10px rgba(255, 80, 60, .5); }
.lk-label b { font-family: var(--serif); font-size: 18px; letter-spacing: 0; color: #fff; }
.lk-bar { position: relative; height: 12px; border-radius: 7px; background: rgba(10, 8, 10, .75); border: 1px solid rgba(255, 120, 90, .35); overflow: hidden; box-shadow: 0 0 20px rgba(255, 60, 40, .1); }
.lk-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #7a1d2c, #e0413a 60%, #ff9a6b); box-shadow: 0 0 18px rgba(255, 80, 60, .7); transition: width .6s var(--ease); }
.lk-ticks { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(20% - 1px), rgba(255, 255, 255, .25) calc(20% - 1px) 20%); }
.lockdown.pulse .lk-bar { animation: lkPulse .8s ease-out; }
@keyframes lkPulse { 0% { box-shadow: 0 0 40px rgba(255, 60, 40, .9); transform: scale(1.03); } 100% { box-shadow: 0 0 20px rgba(255, 60, 40, .1); transform: none; } }
.lockdown.drop .lk-bar { animation: lkDrop .8s ease-out; }
@keyframes lkDrop { 0% { box-shadow: 0 0 40px rgba(140, 230, 255, .9); } 100% { box-shadow: none; } }
.final-seal { margin-top: 6px; text-align: center; font-family: var(--serif); font-size: 22px; font-weight: 700; color: #ff7b6b; letter-spacing: .2em; animation: blink 1s infinite; text-shadow: 0 0 18px rgba(255, 60, 40, .8); }
@keyframes blink { 50% { opacity: .55; } }
.boss { width: 100%; }
.boss-name { display: flex; align-items: baseline; justify-content: center; gap: 12px; font-family: var(--serif); font-size: 24px; font-weight: 600; text-shadow: 0 2px 12px #000; }
.boss-name small { font-size: 14px; font-style: italic; color: var(--muted); font-weight: 500; }
.boss-hp { position: relative; height: 10px; margin-top: 4px; border-radius: 6px; background: rgba(10, 10, 12, .8); border: 1px solid rgba(241, 201, 135, .35); overflow: hidden; }
.boss-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #b9ffd2, #f3eee6); z-index: 2; box-shadow: 0 0 14px rgba(200, 255, 220, .6); }
.boss-trail { position: absolute; inset: 0 auto 0 0; background: #ffcf7a; z-index: 1; transition: width .8s .3s ease-out; }
.boss-hp i { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(11, 12, 16, .9); z-index: 3; }
.boss.exposed .boss-fill { background: linear-gradient(90deg, #ffe08a, #fff); box-shadow: 0 0 20px #ffe08a; }

#toasts { position: absolute; top: 150px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(720px, 90vw); }
.toast { padding: 8px 16px; border-radius: 9px; background: rgba(10, 11, 15, .72); border: 1px solid rgba(255, 255, 255, .08); font-size: 14px; text-align: center; animation: toastIn .4s var(--ease) both; transition: opacity .6s, transform .6s; }
.toast.hint { border-color: rgba(143, 227, 255, .35); color: #d8f6ff; }
.toast.good { border-color: rgba(125, 255, 178, .4); color: #c9ffe0; }
.toast.bad { border-color: rgba(255, 90, 90, .45); color: #ffc9c0; }
.toast.warn { border-color: rgba(255, 207, 122, .5); color: #ffe7b8; }
.toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
#announce { position: absolute; top: 38%; left: 50%; transform: translate(-50%, -50%); text-align: center; font-family: var(--serif); font-size: clamp(30px, 4vw, 56px); font-weight: 600; font-style: italic; color: #fff6e6; text-shadow: 0 0 30px rgba(255, 200, 120, .55), 0 2px 10px #000; opacity: 0; transition: opacity 1s; white-space: nowrap; }
#announce.show { opacity: 1; }
.sealed-lights { display: flex; gap: 14px; justify-content: center; margin: 14px 0 10px; }
.sealed-lights i { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle, #fff3c8 0, #ffcf7a 45%, rgba(255, 160, 60, 0) 72%); box-shadow: 0 0 18px rgba(255, 190, 100, .8); }
.sealed-lights i.out { background: radial-gradient(circle, #3a3530 0, #2a2622 50%, rgba(0, 0, 0, 0) 72%); box-shadow: none; }
.sealed-lights i.dying { animation: lightOut 1.6s .5s var(--ease) forwards; }
@keyframes lightOut { 0% { transform: scale(1); } 30% { transform: scale(1.5); filter: brightness(1.6); } 100% { transform: scale(.8); background: radial-gradient(circle, #3a3530 0, #2a2622 50%, rgba(0, 0, 0, 0) 72%); box-shadow: none; } }
#victory.defeat h2 { color: #c9c2b8; text-shadow: 0 0 30px rgba(120, 140, 180, .35); }
#victory.defeat .eyebrow { color: #9fb0c8; }
.season { position: absolute; top: 22%; left: 50%; transform: translate(-50%, -8px); text-align: center; pointer-events: none; opacity: 0; transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); max-width: min(720px, 92vw); }
.season.show { opacity: 1; transform: translate(-50%, 0); }
.season-eyebrow { font-family: var(--sans); font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: rgba(255, 207, 122, .8); }
.season-name { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: clamp(30px, 3.6vw, 50px); color: #fff3dc; text-shadow: 0 0 28px rgba(255, 190, 110, .5), 0 2px 10px #000; margin: 4px 0 10px; }
.season-name::before, .season-name::after { content: ''; display: inline-block; width: 56px; height: 1px; vertical-align: middle; margin: 0 18px; background: linear-gradient(90deg, transparent, rgba(255, 207, 122, .7), transparent); }
.season-omens { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: 15px; line-height: 1.6; color: rgba(240, 230, 210, .9); text-shadow: 0 1px 6px #000; }
.season-omens li + li { opacity: .78; font-size: 14px; }
.map-season { margin-top: 6px; font-family: var(--sans); font-size: 13px; color: rgba(240, 230, 210, .8); }
.map-season b { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 16px; color: #ffe7b0; margin-right: 8px; }
#announce.secret { color: #d6f6ff; text-shadow: 0 0 30px rgba(143, 227, 255, .7), 0 2px 10px #000; }

#selfHud { position: absolute; left: 22px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.plates { display: flex; gap: 6px; }
.plates i { width: 22px; height: 26px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: linear-gradient(160deg, #fffaf0, #d8cfc0); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .1); transition: opacity .3s, transform .3s; }
.plates i.off { background: rgba(255, 255, 255, .1); }
.plates i.crack { animation: crack .5s; }
@keyframes crack { 0% { transform: scale(1.5) rotate(-8deg); background: #ff8a7a; } 100% { transform: none; } }
.abilities { display: flex; gap: 10px; }
.abil-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: auto; }
.abil-name { font-size: 11px; letter-spacing: .04em; color: var(--muted); max-width: 64px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kit-card { position: absolute; left: 16px; top: 50%; transform: translate(-8px, -40%); width: min(320px, 40vw); padding: 10px 12px; border-radius: 12px; background: rgba(10, 11, 15, .72); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; font-size: 12px; line-height: 1.35; color: rgba(240, 230, 210, .88); opacity: 0; transition: opacity .6s var(--ease), transform .6s var(--ease); pointer-events: none; }
.kit-card.show { opacity: 1; transform: translate(0, -40%); }
.kit-card .kc-row { display: grid; grid-template-columns: 46px 1fr; gap: 8px; align-items: start; }
.kit-card kbd { justify-self: start; min-width: 30px; text-align: center; }
.kit-card b { color: var(--porcelain); font-weight: 600; }
body.onplatform .kit-card.show { opacity: .8; }
.kit-summary { display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.kit-summary .kc-row { display: grid; grid-template-columns: 50px 1fr; gap: 8px; align-items: start; }
.kit-summary b { color: var(--porcelain); font-weight: 600; }
.abil { position: relative; width: 54px; height: 54px; border-radius: 12px; background: rgba(10, 11, 15, .72); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.abil-ico { font-size: 24px; color: var(--porcelain); z-index: 2; }
.abil-cd { position: absolute; inset: 0; background: rgba(0, 0, 0, .65); transform-origin: bottom; transform: scaleY(0); z-index: 3; }
.abil-key { position: absolute; bottom: 2px; right: 4px; font-size: 9px; color: var(--brass2); z-index: 4; letter-spacing: .05em; }
.abil.ready { border-color: var(--line2); box-shadow: 0 0 14px rgba(241, 201, 135, .18); }
.abil.fold.ready { border-color: rgba(143, 227, 255, .6); box-shadow: 0 0 16px rgba(143, 227, 255, .3); }
.abil.flash { animation: abFlash .5s; }
@keyframes abFlash { 0% { box-shadow: 0 0 30px #fff; } }
.abil-pips { position: absolute; top: 3px; left: 4px; display: flex; gap: 2px; z-index: 4; }
.abil-pips i { width: 5px; height: 5px; border-radius: 50%; background: var(--brass2); }
.abil-pips i.off { background: rgba(255, 255, 255, .15); }
.fit-strip { display: flex; flex-direction: column; gap: 5px; }
.fit-frame { display: flex; gap: 2px; }
.fit-frame i { width: 9px; height: 5px; border-radius: 1px; background: rgba(255, 255, 255, .1); }
.fit-frame i.on { background: linear-gradient(#ffe1a0, #c8913f); box-shadow: 0 0 6px rgba(255, 190, 100, .45); }
.fit-chips { display: flex; flex-wrap: wrap; gap: 5px; max-width: 280px; }
.fit-chip { font-size: 11px; letter-spacing: .04em; padding: 2px 7px; border-radius: 9px; background: rgba(10, 11, 15, .7); border: 1px solid color-mix(in srgb, var(--fc, #ffcf7a) 45%, transparent); color: #f0e4cc; }
.fit-chip b { color: var(--fc, #ffd27a); font-weight: 600; margin-left: 4px; }
.fit-chip.max { border-color: var(--fc, #ffd27a); }
.back-key { margin-left: 8px; font-size: 11px; padding: 1px 6px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, .25); color: inherit; vertical-align: 1px; }
.acc-key { margin-left: 8px; font-size: 11px; padding: 1px 6px; border-radius: 4px; background: rgba(20, 17, 12, .35); border: 1px solid rgba(20, 17, 12, .4); color: inherit; vertical-align: 1px; }
.weapon-line { font-size: 13px; color: var(--muted); display: flex; gap: 10px; }
.weapon-line span:first-child { font-family: var(--serif); font-size: 19px; color: var(--porcelain); font-weight: 600; }
#modsHud { position: absolute; right: 18px; bottom: 20px; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.mchip { font-size: 12px; padding: 5px 10px; border-radius: 8px; background: rgba(10, 11, 15, .66); border: 1px solid rgba(255, 255, 255, .07); display: flex; align-items: center; gap: 7px; animation: toastIn .4s var(--ease) both; }
.mchip i { width: 7px; height: 7px; border-radius: 2px; transform: rotate(45deg); }
.tag-fold { background: var(--glass); } .tag-body { background: var(--porcelain); } .tag-equip { background: #b48cff; } .tag-assault { background: #ff8a6b; } .tag-weapon { background: var(--sun); }
.draft-btn { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; padding: 12px 22px; border-radius: 12px; border: 1px solid var(--brass2); background: linear-gradient(180deg, rgba(243, 199, 124, .25), rgba(201, 141, 60, .15)); color: #fff2d8; font-size: 16px; cursor: pointer; animation: glowPulse 1.6s infinite; }
@keyframes glowPulse { 50% { box-shadow: 0 0 34px rgba(255, 200, 110, .5); } }
.gate-msg { position: absolute; top: 46%; left: 50%; transform: translateX(-50%); font-family: var(--serif); font-size: 26px; text-shadow: 0 2px 12px #000; color: var(--sun); }
.rebuild-msg { position: absolute; top: 58%; left: 50%; transform: translateX(-50%); text-align: center; }
.rb-title { font-family: var(--serif); font-size: 28px; font-style: italic; color: var(--sun); text-shadow: 0 0 20px rgba(255, 200, 110, .6); }
.rb-bar { width: 240px; height: 4px; border-radius: 3px; background: rgba(255, 255, 255, .12); margin: 8px auto; overflow: hidden; }
.rb-bar i { display: block; height: 100%; width: 0; background: var(--sun); box-shadow: 0 0 10px var(--sun); }
.rb-hint { font-size: 12px; color: var(--muted); letter-spacing: .1em; }
#netInfo { position: absolute; right: 12px; top: 10px; font-size: 11px; color: #5d5a55; }
#chatLog { position: absolute; left: 18px; bottom: 170px; display: flex; flex-direction: column; gap: 4px; max-width: 380px; }
.chatline { font-size: 13px; background: rgba(10, 11, 15, .55); padding: 4px 9px; border-radius: 7px; transition: opacity 1s; }
.chatline b { margin-right: 6px; }
#chatInput { position: absolute; left: 18px; bottom: 136px; width: 360px; padding: 8px 12px; font-size: 14px; }

/* ---------- draft ---------- */
.draft-inner { text-align: center; max-width: 1040px; padding: 20px; max-height: 100vh; overflow: auto; }
.draft-inner h2 { font-size: 46px; margin: 4px 0 6px; }
.cards { display: flex; gap: 20px; justify-content: center; margin: 30px 0 22px; flex-wrap: wrap; }
.card { width: 280px; min-height: 330px; border-radius: 16px; padding: 26px 22px; text-align: left; cursor: pointer; position: relative; overflow: hidden;
  background: linear-gradient(180deg, #23252f, #15161c); border: 1px solid var(--line); color: var(--porcelain);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5); transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; animation: cardIn .6s var(--ease) both; }
.card:nth-child(2) { animation-delay: .08s; } .card:nth-child(3) { animation-delay: .16s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(40px) rotate(-2deg) scale(.95); } }
.card:hover, .card.focus { transform: translateY(-8px) scale(1.02); border-color: var(--brass2); box-shadow: 0 30px 70px rgba(0, 0, 0, .6), 0 0 40px rgba(241, 201, 135, .22); }
.card::before { content: ""; position: absolute; inset: -40% -40% auto auto; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, var(--cardc, rgba(255, 207, 122, .25)), transparent 70%); opacity: .6; transition: opacity .3s; }
.card:hover::before { opacity: 1; }
.card .ctag { font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--brass); }
.card .cname { font-family: var(--serif); font-size: 31px; font-weight: 600; margin: 14px 0 10px; line-height: 1.05; }
.card .cdesc { font-size: 15px; line-height: 1.5; color: #d6d0c5; }
.card .csym { position: absolute; bottom: 18px; right: 20px; font-size: 54px; opacity: .14; font-family: var(--serif); }
.card .ckey { position: absolute; top: 14px; right: 16px; }
.draft-foot { display: flex; gap: 12px; justify-content: center; position: sticky; bottom: -20px; z-index: 2; margin: 0 -20px -20px; padding: 14px 20px 20px;
  background: linear-gradient(180deg, rgba(8, 9, 12, 0), rgba(8, 9, 12, .95) 35%); }
.replace { margin-bottom: 18px; }

/* ---------- story / sealed / victory ---------- */
.prologue { background: radial-gradient(ellipse at 50% 40%, rgba(40, 26, 14, .55), rgba(2, 2, 4, .985) 70%); cursor: pointer; flex-direction: column; }
.pro-text { max-width: 820px; padding: 24px; text-align: center; min-height: 40vh; display: flex; flex-direction: column; justify-content: center; }
.pro-text p { font-family: var(--serif); font-size: clamp(24px, 2.8vw, 38px); line-height: 1.4; color: #f5ead6; margin: 0 0 16px; opacity: 0; animation: storyLine 1.6s var(--ease) forwards; text-shadow: 0 0 30px rgba(255, 190, 110, .18); }
.pro-text p.vow { font-style: italic; color: #ffe2b0; }
.pro-text p.last { font-size: clamp(20px, 2vw, 26px); letter-spacing: .3em; text-transform: uppercase; font-family: var(--sans); color: #ffcf7a; }
.pro-foot { position: absolute; bottom: 34px; left: 0; right: 0; text-align: center; font-family: var(--sans); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: rgba(240, 230, 210, .45); }
.pro-foot .dots { display: block; margin-bottom: 10px; letter-spacing: .5em; color: rgba(255, 207, 122, .7); }
.voice { position: absolute; left: 50%; bottom: 150px; transform: translate(-50%, 6px); max-width: min(760px, 90vw); text-align: center; pointer-events: none; opacity: 0; transition: opacity .9s var(--ease), transform .9s var(--ease); z-index: 30; }
.voice.show { opacity: 1; transform: translate(-50%, 0); }
.voice-who { font-family: var(--sans); font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: rgba(255, 160, 140, .85); margin-bottom: 4px; }
.voice-text { font-family: var(--serif); font-style: italic; font-size: clamp(19px, 1.9vw, 25px); line-height: 1.35; color: #fff0e0; text-shadow: 0 2px 12px #000, 0 0 2px #000; }
.story { background: radial-gradient(ellipse at center, rgba(8, 8, 10, .6), rgba(3, 3, 5, .97)); }
.story-lines { max-width: 760px; text-align: center; padding: 20px; }
.story-lines p { font-family: var(--serif); font-size: clamp(22px, 2.6vw, 34px); font-style: italic; line-height: 1.35; margin: 0 0 18px; opacity: 0; animation: storyLine 1.2s var(--ease) forwards; color: #f5ead6; }
@keyframes storyLine { from { opacity: 0; transform: translateY(12px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.sealed { background: radial-gradient(ellipse at center, rgba(70, 10, 14, .55), rgba(10, 2, 4, .95)); }
.sealed-inner { text-align: center; animation: sealIn 1s var(--ease); }
.sealed-inner h2 { font-size: clamp(44px, 6vw, 80px); color: #ffb0a0; text-shadow: 0 0 40px rgba(255, 60, 40, .6); margin: 10px 0; }
@keyframes sealIn { from { transform: scale(1.3); opacity: 0; filter: blur(8px); } }
.victory-inner { text-align: center; max-width: 1100px; padding: 20px; max-height: 100vh; overflow: auto; }
.victory-inner h2 { font-size: clamp(56px, 7vw, 96px); background: linear-gradient(180deg, #fff8ea, #f6d79d 60%, #c88d3f); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 30px rgba(255, 200, 120, .4)); }
.victory-lines p { font-family: var(--serif); font-style: italic; font-size: 22px; color: #efe3cd; margin: 6px 0; opacity: 0; animation: storyLine 1.2s var(--ease) forwards; }
.victory-meta { margin: 18px 0; color: var(--muted); display: flex; gap: 26px; justify-content: center; flex-wrap: wrap; font-size: 14px; }
.victory-meta b { color: var(--porcelain); font-weight: 600; }
.victory-crew { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin: 20px 0; }
.vc { width: 230px; padding: 16px; border-radius: 14px; background: rgba(255, 255, 255, .035); border: 1px solid var(--line); text-align: left; opacity: 0; animation: fadeUp .7s var(--ease) forwards; }
.vc .vn { font-family: var(--serif); font-size: 22px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.vc .vn i { width: 10px; height: 10px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.vc .vw { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.vc dl { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; margin: 0; font-size: 13px; }
.vc dt { color: var(--muted); } .vc dd { margin: 0; text-align: right; font-weight: 500; }
.vc .award { margin-top: 10px; font-size: 12px; color: var(--sun); font-style: italic; font-family: var(--serif); font-size: 16px; }

/* ---------- menu / settings ---------- */
.menu-inner, .how-inner { width: min(760px, 94vw); max-height: 88vh; overflow: auto; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; color: var(--muted); padding: 10px 16px; font-size: 15px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .2s, border-color .2s; }
.tab.active { color: var(--brass2); border-color: var(--brass2); }
.menu-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.set-row { display: grid; grid-template-columns: 1fr 220px; gap: 14px; align-items: center; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, .04); font-size: 14px; }
.set-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.set-row input[type=range] { width: 100%; accent-color: var(--brass); }
.set-row select { background: var(--stone2); color: var(--porcelain); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; font-family: inherit; }
.switch { justify-self: end; position: relative; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 12px; background: rgba(255, 255, 255, .12); cursor: pointer; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #ddd; transition: transform .2s; }
.switch input:checked + span { background: var(--brass); }
.switch input:checked + span::after { transform: translateX(20px); background: #fff; }
.bind-row { display: grid; grid-template-columns: 1fr 120px 120px; gap: 10px; align-items: center; padding: 6px 0; font-size: 14px; border-bottom: 1px solid rgba(255, 255, 255, .04); }
.bind-row button { background: rgba(255, 255, 255, .04); border: 1px solid var(--line); color: var(--porcelain); border-radius: 7px; padding: 6px; cursor: pointer; font-size: 13px; }
.bind-row button.listen { border-color: var(--sun); color: var(--sun); animation: blink 1s infinite; }
.bind-row .pad { color: var(--muted); font-size: 12px; text-align: center; }
.how-inner h2 { margin-bottom: 14px; }
.how-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
@media (max-width: 700px) { .how-grid { grid-template-columns: 1fr; } }
.how-grid p { font-size: 14px; line-height: 1.55; color: #d0cabe; margin: 0; }
#howControls { margin-bottom: 16px; }
.ctrl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 18px; font-size: 13px; color: #cfc9be; }
.ctrl-grid div { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid rgba(255, 255, 255, .04); }
.journal-entry { padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.journal-entry h4 { margin-bottom: 4px; }
.journal-entry p { margin: 0; font-family: var(--serif); font-style: italic; font-size: 18px; color: #e6dccb; }
.journal-entry.locked p { font-style: normal; font-family: var(--sans); font-size: 13px; color: var(--muted); }
/* feats: the journal's second page, the popup, and the reclaim screen's line */
.tab-count { font-size: 11px; color: var(--sun); margin-left: 4px; }
.feats-head { margin: 4px 0 8px; font-size: 14px; color: #d0cabe; }
.feats-head b { font-family: var(--serif); font-size: 26px; color: var(--sun); margin-right: 4px; }
.feats-head small { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
#featsBody h3 { margin: 20px 0 8px; }
#featsBody h3 small { font-family: var(--sans); font-size: 12px; color: var(--muted); margin-left: 6px; }
.feats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.feat { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .06); background: rgba(255, 255, 255, .02); }
.feat h4 { margin: 0 0 2px; font-size: 14px; color: var(--muted); }
.feat p { margin: 0; font-size: 12px; line-height: 1.4; color: var(--muted); }
.feat small { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.feat-mark { font-size: 16px; color: rgba(255, 255, 255, .25); line-height: 1.2; }
.feat.got { border-color: var(--line); background: rgba(217, 165, 90, .06); }
.feat.got h4 { color: var(--porcelain); }
.feat.got p { color: #d0cabe; }
.feat.got .feat-mark { color: var(--sun); text-shadow: 0 0 10px rgba(255, 207, 122, .6); }
.feat-bar { height: 3px; margin-top: 6px; border-radius: 2px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.feat-bar i { display: block; height: 100%; background: var(--brass); }
#featPop { position: fixed; right: 24px; bottom: 120px; z-index: 60; width: min(320px, 80vw); padding: 14px 18px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(10, 11, 15, .86); box-shadow: 0 0 40px rgba(255, 200, 120, .18); pointer-events: none; opacity: 0; transform: translateX(24px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
#featPop.show { opacity: 1; transform: none; }
.fp-eyebrow { font-size: 10px; letter-spacing: .25em; text-transform: uppercase; color: var(--sun); }
.fp-eyebrow::before { content: '✦ '; }
.fp-name { font-family: var(--serif); font-size: 24px; font-weight: 600; color: #fff6e6; margin: 2px 0; }
.fp-desc { font-size: 13px; line-height: 1.4; color: #d0cabe; }
.fp-more { margin-top: 6px; font-size: 11px; color: var(--muted); }
.feats-earned { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; margin: 10px 0; font-family: var(--serif); font-size: 18px; color: var(--sun); animation: cardIn .7s 2.4s var(--ease) both; }
.feats-earned small { width: 100%; text-align: center; font-family: var(--sans); font-size: 10px; letter-spacing: .25em; text-transform: uppercase; color: var(--muted); }

#fade { position: fixed; inset: 0; background: #000; z-index: 90; pointer-events: none; opacity: 1; transition: opacity .9s ease; }
#fade.clear { opacity: 0; }
#connecting { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; gap: 14px; background: rgba(5, 5, 8, .8); font-family: var(--serif); font-size: 22px; font-style: italic; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 207, 122, .2); border-top-color: var(--sun); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#errorBox { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 95; padding: 12px 20px; border-radius: 10px; background: rgba(60, 12, 14, .92); border: 1px solid rgba(255, 90, 90, .5); color: #ffd0c8; font-size: 14px; animation: toastIn .3s; }
::-webkit-scrollbar { width: 8px; } ::-webkit-scrollbar-thumb { background: rgba(217, 165, 90, .25); border-radius: 4px; }

@media (max-width: 700px) {
  .lobby-head h2 { font-size: 32px; }
  .code { font-size: 32px; }
  .lobby-foot { flex-wrap: wrap; }
}
.legal { margin-top: 18px; font-size: 12px; color: var(--muted); }
.legal a { color: var(--muted); text-decoration: none; }
.legal a:hover { color: var(--brass2); }

.afterlight { margin-top: 10px; }
.small { font-size: 13px; margin: 0 0 10px; }
.pick.locked { opacity: .45; cursor: not-allowed; }
.pick.locked .ps::before { content: "🔒 "; }
.pick .borrowed { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--glass); margin-left: 6px; }
.pick .cgood { color: #b9ffd2; font-size: 12px; margin-top: 4px; }
.pick .cbad { color: #ffc0b0; font-size: 12px; margin-top: 2px; }
.prompt { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); padding: 10px 18px; border-radius: 10px; background: rgba(10, 11, 15, .78); border: 1px solid var(--line2); font-size: 15px; display: flex; gap: 10px; align-items: center; animation: toastIn .3s var(--ease); }
.lore { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); width: min(380px, 40vw); padding: 20px 22px; border-radius: 14px; background: linear-gradient(180deg, rgba(40, 32, 22, .92), rgba(20, 16, 12, .94)); border: 1px solid var(--line2); box-shadow: 0 20px 60px rgba(0, 0, 0, .6); animation: toastIn .5s var(--ease); }
.lore p { font-family: var(--serif); font-style: italic; font-size: 20px; line-height: 1.45; color: #f0e4cc; margin: 10px 0 0; }
.unlocks { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 14px 0; }
.unlock { padding: 10px 16px; border-radius: 10px; border: 1px solid rgba(143, 227, 255, .5); background: rgba(143, 227, 255, .08); font-family: var(--serif); font-size: 20px; animation: cardIn .7s var(--ease) both; }
.unlock small { display: block; font-family: var(--sans); font-size: 10px; letter-spacing: .25em; text-transform: uppercase; color: var(--glass); }
.conds-hud { position: absolute; right: 18px; top: 34px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.conds-hud span { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #ffd6a0; background: rgba(10, 11, 15, .6); padding: 3px 8px; border-radius: 6px; border: 1px solid rgba(255, 207, 122, .3); }

#lobby.modal { background: rgba(6, 7, 10, .82); backdrop-filter: blur(4px); z-index: 45; }
.map-inner { width: min(860px, 94vw); max-height: 90vh; overflow: auto; }
.map-inner h2 { font-size: 40px; margin: 4px 0 6px; }
.map-crew { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.map-crew span { padding: 6px 12px; border-radius: 8px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); font-size: 13px; }
.map-crew span.ready { border-color: rgba(125, 255, 178, .45); color: var(--good); }
/* what closes a panel stays in view: its foot sticks to the bottom while the contents scroll */
.map-foot, .panel-foot { position: sticky; bottom: -22px; z-index: 2; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
  margin: 16px -22px -22px; padding: 14px 22px 22px; border-radius: 0 0 14px 14px;
  background: linear-gradient(180deg, rgba(16, 17, 23, 0), rgba(16, 17, 23, .97) 35%); }
.platform-hud { position: absolute; right: 18px; top: 18px; pointer-events: auto; padding: 12px 14px; border-radius: 12px; background: rgba(10, 11, 15, .62); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.small-code { font-size: 26px; }
.pf-actions { display: flex; gap: 6px; }
.toggle.small { margin-top: 2px; font-size: 12px; }
.pf-hint { font-size: 12px; color: var(--muted); }
.prompt.station { bottom: 150px; font-family: var(--serif); font-size: 20px; }
body.onplatform #selfHud .abilities, body.onplatform #modsHud { opacity: .7; }

/* ---- the district map ---- */
.minimap { position: absolute; right: 16px; top: 16px; padding: 8px 8px 6px; border-radius: 14px; background: linear-gradient(180deg, rgba(16,15,20,.82), rgba(10,10,14,.86)); border: 1px solid rgba(255,207,122,.28); box-shadow: 0 10px 30px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.03); pointer-events: none; }
.minimap canvas { display: block; border-radius: 9px; background: radial-gradient(circle at 50% 50%, rgba(40,36,44,.6), rgba(8,8,12,.7)); }
.mm-foot { display: flex; gap: 10px; align-items: center; justify-content: space-between; font-size: 11px; letter-spacing: .06em; color: #d8cfc0; padding: 6px 2px 0; }
.mm-foot kbd { font-size: 10px; padding: 1px 5px; }
.mm-foot .mm-key { color: rgba(216,207,192,.6); }
#mmGreat { color: #ffcf7a; }
body.onplatform .minimap { display: none; }
.minimap ~ .conds-hud { top: 250px; }
.gather { position: absolute; left: 50%; top: 118px; transform: translateX(-50%); padding: 10px 20px; border-radius: 12px; background: rgba(10,11,15,.82); border: 1px solid rgba(255,207,122,.45); font-family: var(--serif); font-size: 19px; color: #ffe7b0; text-align: center; animation: toastIn .3s var(--ease); }
.gather small { display: block; font-family: var(--sans); font-size: 12px; letter-spacing: .08em; color: rgba(235,225,205,.75); margin-top: 2px; }
.hold { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); font-family: var(--serif); font-size: 30px; color: #ffcf7a; text-shadow: 0 2px 12px rgba(0,0,0,.7); }
.map-screen { position: fixed; inset: 0; z-index: 40; background: radial-gradient(ellipse at 50% 45%, rgba(18,16,22,.86), rgba(4,4,6,.95)); animation: fadeIn .2s ease; }
.map-screen canvas { position: absolute; inset: 0; cursor: grab; }
.map-screen canvas:active { cursor: grabbing; }
.map-head { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); text-align: center; pointer-events: none; }
.map-head .eyebrow { font-size: 13px; }
.map-status { font-family: var(--serif); font-size: 24px; color: #f3eee6; margin-top: 4px; }
.map-keys { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #ffcf7a; margin-top: 4px; }
.map-legend { position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%); display: flex; gap: 18px; font-size: 12px; color: #d8cfc0; pointer-events: none; flex-wrap: wrap; justify-content: center; }
.map-legend span { display: flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 10px; height: 10px; transform: rotate(45deg); }
.lg-draft { background: #ffd27a; } .lg-elite { background: #d8b8ff; } .lg-repair { background: #ffb36b; transform: none; border-radius: 2px; } .lg-key { background: #ffe08a; border-radius: 50%; transform: none; } .lg-memory { background: #9fd8ff; transform: none; } .lg-calm { background: #9fe8ff; border-radius: 50% 50% 2px 2px; transform: none; } .lg-boss { background: #ff9a7a; transform: none; clip-path: polygon(0 100%, 0 30%, 25% 60%, 50% 0, 75% 60%, 100% 30%, 100% 100%); }
.map-hint { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); font-size: 12px; color: rgba(216,207,192,.65); pointer-events: none; white-space: nowrap; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 700px) { .minimap canvas { width: 170px !important; height: 116px !important; } .map-hint { white-space: normal; text-align: center; width: 90%; } }

/* ---- focus without a mouse ---- */
.btn:focus-visible, .btn.navfocus, .pick:focus-visible, .pick.navfocus, .tab:focus-visible, .tab.navfocus, .link:focus-visible, .link.navfocus,
.bind-row button:focus-visible, .bind-row button.navfocus, .open-rooms .room.navfocus, select:focus-visible, select.navfocus,
input[type=range]:focus-visible, input[type=range].navfocus, label.switch.navfocus, .colors button.navfocus, .colors button:focus-visible {
  outline: 2px solid #f1c987; outline-offset: 3px; box-shadow: 0 0 0 6px rgba(241, 201, 135, .14), 0 0 22px rgba(255, 190, 110, .25);
}
.card:focus-visible, .card.navfocus { outline: 2px solid #f1c987; outline-offset: 4px; transform: translateY(-8px); box-shadow: 0 0 0 6px rgba(241, 201, 135, .14), 0 18px 50px rgba(0, 0, 0, .55), 0 0 30px rgba(255, 190, 110, .25); }
.t-item.navfocus { color: #fff6e6; transform: translateX(10px); text-shadow: 0 0 22px rgba(255, 200, 120, .35); outline: none; }
.t-item.navfocus::before { width: 26px; }
.t-item.navfocus::after { transform: rotate(45deg) scale(1); }
.t-item:focus { outline: none; }

.mm-stir { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 2px 0; font-size: 11px; letter-spacing: .06em; color: #d8cfc0; }
.mm-stir .rest { color: #9fffb0; }
.mm-stir .hot { color: #ff9a7a; }
.mm-stir .pips { display: flex; gap: 3px; }
.mm-stir i { position: relative; width: 14px; height: 6px; border-radius: 2px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.mm-stir i.on { background: linear-gradient(90deg, #ff9a6b, #ff6b5b); box-shadow: 0 0 6px rgba(255, 107, 91, .5); }
.mm-stir i b { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255, 154, 107, .55); }
.rebuild-msg.held .rb-bar { display: none; }
.fit-choose { max-width: 720px; }
.fit-choose h2 { font-size: 38px; }
#fitChooseList { justify-content: center; margin: 14px 0 18px; }
/* feats on the platform: the card under the crew code; the title's count */
.feat-card { width: 230px; margin-top: 6px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line2); background: rgba(217, 165, 90, .07); color: var(--porcelain); text-align: left; cursor: pointer; font: inherit; transition: background .2s, border-color .2s; }
.feat-card:hover, .feat-card.navfocus { background: rgba(217, 165, 90, .16); border-color: var(--brass2); }
.fc-head { font-family: var(--serif); font-size: 18px; }
.fc-head b { color: var(--sun); margin-left: 4px; }
.fc-head small { color: var(--muted); font-family: var(--sans); font-size: 12px; margin-left: 3px; }
.fc-star { color: var(--sun); text-shadow: 0 0 10px rgba(255, 207, 122, .6); }
.fc-sub { margin: 6px 0 2px; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.feat-next { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; align-items: baseline; margin-top: 5px; font-size: 13px; }
.feat-next small { color: var(--muted); font-size: 11px; }
.feat-next .feat-bar { grid-column: 1 / -1; margin-top: 3px; }
.feats-next { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 18px; }
.t-count { font-size: .75em; color: var(--sun); margin-left: 6px; }
.victory-foot { display: flex; gap: 12px; justify-content: center; position: sticky; bottom: -20px; z-index: 2; margin: 0 -20px -20px; padding: 14px 20px 20px;
  background: linear-gradient(180deg, rgba(8, 9, 12, 0), rgba(8, 9, 12, .95) 35%); }
