:root {
  --navy: #0b1220;
  --cyan: #c4a35a;
  --cyan-dim: #8f7438;
  --gold: #c9a227;
  --gold-2: #ead7a2;
  --orange: #d4893a;
  --green: #3cb86a;
  --red: #c44545;
  --text: #f4efe4;
  --muted: #b9b09c;
  --board-max: 1320px;
  --ladder-w: 180px;
  --life-size: 74px;
  --q-min-h: 84px;
  --answer-min-h: 56px;
  --game-pad-x: 16px;
  --safe-top: max(12px, env(safe-area-inset-top, 0px));
  --safe-bottom: max(16px, env(safe-area-inset-bottom, 0px));
}

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

html, body {
  min-height: 100%;
  color: var(--text);
  font-family: "Tajawal", Tahoma, Arial, sans-serif;
  background: #07080c;
}

body { overflow-x: hidden; }

#app {
  position: relative;
  z-index: 1;
}

.studio-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 70% at 50% 40%, #1a2740 0%, #0b1220 48%, #07080c 100%);
  pointer-events: none;
}

.studio-bg::before,
.studio-bg::after {
  content: "";
  position: absolute;
  inset: -10% -5%;
  background:
    repeating-linear-gradient(
      -28deg,
      transparent 0 46px,
      rgba(196, 163, 90, 0.05) 47px,
      transparent 90px
    );
  mask-image: radial-gradient(ellipse 70% 80% at 18% 55%, #000 20%, transparent 72%);
}

.studio-bg::after {
  transform: scaleX(-1);
  opacity: 0.55;
  mask-image: radial-gradient(ellipse 60% 70% at 82% 40%, #000 10%, transparent 68%);
}

.sound-dock {
  --pct: 80%;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 16px 5px 5px;
  min-width: 268px;
  background:
    radial-gradient(circle at 18% 30%, rgba(26, 61, 108, 0.55), transparent 42%),
    linear-gradient(180deg, #102038 0%, #071018 100%);
  border: 2.5px solid #c4a35a;
  border-radius: 999px;
  box-shadow:
    inset 0 0 0 3px #081018,
    inset 0 0 0 4.5px #8f7438,
    0 0 22px rgba(196, 163, 90, 0.28),
    0 10px 28px rgba(0, 0, 0, 0.45);
  font-family: "Tajawal", Tahoma, Arial, sans-serif;
}

.sound-mute {
  position: relative;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #ead7a2;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.sound-mute .life-disc {
  width: 100%;
  height: 100%;
  position: relative;
}

.sound-mute-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  pointer-events: none;
}

.sound-mute svg {
  width: 22px;
  height: 22px;
  display: block;
  z-index: 1;
}

.sound-mute:hover .life-disc {
  border-color: #ead7a2;
  transform: scale(1.06);
}

.sound-dock:not(.muted) .sound-mute-ring {
  animation: soundPulse 2.4s ease-out infinite;
}

.sound-dock.muted .sound-mute {
  color: #ff8a94;
}

.sound-dock.muted .sound-mute .life-disc {
  border-color: #c44545;
  box-shadow:
    inset 0 0 0 3px #081018,
    inset 0 0 0 4.5px #8a3030;
}

.sound-dock.muted .sound-mute-ring {
  animation: none;
}

@keyframes soundPulse {
  0% { box-shadow: 0 0 0 0 rgba(196, 163, 90, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(196, 163, 90, 0); }
  100% { box-shadow: 0 0 0 0 rgba(196, 163, 90, 0); }
}

.sound-body { flex: 1; min-width: 0; padding: 2px 2px 0 0; }

.sound-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.sound-kicker {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--gold-2);
  letter-spacing: 0.04em;
}

#vol-pct {
  font-size: 0.82rem;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  min-width: 2.8em;
  text-align: right;
}

.sound-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sound-step {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 1.5px solid #8f7438;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #1a3d6c, #071428 70%);
  color: #ead7a2;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: inset 0 0 0 2px #081018;
}

.sound-step:hover {
  border-color: #ead7a2;
  color: #fff;
  box-shadow: inset 0 0 0 2px #081018, 0 0 10px rgba(196, 163, 90, 0.4);
}

.sound-track { flex: 1; min-width: 0; }

.sound-slider {
  width: 100%;
  height: 7px;
  appearance: none;
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  background:
    linear-gradient(#081018, #081018) padding-box,
    linear-gradient(to right, #ead7a2 0 var(--pct), rgba(196, 163, 90, 0.18) var(--pct)) border-box;
  border: 1px solid #8f7438;
  box-shadow: 0 0 10px rgba(196, 163, 90, 0.2) inset;
}

.sound-slider::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6d4, #c9a227);
  border: 2px solid #081018;
  box-shadow: 0 0 0 1px #8f7438, 0 0 10px rgba(196, 163, 90, 0.7);
}

.sound-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid #081018;
  border-radius: 50%;
  background: #c9a227;
}

.sound-eq {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2px;
  height: 11px;
  margin-top: 5px;
}

.sound-eq i {
  display: block;
  flex: 1;
  height: 22%;
  border-radius: 1px;
  background: rgba(196, 163, 90, 0.16);
  transform-origin: bottom;
  transition: height 0.15s ease, background 0.15s ease;
}

.sound-eq i.on {
  background: linear-gradient(180deg, #ead7a2, #c4a35a);
  box-shadow: 0 0 5px rgba(196, 163, 90, 0.55);
}

.sound-eq i:nth-child(1).on { height: 35%; }
.sound-eq i:nth-child(2).on { height: 55%; }
.sound-eq i:nth-child(3).on { height: 70%; }
.sound-eq i:nth-child(4).on { height: 100%; }
.sound-eq i:nth-child(5).on { height: 78%; }
.sound-eq i:nth-child(6).on { height: 92%; }
.sound-eq i:nth-child(7).on { height: 60%; }
.sound-eq i:nth-child(8).on { height: 42%; }

.sound-dock:not(.muted) .sound-eq i.on {
  animation: eqBeat 1.1s ease-in-out infinite;
}
.sound-eq i:nth-child(2).on { animation-delay: 0.08s; }
.sound-eq i:nth-child(3).on { animation-delay: 0.16s; }
.sound-eq i:nth-child(4).on { animation-delay: 0.05s; }
.sound-eq i:nth-child(5).on { animation-delay: 0.2s; }
.sound-eq i:nth-child(6).on { animation-delay: 0.12s; }
.sound-eq i:nth-child(7).on { animation-delay: 0.18s; }
.sound-eq i:nth-child(8).on { animation-delay: 0.1s; }

@keyframes eqBeat {
  0%, 100% { filter: brightness(1); transform: scaleY(1); }
  50% { filter: brightness(1.35); transform: scaleY(0.72); }
}

.sound-dock.muted .sound-slider {
  border-color: #8a3030;
  background:
    linear-gradient(#081018, #081018) padding-box,
    linear-gradient(to right, #c44545 0 var(--pct), rgba(196, 69, 69, 0.16) var(--pct)) border-box;
}

.sound-dock.muted #vol-pct {
  color: #ff8a94;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.screen {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
}

.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 40px;
}

#screen-title {
  text-align: center;
  gap: 8px;
  padding-top: 96px;
}

.start-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 8px 0 4px;
}

.start-author {
  margin: 0;
  color: var(--gold);
  font-size: clamp(1.05rem, 2.8vw, 1.32rem);
  font-weight: 900;
  letter-spacing: 0.06em;
}

.start-made {
  margin: 0;
  color: var(--gold-2);
  font-size: clamp(1.05rem, 2.8vw, 1.35rem);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.channel-kick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
  padding: 14px 22px;
  border-radius: 18px;
  border: 1px solid rgba(83, 252, 24, 0.42);
  background: rgba(83, 252, 24, 0.1);
  color: #d8ffb8;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease, border-color 0.15s ease;
}

.channel-kick:hover {
  color: #eeffd8;
  border-color: rgba(83, 252, 24, 0.68);
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.channel-live {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border-radius: 50%;
  background: #53fc18;
  box-shadow: 0 0 12px rgba(83, 252, 24, 0.85);
  animation: channelPulse 1.4s ease-in-out infinite;
}

@keyframes channelPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

.channel-text {
  color: var(--text);
  font-size: clamp(0.95rem, 2.6vw, 1.35rem);
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.channel-on {
  color: #53fc18;
  font-weight: 800;
}

.start-credit {
  margin: 0;
  color: rgba(154, 168, 196, 0.82);
  font-size: clamp(1rem, 2.6vw, 1.28rem);
  letter-spacing: 0.04em;
}

.start-credit strong {
  color: var(--gold);
  font-weight: 900;
}

.logo-main {
  width: min(380px, 72vw);
  height: auto;
  filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.65));
}

#screen-title h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--gold-2);
  text-shadow: 0 0 18px rgba(232, 197, 71, 0.35);
}

.tagline, .hint { color: var(--muted); font-size: 0.95rem; }
.hint { margin-top: 8px; font-size: 0.82rem; }

.btn-gold, .btn-action {
  font-family: inherit;
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
}

.btn-gold {
  margin-top: 18px;
  color: #1a1404;
  border: 0;
  padding: 12px 36px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe58a, #d4a017);
  box-shadow: 0 0 0 2px #7a5a10, 0 8px 24px rgba(232, 197, 71, 0.35);
}

.btn-start {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 220px;
  padding: 16px 48px;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
}

.btn-start-en {
  font-family: Arial, sans-serif;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.btn-start-ar {
  font-size: 0.95rem;
  letter-spacing: 0;
  font-weight: 800;
}

.btn-gold:disabled {
  opacity: 0.38;
  cursor: default;
  box-shadow: none;
}

.btn-gold:not(:disabled):hover { filter: brightness(1.08); }

.actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  justify-content: center;
  gap: 6px 12px;
  width: min(100%, 620px);
  margin: 18px auto 0;
  padding: 12px 0 2px;
  border-top: 1px solid rgba(196, 163, 90, 0.32);
  background: linear-gradient(180deg, rgba(196, 163, 90, 0.07), transparent 72%);
}

.btn-action {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  min-height: 54px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-action .lz-stroke,
.btn-action .lz-ray {
  stroke-width: 4.5;
}

.btn-action-text {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 78%;
  font-size: clamp(0.92rem, 1.5vw, 1.08rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
}

.btn-ico {
  width: 1.05em;
  height: 1.05em;
  flex: 0 0 auto;
  display: block;
}

.btn-action-primary {
  color: #1a1404;
}

.btn-action-primary .lz-fill {
  fill: #e8c547;
}

.btn-action-primary .lz-stroke,
.btn-action-primary .lz-ray {
  stroke: #8a6410;
}

.btn-action-primary:not(:disabled):hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-action-primary:not(:disabled):hover .lz-fill {
  fill: #f4d66a;
}

.btn-action-primary:disabled {
  color: #8a96a8;
  cursor: default;
  opacity: 1;
  filter: none;
  transform: none;
}

.btn-action-primary:disabled .lz-fill {
  fill: rgba(12, 22, 38, 0.88);
}

.btn-action-primary:disabled .lz-stroke,
.btn-action-primary:disabled .lz-ray {
  stroke: rgba(196, 163, 90, 0.32);
}

.btn-action-secondary {
  color: #f0d4b4;
}

.btn-action-secondary .lz-fill {
  fill: #24160f;
}

.btn-action-secondary .lz-stroke,
.btn-action-secondary .lz-ray {
  stroke: #c4894a;
}

.btn-action-secondary:hover {
  color: #fff6ea;
  transform: translateY(-1px);
}

.btn-action-secondary:hover .lz-fill {
  fill: #3a2418;
}

.btn-action-secondary:hover .lz-stroke,
.btn-action-secondary:hover .lz-ray {
  stroke: #ead7a2;
}

.btn-action-secondary:active,
.btn-action-primary:not(:disabled):active {
  transform: translateY(0);
}

/* —— Game layout (classic Millionaire) —— */
#screen-game.active {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  position: relative;
  width: 100%;
  padding: 0 0 var(--safe-bottom);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

.lifelines {
  position: absolute;
  top: var(--safe-top);
  left: 50%;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 22px;
  padding: 8px 16px;
  transform: translateX(-50%);
}

.life {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: auto;
  min-width: var(--life-size);
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  flex: 0 0 auto;
}

.life-shell {
  position: relative;
  width: var(--life-size);
  height: var(--life-size);
  flex: 0 0 var(--life-size);
}

.life-glow {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(234, 215, 162, 0.9);
  opacity: 0;
  pointer-events: none;
}

.life-glow-delay {
  animation-delay: 0.45s;
}

.life.active .life-glow {
  animation: lifePulse 1.25s ease-out infinite;
}

.life.active .life-disc {
  border-color: #ead7a2;
  box-shadow:
    inset 0 0 0 3px #081018,
    inset 0 0 0 4.5px #8f7438,
    0 0 0 2px rgba(234, 215, 162, 0.55),
    0 0 22px rgba(232, 197, 71, 0.65);
}

.life.active .life-label {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(232, 197, 71, 0.45);
}

@keyframes lifePulse {
  0% {
    transform: scale(0.88);
    opacity: 0.95;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

.life-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--gold-2);
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

.game-main {
  display: grid;
  grid-template-columns: var(--ladder-w) minmax(0, 1fr);
  grid-template-rows: auto auto;
  width: 100%;
  align-items: end;
  padding-top: 128px;
  flex-shrink: 0;
}

.ladder-col {
  position: absolute;
  top: clamp(112px, 14vh, 150px);
  right: 0;
  z-index: 4;
  grid-column: 1;
  grid-row: 2;
  width: var(--ladder-w);
  padding: 0 10px 18px 6px;
  align-self: end;
  max-height: calc(100dvh - 180px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(196, 163, 90, 0.45) transparent;
}

.stage {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: min(1100px, calc(100% - var(--ladder-w) - var(--ladder-w)));
  margin-inline: auto;
  padding: 0 12px 18px 8px;
  min-width: 0;
  overflow: visible;
}

.q-lozenge {
  grid-column: 1 / -1;
  grid-row: 1;
  position: relative;
  width: 100%;
  min-height: var(--q-min-h);
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.q-lozenge .lozenge-label {
  position: relative;
  z-index: 1;
  width: min(68vw, 1040px);
  max-width: 72%;
  box-sizing: border-box;
  padding: 14px 20px;
  text-align: center;
  font-size: clamp(1.1rem, 1.8vw, 1.65rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.4;
  overflow-wrap: break-word;
  word-wrap: break-word;
  pointer-events: none;
}

.life-disc {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #1a3d6c, #071428 64%);
  border: 2.5px solid #c4a35a;
  box-shadow:
    inset 0 0 0 3px #081018,
    inset 0 0 0 4.5px #8f7438;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.life-disc svg {
  width: 54%;
  height: 54%;
  display: block;
}

.icon-fifty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #fff;
  font-family: "Tajawal", Arial, sans-serif;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  line-height: 1;
}

.icon-fifty b { font-weight: 800; }

.icon-fifty i {
  width: 2px;
  height: 22px;
  background: #c4a35a;
  border-radius: 2px;
}

.life:hover:not(.used) .life-disc {
  border-color: #ead7a2;
  transform: scale(1.06);
}

.host-wrap {
  position: absolute;
  left: 50%;
  top: 36%;
  z-index: 8;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.start-intro-host {
  position: absolute;
  left: 50%;
  top: 54%;
  z-index: 8;
  transform: translate(-50%, -50%);
  margin: 0;
  gap: 4px;
  pointer-events: auto;
}

.start-intro-host .start-author {
  font-size: clamp(0.72rem, 1.8vw, 0.88rem);
}

.start-intro-host .start-credit {
  font-size: clamp(0.68rem, 1.6vw, 0.82rem);
}

.start-intro-host .channel-kick {
  padding: 6px 12px;
  border-radius: 999px;
  gap: 8px;
}

.start-intro-host .channel-live {
  width: 7px;
  height: 7px;
  flex-basis: 7px;
}

.start-intro-host .channel-text {
  font-size: clamp(0.68rem, 1.7vw, 0.82rem);
}

.samir-help {
  position: absolute;
  left: max(10px, env(safe-area-inset-left, 0px));
  top: 50%;
  z-index: 7;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: auto;
  min-width: 88px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.samir-shell {
  width: clamp(72px, 11vw, 96px);
  height: clamp(72px, 11vw, 96px);
  flex: 0 0 auto;
}

.samir-disc {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.samir-label {
  max-width: 92px;
  font-size: 0.62rem;
  line-height: 1.25;
  white-space: normal;
}

.life.active .samir-disc {
  filter:
    drop-shadow(0 0 0 2px rgba(234, 215, 162, 0.55))
    drop-shadow(0 0 22px rgba(232, 197, 71, 0.65));
}

.samir-help.used {
  opacity: 0.32;
  filter: grayscale(1);
  pointer-events: none;
}

.samir-help.used .samir-label {
  opacity: 1;
}

.host {
  position: relative;
  width: clamp(140px, 20vw, 220px);
  height: clamp(140px, 20vw, 220px);
}

.host-disc {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.host-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid rgba(234, 215, 162, 0.85);
  opacity: 0;
  pointer-events: none;
}

.host.speaking .host-disc {
  filter: drop-shadow(0 0 16px rgba(232, 197, 71, 0.75));
}

.host.speaking .host-ring {
  animation: hostSpeak 1.35s ease-out infinite;
}

.host.speaking .host-ring-delay {
  animation-delay: 0.45s;
}

@keyframes hostSpeak {
  0% {
    transform: scale(0.92);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.32);
    opacity: 0;
  }
}

.life.used {
  opacity: 0.32;
  filter: grayscale(1);
  pointer-events: none;
}

.life.used .life-label {
  opacity: 1;
}

#ladder {
  list-style: none;
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
}

#ladder li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold-2);
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

#ladder li .n {
  width: 1.4em;
  text-align: center;
  opacity: 0.9;
}

#ladder li:nth-child(-n+5) { color: var(--orange); }
#ladder li.safe { color: var(--gold); }
#ladder li.done { opacity: 0.55; }

#ladder li.now {
  background: #c9a227;
  color: #1a1404;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(245, 208, 0, 0.45);
}

#ladder li.now .n {
  position: relative;
}

#ladder li.now .n::before {
  content: "";
  position: absolute;
  right: calc(100% + 6px);
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%);
  box-shadow: 0 0 6px #fff;
}

.lozenge-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: none;
  pointer-events: none;
}

.lz-fill {
  fill: rgba(6, 20, 42, 0.82);
  stroke: none;
}

.lz-stroke,
.lz-ray {
  fill: none;
  stroke: #c4a35a;
  stroke-width: 5.5;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: miter;
  stroke-linecap: round;
}

.answers-wrap {
  position: relative;
  margin-top: 4px;
  width: 100%;
}

.dollar {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: clamp(30px, 4vw, 38px);
  height: clamp(30px, 4vw, 38px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  color: #7a4e00;
  background: radial-gradient(circle at 35% 30%, #ffe9a0, #e0b13a 46%, #9a6b10);
  box-shadow: 0 2px 0 #5a3b00, 0 0 14px rgba(240, 210, 74, 0.55);
  pointer-events: none;
}

.answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(4px, 1vw, 8px);
  row-gap: clamp(6px, 1.2vw, 10px);
}

.answer {
  position: relative;
  display: grid;
  place-items: center;
  font-family: inherit;
  color: var(--text);
  background: transparent;
  border: 0;
  padding: 0;
  font-size: clamp(0.92rem, 1.2vw + 0.45rem, 1.08rem);
  font-weight: 700;
  cursor: pointer;
  min-height: var(--answer-min-h);
  direction: rtl;
  min-width: 0;
}

.answer .lozenge-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.4em;
  width: 88%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px 14%;
  pointer-events: none;
  direction: rtl;
  unicode-bidi: isolate;
}

.answer .letter {
  color: var(--cyan);
  font-weight: 800;
  flex: 0 0 auto;
  unicode-bidi: isolate;
}

.answer .dot {
  color: var(--cyan);
  font-weight: 800;
  flex: 0 0 auto;
  direction: ltr;
  unicode-bidi: isolate;
  line-height: 1;
}

.answer .text {
  flex: 1 1 auto;
  min-width: 0;
  direction: rtl;
  unicode-bidi: plaintext;
  text-align: start;
  overflow-wrap: break-word;
  word-wrap: break-word;
  line-height: 1.35;
}

.answer:nth-child(odd) .lozenge-label { justify-content: flex-start; }
.answer:nth-child(even) .lozenge-label { justify-content: flex-end; }

.answer:hover:not(:disabled) .lz-stroke,
.answer:hover:not(:disabled) .lz-ray {
  stroke: #ead7a2;
}

.answer.selected .lz-fill { fill: #f0b429; }
.answer.selected { color: #1a1404; }
.answer.selected .letter,
.answer.selected .dot { color: #3b2200; }

.answer.correct .lz-fill { fill: #3cb86a; }
.answer.correct { color: #04210e; }
.answer.correct .letter,
.answer.correct .dot { color: #04210e; }

.answer.wrong .lz-fill { fill: #d02432; }

.answer.hidden {
  visibility: hidden;
  pointer-events: none;
}

.answer:disabled { cursor: default; }

#screen-end h2 {
  color: var(--gold-2);
  font-size: 2rem;
  margin: 10px 0;
}

.logo-small { width: 148px; height: auto; }

.end-amount {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(232, 197, 71, 0.4);
}

.end-msg { color: var(--muted); margin-top: 6px; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  display: grid;
  place-items: center;
  z-index: 20;
  padding: 16px;
}

.modal[hidden] { display: none; }

.modal-card {
  width: min(440px, 94vw);
  background: linear-gradient(180deg, #0b2a55, #061428);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 24px rgba(196, 163, 90, 0.35);
  border-radius: 16px;
  padding: 22px 20px 18px;
  text-align: center;
}

.modal-card h3 {
  color: var(--cyan);
  margin-bottom: 12px;
}

.poll {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  height: 168px;
  margin: 12px 0 6px;
}

.poll .bar-wrap { width: 52px; text-align: center; }

.poll .bar {
  background: linear-gradient(180deg, #ead7a2, var(--cyan) 55%, #0b6e86);
  border-radius: 6px 6px 0 0;
  margin: 0 auto 6px;
  width: 28px;
  min-height: 8px;
  transition: height 0.12s ease-out;
  box-shadow: 0 0 10px rgba(196, 163, 90, 0.25);
}

.poll-live .bar {
  transition: height 0.08s linear;
}

.poll-done .bar {
  box-shadow: 0 0 14px rgba(232, 197, 71, 0.45);
}

.poll .pct {
  font-size: 0.85rem;
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  margin-bottom: 4px;
}

.poll .lab { color: var(--muted); font-weight: 700; }

.poll-status {
  color: var(--gold-2);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  min-height: 1.2em;
}

.poll-status.is-done { color: var(--gold); }
.phone-line { font-size: 1.15rem; line-height: 1.8; }

/* —— Tablet —— */
@media (max-width: 1100px) {
  :root {
    --ladder-w: 148px;
  }

  #ladder li {
    font-size: 0.78rem;
    padding: 3px 5px;
  }
}

/* —— Mobile & narrow —— */
@media (max-width: 860px) {
  :root {
    --life-size: 58px;
    --q-min-h: 72px;
  }

  .lifelines {
    top: var(--safe-top);
    padding: 6px 10px;
    gap: 8px;
  }

  .life-label {
    font-size: 0.58rem;
  }

  .host-wrap { top: 28%; }
  .start-intro-host { top: 46%; }
  .host {
    width: 108px;
    height: 108px;
  }

  .samir-help {
    top: 42%;
    left: max(6px, env(safe-area-inset-left, 0px));
  }

  .samir-shell {
    width: 64px;
    height: 64px;
  }

  .samir-label {
    max-width: 72px;
    font-size: 0.52rem;
  }

  .game-main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    align-content: end;
    min-width: 0;
    max-width: 100%;
    min-height: calc(100dvh - var(--safe-bottom));
    padding-top: 82px;
    overflow-x: clip;
  }

  .ladder-col {
    position: static;
    top: auto;
    right: auto;
    z-index: auto;
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    padding: 0 8px 6px;
    max-height: none;
    overflow: visible;
  }

  .stage {
    grid-column: 1;
    grid-row: 3;
    width: 100%;
    margin-inline: 0;
    padding: 0 10px 14px;
  }

  .q-lozenge .lozenge-label {
    width: 72vw;
    max-width: 78%;
    min-width: 0;
    font-size: clamp(0.98rem, 4vw, 1.2rem);
    padding: 12px 14px;
  }

  #ladder {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 4px;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  #ladder::-webkit-scrollbar { display: none; }

  #ladder li {
    flex: 0 0 auto;
    font-size: 0.75rem;
    padding: 5px 10px;
    scroll-snap-align: center;
    white-space: nowrap;
  }

  #ladder li .n { display: none; }
  #ladder li.now .n::before { display: none; }

  .answers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 4px;
  }
  .dollar { display: none; }

  .answer .lozenge-label {
    width: 94%;
    padding: 10px 9%;
  }
  .answer:nth-child(odd) .lozenge-label,
  .answer:nth-child(even) .lozenge-label { justify-content: flex-start; }

  .actions {
    gap: 4px 6px;
    margin-top: 10px;
    padding-top: 10px;
  }

  .btn-action {
    min-height: 48px;
  }

  .btn-action-text {
    gap: 5px;
    font-size: 0.86rem;
    max-width: 86%;
  }

  .sound-dock {
    top: max(8px, env(safe-area-inset-top, 0px));
    left: max(8px, env(safe-area-inset-left, 0px));
    min-width: 0;
    max-width: min(280px, calc(100% - 16px));
    padding: 4px 12px 4px 4px;
    gap: 8px;
  }

  .sound-mute { width: 42px; height: 42px; flex-basis: 42px; }
  #screen-title { padding-top: calc(76px + var(--safe-top)); }
}

/* —— Phones —— */
@media (max-width: 600px) {
  :root {
    --life-size: 52px;
    --q-min-h: 68px;
    --answer-min-h: 50px;
  }

  #screen-game.active {
    overflow-y: auto;
  }

  .lifelines {
    gap: 6px;
    padding: 4px 8px;
  }

  .life-label {
    font-size: 0.52rem;
  }

  .host-wrap { top: 24%; }
  .start-intro-host { top: 42%; }
  .host {
    width: 88px;
    height: 88px;
  }

  .samir-help {
    top: 38%;
  }

  .samir-shell {
    width: 56px;
    height: 56px;
  }

  .game-main {
    min-height: calc(100dvh - var(--safe-bottom));
    padding-top: 68px;
  }

  .q-lozenge {
    margin-bottom: 5px;
  }

  .q-lozenge .lozenge-label {
    width: 72vw;
    max-width: 78%;
    padding: 10px 8px;
    font-size: clamp(0.9rem, 4.3vw, 1.08rem);
    line-height: 1.35;
  }

  .ladder-col {
    padding-inline: 6px;
  }

  #ladder li {
    font-size: 0.7rem;
    padding: 4px 9px;
  }

  .stage {
    padding: 0 6px 8px;
  }

  .btn-ico { display: none; }
  .btn-action-text { font-size: 0.82rem; max-width: 88%; }

  .answers {
    grid-template-columns: 1fr;
    row-gap: 6px;
  }

  .answer {
    font-size: 0.94rem;
  }

  .answer .lozenge-label {
    width: 92%;
    padding: 8px 10%;
  }

  .sound-dock {
    width: var(--life-size);
    height: var(--life-size);
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .sound-mute {
    width: 100%;
    height: 100%;
    flex-basis: auto;
  }

  .sound-body {
    display: none;
  }
}

/* —— Small phones —— */
@media (max-width: 480px) {
  :root {
    --life-size: 50px;
    --answer-min-h: 50px;
  }

  .icon-fifty { font-size: 0.58rem; gap: 3px; }
  .icon-fifty i { height: 14px; }

  .q-lozenge .lozenge-label {
    font-size: clamp(0.9rem, 4.5vw, 1.1rem);
    line-height: 1.4;
  }

  .answer { font-size: 0.92rem; }

  .btn-action-text { font-size: 0.8rem; }
  .btn-ico { display: none; }

  .logo-main { width: min(300px, 82vw); }
}

/* —— Short viewport (landscape / small height) —— */
@media (max-height: 720px) {
  :root {
    --life-size: 50px;
    --q-min-h: 62px;
    --answer-min-h: 48px;
  }

  .lifelines {
    padding: 4px 10px;
  }

  .game-main { padding-top: 70px; }
  .host-wrap { top: 26%; }
  .start-intro-host { top: 44%; }
  .host {
    width: 86px;
    height: 86px;
  }
  .actions { margin-top: 10px; }
}

@media (max-width: 900px) and (orientation: landscape) {
  .game-main {
    grid-template-columns: 130px minmax(0, 1fr);
    grid-template-rows: auto auto;
    padding-top: 68px;
  }

  .ladder-col {
    position: static;
    grid-column: 1;
    grid-row: 2;
    padding-bottom: 10px;
    max-height: 42vh;
  }

  .stage {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    margin-inline: 0;
  }

  #ladder {
    flex-direction: column-reverse;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 42vh;
  }

  #ladder li .n { display: inline; }
  .answers { grid-template-columns: 1fr 1fr; }
  .dollar { display: grid; }
  .actions { margin-top: 8px; padding-top: 8px; }
  .btn-action { min-height: 44px; }
}

/* —— Large screens —— */
@media (min-width: 1600px) {
  .q-lozenge .lozenge-label {
    width: min(68vw, 1100px);
    font-size: 1.7rem;
  }
}
