/* ===== FONTS (خطوط العلامة الجديدة) ===== */
@font-face {
  font-family: 'CapoHeading';
  src: url('https://files.catbox.moe/236lzl.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'CapoHeadingAlt';
  src: url('https://files.catbox.moe/va4cz0.otf') format('opentype');
  font-display: swap;
}
@font-face {
  font-family: 'CapoBodyBold';
  src: url('https://files.catbox.moe/uqr0yx.otf') format('opentype');
  font-display: swap;
}
@font-face {
  font-family: 'CapoInput';
  src: url('https://files.catbox.moe/zhyu9p.otf') format('opentype');
  font-display: swap;
}

:root {
  --bg-deep: #08070a;
  --bg-card: rgba(28,22,17,0.62);
  --bg-surface: rgba(38,30,23,0.55);
  --bg-overlay: rgba(48,38,28,0.62);
  --accent-gold: #e5c87a;
  --accent-gold-dim: #a3854f;
  --accent-red: #7e2020;
  --accent-red-bright: #a1292a;
  --accent-smoke: #2e2722;
  --text-primary: #f2e8d5;
  --text-secondary: #b3a890;
  --text-muted: #7a7060;
  --border-subtle: rgba(229,200,122,0.14);
  --border-accent: rgba(229,200,122,0.35);
  --success: #2d6a4f;
  --danger: #7e2020;
  --font-ar: 'CapoBodyBold', 'IBM Plex Sans Arabic', 'IBM Plex Sans', sans-serif;
  --font-display: 'CapoHeading', 'CapoHeadingAlt', 'IBM Plex Sans', 'IBM Plex Sans Arabic', sans-serif;
  --font-body-light: 'Thmanyah Serif Text', 'IBM Plex Sans Arabic', 'IBM Plex Sans', sans-serif;
  --font-input: 'CapoInput', 'IBM Plex Sans Arabic', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 4px 24px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 30px rgba(229,200,122,0.18);
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
  --glass-blur: blur(16px) saturate(150%);
}

* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body { height:100%; overflow:hidden; }

input, textarea, select { font-family: var(--font-input); }

body {
  font-family: var(--font-ar);
  background: var(--bg-deep);
  background-image: radial-gradient(ellipse at 20% 0%, rgba(126,32,32,0.12), transparent 55%), radial-gradient(ellipse at 85% 15%, rgba(229,200,122,0.06), transparent 50%);
  color: var(--text-primary);
  user-select: none;
  -webkit-user-select: none;
}

/* Prevent copy/save */
img { pointer-events: none; -webkit-user-drag: none; }
* { -webkit-touch-callout: none; }

/* ===== BACKGROUND ATMOSPHERE ===== */
#atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
#atmosphere::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 30% 20%, rgba(139,28,28,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 80% 80%, rgba(201,168,76,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 80% 80% at 50% 50%, rgba(5,5,8,0.8) 0%, transparent 100%);
}
.smoke-particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(201,168,76,0.03);
  animation: smokeDrift linear infinite;
}
@keyframes smokeDrift {
  0% { transform: translateY(100vh) scale(0.5); opacity:0; }
  20% { opacity:1; }
  80% { opacity:0.5; }
  100% { transform: translateY(-20vh) scale(2); opacity:0; }
}

/* ===== SCREENS ===== */
#app {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.screen.active { display: flex; }

/* ===== SPLASH / LOGO SCREEN ===== */
#screen-splash {
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 70% 50% at 50% 42%, rgba(201,168,76,0.10) 0%, transparent 70%),
    var(--bg-deep);
}
.splash-logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: splashRise 0.9s cubic-bezier(0.16,1,0.3,1) both;
}
.splash-logo-ring {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px solid rgba(201,168,76,0.18);
  animation: ringExpand 2.6s ease-out infinite;
}
.splash-logo {
  width: 190px;
  height: 190px;
  object-fit: contain;
  position: relative;
  z-index: 1;
  animation: splashPulse 2.4s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(201,168,76,0.4));
}
@keyframes splashRise {
  from { opacity: 0; transform: translateY(14px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ringExpand {
  0%   { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.35); opacity: 0; }
}
@keyframes splashPulse {
  0%,100% { filter: drop-shadow(0 0 18px rgba(201,168,76,0.28)); }
  50% { filter: drop-shadow(0 0 46px rgba(201,168,76,0.65)); }
}
.splash-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.5rem;
  color: var(--accent-gold);
  margin-top: 22px;
  letter-spacing: 8px;
  text-transform: uppercase;
  opacity: 0;
  animation: splashFadeUp 0.7s ease-out 0.35s forwards;
}
.splash-sub {
  font-family: var(--font-ar);
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 8px;
  letter-spacing: 1px;
  opacity: 0;
  animation: splashFadeUp 0.7s ease-out 0.5s forwards;
}
@keyframes splashFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.splash-loader {
  margin-top: 44px;
  width: 180px;
  height: 3px;
  background: var(--border-subtle);
  border-radius: 3px;
  overflow: hidden;
  opacity: 0;
  animation: splashFadeUp 0.7s ease-out 0.65s forwards;
  position: relative;
}
.splash-loader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-gold-dim), var(--accent-gold));
  border-radius: 3px;
  animation: loadBar 2.2s cubic-bezier(0.65,0,0.35,1) forwards;
  position: relative;
  overflow: hidden;
}
.splash-loader-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: loaderShimmer 1.1s linear infinite;
}
@keyframes loaderShimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}
@keyframes loadBar { from { width:0% } to { width:100% } }
.splash-status {
  margin-top: 14px;
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0;
  animation: splashFadeUp 0.7s ease-out 0.8s forwards;
}

/* ===== AUTH SCREENS ===== */
#screen-auth {
  background: var(--bg-deep);
  min-height: 100%;
  padding: 0;
}
.auth-header {
  text-align: center;
  padding: 60px 24px 30px;
  background: linear-gradient(180deg, rgba(139,28,28,0.15) 0%, transparent 100%);
}
.auth-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(201,168,76,0.3));
  margin-bottom: 16px;
}
.auth-title-main {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--accent-gold);
  letter-spacing: 6px;
}
.auth-title-sub {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  margin: 0 24px;
}
.auth-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.auth-tab.active {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
}

.auth-form { padding: 24px; display: none; flex-direction: column; gap: 14px; }
.auth-form.active { display: flex; }

.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 0.8rem; color: var(--text-secondary); }
.field-row { display: flex; gap: 10px; }
.field-row .field-group { flex: 1; }

.field-input {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-ar);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
  direction: ltr;
  text-align: right;
}
.field-input[type="text"], .field-input[type="email"], .field-input[type="tel"],
.field-input[type="password"] {
  direction: ltr;
  text-align: right;
}
.field-input:focus {
  border-color: var(--accent-gold-dim);
  background: var(--bg-overlay);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.1);
}
.field-input::placeholder { color: var(--text-muted); }
.field-input.error { border-color: var(--accent-red-bright); }

.field-hint { font-size: 0.72rem; color: var(--text-muted); font-family: var(--font-body-light); font-weight: 300; }
.field-error { font-size: 0.75rem; color: var(--accent-red-bright); display: none; }
.field-error.show { display: block; }

.btn-primary {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #8a6d28, var(--accent-gold));
  border: none;
  border-radius: var(--radius-sm);
  color: #0a0a0f;
  font-family: var(--font-ar);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-google {
  width: 100%;
  padding: 13px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-ar);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-google:hover { border-color: var(--accent-gold-dim); background: var(--bg-overlay); }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.forgot-link {
  text-align: center;
  color: var(--accent-gold-dim);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
}
.forgot-link:hover { color: var(--accent-gold); }

.login-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}
.login-option-select {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.login-opt-btn {
  padding: 7px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  color: var(--text-secondary);
  font-family: var(--font-ar);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}
.login-opt-btn.active {
  background: var(--accent-smoke);
  border-color: var(--accent-gold-dim);
  color: var(--accent-gold);
}

.auth-footer {
  padding: 20px 24px 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

/* verification notice */
.verify-notice {
  background: rgba(201,168,76,0.08);
  border: 1px solid var(--accent-gold-dim);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: none;
}
.verify-notice.show { display: block; }
.verify-notice strong { color: var(--accent-gold); display: block; margin-bottom: 4px; }

/* ===== MAIN APP ===== */
#screen-home {
  background: var(--bg-deep);
}

/* bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  display: none;
}
.bottom-nav.visible { display: flex; }
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
}
.nav-item.active { color: var(--accent-gold); }
.nav-item svg { width: 22px; height: 22px; }
.nav-item span { font-size: 0.65rem; }

/* ===== HOME CONTENT ===== */
#screen-home {
  padding-bottom: 70px;
}
.home-header {
  padding: 50px 20px 20px;
  background: linear-gradient(180deg, rgba(139,28,28,0.2) 0%, transparent 100%);
}
.home-greeting {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.home-username {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
}
.home-alias {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--accent-gold);
  margin-top: 2px;
  letter-spacing: 3px;
}

.mascot-banner {
  margin: 0 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  min-height: 160px;
  display: flex;
  align-items: flex-end;
}
.mascot-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(139,28,28,0.3) 0%, rgba(10,10,15,0.9) 100%);
}
.mascot-img {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 150px;
  object-fit: contain;
  opacity: 0.9;
  filter: drop-shadow(0 0 20px rgba(139,28,28,0.5));
}
.mascot-text {
  position: relative;
  z-index: 1;
  padding: 16px 16px 16px 120px;
  text-align: right;
}
.mascot-text h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--accent-gold);
  margin-bottom: 6px;
  letter-spacing: 2px;
}
.mascot-text p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.section-title {
  padding: 0 16px 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  display: block;
  width: 3px;
  height: 14px;
  background: var(--accent-gold);
  border-radius: 2px;
  flex-shrink: 0;
}

/* game cards - big poster style, one per row, animated entrance */
.games-scroll {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: visible;
  padding: 0 16px 8px;
}

.game-card {
  width: 100%;
  height: 264px;
  cursor: pointer;
  position: relative;
  opacity: 0;
  transform: translateY(16px);
  animation: gameCardIn 0.55s cubic-bezier(0.16,1,0.3,1) forwards;
}
.games-scroll .game-card:nth-child(1) { animation-delay: 0.02s; }
.games-scroll .game-card:nth-child(2) { animation-delay: 0.08s; }
.games-scroll .game-card:nth-child(3) { animation-delay: 0.14s; }
.games-scroll .game-card:nth-child(4) { animation-delay: 0.20s; }
.games-scroll .game-card:nth-child(n+5) { animation-delay: 0.26s; }
@keyframes gameCardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* قلب الكارت: بدّلنا الـ 3D transform (rotateY) بتلاشي/تكبير عادي
   لأن الـ 3D transform كان بيسبب مشاكل حقيقية على شاشات موبايل كتير:
   الوش المخفي كان أحياناً بيستقبل ضغطات (زرار التفاصيل مش بيشتغل) وأحياناً بيترندر فاضي (الاسم مش ظاهر).
   الطريقة دي آمنة 100% على كل المتصفحات وبتدي نفس احساس "القلب" */
.game-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
}
.game-card-face {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.4,0.2,0.2,1), border-color 0.2s ease, box-shadow 0.2s ease;
}
.game-card-front { opacity: 1; transform: scale(1) scaleX(1); z-index: 2; pointer-events: auto; }
.game-card-back  { opacity: 0; transform: scale(0.94) scaleX(0.85); z-index: 1; pointer-events: none; }
.game-card.flipped .game-card-front { opacity: 0; transform: scale(0.94) scaleX(0.85); z-index: 1; pointer-events: none; }
.game-card.flipped .game-card-back  { opacity: 1; transform: scale(1) scaleX(1); z-index: 2; pointer-events: auto; }
.game-card:hover .game-card-face {
  border-color: var(--accent-gold-dim);
  box-shadow: var(--shadow-glow);
}
.game-card-img,
.game-card-img-placeholder {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
  background: var(--bg-surface);
}
.game-card-img-placeholder {
  background: linear-gradient(135deg, var(--bg-surface), var(--accent-smoke));
  display: flex;
  align-items: center;
  justify-content: center;
}
/* cinematic gradient so the title always reads well over any cover photo */
.game-card-front::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 190px;
  background: linear-gradient(180deg, rgba(5,5,8,0) 45%, rgba(5,5,8,0.92) 100%);
  pointer-events: none;
}
.game-card-body { padding: 12px 14px 14px; position: relative; }
.game-card-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-card-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.game-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  z-index: 1;
  backdrop-filter: blur(4px);
}
.badge-free { background: rgba(45,106,79,0.85); color: #7ecba4; }
.badge-paid { background: rgba(139,28,28,0.85); color: #e8a0a0; }

.diff-chip {
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 600;
}
.diff-easy { background: rgba(45,106,79,0.25); color: #7ecba4; }
.diff-medium { background: rgba(201,168,76,0.2); color: var(--accent-gold); }
.diff-hard { background: rgba(139,28,28,0.25); color: #e8a0a0; }

.flip-hint {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 1;
  background: rgba(5,5,8,0.55);
  border: 1px solid rgba(201,168,76,0.35);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  backdrop-filter: blur(3px);
}
.flip-hint svg { width: 14px; height: 14px; }

/* ===== game card back (mascot / rating / plays count) ===== */
.game-card-back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(201,168,76,0.1), transparent 60%), linear-gradient(160deg, var(--bg-card), var(--bg-surface));
}
.game-card-mascot {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-gold-dim);
  box-shadow: 0 0 18px rgba(201,168,76,0.25);
}
.game-card-mascot-placeholder {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  border: 2px solid var(--accent-gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  background: var(--bg-overlay);
}
.game-card-back-name { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.game-card-back-stars { display: flex; align-items: center; gap: 4px; color: var(--accent-gold); font-size: 0.78rem; }
.game-card-back-stars svg { width: 14px; height: 14px; }
.game-card-back-stars .star-empty { color: var(--border-subtle); }
.game-card-back-stars .qr-star { width: 20px; height: 20px; cursor: pointer; transition: transform 0.15s ease; }
.game-card-back-stars .qr-star:hover { transform: scale(1.25); }
.game-card-back-stars .qr-star:active { transform: scale(0.9); }
.game-card-back-stars .gcb-count { font-size: 0.72rem; color: var(--text-muted); margin-right: 4px; }
.game-card-back-plays { font-size: 0.74rem; color: var(--text-muted); }
.game-card-back-btn {
  margin-top: 4px;
  padding: 8px 22px;
  border-radius: 20px;
  border: 1px solid var(--accent-gold-dim);
  background: rgba(201,168,76,0.1);
  color: var(--accent-gold);
  font-family: var(--font-ar);
  font-size: 0.8rem;
  cursor: pointer;
}

/* player count badges */
.player-count-chips {
  display: flex;
  gap: 6px;
}
.pc-chip {
  padding: 2px 7px;
  border-radius: 12px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-subtle);
  font-size: 0.67rem;
  color: var(--text-muted);
}

/* ===== GAME DETAILS ===== */
#screen-game-detail {
  padding-bottom: 120px;
  display: none;
  flex-direction: column;
}
#screen-game-detail.active { display: flex; }
.game-detail-hero {
  position: relative;
  height: 220px;
  overflow: hidden;
}
.game-detail-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.game-detail-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, var(--bg-deep) 100%);
}
.back-btn {
  position: absolute;
  top: 50px;
  right: 16px;
  width: 38px;
  height: 38px;
  background: rgba(10,10,15,0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  z-index: 10;
}
.back-btn svg { width: 18px; height: 18px; color: var(--text-primary); }

.game-detail-body { padding: 16px; }
.game-detail-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.game-detail-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}
.game-detail-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.info-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: center;
}
.info-chip-label { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 3px; }
.info-chip-val { font-size: 0.9rem; font-weight: 600; color: var(--accent-gold); }

.coupon-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.coupon-row.stacked { flex-direction: column; }
.coupon-row.stacked .btn-coupon { width: 100%; }
.coupon-input {
  flex: 1;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-ar);
  font-size: 0.85rem;
  outline: none;
  direction: ltr;
  text-align: center;
}
.btn-coupon {
  padding: 12px 18px;
  background: var(--bg-overlay);
  border: 1px solid var(--accent-gold-dim);
  border-radius: var(--radius-sm);
  color: var(--accent-gold);
  font-family: var(--font-ar);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-coupon:hover { background: rgba(201,168,76,0.1); }
.btn-coupon.selected { background: var(--accent-gold); color: var(--bg-deep); border-color: var(--accent-gold); }

.btn-buy {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #8a6d28, var(--accent-gold));
  border: none;
  border-radius: var(--radius-sm);
  color: #0a0a0f;
  font-family: var(--font-ar);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.btn-buy:hover { filter: brightness(1.1); }

/* paypal container */
#paypal-button-container { margin-top: 12px; min-height: 50px; }

/* ===== JOIN ROOM ===== */
#screen-join {
  padding: 0 16px;
  justify-content: center;
  min-height: 100%;
  padding-top: 80px;
  padding-bottom: 80px;
}
.join-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 30px 24px;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.join-icon { margin-bottom: 16px; }
.join-icon svg { width: 48px; height: 48px; color: var(--accent-gold); }
.join-title { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.join-sub { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 20px; }
.code-input {
  width: 100%;
  padding: 16px;
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--accent-gold);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 6px;
  outline: none;
  direction: ltr;
  margin-bottom: 16px;
  text-transform: uppercase;
  transition: var(--transition);
}
.code-input:focus { border-color: var(--accent-gold-dim); }
.btn-join {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--accent-red), #c0392b);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-ar);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 10px;
}
.btn-join:hover { filter: brightness(1.1); }

/* share link join */
.share-divider { margin: 20px 0; }
.share-hint { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 12px; }

/* ===== ROOM SCREEN ===== */
#screen-room {
  padding-bottom: 70px;
  display: none;
  flex-direction: column;
}
#screen-room.active { display: flex; }

.room-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  padding: 50px 16px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.room-code-display {
  display: flex;
  align-items: center;
  gap: 8px;
}
.room-code-label { font-size: 0.72rem; color: var(--text-muted); }
.room-code-val {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--accent-gold);
  letter-spacing: 4px;
}
.room-copy-btn {
  padding: 5px 10px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: var(--font-ar);
  font-size: 0.72rem;
  cursor: pointer;
  transition: var(--transition);
}
.room-copy-btn:hover { border-color: var(--accent-gold-dim); color: var(--accent-gold); }

.room-game-title {
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 4px;
}

/* round indicator */
.round-bar {
  padding: 10px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.round-label { font-size: 0.78rem; color: var(--text-muted); }
.round-val { font-size: 0.85rem; font-weight: 600; color: var(--accent-gold); }
.round-dots { display: flex; gap: 6px; }
.round-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-subtle);
  transition: var(--transition);
}
.round-dot.done { background: var(--accent-gold); }
.round-dot.current { background: var(--accent-red-bright); box-shadow: 0 0 8px var(--accent-red-bright); }

/* room tabs */
.room-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
}
.room-tab {
  flex: 1;
  padding: 11px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  position: relative;
}
.room-tab.active { color: var(--accent-gold); border-bottom-color: var(--accent-gold); }
.tab-badge {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(14px);
  width: 8px;
  height: 8px;
  background: var(--accent-red-bright);
  border-radius: 50%;
  display: none;
}
.tab-badge.show { display: block; }

.room-tab-content { display: none; flex: 1; overflow-y: auto; }
.room-tab-content.active { display: flex; flex-direction: column; }

/* chat */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}
.chat-msg {
  max-width: 78%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
}
.chat-msg.mine {
  align-self: flex-end;
  background: var(--accent-smoke);
  border: 1px solid var(--border-accent);
  border-bottom-right-radius: 4px;
}
.chat-msg.other {
  align-self: flex-start;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: 4px;
}
.chat-msg.system {
  align-self: center;
  background: transparent;
  border: none;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
}
.chat-msg.last-words {
  align-self: center;
  max-width: 90%;
  background: linear-gradient(135deg, rgba(126,32,32,0.18), rgba(126,32,32,0.06));
  border: 1px solid var(--accent-red);
}
.chat-msg.last-words .chat-msg-sender { color: var(--accent-red-bright); }
.chat-msg.accusation {
  align-self: center;
  max-width: 92%;
  background: linear-gradient(135deg, rgba(229,200,122,0.16), rgba(229,200,122,0.05));
  border: 1px solid var(--accent-gold-dim);
  text-align: center;
}
.chat-msg.accusation .chat-msg-sender { color: var(--accent-gold); }
.chat-msg-sender {
  font-size: 0.7rem;
  color: var(--accent-gold-dim);
  margin-bottom: 2px;
  font-weight: 600;
}
.chat-msg-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 3px;
  text-align: left;
  font-family: var(--font-body-light);
  font-weight: 300;
}

.reactions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  position: relative;
}
.reaction-chip {
  background: var(--bg-overlay);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1.6;
}
.reaction-chip.mine { border-color: var(--accent-gold); color: var(--accent-gold); background: rgba(229,200,122,0.1); }
.reaction-chip.reaction-add { padding: 2px 7px; opacity: 0.6; }
.reaction-picker {
  position: absolute;
  bottom: 100%;
  right: 0;
  display: flex;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: 20px;
  padding: 6px 10px;
  z-index: 20;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.reaction-picker span { cursor: pointer; font-size: 1.1rem; }

.chat-input-area {
  padding: 10px 12px 12px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 8px;
}
.chat-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  color: var(--text-primary);
  font-family: var(--font-ar);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
  direction: rtl;
}
.chat-input:focus { border-color: var(--accent-gold-dim); }
.chat-send-btn {
  width: 40px;
  height: 40px;
  background: var(--accent-gold-dim);
  border: none;
  border-radius: 50%;
  color: #0a0a0f;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}
.chat-send-btn:hover { background: var(--accent-gold); }
.chat-send-btn svg { width: 18px; height: 18px; }

/* clues tab */
.clues-list { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.clue-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px);
  animation: clueCardIn 0.5s cubic-bezier(0.16,1,0.3,1) forwards;
}
@keyframes clueCardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.clue-card-head {
  padding: 10px 14px;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  gap: 10px;
}
.clue-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-red);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.clue-title { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.clue-round-tag {
  margin-right: auto;
  font-size: 0.68rem;
  color: var(--text-muted);
  background: var(--bg-overlay);
  padding: 2px 7px;
  border-radius: 10px;
}
.clue-body { padding: 12px 14px; }
.clue-text { font-size: 0.83rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 10px; }
.clue-media-img {
  width: 100%;
  border-radius: 6px;
  max-height: 240px;
  object-fit: cover;
  display: block;
}

/* ===== EVIDENCE VIDEO PLAYER (custom framed player, app-themed) ===== */
.clue-video-frame {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--accent-gold-dim);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.5);
}
.clue-video-frame::before,
.clue-video-frame::after,
.clue-video-frame .corner-tl,
.clue-video-frame .corner-tr,
.clue-video-frame .corner-bl,
.clue-video-frame .corner-br {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--accent-gold);
  z-index: 3;
  pointer-events: none;
  opacity: 0.85;
}
.clue-video-frame .corner-tl { top: 6px; left: 6px; border-left-width: 2px; border-top-width: 2px; border-right: none; border-bottom: none; }
.clue-video-frame .corner-tr { top: 6px; right: 6px; border-right-width: 2px; border-top-width: 2px; border-left: none; border-bottom: none; }
.clue-video-frame .corner-bl { bottom: 6px; left: 6px; border-left-width: 2px; border-bottom-width: 2px; border-right: none; border-top: none; }
.clue-video-frame .corner-br { bottom: 6px; right: 6px; border-right-width: 2px; border-bottom-width: 2px; border-left: none; border-top: none; }
.clue-video-frame::before { content: none; }
.clue-video-frame::after { content: none; }
.clue-media-video {
  width: 100%;
  max-height: 260px;
  display: block;
  background: #000;
}
.clue-video-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  background: rgba(139,28,28,0.85);
  color: var(--text-primary);
  font-size: 0.62rem;
  letter-spacing: 2px;
  padding: 3px 8px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.clue-video-tag .rec-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff5555;
  animation: recBlink 1.1s ease-in-out infinite;
}
@keyframes recBlink { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }
.clue-video-play-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.55) 100%);
  cursor: pointer;
  transition: opacity 0.25s ease;
}
.clue-video-play-overlay.hidden { opacity: 0; pointer-events: none; }
.clue-video-play-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(10,10,15,0.65);
  border: 2px solid var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 22px rgba(201,168,76,0.35);
  animation: videoPlayPulse 2.2s ease-in-out infinite;
}
.clue-video-play-btn svg { width: 22px; height: 22px; color: var(--accent-gold); margin-right: -2px; }
@keyframes videoPlayPulse {
  0%,100% { box-shadow: 0 0 14px rgba(201,168,76,0.25); }
  50% { box-shadow: 0 0 26px rgba(201,168,76,0.55); }
}
.clue-locked {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* players tab */
.players-list { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.player-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.player-item:hover { border-color: var(--accent-gold-dim); }
.player-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-overlay);
  border: 2px solid var(--border-subtle);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
.player-avatar-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
  animation: cardFlip 3s ease-in-out infinite;
}
@keyframes cardFlip {
  0%,40%,100% { transform: rotateY(0deg); }
  50%,90% { transform: rotateY(180deg); }
}
.player-avatar-bio {
  position: absolute;
  inset: 0;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 4px;
  backface-visibility: hidden;
  opacity: 0;
}
.player-name { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.player-alias {
  font-family: var(--font-display);
  font-size: 0.72rem;
  color: var(--accent-gold);
  letter-spacing: 2px;
  margin-top: 1px;
}
.player-status {
  margin-right: auto;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 12px;
}
.status-active { background: rgba(45,106,79,0.3); color: #7ecba4; }
.status-offline { background: rgba(122,112,96,0.25); color: var(--text-muted); }
.status-eliminated { background: rgba(139,28,28,0.3); color: #e8a0a0; }
.status-capo { background: rgba(201,168,76,0.2); color: var(--accent-gold); }

/* player card modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.player-card-modal {
  width: 100%;
  max-width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--accent-gold-dim);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-glow);
  animation: cardReveal 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes cardReveal {
  from { transform: scale(0.7) rotateY(-20deg); opacity:0; }
  to { transform: scale(1) rotateY(0deg); opacity:1; }
}
.player-card-header {
  padding: 20px;
  background: linear-gradient(135deg, rgba(139,28,28,0.3), rgba(201,168,76,0.1));
  text-align: center;
  position: relative;
}
.player-card-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 10px rgba(201,168,76,0.3));
}
.player-card-logo.is-photo { object-fit: cover; border-radius: 50%; filter: none; border: 2px solid var(--accent-gold-dim); }
.player-card-alias {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--accent-gold);
  letter-spacing: 4px;
  margin-bottom: 4px;
}
.player-card-name { font-size: 0.85rem; color: var(--text-secondary); }
.player-card-body { padding: 16px 20px 20px; }
.player-card-bio {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.8;
  text-align: center;
  padding: 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}
.btn-close-modal {
  width: 100%;
  padding: 11px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-ar);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}
.btn-close-modal:hover { border-color: var(--accent-gold-dim); color: var(--accent-gold); }

/* ===== VOTING ===== */
.vote-screen {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.vote-banner {
  background: linear-gradient(135deg, rgba(139,28,28,0.3), rgba(10,10,15,0.8));
  border: 1px solid var(--accent-red);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.vote-banner-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.vote-banner-sub { font-size: 0.8rem; color: var(--text-secondary); }
.vote-timer {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--accent-red-bright);
  text-align: center;
  letter-spacing: 6px;
}

.global-vote-timer-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(126,32,32,0.25), rgba(126,32,32,0.1));
  border-bottom: 1px solid var(--border-accent);
  color: var(--accent-red-bright);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
#global-vote-timer-text {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 3px;
  min-width: 54px;
  text-align: center;
}
.global-vote-timer-label { font-size: 0.78rem; color: var(--text-secondary); }
.global-vote-timer-bar.urgent { animation: voteUrgentPulse 0.8s ease-in-out infinite; }

.round-history-strip {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.round-history-item {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  min-width: 62px;
}
.round-history-item .rh-round { font-size: 0.66rem; color: var(--text-muted); }
.round-history-item .rh-name { font-size: 0.74rem; color: var(--text-primary); font-weight: 600; white-space: nowrap; }
.round-history-item.rh-tie .rh-name { color: var(--text-muted); }

.vote-candidates { display: flex; flex-direction: column; gap: 8px; }
.vote-candidate {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.vote-candidate:hover { border-color: var(--accent-gold-dim); }
.vote-candidate.selected {
  border-color: var(--accent-red-bright);
  background: rgba(139,28,28,0.15);
}
.vote-candidate.voted-by {
  border-color: var(--accent-gold-dim);
  background: rgba(201,168,76,0.05);
}
.vote-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-subtle);
  flex-shrink: 0;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.vote-candidate.selected .vote-check {
  background: var(--accent-red-bright);
  border-color: var(--accent-red-bright);
}
.vote-check-inner { width: 10px; height: 10px; border-radius: 50%; background: white; display: none; }
.vote-candidate.selected .vote-check-inner { display: block; }
.vote-cand-name { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); flex: 1; }
.vote-cand-alias { font-family: var(--font-display); font-size: 0.72rem; color: var(--accent-gold); display: block; margin-top: 1px; letter-spacing: 2px; }
.vote-cand-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}
.vote-cand-voters {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.btn-vote {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--accent-red), #c0392b);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-ar);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.btn-vote:hover { filter: brightness(1.1); }
.btn-vote:disabled { opacity: 0.5; cursor: not-allowed; }

/* spectator overlay */
.spectator-bar {
  background: rgba(139,28,28,0.2);
  border: 1px solid rgba(139,28,28,0.5);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  text-align: center;
  font-size: 0.82rem;
  color: #e8a0a0;
  display: none;
}
.spectator-bar.show { display: block; }

/* eliminated overlay */
.eliminated-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.92);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.eliminated-overlay.show { display: flex; }
.eliminated-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: eliminatedPulse 1s ease-in-out 3;
}
@keyframes eliminatedPulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
.eliminated-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--accent-red-bright);
  letter-spacing: 4px;
  margin-bottom: 10px;
}
.eliminated-sub { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 24px; }
.btn-spectate {
  padding: 13px 30px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-ar);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}
.btn-spectate:hover { border-color: var(--accent-gold-dim); }

/* ===== PROFILE ===== */
#screen-profile {
  padding-bottom: 80px;
}
.profile-header {
  background: linear-gradient(180deg, rgba(139,28,28,0.25) 0%, transparent 100%);
  padding: 50px 16px 20px;
  text-align: center;
}
.profile-logo-wrapper {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--accent-gold-dim);
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}
.profile-logo { width: 56px; height: 56px; object-fit: contain; }
.profile-logo.is-photo { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-edit-badge {
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-gold);
  color: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-deep);
}
.player-avatar-logo.is-photo { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.profile-alias {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--accent-gold);
  letter-spacing: 5px;
  margin-bottom: 4px;
}
.profile-fullname { font-size: 0.9rem; color: var(--text-secondary); }

.profile-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.profile-section-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-section-title::before {
  content: '';
  display: block;
  width: 3px;
  height: 12px;
  background: var(--accent-gold);
  border-radius: 2px;
}
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
}
.profile-field {
  padding: 13px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
}
.profile-field:last-child { border-bottom: none; }
.profile-field-label { font-size: 0.8rem; color: var(--text-muted); }
.profile-field-val { font-size: 0.85rem; color: var(--text-primary); direction: ltr; }

/* rating */
.rating-section { padding: 16px; }
.detail-rating-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-gold);
  font-size: 0.82rem;
  margin: -6px 0 10px;
}
.detail-rating-summary svg { width: 15px; height: 15px; }
.detail-rating-summary .star-empty { color: var(--border-subtle); }
.detail-rating-summary .drs-count { color: var(--text-muted); font-size: 0.76rem; margin-right: 4px; }

.rating-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.rating-title { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 14px; }
.stars-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}
.star-btn {
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
}
.star-btn svg { width: 36px; height: 36px; }
.star-btn.active { color: var(--accent-gold); }
.star-btn:hover { transform: scale(1.2); }
.rating-comment {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-ar);
  font-size: 0.85rem;
  outline: none;
  resize: none;
  height: 80px;
  margin-bottom: 12px;
  transition: var(--transition);
  direction: rtl;
}
.rating-comment:focus { border-color: var(--accent-gold-dim); }
.btn-rate {
  width: 100%;
  padding: 12px;
  background: var(--bg-overlay);
  border: 1px solid var(--accent-gold-dim);
  border-radius: var(--radius-sm);
  color: var(--accent-gold);
  font-family: var(--font-ar);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}
.btn-rate:hover { background: rgba(201,168,76,0.1); }

/* notifications */
.notif-badge {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 10px;
  height: 10px;
  background: var(--accent-red-bright);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
  display: none;
}
.notif-badge.show { display: block; }
.notif-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: 12px;
}
.notif-item:last-child { border-bottom: none; }
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-gold);
  flex-shrink: 0;
  margin-top: 5px;
}
.notif-dot.read { background: var(--text-muted); }
.notif-text { font-size: 0.83rem; color: var(--text-secondary); line-height: 1.5; }
.notif-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 3px; font-family: var(--font-body-light); font-weight: 300; }

/* ===== TOAST ===== */
#toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 1000;
  background: var(--bg-overlay);
  border: 1px solid var(--border-accent);
  border-radius: 24px;
  padding: 10px 20px;
  font-size: 0.83rem;
  color: var(--text-primary);
  opacity: 0;
  transition: all 0.3s ease;
  white-space: nowrap;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== LOADING ===== */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== WAITING ROOM ===== */
.waiting-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  text-align: center;
  gap: 16px;
}
.waiting-pulse {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(201,168,76,0.1);
  border: 2px solid var(--accent-gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: waitingPulse 2s ease-in-out infinite;
}
@keyframes waitingPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(201,168,76,0.3); }
  50% { box-shadow: 0 0 0 20px rgba(201,168,76,0); }
}
.waiting-title { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); }
.waiting-sub { font-size: 0.83rem; color: var(--text-muted); }

/* share room link */
.share-room-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  color: var(--text-secondary);
  font-family: var(--font-ar);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
}
.share-room-btn:hover { border-color: var(--accent-gold-dim); color: var(--accent-gold); }
.share-room-btn svg { width: 16px; height: 16px; }

/* ===== GAME ENDED ===== */
.game-ended-screen {
  flex: 1;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  text-align: center;
  overflow-y: auto;
}
.game-ended-screen.show { display: flex; }
.game-result-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.result-win { background: rgba(45,106,79,0.2); border: 2px solid #2d6a4f; }
.result-lose { background: rgba(139,28,28,0.2); border: 2px solid var(--accent-red); }
.result-win svg { color: #7ecba4; }
.result-lose svg { color: #e8a0a0; }
.result-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 4px;
  margin-bottom: 8px;
}
.result-sub { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 24px; font-family: var(--font-body-light); font-weight: 300; }
.result-title.lose-shake { animation: resultShake 0.5s ease-in-out 1; }
@keyframes resultShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px) rotate(-1deg); }
  40% { transform: translateX(5px) rotate(1deg); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

/* ===== NOTIFICATIONS SCREEN ===== */
#screen-notifications { padding-bottom: 80px; padding-top: 50px; }
.notif-header { padding: 10px 16px 0; }
.notif-header-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.notif-list { padding: 12px 0; }

/* ===== CASE STORY REVEAL (shown to everyone for 60s when a game starts, before clues) ===== */
.case-story-screen {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 22px;
  background:
    radial-gradient(ellipse 70% 45% at 50% 15%, rgba(139,28,28,0.18) 0%, transparent 70%),
    linear-gradient(180deg, rgba(5,5,8,0.97), rgba(5,5,8,0.99) 60%, #050508);
  overflow-y: auto;
}
.case-story-screen.show { display: flex; }
.case-story-stamp {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 5px;
  color: var(--accent-red-bright);
  border: 1px solid var(--accent-red);
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 18px;
  transform: rotate(-2deg);
  opacity: 0;
  animation: storyPartFade 0.5s ease-out 0.05s forwards;
}
.case-story-icon {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(201,168,76,0.08);
  border: 1px solid var(--accent-gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  opacity: 0;
  animation: storyPartFade 0.5s ease-out 0.15s forwards;
}
.case-story-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 3px;
  color: var(--accent-gold);
  margin-bottom: 16px;
  opacity: 0;
  animation: storyPartFade 0.5s ease-out 0.25s forwards;
}
.case-story-text-wrap {
  max-width: 420px;
  max-height: 38vh;
  overflow-y: auto;
  padding: 18px 18px;
  background: rgba(13,13,20,0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  margin-bottom: 22px;
  opacity: 0;
  animation: storyPartFade 0.6s ease-out 0.35s forwards;
}
.case-story-text {
  font-size: 0.92rem;
  line-height: 2;
  color: var(--text-primary);
}
@keyframes storyPartFade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.case-story-timer-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: storyPartFade 0.5s ease-out 0.5s forwards;
}
.case-story-timer-wrap svg { width: 88px; height: 88px; transform: rotate(-90deg); }
.case-story-ring-bg { fill: none; stroke: var(--border-subtle); stroke-width: 5; }
.case-story-ring { fill: none; stroke: var(--accent-red-bright); stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset 0.25s linear; }
.case-story-seconds {
  position: absolute;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}
.case-story-hint {
  margin-top: 12px;
  font-size: 0.76rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  opacity: 0;
  animation: storyPartFade 0.5s ease-out 0.6s forwards;
}

/* ===== ROUND CLUE SPOTLIGHT (each round's clue appears once, on screen, for 60s) ===== */
.clue-spotlight-screen {
  position: fixed;
  inset: 0;
  z-index: 145;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 26px 20px;
  background:
    radial-gradient(ellipse 70% 45% at 50% 15%, rgba(201,168,76,0.12) 0%, transparent 70%),
    linear-gradient(180deg, rgba(5,5,8,0.97), rgba(5,5,8,0.99) 60%, #050508);
  overflow-y: auto;
}
.clue-spotlight-screen.show { display: flex; }
.spotlight-badge {
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 4px;
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold-dim);
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 14px;
  opacity: 0;
  animation: storyPartFade 0.5s ease-out 0.05s forwards;
}
.spotlight-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text-primary);
  letter-spacing: 2px;
  margin-bottom: 16px;
  opacity: 0;
  animation: storyPartFade 0.5s ease-out 0.15s forwards;
}
.spotlight-clues-wrap {
  width: 100%;
  max-width: 420px;
  max-height: 48vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  opacity: 0;
  animation: storyPartFade 0.6s ease-out 0.25s forwards;
}
.spotlight-clue-card {
  background: rgba(13,13,20,0.85);
  border: 1px solid var(--accent-gold-dim);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: right;
}
.spotlight-clue-title { font-size: 0.88rem; font-weight: 700; color: var(--accent-gold); margin-bottom: 8px; }
.spotlight-clue-text { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.8; }
.spotlight-timer-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: storyPartFade 0.5s ease-out 0.4s forwards;
}
.spotlight-timer-wrap svg { width: 72px; height: 72px; transform: rotate(-90deg); }
.spotlight-ring-bg { fill: none; stroke: var(--border-subtle); stroke-width: 5; }
.spotlight-ring { fill: none; stroke: var(--accent-gold); stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset 0.25s linear; }
.spotlight-seconds {
  position: absolute;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}
.spotlight-hint {
  margin-top: 10px;
  font-size: 0.74rem;
  color: var(--text-muted);
  opacity: 0;
  animation: storyPartFade 0.5s ease-out 0.5s forwards;
}

/* ===== VOTE COUNTDOWN (urgency state) ===== */
.vote-timer.urgent { animation: voteUrgentPulse 0.8s ease-in-out infinite; }
@keyframes voteUrgentPulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.06); }
}

/* ===== WAITING ROOM: player list, ready-up, kick, lock (new room features) ===== */
.waiting-players-list {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.waiting-player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  text-align: right;
}
.waiting-player-row .wp-alias { flex: 1; font-size: 0.82rem; color: var(--text-primary); font-weight: 600; }
.wp-ready-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border-subtle);
  flex-shrink: 0;
}
.wp-ready-dot.ready { background: #2d6a4f; box-shadow: 0 0 6px rgba(45,106,79,0.7); }
.wp-kick-btn {
  background: transparent;
  border: 1px solid var(--accent-red);
  color: #e8a0a0;
  border-radius: 6px;
  font-size: 0.68rem;
  padding: 4px 8px;
  cursor: pointer;
  transition: var(--transition);
}
.wp-kick-btn:hover { background: rgba(139,28,28,0.2); }
.btn-ready-toggle {
  padding: 10px 22px;
  border-radius: 24px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: var(--font-ar);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}
.btn-ready-toggle.is-ready {
  border-color: #2d6a4f;
  color: #7ecba4;
  background: rgba(45,106,79,0.15);
}
.room-lock-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  transition: var(--transition);
}
.room-lock-toggle.is-locked { border-color: var(--accent-red); color: #e8a0a0; }
.room-lock-toggle svg { width: 14px; height: 14px; }

/* ===== COPYRIGHT FOOTER ===== */
.app-copyright {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.65;
  padding: 22px 16px 10px;
  letter-spacing: 0.5px;
}

/* ===== TOP PLAYERS / HALL OF FAME ===== */
.top-player-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  opacity: 0;
  transform: translateY(10px);
  animation: clueCardIn 0.5s cubic-bezier(0.16,1,0.3,1) forwards;
}
.top-player-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.top-player-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--accent-gold-dim);
  flex-shrink: 0;
}
.top-player-avatar img { width: 100%; height: 100%; object-fit: cover; }
.top-player-alias { font-size: 0.92rem; font-weight: 700; color: var(--accent-gold); }
.top-player-name { font-size: 0.75rem; color: var(--text-muted); }
.top-player-count {
  margin-right: auto;
  background: rgba(201,168,76,0.12);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold-dim);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.top-player-wins { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--border-subtle); padding-top: 10px; }
.top-player-win-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-secondary);
}
.tpw-game { color: var(--text-primary); }
.tpw-date { color: var(--text-muted); }

/* ===== CHARACTER REVEAL CARD (player's private role card - animated, with mascot + game name) ===== */
.char-reveal-card {
  position: relative;
  width: 100%;
  max-width: 320px;
  background: linear-gradient(160deg, var(--bg-card), var(--bg-surface));
  border: 1px solid var(--accent-gold-dim);
  border-radius: var(--radius);
  padding: 26px 22px 22px;
  text-align: center;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 20px 50px rgba(0,0,0,0.6), 0 0 40px rgba(201,168,76,0.12);
  transform: rotateY(-90deg) scale(0.85);
  opacity: 0;
  animation: charCardFlipIn 0.7s cubic-bezier(0.34,1.3,0.4,1) 0.1s forwards;
}
@keyframes charCardFlipIn {
  0%   { transform: rotateY(-90deg) scale(0.85); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: rotateY(0deg) scale(1); opacity: 1; }
}
.char-reveal-shine {
  position: absolute;
  top: 0; left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(201,168,76,0.18), transparent);
  transform: skewX(-20deg);
  animation: charCardShine 1.6s ease-out 0.75s 1;
}
@keyframes charCardShine {
  from { left: -60%; }
  to   { left: 130%; }
}
.char-reveal-game-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 3px;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
  opacity: 0;
  animation: storyPartFade 0.5s ease-out 0.55s forwards;
}
.char-reveal-mascot-wrap {
  width: 84px;
  height: 84px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 2px solid var(--accent-gold);
  padding: 3px;
  box-shadow: 0 0 24px rgba(201,168,76,0.3);
  opacity: 0;
  animation: storyPartFade 0.5s ease-out 0.4s forwards;
}
.char-reveal-mascot { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.char-reveal-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 6px;
  opacity: 0;
  animation: storyPartFade 0.5s ease-out 0.65s forwards;
}
.char-reveal-card .eliminated-title { opacity: 0; animation: storyPartFade 0.5s ease-out 0.7s forwards; }
.char-reveal-card .eliminated-sub { opacity: 0; animation: storyPartFade 0.5s ease-out 0.85s forwards; margin-bottom: 18px; }
.char-reveal-card #char-reveal-capo-tag.show-tag { opacity: 0; animation: storyPartFade 0.5s ease-out 0.78s forwards; }
.char-reveal-card .btn-spectate { opacity: 0; animation: storyPartFade 0.5s ease-out 0.95s forwards; }

/* ===== game detail: cast of characters preview (no capo info revealed - no spoilers) ===== */
.detail-characters-list { display: flex; flex-direction: column; gap: 8px; }
.char-preview-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  opacity: 0;
  transform: translateY(8px);
  animation: clueCardIn 0.45s cubic-bezier(0.16,1,0.3,1) forwards;
}
.char-preview-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-overlay);
  border: 1px solid var(--accent-gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent-gold);
}
.char-preview-avatar svg { width: 17px; height: 17px; }
.char-preview-name { font-size: 0.86rem; font-weight: 700; color: var(--text-primary); }
.char-preview-bio { font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; line-height: 1.5; }

.wallet-card { padding: 16px; }
.wallet-balance-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.wallet-balance-row > div:first-child { min-width: 0; flex: 1 1 auto; }
.wallet-balance-row > button { flex-shrink: 0; }
.wallet-balance-amount { font-size: 1.4rem; font-weight: 700; color: var(--accent-gold); margin-top: 4px; }
.wallet-locked-note {
  font-size: 0.68rem;
  color: var(--accent-red-bright);
  margin-top: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 360px) {
  .splash-title { font-size: 2rem; }
  .game-card-img, .game-card-img-placeholder, .game-card::after { height: 160px; }
}

/* ===== GLASSMORPHISM (تأثيرات زجاجية - بلور خلفية على أهم الأسطح) ===== */
.bottom-nav,
.room-header,
.profile-header,
.profile-card,
.game-card-face,
#toast,
.char-reveal-card,
.clue-card,
.game-report-wrap,
.notif-header,
.share-room-btn,
.room-lock-toggle,
.spectator-bar,
.create-room-game-item,
.top-player-row,
.wallet-topup-section,
#wallet-topup-section {
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.eliminated-overlay {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.eliminated-overlay { background: rgba(8,7,10,0.86); }
.bottom-nav { border-top: 1px solid var(--border-accent); box-shadow: 0 -8px 30px rgba(0,0,0,0.35); }
.room-header, .profile-header { border-bottom: 1px solid var(--border-accent); }
.profile-card, .game-card-face, .char-reveal-card, .clue-card, .game-report-wrap {
  border: 1px solid var(--border-subtle);
  box-shadow: inset 0 1px 0 rgba(242,232,213,0.05), var(--shadow-card);
}
#toast { box-shadow: 0 8px 28px rgba(0,0,0,0.5), inset 0 1px 0 rgba(242,232,213,0.06); }

/* ===== INTERACTIVE STORIES (قصص تفاعلية) ===== */
.story-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
}
.story-card:active { transform: scale(0.98); }
.story-card-title { font-family: var(--font-display); font-size: 1.05rem; color: var(--accent-gold); margin-bottom: 6px; }
.story-card-desc { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 10px; }
.story-card-meta { display: flex; gap: 10px; font-size: 0.72rem; color: var(--text-muted); }
.story-scene-text {
  font-size: 1.02rem;
  line-height: 2;
  color: var(--text-primary);
  padding-top: 20px;
  white-space: pre-wrap;
}
.story-choice-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text-primary);
  font-family: var(--font-ar);
  font-size: 0.92rem;
  text-align: right;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.story-choice-btn:hover { border-color: var(--accent-gold); background: rgba(229,200,122,0.08); }
.story-choice-btn .choice-votes {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: var(--accent-gold);
  background: var(--bg-overlay);
  border-radius: 10px;
  padding: 2px 8px;
}
.story-choice-btn.voted { border-color: var(--accent-gold); background: rgba(229,200,122,0.14); }
