:root {
  --bg: #14151c;
  --surface: #1e1f29;
  --surface-2: #262837;
  --border: #34364a;
  --brass: #c9a227;
  --brass-glow: rgba(201, 162, 39, 0.35);
  --ember: #c1502e;
  --teal: #4fa893;
  --text: #ede6d6;
  --text-muted: #9c978a;

  --font-display: "Cinzel", serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(201, 162, 39, 0.08), transparent),
    radial-gradient(ellipse 700px 500px at 100% 0%, rgba(79, 168, 147, 0.06), transparent);
  background-attachment: fixed;
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* ---------------------------------------------------------------- hero */

.hero {
  position: relative;
  text-align: center;
  padding: 18px 50px 8px;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 6px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 6vw, 52px);
  letter-spacing: 0.03em;
  margin: 0 0 10px;
  background: linear-gradient(180deg, #f5eeda, var(--brass));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-tagline {
  max-width: 520px;
  margin: 0 auto;
  color: var(--text-muted);
  line-height: 1.5;
  font-size: 15px;
}

#quorumWord {
  color: var(--brass);
  font-family: var(--font-mono);
  font-weight: 500;
}

.icon-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { border-color: var(--brass); color: var(--brass); }

#settingsBtn {
  position: absolute;
  top: 18px;
  right: 0;
}

/* --------------------------------------------------- next session panel */

.next-session-panel {
  display: flex;
  align-items: center;
  gap: 28px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px 28px;
  margin: 22px 0 30px;
  flex-wrap: wrap;
}

.seat-table { flex: 0 0 auto; }

.next-session-copy { flex: 1 1 240px; min-width: 220px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.next-session-headline {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.next-session-sub {
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ------------------------------------------------------------- columns */

.columns {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
}

@media (max-width: 760px) {
  .columns { grid-template-columns: 1fr; }
  .next-session-panel { flex-direction: column; text-align: center; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 0 0 4px;
  letter-spacing: 0.02em;
}

.card-hint {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 16px;
  line-height: 1.5;
}

/* ------------------------------------------------------------ controls */

.select, input[type="text"], input[type="number"], input[type="date"] {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 10px;
  font-family: var(--font-body);
  font-size: 14px;
}
.select:focus, input:focus {
  outline: 2px solid var(--brass);
  outline-offset: 1px;
}

.btn {
  border-radius: 8px;
  padding: 9px 16px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-brass {
  background: var(--brass);
  color: #211a05;
}
.btn-brass:hover { background: #ddb52c; }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--brass); color: var(--brass); }

.player-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.player-row .select { flex: 1; min-width: 140px; }

/* ------------------------------------------------------------- grid ui */

.avail-grid {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 6px;
}
.avail-grid th {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 500;
  padding: 6px 4px;
  text-align: left;
}
.avail-grid .day-label {
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-body);
  color: var(--text);
  font-size: 13px;
}
.avail-grid td { padding: 3px; }

.toggle-cell {
  width: 100%;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.toggle-cell:hover { border-color: var(--brass); }
.toggle-cell[aria-pressed="true"] {
  background: var(--brass);
  border-color: var(--brass);
  box-shadow: 0 0 0 3px var(--brass-glow);
}

/* --------------------------------------------------------- overrides ui */

.overrides-block {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.overrides-block summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--brass);
  font-weight: 600;
}
.override-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.override-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}
.override-list li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.override-list button {
  background: none;
  border: none;
  color: var(--ember);
  cursor: pointer;
  font-family: var(--font-mono);
}

/* ------------------------------------------------------------ sessions */

.session-list { display: flex; flex-direction: column; gap: 10px; }

.session-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.session-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.session-date {
  font-family: var(--font-display);
  font-size: 15px;
}
.session-when {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.session-attendees {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.avatar-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 9px 3px 3px;
  font-size: 12px;
}
.avatar-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
}
.session-cancel {
  margin-top: 10px;
  background: none;
  border: none;
  color: var(--ember);
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font-mono);
}

.empty-state {
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font-mono);
  padding: 20px 0;
  text-align: center;
}

.foot {
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  margin-top: 40px;
}

/* --------------------------------------------------------------- modal */

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 14, 0.7);
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  z-index: 20;
  overflow-y: auto;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 460px;
  padding: 22px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.modal-head h2 { font-family: var(--font-display); margin: 0; font-size: 20px; }
.modal-subhead { font-family: var(--font-display); font-size: 15px; margin: 0 0 10px; }
.modal-divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

.field {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
}
.field span { display: block; margin-bottom: 4px; color: var(--text-muted); }
.field input { width: 100%; }
.checkbox-field { display: flex; align-items: center; gap: 8px; }
.checkbox-field span { margin: 0; }
.checkbox-field input { width: auto; }

.roster-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}
.roster-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.roster-list button {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--ember);
  cursor: pointer;
  font-size: 12px;
}

.run-result {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* --------------------------------------------------------- auth screen */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 30px 26px;
  width: 100%;
  max-width: 380px;
}

.auth-tabs {
  display: flex;
  gap: 6px;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 18px;
}
.auth-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px;
  border-radius: 7px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
}
.auth-tab.active {
  background: var(--brass);
  color: #211a05;
}

.auth-form .field { margin-bottom: 14px; }

.auth-error {
  color: var(--ember);
  font-size: 13px;
  font-family: var(--font-mono);
  margin-top: 12px;
  min-height: 16px;
  text-align: center;
}

/* ------------------------------------------------------- signed-in bar */

.session-bar {
  position: absolute;
  top: 18px;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.session-bar .signed-in-as {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.session-bar .avatar-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.admin-note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.roster-list .admin-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--brass);
  border: 1px solid var(--brass);
  border-radius: 6px;
  padding: 1px 5px;
  margin-left: 4px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
