:root {
  --bg: #111827;
  --panel: #121822;
  --panel-2: #0f141d;
  --text: #e6edf3;
  --muted: #94a3b8;
  --accent: #f4b942;
  --accent-2: #10b981;
  --danger: #ef4444;
  --border: #1f2937;
  --shadow: 0 10px 30px rgba(0,0,0,0.4);
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  background:
    linear-gradient(180deg, rgba(8, 12, 18, 0.85), rgba(8, 12, 18, 0.95)),
    url("/static/game-night-photo-bg.png") center/cover fixed no-repeat;
  color: var(--text);
}

.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(14, 20, 28, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.10);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.brand {
  font-weight: 700;
  letter-spacing: 0.5px;
}

.nav a {
  color: var(--muted);
  margin-left: 16px;
  text-decoration: none;
  font-size: 14px;
}

.nav a:hover { color: var(--text); }

.content {
  margin-top: 24px;
  background: rgba(12, 17, 25, 0.70);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid rgba(148, 163, 184, 0.08);
  box-shadow: 0 8px 18px rgba(0,0,0,0.25);
}

h1, h2, h3 {
  margin: 0 0 16px 0;
}

p { color: var(--muted); }

.card {
  background: var(--panel-2);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-actions {
  display: flex;
  align-items: flex-end;
}


input, select {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0c1119;
  color: var(--text);
  font-size: 14px;
}

input[type="checkbox"] {
  width: auto;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.btn {
  display: inline-block;
  padding: 12px 18px;
  background: var(--accent);
  color: #111;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.edit-btn {
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1;
}

.btn.secondary {
  background: #334155;
  color: var(--text);
}

.btn.danger { background: var(--danger); }

.btn.block { width: 100%; }

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.info-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.info-popup {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--muted);
  font-size: 13px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-card {
  background: rgba(12, 17, 25, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 16px;
  width: min(420px, 92vw);
  box-shadow: var(--shadow);
}

.rotate-pill {
  display: none;
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
  z-index: 20;
}

@media (max-width: 900px) and (orientation: portrait) {
  .rotate-pill { display: inline-flex; }
  .rsvp-table .hide-mobile { display: none; }
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.2;
  background: #0f172a;
  border: 1px solid var(--border);
  color: var(--muted);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, .table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.notice {
  padding: 12px;
  background: #1f2937;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.notice-strong {
  background: #5c3b00 !important;
  border-color: #f59e0b !important;
  color: #fff3c4 !important;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.35);
}

.error {
  color: #fecaca;
  background: #3f1d1d;
  border: 1px solid #7f1d1d;
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .content { padding: 16px; }
  .game-meta { display: block; }
.game-meta .game-location { display: block; margin-top: 4px; color: var(--muted); }
.map-link { color: var(--muted); text-decoration: underline; }
.map-link:hover { color: var(--text); }
  .rsvp-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

body.host-display-page {
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(245, 158, 11, 0.18), transparent 36%),
    linear-gradient(180deg, #05080d 0%, #09111a 45%, #05080d 100%);
}

body.host-display-page .app {
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

body.host-display-page .topbar {
  display: none;
}

body.host-display-page .content {
  margin-top: 0;
  min-height: 100vh;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.host-display-dashboard-link {
  position: fixed;
  top: 16px;
  right: 18px;
  z-index: 30;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: #f8fafc;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
}

.host-display-dashboard-link:hover {
  background: rgba(30, 41, 59, 0.92);
}

.host-display-viewport {
  width: 100%;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  position: fixed;
  inset: 0;
  padding: 28px 34px;
}

.host-display-board {
  width: max-content;
  transform-origin: top left;
  will-change: transform;
}

.host-display-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: max-content;
  min-width: 1280px;
}

.host-display-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.host-display-title {
  font-size: clamp(2.8rem, 4.8vw, 5rem);
  line-height: 1.05;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.host-display-meta {
  font-size: clamp(1.25rem, 2vw, 1.85rem);
  gap: 22px;
  color: #cbd5e1;
}

.host-display-badges {
  justify-content: flex-end;
}

.host-display-badge {
  font-size: clamp(1.15rem, 1.8vw, 1.5rem);
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.22);
  color: #f8fafc;
}

.host-display-table-wrap {
  flex: 1;
  background: rgba(8, 13, 20, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  overflow: hidden;
}

.host-display-table th,
.host-display-table td {
  padding: 12px 14px;
  font-size: clamp(1.2rem, 2vw, 1.75rem);
}

.host-display-table th {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: rgba(11, 18, 27, 0.94);
}

.host-display-table td[data-label="Fast"] {
  white-space: nowrap;
  font-weight: 700;
  color: #fcd34d;
}

.host-display-table td[data-label="Name"] {
  font-size: clamp(1.35rem, 2.25vw, 2rem);
  font-weight: 700;
}

.host-display-table td[data-label="Seat"] {
  font-weight: 700;
  font-size: clamp(1.7rem, 2.8vw, 2.4rem);
  color: #f8fafc;
}

@media (max-width: 900px) {
  .host-display-header {
    flex-direction: column;
  }

  .host-display-badges {
    justify-content: flex-start;
  }
}


.stats-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.stats-heading p {
  margin: -8px 0 0;
}

.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}

.stats-kpi {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 20, 29, 0.88);
}

.stats-kpi strong {
  display: block;
  font-size: 30px;
  line-height: 1;
  color: var(--text);
}

.stats-kpi small,
.stats-kpi-label {
  color: var(--muted);
  font-size: 12px;
}

.stats-kpi-active {
  border-left: 3px solid var(--accent-2);
}

.stats-kpi-cancelled {
  border-left: 3px solid var(--danger);
}

.stats-section {
  padding: 20px 0;
  border-top: 1px solid var(--border);
}

.stats-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stats-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.stats-table {
  min-width: 600px;
}

.stats-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.stats-split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.6fr);
  gap: 28px;
}

.stats-bars {
  display: grid;
  gap: 15px;
}

.stats-bar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 14px;
}

.stats-bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #0c1119;
  border: 1px solid var(--border);
}

.stats-bar-track span {
  display: block;
  height: 100%;
  min-width: 2px;
  background: var(--accent);
}

.stats-response-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stats-response-grid div {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 20, 29, 0.88);
}

.stats-response-grid span,
.stats-response-grid strong {
  display: block;
}

.stats-response-grid span {
  color: var(--muted);
  font-size: 11px;
}

.stats-response-grid strong {
  margin-top: 6px;
  font-size: 22px;
}

@media (max-width: 760px) {
  .stats-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-split {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (max-width: 480px) {
  .stats-heading {
    display: block;
  }

  .stats-heading .btn {
    margin-top: 12px;
  }

  .stats-kpi {
    min-height: 100px;
    padding: 12px;
  }

  .stats-kpi strong {
    font-size: 26px;
  }
}


.registration-attestation {
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px solid rgba(245, 158, 11, 0.55);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: rgba(92, 59, 0, 0.34);
}

.registration-attestation > strong {
  display: block;
  margin-bottom: 6px;
}

.registration-attestation p {
  margin: 0 0 12px;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.45;
}

.registration-attestation a {
  display: inline-block;
  margin-top: 10px;
  color: #fcd34d;
  font-size: 12px;
}

.registration-attestation-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
}

.registration-attestation-check input {
  flex: 0 0 auto;
  margin-top: 3px;
}

.invite-list-picker {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding: 4px;
}

.check-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  display: flex;
  gap: 10px;
  padding: 9px 10px;
}

.check-row input {
  width: auto;
}

.check-row small {
  color: var(--muted);
}

.sms-preview-box {
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 14px;
  padding: 12px;
}

.sms-preview-box p {
  margin-bottom: 0;
}
