@font-face {
  font-family: "Pager Mono";
  src: local("IBM Plex Mono"), local("Cascadia Mono"), local("JetBrains Mono"), local("Courier New");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #030303;
  --panel: #070606;
  --panel-soft: #0b0707;
  --red: #d32b27;
  --red-hot: #ef3933;
  --red-mid: #7e201e;
  --red-dim: #421313;
  --line: rgba(211, 43, 39, .55);
  --muted: #7d4644;
  --quiet: #4e4242;
  --frame: #383d3d;
  --font: "Pager Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: #000; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--red);
  background:
    radial-gradient(ellipse at 16% 48%, transparent 0 7%, rgba(91, 21, 20, .22) 7.2% 7.5%, transparent 7.8% 11%, rgba(91, 21, 20, .18) 11.2% 11.5%, transparent 11.8% 16%),
    radial-gradient(ellipse at 82% 42%, transparent 0 8%, rgba(91, 21, 20, .2) 8.2% 8.45%, transparent 8.7% 13%, rgba(91, 21, 20, .16) 13.2% 13.45%, transparent 13.7% 19%),
    #010101;
  font-family: var(--font);
  font-size: 14px;
  letter-spacing: .08em;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  content: "";
  opacity: .18;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.09) 3px 4px);
  mix-blend-mode: screen;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: .5;
  background:
    repeating-radial-gradient(ellipse at 25% 42%, transparent 0 18px, rgba(108, 25, 23, .35) 19px 20px, transparent 21px 31px),
    repeating-radial-gradient(ellipse at 78% 62%, transparent 0 22px, rgba(108, 25, 23, .25) 23px 24px, transparent 25px 36px);
  filter: contrast(1.5);
}

button, a, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.portal-shell {
  width: calc(100% - 24px);
  min-height: calc(100dvh - 24px);
  margin: 12px auto;
  display: grid;
  grid-template-rows: 54px 1fr 46px;
  border: 1px solid var(--frame);
  border-radius: 11px;
  overflow: hidden;
  background: rgba(0,0,0,.42);
  box-shadow: inset 0 0 70px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.015);
}

.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-width: 0;
  padding: 0 24px;
  border-bottom: 1px solid rgba(121, 25, 23, .34);
  background: rgba(0,0,0,.65);
  font-size: 11px;
  letter-spacing: .15em;
}

.site-brand {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--red);
  text-decoration: none;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .2em;
}

.site-brand img { width: 34px; height: 25px; object-fit: contain; }
.site-domain { justify-self: center; color: var(--red); }
.site-section { justify-self: end; color: var(--muted); }
.site-section i { width: 7px; height: 7px; margin-left: 10px; display: inline-block; background: var(--red-mid); }

.page-stage {
  min-height: 0;
  padding: clamp(28px, 5vh, 66px) 26px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 27px;
}

.access-card {
  position: relative;
  flex: 0 1 auto;
  border: 1px solid var(--red);
  border-radius: 23px;
  color: var(--red);
  background:
    linear-gradient(90deg, transparent 0 49.8%, rgba(224, 47, 42, .025) 49.9% 50.1%, transparent 50.2%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.013) 0 1px, transparent 1px 4px),
    rgba(5, 3, 3, .89);
  box-shadow: inset 0 0 45px rgba(116, 18, 17, .08), 0 0 25px rgba(0,0,0,.8);
}

.access-card::before,
.access-card::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.access-card::before {
  inset: 12px;
  border: 1px dotted rgba(211, 43, 39, .28);
  border-radius: 14px;
}

.access-card::after {
  inset: 0;
  opacity: .16;
  border-radius: inherit;
  background: repeating-linear-gradient(117deg, transparent 0 8px, rgba(239,57,51,.18) 9px, transparent 10px 14px);
  mix-blend-mode: screen;
}

.guest-card { width: min(760px, 100%); }
.account-card { width: min(760px, 100%); }

.card-main { position: relative; z-index: 1; margin-right: 45px; padding: 27px 36px 25px; }
.guest-card .card-main { min-height: 465px; }
.account-card .card-main { min-height: 493px; }
.account-card .card-main { padding-right: 35px; padding-left: 50px; }

.card-rail {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  bottom: 0;
  width: 45px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  writing-mode: vertical-rl;
  border-left: 1px solid rgba(211, 43, 39, .55);
  font-size: 8px;
  letter-spacing: .14em;
  color: var(--red-mid);
}

.card-rail span { font-size: 17px; color: var(--red); }
.card-rail b { font-weight: 500; }

.corner {
  position: absolute;
  z-index: 3;
  width: 19px;
  height: 19px;
  pointer-events: none;
}

.corner::before, .corner::after { position: absolute; content: ""; background: var(--red-hot); }
.corner::before { width: 19px; height: 1px; top: 9px; }
.corner::after { width: 1px; height: 19px; left: 9px; }
.corner-tl { top: 15px; left: 19px; }
.corner-tr { top: 15px; right: 58px; }
.corner-bl { bottom: 14px; left: 19px; }
.corner-br { right: 58px; bottom: 14px; }

.decor-plus { position: absolute; color: var(--red-hot); font-size: 15px; }
.plus-one { top: 12px; left: 49%; }
.plus-two { right: 7px; bottom: 6px; }

.brand-kicker {
  color: #d85a56;
  font-size: 12px;
  letter-spacing: .13em;
  text-align: right;
}

.guest-hero {
  display: grid;
  grid-template-columns: 46% 54%;
  align-items: center;
  min-height: 226px;
  border-bottom: 1px solid rgba(211, 43, 39, .6);
}

.phoenix-wrap { align-self: stretch; display: grid; place-items: center; overflow: hidden; }
.phoenix { width: 110%; height: auto; max-height: 230px; overflow: visible; filter: drop-shadow(0 0 10px rgba(211,43,39,.18)); }
.phoenix-lines { fill: none; stroke: var(--red); stroke-width: 2.5; stroke-linecap: square; stroke-linejoin: miter; }
.phoenix-fill { fill: var(--red-hot); }

.wordmark-block { padding-left: 19px; }
.micro-rule { width: 100%; height: 17px; margin-bottom: 5px; opacity: .6; background: repeating-linear-gradient(90deg, transparent 0 27px, var(--red-mid) 28px 36px, transparent 37px 48px); }
.wordmark-block h1, .network-pane h1 {
  margin: 0;
  color: var(--red-hot);
  font-size: clamp(68px, 8vw, 101px);
  line-height: .84;
  letter-spacing: .08em;
  font-weight: 900;
  text-shadow: 3px 0 0 #5d1716, -2px 0 0 #9c211f, 0 0 18px rgba(239,57,51,.18);
  background: repeating-linear-gradient(0deg, var(--red-hot) 0 3px, #8f1e1c 3px 5px);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.wordmark-block > p, .network-subtitle {
  margin: 12px 0 16px;
  color: #df4440;
  font-size: clamp(16px, 2vw, 22px);
  letter-spacing: .14em;
}

.access-label {
  padding: 13px 15px;
  border: 1px solid rgba(211, 43, 39, .65);
  color: #dc5a55;
  font-size: 13px;
  white-space: nowrap;
}

.dossier-grid, .account-record {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 19px 0 15px;
  border-bottom: 1px solid rgba(211, 43, 39, .7);
}

.dossier-grid > div, .account-record > div { min-width: 0; padding: 0 17px; border-right: 1px solid rgba(211, 43, 39, .45); }
.dossier-grid > div:first-child, .account-record > div:first-child { padding-left: 13px; }
.dossier-grid > div:last-child, .account-record > div:last-child { border: 0; }
.dossier-grid span, .account-record span { display: block; margin-bottom: 8px; color: var(--red); font-size: 9px; }
.dossier-grid strong, .account-record strong { color: #dd3d39; font-size: 12px; line-height: 1.6; font-weight: 500; }

.barcode {
  height: 31px;
  margin: 16px 12px 8px;
  background: repeating-linear-gradient(90deg, var(--red) 0 1px, transparent 1px 3px, var(--red-hot) 3px 5px, transparent 5px 8px, var(--red-mid) 8px 9px, transparent 9px 13px);
  opacity: .85;
  clip-path: polygon(0 0, 98% 0, 98% 45%, 100% 45%, 100% 100%, 1.5% 100%, 1.5% 65%, 0 65%);
}

.serial { color: #d7423e; text-align: center; font-size: 13px; letter-spacing: .14em; }

.guest-stage, .account-stage { justify-content: flex-start; padding-top: 115px; }
.guest-stage { gap: 35px; }
.primary-action-block { text-align: center; }
.primary-action-block p { margin: 10px 0 0; }
.action-notice { color: var(--muted); font-size: 9px; }
.action-notice.is-warning { color: var(--red-hot); }
.action-subline { color: var(--quiet); font-size: 9px; }

.tech-button {
  position: relative;
  min-height: 51px;
  padding: 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 1px solid var(--red);
  border-radius: 0;
  color: #e04440;
  background: rgba(21, 5, 5, .63);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: .12em;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.tech-button::before, .tech-button::after { position: absolute; content: ""; width: 11px; height: 1px; background: var(--red-hot); }
.tech-button::before { top: -1px; left: 14px; }
.tech-button::after { right: 14px; bottom: -1px; }
.tech-button:hover { color: #ff5e58; background: rgba(91, 16, 14, .34); box-shadow: 0 0 24px rgba(211,43,39,.15), inset 0 0 20px rgba(211,43,39,.07); }
.tech-button:active { transform: translateY(1px); }
.tech-button:focus-visible { outline: 1px dashed var(--red-hot); outline-offset: 4px; }
.tech-button:disabled { cursor: wait; opacity: .55; }
.tech-button.is-busy { animation: button-pulse 800ms infinite alternate; }
.icon { width: 19px; height: 19px; flex: 0 0 auto; fill: currentColor; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; stroke-linejoin: miter; }
.icon-discord { stroke: none; }
.icon-qr { stroke: none; }
.discord-button { min-width: 365px; }

.site-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  border-top: 1px solid rgba(121, 25, 23, .25);
  color: #4c2c2b;
  background: rgba(0,0,0,.52);
  font-size: 8px;
}
.site-footer b { color: var(--red-mid); font-weight: 400; }

.account-stage { gap: 24px; }
.account-top { display: grid; grid-template-columns: 205px 1fr; gap: 61px; }
.identity-pane { min-width: 0; padding-top: 13px; }
.avatar-frame { height: 198px; overflow: hidden; border: 1px solid rgba(211,43,39,.8); background: #080404; }
.avatar-frame img, .avatar-frame svg { width: 100%; height: 100%; display: block; object-fit: cover; }
.avatar-frame svg { color: var(--red); }
.avatar-grid { fill: none; stroke: rgba(211,43,39,.15); stroke-width: .5; }
.avatar-art { fill: none; stroke: var(--red); stroke-width: 2.2; }
.avatar-frame text { fill: var(--red-mid); font-family: var(--font); font-size: 7px; letter-spacing: 1px; }
.identity-pane h2 { margin: 13px 0 12px; overflow: hidden; color: #df4b46; font-size: 20px; font-weight: 500; letter-spacing: .08em; text-overflow: ellipsis; white-space: nowrap; }
.member-stamp { display: flex; align-items: center; gap: 10px; padding-top: 11px; border-top: 1px solid rgba(211,43,39,.44); color: #cf3935; font-size: 12px; }
.member-stamp .icon { width: 20px; }

.network-pane { padding-top: 3px; }
.network-pane .brand-kicker { text-align: left; }
.network-pane h1 { margin-top: 10px; font-size: 78px; }
.network-subtitle { margin: 9px 0 12px; font-size: 17px; }

.status-stack { border: 1px solid rgba(211,43,39,.7); }
.status-stack > div { min-height: 30px; padding: 0 12px; display: grid; grid-template-columns: 15px 1fr 9px; align-items: center; border-bottom: 1px solid rgba(211,43,39,.45); color: #dd514c; font-size: 10px; }
.status-stack > div:last-child { border: 0; }
.status-stack i { font-style: normal; font-size: 11px; }
.status-stack b { width: 8px; height: 6px; opacity: .7; background: repeating-linear-gradient(0deg, var(--red) 0 1px, transparent 1px 2px); }
.status-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--red-hot); box-shadow: 0 0 8px var(--red-hot); }
[data-account-state="inactive"] .status-dot { border-radius: 0; background: var(--muted); box-shadow: none; }

.subscription-heading { margin: 17px 0 10px; display: flex; justify-content: space-between; gap: 10px; color: #dc4d48; font-size: 10px; }
.subscription-heading b { color: var(--red); font-size: 8px; font-weight: 500; }
.subscription-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tech-button.compact { min-width: 0; min-height: 39px; padding: 0 15px; justify-content: space-between; font-size: 11px; }
.tech-button.compact .icon { width: 18px; }
.tech-button.activate { grid-column: 1 / -1; justify-content: center; }

.account-record { margin-top: 12px; padding: 8px 0; }
.account-record span { margin-bottom: 6px; font-size: 8px; }
.account-record strong { font-size: 11px; }
.account-record > div { padding-left: 17px; }
.account-barcode { height: 28px; margin-top: 12px; }
.account-actions .logout-button { min-width: 205px; min-height: 46px; }
.account-actions form { margin: 0; }

.qr-dialog {
  width: min(430px, calc(100% - 30px));
  padding: 28px;
  border: 1px solid var(--red);
  color: var(--red);
  background: #050303;
  box-shadow: 0 0 80px rgba(0,0,0,.95), inset 0 0 35px rgba(211,43,39,.08);
  text-align: center;
}
.qr-dialog::backdrop { background: rgba(0,0,0,.86); backdrop-filter: blur(3px); }
.qr-dialog h2 { margin: 8px 0 20px; color: var(--red-hot); font-size: 22px; letter-spacing: .13em; }
.dialog-kicker { color: var(--muted); font-size: 9px; }
.dialog-close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--red-mid); color: var(--red); background: transparent; cursor: pointer; }
.dialog-close .icon { width: 17px; }
.qr-frame { width: 280px; max-width: 100%; aspect-ratio: 1; margin: auto; padding: 8px; border: 1px solid var(--red); background: #050505; }
.qr-frame img { width: 100%; height: 100%; display: block; }
.qr-dialog p { margin: 17px 0 0; color: var(--muted); font-size: 8px; line-height: 1.7; }

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 32px;
  min-width: 280px;
  padding: 14px 22px;
  border: 1px solid var(--red);
  color: var(--red-hot);
  background: rgba(5,3,3,.96);
  box-shadow: 0 0 30px rgba(0,0,0,.9);
  font-size: 10px;
  text-align: center;
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast[data-tone="error"] { color: #ff655f; }
.clipboard-fallback { position: fixed; left: -9999px; opacity: 0; }

@keyframes button-pulse { from { border-color: var(--red-mid); } to { border-color: var(--red-hot); box-shadow: 0 0 18px rgba(211,43,39,.3); } }

@media (max-width: 760px) {
  body { font-size: 12px; }
  .portal-shell { width: calc(100% - 12px); min-height: calc(100dvh - 12px); margin: 6px auto; grid-template-rows: 52px 1fr 42px; border-radius: 7px; }
  .site-header { grid-template-columns: 1fr auto; padding: 0 15px; }
  .site-domain { display: none; }
  .site-section { font-size: 8px; }
  .page-stage { padding: 25px 10px 18px; gap: 20px; justify-content: flex-start; }
  .access-card { border-radius: 13px; }
  .card-main { margin-right: 29px; padding: 28px 18px 22px; }
  .account-card .card-main { padding-right: 18px; padding-left: 18px; }
  .guest-card .card-main, .account-card .card-main { min-height: 0; }
  .card-rail { width: 30px; font-size: 6px; }
  .corner-tr, .corner-br { right: 39px; }
  .guest-hero { grid-template-columns: 1fr; padding-bottom: 20px; }
  .phoenix-wrap { height: 175px; }
  .phoenix { width: 100%; }
  .wordmark-block { padding: 0; text-align: center; }
  .wordmark-block h1 { font-size: 76px; }
  .access-label { font-size: 10px; white-space: normal; }
  .dossier-grid, .account-record { grid-template-columns: 1fr; }
  .dossier-grid > div, .account-record > div { padding: 10px 8px; border-right: 0; border-bottom: 1px solid rgba(211,43,39,.35); }
  .dossier-grid > div:first-child, .account-record > div:first-child { padding-left: 8px; }
  .dossier-grid > div:last-child, .account-record > div:last-child { border-bottom: 0; }
  .barcode { margin-left: 4px; margin-right: 4px; }
  .serial { overflow-wrap: anywhere; font-size: 9px; }
  .discord-button { width: min(100%, 330px); min-width: 0; padding: 0 20px; font-size: 11px; }
  .site-footer { gap: 9px; font-size: 6px; }
  .site-footer span:last-child, .site-footer b:last-of-type { display: none; }
  .account-top { grid-template-columns: 1fr; gap: 23px; }
  .identity-pane { padding-top: 0; }
  .avatar-frame { height: auto; aspect-ratio: 1.08; }
  .identity-pane h2 { font-size: 18px; }
  .network-pane h1 { font-size: 70px; }
  .network-pane .brand-kicker { text-align: right; }
  .subscription-heading { align-items: flex-end; }
  .subscription-actions { grid-template-columns: 1fr; }
  .account-record { margin-top: 20px; }
  .account-record > div { padding-left: 8px; }
  .action-notice, .action-subline { max-width: 320px; line-height: 1.5; }
}

@media (max-height: 760px) and (min-width: 761px) {
  .portal-shell { grid-template-rows: 48px 1fr 36px; }
  .page-stage { padding-top: 20px; padding-bottom: 14px; gap: 15px; }
  .guest-card .card-main { min-height: 390px; }
  .guest-hero { min-height: 195px; }
  .account-card .card-main { min-height: 450px; }
  .avatar-frame { height: 190px; }
  .account-top { grid-template-columns: 205px 1fr; gap: 35px; }
  .network-pane h1 { font-size: 68px; }
  .account-record { margin-top: 12px; }
}

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