  :root {
    color-scheme: dark;
    --background: #111116;
    --surface: #1b1b22;
    --surface-raised: #22222b;
    --border: #34343f;
    --text: #f5f2eb;
    --muted: #a6a2a0;
    --gold: #e6b85c;
    --gold-bright: #f4cb76;
    --red: #f08484;
    --green: #83d2a3;
    --blue: #8db9ed;
  }

  * { box-sizing: border-box; }

  body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background:
      radial-gradient(ellipse at 50% 0, rgba(123, 86, 38, .13), transparent 42rem),
      var(--background);
    color: var(--text);
    font: 15px/1.6 "Segoe UI", Arial, sans-serif;
  }

  a { color: inherit; }

  .page-shell {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
  }

  .site-header,
  .site-footer {
    display: flex;
    width: min(1120px, calc(100% - 48px));
    margin-inline: auto;
    align-items: center;
    justify-content: space-between;
  }

  .site-header {
    min-height: 78px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
  }

  .brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-decoration: none;
  }

  .brand strong { color: var(--gold); }

  .brand-mark {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid var(--gold);
    border-radius: 10px 3px 10px 3px;
    color: var(--gold-bright);
    font-family: Georgia, serif;
    font-size: 21px;
  }

  .header-caption,
  .eyebrow,
  .summary-label {
    color: var(--gold);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .17em;
  }

  .main-content {
    width: min(1120px, calc(100% - 48px));
    margin: 0 auto;
    flex: 1;
    padding: 66px 0 76px;
  }

  .intro { max-width: 650px; margin-bottom: 32px; }
  .intro .eyebrow, .card-heading .eyebrow { margin: 0 0 8px; }
  h1, h2, p { margin-top: 0; }

  h1 {
    margin-bottom: 10px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 500;
    letter-spacing: -.035em;
    line-height: 1.15;
  }

  .intro > p:last-child { margin-bottom: 0; color: var(--muted); }

  .card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(255,255,255,.025), transparent 60%), var(--surface);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .18);
  }

  .submit-card { max-width: 560px; padding: 30px; }
  .card-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
  .card-heading h2 { margin: 0; font-size: 21px; font-weight: 600; }
  .heading-icon { color: #77727a; font-family: Georgia, serif; font-size: 22px; }

  form { display: grid; gap: 10px; }
  label { margin-top: 7px; color: #dedbd6; font-size: 13px; font-weight: 600; }

  input, select {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 7px;
    outline: none;
    background: var(--background);
    color: var(--text);
    font: inherit;
    transition: border-color .16s ease, box-shadow .16s ease;
  }

  input::placeholder { color: #77737a; }
  input:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(230, 184, 92, .12); }
  select:disabled { color: var(--muted); }

  .button {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding: 0 16px;
    border: 0;
    border-radius: 7px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background .16s ease, transform .16s ease, opacity .16s ease;
  }

  .button-primary { background: var(--gold); color: #211a10; }
  .button-primary:hover:not(:disabled) { transform: translateY(-1px); background: var(--gold-bright); }
  .button:disabled { cursor: not-allowed; opacity: .5; }
  .card-footnote { margin: 18px 0 0; color: var(--muted); font-size: 12px; }

  .notice {
    padding: 10px 12px;
    border: 1px solid rgba(240, 132, 132, .3);
    border-radius: 6px;
    background: rgba(240, 132, 132, .08);
    color: #ffb6b6;
    font-size: 13px;
  }

  .notice-success {
    border-color: rgba(131, 210, 163, .3);
    background: rgba(131, 210, 163, .08);
    color: var(--green);
  }

  .site-footer {
    min-height: 66px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    color: var(--muted);
    font-size: 12px;
  }

  .text-link { color: var(--gold); font-size: 13px; text-decoration: none; }
  .text-link:hover { color: var(--gold-bright); }
  .queue-content { padding-top: 54px; }

  .queue-summary {
    display: flex;
    min-height: 78px;
    align-items: center;
    gap: 44px;
    margin-bottom: 18px;
    padding: 14px 20px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
  }

  .summary-item { display: grid; gap: 3px; }
  .summary-label { color: var(--muted); font-size: 9px; }
  .summary-item strong { font-size: 15px; }
  .refresh-indicator { margin-left: auto; color: var(--muted); font-size: 12px; }
  .queue-card { padding: 24px; }
  .queue-card .card-heading { margin-bottom: 16px; }
  .table-wrap { overflow-x: auto; }

  table { width: 100%; border-collapse: collapse; text-align: left; }
  th, td { padding: 14px 12px; border-bottom: 1px solid var(--border); }
  th { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
  td { font-size: 13px; }
  tbody tr:last-child td { border-bottom: 0; }
  .position-cell { color: var(--gold-bright); font-weight: 700; }
  .table-empty { padding: 36px 12px; color: var(--muted); text-align: center; }

  .status {
    display: inline-block;
    padding: 3px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
  }

  .status-waiting { border-color: rgba(230,184,92,.3); background: rgba(230,184,92,.08); color: var(--gold-bright); }
  .status-passed { border-color: rgba(141,185,237,.3); background: rgba(141,185,237,.08); color: var(--blue); }
  .status-won { border-color: rgba(131,210,163,.3); background: rgba(131,210,163,.08); color: var(--green); }
  .status-cancelled { border-color: rgba(240,132,132,.3); background: rgba(240,132,132,.08); color: var(--red); }

  @media (max-width: 640px) {
    .site-header, .site-footer, .main-content { width: min(100% - 32px, 1120px); }
    .site-header { min-height: 68px; }
    .brand { gap: 8px; font-size: 10px; letter-spacing: .08em; }
    .brand-mark { width: 32px; height: 32px; }
    .header-caption { display: none; }
    .main-content { padding: 44px 0 54px; }
    .submit-card, .queue-card { padding: 20px; }
    .queue-summary { flex-wrap: wrap; gap: 16px 28px; padding: 16px; }
    .refresh-indicator { width: 100%; margin-left: 0; }
    th, td { padding: 12px 9px; }
    th { font-size: 9px; letter-spacing: .04em; }
    td { font-size: 12px; }
    .site-footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 2px; padding: 12px 0; }
  }
  /* Queue item selector */
.item-selector {
  width: calc(100% - 40px);
  max-width: 1080px;
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  box-sizing: border-box;
}

.item-selector select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.login-section {
  display: flex;
  justify-content: flex-start;
  margin: 16px auto 24px;
}

.button-discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  padding: 13px 24px;
  background: #f5c542;
  color: #171717;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  transition: background 0.2s ease;
}

.button-discord:hover {
  background: #e5b52e;
}