/* HedgeEm Lobby — hedgeem.qeetoto.com
   Brand: dark bg #0a0f0a, gold #f5c518, green #3d8a3d
   Stack: vanilla CSS, no framework */

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

:root {
  --gold:    #f5c518;
  --green:   #3d8a3d;
  --green-dk:#2d6a2d;
  --bg:      #0a0f0a;
  --bg-card: #111a11;
  --bg-card-hover: #162016;
  --border:  #1e3a1e;
  --text:    #ffffff;
  --text-dim:#aaaaaa;
  --red:     #e05252;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── HEADER ─────────────────────────────────────────────── */
.lobby-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  background: rgba(10,15,10,0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.header-logo img {
  height: 36px;
  width: auto;
}

.header-logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold);
}

.header-logo-sub {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
  line-height: 1;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border-radius: 6px;
  border: none;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
  user-select: none;
  white-space: nowrap;
}
.btn:hover  { opacity: 0.88; }
.btn:active { transform: scale(0.97); }

.btn-gold {
  background: var(--gold);
  color: #000;
}
.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
}
.btn-google {
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  font-weight: 500;
  gap: 10px;
}
.btn-google:hover { background: #f8f9fa; opacity: 1; }
.btn-google svg   { flex-shrink: 0; }

.modal-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: #444;
  font-size: 0.78rem;
}
.modal-divider::before,
.modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.btn-green {
  background: var(--green);
  color: #fff;
}
.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

/* ── USER PILL (logged-in state) ─────────────────────────── */
.user-pill {
  display: none; /* shown via JS when logged in */
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: #fff;
  letter-spacing: 0.02em;
}
.user-name {
  font-size: 0.875rem;
  color: var(--text-dim);
}
.user-balance {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
}
.user-balance:hover {
  text-decoration: underline;
}

/* ── HERO ─────────────────────────────────────────────────── */
.lobby-hero {
  text-align: center;
  padding: 64px 24px 48px;
  background: radial-gradient(ellipse at 50% 0%, #0d200d 0%, var(--bg) 70%);
  border-bottom: 1px solid var(--border);
}

.hero-tagline {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 12px;
}
.hero-tagline em {
  font-style: normal;
  color: var(--gold);
}

.hero-sub {
  font-size: 1rem;
  color: var(--text-dim);
  max-width: 480px;
  margin: 0 auto 20px;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 0 auto 24px;
}
.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.hero-stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  font-weight: 600;
}
.hero-stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -0.01em;
}
.hero-stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

/* ── SECTION ─────────────────────────────────────────────── */
.lobby-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}

.section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── GAME TILE GRID ──────────────────────────────────────── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.game-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  cursor: pointer;
}
.game-tile:hover {
  border-color: var(--green);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(61,138,61,0.15);
  background: var(--bg-card-hover);
}
.game-tile.coming-soon {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}
.game-tile.coming-soon:hover {
  transform: none;
  box-shadow: none;
}

.tile-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0d1a0d;
}
.tile-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tile-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, #0d1a0d 0%, #162016 100%);
}

/* Lock overlay — visible when user is not logged in (.lobby-locked) */
.tile-lock {
  display: none;
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.72);
  color: #fff;
  border-radius: 6px;
  padding: 4px 8px 4px 6px;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  pointer-events: none;
  user-select: none;
}
.lobby-locked .tile-lock {
  display: flex;
}

.tile-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge-live    { background: var(--green);  color: #fff; }
.badge-legacy  { background: #555;          color: #fff; }
.badge-soon    { background: #333;          color: var(--text-dim); }

.tile-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.tile-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.tile-version {
  font-size: 0.72rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.tile-desc {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.4;
  flex: 1;
}

.tile-footer {
  padding: 12px 16px 16px;
  display: flex;
  gap: 8px;
}
.tile-play-btn {
  flex: 1;
}

/* ── ODDS CALCULATOR PROMO ───────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, transform 0.15s;
}
.tool-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.tool-icon { font-size: 2rem; }
.tool-name { font-size: 1rem; font-weight: 700; }
.tool-desc { font-size: 0.82rem; color: var(--text-dim); line-height: 1.4; }

/* ── MODALS ──────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open {
  display: flex;
}

.modal {
  background: #111a11;
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  padding: 32px 28px;
  position: relative;
  animation: modal-in 0.18s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,0.05); }

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--gold);
}

/* ── FORM ELEMENTS ───────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.form-input {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus {
  border-color: var(--green);
}
.form-input::placeholder { color: #555; }

.form-error {
  font-size: 0.8rem;
  color: var(--red);
  min-height: 18px;
  display: none;
}
.form-error.visible { display: block; }

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.modal-footer-link {
  text-align: center;
  margin-top: 16px;
  font-size: 0.82rem;
  color: var(--text-dim);
}
.modal-footer-link a {
  color: var(--gold);
  text-decoration: none;
  cursor: pointer;
}
.modal-footer-link a:hover { text-decoration: underline; }

/* ── THEME PICKER ────────────────────────────────────────── */
.theme-picker {
  display: flex;
  gap: 4px;
  padding: 0 16px 12px;
}

.theme-btn {
  flex: 1;
  padding: 5px 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.theme-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}
.theme-btn.active {
  background: var(--green-dk);
  border-color: var(--green);
  color: #fff;
}

/* ── FOOTER ──────────────────────────────────────────────── */
.lobby-footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 24px;
  font-size: 0.78rem;
  color: #555;
  margin-top: auto;
}

/* ── LIVE TABLES ─────────────────────────────────────────── */
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Pulsing green dot next to "Live Tables" heading */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0.5;
  flex-shrink: 0;
}
.live-dot.pulse {
  animation: live-pulse 0.6s ease-out forwards;
}
@keyframes live-pulse {
  0%   { opacity: 0.5; transform: scale(1); }
  50%  { opacity: 1;   transform: scale(1.6); }
  100% { opacity: 0.5; transform: scale(1); }
}

/* Loading state */
.live-tables-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  font-size: 0.875rem;
}
.live-tables-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.live-tables-empty {
  font-size: 0.875rem;
  color: var(--text-dim);
  padding: 20px 0;
}

/* Table card grid */
.live-tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.live-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.live-table-id {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.live-table-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.live-table-players {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Game state badge */
.live-table-state {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.state-waiting  { background: rgba(80,80,80,0.3);   color: #aaa; }
.state-betting  { background: rgba(245,197,24,0.15); color: var(--gold); }
.state-dealing  { background: rgba(30,140,60,0.2);  color: #6be06b; }
.state-showdown { background: rgba(200,80,80,0.2);  color: #e06b6b; }
.state-active   { background: rgba(60,100,60,0.2);  color: var(--text-dim); }

.live-table-join {
  align-self: flex-start;
  margin-top: auto;
  text-decoration: none;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .lobby-header { padding: 0 16px; }
  .header-logo-text { font-size: 1rem; }
  .lobby-hero { padding: 40px 16px 32px; }
  .lobby-section { padding: 32px 16px; }
  .game-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .tile-body { padding: 12px; }
  .tile-title { font-size: 0.9rem; }
  .tile-footer { padding: 8px 12px 12px; }
}
@media (max-width: 400px) {
  .game-grid { grid-template-columns: 1fr; }
}
