/*
 * client/style/landing.css — V1.8 handover_10: the front door.
 * Same token system as main.css (client/style/tokens.css) — no raw hex here.
 */

@import "./tokens.css";

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background: var(--mat-void);
  color: var(--ink-bright);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
}

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

.hidden { display: none !important; }

.brand {
  font-family: var(--font-display);
  color: var(--neon-cyan);
  letter-spacing: 0.14em;
  font-weight: 600;
  font-size: 1.1rem;
}

/* ── Password gate ───────────────────────────────────────────────────── */

.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.gate-inner {
  max-width: 24rem;
  width: 100%;
  text-align: center;
}

.gate-inner .brand { font-size: 1.75rem; display: block; margin-bottom: var(--space-2); }

.gate-sub { color: var(--ink-dim); margin-bottom: var(--space-4); }

#gate-form {
  display: flex;
  gap: var(--space-2);
}

#gate-password {
  flex: 1;
  background: var(--mat-panel);
  border: 1px solid var(--mat-line);
  color: var(--ink-bright);
  border-radius: var(--radius-chip);
  padding: var(--space-2) var(--space-3);
  font-size: 14px;
}
#gate-password:focus { outline: 1px solid var(--neon-violet); }

#gate-submit {
  background: var(--neon-violet);
  color: var(--mat-void);
  border: none;
  border-radius: var(--radius-chip);
  padding: var(--space-2) var(--space-3);
  font-weight: 600;
}
#gate-submit:hover { box-shadow: var(--glow-violet); }

.gate-error {
  margin-top: var(--space-3);
  color: var(--neon-red);
}

/* ── Front door ──────────────────────────────────────────────────────── */

.fd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--mat-line);
}

.link-btn {
  background: none;
  border: none;
  color: var(--ink-faint);
  font-size: 12px;
  text-decoration: underline;
}
.link-btn:hover { color: var(--ink-dim); }

.fd-main {
  max-width: 60rem;
  margin: 0 auto;
  padding: var(--space-4);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 720px) {
  .fd-main { grid-template-columns: 1fr; }
}

.fd-panel {
  background: var(--mat-panel);
  border: 1px solid var(--mat-line);
  border-radius: var(--radius-card);
  padding: var(--space-3);
}

.fd-panel h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ink-bright);
  margin-bottom: var(--space-1);
}

.fd-hint {
  color: var(--ink-dim);
  font-size: 12px;
  margin-bottom: var(--space-3);
}

.fd-error {
  color: var(--neon-red);
  font-size: 12px;
  margin-top: var(--space-2);
}

#new-table-form {
  display: flex;
  gap: var(--space-2);
}

#new-table-name {
  flex: 1;
  background: var(--mat-void);
  border: 1px solid var(--mat-line);
  color: var(--ink-bright);
  border-radius: var(--radius-chip);
  padding: var(--space-2);
}

#new-table-submit {
  background: var(--neon-lime);
  color: var(--mat-void);
  border: none;
  border-radius: var(--radius-chip);
  padding: var(--space-2) var(--space-3);
  font-weight: 600;
  white-space: nowrap;
}
#new-table-submit:hover { box-shadow: 0 0 18px rgba(138,255,122,0.4); }

.table-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.table-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  background: var(--mat-raised);
  border-radius: var(--radius-chip);
  padding: var(--space-2);
  font-size: 12px;
}

.table-row .table-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.table-row .table-title {
  color: var(--ink-bright);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-row .table-sub {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 11px;
}

.table-row .table-actions {
  display: flex;
  gap: var(--space-1);
  flex: 0 0 auto;
}

.table-row button, .table-row a.table-action {
  background: var(--mat-void);
  border: 1px solid var(--mat-line);
  color: var(--ink-bright);
  border-radius: var(--radius-chip);
  padding: 4px 8px;
  font-size: 11px;
  text-decoration: none;
  display: inline-block;
}
.table-row button:hover, .table-row a.table-action:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); }
.table-row button.danger:hover { border-color: var(--neon-red); color: var(--neon-red); }

.table-row .winner-badge {
  color: var(--neon-amber);
}

/* ── Copy-link result panel ──────────────────────────────────────────── */

.join-link-panel {
  background: var(--mat-raised);
  border: 1px solid var(--neon-violet);
  border-radius: var(--radius-chip);
  padding: var(--space-3);
  margin-top: var(--space-2);
}

.join-link-row {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.join-link-row input {
  flex: 1;
  background: var(--mat-void);
  border: 1px solid var(--mat-line);
  color: var(--ink-bright);
  border-radius: var(--radius-chip);
  padding: var(--space-2);
  font-family: var(--font-mono);
  font-size: 11px;
}

.join-link-row button {
  background: var(--neon-cyan);
  color: var(--mat-void);
  border: none;
  border-radius: var(--radius-chip);
  padding: var(--space-2) var(--space-3);
  font-weight: 600;
}

/* ── Close-confirm popup (D13 — shared shape with the in-game one) ─────── */

#close-confirm {
  position: fixed;
  inset: 0;
  background: rgba(10,6,18,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.confirm-inner {
  background: var(--mat-panel);
  border: 1px solid var(--neon-red);
  border-radius: var(--radius-card);
  padding: var(--space-4);
  max-width: 26rem;
  width: 100%;
}

.confirm-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: var(--space-3);
}

.confirm-consequences {
  list-style: disc;
  padding-left: 1.2em;
  color: var(--ink-bright);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}

.confirm-btn-row {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
}

.confirm-danger-btn {
  background: var(--neon-red);
  color: var(--mat-void);
  border: none;
  border-radius: var(--radius-chip);
  padding: var(--space-2) var(--space-3);
  font-weight: 600;
}

.confirm-cancel-btn {
  background: transparent;
  border: 1px solid var(--mat-line);
  color: var(--ink-dim);
  border-radius: var(--radius-chip);
  padding: var(--space-2) var(--space-3);
}

/* ── Toasts (same shape as main.css's, duplicated here since landing.html
   never loads main.css — no build step to share a partial across bundles) ── */

#toast-stack {
  position: fixed;
  top: var(--space-3);
  right: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 200;
  max-width: 22rem;
}

.toast {
  display: flex;
  background: var(--mat-panel);
  border: 1px solid var(--mat-line);
  border-radius: var(--radius-chip);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.toast-bar { width: 4px; background: var(--neon-cyan); }
.toast.error .toast-bar { background: var(--neon-red); }
.toast.warning .toast-bar { background: var(--neon-amber); }
.toast.info .toast-bar { background: var(--neon-cyan); }

.toast-body { flex: 1; padding: var(--space-2) var(--space-3); font-size: 12px; }
.toast-sev { display: block; font-weight: 700; letter-spacing: 0.06em; font-size: 10px; color: var(--ink-dim); }
.toast-msg { display: block; color: var(--ink-bright); margin-top: 2px; }
.toast-close {
  background: none; border: none; color: var(--ink-faint);
  padding: var(--space-1) var(--space-2); align-self: flex-start;
}
