/* Frontier: Cold Front - website. Visual language of the in-game main menu (art/menu):
   gunmetal riveted frames, CRT radar panels, red bevelled buttons with gold text,
   Russo One for display, Share Tech Mono for readouts. Phone first. */
:root {
  --bg: #07080a;
  --gold: #ffcf5c;
  --gold-2: #e69a2a;
  --amber: #ffb13b;
  --text: #e8e2d6;
  --muted: #a59d8f;
  --red: #e2392c;
  --blue: #3f9bff;
  --tint: 255, 90, 60;              /* CRT tint (rgb) */
  --ok: #5dff6a;
  --font: "Russo One", "Rubik", system-ui, sans-serif;
  --mono: "Share Tech Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --gutter: 16px;
  --maxw: 1180px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); font: 400 16px/1.5 var(--mono);
  background: radial-gradient(120% 80% at 50% 0%, rgba(7,8,10,0.2), rgba(7,8,10,0.92) 70%), url("../assets/bg.webp") center top / cover fixed, var(--bg);
  overflow-x: hidden;
}
img { max-width: 100%; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: #fff1c4; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--gold); color: #000; padding: 8px 12px; font-family: var(--font); }
.skip:focus { top: 8px; }
h1, h2, h3 { font-family: var(--font); font-weight: 400; letter-spacing: 0.06em; line-height: 1.15; margin: 0; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------------------------------------------------------------- top bar */
.top {
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(#2b2e33, #1b1d20 60%, #141517);
  border-bottom: 2px solid #050506;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 6px 18px rgba(0,0,0,0.6);
}
.top::after { /* rivets along the bar */
  content: ""; position: absolute; left: 0; right: 0; bottom: 5px; height: 6px; pointer-events: none; opacity: 0.8;
  background: radial-gradient(circle at 3px 3px, #8d939b 0 1.6px, #222428 2px 2.8px, transparent 3px) 10px 0 / 120px 6px repeat-x;
}
.top-in { display: flex; align-items: center; gap: 12px; min-height: 58px; padding-top: env(safe-area-inset-top, 0); }
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 40px; width: auto; display: block; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.7)); }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  font: 400 13px var(--font); letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; color: #cfc6b4;
  padding: 8px 12px; border-radius: 4px; white-space: nowrap;
}
.nav a:hover { color: var(--gold); background: rgba(255,255,255,0.04); }
.nav a[aria-current="page"] { color: var(--gold); box-shadow: inset 0 -2px 0 var(--gold-2); }
.top .spacer { flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 12px 4px 6px; border-radius: 6px;
  text-decoration: none; color: var(--text); font: 400 13px var(--mono); white-space: nowrap; max-width: 46vw;
  background: linear-gradient(#0b0c0e, #141517); border: 1px solid #000;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.9), 0 1px 0 rgba(255,255,255,0.08);
}
.chip:hover { color: #fff; }
.chip .lv { font: 400 12px var(--font); color: #111; background: var(--gold); border-radius: 3px; padding: 1px 5px; flex: none; }
.chip .nm { overflow: hidden; text-overflow: ellipsis; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 6px var(--blue); flex: none; }
.chip .dot.red { background: var(--red); box-shadow: 0 0 6px var(--red); }
.chip.login { padding: 4px 14px; color: var(--gold); font-family: var(--font); letter-spacing: 0.08em; text-transform: uppercase; font-size: 13px; }

/* ---------------------------------------------------------------- buttons (nine-sliced red plate from the menu) */
.btn {
  --bh: 52px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--bh); min-width: 0; padding: 0; margin: 0; cursor: pointer; text-decoration: none;
  border-style: solid; border-color: transparent; border-width: 0 calc(var(--bh) * 0.36);
  border-image: url("../assets/button.webp") 0 64 fill / 0 calc(var(--bh) * 0.36) stretch;
  background: none; color: #ffd562;
  font: 400 calc(var(--bh) * 0.32) var(--font); letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
  text-shadow: 0 -1px 0 #fff3c2aa, 1px 1px 0 #4a0e04, -1px 1px 0 #4a0e04, 0 2px 0 #4a0e04, 0 3px 5px rgba(0,0,0,0.7), 0 0 12px rgba(255,190,70,0.35);
  transition: filter .12s, transform .08s; touch-action: manipulation;
}
.btn:hover, .btn:focus-visible { filter: brightness(1.18) saturate(1.1); color: #ffe07a; }
.btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }
.btn:active { filter: brightness(0.85); transform: translateY(1px) scale(0.99); }
.btn[disabled], .btn[aria-disabled="true"] { filter: grayscale(0.9) brightness(0.6); cursor: not-allowed; }
.btn.big { --bh: 66px; }
.btn.small { --bh: 40px; }
.btn.block { display: flex; width: 100%; }
.btn.primary::before {
  content: ""; position: absolute; inset: 6px calc(var(--bh) * -0.2); border-radius: 6px; pointer-events: none;
  box-shadow: 0 0 18px 2px rgba(255,140,40,0.35); animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 26px 5px rgba(255,150,50,0.55); } }
/* dark steel secondary button */
.btn2 {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; cursor: pointer;
  font: 400 13px var(--font); letter-spacing: 0.1em; text-transform: uppercase; color: #ddd4c2; text-decoration: none;
  border-radius: 5px; border: 1px solid #000;
  background: linear-gradient(#3b3e44, #26282c 60%, #1f2124);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.18), inset -1px -1px 0 rgba(0,0,0,0.6), 0 3px 8px rgba(0,0,0,0.5);
}
.btn2:hover { filter: brightness(1.15); color: #fff; }
.btn2:active { transform: translateY(1px); }
.btn2.danger { color: #ffb4a8; background: linear-gradient(#4a2522, #2e1715); }
.btn2[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------------------------------------------------------------- steel panel (nine-sliced menu panel) */
.panel {
  position: relative; isolation: isolate; --ps: 0.42;
  padding: calc(64px * var(--ps)) calc(66px * var(--ps)) calc(70px * var(--ps));
  filter: drop-shadow(0 14px 22px rgba(0,0,0,0.6));
}
.panel::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  border-style: solid; border-color: transparent; border-width: calc(100px * var(--ps));
  border-image: url("../assets/panel.webp") 100 fill / calc(100px * var(--ps)) stretch;
}
/* plate with the header art and CRT text */
.plate {
  position: relative; aspect-ratio: 800 / 213; width: min(100%, 420px); margin: 0 auto 8px;
  background: url("../assets/header.webp") center / 100% 100% no-repeat;
}
.plate > * {
  position: absolute; left: 11%; right: 11%; top: 21%; bottom: 20%; display: grid; place-content: center; text-align: center;
  font: 400 clamp(15px, 4.2vw, 19px) var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: rgb(var(--tint));
  text-shadow: 0 0 8px rgba(var(--tint), 0.9); border-radius: 4px; margin: 0;
  background: repeating-linear-gradient(transparent 0 2px, rgba(0,0,0,0.35) 2px 3px);
}
.plate small { display: block; font-size: 0.62em; letter-spacing: 0.22em; opacity: 0.7; margin-top: 1px; }

/* riveted card (like the faction cards) */
.card {
  --fc: var(--gold-2); position: relative; padding: 16px; border-radius: 6px; color: var(--text);
  background:
    radial-gradient(circle at 9px 9px, #9aa0a8 0 2px, #2a2c30 2.5px 3.5px, transparent 4px),
    radial-gradient(circle at calc(100% - 9px) 9px, #9aa0a8 0 2px, #2a2c30 2.5px 3.5px, transparent 4px),
    radial-gradient(circle at 9px calc(100% - 9px), #9aa0a8 0 2px, #2a2c30 2.5px 3.5px, transparent 4px),
    radial-gradient(circle at calc(100% - 9px) calc(100% - 9px), #9aa0a8 0 2px, #2a2c30 2.5px 3.5px, transparent 4px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 3px),
    linear-gradient(#3b3e44, #26282c 60%, #1f2124);
  border: 2px solid #0c0d0e;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.2), inset -1px -1px 0 rgba(0,0,0,0.6), 0 8px 18px rgba(0,0,0,0.6);
}
.card.blue { --fc: var(--blue); }
.card.red { --fc: var(--red); }

/* CRT screen */
.crt {
  --tint: 255, 90, 60;
  position: relative; overflow: hidden; border-radius: 6px; color: rgb(var(--tint));
  background:
    repeating-linear-gradient(transparent 0 2px, rgba(0,0,0,0.3) 2px 3px),
    linear-gradient(90deg, rgba(var(--tint),0.07) 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(rgba(var(--tint),0.07) 1px, transparent 1px) 0 0 / 18px 18px,
    radial-gradient(100% 90% at 50% 40%, rgba(var(--tint),0.16), #050506 85%);
  border: 1px solid #000;
  box-shadow: inset 0 3px 12px rgba(0,0,0,0.95), 0 0 0 3px #2b2d31, 0 0 0 4px #0c0c0d, 0 1px 0 4px rgba(255,255,255,0.08);
  text-shadow: 0 0 6px rgba(var(--tint),0.7);
}
.crt::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255,255,255,0.07), transparent 35%); pointer-events: none; }
.crt.blue { --tint: 90, 170, 255; }
.crt.amber { --tint: 255, 177, 59; }
.crt.green { --tint: 93, 255, 106; }

/* amber terminal strip */
.status {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 14px; border-radius: 8px;
  background: linear-gradient(#0b0c0e, #141517); border: 1px solid #000;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.9), 0 1px 0 rgba(255,255,255,0.08), 0 0 0 3px #2a2c30, 0 0 0 4px #0b0b0c;
  font: 400 14px var(--mono); color: var(--amber); text-shadow: 0 0 6px rgba(255,160,40,0.6);
}
.status::before { content: "\25B6"; font-size: 10px; opacity: 0.8; flex: none; }
.status .caret { width: 8px; height: 15px; background: currentColor; flex: none; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

.led { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #3a1010; box-shadow: inset 0 1px 2px rgba(0,0,0,0.8), 0 0 0 2px #1a1b1d; flex: none; }
.led.g { background: var(--ok); box-shadow: 0 0 8px #3dff5a, 0 0 0 2px #1a1b1d; }
.led.a { background: var(--amber); box-shadow: 0 0 8px #ff9a20, 0 0 0 2px #1a1b1d; animation: blink 1.4s steps(1) infinite; }

/* faction tag */
.ftag { display: inline-flex; align-items: center; gap: 6px; font: 400 12px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; padding: 2px 8px 1px 6px; border-radius: 3px; background: rgba(0,0,0,0.45); color: #cfe3ff; box-shadow: inset 0 1px 2px rgba(0,0,0,0.7), 0 1px 0 rgba(255,255,255,0.08); }
.ftag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 6px var(--blue); }
.ftag.red { color: #ffd0c8; }
.ftag.red::before { background: var(--red); box-shadow: 0 0 6px var(--red); }

/* emblem placeholder: the menu emblem, tinted per emblem id */
.emblem { display: inline-block; aspect-ratio: 360 / 486; width: 44px; background: url("../assets/emblem.webp") center / contain no-repeat; filter: drop-shadow(0 3px 4px rgba(0,0,0,0.7)); flex: none; }
.emblem[data-e="chevron-2"] { filter: drop-shadow(0 3px 4px #000) hue-rotate(160deg) saturate(0.7); }
.emblem[data-e="star-bronze"] { filter: drop-shadow(0 3px 4px #000) sepia(0.7) saturate(1.6) hue-rotate(-12deg) brightness(0.85); }
.emblem[data-e="wings"] { filter: drop-shadow(0 0 6px rgba(90,170,255,0.6)) hue-rotate(185deg); }
.emblem[data-e="star-silver"] { filter: drop-shadow(0 3px 4px #000) grayscale(1) brightness(1.25); }
.emblem[data-e="snowflake"] { filter: drop-shadow(0 0 8px rgba(140,220,255,0.7)) hue-rotate(170deg) brightness(1.15); }
.emblem[data-e="star-gold"], .emblem[data-e="laurel"] { filter: drop-shadow(0 0 8px rgba(255,200,80,0.6)) sepia(0.6) saturate(2.2) brightness(1.1); }
.emblem[data-e="frontier-crest"], .emblem[data-e="diamond"] { filter: drop-shadow(0 0 10px rgba(255,90,60,0.7)) saturate(1.8) hue-rotate(-20deg); }

/* XP bar: segmented gold */
.xpbar { position: relative; height: 18px; border-radius: 4px; overflow: hidden; background: #0b0c0d; box-shadow: inset 0 2px 5px #000, 0 1px 0 rgba(255,255,255,0.1); }
.xpbar i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(#ffe39a, #f0a828 55%, #b8650f); box-shadow: 0 0 10px rgba(255,180,60,0.6); transition: width 1.2s cubic-bezier(.2,.8,.2,1); }
.xpbar::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 9px, rgba(0,0,0,0.55) 9px 11px); pointer-events: none; }
.xpmeta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 6px; }

/* tables in CRT panels */
.board { width: 100%; border-collapse: collapse; font: 400 15px var(--mono); position: relative; z-index: 1; }
.board th { text-align: left; font-weight: 400; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.7; padding: 10px 10px 6px; border-bottom: 1px solid rgba(var(--tint),0.35); }
.board td { padding: 9px 10px; border-bottom: 1px solid rgba(var(--tint),0.12); vertical-align: middle; }
.board tr:last-child td { border-bottom: 0; }
.board .r { text-align: right; white-space: nowrap; }
.board .rank { width: 3.2em; color: #fff; }
.board a { color: #fff; text-decoration: none; text-shadow: 0 0 6px rgba(var(--tint),0.9); }
.board a:hover { text-decoration: underline; }
.board tr.me td { background: rgba(255,177,59,0.13); }
.board .who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.board .who .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .who .emblem { width: 22px; }
.board .lvl { color: var(--gold); font-size: 13px; }
.board .top1 .rank { color: var(--gold); }
.board .fd { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 6px var(--blue); flex: none; }
.board .fd.red { background: var(--red); box-shadow: 0 0 6px var(--red); }
.empty { padding: 28px 16px; text-align: center; position: relative; z-index: 1; }

/* forms */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label, .legend { font: 400 12px var(--font); letter-spacing: 0.14em; text-transform: uppercase; color: #cdbf9f; }
.field input, .field select {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 5px; border: 1px solid #000;
  font: 400 17px var(--mono); color: #fff; background: #0c0d0f;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.9), 0 1px 0 rgba(255,255,255,0.1);
}
.field input:focus-visible, .field select:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
.field input[aria-invalid="true"] { box-shadow: inset 0 2px 6px rgba(0,0,0,0.9), 0 0 0 2px var(--red); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.field .err { font-size: 13px; color: #ff8f80; min-height: 0; }
.field .err:empty { display: none; }
.formmsg { padding: 10px 12px; border-radius: 5px; font-size: 14px; background: rgba(0,0,0,0.45); box-shadow: inset 0 1px 3px #000; }
.formmsg:empty { display: none; }
.formmsg.bad { color: #ffb0a4; box-shadow: inset 0 1px 3px #000, 0 0 0 1px rgba(226,57,44,0.6); }
.formmsg.good { color: #b6ffbd; box-shadow: inset 0 1px 3px #000, 0 0 0 1px rgba(93,255,106,0.4); }
.links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; font-size: 14px; }
.fpick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border: 0; padding: 0; margin: 0; }
.fpick legend { margin-bottom: 6px; }
.fopt { position: relative; }
.fopt input { position: absolute; opacity: 0; inset: 0; }
.fopt label {
  display: grid; justify-items: center; gap: 4px; padding: 10px 8px 9px; border-radius: 6px; cursor: pointer; text-align: center;
  background: linear-gradient(#34373c, #222428); border: 2px solid #0c0d0e;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.15), 0 4px 10px rgba(0,0,0,0.5);
  font: 400 15px var(--font); letter-spacing: 0.1em; text-transform: uppercase;
}
.fopt label img { height: 62px; width: auto; filter: drop-shadow(0 3px 3px rgba(0,0,0,0.6)); }
.fopt label small { font: 400 11.5px var(--mono); letter-spacing: 0.02em; text-transform: none; color: var(--muted); }
.fopt.blue label { color: #9dcbff; } .fopt.red label { color: #ffaa9f; }
.fopt input:checked + label { border-color: var(--fc); box-shadow: 0 0 0 2px #000, 0 0 18px color-mix(in srgb, var(--fc) 55%, transparent); }
.fopt.blue { --fc: var(--blue); } .fopt.red { --fc: var(--red); }
.fopt input:focus-visible + label { outline: 2px solid var(--amber); outline-offset: 2px; }

/* auth page layout */
.authpage { padding: 22px var(--gutter) 40px; display: grid; justify-items: center; }
.authpage .panel { width: min(100%, 470px); }
.authpage .form { padding: 4px 4px 2px; }

/* ---------------------------------------------------------------- footer */
.foot { margin-top: 48px; padding: 22px 0 calc(28px + env(safe-area-inset-bottom, 0)); border-top: 2px solid #050506; background: linear-gradient(#141517, #0b0c0d); box-shadow: inset 0 1px 0 rgba(255,255,255,0.06); font-size: 13px; color: var(--muted); }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.foot a { color: #cfc6b4; text-decoration: none; }
.foot a:hover { color: var(--gold); }
.foot .ver { margin-left: auto; }

/* section headings */
.sect { margin-top: 44px; }
.sect-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sect-h h2 { font-size: clamp(20px, 5vw, 28px); color: var(--gold); text-shadow: 0 0 10px rgba(255,170,60,0.35), 0 2px 0 #000; text-transform: uppercase; }
.sect-h a { font-size: 14px; white-space: nowrap; }
.kicker { font: 400 12px var(--mono); letter-spacing: 0.3em; text-transform: uppercase; color: rgb(var(--tint)); text-shadow: 0 0 8px rgba(var(--tint), 0.7); }

/* tabs */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 8px; margin: 0 -2px; }
.tabs::-webkit-scrollbar { display: none; }
@media (max-width: 559px) { .tabs { flex-wrap: wrap; overflow: visible; } .tab { flex: 1 1 auto; } }
.tab {
  flex: none; min-height: 42px; padding: 0 14px; cursor: pointer; border-radius: 5px; border: 1px solid #000;
  font: 400 13px var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: #cfc6b4;
  background: linear-gradient(#34373c, #222428); box-shadow: inset 1px 1px 0 rgba(255,255,255,0.14), 0 3px 8px rgba(0,0,0,0.5);
}
.tab:hover { color: #fff; }
.tab[aria-selected="true"] { color: #ffd562; background: linear-gradient(#c8281c, #8e140c); box-shadow: inset 0 1px 0 rgba(255,220,180,0.45), inset 0 -2px 0 rgba(0,0,0,0.35), 0 0 12px rgba(255,90,40,0.35); text-shadow: 0 1px 0 #4a0e04, 0 0 8px rgba(255,190,70,0.4); }
.tab .fd { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--blue); }
.tab .fd.red { background: #ff6a5a; }

.pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; font-size: 14px; color: var(--muted); }

.muted { color: var(--muted); }
.gold { color: var(--gold); }
.mono { font-family: var(--mono); }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------- phone header */
@media (max-width: 719px) {
  .top-in { flex-wrap: wrap; gap: 6px 10px; min-height: 0; padding-top: calc(env(safe-area-inset-top, 0px) + 8px); padding-bottom: 10px; }
  .brand img { height: 34px; }
  .nav { order: 3; width: 100%; margin: 0; justify-content: space-between; border-top: 1px solid rgba(0,0,0,0.6); box-shadow: 0 -1px 0 rgba(255,255,255,0.05); padding-top: 4px; }
  .nav a { flex: 1; text-align: center; padding: 8px 4px; font-size: 12px; }
  .top::after { display: none; }
}
