/* Warden control panel — visual layer.
   Every selector app.js relies on is preserved; this file only changes how
   things look, never what they're called. */

:root {
  --bg: #080b16;
  --bg-deep: #05070f;
  --surface: rgba(20, 25, 45, 0.72);
  --surface-solid: #121628;
  --raised: rgba(28, 34, 60, 0.78);
  --raised-solid: #181d33;
  --line: rgba(90, 104, 165, 0.22);
  --line-strong: rgba(120, 136, 200, 0.34);
  --text: #eef1fb;
  --muted: #8f97bd;
  --amber: #ffc24b;
  --amber-soft: rgba(255, 194, 75, 0.14);
  --amber-dim: #6b5320;
  --danger: #ff5c5c;
  --ok: #3ddc97;
  --blurple: #5865f2;
  --violet: #8b5cf6;
  --radius: 14px;
  --radius-sm: 9px;
  /* Layout width knobs.
     --main-max: none  = the panel fills the whole browser width.
                 1400px (or any length) = caps it on ultra-wide monitors.
     --control-max: how wide a single input may grow. Raise for edge-to-edge
     inputs, lower if long rows get hard to track across a big screen. */
  --main-max: none;
  --control-max: 640px;
  --glow-amber: 0 0 0 1px rgba(255, 194, 75, 0.35), 0 6px 26px -6px rgba(255, 194, 75, 0.42);
  --shadow-lift: 0 14px 38px -14px rgba(0, 0, 0, 0.8);
  --ease: cubic-bezier(0.22, 0.85, 0.36, 1);
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg-deep);
  color: var(--text);
  font: 14px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* ── Living backdrop ────────────────────────────────────
   Three slow-drifting colour fields plus a fixed grid. Both layers are
   pseudo-elements so index.html needs no extra markup, and both sit behind
   content at negative z-index. */
body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -2;
  background:
    radial-gradient(38vw 38vw at 18% 22%, rgba(255, 194, 75, 0.16), transparent 62%),
    radial-gradient(42vw 42vw at 82% 18%, rgba(88, 101, 242, 0.20), transparent 64%),
    radial-gradient(46vw 46vw at 62% 88%, rgba(139, 92, 246, 0.16), transparent 66%),
    radial-gradient(34vw 34vw at 8% 82%, rgba(61, 220, 151, 0.09), transparent 60%);
  filter: blur(28px) saturate(1.15);
  animation: drift 34s ease-in-out infinite alternate;
  will-change: transform;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(140, 155, 215, 0.045) 1px, transparent 1px) 0 0 / 100% 46px,
    linear-gradient(90deg, rgba(140, 155, 215, 0.045) 1px, transparent 1px) 0 0 / 46px 100%,
    radial-gradient(ellipse 120% 80% at 50% 0%, transparent 40%, rgba(5, 7, 15, 0.75) 100%);
  mask-image: radial-gradient(ellipse 130% 95% at 50% 35%, #000 45%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 130% 95% at 50% 35%, #000 45%, transparent 100%);
  pointer-events: none;
}

@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  33%  { transform: translate3d(2.5%, -2%, 0) scale(1.06); }
  66%  { transform: translate3d(-2%, 2.5%, 0) scale(1.03); }
  100% { transform: translate3d(1.5%, 1.5%, 0) scale(1.07); }
}

a { color: var(--amber); }
button { font: inherit; cursor: pointer; }

input, select, textarea {
  font: inherit;
  color: var(--text);
  background: rgba(8, 11, 22, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s;
}
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-soft);
}
input[type="number"] { width: 92px; }
textarea { width: 100%; min-height: 70px; resize: vertical; }

/* Scrollbars, tinted to match */
* { scrollbar-width: thin; scrollbar-color: rgba(120, 136, 200, 0.32) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(120, 136, 200, 0.28);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(255, 194, 75, 0.4); background-clip: content-box; }

::selection { background: rgba(255, 194, 75, 0.28); color: #fff; }

.boot {
  padding: 48px;
  color: var(--muted);
  font-family: var(--font-display);
  animation: breathe 1.8s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

/* ── Shared motion ──────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
/* Opacity-only. Used where a transform would turn the element into the
   containing block for its position: fixed children. */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Sign-in & guild picker ─────────────────────────── */
.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.gate-card {
  width: min(460px, 100%);
  background: var(--surface);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 38px;
  box-shadow: var(--shadow-lift), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: popIn 0.5s var(--ease) both;
  position: relative;
  overflow: hidden;
}
/* Hairline of light along the top edge */
.gate-card::before {
  content: "";
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 194, 75, 0.7), transparent);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 6px;
}
/* Gradient only on the text, not the lamp child */
.wordmark { color: var(--text); }
.wordmark .lamp { width: 12px; height: 12px; }
.gate-card p { color: var(--muted); margin: 0 0 22px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 18px;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s var(--ease), border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.btn:hover { border-color: var(--amber); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.btn:active { transform: translateY(0); }
/* Sheen sweep on hover */
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.16) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.6s var(--ease);
  pointer-events: none;
}
.btn:hover::after { transform: translateX(120%); }
.btn.primary {
  background: linear-gradient(135deg, #ffd371, var(--amber) 55%, #e8a72c);
  border-color: transparent;
  color: #1a1405;
  box-shadow: var(--glow-amber);
}
.btn.primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 0 0 1px rgba(255, 194, 75, 0.5), 0 12px 34px -8px rgba(255, 194, 75, 0.55);
}
.btn.danger { background: rgba(255, 92, 92, 0.08); border-color: var(--danger); color: var(--danger); }
.btn.danger:hover {
  background: rgba(255, 92, 92, 0.18);
  box-shadow: 0 0 0 1px rgba(255, 92, 92, 0.4), 0 10px 30px -10px rgba(255, 92, 92, 0.6);
}
.btn:disabled { opacity: 0.45; cursor: default; transform: none; box-shadow: none; }
.btn:disabled::after { display: none; }

.guild-list { display: grid; gap: 10px; margin-top: 8px; }
.guild-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  transition: transform 0.18s var(--ease), border-color 0.18s, box-shadow 0.18s, background 0.18s;
  animation: fadeUp 0.4s var(--ease) both;
}
/* Staggered entrance down the server list */
.guild-row:nth-child(1) { animation-delay: 0.02s; }
.guild-row:nth-child(2) { animation-delay: 0.06s; }
.guild-row:nth-child(3) { animation-delay: 0.10s; }
.guild-row:nth-child(4) { animation-delay: 0.14s; }
.guild-row:nth-child(5) { animation-delay: 0.18s; }
.guild-row:nth-child(n+6) { animation-delay: 0.22s; }
.guild-row:hover {
  border-color: var(--amber);
  transform: translateX(4px);
  box-shadow: var(--shadow-lift);
  background: rgba(38, 45, 78, 0.8);
}
.guild-row img, .guild-row .guild-fallback {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--raised-solid);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700;
  flex: none;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform 0.2s var(--ease);
}
.guild-row:hover img, .guild-row:hover .guild-fallback { transform: scale(1.06) rotate(-2deg); }
.guild-row .sub { color: var(--muted); font-size: 12px; }
.guild-row.disabled { opacity: 0.5; }
.guild-row.disabled:hover { transform: none; border-color: var(--line-strong); }

/* ── Panel shell ───────────────────────────────────── */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.rail {
  background: linear-gradient(180deg, rgba(18, 22, 40, 0.82), rgba(12, 16, 30, 0.9));
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 5;
}
.rail .wordmark { font-size: 20px; padding: 0 10px 14px; }
.rail-guild {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; margin-bottom: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--raised);
  color: var(--text); text-align: left; width: 100%;
  transition: border-color 0.18s, transform 0.18s var(--ease);
}
.rail-guild:hover { border-color: var(--amber); transform: translateY(-1px); }
.rail-guild img { width: 28px; height: 28px; border-radius: 8px; }
.rail-guild .sub { font-size: 11px; color: var(--muted); }

.rail-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: none;
  color: var(--muted);
  width: 100%;
  text-align: left;
  font-weight: 500;
  position: relative;
  transition: color 0.16s, background 0.16s, transform 0.16s var(--ease);
}
.rail-item:hover { color: var(--text); background: var(--raised); transform: translateX(3px); }
.rail-item.active {
  color: var(--text);
  background: linear-gradient(90deg, var(--amber-soft), rgba(28, 34, 60, 0.5));
  border-color: rgba(255, 194, 75, 0.28);
}
/* Amber marker on the active section */
.rail-item.active::before {
  content: "";
  position: absolute;
  left: -14px; top: 50%;
  width: 3px; height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--amber);
  box-shadow: 0 0 12px 1px rgba(255, 194, 75, 0.7);
  transform: translateY(-50%);
}
.rail-item .lamp { margin-left: auto; }
.rail-foot { margin-top: auto; padding: 10px; color: var(--muted); font-size: 12px; }

/* Owner-only rail group */
.rail-divider {
  margin: 14px 10px 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.rail-item.owner { color: var(--amber); }
.rail-item.owner:hover { color: var(--amber); background: var(--amber-soft); }
.rail-item.owner.active { background: linear-gradient(90deg, var(--amber-soft), rgba(28, 34, 60, 0.5)); }

/* Signature element: armed-state lamps */
.lamp {
  width: 9px; height: 9px; border-radius: 50%;
  background: #2c3352;
  flex: none;
  transition: background 0.25s, box-shadow 0.25s;
}
.lamp.on {
  background: var(--amber);
  box-shadow: 0 0 10px 2px rgba(255, 194, 75, 0.55);
  animation: lampGlow 3.2s ease-in-out infinite;
}
@keyframes lampGlow {
  0%, 100% { box-shadow: 0 0 8px 1px rgba(255, 194, 75, 0.45); }
  50%      { box-shadow: 0 0 14px 3px rgba(255, 194, 75, 0.7); }
}
.lamp.alert {
  background: var(--danger);
  box-shadow: 0 0 10px 2px rgba(255, 92, 92, 0.6);
  animation: pulse 1.1s infinite alternate;
}
@keyframes pulse { from { opacity: 1; } to { opacity: 0.4; } }

/* ── Main column ───────────────────────────────────── */
.main {
  padding: 30px clamp(18px, 2.6vw, 48px) 100px;
  width: 100%;
  max-width: var(--main-max);
  min-width: 0; /* lets the grid column shrink instead of overflowing */
  /* Deliberately not a transform: .savebar lives inside .main and is
     position: fixed. A transformed ancestor would anchor it to .main
     instead of the viewport. */
  animation: fadeIn 0.35s var(--ease) both;
}
.main h1 {
  font-family: var(--font-display);
  font-size: 26px;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.main .lede { color: var(--muted); margin: 0 0 26px; }

.card {
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: 0 8px 26px -18px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.22s, box-shadow 0.22s;
  animation: fadeUp 0.42s var(--ease) both;
}
.card:nth-of-type(2) { animation-delay: 0.05s; }
.card:nth-of-type(3) { animation-delay: 0.10s; }
.card:nth-of-type(4) { animation-delay: 0.15s; }
.card:nth-of-type(n+5) { animation-delay: 0.19s; }
.card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 16px 40px -22px rgba(0, 0, 0, 1), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.card > h2 {
  font-family: var(--font-display);
  font-size: 15.5px;
  margin: 0 0 4px;
  display: flex; align-items: center; gap: 10px;
}
.card > .hint { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }

.field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  transition: background 0.16s;
}
.field:first-of-type { border-top: 0; }
.field:hover { background: rgba(255, 255, 255, 0.018); }
.field .label { font-weight: 500; flex: 0 1 auto; min-width: 0; }
.field .label small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }

/* The control side grows with the window instead of sitting at a fixed size.
   Small controls (switches, number steppers) opt out via flex: none below. */
.field .control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: var(--control-max);
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Wide controls stretch to fill whatever the control column was given */
.field .control > select,
.field .control > textarea,
.field .control > .chips,
.field .control > input[type="text"],
.field .control > input:not([type]) {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}
/* …but these keep their own fixed size. Only flex is reset here — setting
   width would override the dimensions each control defines for itself, and
   an auto-width .switch collapses to zero (its parts are absolutely
   positioned), throwing the thumb outside the track. */
.field .control > .switch,
.field .control > input[type="number"],
.field .control > input[type="checkbox"],
.field .control > .btn {
  flex: none;
}

/* Breaker-style toggle */
.switch { position: relative; width: 44px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 2; }
.switch .track {
  position: absolute; inset: 0;
  background: rgba(8, 11, 22, 0.9);
  border: 1px solid var(--line);
  border-radius: 20px;
  transition: background 0.24s var(--ease), border-color 0.24s, box-shadow 0.24s;
}
.switch .thumb {
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--muted);
  transition: transform 0.26s var(--ease), background 0.24s, box-shadow 0.24s;
}
.switch input:checked + .track {
  background: linear-gradient(135deg, rgba(255, 194, 75, 0.3), rgba(255, 194, 75, 0.14));
  border-color: var(--amber);
  box-shadow: inset 0 0 12px rgba(255, 194, 75, 0.25);
}
.switch input:checked + .track + .thumb {
  transform: translateX(20px);
  background: var(--amber);
  box-shadow: 0 0 12px 2px rgba(255, 194, 75, 0.6);
}
.switch input:focus-visible + .track { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }

/* Chips input (word lists, domains) */
.chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(8, 11, 22, 0.7);
  padding: 7px;
  min-width: 0;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.chips:focus-within { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  animation: popIn 0.22s var(--ease) both;
  transition: border-color 0.16s, transform 0.16s var(--ease);
}
.chip:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.chip button {
  background: none; border: 0; color: var(--muted); padding: 0;
  font-size: 13px; line-height: 1;
  transition: color 0.15s, transform 0.15s;
}
.chip button:hover { color: var(--danger); transform: scale(1.25); }
.chips input { border: 0; background: none; flex: 1; min-width: 90px; padding: 2px 4px; }
.chips input:focus-visible { outline: none; box-shadow: none; border: 0; }

select[multiple] { min-width: 0; min-height: 108px; }

/* Save bar */
.savebar {
  position: fixed;
  bottom: 20px;
  right: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(24, 29, 51, 0.85);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 11px 15px;
  box-shadow: var(--shadow-lift);
  animation: popIn 0.34s var(--ease) both;
  z-index: 40;
}
.savebar .note { color: var(--muted); font-size: 12px; }

/* Panic control */
.panic {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 16px; /* matches .card and .stats — was 0, so the next card collided */
  display: flex;
  align-items: center;
  gap: 16px;
  background:
    repeating-linear-gradient(-45deg, rgba(255, 92, 92, 0.07) 0 12px, transparent 12px 24px),
    var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.panic.armed {
  border-color: var(--danger);
  animation: armedPulse 2.4s ease-in-out infinite;
}
@keyframes armedPulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 92, 92, 0.25), 0 0 34px -14px rgba(255, 92, 92, 0.5); }
  50%      { box-shadow: 0 0 0 1px rgba(255, 92, 92, 0.45), 0 0 54px -10px rgba(255, 92, 92, 0.8); }
}
.panic .title { font-family: var(--font-display); font-weight: 700; }
.panic .sub { color: var(--muted); font-size: 12.5px; }
.panic .btn { margin-left: auto; }

/* Stats + cases */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
  animation: fadeUp 0.4s var(--ease) both;
}
.stat:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow-lift); }
.stat::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--amber), transparent 70%);
  opacity: 0.65;
}
.stat .num {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
}
.stat .label { color: var(--muted); font-size: 12px; }

/* ── Giveaway list ─────────────────────────────────────
   Replaces what used to be a very wide table. Each row is flex, every text
   column carries min-width: 0 so long prize names wrap instead of pushing
   the row past the card edge. */
.gw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gw {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.18s, transform 0.18s var(--ease), box-shadow 0.18s;
  animation: fadeUp 0.34s var(--ease) both;
}
.gw:hover { border-color: var(--line-strong); transform: translateX(3px); box-shadow: var(--shadow-lift); }
.gw > .lamp { margin-top: 6px; }
.gw.ended { opacity: 0.72; }

.gw-main { flex: 1 1 auto; min-width: 0; }
.gw-prize {
  font-weight: 500;
  font-size: 14.5px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}
.gw-id { color: var(--muted); font-size: 11.5px; font-weight: 400; }
.gw-meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }
.gw-outcome { font-size: 12.5px; margin-top: 4px; color: var(--text); overflow-wrap: anywhere; }
.gw.ended .gw-outcome { color: var(--muted); }

.gw-side {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding-left: 4px;
}
.gw-entries { text-align: right; line-height: 1.2; }
.gw-entries .num { font-family: var(--font-display); font-weight: 700; font-size: 18px; display: block; }
.gw-entries .label { color: var(--muted); font-size: 11px; }
.btn.sm { padding: 6px 13px; font-size: 13px; font-weight: 500; }

@media (max-width: 620px) {
  .gw { flex-wrap: wrap; }
  .gw-side { width: 100%; justify-content: space-between; padding-left: 21px; }
}

/* Long free text (case reasons) wraps rather than widening the table */
table.cases { width: 100%; border-collapse: collapse; font-size: 13px; }
table.cases td { overflow-wrap: anywhere; }
table.cases th {
  text-align: left; color: var(--muted); font-weight: 500;
  padding: 9px 10px; border-bottom: 1px solid var(--line-strong);
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
}
table.cases td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.cases tbody tr { transition: background 0.15s; }
table.cases tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
table.cases .mono { font-family: var(--font-mono); font-size: 12px; }

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2.5px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--raised);
  letter-spacing: 0.02em;
}
.badge.ban, .badge.softban { color: var(--danger); border-color: rgba(255, 92, 92, 0.5); background: rgba(255, 92, 92, 0.1); }
.badge.kick { color: #ff9f43; border-color: rgba(255, 159, 67, 0.5); background: rgba(255, 159, 67, 0.1); }
.badge.warn, .badge.timeout { color: var(--amber); border-color: rgba(255, 194, 75, 0.5); background: var(--amber-soft); }
.badge.unban, .badge.untimeout { color: var(--ok); border-color: rgba(61, 220, 151, 0.5); background: rgba(61, 220, 151, 0.1); }

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(24, 29, 51, 0.92);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--amber);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  box-shadow: 0 0 0 1px rgba(255, 194, 75, 0.2), var(--shadow-lift);
  z-index: 50;
  animation: toastIn 0.32s var(--ease) both;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 16px) scale(0.96); }
  to   { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
.toast.err { border-color: var(--danger); box-shadow: 0 0 0 1px rgba(255, 92, 92, 0.25), var(--shadow-lift); }

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.topbar .who { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 10px; }
.linklike {
  background: none; border: 0; color: var(--amber); padding: 0;
  text-decoration: none; position: relative;
}
/* Underline that wipes in on hover */
.linklike::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s var(--ease);
}
.linklike:hover::after { transform: scaleX(1); }

/* ── Wide screens ───────────────────────────────────────
   Past ~1500px a single column of cards leaves the label and its control
   stranded at opposite ends of the row. Instead the cards flow into as many
   columns as fit; headings, stats and the panic strip still span the lot. */
@media (min-width: 1500px) {
  .main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
    gap: 0 18px;
    align-content: start;
  }
  .main > *:not(.card) { grid-column: 1 / -1; }
  .card { align-self: start; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .rail-item.active::before { display: none; }
  .rail-foot { display: none; }
  .main { padding: 20px 16px 110px; }
  .field { flex-direction: column; align-items: flex-start; }
  .field .control { max-width: 100%; justify-content: flex-start; }
  .savebar { left: 16px; right: 16px; bottom: 16px; justify-content: space-between; }
}

/* ── Motion opt-out ─────────────────────────────────────
   Anyone with reduced-motion set gets the same layout, no movement. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .btn:hover, .guild-row:hover, .stat:hover, .rail-item:hover, .rail-guild:hover { transform: none; }
}
