/* L'3ab V1.1 — Aurora Glass Theme */
:root {
  --bg-base: #0D1B2A;
  --glass-bg: rgba(255, 255, 255, 0.10);
  --glass-alt: rgba(0, 245, 212, 0.12);
  --glass-nav: rgba(13, 27, 42, 0.80);
  --border-glass: rgba(255, 255, 255, 0.22);
  --text-main: #F8FAFC;
  --text-muted: #B8C7D9;
  --accent: #00F5D4;
  --accent-ink: #062124;
  --accent-2: #A78BFA;
  --accent-3: #38BDF8;
  --radius: 22px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: var(--bg-base);
  background-image:
    radial-gradient(circle at 12% 14%, rgba(0, 245, 212, 0.32), transparent 46%),
    radial-gradient(circle at 86% 24%, rgba(167, 139, 250, 0.34), transparent 50%),
    radial-gradient(circle at 42% 88%, rgba(56, 189, 248, 0.25), transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  overflow: hidden;
}

.hidden { display: none !important; }

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px;
}
.glass-card.alt { background: var(--glass-alt); }

.glass-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 11px 14px;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
}
.glass-input::placeholder { color: var(--text-muted); }
.glass-input:focus { border-color: var(--accent); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 14px;
  padding: 10px 15px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 245, 212, 0.28);
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--border-glass);
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.full-width { width: 100%; }
.small-btn { padding: 6px 10px; font-size: 12px; }

.chip {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border: 1px solid var(--border-glass);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.gate-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 40;
}
.gate-box { width: 100%; max-width: 380px; text-align: center; display: flex; flex-direction: column; gap: 12px; }
.gate-title { margin: 0; font-size: 22px; font-weight: 800; }
.gate-sub { margin: 0; font-size: 13px; color: var(--text-muted); }
.auth-tabs { display: flex; gap: 8px; justify-content: center; }
.gate-form { display: flex; flex-direction: column; gap: 10px; }
.gate-error {
  font-size: 12px;
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.18);
  border: 1px solid rgba(251, 113, 133, 0.45);
  border-radius: 10px;
  padding: 8px 10px;
}
.gate-info {
  font-size: 12px;
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.45);
  border-radius: 10px;
  padding: 8px 10px;
}

.logo-orb {
  width: 54px; height: 54px; margin: 0 auto; border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #062124; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 20px; box-shadow: 0 8px 22px rgba(0, 245, 212, 0.3);
}
.logo-orb.small { width: 38px; height: 38px; margin: 0; border-radius: 12px; font-size: 15px; }

.app-shell { display: flex; flex-direction: column; height: 100dvh; max-width: 500px; margin: 0 auto; }
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: var(--glass-nav); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass); flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.brand-name { font-weight: 800; font-size: 16px; line-height: 1.2; }
.brand-sub { font-size: 11px; color: var(--text-muted); }

.sync-pill {
  font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 999px;
  background: rgba(0, 245, 212, 0.14); border: 1px solid rgba(0, 245, 212, 0.35); color: var(--accent);
}

.main-scroll { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 13px; }

.bottom-nav {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: var(--glass-nav); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border-glass); flex-shrink: 0;
}
.nav-item {
  background: none; border: none; color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 4px; border-radius: 14px; font-size: 11px; font-weight: 600; cursor: pointer;
}
.nav-item.active { color: var(--accent); background: rgba(0, 245, 212, 0.12); }

.badge-pill {
  display: inline-block; font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 3px 9px; border-radius: 999px; background: var(--accent-2); color: #130F26;
}
.card-title { font-size: 16px; font-weight: 800; margin: 6px 0 4px; }
.darija-text { font-size: 13px; color: var(--text-muted); direction: rtl; text-align: right; margin: 4px 0 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.row-gap { display: flex; gap: 8px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.vibe-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

.answer-bubble {
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--border-glass);
  border-radius: 14px; padding: 10px 12px; font-size: 13px;
}

.option-btn {
  width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--border-glass); background: rgba(255, 255, 255, 0.07);
  color: var(--text-main); font-size: 13px; font-weight: 600; cursor: pointer;
}
.option-btn.selected { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.overlay {
  position: fixed; inset: 0; background: rgba(6, 12, 20, 0.84); backdrop-filter: blur(8px);
  z-index: 50; display: flex; align-items: center; justify-content: center; padding: 10px;
}
.overlay-card { width: 100%; max-width: 440px; max-height: 92dvh; display: flex; flex-direction: column; gap: 10px; }
.overlay-head { display: flex; align-items: center; justify-content: space-between; }
.overlay-title { margin: 0; font-size: 17px; font-weight: 800; }
.overlay-body { overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }

canvas.game-canvas {
  width: 100%; max-width: 360px; aspect-ratio: 1 / 1; margin: 0 auto; display: block;
  border-radius: 14px; border: 1px solid var(--border-glass); background: #0B1622; touch-action: none;
}

/* Real Playing Card Felt Table for Ronda */
.ronda-felt {
  background: radial-gradient(circle at center, #114B3E 0%, #0A2E26 100%);
  border: 2px solid rgba(255, 215, 130, 0.35);
  border-radius: 18px;
  padding: 14px;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.45);
}
.card-hand { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.playing-card {
  width: 64px; height: 92px; border-radius: 10px;
  background: linear-gradient(165deg, #FFFDF8 0%, #F1E9DA 100%);
  color: #1A1A1A; border: 1.5px solid #D5C7B2;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.38);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 5px 6px; font-weight: 900; cursor: pointer; transition: transform 0.12s ease;
}
.playing-card:active { transform: translateY(-4px); }
.playing-card .corner { font-size: 12px; line-height: 1; text-align: left; }
.playing-card .center-suit { font-size: 24px; text-align: center; line-height: 1; }
.playing-card .corner.bottom { transform: rotate(180deg); }

.score-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; text-align: center; gap: 10px; }
.score-num { font-size: 26px; font-weight: 900; color: var(--accent); }

.toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%);
  background: #F8FAFC; color: #0D1B2A; padding: 9px 16px; border-radius: 999px;
  font-size: 12px; font-weight: 800; z-index: 60; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
