/* =============================================================================
   Metal Slug Online — arcade catalog
   Dark, warm, high-contrast. Designed to stay readable on a TV across a room,
   and to make gamepad focus impossible to lose track of.
   ========================================================================== */

:root {
  --bg:        #0b0a09;
  --bg-grad:   #14110d;
  --surface:   #1a1714;
  --surface-2: #221e19;
  --surface-3: #2b2620;
  --line:      #332d26;
  --line-soft: #262119;

  --text:      #f5f0e6;
  --text-dim:  #b8ada0;
  --muted:     #8b8175;

  --accent:     #ff8c1a;
  --accent-hi:  #ffa94d;
  --accent-ink: #1c0f00;

  --ok:      #4ec26a;
  --warn:    #e0a83a;
  --danger:  #e5524d;

  --sys-neogeo: #ff453a;
  --sys-cps1:   #ffb020;
  --sys-cps2:   #52a8ff;

  --font-display: Bahnschrift, "Arial Narrow", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body:    "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-mono:    ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  --pad-x: clamp(16px, 4vw, 56px);

  --shadow-1: 0 1px 2px rgba(0,0,0,.5), 0 4px 14px rgba(0,0,0,.35);
  --shadow-2: 0 8px 34px rgba(0,0,0,.55);
  --glow:     0 0 0 3px rgba(255,140,26,.28);

  --ease: cubic-bezier(.32, .72, 0, 1);
}

*, *::before, *::after { box-sizing: border-box; }

/* The UA stylesheet hides [hidden] with `display: none`, but that is a normal
   author-weight rule and ANY class setting `display` beats it — so an element
   styled `display: grid` stays on screen while JS believes it is hidden. Every
   toggled panel here (.fault, .empty, .search__clear) sets a display value, so
   this has to win outright. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: clamp(15px, .55vw + 13px, 17px);
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--bg-grad), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

/* Faint CRT scanlines. Kept well below the threshold where text softens. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,.018) 0 1px,
    transparent 1px 3px
  );
}

@media (prefers-reduced-motion: reduce) {
  body::after { display: none; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .01em;
  margin: 0;
}

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  border-radius: var(--r-sm);
}
.skip:focus { left: 12px; }

/* ============================== Top bar ================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11,10,9,.86);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line-soft);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  padding: 12px var(--pad-x);
  max-width: 1680px;
  margin-inline: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: none;
  color: var(--accent);
}
.brand__mark { width: 40px; height: 29px; flex: none; }
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  font-family: var(--font-display);
}
.brand__text b {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--text);
}
.brand__text i {
  font-style: normal;
  font-size: .62rem;
  letter-spacing: .28em;
  color: var(--accent);
}
@media (max-width: 620px) { .brand__text { display: none; } }

/* ------------------------------- Search ---------------------------------- */

.search {
  position: relative;
  flex: 1 1 auto;
  max-width: 520px;
  display: flex;
  align-items: center;
}
.search__icon {
  position: absolute;
  left: 12px;
  width: 19px; height: 19px;
  color: var(--muted);
  pointer-events: none;
}
.search input {
  width: 100%;
  padding: 10px 38px 10px 39px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus {
  outline: none;
  background: var(--surface-2);
  border-color: var(--accent);
  box-shadow: var(--glow);
}
.search input::-webkit-search-cancel-button { display: none; }

.search__clear {
  position: absolute;
  right: 8px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  font-size: 20px; line-height: 1;
  color: var(--muted);
  background: none; border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.search__clear:hover { color: var(--text); background: var(--surface-3); }

/* --------------------------- Controller pill ----------------------------- */

.pad {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 11px;
  font-size: .8rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  transition: color .2s, border-color .2s, background .2s;
}
.pad__icon { width: 22px; height: 22px; flex: none; }
.pad[data-state="connected"] {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 45%, transparent);
  background: color-mix(in srgb, var(--ok) 11%, var(--surface));
}
.pad[data-state="connected"] .pad__icon { animation: padPop .45s var(--ease); }
@keyframes padPop {
  0%   { transform: scale(.6) rotate(-8deg); }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}
@media (max-width: 900px) { .pad__label { display: none; } .pad { padding: 7px 10px; } }

/* --------------------------- Identity / admin ---------------------------- */

.chip--admin {
  flex: none;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.chip--admin:hover { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

.who {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 4px;
}
.who__name {
  max-width: 18ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-dim);
}
.who__out {
  padding: 6px 12px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: all .16s var(--ease);
}
.who__out:hover { color: #ffc9c7; border-color: color-mix(in srgb, var(--danger) 50%, transparent); }

@media (max-width: 1100px) { .who__name { display: none; } }
@media (max-width: 820px)  { .chip--admin span, .who__out { font-size: .74rem; } }

/* ============================== Filters ================================== */

.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 20px var(--pad-x) 4px;
  max-width: 1680px;
  margin-inline: auto;
}
.filters__group { display: flex; gap: 8px; flex-wrap: wrap; }
.filters__spacer { flex: 1 1 auto; }

.chip {
  padding: 7px 15px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: all .16s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--surface-3); background: var(--surface-2); }
.chip.is-on {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

/* ============================== Shelves ================================== */

.shelves {
  max-width: 1680px;
  margin-inline: auto;
  padding: 8px var(--pad-x) 64px;
}

.shelf { margin-top: 40px; }
.shelf:first-child { margin-top: 24px; }

.shelf__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.shelf__title {
  font-size: clamp(1.15rem, 1.4vw, 1.5rem);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.shelf__title::before {
  content: "";
  display: inline-block;
  width: 4px; height: .95em;
  margin-right: 11px;
  vertical-align: -.08em;
  background: var(--accent);
  border-radius: 2px;
}
.shelf__blurb {
  font-size: .85rem;
  color: var(--muted);
  flex: 1 1 auto;
}
.shelf__count {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--muted);
  flex: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: clamp(14px, 1.5vw, 22px);
}

/* =============================== Card ==================================== */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.card:hover,
.card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-2);
  outline: none;
}
.card:focus-visible { box-shadow: var(--shadow-2), var(--glow); }
.card:active { transform: translateY(-1px); }

/* Procedural marquee art. --h drives hue; set per card from the game id. */
.card__art {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(150deg,
      hsl(var(--h) 62% 26%) 0%,
      hsl(var(--h) 48% 14%) 48%,
      hsl(calc(var(--h) + 28) 40% 10%) 100%);
}
.card__art::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: repeating-linear-gradient(
    -52deg,
    rgba(0,0,0,.22) 0 12px,
    transparent 12px 30px
  );
}
.card__art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 55% at 50% 108%, rgba(0,0,0,.62), transparent 70%),
    radial-gradient(90% 70% at 50% -10%, rgba(255,255,255,.1), transparent 60%);
}

.card__initials {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5.4vw, 3.6rem);
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1;
  color: rgba(255,255,255,.9);
  text-shadow:
    0 2px 0 rgba(0,0,0,.45),
    0 0 34px hsl(var(--h) 90% 60% / .45);
  transform: translateY(-4px);
}

.card__img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* Corner badges */
.card__sys {
  position: absolute;
  z-index: 3;
  top: 10px; left: 10px;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .09em;
  color: #fff;
  background: color-mix(in srgb, var(--sys) 82%, #000);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-1);
}
.card__players {
  position: absolute;
  z-index: 3;
  top: 10px; right: 10px;
  padding: 3px 7px;
  font-family: var(--font-mono);
  font-size: .62rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(4px);
  border-radius: var(--r-sm);
}

.card__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 14px 14px;
  flex: 1 1 auto;
}
.card__title {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .015em;
}
.card__meta {
  font-family: var(--font-mono);
  font-size: .73rem;
  color: var(--muted);
  margin: 0;
}
.card__blurb {
  margin: 7px 0 0;
  font-size: .8rem;
  line-height: 1.42;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Availability strip */
.card__state {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  font-size: .73rem;
  font-weight: 600;
  border-top: 1px solid var(--line-soft);
  background: var(--surface-2);
  color: var(--muted);
}
.card__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
  box-shadow: 0 0 8px currentColor;
}
.card[data-state="ready"]     .card__state { color: var(--ok); }
.card[data-state="unverified"] .card__state { color: var(--warn); }
.card[data-state="missing"]   .card__state { color: var(--danger); }

.card[data-state="missing"] {
  cursor: not-allowed;
  opacity: .52;
  filter: saturate(.35);
}
.card[data-state="missing"]:hover { transform: none; border-color: var(--line-soft); box-shadow: none; }

.card__warn {
  position: absolute;
  z-index: 3;
  bottom: 10px; right: 10px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  font-size: .72rem;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--warn);
  border-radius: 50%;
  box-shadow: var(--shadow-1);
}

/* ============================ Empty state ================================ */

.empty {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  padding: 90px 20px;
  text-align: center;
  color: var(--muted);
}
.empty b { font-size: 1.2rem; color: var(--text); font-family: var(--font-display); letter-spacing: .03em; }

/* ============================== Footer =================================== */

.foot {
  border-top: 1px solid var(--line-soft);
  background: rgba(0,0,0,.28);
}
.foot__inner {
  max-width: 1680px;
  margin-inline: auto;
  padding: 26px var(--pad-x) 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  align-items: baseline;
}
.foot__stat {
  margin: 0;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--text-dim);
}
.foot__note {
  margin: 0;
  font-size: .78rem;
  color: var(--muted);
  max-width: 60ch;
}

/* =============================== Gate ==================================== */

body.gate {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px;
}

.gate__main { width: 100%; max-width: 420px; }

.gate__card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(26px, 5vw, 40px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
}

.gate__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 10px;
  color: var(--accent);
}
.gate__mark { width: 54px; height: 39px; margin-bottom: 8px; }
.gate__title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 5vw, 2.1rem);
  font-weight: 700;
  letter-spacing: .17em;
  color: var(--text);
  line-height: 1;
}
.gate__sub {
  margin: 0;
  font-family: var(--font-display);
  font-size: .68rem;
  letter-spacing: .3em;
  color: var(--accent);
}

.gate__field { display: flex; flex-direction: column; gap: 6px; }
.gate__field label {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.gate__field input {
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color .15s, box-shadow .15s;
}
.gate__field input::placeholder { color: #6b635a; }
.gate__field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--glow);
}

.gate__error {
  margin: 0;
  padding: 11px 14px;
  font-size: .85rem;
  color: #ffd7d5;
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  border-radius: var(--r-md);
}

.gate__submit {
  margin-top: 4px;
  padding: 13px 20px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background .16s, opacity .16s;
}
.gate__submit:hover:not(:disabled) { background: var(--accent-hi); }
.gate__submit:disabled { cursor: progress; opacity: .75; }
.gate__submit.is-busy { background: var(--surface-3); color: var(--text-dim); }

.gate__note {
  margin: 2px 0 0;
  text-align: center;
  font-size: .76rem;
  line-height: 1.5;
  color: var(--muted);
}

/* ============================== Player =================================== */

body.playing {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  background: #000;
}

.playbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 24px);
  padding: 9px clamp(12px, 2.5vw, 24px);
  background: rgba(11,10,9,.94);
  border-bottom: 1px solid var(--line-soft);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}

/* Once the game is actually running, the chrome gets out of the way until the
   pointer comes back to it. */
body.is-running .playbar { opacity: .22; }
body.is-running .playbar:hover,
body.is-running .playbar:focus-within { opacity: 1; }

.playbar__back {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 7px 14px 7px 9px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: all .16s var(--ease);
}
.playbar__back svg { width: 17px; height: 17px; }
.playbar__back:hover { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

.playbar__title {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.playbar__title b {
  font-family: var(--font-display);
  font-size: 1.02rem;
  letter-spacing: .03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.playbar__title span {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--muted);
}

.stage {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  background: #000;
}

#game { width: 100%; height: 100%; }

/* ------------------------------- Failure --------------------------------- */

.fault {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}
.fault__box {
  max-width: 560px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.fault__title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  letter-spacing: .03em;
  color: var(--danger);
}
.fault__msg {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text-dim);
}
.fault__detail {
  margin: 0;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: .78rem;
  line-height: 1.6;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  white-space: pre-wrap;
  overflow-x: auto;
}
.fault__action {
  margin-top: 4px;
  padding: 11px 22px;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 999px;
  transition: background .16s;
}
.fault__action:hover { background: var(--accent-hi); }

/* ============================== Admin ==================================== */

.admin {
  max-width: 1180px;
  margin-inline: auto;
  padding: 24px var(--pad-x) 80px;
}
.admin__tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: clamp(18px, 3vw, 30px);
  margin-bottom: 22px;
}
.panel__title {
  font-size: 1.3rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.panel__sub {
  font-size: 1rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin: 28px 0 12px;
  color: var(--text-dim);
}
.panel__lead {
  margin: 0 0 20px;
  max-width: 74ch;
  font-size: .9rem;
  line-height: 1.6;
  color: var(--text-dim);
}
.panel code {
  font-family: var(--font-mono);
  font-size: .86em;
  padding: 1px 5px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.muted { color: var(--muted); font-size: .85rem; }
.row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* ------------------------------- Buttons --------------------------------- */

.btn {
  padding: 9px 16px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all .16s var(--ease);
}
.btn:hover:not(:disabled) { background: var(--surface-3); border-color: var(--surface-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.btn--primary:hover:not(:disabled) { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn--danger { color: #ffc9c7; border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn--danger:hover:not(:disabled) { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn--ghost { background: transparent; }
.btn--sm { padding: 6px 11px; font-size: .78rem; }

/* -------------------------------- Drop ----------------------------------- */

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 42px 20px;
  text-align: center;
  color: var(--text-dim);
  background: var(--bg);
  border: 2px dashed var(--line);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all .18s var(--ease);
}
.drop:hover, .drop:focus-visible, .drop.is-over {
  color: var(--text);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, var(--bg));
}
.drop.is-over { transform: scale(1.01); }
.drop__icon { width: 34px; height: 34px; color: var(--accent); margin-bottom: 4px; }
.drop b { font-size: 1rem; color: var(--text); }
.drop span { font-size: .84rem; }

/* ------------------------------ Progress --------------------------------- */

.progress { margin-top: 16px; }
.progress__bar {
  height: 7px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress__bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-hi));
  transition: width .2s;
}
.progress__label {
  margin: 7px 0 0;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--muted);
}

/* -------------------------------- Table ---------------------------------- */

.table { overflow-x: auto; }
.table table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.table th {
  text-align: left;
  padding: 9px 12px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr.is-off { opacity: .45; }
.table td.num { font-family: var(--font-mono); white-space: nowrap; }
.table td.actions { display: flex; gap: 6px; justify-content: flex-end; }

.tag {
  display: inline-block;
  padding: 2px 8px;
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.tag--bios,
.tag--superadmin { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.tag--game,
.tag--admin { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.tag--unlisted { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }

/* -------------------------------- Forms ---------------------------------- */

.form {
  padding: 20px;
  margin-bottom: 26px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.form input, .form select {
  padding: 10px 12px;
  font: inherit;
  font-size: .9rem;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.form input:focus, .form select:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--glow);
}
.withbtn { display: flex; gap: 8px; }
.withbtn input { flex: 1 1 auto; min-width: 0; }

/* Checkbox that sits inline with a button */
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .84rem;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ------------------------------- Artwork --------------------------------- */

.artgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.artcard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.artcard__preview {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: var(--r-sm);
}
.artcard__preview img { width: 100%; height: 100%; object-fit: cover; }
.artcard__none { font-size: .78rem; color: var(--muted); }
.artcard__title { font-size: .88rem; line-height: 1.25; }
.artcard__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.artcard__pick {
  flex: 1 1 auto;
  padding: 6px 9px;
  text-align: center;
  font-size: .74rem;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all .15s;
}
.artcard__pick:hover { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

/* Capture control in the player bar */
.playbar__capture {
  flex: none;
  padding: 7px 14px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 999px;
  cursor: pointer;
  transition: all .16s var(--ease);
}
.playbar__capture:hover:not(:disabled) { color: var(--accent-ink); background: var(--accent); }
.playbar__capture:disabled { opacity: .6; cursor: progress; }

/* =============================== Co-op =================================== */

/* Guest view — the host's screen. Pixel art must not be smoothed. */
.coop__video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  image-rendering: pixelated;
}

.coop {
  position: absolute;
  z-index: 20;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(460px, calc(100% - 32px));
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
}
.coop__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.coop__head b {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.coop__close {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  font-size: 22px; line-height: 1;
  color: var(--muted);
  background: none; border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.coop__close:hover { color: var(--text); background: var(--surface-3); }

.coop__status {
  margin: 0 0 12px;
  font-size: .9rem;
  line-height: 1.5;
  color: var(--text-dim);
}
.coop__link { display: flex; gap: 8px; margin-bottom: 10px; }
.coop__link input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.coop__link input:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
.coop__hint {
  margin: 0;
  font-size: .78rem;
  line-height: 1.5;
  color: var(--muted);
}

.playbar__coop {
  flex: none;
  padding: 7px 14px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--ok);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--ok) 45%, transparent);
  border-radius: 999px;
  cursor: pointer;
  transition: all .16s var(--ease);
}
.playbar__coop:hover:not(:disabled) { color: #06210d; background: var(--ok); }
.playbar__coop:disabled { opacity: .6; cursor: default; }

/* ============================== Toasts =================================== */

.toasts {
  position: fixed;
  z-index: 200;
  right: clamp(12px, 3vw, 28px);
  bottom: clamp(12px, 3vw, 28px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 250px;
  max-width: 380px;
  padding: 12px 16px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  animation: toastIn .32s var(--ease);
}
.toast[data-kind="ok"]   { border-left-color: var(--ok); }
.toast[data-kind="warn"] { border-left-color: var(--warn); }
.toast[data-kind="err"]  { border-left-color: var(--danger); }
.toast.is-out { animation: toastOut .25s var(--ease) forwards; }
.toast small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; }

@keyframes toastIn  { from { opacity: 0; transform: translateX(24px) scale(.96); } }
@keyframes toastOut { to   { opacity: 0; transform: translateX(24px) scale(.96); } }
