@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&display=swap");

/* ===================== إعدادات أساسية — هوية سينمائية داكنة ===================== */
:root {
  --void: #0d0805;
  --bg-deep: #1a0f08;
  --bg-mid: #2c1810;
  --coffee: #4b2e1e;
  --coffee-mid: #7a4b24;
  --coffee-light: #a9784a;
  --cream: #f3e5d0;
  --cream-soft: #fbf3e6;
  --gold: #e8b23d;
  --gold-bright: #ffd579;
  --gold-deep: #9c6a15;
  --success: #35c47e;
  --success-glow: rgba(53, 196, 126, 0.45);
  --danger: #ff5b4d;
  --danger-glow: rgba(255, 91, 77, 0.45);
  --text-light: #f7ecd9;
  --text-muted: #c7a67d;
  --text-dark: #2b1c12;
  --glass-bg: rgba(255, 246, 230, 0.05);
  --glass-bg-strong: rgba(255, 246, 230, 0.09);
  --glass-border: rgba(232, 178, 61, 0.28);
  --radius-lg: clamp(18px, 2.2vw, 30px);
  --radius-md: clamp(12px, 1.6vw, 20px);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-glow-gold: 0 0 0 1px rgba(232,178,61,0.4), 0 8px 24px rgba(232,178,61,0.18), 0 2px 40px rgba(232,178,61,0.12);
  --max-content-width: 720px;
  --max-tv-width: 1080px;
  --font-display: "Cairo", "Tahoma", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--void);
  color: var(--text-light);
  font-family: var(--font-display);
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(ellipse 900px 600px at 15% -5%, rgba(232,178,61,0.10), transparent 55%),
    radial-gradient(ellipse 900px 700px at 90% 110%, rgba(154,90,30,0.16), transparent 55%),
    radial-gradient(circle at 50% 40%, var(--bg-mid), var(--bg-deep) 55%, var(--void) 100%);
  background-attachment: fixed;
}

h1, h2, h3 { margin: 0; font-weight: 800; color: var(--text-light); font-family: var(--font-display); }
p { margin: 0; }
button { font-family: inherit; }

/* ===================== الهيكل العام ===================== */
.app-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: var(--max-tv-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(16px, 3vw, 32px);
  animation: fadeIn .32s cubic-bezier(.2,.8,.2,1);
}
.screen.active { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===================== الشاشة الرئيسية ===================== */
[data-screen="home"] {
  align-items: center;
  justify-content: space-between;
  text-align: center;
  position: relative;
}

.bg-decor {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 15%, rgba(232,178,61,0.16), transparent 38%),
    radial-gradient(circle at 82% 78%, rgba(154,90,30,0.18), transparent 42%);
  pointer-events: none;
  z-index: 0;
}

.brand {
  position: relative;
  z-index: 1;
  margin-top: clamp(24px, 8vh, 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.brand-cup {
  font-size: clamp(56px, 12vw, 110px);
  filter: drop-shadow(0 0 30px rgba(232,178,61,0.35)) drop-shadow(0 10px 16px rgba(0,0,0,0.5));
  animation: sway 3.5s ease-in-out infinite;
}
@keyframes sway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

.brand h1 {
  font-size: clamp(2.4rem, 6.5vw, 4.4rem);
  font-weight: 900;
  letter-spacing: 1px;
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 55%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(232,178,61,0.25);
}
.tagline {
  color: var(--text-muted);
  font-size: clamp(0.95rem, 2vw, 1.3rem);
  font-weight: 600;
}

.credit-pill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  color: var(--text-light);
  padding: 10px 22px;
  border-radius: 999px;
  font-size: clamp(0.9rem, 1.6vw, 1.15rem);
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}
.credit-icon { font-size: 1.2em; }

.home-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 380px;
}

.lucky-cup-banner {
  position: relative;
  z-index: 1;
  background: linear-gradient(90deg, var(--gold-bright), var(--gold));
  color: var(--text-dark);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: clamp(0.85rem, 1.6vw, 1.05rem);
  box-shadow: var(--shadow-glow-gold);
}
.hidden { display: none !important; }

.ad-banner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--glass-bg);
  border: 1px dashed var(--coffee-light);
  border-radius: var(--radius-md);
  padding: clamp(10px, 2vw, 16px);
  color: var(--text-muted);
  font-size: clamp(0.8rem, 1.4vw, 0.95rem);
}
.ad-badge {
  background: var(--coffee-mid);
  color: var(--text-light);
  font-size: 0.7em;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
}

/* ===================== أزرار عامة ===================== */
.btn {
  border: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  padding: clamp(12px, 2vw, 16px) clamp(18px, 3vw, 28px);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 800;
  font-family: var(--font-display);
  transition: transform .15s cubic-bezier(.2,.8,.2,1), box-shadow .15s ease, opacity .15s ease, filter .15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.3); }
.btn:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

.btn-primary {
  background: linear-gradient(160deg, var(--gold-bright) 0%, var(--gold) 45%, var(--gold-deep) 100%);
  color: #2b1a05;
  box-shadow: 0 6px 18px rgba(232,178,61,0.35), 0 2px 0 rgba(255,255,255,0.35) inset, 0 -3px 0 rgba(0,0,0,0.15) inset;
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 8px 24px rgba(232,178,61,0.5), 0 2px 0 rgba(255,255,255,0.35) inset; }
.btn-lg { padding: clamp(14px, 2.4vw, 20px) clamp(20px, 4vw, 36px); font-size: clamp(1.05rem, 2.4vw, 1.4rem); }

.btn-ghost {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  color: var(--text-light);
  border: 2px solid var(--glass-border);
}
.btn-ghost:hover { background: var(--glass-bg-strong); border-color: var(--gold); }

.btn-success {
  background: linear-gradient(160deg, #4fe0a0, var(--success));
  color: #06301d;
  box-shadow: 0 6px 18px var(--success-glow);
}
.btn-danger {
  background: linear-gradient(160deg, #ff8478, var(--danger));
  color: #3a0a05;
  box-shadow: 0 6px 18px var(--danger-glow);
}

.btn-round {
  width: clamp(40px, 6vw, 56px);
  height: clamp(40px, 6vw, 56px);
  border-radius: 50%;
  background: linear-gradient(160deg, var(--coffee-mid), var(--coffee));
  color: var(--text-light);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  padding: 0;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--glass-border);
}
.btn-round:hover { filter: brightness(1.15); }

.icon-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  width: clamp(36px, 5vw, 48px);
  height: clamp(36px, 5vw, 48px);
  font-size: clamp(1rem, 2vw, 1.3rem);
  cursor: pointer;
  color: var(--text-light);
  backdrop-filter: blur(8px);
  transition: background .15s ease;
}
.icon-btn:hover { background: var(--glass-bg-strong); }

/* ===================== الشاشات ذات الشريط العلوي ===================== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: clamp(12px, 2vh, 24px);
}
.topbar h2 { font-size: clamp(1.2rem, 3vw, 1.7rem); text-align: center; flex: 1; }
.spacer { width: clamp(36px, 5vw, 48px); }
.round-target {
  font-size: clamp(0.8rem, 1.6vw, 1rem);
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  color: var(--gold-bright);
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.panel-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2.4vh, 28px);
  padding-bottom: 12px;
}

.setup-block h3 {
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  margin-bottom: 8px;
}
.hint { color: var(--text-muted); font-size: clamp(0.8rem, 1.6vw, 0.95rem); }
.hint.center { text-align: center; }

.row-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: clamp(12px, 2vw, 18px);
}
.row-block > div:first-child { flex: 1; }

/* ===================== إعداد اللعبة ===================== */
.team-count-row, .target-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 3vw, 32px);
}
.team-count-display {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 900;
  min-width: 2ch;
  text-align: center;
  color: var(--gold-bright);
}

.team-names-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.team-name-input {
  width: 100%;
  padding: clamp(10px, 1.8vw, 14px);
  border-radius: var(--radius-md);
  border: 2px solid var(--glass-border);
  background: var(--glass-bg);
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  font-weight: 700;
  color: var(--text-light);
  text-align: center;
}
.team-name-input::placeholder { color: var(--text-muted); }
.team-name-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,178,61,0.2); }

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.category-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: clamp(10px, 1.8vw, 16px) 8px;
  border-radius: var(--radius-md);
  border: 2px solid var(--glass-border);
  background: var(--glass-bg);
  cursor: pointer;
  font-size: clamp(0.8rem, 1.6vw, 0.95rem);
  font-weight: 700;
  color: var(--text-muted);
  transition: all .18s ease;
}
.category-chip .cat-icon { font-size: clamp(1.3rem, 2.6vw, 1.8rem); filter: grayscale(0.4); transition: filter .18s ease; }
.category-chip.selected {
  background: linear-gradient(160deg, rgba(232,178,61,0.22), rgba(154,90,30,0.14));
  border-color: var(--gold);
  color: var(--gold-bright);
  box-shadow: var(--shadow-glow-gold);
}
.category-chip.selected .cat-icon { filter: none; }

.setup-footer { padding-top: 12px; }
.setup-footer .btn { width: 100%; }

/* ===================== شاشة اللعب ===================== */
[data-screen="game"] { align-items: stretch; }

.dallahs-row {
  display: flex;
  gap: clamp(10px, 2vw, 20px);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: clamp(10px, 2vh, 20px);
}

.dallah-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 90px;
  transition: transform .2s ease;
}
.dallah-shape {
  width: clamp(56px, 10vw, 96px);
  height: clamp(70px, 12vw, 120px);
  position: relative;
  -webkit-mask-image: url("../assets/dallah.svg");
  mask-image: url("../assets/dallah.svg");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  background: rgba(255,246,230,0.10);
  overflow: hidden;
}
.dallah-fill {
  position: absolute;
  bottom: 0; right: 0; left: 0;
  height: 0%;
  background: linear-gradient(120deg, var(--gold-bright), var(--gold) 45%, var(--gold-deep) 55%, var(--gold-bright));
  background-size: 220% 220%;
  transition: height .5s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 0 16px rgba(232,178,61,0.5) inset;
  animation: liquidShimmer 3.5s ease-in-out infinite;
}
@keyframes liquidShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.dallah-item.score-bump { animation: dallahBump .5s cubic-bezier(.34,1.56,.64,1); }
.dallah-item.score-bump-negative { animation: dallahShake .4s ease; }
@keyframes dallahBump {
  0% { transform: scale(1); }
  35% { transform: scale(1.22); }
  100% { transform: scale(1.06); }
}
@keyframes dallahShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}
.score-popup {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--success);
  text-shadow: 0 0 12px rgba(53,196,126,0.6);
  pointer-events: none;
  animation: scorePopupFloat 1.1s ease-out forwards;
  z-index: 5;
}
.score-popup.score-popup-negative {
  color: var(--danger);
  text-shadow: 0 0 12px rgba(255,91,77,0.6);
}
@keyframes scorePopupFloat {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.6); }
  25% { opacity: 1; transform: translate(-50%, -14px) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -46px) scale(1); }
}
.dallah-team-name {
  font-weight: 700;
  font-size: clamp(0.75rem, 1.5vw, 0.95rem);
  color: var(--text-muted);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dallah-team-score { font-size: clamp(0.7rem, 1.3vw, 0.85rem); color: var(--text-muted); }
.dallah-item.is-active { transform: scale(1.06); }
.dallah-item.is-active .dallah-team-name { color: var(--gold-bright); }
.dallah-item.is-active .dallah-shape { filter: drop-shadow(0 0 14px rgba(232,178,61,0.6)); }
.dallah-item.is-winner .dallah-shape { filter: drop-shadow(0 0 18px rgba(53,196,126,0.7)); }

.game-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 3vh, 32px);
  text-align: center;
}

.stage-idle { display: flex; flex-direction: column; align-items: center; gap: 16px; }

.pour-btn {
  border: none;
  cursor: pointer;
  background: radial-gradient(circle at 32% 28%, var(--gold-bright) 0%, var(--gold) 42%, var(--gold-deep) 78%, #6b4610 100%);
  color: #2b1a05;
  width: clamp(180px, 32vw, 280px);
  height: clamp(180px, 32vw, 280px);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: clamp(1rem, 2.2vw, 1.4rem);
  font-weight: 900;
  box-shadow:
    0 16px 40px rgba(0,0,0,0.5),
    0 0 0 6px rgba(232,178,61,0.12),
    0 0 60px rgba(232,178,61,0.25),
    0 3px 0 rgba(255,255,255,0.4) inset;
  transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s ease;
  animation: pourPulse 2.6s ease-in-out infinite;
}
@keyframes pourPulse {
  0%, 100% { box-shadow: 0 16px 40px rgba(0,0,0,0.5), 0 0 0 6px rgba(232,178,61,0.12), 0 0 60px rgba(232,178,61,0.25), 0 3px 0 rgba(255,255,255,0.4) inset; }
  50% { box-shadow: 0 16px 40px rgba(0,0,0,0.5), 0 0 0 10px rgba(232,178,61,0.18), 0 0 90px rgba(232,178,61,0.4), 0 3px 0 rgba(255,255,255,0.4) inset; }
}
.pour-btn:hover { transform: translateY(-2px); }
.pour-btn:active { transform: scale(0.95); animation: none; }
.pour-btn:disabled { cursor: default; }
.pour-icon { font-size: clamp(2.4rem, 7vw, 4.5rem); filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3)); transition: transform .5s ease; }
.pour-drop {
  position: absolute;
  top: 38%;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  opacity: 0;
}
.pour-btn.pouring { animation: none; transform: scale(0.97); }
.pour-btn.pouring .pour-icon { animation: pourTilt .55s ease; }
.pour-btn.pouring .pour-drop { animation: pourDrip .55s ease; }
@keyframes pourTilt {
  0% { transform: rotate(0deg); }
  30% { transform: rotate(-22deg); }
  70% { transform: rotate(-22deg); }
  100% { transform: rotate(0deg); }
}
@keyframes pourDrip {
  0%, 25% { opacity: 0; transform: translateY(-10px) scale(0.5); }
  40% { opacity: 1; transform: translateY(0) scale(1); }
  90% { opacity: 1; transform: translateY(26px) scale(0.8); }
  100% { opacity: 0; transform: translateY(30px) scale(0.6); }
}

.stage-challenge {
  width: 100%;
  max-width: var(--max-content-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px, 2.4vh, 24px);
}

.challenge-badge {
  padding: 8px 22px;
  border-radius: 999px;
  font-weight: 800;
  font-size: clamp(0.85rem, 1.8vw, 1.05rem);
  color: var(--text-light);
  letter-spacing: .3px;
}
.challenge-badge.type-info { background: linear-gradient(120deg, #7a4b24, #a9784a); box-shadow: 0 0 24px rgba(169,120,74,0.4); }
.challenge-badge.type-acting { background: linear-gradient(120deg, #b3701f, #e8a53d); box-shadow: 0 0 24px rgba(232,165,61,0.4); }
.challenge-badge.type-auction { background: linear-gradient(120deg, #1f7a6b, #35c4a8); box-shadow: 0 0 24px rgba(53,196,168,0.4); }
.challenge-badge.type-council { background: linear-gradient(120deg, #7a1fb3, #c53de8); box-shadow: 0 0 24px rgba(197,61,232,0.4); }
.challenge-badge.type-hail { background: linear-gradient(120deg, #b3341f, #e86a3d); box-shadow: 0 0 24px rgba(232,106,61,0.4); }
.challenge-badge.type-sabr { background: linear-gradient(120deg, #2f4a7a, #4b78c5); box-shadow: 0 0 24px rgba(75,120,197,0.4); }

.challenge-card.card-enter { animation: cardPop .45s cubic-bezier(.2,.9,.3,1.1); }
@keyframes cardPop {
  0% { opacity: 0; transform: scale(0.88) translateY(14px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.timer-start-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: var(--max-content-width);
}
.timer-start-wrap .btn { animation: pourPulse 2.6s ease-in-out infinite; }

.timer-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: var(--max-content-width);
}
.timer-bar {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,246,230,0.1);
  overflow: hidden;
}
.timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  transition: width 1s linear, background .3s ease;
}
.timer-seconds {
  font-weight: 900;
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--gold-bright);
  min-width: 2.4ch;
  text-align: center;
}
.timer-wrap.low .timer-fill { background: linear-gradient(90deg, var(--danger), #ff8478); }
.timer-wrap.low .timer-seconds { color: var(--danger); animation: timerPulse 1s ease-in-out infinite; }
@keyframes timerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.challenge-card {
  width: 100%;
  background: linear-gradient(160deg, var(--glass-bg-strong), var(--glass-bg));
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 4vw, 40px);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.challenge-image {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
  align-self: center;
  background: rgba(255,255,255,0.05);
}
.challenge-text {
  font-size: clamp(1.15rem, 3vw, 1.8rem);
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-light);
}

.peek-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: clamp(64px, 10vh, 90px);
  border-radius: var(--radius-md);
  border: 2px dashed var(--gold);
  background: rgba(232,178,61,0.08);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  transition: background .15s ease, transform .1s ease;
  padding: clamp(10px, 2vw, 16px);
  text-align: center;
  gap: 10px;
}
.peek-box:active { transform: scale(0.98); }
.peek-hint {
  font-size: clamp(0.9rem, 1.8vw, 1.1rem);
  font-weight: 700;
  color: var(--gold-bright);
}
.peek-reveal {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.peek-value {
  font-size: clamp(1.4rem, 3.6vw, 2.2rem);
  font-weight: 900;
  color: var(--gold-bright);
  text-shadow: 0 0 24px rgba(232,178,61,0.5);
}
.peek-box.revealed { background: rgba(232,178,61,0.18); }
.peek-box.revealed .peek-hint { display: none; }
.peek-box.revealed .peek-reveal { display: flex; }

.silent-notice {
  display: flex;
  justify-content: center;
}
.silent-notice .forbidden-chip { background: rgba(232,178,61,0.14); color: var(--gold-bright); border-color: var(--gold); }

.choices-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.choice-item {
  background: var(--glass-bg);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: clamp(12px, 1.8vw, 16px);
  font-size: clamp(0.9rem, 1.8vw, 1.05rem);
  font-weight: 700;
  color: var(--text-light);
  cursor: pointer;
  font-family: var(--font-display);
  transition: all .16s ease;
}
.choice-item:hover:not(:disabled) { border-color: var(--gold); background: var(--glass-bg-strong); transform: translateY(-2px); }
.choice-item.selected { border-color: var(--gold); background: linear-gradient(160deg, rgba(232,178,61,0.28), rgba(154,90,30,0.16)); box-shadow: var(--shadow-glow-gold); animation: choiceBump .3s cubic-bezier(.34,1.56,.64,1); }
.choice-item.correct { border-color: var(--success); background: rgba(53,196,126,0.18); box-shadow: 0 0 24px var(--success-glow); color: #d4ffe9; animation: choicePop .4s cubic-bezier(.34,1.56,.64,1); }
.choice-item.wrong { border-color: var(--danger); background: rgba(255,91,77,0.18); box-shadow: 0 0 24px var(--danger-glow); color: #ffe0dc; animation: choiceShake .4s ease; }
@keyframes choiceBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.07); }
  100% { transform: scale(1); }
}
@keyframes choicePop {
  0% { transform: scale(1); }
  40% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
@keyframes choiceShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.choice-item:disabled { cursor: default; }

.fact-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: linear-gradient(120deg, rgba(232,178,61,0.14), rgba(232,178,61,0.05));
  border: 1px solid rgba(232,178,61,0.35);
  border-radius: var(--radius-md);
  padding: clamp(12px, 2vw, 18px);
  text-align: right;
}
.fact-icon { font-size: 1.3em; line-height: 1; }
.fact-box p { color: var(--text-light); font-size: clamp(0.85rem, 1.7vw, 1rem); font-weight: 600; line-height: 1.6; }

.forbidden-words {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.forbidden-chip {
  background: rgba(255,91,77,0.14);
  color: #ffb3aa;
  border: 1px solid var(--danger);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: clamp(0.75rem, 1.5vw, 0.9rem);
  font-weight: 700;
}

.mcq-actions, .next-round-wrap {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: var(--max-content-width);
}
.mcq-actions .btn, .next-round-wrap .btn { flex: 1; }

/* ===================== شاشة نفاذ الرصيد ===================== */
[data-screen="credits"] { align-items: center; justify-content: center; }
.credits-modal {
  max-width: 420px;
  width: 100%;
  background: linear-gradient(160deg, var(--glass-bg-strong), var(--glass-bg));
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 5vw, 40px);
  box-shadow: var(--shadow-soft);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.credits-cup { font-size: clamp(3rem, 8vw, 4.5rem); filter: drop-shadow(0 0 24px rgba(232,178,61,0.35)); }
.credits-actions { display: flex; flex-direction: column; gap: 12px; width: 100%; margin-top: 8px; }

.ad-progress-wrap, .ad-progress { width: 100%; }
.ad-progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,246,230,0.1);
  overflow: hidden;
}
.ad-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  box-shadow: 0 0 12px rgba(232,178,61,0.6);
  transition: width .1s linear;
}

/* ===================== نتيجة الجولة ===================== */
[data-screen="result"] { align-items: center; justify-content: center; position: relative; overflow: hidden; }
.result-wrap {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 480px;
  width: 100%;
  position: relative;
  z-index: 2;
}
.result-cup {
  font-size: clamp(3.5rem, 9vw, 5.5rem);
  filter: drop-shadow(0 0 40px rgba(232,178,61,0.5));
  animation: trophyPop .6s cubic-bezier(.34,1.56,.64,1);
}
@keyframes trophyPop {
  0% { transform: scale(0) rotate(-20deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.winner-name {
  font-size: clamp(1.6rem, 4.4vw, 2.6rem);
  font-weight: 900;
  color: var(--gold-bright);
  background: linear-gradient(160deg, rgba(232,178,61,0.2), rgba(154,90,30,0.1));
  border: 1px solid var(--glass-border);
  padding: 10px 28px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glow-gold);
}
.winner-name.bounce-in { animation: winnerBounce .5s .15s backwards cubic-bezier(.34,1.56,.64,1); }
@keyframes winnerBounce {
  0% { opacity: 0; transform: scale(0.6) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.final-scores {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.final-score-row {
  display: flex;
  justify-content: space-between;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-weight: 700;
  color: var(--text-light);
}
.result-actions { display: flex; flex-direction: column; gap: 12px; width: 100%; margin-top: 8px; }

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 16px;
  opacity: 0.9;
  z-index: 1;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(540deg); opacity: 0.2; }
}

/* ===================== الإعدادات ===================== */
.switch { position: relative; display: inline-block; width: 52px; height: 30px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: rgba(255,246,230,0.15);
  border-radius: 999px;
  transition: .2s;
  border: 1px solid var(--glass-border);
}
.switch-slider::before {
  content: ""; position: absolute; height: 22px; width: 22px;
  right: 3px; bottom: 3px;
  background: var(--cream-soft); border-radius: 50%; transition: .2s;
}
.switch input:checked + .switch-slider { background: linear-gradient(160deg, var(--gold-bright), var(--gold)); }
.switch input:checked + .switch-slider::before { transform: translateX(-22px); }

.lang-select {
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 2px solid var(--glass-border);
  background: var(--glass-bg);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-light);
  font-family: var(--font-display);
}
.lang-select option { color: var(--text-dark); }

/* ===================== توست ===================== */
.toast {
  position: fixed;
  bottom: clamp(16px, 4vh, 32px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(160deg, var(--bg-mid), var(--void));
  border: 1px solid var(--glass-border);
  color: var(--text-light);
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: clamp(0.85rem, 1.6vw, 1rem);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 999;
  max-width: 90vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===================== نقاط الفصل حسب الجهاز ===================== */

/* أجهزة لوحية */
@media (min-width: 640px) {
  .home-actions { max-width: 460px; }
  .credits-modal, .result-wrap { max-width: 520px; }
}

/* شاشات كبيرة / تلفزيون / سطح مكتب */
@media (min-width: 1024px) {
  .app-shell { max-width: var(--max-tv-width); }
  .screen { padding: clamp(24px, 3vw, 48px) clamp(40px, 6vw, 90px); }
  .home-actions { max-width: 420px; }
  .pour-btn { width: 260px; height: 260px; }
}

@media (min-width: 1600px) {
  html { font-size: 20px; }
  .app-shell { max-width: 1400px; }
}

/* شاشات قصيرة (لاندسكيب موبايل) */
@media (max-height: 480px) and (orientation: landscape) {
  .brand { margin-top: 8px; }
  .brand-cup { font-size: 2.4rem; }
  .home-actions { flex-direction: row; flex-wrap: wrap; }
}

/* تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
  .brand-cup, .pour-btn, .result-cup { animation: none; }
  .screen { animation: none; }
  .confetti-piece { display: none; }
  .dallah-fill { animation: none; }
  .dallah-item.score-bump, .dallah-item.score-bump-negative,
  .challenge-card.card-enter,
  .choice-item.selected, .choice-item.correct, .choice-item.wrong,
  .pour-btn.pouring .pour-icon, .pour-btn.pouring .pour-drop,
  .winner-name.bounce-in,
  .timer-start-wrap .btn {
    animation: none;
  }
}
