/* Ascendant Play — shared styles for the lobby + player hub shell.
   Static preview build: everything is client-side, no backend yet. */

:root {
  --bg: #0d0b14;
  --bg-raise: #16121f;
  --bg-card: #1c1729;
  --line: #2e2740;
  --line-soft: #241d33;
  --text: #ece7f4;
  --text-dim: #9a91ad;
  --text-faint: #6c6480;
  --gold: #d9a94a;
  --gold-soft: #f0cd8a;
  --accent: #8b5cf6;
  --accent-soft: #a78bfa;
  --danger: #e5484d;
  --ok: #46a758;
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

/* Keep the hidden attribute authoritative — our display rules on
   .notice etc. would otherwise out-specificity the UA stylesheet. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1200px 600px at 50% -200px, #241b3a 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

a { color: var(--accent-soft); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Shell ---- */

.shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px 64px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 32px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand .brand-sub {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.topnav {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.topnav a {
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
}
.topnav a:hover { color: var(--text); text-decoration: none; background: var(--bg-raise); }
.topnav a.is-active { color: var(--text); background: var(--bg-card); }

/* ---- Cards / panels ---- */

.panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.panel + .panel { margin-top: 20px; }

.panel h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
.panel .panel-sub {
  margin: 0 0 18px;
  color: var(--text-dim);
  font-size: 0.88rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* ---- Buttons & inputs ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-raise);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: #201a30; border-color: #3b3255; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(180deg, #9d6ef8, #7c4fe0);
  border-color: #8b5cf6;
  color: #fff;
}
.btn-primary:hover { background: linear-gradient(180deg, #a97ffc, #8a5cf0); border-color: #a78bfa; }

.btn-gold {
  background: linear-gradient(180deg, #e6b95e, #c99435);
  border-color: var(--gold);
  color: #241a05;
}
.btn-gold:hover { background: linear-gradient(180deg, #f0c86f, #d6a344); border-color: var(--gold-soft); }

.btn-ghost { background: transparent; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: transparent; }
.btn-danger-ghost:hover { background: rgba(229, 72, 77, 0.1); border-color: rgba(229, 72, 77, 0.35); }

.btn-block { width: 100%; }
.btn-lg { padding: 13px 24px; font-size: 1rem; }
.btn-sm { padding: 5px 12px; font-size: 0.82rem; font-weight: 500; }

label.field {
  display: block;
  margin-bottom: 14px;
}
label.field .field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

input[type="text"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}
input[type="text"]:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}
textarea { resize: vertical; min-height: 70px; }

.input-row {
  display: flex;
  gap: 10px;
}
.input-row input { flex: 1; }

.code-input {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-family: Consolas, 'Cascadia Mono', monospace;
  font-weight: 700;
}

/* ---- Hero (landing) ---- */

.hero {
  text-align: center;
  padding: 40px 0 36px;
}
.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.02em;
}
.hero h1 .gold { color: var(--gold); }
.hero p {
  margin: 0 auto;
  max-width: 520px;
  color: var(--text-dim);
}

/* ---- Notices ---- */

.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(217, 169, 74, 0.35);
  background: rgba(217, 169, 74, 0.08);
  color: var(--gold-soft);
  font-size: 0.88rem;
  margin-bottom: 24px;
}
.notice .notice-icon { flex-shrink: 0; }

/* ---- Toast ---- */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--bg-raise);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 100;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Hub: profile ---- */

.profile-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #5b3aa8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  user-select: none;
  overflow: hidden;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-name { font-size: 1.1rem; font-weight: 700; }
.profile-sub { color: var(--text-faint); font-size: 0.85rem; }

.google-hint {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.google-hint .hint-text { color: var(--text-faint); font-size: 0.83rem; }

/* ---- Hub: decks ---- */

.deck-list { list-style: none; margin: 0; padding: 0; }
.deck-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line-soft);
}
.deck-item:last-child { border-bottom: none; }
.deck-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-raise);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.deck-meta { flex: 1; min-width: 0; }
.deck-name { font-weight: 600; }
.deck-sub {
  color: var(--text-faint);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.deck-format-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-soft);
  border: 1px solid rgba(139, 92, 246, 0.3);
  margin-right: 8px;
}
.deck-actions { display: flex; gap: 6px; flex-shrink: 0; }

.empty-hint {
  color: var(--text-faint);
  font-size: 0.9rem;
  text-align: center;
  padding: 22px 0;
}

/* ---- Hub: stats ---- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}
.stat-tile {
  background: var(--bg-raise);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text-dim); }
.stat-label {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ---- Room ---- */

.room-code-panel { text-align: center; }
.room-code {
  font-family: Consolas, 'Cascadia Mono', monospace;
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin: 6px 0 2px;
  user-select: all;
}
.room-code-label {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.seat-list { list-style: none; margin: 0; padding: 0; }
.seat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line-soft);
}
.seat:last-child { border-bottom: none; }
.seat .avatar { width: 40px; height: 40px; font-size: 1rem; }
.seat.is-empty .avatar {
  background: var(--bg-raise);
  border: 1px dashed var(--line);
  color: var(--text-faint);
}
.seat-name { font-weight: 600; }
.seat-role { color: var(--text-faint); font-size: 0.8rem; }
.seat-tag {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 10px;
  border-radius: 999px;
}
.seat-tag.host { background: rgba(217, 169, 74, 0.14); color: var(--gold); border: 1px solid rgba(217, 169, 74, 0.4); }
.seat-tag.you { background: rgba(70, 167, 88, 0.14); color: #7bd28d; border: 1px solid rgba(70, 167, 88, 0.4); }
.seat-tag.waiting { background: var(--bg-raise); color: var(--text-faint); border: 1px solid var(--line-soft); }

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* ---- Game placeholder (the meme room) ---- */

.stage-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  text-align: center;
  background:
    radial-gradient(900px 480px at 50% 18%, rgba(240, 205, 138, 0.14) 0%, transparent 62%),
    var(--bg);
}
.meme-line {
  font-size: clamp(1.4rem, 4.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 0 #000, 0 0 18px rgba(0, 0, 0, 0.6);
  margin: 0;
}
.meme-line.bottom { margin-top: 8px; }

.pedestal-scene {
  position: relative;
  margin: 44px 0 40px;
  width: min(420px, 82vw);
}
.spotlight {
  position: absolute;
  left: 50%;
  top: -130px;
  transform: translateX(-50%);
  width: 78%;
  height: 200px;
  background: linear-gradient(180deg, rgba(240, 205, 138, 0.22), transparent 85%);
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
  pointer-events: none;
}
.pedestal {
  position: relative;
  margin: 0 auto;
  width: 56%;
}
.pedestal .top {
  height: 22px;
  background: linear-gradient(180deg, #f3ead9, #cfc4ab);
  border-radius: 4px 4px 0 0;
  box-shadow: 0 2px 0 rgba(0,0,0,0.25);
}
.pedestal .column {
  height: 110px;
  margin: 0 10%;
  background: linear-gradient(90deg, #b9ad93, #efe6d2 30%, #d8cdb4 70%, #a99d84);
}
.pedestal .base {
  height: 26px;
  background: linear-gradient(180deg, #e8dfc9, #b5a98e);
  border-radius: 0 0 4px 4px;
}
.rope-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: -58px;
  position: relative;
  z-index: 2;
}
.rope-post {
  width: 10px;
  height: 84px;
  background: linear-gradient(90deg, #8a6a1f, #e0b64e 45%, #8a6a1f);
  border-radius: 4px;
  position: relative;
}
.rope-post::before {
  content: '';
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f3d27a, #96741f);
}
.rope {
  flex: 1;
  height: 46px;
  margin: 0 -2px;
  align-self: flex-start;
  margin-top: 6px;
  border: none;
  border-bottom: 9px solid #8e2f3c;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  opacity: 0.95;
}
.stage-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.stage-note {
  margin-top: 18px;
  color: var(--text-faint);
  font-size: 0.85rem;
}

/* ---- Connection status pill ---- */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--bg-raise);
  color: var(--text-dim);
}
.status-pill::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
}
.status-pill.is-online { color: #7bd28d; border-color: rgba(70, 167, 88, 0.4); }
.status-pill.is-online::before { background: var(--ok); }
.status-pill.is-connecting, .status-pill.is-reconnecting { color: var(--gold-soft); border-color: rgba(217, 169, 74, 0.4); }
.status-pill.is-connecting::before, .status-pill.is-reconnecting::before {
  background: var(--gold);
  animation: pulse 1.2s ease-in-out infinite;
}
.status-pill.is-closed { color: var(--danger); border-color: rgba(229, 72, 77, 0.4); }
.status-pill.is-closed::before { background: var(--danger); }
.status-pill.is-local::before { background: var(--accent); }

/* ---- Lobby chat ---- */

.chat-log {
  height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-size: 0.9rem;
}
.chat-msg .chat-from { font-weight: 700; color: var(--accent-soft); margin-right: 6px; }
.chat-msg.is-you .chat-from { color: var(--gold-soft); }
.chat-msg.is-system { color: var(--text-faint); font-style: italic; font-size: 0.84rem; }

.seat-deck {
  color: var(--text-faint);
  font-size: 0.78rem;
}
.spectator-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  color: var(--text-faint);
  font-size: 0.85rem;
}

/* ---- Footer ---- */

.foot {
  margin-top: 48px;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.8rem;
}
