/* prdx::academy — app layer on top of the Paradox HUD theme (theme.css).
   Only components the theme doesn't ship; colors come from its :root tokens. */

/* The theme's #bg references a bg.webp we don't ship — keep the CSS glows only
   (avoids a 404 on every page view). */
#bg {
  background:
    radial-gradient(55% 55% at 0% 52%, rgba(255, 40, 62, .34), transparent 72%),
    radial-gradient(55% 55% at 100% 48%, rgba(24, 140, 255, .34), transparent 72%),
    radial-gradient(38% 16% at 10% 100%, rgba(255, 40, 62, .3), transparent 72%),
    radial-gradient(38% 16% at 90% 100%, rgba(24, 150, 255, .3), transparent 72%),
    linear-gradient(180deg, #050912 0%, #060a15 55%, #04060c 100%);
}

/* ---------------------------------------------------------------- header chip */
#who .who-name { color: var(--text-2); font-weight: 600; font-size: 14px; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#who .avatar { width: 40px; height: 40px; }
#who .avatar svg { width: 24px; height: 24px; }
#who .pill {
  position: relative; isolation: isolate; display: inline-flex; align-items: center;
  height: 36px; padding: 0 16px; color: var(--text-2); font-weight: 600; font-size: 14px; white-space: nowrap;
}
#who .pill::before, #who .pill::after { content: ""; position: absolute; z-index: -1; }
#who .pill::before {
  inset: 0; background: linear-gradient(180deg, rgba(120, 170, 240, .6), rgba(70, 105, 170, .3));
  clip-path: polygon(11px 0, 100% 0, 100% calc(100% - 11px), calc(100% - 11px) 100%, 0 100%, 0 11px);
}
#who .pill::after {
  inset: 1px; background: linear-gradient(180deg, rgba(15, 24, 46, .97), rgba(8, 13, 26, .97));
  clip-path: polygon(10.6px 0, 100% 0, 100% calc(100% - 10.6px), calc(100% - 10.6px) 100%, 0 100%, 0 10.6px);
}
#who .pill:hover { text-decoration: none; color: #fff; filter: drop-shadow(0 0 7px rgba(34, 211, 240, .45)); }
#who .pill.signin { color: #fff; filter: drop-shadow(0 0 8px var(--primary-glow)); }
#who .pill.signin::before { background: linear-gradient(180deg, var(--primary-edge), var(--primary-to)); }
#who .pill.signin::after { background: linear-gradient(180deg, var(--primary-from), var(--primary-to)); }

/* ---------------------------------------------------------------- page layout */
.narrow { max-width: 640px; margin: 0 auto; }
.back { margin: 0 0 10px; font-size: 14px; }
.back a { color: var(--muted); }
.back a:hover { color: var(--text); }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 0 22px; align-items: start; }
.split > div > h2:first-child { margin-top: 0; }
.hint { margin: 8px 0 0; }
#app .sub { max-width: 80ch; }
.sub .tag { margin-right: 4px; }
.inline-actions > .btn, .inline-actions > button { margin-top: 0; }
.panel > .inline-actions:last-child { margin-top: 16px; }
.tablewrap { overflow-x: auto; }
.empty { color: var(--muted); margin: 0; }

/* landing */
.hero { max-width: 760px; padding: 26px 0 8px; }
.hero h1 { font-size: 44px; line-height: 1.1; letter-spacing: .5px; }
.hero .sub { font-size: 16px; max-width: 60ch; color: var(--text-2); }
.btn.discord { background: linear-gradient(180deg, #5865f2, #3c45b8); border-color: #8891ff; box-shadow: 0 0 14px rgba(88, 101, 242, .5), inset 0 1px 0 rgba(255, 255, 255, .2); }
.btn svg { flex: none; }

/* buttons the theme doesn't have */
.btn.small, button.small { padding: 6px 14px; margin: 0; font-size: 14px; }
.btn.ghost.warn, button.ghost.warn { color: var(--amber); border-color: rgba(190, 130, 30, .8); box-shadow: 0 0 10px rgba(255, 194, 71, .15); }
.btn.ghost.danger, button.ghost.danger { color: #ff7280; border-color: rgba(200, 50, 64, .8); box-shadow: 0 0 10px rgba(255, 53, 71, .18); }
.btn.ghost.warn:hover, .btn.ghost.danger:hover, button.ghost.danger:hover { background: rgba(40, 14, 22, .9); }
td .btn.small, td button.small { padding: 3px 10px; font-size: 13px; }

/* ---------------------------------------------------------------- forms */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend, .flabel { display: block; padding: 0; font-size: 14px; color: var(--text-2); margin: 12px 0 6px; }
input[type=radio], input[type=checkbox] { width: auto; padding: 0; margin: 0; flex: none; accent-color: var(--accent); }
.opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.toggles { display: flex; flex-direction: column; gap: 8px; }
label.opt {
  display: flex; align-items: center; gap: 12px; margin: 0; cursor: pointer;
  padding: 9px 12px; background: var(--row); border: 1px solid var(--line); border-left: 3px solid rgba(92, 132, 204, .35);
  transition: border-color .12s, background .12s;
}
label.opt:hover { border-color: rgba(34, 211, 240, .45); }
label.opt:has(input:checked) { border-left-color: var(--accent); background: rgba(22, 30, 58, .95); }
label.opt.disabled, label.opt:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.optcol { display: flex; flex-direction: column; min-width: 0; }
.oname { color: var(--text); font-weight: 600; font-size: 14px; }
.odesc { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.create .row2 { gap: 6px 22px; align-items: start; }
.create button[type=submit] { margin-top: 20px; }
.create fieldset { margin-top: 10px; }
.hint.warn { color: var(--amber); }
.admrow { display: flex; gap: 8px; align-items: stretch; margin: 0 0 4px; }
.admrow input, .admrow select { flex: 1 1 0; min-width: 0; padding: 8px 12px; }
.admrow select { padding-right: 34px; }
.admrow button { flex: none; margin: 0; }

/* ---------------------------------------------------------------- server cards */
.srv { display: flex; flex-direction: column; gap: 6px; }
.srv .t { color: var(--text); margin: 0; line-height: 1.3; overflow-wrap: anywhere; }
.srv .t:hover { color: #fff; text-decoration: none; filter: drop-shadow(0 0 6px rgba(34, 211, 240, .5)); }
.srv .tags { display: flex; flex-wrap: wrap; gap: 5px; }
.bar { height: 5px; border-radius: 2px; background: rgba(60, 90, 140, .35); overflow: hidden; margin-top: 4px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #1a9bff, var(--cyan)); box-shadow: 0 0 8px rgba(34, 211, 240, .5); }
.srv-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 6px; }
.count { color: var(--text-2); font-size: 13.5px; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- live panel */
.live-hd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 6px; color: var(--muted); font-size: 13.5px; }
.live-hd .count { margin-left: auto; }
.pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px rgba(91, 227, 138, .8); margin-right: 6px; vertical-align: 1px; }
.players .pname { font-weight: 600; overflow-wrap: break-word; }
.players td.num { white-space: nowrap; }
.players td .tag { margin-left: 6px; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.players .acts { white-space: nowrap; text-align: right; width: 1%; }
.players .acts form { display: inline; margin: 0; }
.chat { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.chat h3 { margin: 0 0 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.chat-log { max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.chat-line { font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
.chat-line .who { color: var(--blue); font-weight: 600; }

/* ---------------------------------------------------------------- join / connect */
.code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 34px; font-weight: 700; letter-spacing: .4em;
  text-align: center; color: #fff; padding: 18px 12px 18px calc(12px + .4em); margin: 0 0 16px; user-select: all; overflow-wrap: anywhere;
  background: var(--row); border: 1px solid rgba(34, 211, 240, .45); border-left: 3px solid var(--accent);
  text-shadow: 0 0 16px rgba(34, 211, 240, .55);
}
pre {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.6; color: var(--text-2);
  background: var(--row); border: 1px solid var(--line); border-left: 3px solid rgba(34, 211, 240, .6);
  padding: 12px 14px; margin: 0; overflow-x: auto; white-space: pre;
}
.pwbox { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pwbox code { font-size: 16px; letter-spacing: .05em; padding: 6px 12px; background: var(--row); border: 1px solid var(--line); }
.pwbox button { margin: 0; }

/* ---------------------------------------------------------------- matches / maps / launch */
.matches { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 0 18px; }
.match-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 6px; font-size: 16px; }
.match-hd span { color: var(--muted); font-size: 13px; font-weight: 400; font-variant-numeric: tabular-nums; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.teams table { font-size: 13.5px; }
.teams td, .teams th { padding: 6px 9px; }
.team-hd { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; font-weight: 700; }
.team-hd .num { margin-left: auto; color: var(--text-2); }
.mapgrid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.card.mapcard { padding: 0; display: flex; flex-direction: column; }
.mshot, .mshot-none { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: #0a1020; }
.mshot-none { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.mapcard .mbody { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.mapcard .mname { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.mapcard .mdl { margin-top: auto; padding-top: 6px; font-size: 13.5px; font-weight: 600; }
details.panel > summary { font-weight: 700; font-size: 16px; list-style-position: inside; }
details.panel[open] > summary { margin-bottom: 10px; }
details.panel ol { padding-left: 20px; color: var(--text-2); }

/* booting spinner */
.spinner { width: 46px; height: 46px; margin: 10px 0 18px; border: 4px solid rgba(92, 132, 204, .3); border-top-color: var(--cyan); border-radius: 50%; animation: spin 900ms linear infinite; box-shadow: 0 0 14px rgba(34, 211, 240, .25); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
  * { transition: none !important; }
}

/* ---------------------------------------------------------------- small screens */
@media (max-width: 860px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split > div + div > h2:first-child { margin-top: 28px; }
  #who .who-name { display: none; }
  .hero h1 { font-size: 32px; }
}
@media (max-width: 560px) {
  .brandlogo { height: 22px; }
  #top { gap: 10px; }
  #who { gap: 8px; }
  #who .avatar { width: 34px; height: 34px; }
  #who .avatar svg { width: 20px; height: 20px; }
  #who .pill { height: 32px; padding: 0 12px; font-size: 13px; }
  .teams { grid-template-columns: 1fr; }
  .opts { grid-template-columns: minmax(0, 1fr); }
  .players .acts form, .players .acts .btn { display: flex; margin: 3px 0; }
  .players .acts button, .players .acts .btn { width: 100%; }
  .code { font-size: 26px; letter-spacing: .25em; }
  .admrow { flex-wrap: wrap; }
  .admrow button { flex: 1 1 100%; }
}

/* screen-reader-only text */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
