/* ================================================
   Shakkba — All Screens
   Design system shared with the in-game prototype
================================================ */

:root {
  --gold: #C9A961;
  --gold-bright: #FFD700;
  --gold-deep: #8a6d2e;
  --red: #8B2635;
  --red-bright: #dc283c;
  --blue: #1B4965;
  --emerald: #1F4D3A;
  --emerald-deep: #0f3325;
  --sand: #E8DCC4;
  --olive: #6B7F50;
  --terra: #C65D32;
  --midnight: #14152a;
  --midnight-deep: #0c0d1c;
  --ivory: #fff8e7;
  --ink: #1a1b2e;
  --line: rgba(201, 169, 97, 0.2);
  --line-strong: rgba(201, 169, 97, 0.45);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 32px;

  --shadow-1: 0 6px 18px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 18px 50px rgba(0, 0, 0, 0.45);
  --shadow-gold: 0 0 0 1px rgba(201, 169, 97, 0.3), 0 14px 40px rgba(0, 0, 0, 0.5);
}

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

html, body {
  font-family: 'Cairo', system-ui, sans-serif;
  background: var(--midnight-deep);
  color: var(--ivory);
  min-height: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(201,169,97,0.08), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(139,38,53,0.10), transparent 60%),
    linear-gradient(180deg, #0d0e1c 0%, #14152a 50%, #0a0b18 100%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; }

/* =========================================================
   NAV
========================================================= */
.screens-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 28px;
  background: rgba(12, 13, 28, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: rgba(201,169,97,0.08);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.brand-name {
  font-family: 'Reem Kufi', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--gold-bright);
  letter-spacing: 0.02em;
  line-height: 1;
}
.brand-sub {
  font-size: 10px;
  color: var(--sand);
  opacity: 0.55;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 3px;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 12px;
}
.nav-tab {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--sand);
  opacity: 0.7;
  transition: all 0.2s ease;
}
.nav-tab:hover {
  opacity: 1;
  background: rgba(255,255,255,0.04);
}
.nav-tab.active {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: var(--midnight-deep);
  opacity: 1;
  box-shadow: 0 4px 12px rgba(201,169,97,0.25);
}

/* =========================================================
   SCREEN BASE
========================================================= */
.screen {
  display: none;
  padding: 40px 32px 80px;
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
  opacity: 1;
}
.screen.active {
  display: block;
  animation: screenIn 0.45s ease;
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(201,169,97,0.08);
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  font-size: 13px;
  color: var(--gold);
  margin-bottom: 16px;
}
.screen-eyebrow .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 10px var(--gold-bright);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.screen-title {
  font-family: 'Reem Kufi', sans-serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  color: var(--ivory);
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.screen-sub {
  color: var(--sand);
  opacity: 0.7;
  font-size: 16px;
  margin-top: 8px;
}

/* =========================================================
   BUTTONS (shared)
========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
  transition: all 0.25s cubic-bezier(.22,1,.36,1);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 50%, var(--gold-deep) 100%);
  color: #20140a;
  box-shadow: 0 6px 18px rgba(201,169,97,0.35), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(255,215,0,0.4), inset 0 1px 0 rgba(255,255,255,0.5);
}
.btn-glow {
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  pointer-events: none;
  animation: btnGlow 3s ease-in-out infinite;
}
@keyframes btnGlow {
  0%,90%,100% { left: -60%; }
  45%,55% { left: 110%; }
}

.btn-ghost {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line-strong);
  color: var(--ivory);
}
.btn-ghost:hover {
  background: rgba(201,169,97,0.08);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.btn-block { width: 100%; }
.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

/* =========================================================
   HOME
========================================================= */
.home {
  padding-top: 0;
  padding-bottom: 100px;
}

.ambient-orbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  animation: orbFloat 20s ease-in-out infinite;
}
.orb-1 { width: 400px; height: 400px; background: var(--gold); top: -10%; right: -5%; animation-delay: 0s; }
.orb-2 { width: 350px; height: 350px; background: var(--red); top: 40%; left: -8%; animation-delay: -7s; }
.orb-3 { width: 300px; height: 300px; background: var(--blue); bottom: -10%; right: 30%; animation-delay: -14s; }
@keyframes orbFloat {
  0%,100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, 30px) scale(1.1); }
  66% { transform: translate(-30px, 50px) scale(0.95); }
}

.floating-cards { position: absolute; inset: 0; pointer-events: none; z-index: 1; opacity: 0.25; }
.float-card {
  position: absolute;
  width: 60px; height: 84px;
  background: linear-gradient(135deg, #5e1a26 0%, #3a0e17 100%);
  border: 1px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.float-card::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(201,169,97,0.3);
  border-radius: 5px;
}
.fc1 { top: 8%; left: 8%; transform: rotate(-15deg); animation: floatA 12s ease-in-out infinite; }
.fc2 { top: 18%; right: 12%; transform: rotate(20deg); animation: floatA 14s ease-in-out infinite -3s; }
.fc3 { bottom: 30%; left: 6%; transform: rotate(8deg); animation: floatA 16s ease-in-out infinite -6s; }
.fc4 { bottom: 12%; right: 20%; transform: rotate(-10deg); animation: floatA 13s ease-in-out infinite -9s; }
.fc5 { top: 50%; left: 45%; transform: rotate(45deg); animation: floatA 18s ease-in-out infinite -2s; opacity: 0.15; }
@keyframes floatA {
  0%,100% { transform: translate(0,0) rotate(var(--r, 0deg)); }
  50% { transform: translate(15px, -20px) rotate(var(--r, 0deg)); }
}

.home-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
  padding-top: 60px;
  padding-bottom: 60px;
}

.home-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: rgba(201,169,97,0.08);
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  width: fit-content;
  font-size: 13px;
  color: var(--gold);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold-bright); box-shadow: 0 0 10px var(--gold-bright); animation: pulse 2s infinite; }

.hero-title {
  font-family: 'Reem Kufi', sans-serif;
  font-weight: 700;
  font-size: clamp(48px, 7vw, 88px);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.line-1 {
  display: block;
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 50%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 20px rgba(255,215,0,0.25));
}
.line-2 {
  display: block;
  color: var(--ivory);
  margin-top: 4px;
  font-size: 0.55em;
  font-weight: 500;
  opacity: 0.85;
}

.hero-sub {
  font-size: 17px;
  line-height: 1.7;
  color: var(--sand);
  opacity: 0.8;
  max-width: 520px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.stat { text-align: center; }
.stat-num {
  font-family: 'Reem Kufi', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--gold-bright);
  line-height: 1;
}
.stat-lbl { font-size: 12px; color: var(--sand); opacity: 0.6; margin-top: 4px; }
.stat-sep { width: 1px; height: 28px; background: var(--line); }

/* hero card stage */
.home-right {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 480px;
}
.hero-card-stage {
  position: relative;
  width: 360px; height: 480px;
  display: grid;
  place-items: center;
  perspective: 1200px;
}
.ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--gold);
  opacity: 0.15;
  animation: ringRot 30s linear infinite;
}
.ring-1 { width: 480px; height: 480px; opacity: 0.1; }
.ring-2 { width: 380px; height: 380px; opacity: 0.18; animation-direction: reverse; animation-duration: 24s; border-style: dashed; }
.ring-3 { width: 280px; height: 280px; opacity: 0.25; animation-duration: 18s; }
@keyframes ringRot { to { transform: rotate(360deg); } }

.hero-card {
  position: relative;
  width: 220px;
  aspect-ratio: 5/7;
  animation: cardFloat 6s ease-in-out infinite;
  transform-style: preserve-3d;
}
@keyframes cardFloat {
  0%,100% { transform: translateY(0) rotateY(-6deg) rotateX(4deg); }
  50% { transform: translateY(-12px) rotateY(6deg) rotateX(-2deg); }
}
.hero-card-inner {
  position: relative;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #fff8e7 0%, #f0e5c5 100%);
  border-radius: 18px;
  border: 1.5px solid var(--gold);
  box-shadow:
    0 30px 60px rgba(0,0,0,0.5),
    0 0 0 1px rgba(255,215,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 12px;
}
.card-edge {
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(201,169,97,0.4);
  border-radius: 12px;
  pointer-events: none;
}
.card-corner {
  position: absolute;
  font-family: 'Reem Kufi', sans-serif;
  text-align: center;
  color: var(--red-bright);
  z-index: 2;
}
.card-corner.tl { top: 12px; left: 14px; }
.card-corner.br { bottom: 12px; right: 14px; transform: rotate(180deg); }
.card-corner .rank { font-size: 28px; font-weight: 700; line-height: 1; }
.card-corner .suit { font-size: 22px; line-height: 1; color: var(--gold-bright); margin-top: 2px; }
.card-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.snake-illust { width: 80%; height: 80%; }
.snake-path {
  stroke-dasharray: 300;
  stroke-dashoffset: 0;
  animation: snakeBreathe 4s ease-in-out infinite;
}
@keyframes snakeBreathe {
  0%,100% { stroke-width: 14; }
  50% { stroke-width: 16; filter: drop-shadow(0 0 6px var(--red-bright)); }
}

.card-shadow {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 30px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.6) 0%, transparent 70%);
  filter: blur(8px);
  z-index: -1;
  animation: shadowPulse 6s ease-in-out infinite;
}
@keyframes shadowPulse {
  0%,100% { transform: translateX(-50%) scale(1); opacity: 0.6; }
  50% { transform: translateX(-50%) scale(0.85); opacity: 0.3; }
}

.card-label {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Reem Kufi', sans-serif;
  font-size: 22px;
  color: var(--gold-bright);
  letter-spacing: 0.1em;
  text-shadow: 0 2px 10px rgba(255,215,0,0.4);
}

.home-features {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 60px;
}
.feature-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(.22,1,.36,1);
}
.feature-card:hover {
  background: rgba(201,169,97,0.06);
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}
.feature-icon {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 14px;
  flex-shrink: 0;
  color: var(--gold-bright);
}
.ico-bot { background: linear-gradient(135deg, rgba(27,73,101,0.4), rgba(27,73,101,0.1)); border: 1px solid rgba(27,73,101,0.5); color: #5dade2; }
.ico-pvp { background: linear-gradient(135deg, rgba(139,38,53,0.4), rgba(139,38,53,0.1)); border: 1px solid rgba(139,38,53,0.5); color: #ec7385; }
.ico-stats { background: linear-gradient(135deg, rgba(201,169,97,0.4), rgba(201,169,97,0.1)); border: 1px solid rgba(201,169,97,0.5); }
.feature-body { flex: 1; }
.feature-title { font-family: 'Reem Kufi', sans-serif; font-size: 18px; color: var(--ivory); }
.feature-sub { font-size: 13px; color: var(--sand); opacity: 0.7; margin-top: 2px; }
.feature-arrow { color: var(--gold); font-size: 22px; transition: transform 0.25s; }
.feature-card:hover .feature-arrow { transform: translateX(-4px); }

.home-proverb {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-top: 60px;
  padding: 32px;
  border-top: 1px solid var(--line);
}
.quote-mark {
  font-family: 'Amiri', serif;
  font-size: 72px;
  color: var(--gold);
  opacity: 0.3;
  line-height: 0.4;
  margin-bottom: 8px;
}
.proverb-text {
  font-family: 'Amiri', serif;
  font-size: 22px;
  color: var(--ivory);
  font-weight: 700;
  margin-bottom: 8px;
}
.proverb-attr {
  font-size: 13px;
  color: var(--gold);
  opacity: 0.8;
}

/* =========================================================
   AUTH (Login + Register)
========================================================= */
.auth {
  padding: 0;
  max-width: none;
  height: calc(100vh - 67px);
  min-height: 700px;
  display: grid;
  place-items: center;
}
.auth-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: 1100px;
  min-height: 640px;
  margin: 32px;
  background: rgba(20, 21, 42, 0.7);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-2);
}

.auth-art {
  position: relative;
  background: linear-gradient(135deg, #1F4D3A 0%, #0f2a20 100%);
  overflow: hidden;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.register-art {
  background: linear-gradient(135deg, #5e1a26 0%, #2d0d13 100%);
}
.auth-art-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 30% 20%, rgba(255,215,0,0.15), transparent 70%),
    radial-gradient(ellipse 80% 60% at 70% 80%, rgba(0,0,0,0.4), transparent 70%);
}
.auth-cards {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
}
.ac-card {
  position: absolute;
  width: 80px; height: 112px;
  background: linear-gradient(135deg, var(--ivory), #e0d4b0);
  border: 1px solid var(--gold);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}
.ac1 { top: 12%; right: 18%; transform: rotate(-12deg); animation: floatA 14s ease-in-out infinite; }
.ac2 { top: 50%; right: 8%; transform: rotate(8deg); animation: floatA 18s ease-in-out infinite -4s; }
.ac3 { bottom: 12%; right: 30%; transform: rotate(-22deg); animation: floatA 16s ease-in-out infinite -8s; }

.auth-art-content { position: relative; z-index: 2; }
.auth-art-mark { width: 80px; height: 80px; margin-bottom: 24px; }
.auth-art-title {
  font-family: 'Reem Kufi', sans-serif;
  font-size: 36px;
  color: var(--ivory);
  margin-bottom: 12px;
  line-height: 1.1;
}
.auth-art-sub {
  font-size: 15px;
  color: var(--sand);
  opacity: 0.85;
  line-height: 1.7;
  margin-bottom: 32px;
}
.auth-art-meta { display: flex; flex-direction: column; gap: 10px; }
.meta-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  color: var(--ivory);
  opacity: 0.85;
}
.meta-item span:first-child { font-size: 18px; }

.perks { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.perks li {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px;
  color: var(--ivory);
  opacity: 0.9;
}
.perk-dot {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  background: var(--gold-bright);
  color: var(--midnight-deep);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.auth-form-wrap {
  background: rgba(12, 13, 28, 0.6);
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
}
.auth-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 28px;
}
.auth-tab {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--sand);
  opacity: 0.6;
  transition: all 0.2s;
}
.auth-tab.active {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: var(--midnight-deep);
  opacity: 1;
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.form-title { font-family: 'Reem Kufi', sans-serif; font-size: 26px; color: var(--ivory); }
.form-sub { font-size: 13px; color: var(--sand); opacity: 0.7; margin-top: -8px; margin-bottom: 8px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-lbl { font-size: 13px; color: var(--sand); opacity: 0.85; }
.field-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: all 0.2s;
}
.field-input:focus-within {
  border-color: var(--gold);
  background: rgba(201,169,97,0.06);
  box-shadow: 0 0 0 3px rgba(201,169,97,0.12);
}
.field-input svg { color: var(--gold); opacity: 0.7; flex-shrink: 0; }
.field-input input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ivory);
  font-size: 15px;
}
.field-input input::placeholder { color: var(--sand); opacity: 0.4; }
.field-input .prefix { color: var(--gold); font-weight: 700; }
.field-input .suffix-good { color: #10B981; font-size: 12px; font-weight: 600; }
.eye-toggle { color: var(--sand); opacity: 0.6; }
.eye-toggle:hover { opacity: 1; color: var(--gold); }

.pw-strength { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.pw-bar { flex: 1; height: 4px; background: rgba(255,255,255,0.06); border-radius: 100px; overflow: hidden; }
.pw-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red-bright), #f59e0b, var(--gold-bright), #10B981);
  background-size: 400% 100%;
  background-position: 65% 0;
  border-radius: 100px;
}
.pw-label { font-size: 12px; color: #10B981; font-weight: 600; }

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  color: var(--sand);
}
.check input { display: none; }
.check-box {
  width: 18px; height: 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  display: grid; place-items: center;
  transition: all 0.2s;
}
.check input:checked + .check-box {
  background: var(--gold);
  border-color: var(--gold);
}
.check input:checked + .check-box::after {
  content: '✓';
  color: var(--midnight-deep);
  font-weight: 700;
  font-size: 12px;
}
.check-block { font-size: 12px; line-height: 1.5; }

.form-link { color: var(--gold-bright); cursor: pointer; }
.form-link:hover { text-decoration: underline; }

.form-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  color: var(--sand);
  opacity: 0.5;
  font-size: 12px;
}
.form-divider::before, .form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.oauth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ivory);
  transition: all 0.2s;
}
.oauth-btn:hover { background: rgba(255,255,255,0.08); border-color: var(--line-strong); }

.form-foot {
  text-align: center;
  font-size: 13px;
  color: var(--sand);
  opacity: 0.7;
  margin-top: 8px;
}

/* =========================================================
   LOBBY
========================================================= */
.lobby-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.lobby-actions { display: flex; gap: 10px; }

.lobby-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}

.lobby-main { display: flex; flex-direction: column; gap: 20px; }

.quick-match {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(201,169,97,0.15) 0%, rgba(139,38,53,0.1) 100%);
  border: 1px solid var(--gold);
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
}
.quick-match::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 80% at 80% 50%, rgba(255,215,0,0.15), transparent 70%);
}
.qm-content { display: flex; align-items: center; gap: 20px; position: relative; z-index: 1; }
.qm-pulse {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  position: relative;
}
.qm-pulse::before, .qm-pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--gold-bright);
  animation: qmPulse 2.5s ease-out infinite;
}
.qm-pulse::after { animation-delay: 1.25s; }
@keyframes qmPulse {
  0% { transform: scale(0.4); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}
.qm-pulse {
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 20px var(--gold-bright);
}
.qm-pulse::before, .qm-pulse::after { background: var(--gold); }

.qm-title { font-family: 'Reem Kufi', sans-serif; font-size: 22px; color: var(--ivory); }
.qm-sub { font-size: 13px; color: var(--sand); opacity: 0.8; margin-top: 4px; }

.lobby-section {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
}
.lobby-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.lobby-section-head h3 { font-family: 'Reem Kufi', sans-serif; font-size: 20px; }
.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  padding: 6px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 13px;
  color: var(--sand);
  opacity: 0.7;
  transition: all 0.2s;
}
.pill:hover { opacity: 1; }
.pill.active {
  background: rgba(201,169,97,0.15);
  border-color: var(--gold);
  color: var(--gold-bright);
  opacity: 1;
}

.tables-list { display: flex; flex-direction: column; gap: 10px; }
.table-row {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: all 0.2s;
}
.table-row:hover { border-color: var(--line-strong); background: rgba(255,255,255,0.04); }
.table-row.featured {
  background: linear-gradient(90deg, rgba(201,169,97,0.1), rgba(255,255,255,0.025));
  border-color: var(--gold);
}
.table-row.locked { opacity: 0.7; }
.table-icon { width: 48px; height: 48px; display: grid; place-items: center; }
.table-name {
  font-family: 'Reem Kufi', sans-serif;
  font-size: 16px;
  color: var(--ivory);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}
.badge-host { background: rgba(201,169,97,0.15); color: var(--gold-bright); border-color: var(--gold); }
.badge-libyan { background: rgba(139,38,53,0.2); color: #ec7385; border-color: var(--red); }
.badge-lock { background: rgba(255,255,255,0.04); color: var(--sand); }
.table-meta { font-size: 12px; color: var(--sand); opacity: 0.7; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.table-host-mini { display: flex; align-items: center; gap: 10px; }
.mini-ava {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--c, var(--gold)), color-mix(in srgb, var(--c, var(--gold)) 60%, #000));
  color: var(--ivory);
  font-weight: 700;
  font-size: 13px;
  font-family: 'Reem Kufi', sans-serif;
  border: 2px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.mini-name { font-size: 13px; color: var(--ivory); font-weight: 600; }
.mini-rank { font-size: 11px; color: var(--sand); opacity: 0.7; margin-top: 2px; }

.lobby-side { display: flex; flex-direction: column; gap: 16px; }
.side-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
}
.side-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.side-head h4 { font-family: 'Reem Kufi', sans-serif; font-size: 16px; }
.online-count {
  background: rgba(16,185,129,0.2);
  border: 1px solid #10B981;
  color: #10B981;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
}

.friends-list { display: flex; flex-direction: column; gap: 8px; }
.friend {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  transition: background 0.2s;
}
.friend:hover { background: rgba(255,255,255,0.03); }
.friend-ava {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--c, var(--gold)), color-mix(in srgb, var(--c, var(--gold)) 60%, #000));
  color: var(--ivory);
  font-weight: 700;
  font-size: 12px;
  font-family: 'Reem Kufi', sans-serif;
  flex-shrink: 0;
}
.status {
  position: absolute;
  bottom: -1px; right: -1px;
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 2px solid var(--midnight-deep);
}
.status.online { background: #10B981; }
.status.away { background: #f59e0b; }
.friend-body { flex: 1; min-width: 0; }
.friend-name { font-size: 13px; color: var(--ivory); font-weight: 600; }
.friend-state { font-size: 11px; color: var(--sand); opacity: 0.7; }
.icon-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--sand);
  transition: all 0.2s;
}
.icon-btn:hover { background: rgba(255,255,255,0.08); color: var(--ivory); }
.icon-btn.challenge { background: rgba(201,169,97,0.15); color: var(--gold-bright); border-color: var(--gold); }

.champ-list { display: flex; flex-direction: column; gap: 6px; }
.champ {
  display: grid;
  grid-template-columns: 24px 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 6px;
  border-radius: 8px;
}
.champ .rk { font-family: 'Reem Kufi', sans-serif; font-size: 18px; color: var(--gold); text-align: center; }
.champ-1 { background: linear-gradient(90deg, rgba(255,215,0,0.1), transparent); }
.champ-2 { background: linear-gradient(90deg, rgba(192,192,192,0.08), transparent); }
.champ-3 { background: linear-gradient(90deg, rgba(205,127,50,0.08), transparent); }
.champ-name { font-size: 13px; color: var(--ivory); font-weight: 600; }
.champ-pts { font-family: 'Reem Kufi', sans-serif; font-size: 13px; color: var(--gold-bright); }

/* =========================================================
   SETUP
========================================================= */
.setup-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.setup-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

.setup-main { display: flex; flex-direction: column; gap: 20px; }

.setup-section {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
}
.section-h {
  font-family: 'Reem Kufi', sans-serif;
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--gold-bright);
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.25s;
  text-align: center;
}
.mode-card input { display: none; }
.mode-card:hover { background: rgba(255,255,255,0.05); border-color: var(--line-strong); }
.mode-card.selected {
  background: linear-gradient(135deg, rgba(201,169,97,0.15), rgba(201,169,97,0.05));
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,169,97,0.12);
}
.mode-ico { width: 40px; height: 40px; display: grid; place-items: center; color: var(--gold); }
.mode-card.selected .mode-ico { color: var(--gold-bright); }
.mode-name { font-family: 'Reem Kufi', sans-serif; font-size: 16px; color: var(--ivory); }
.mode-sub { font-size: 12px; color: var(--sand); opacity: 0.7; }
.mode-check {
  position: absolute;
  top: 10px; right: 10px;
  width: 22px; height: 22px;
  background: var(--gold);
  color: var(--midnight-deep);
  border-radius: 50%;
  display: none;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
}
.mode-card.selected .mode-check { display: grid; }

.diff-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.diff-pill {
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: center;
  transition: all 0.25s;
}
.diff-pill input { display: none; }
.diff-pill:hover { background: rgba(255,255,255,0.05); }
.diff-pill.selected {
  background: linear-gradient(135deg, rgba(201,169,97,0.15), rgba(201,169,97,0.05));
  border-color: var(--gold);
}
.diff-emoji { font-size: 32px; line-height: 1; }
.diff-name { font-family: 'Reem Kufi', sans-serif; font-size: 16px; margin-top: 6px; }
.diff-sub { font-size: 11px; color: var(--sand); opacity: 0.7; margin-top: 2px; }

.score-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.score-card {
  position: relative;
  padding: 14px 10px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: center;
  transition: all 0.25s;
}
.score-card input { display: none; }
.score-card:hover { background: rgba(255,255,255,0.05); }
.score-card.selected {
  background: linear-gradient(135deg, rgba(201,169,97,0.15), rgba(255,215,0,0.05));
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(201,169,97,0.2);
}
.score-num { font-family: 'Reem Kufi', sans-serif; font-size: 28px; font-weight: 700; color: var(--gold-bright); line-height: 1; }
.score-name { font-size: 12px; color: var(--sand); margin-top: 4px; }
.score-tag { font-size: 10px; color: var(--gold); margin-top: 4px; font-weight: 700; }

.rule-group {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  margin-bottom: 12px;
  background: rgba(0,0,0,0.15);
}
.rule-group:last-child { margin-bottom: 0; }
.rule-group-h {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}
.rg-spacer { flex: 1; }
.rg-toggle { font-size: 12px; color: var(--gold); font-weight: 600; }
.dot-emerald { background: #10B981; }
.dot-amber { background: #f59e0b; }
.dot-red { background: var(--red-bright); }
.dot-emerald, .dot-amber, .dot-red { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.rule-core { border-color: rgba(16,185,129,0.3); }
.rule-common { border-color: rgba(245,158,11,0.3); }
.rule-libyan { border-color: rgba(220,40,60,0.3); background: linear-gradient(135deg, rgba(220,40,60,0.05), rgba(0,0,0,0.15)); }

.rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 4px;
  border-bottom: 1px dashed var(--line);
}
.rule-row:last-child { border-bottom: none; }
.rule-row.locked { opacity: 0.85; }
.rule-info { flex: 1; }
.rule-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ivory);
  display: flex;
  align-items: center;
  gap: 8px;
}
.chip {
  display: inline-block;
  padding: 1px 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
}
.chip-gold { background: rgba(255,215,0,0.18); color: var(--gold-bright); border: 1px solid var(--gold); }
.chip-red { background: rgba(220,40,60,0.18); color: #ec7385; border: 1px solid var(--red); }
.chip-crown { background: linear-gradient(90deg, var(--gold), var(--gold-bright)); color: var(--midnight-deep); }
.rule-sub { font-size: 12px; color: var(--sand); opacity: 0.7; margin-top: 2px; }

.switch {
  width: 42px; height: 24px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
  border-radius: 100px;
  position: relative;
  cursor: pointer;
  transition: all 0.25s;
  flex-shrink: 0;
}
.switch span {
  position: absolute;
  top: 2px; right: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--sand);
  transition: all 0.25s cubic-bezier(.22,1,.36,1);
}
.switch.on { background: var(--gold); border-color: var(--gold); }
.switch.on span { right: calc(100% - 20px); background: var(--midnight-deep); }
.switch.locked { opacity: 0.7; cursor: not-allowed; }

.theme-grid { display: flex; flex-direction: column; gap: 14px; }
.theme-h { font-size: 13px; color: var(--sand); opacity: 0.85; }
.swatch-row { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch {
  position: relative;
  width: 76px; height: 60px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: linear-gradient(135deg, var(--c1), var(--c2));
  cursor: pointer;
  transition: all 0.2s;
  display: grid;
  place-items: end center;
  padding-bottom: 4px;
}
.swatch input { display: none; }
.swatch span { font-size: 10px; color: var(--ivory); text-shadow: 0 1px 2px rgba(0,0,0,0.6); }
.swatch:hover { transform: translateY(-2px); }
.swatch.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,169,97,0.25), 0 6px 14px rgba(0,0,0,0.4);
}
.swatch.selected::before {
  content: '✓';
  position: absolute;
  top: 4px; right: 4px;
  width: 18px; height: 18px;
  background: var(--gold);
  color: var(--midnight-deep);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}

.setup-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 90px; }

.summary-card {
  background: linear-gradient(180deg, rgba(201,169,97,0.1), rgba(0,0,0,0.2));
  border: 1px solid var(--gold);
  border-radius: var(--r-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.summary-h {
  font-family: 'Reem Kufi', sans-serif;
  font-size: 16px;
  color: var(--gold-bright);
  margin-bottom: 4px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--sand);
  padding: 4px 0;
}
.summary-row b { color: var(--ivory); }
.text-gold { color: var(--gold-bright) !important; }
.summary-divider { height: 1px; background: var(--line); margin: 8px 0; }

.tip-card {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: rgba(255,215,0,0.06);
  border: 1px solid rgba(255,215,0,0.25);
  border-radius: var(--r-md);
}
.tip-icon { font-size: 28px; line-height: 1; }
.tip-h { font-family: 'Reem Kufi', sans-serif; font-size: 14px; color: var(--gold-bright); }
.tip-body { font-size: 13px; color: var(--sand); opacity: 0.85; line-height: 1.5; margin-top: 4px; }

/* =========================================================
   RULES
========================================================= */
.rules-head {
  text-align: center;
  margin-bottom: 32px;
}
.rules-head .screen-eyebrow { margin-left: auto; margin-right: auto; display: inline-flex; }

.rules-toc {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 12px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--line);
  border-radius: 100px;
  margin-bottom: 32px;
  position: sticky;
  top: 80px;
  z-index: 10;
  backdrop-filter: blur(10px);
}
.toc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 13px;
  color: var(--sand);
  cursor: pointer;
  transition: all 0.2s;
}
.toc-item:hover { background: rgba(255,255,255,0.04); color: var(--ivory); }
.toc-item.active {
  background: rgba(201,169,97,0.15);
  color: var(--gold-bright);
}
.toc-num {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
  font-family: 'Reem Kufi', sans-serif;
  font-size: 12px;
  font-weight: 700;
}
.toc-item.active .toc-num { background: var(--gold); color: var(--midnight-deep); }

.rules-content { display: flex; flex-direction: column; gap: 24px; }

.rule-block {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 24px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 32px;
  position: relative;
  overflow: hidden;
}
.libyan-block {
  background: linear-gradient(135deg, rgba(139,38,53,0.08) 0%, rgba(255,255,255,0.025) 100%);
  border-color: var(--red);
}
.block-num {
  font-family: 'Reem Kufi', sans-serif;
  font-size: 80px;
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--gold);
  text-stroke: 1.5px var(--gold);
  line-height: 1;
  opacity: 0.6;
}
.block-body h3 {
  font-family: 'Reem Kufi', sans-serif;
  font-size: 28px;
  color: var(--ivory);
  margin-bottom: 16px;
}
.block-intro { font-size: 15px; color: var(--sand); opacity: 0.85; margin-bottom: 20px; line-height: 1.7; }

.basics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.basic-card {
  text-align: center;
  padding: 18px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.basic-num {
  font-family: 'Reem Kufi', sans-serif;
  font-size: 48px;
  color: var(--gold-bright);
  line-height: 1;
  font-weight: 700;
}
.basic-lbl {
  font-family: 'Reem Kufi', sans-serif;
  font-size: 14px;
  color: var(--ivory);
  margin-top: 6px;
}
.basic-sub { font-size: 12px; color: var(--sand); opacity: 0.7; margin-top: 4px; }

.suits-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.suit-mini {
  text-align: center;
  padding: 14px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  border-top: 3px solid var(--c, var(--gold));
}
.suit-glyph { font-size: 28px; color: var(--c); line-height: 1; }
.suit-name { font-family: 'Reem Kufi', sans-serif; font-size: 14px; margin-top: 6px; }
.suit-sub { font-size: 11px; color: var(--sand); opacity: 0.6; margin-top: 2px; }

.steps { display: flex; flex-direction: column; gap: 16px; }
.step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  align-items: flex-start;
}
.step-n {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: var(--midnight-deep);
  display: grid; place-items: center;
  font-family: 'Reem Kufi', sans-serif;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.step-h { font-family: 'Reem Kufi', sans-serif; font-size: 17px; color: var(--ivory); margin-bottom: 4px; }
.step p { font-size: 14px; color: var(--sand); opacity: 0.85; line-height: 1.7; }

.capture-demo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.cap-side {
  padding: 20px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.cap-side h4 { font-family: 'Reem Kufi', sans-serif; font-size: 16px; margin-bottom: 8px; color: var(--gold-bright); }
.cap-side p { font-size: 13px; color: var(--sand); opacity: 0.85; line-height: 1.6; margin-bottom: 14px; }
.mini-table {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  position: relative;
}
.mc {
  aspect-ratio: 5/7;
  background: linear-gradient(135deg, var(--ivory), #f0e5c5);
  border: 1px solid var(--gold);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-family: 'Reem Kufi', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--midnight-deep);
}
.mc.match {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 2px var(--gold-bright), 0 0 16px rgba(255,215,0,0.4);
  animation: matchGlow 2s ease-in-out infinite;
}
@keyframes matchGlow {
  0%,100% { box-shadow: 0 0 0 2px var(--gold-bright), 0 0 16px rgba(255,215,0,0.4); }
  50% { box-shadow: 0 0 0 2px var(--gold-bright), 0 0 26px rgba(255,215,0,0.7); }
}
.mc.played {
  grid-column: 2 / 4;
  background: linear-gradient(135deg, #fff8e7, #f0d570);
  border-color: var(--red-bright);
  color: var(--red-bright);
  box-shadow: 0 8px 20px rgba(220,40,60,0.3);
}
.cap-arrow {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 24px;
  color: var(--gold);
  margin: 6px 0;
  animation: arrowBob 2s ease-in-out infinite;
}
@keyframes arrowBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

.shakkba-callout {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px;
  background: linear-gradient(90deg, rgba(255,215,0,0.12), rgba(201,169,97,0.05));
  border: 1px solid var(--gold);
  border-radius: var(--r-md);
}
.shakkba-emoji { font-size: 40px; }
.shakkba-h { font-family: 'Reem Kufi', sans-serif; font-size: 22px; color: var(--gold-bright); margin-bottom: 4px; }
.shakkba-callout p { font-size: 14px; color: var(--sand); opacity: 0.95; line-height: 1.6; }

.libyan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.lib-card {
  padding: 20px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  position: relative;
  transition: all 0.25s;
}
.lib-card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.lib-card.highlight {
  background: linear-gradient(180deg, rgba(255,215,0,0.12), rgba(0,0,0,0.25));
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 1px rgba(255,215,0,0.3), 0 12px 28px rgba(0,0,0,0.4);
}
.lib-icon { font-size: 36px; line-height: 1; margin-bottom: 8px; }
.lib-h { font-family: 'Reem Kufi', sans-serif; font-size: 18px; color: var(--ivory); }
.lib-card-sub { font-size: 11px; color: var(--gold); opacity: 0.85; margin-top: 2px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.lib-card p { font-size: 13px; color: var(--sand); opacity: 0.85; line-height: 1.6; margin-bottom: 12px; }
.lib-tag {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(201,169,97,0.15);
  border: 1px solid var(--gold);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-bright);
}
.tag-red { background: rgba(220,40,60,0.18); border-color: var(--red); color: #ec7385; }
.tag-crown { background: linear-gradient(90deg, var(--gold), var(--gold-bright)); border-color: var(--gold-bright); color: var(--midnight-deep); }

.score-table {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.score-table .row {
  display: grid;
  grid-template-columns: 1.2fr 2fr 0.8fr;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  align-items: center;
}
.score-table .row:last-child { border-bottom: none; }
.score-table .row.row-h {
  background: rgba(201,169,97,0.1);
  font-weight: 700;
  color: var(--gold-bright);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.score-table .row span:nth-child(2) { color: var(--sand); opacity: 0.85; font-size: 13px; }
.rt { text-align: left; font-family: 'Reem Kufi', sans-serif; color: var(--gold-bright); font-size: 16px; }
.gold-row { background: linear-gradient(90deg, rgba(255,215,0,0.08), transparent); }
.score-table .total {
  background: linear-gradient(90deg, rgba(201,169,97,0.15), transparent);
  font-weight: 700;
}
.score-table .total span:first-child { color: var(--ivory); font-family: 'Reem Kufi', sans-serif; }
.score-table .total .rt { font-size: 22px; }

.rules-cta {
  text-align: center;
  margin-top: 40px;
}

/* =========================================================
   STATS
========================================================= */
.stats-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.stats-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 12px;
}
.stab {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sand);
  opacity: 0.65;
  transition: all 0.2s;
}
.stab.active {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: var(--midnight-deep);
  opacity: 1;
}

.stats-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.profile-big {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(201,169,97,0.12), rgba(255,255,255,0.025));
  border: 1px solid var(--gold);
  border-radius: var(--r-lg);
}
.big-ava {
  position: relative;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep));
  color: var(--midnight-deep);
  display: grid; place-items: center;
  font-family: 'Reem Kufi', sans-serif;
  font-weight: 700;
  font-size: 32px;
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 5px rgba(201,169,97,0.2), 0 8px 20px rgba(0,0,0,0.4);
  flex-shrink: 0;
}
.ava-frame {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px dashed var(--gold);
  opacity: 0.4;
  animation: ringRot 12s linear infinite;
}
.profile-meta { flex: 1; }
.profile-name { font-family: 'Reem Kufi', sans-serif; font-size: 22px; color: var(--ivory); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rank-badge {
  font-size: 12px;
  padding: 3px 10px;
  background: rgba(255,215,0,0.18);
  border: 1px solid var(--gold);
  border-radius: 100px;
  color: var(--gold-bright);
  font-weight: 700;
}
.profile-handle { font-size: 12px; color: var(--sand); opacity: 0.7; margin-top: 4px; }
.profile-rating { margin-top: 14px; }
.rating-bar { height: 6px; background: rgba(255,255,255,0.06); border-radius: 100px; overflow: hidden; margin-bottom: 6px; }
.rating-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  border-radius: 100px;
  position: relative;
}
.rating-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}
@keyframes shimmer { 0% { background-position: -100% 0; } 100% { background-position: 200% 0; } }
.rating-info { display: flex; justify-content: space-between; font-size: 12px; }
.rating-num { font-family: 'Reem Kufi', sans-serif; color: var(--gold-bright); font-size: 16px; }
.rating-to { color: var(--sand); opacity: 0.7; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.stat-card {
  padding: 18px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60%; height: 100%;
  background: radial-gradient(ellipse at top right, rgba(201,169,97,0.1), transparent 70%);
  pointer-events: none;
}
.sc-icon { font-size: 28px; line-height: 1; }
.sc-num { font-family: 'Reem Kufi', sans-serif; font-size: 32px; color: var(--gold-bright); line-height: 1; margin-top: 6px; }
.sc-lbl { font-size: 13px; color: var(--ivory); margin-top: 4px; }
.sc-trend { font-size: 11px; color: var(--sand); opacity: 0.7; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.sc-trend.up { color: #10B981; opacity: 1; }
.sc-trend.up::before { content: '↑ '; }

.stats-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}
.stats-panel {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
}
.stats-panel.wide { grid-column: 1 / -1; }
.panel-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.panel-h h3 { font-family: 'Reem Kufi', sans-serif; font-size: 18px; color: var(--ivory); }
.panel-h .muted { font-size: 12px; color: var(--sand); opacity: 0.7; }
.legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--sand); }
.legend .dot { width: 8px; height: 8px; border-radius: 50%; }
.legend .dot-emerald { background: #10B981; }
.legend .dot-red { background: var(--red-bright); }

.perf-chart { width: 100%; height: 200px; }

.ach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ach {
  padding: 14px 10px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-align: center;
  position: relative;
  opacity: 0.5;
  filter: grayscale(0.5);
}
.ach.unlocked { opacity: 1; filter: none; background: rgba(201,169,97,0.06); border-color: var(--line-strong); }
.ach.rare {
  background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(0,0,0,0.2));
  border-color: var(--gold-bright);
}
.ach-icon { font-size: 28px; line-height: 1; }
.ach-name { font-family: 'Reem Kufi', sans-serif; font-size: 13px; margin-top: 6px; color: var(--ivory); }
.ach-sub { font-size: 10px; color: var(--sand); opacity: 0.7; margin-top: 2px; }
.ach-prog {
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 100px;
  margin-top: 8px;
  overflow: hidden;
}
.ach-prog div {
  height: 100%;
  background: var(--gold);
  border-radius: 100px;
}

.bar-row {
  display: grid;
  grid-template-columns: 80px 1fr 50px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.bar-row:last-child { border-bottom: none; }
.bar-row span { color: var(--sand); }
.bar { height: 8px; background: rgba(255,255,255,0.06); border-radius: 100px; overflow: hidden; }
.bar div { height: 100%; background: var(--c, var(--gold)); border-radius: 100px; }
.bar-row b { font-family: 'Reem Kufi', sans-serif; color: var(--ivory); font-size: 14px; text-align: left; }

.matches-list { display: flex; flex-direction: column; gap: 8px; }
.match {
  display: grid;
  grid-template-columns: 70px 1.5fr 100px 1fr 100px 60px;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  border-right: 3px solid;
}
.match.win { border-right-color: #10B981; }
.match.loss { border-right-color: var(--red-bright); }
.match-result {
  font-family: 'Reem Kufi', sans-serif;
  font-size: 14px;
  font-weight: 700;
}
.match.win .match-result { color: #10B981; }
.match.loss .match-result { color: var(--red-bright); }
.match-vs { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ivory); }
.match-score { font-family: 'Reem Kufi', sans-serif; font-size: 18px; color: var(--gold-bright); text-align: center; }
.match-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag {
  padding: 2px 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  font-size: 12px;
}
.tag-gold { background: rgba(255,215,0,0.18); border: 1px solid var(--gold); }
.match-time { font-size: 12px; color: var(--sand); opacity: 0.7; }
.match-elo { font-family: 'Reem Kufi', sans-serif; font-size: 14px; font-weight: 700; text-align: center; }
.match-elo.up { color: #10B981; }
.match-elo.down { color: var(--red-bright); }

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 1024px) {
  .home-grid { grid-template-columns: 1fr; gap: 40px; }
  .home-right { min-height: 380px; }
  .lobby-grid, .setup-grid, .stats-grid, .stats-hero { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; max-width: 500px; }
  .auth-art { display: none; }
  .libyan-grid, .basics-grid, .ach-grid, .mode-grid, .diff-row { grid-template-columns: repeat(2, 1fr); }
  .score-row { grid-template-columns: repeat(3, 1fr); }
  .capture-demo { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .match { grid-template-columns: 60px 1fr 80px; gap: 10px; }
  .match-tags, .match-time, .match-elo { display: none; }
}

@media (max-width: 640px) {
  .nav-tabs { display: none; }
  .screen { padding: 24px 16px 60px; }
  .home-features { grid-template-columns: 1fr; }
  .libyan-grid, .basics-grid, .ach-grid, .mode-grid, .diff-row, .stat-grid { grid-template-columns: 1fr; }
  .score-row { grid-template-columns: repeat(2, 1fr); }
  .suits-row { grid-template-columns: repeat(2, 1fr); }
  .table-row { grid-template-columns: 40px 1fr; }
  .table-host-mini, .table-row .btn { grid-column: 2; justify-self: end; }
  .rule-block { grid-template-columns: 1fr; padding: 20px; }
  .block-num { font-size: 56px; }
  .auth-form-wrap { padding: 28px 24px; }
}
