/* عجلة الحظ — واجهة لعب تحنَّك */
:root {
  --bg-deep: #1a0a2e;
  --bg-mid: #22103a;
  --card: #2d1a4a;
  --card2: #381f58;
  --purple: #7c3aed;
  --purple-light: #a855f7;
  --purple-glow: rgba(124, 58, 237, 0.45);
  --gold: #f0b429;
  --gold-light: #ffe9a8;
  --orange: #f59e0b;
  --text: #fff8e7;
  --muted: #a78bca;
  --border: rgba(124, 58, 237, 0.35);
  --border-gold: rgba(251, 191, 36, 0.45);
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.42);
  --lw-side-col: clamp(200px, 16vw, 320px);
  --lw-main-gap: clamp(8px, 1.1vw, 12px);
  --lw-shell-pad-inline: max(
    8px,
    env(safe-area-inset-left, 0px),
    env(safe-area-inset-right, 0px)
  );
}

*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
  overflow: hidden;
}

html, body.lw-body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: 'Cairo', sans-serif;
  color: var(--text);
  background: var(--bg-deep);
}

/* صفحة لعب مستقلة — لا هيدر غلاف الموقع ولا padding-top العام */
body.lw-body {
  padding-top: 0 !important;
}

body.lw-body .header-banner {
  display: none !important;
}

/* —— خلفية استودio: عمق وحركة بصرية (ثابتة، بدون أنيميشن) —— */
.lw-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: var(--bg-deep);
}

.lw-bg__canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 100% 48% at 50% -5%, rgba(255, 233, 168, 0.2), transparent 58%),
    radial-gradient(ellipse 90% 52% at 50% 105%, rgba(124, 58, 237, 0.28), transparent 62%),
    radial-gradient(ellipse 55% 45% at 18% 62%, rgba(168, 85, 247, 0.18), transparent 70%),
    radial-gradient(ellipse 50% 42% at 82% 58%, rgba(245, 158, 11, 0.12), transparent 68%),
    radial-gradient(ellipse 78% 62% at 50% 48%, rgba(45, 26, 74, 0.45) 0%, transparent 70%),
    linear-gradient(
      155deg,
      #1a0a2e 0%,
      #241240 24%,
      #2d1850 48%,
      #261445 72%,
      #1a0a2e 100%
    );
}

.lw-bg__mesh {
  position: absolute;
  inset: -15%;
  z-index: 2;
  opacity: 0.88;
  filter: blur(52px);
  background:
    radial-gradient(circle at 22% 28%, rgba(168, 85, 247, 0.42) 0%, transparent 48%),
    radial-gradient(circle at 78% 32%, rgba(251, 191, 36, 0.22) 0%, transparent 46%),
    radial-gradient(circle at 62% 78%, rgba(124, 58, 237, 0.32) 0%, transparent 44%),
    radial-gradient(circle at 35% 72%, rgba(255, 233, 168, 0.14) 0%, transparent 42%);
}

.lw-bg__wheel-print {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 52%;
  width: min(145vmax, 1750px);
  height: min(145vmax, 1750px);
  transform: translate(-50%, -50%);
  opacity: 0.42;
  background: repeating-radial-gradient(
    circle at center,
    transparent 0,
    transparent 34px,
    rgba(255, 233, 168, 0.09) 35px,
    transparent 36px,
    transparent 68px,
    rgba(168, 85, 247, 0.11) 69px,
    transparent 70px
  );
  mask-image: radial-gradient(circle, #000 0%, #000 40%, transparent 72%);
}

.lw-bg__wheel-print::after {
  content: '';
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  border: 1px solid rgba(255, 233, 168, 0.14);
  box-shadow:
    0 0 0 1px rgba(124, 58, 237, 0.12),
    inset 0 0 48px rgba(124, 58, 237, 0.08);
}

.lw-bg__rays {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: -18%;
  width: min(160vmax, 2000px);
  height: min(160vmax, 2000px);
  transform: translateX(-50%);
  opacity: 0.14;
  background: repeating-conic-gradient(
    from -90deg at 50% 50%,
    rgba(255, 233, 168, 0.55) 0deg 7deg,
    transparent 7deg 14deg
  );
  mask-image: radial-gradient(circle, #000 0%, #000 32%, transparent 58%);
}

.lw-bg__flow {
  position: absolute;
  z-index: 5;
  inset: -10%;
  opacity: 0.07;
  transform: rotate(-8deg);
  background:
    repeating-linear-gradient(
      112deg,
      transparent 0,
      transparent 56px,
      rgba(255, 233, 168, 0.85) 56px,
      rgba(255, 233, 168, 0.85) 57px
    ),
    repeating-linear-gradient(
      112deg,
      transparent 0,
      transparent 112px,
      rgba(168, 85, 247, 0.45) 112px,
      rgba(168, 85, 247, 0.45) 113px
    );
  mask-image: radial-gradient(ellipse 88% 78% at 50% 46%, #000 18%, transparent 76%);
}

.lw-bg__glow {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 50%;
  width: min(80vw, 860px);
  height: min(60vh, 560px);
  transform: translate(-50%, -46%);
  background:
    radial-gradient(
      ellipse 100% 100% at 50% 48%,
      rgba(255, 255, 255, 0.06) 0%,
      rgba(124, 58, 237, 0.22) 28%,
      rgba(240, 180, 41, 0.1) 48%,
      transparent 70%
    );
}

.lw-bg__sheen {
  position: absolute;
  z-index: 7;
  inset: 0;
  background:
    linear-gradient(
      125deg,
      transparent 0%,
      rgba(255, 255, 255, 0.04) 42%,
      transparent 58%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.08) 0%,
      rgba(255, 233, 168, 0.05) 10%,
      transparent 40%
    );
  mask-image: radial-gradient(ellipse 80% 58% at 50% 0%, #000 0%, transparent 74%);
}

.lw-bg__frame {
  position: absolute;
  z-index: 8;
  inset: 0;
  background:
    radial-gradient(ellipse 96% 90% at 50% 48%, transparent 42%, rgba(12, 4, 22, 0.5) 100%),
    linear-gradient(180deg, rgba(12, 4, 22, 0.2) 0%, transparent 14%, transparent 84%, rgba(12, 4, 22, 0.26) 100%);
}

.lw-bg__frame::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.045;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.55) 0.6px, transparent 1.2px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 92% 85% at 50% 48%, #000 25%, transparent 78%);
}

.lw-bg__frame::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.04;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

@media (max-width: 960px) {
  .lw-bg__wheel-print,
  .lw-bg__rays {
    opacity: 0.28;
  }

  .lw-bg__flow {
    opacity: 0.05;
  }
}


.lw-shell {
  position: relative;
  z-index: 1;
  height: 100dvh;
  max-height: 100dvh;
  width: 100%;
  max-width: none;
  margin-inline: auto;
  padding: 0 max(8px, env(safe-area-inset-right))
    max(14px, env(safe-area-inset-bottom, 14px)) max(8px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  justify-content: flex-start;
}

/* —— Header: فرق + شعار —— */
.lw-hd {
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  direction: ltr;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.2vw, 14px);
  padding:
    max(12px, calc(8px + env(safe-area-inset-top, 0px)))
    max(96px, calc(10px + env(safe-area-inset-right, 0px)))
    max(14px, 12px)
    max(44px, calc(10px + env(safe-area-inset-left, 0px)));
  margin: 0;
  overflow: visible;
  isolation: isolate;
  background: none;
  border: none;
  box-shadow: none;
}

.lw-hd__exit {
  position: absolute;
  right: max(0px, env(safe-area-inset-right, 0px));
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  direction: rtl;
  min-height: 40px;
  padding: 8px 16px 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.42);
  background: linear-gradient(180deg, rgba(56, 31, 88, 0.95), rgba(18, 8, 32, 0.92));
  color: var(--gold-light);
  font: inherit;
  font-weight: 900;
  font-size: clamp(0.82rem, 1.8vw, 0.92rem);
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.lw-hd__exit-text {
  line-height: 1;
}

.lw-hd__exit i {
  font-size: 0.88em;
  opacity: 0.92;
}

.lw-hd__exit:hover,
.lw-hd__exit:focus-visible {
  border-color: rgba(255, 233, 168, 0.65);
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.55), rgba(45, 26, 74, 0.95));
  box-shadow:
    0 6px 18px rgba(124, 58, 237, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  outline: none;
}

.lw-hd__exit:active {
  transform: translateY(-50%) scale(0.98);
}

.lw-hd__flank {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.lw-hd__flank--start {
  justify-content: flex-start;
}

.lw-hd__flank--end {
  justify-content: flex-end;
}

.lw-hd__core {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: min(calc(100vw - 200px), 480px);
  direction: rtl;
  pointer-events: none;
  z-index: 2;
}

.lw-hd__core .lw-hd__brand {
  pointer-events: auto;
}

.lw-hd__brand {
  display: inline-flex;
  align-items: center;
  gap: clamp(16px, 2.8vw, 26px);
  padding: 4px 0;
  text-decoration: none;
  color: inherit;
  background: none;
  border: none;
  box-shadow: none;
  direction: rtl;
}

.lw-hd__logo-wrap {
  position: relative;
  flex-shrink: 0;
  width: clamp(56px, 9.5vmin, 76px);
  height: clamp(56px, 9.5vmin, 76px);
  display: grid;
  place-items: center;
}

.lw-hd__logo-wheel {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(
    from -90deg,
    #6d28d9,
    #9333ea,
    #7c3aed,
    #d97706,
    #fbbf24,
    #eab308,
    #b45309,
    #991b1b,
    #581c87,
    #5b21b6,
    #a855f7,
    #6d28d9
  );
  box-shadow:
    0 0 0 2px rgba(146, 64, 14, 0.75),
    0 0 0 4px rgba(255, 233, 168, 0.55),
    0 4px 14px rgba(0, 0, 0, 0.45);
}

.lw-hd__logo-wheel::after {
  content: '';
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(26, 10, 46, 0.15), rgba(26, 10, 46, 0.55));
  box-shadow: inset 0 0 0 2px rgba(255, 233, 168, 0.35);
}

.lw-hd__logo {
  position: relative;
  z-index: 1;
  width: clamp(50px, 8vmin, 68px);
  height: clamp(50px, 8vmin, 68px);
  border-radius: 16px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.4));
}

.lw-hd__game {
  font-size: clamp(1.55rem, 4.2vw, 2.35rem);
  font-weight: 900;
  line-height: 1.06;
  color: var(--gold-light);
  letter-spacing: 0.01em;
  text-shadow: 0 2px 16px rgba(124, 58, 237, 0.5);
  white-space: nowrap;
}


@media (max-width: 900px) {
  .lw-hd__exit {
    min-height: 36px;
    padding: 7px 13px 7px 12px;
    font-size: 0.8rem;
  }
}

@media (max-width: 520px) {
  .lw-hd__brand {
    flex-direction: row;
    gap: 12px;
  }
  .lw-hd__game { white-space: nowrap; text-align: center; }
}

.lw-seat {
  position: relative;
  flex: 0 1 auto;
  max-width: min(240px, 42vw);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, rgba(45, 26, 74, 0.85), rgba(18, 8, 32, 0.9));
  border: 1px solid var(--border);
  border-color: color-mix(in srgb, var(--team-color, var(--border)) 55%, var(--border));
}

.lw-seat__ring {
  position: relative;
  flex-shrink: 0;
}

.lw-seat__avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid color-mix(in srgb, var(--team-color, #a855f7) 58%, rgba(255, 255, 255, 0.2));
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

.lw-seat__avatar--ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--purple-light), var(--purple));
  font-weight: 900;
  font-size: 1.1rem;
  color: #fff;
}

.lw-seat__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lw-seat__name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.lw-seat__name {
  font-size: 0.9rem;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.lw-seat__score {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--gold-light);
}

.lw-seat__score-unit {
  font-size: 0.68rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.72);
}

.lw-seat--hd {
  max-width: min(220px, 38vw);
  padding: 5px 10px 5px 8px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(45, 26, 74, 0.82), rgba(18, 8, 32, 0.88));
}

.lw-hd__flank .lw-seat--hd {
  width: min(240px, 36vw);
  max-width: min(240px, 36vw);
  direction: rtl;
}

.lw-seat--hd .lw-seat__avatar {
  width: 38px;
  height: 38px;
}

.lw-seat--hd .lw-seat__name {
  font-size: clamp(0.82rem, 1.6vw, 0.95rem);
}

.lw-seat--hd .lw-seat__score {
  font-size: 0.72rem;
}

/* شريط الفرق فوق الأعمدة (≤1250px) */
.lw-players-band {
  display: none;
  flex-shrink: 0;
  width: 100%;
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(168, 85, 247, 0.32);
  background:
    linear-gradient(165deg, rgba(45, 26, 74, 0.92), rgba(18, 8, 32, 0.96));
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.lw-players-band__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 10px 12px;
  direction: rtl;
}

.lw-players-band .lw-seat--hd {
  flex: 1 1 min(220px, calc(50% - 12px));
  max-width: min(280px, 100%);
  min-width: min(200px, 100%);
}

.lw-players-band .lw-seat__body {
  flex: 1;
  min-width: 0;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lw-players-band .lw-seat__scores {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  line-height: 1.15;
}

.lw-players-band .lw-seat__name {
  font-size: clamp(1rem, 2.2vw, 1.18rem);
}

.lw-players-band .lw-seat__score--round {
  font-size: clamp(0.92rem, 2vw, 1.05rem);
  color: var(--gold-light);
}

.lw-players-band .lw-seat__score--total {
  font-size: clamp(0.78rem, 1.7vw, 0.9rem);
  font-weight: 800;
  color: rgba(253, 224, 71, 0.92);
}

.lw-players-band .lw-seat--hd.lw-seat--active {
  border-width: 2px;
  border-color: var(--team-color, #a855f7);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

@media (max-width: 1250px) {
  /* الفرق داخل لوحة اللعب (الشريط العلوي) — أوضح على الجوال من الشريط المنفصل */
  .lw-players-band {
    display: none !important;
  }

  .lw-screen__playerbar {
    display: flex !important;
  }

  .lw-screen {
    padding-top: 6px;
  }
}

@media (min-width: 1251px) {
  .lw-players-band {
    display: none !important;
  }
}

/* —— Main: عجلة | شاشة | حروف —— */
.lw-main {
  flex: 1;
  min-height: 0;
  width: 100%;
  position: relative;
  z-index: 0;
  isolation: isolate;
  overflow: hidden;
  direction: ltr;
  display: grid;
  grid-template-columns:
    var(--lw-side-col)
    minmax(0, 1fr)
    var(--lw-side-col);
  gap: var(--lw-main-gap);
  align-items: stretch;
  overflow: hidden;
}

.lw-play {
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.lw-screen {
  position: relative;
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 10px 12px 8px;
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 90% 55% at 50% 0%, rgba(124, 58, 237, 0.22), transparent 62%),
    linear-gradient(180deg, rgba(45, 26, 74, 0.88), rgba(18, 8, 32, 0.92));
  border: 1px solid rgba(168, 85, 247, 0.28);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.lw-screen__playerbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: clamp(44px, 8vmin, 56px);
  padding: 6px 8px 8px;
  border-bottom: 1px solid rgba(168, 85, 247, 0.18);
  direction: ltr;
}

.lw-screen__playerbar-side {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  direction: rtl;
}

.lw-screen__playerbar-side--start {
  justify-content: flex-start;
}

.lw-screen__playerbar-side--end {
  justify-content: flex-end;
}

.lw-screen__playerbar .lw-seat--hd {
  width: min(240px, 42vw);
  max-width: min(240px, 42vw);
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.lw-screen__playerbar .lw-seat__body {
  flex: 1;
  min-width: 0;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lw-screen__playerbar .lw-seat__scores {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
  line-height: 1.15;
}

.lw-screen__playerbar .lw-seat__score--round {
  font-size: clamp(0.92rem, 2.1vw, 1.05rem);
  color: var(--gold-light);
}

.lw-screen__playerbar .lw-seat__score--total {
  font-size: clamp(0.78rem, 1.75vw, 0.9rem);
  font-weight: 800;
  color: rgba(253, 224, 71, 0.92);
}

.lw-screen__playerbar .lw-seat__score--total .lw-seat__score-unit {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.92em;
}

.lw-screen__playerbar .lw-seat__name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: clamp(1.05rem, 2.45vw, 1.22rem);
}

.lw-screen__playerbar .lw-seat__score {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: clamp(1rem, 2.35vw, 1.14rem);
}

.lw-screen__playerbar .lw-seat__score-unit {
  font-size: clamp(0.88rem, 2vw, 0.98rem);
}

.lw-screen__playerbar .lw-seat--hd.lw-seat--active {
  border-width: 2px;
  border-color: var(--team-color, #a855f7);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.lw-screen__playerbar .lw-seat--hd.lw-seat--active::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--team-color, #a855f7);
  pointer-events: none;
}

.lw-screen__playerbar .lw-seat--hd.lw-seat--active .lw-seat__avatar {
  border-width: 3px;
  border-color: var(--team-color, #a855f7);
}

.lw-screen__infobar {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  gap: clamp(6px, 1.2vw, 10px);
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(168, 85, 247, 0.18);
  direction: ltr;
  --turn-accent: #a855f7;
  --infobar-scale: 1;
}

.lw-screen__infobar-turn {
  margin: 0;
  justify-self: start;
  direction: rtl;
  display: flex;
  align-items: center;
  gap: calc(10px * var(--infobar-scale));
  width: max-content;
  max-width: 100%;
  box-sizing: border-box;
  padding:
    calc(8px * var(--infobar-scale))
    calc(16px * var(--infobar-scale))
    calc(8px * var(--infobar-scale))
    calc(14px * var(--infobar-scale));
  border-radius: calc(10px * var(--infobar-scale));
  font-size: calc(clamp(0.88rem, 2.4vw, 1.1rem) * var(--infobar-scale));
  font-weight: 900;
  color: #fff;
  background: color-mix(in srgb, var(--turn-accent) 12%, rgba(10, 4, 20, 0.88));
  border: 1px solid color-mix(in srgb, var(--turn-accent) 38%, rgba(255, 255, 255, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  white-space: nowrap;
  overflow: visible;
  flex-shrink: 0;
}

.lw-host-intro-preview .lw-screen__infobar-topic {
  color: rgba(255, 233, 168, 0.72);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.lw-screen__infobar-topic {
  margin: 0;
  justify-self: stretch;
  direction: rtl;
  text-align: center;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-weight: 900;
  font-size: calc(clamp(0.98rem, 2.8vw, 1.22rem) * var(--infobar-scale));
  line-height: 1.28;
  color: var(--gold-light);
  white-space: nowrap;
  overflow: hidden;
}

.lw-screen__infobar-round {
  margin: 0;
  justify-self: end;
  direction: rtl;
  text-align: end;
  width: max-content;
  max-width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
  font-size: calc(clamp(0.88rem, 2.4vw, 1.08rem) * var(--infobar-scale));
  font-weight: 800;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  overflow: hidden;
}

.lw-screen__turn-dot {
  width: calc(9px * var(--infobar-scale));
  height: calc(9px * var(--infobar-scale));
  border-radius: 50%;
  background: var(--turn-accent);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
}

.lw-screen__turn-text {
  line-height: 1.2;
  flex: 0 0 auto;
  white-space: nowrap;
}

.lw-screen__meta {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.lw-screen__board {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px 4px;
  background:
    radial-gradient(ellipse 70% 55% at 50% 45%, rgba(124, 58, 237, 0.14), transparent 70%);
}

.lw-screen__board.is-word-win .lw-puzzle-grid {
  filter: brightness(0.55) saturate(0.85);
  transition: filter 0.5s ease;
}

.lw-screen__board.is-word-win.is-win-peek .lw-puzzle-grid {
  filter: brightness(1) saturate(1);
}

/* —— تحنّك المقدّم: اختيار قبل الجولة الأولى —— */
.lw-host-gate {
  position: absolute;
  inset: 0;
  z-index: 35;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: clamp(10px, 3vw, 18px);
  pointer-events: none;
}

.lw-host-gate[hidden] {
  display: none !important;
}

.lw-host-gate__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(12, 4, 24, 0.08) 0%,
    rgba(12, 4, 24, 0.42) 55%,
    rgba(12, 4, 24, 0.72) 100%
  );
  pointer-events: none;
}

.lw-host-gate__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: 14px 14px 12px;
  border-radius: 16px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: linear-gradient(145deg, rgba(45, 26, 74, 0.94), rgba(18, 8, 34, 0.92));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

.lw-host-gate__hint {
  margin: 0 0 10px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255, 248, 231, 0.82);
}

.lw-host-gate__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 420px) {
  .lw-host-gate__actions {
    grid-template-columns: 1fr;
  }
}

.lw-host-gate__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 11px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 248, 231, 0.18);
  background: rgba(255, 248, 231, 0.06);
  color: #fff8e7;
  font: inherit;
  font-weight: 800;
  font-size: 0.84rem;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.lw-host-gate__btn--start {
  border-color: rgba(251, 191, 36, 0.65);
  background: linear-gradient(180deg, rgba(255, 233, 168, 0.22), rgba(245, 158, 11, 0.12));
}

.lw-host-gate__btn:hover:not(:disabled),
.lw-host-gate__btn:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(251, 191, 36, 0.85);
  outline: none;
}

.lw-host-gate__btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* إعدادات المقدّم والصوت — يسار الهيدر (لا تغطي زر تكبير العجلة) */
.lw-host-settings-wrap {
  position: absolute;
  left: max(0px, env(safe-area-inset-left, 0px));
  top: 50%;
  transform: translateY(-50%);
  z-index: 105;
  width: max-content;
  max-width: none;
  pointer-events: none;
}

.lw-host-settings-wrap[hidden] {
  display: none !important;
}

.lw-host-settings-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  direction: rtl;
  width: max-content;
  max-width: none;
  margin: 0;
  min-height: 40px;
  white-space: nowrap;
  padding: 8px 16px 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.42);
  background: linear-gradient(180deg, rgba(56, 31, 88, 0.95), rgba(18, 8, 32, 0.92));
  color: var(--gold-light);
  font: inherit;
  font-weight: 900;
  font-size: clamp(0.82rem, 1.8vw, 0.92rem);
  letter-spacing: 0.02em;
  line-height: 1;
  cursor: pointer;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.lw-host-settings-btn:hover,
.lw-host-settings-btn.is-open,
.lw-host-settings-btn:focus-visible {
  border-color: rgba(255, 233, 168, 0.65);
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.55), rgba(45, 26, 74, 0.95));
  box-shadow:
    0 6px 18px rgba(124, 58, 237, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  outline: none;
}

.lw-host-settings-btn:active {
  transform: scale(0.98);
}

.lw-host-settings-btn i {
  font-size: 0.88em;
  opacity: 0.92;
}

.lw-host-settings-btn__text {
  white-space: nowrap;
  line-height: 1;
  flex-shrink: 0;
}

/* مساحة للزر الكامل + خروج بدون قصّ النص */
.lw-hd:has(.lw-host-settings-wrap:not([hidden])) {
  padding-left: max(11.5rem, calc(10px + env(safe-area-inset-left, 0px)));
  padding-right: max(6.5rem, calc(10px + env(safe-area-inset-right, 0px)));
}

.lw-hd:has(.lw-host-settings-wrap:not([hidden])) .lw-hd__core {
  max-width: min(calc(100vw - 22rem), 420px);
}

.lw-host-interact {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: auto;
  min-width: min(280px, 92vw);
  max-width: min(320px, 96vw);
  z-index: 120;
  padding: 8px 9px 6px;
  border-radius: 14px;
  border: 1px solid rgba(251, 191, 36, 0.42);
  background: linear-gradient(155deg, rgba(45, 26, 74, 0.98), rgba(14, 6, 28, 0.96));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  text-align: right;
  max-height: min(42vh, 240px);
  overflow: auto;
  pointer-events: auto;
}

.lw-host-interact[hidden] {
  display: none !important;
}

.lw-host-interact__section {
  margin: 6px 0 2px;
  padding: 0 4px;
  font-size: 0.62rem;
  font-weight: 900;
  color: rgba(255, 233, 168, 0.75);
  letter-spacing: 0.02em;
  list-style: none;
}

.lw-host-interact__item[hidden] {
  display: none !important;
}

.lw-host-settings-wrap--sound-only .lw-host-interact__section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.lw-host-interact__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lw-host-interact__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 5px;
  border-radius: 9px;
  border: 1px solid rgba(255, 248, 231, 0.08);
  background: rgba(255, 248, 231, 0.03);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.lw-host-interact__item.is-live {
  border-color: rgba(251, 191, 36, 0.78);
  background: rgba(251, 191, 36, 0.16);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.22);
}

.lw-host-interact__item.is-user-off {
  opacity: 0.7;
}

.lw-host-interact__item.is-user-off .lw-host-interact__label {
  text-decoration: line-through;
  color: rgba(255, 248, 231, 0.42);
}

.lw-host-interact__label {
  font-size: 0.68rem;
  font-weight: 800;
  color: rgba(255, 248, 231, 0.92);
  line-height: 1.3;
}

.lw-host-interact__label i {
  margin-inline-end: 3px;
  opacity: 0.85;
  font-size: 0.62rem;
}

.lw-host-interact__toggle {
  flex-shrink: 0;
  width: 32px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(120, 80, 160, 0.55);
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease;
}

.lw-host-interact__toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff8e7;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}

.lw-host-interact__toggle.is-on {
  background: linear-gradient(180deg, #ffe9a8, #d97706);
}

.lw-host-interact__toggle.is-on::after {
  transform: translateX(-14px);
}

.lw-host-interact__toggle:focus-visible {
  outline: 2px solid rgba(251, 191, 36, 0.85);
  outline-offset: 2px;
}

.lw-host-explain-active .lw-host-settings-wrap,
.lw-host-explain-active .lw-host-interact {
  opacity: 1 !important;
  filter: none !important;
}

/* إبراز الشرح — توهج قوي + تعتيم باقي الشاشة */
.lw-host-explain-active .lw-wheel-col:not(:has(.is-host-highlight)),
.lw-host-explain-active .lw-keys-col:not(:has(.is-host-highlight)),
.lw-host-explain-active .lw-screen__board:not(.is-host-highlight),
.lw-host-explain-active .lw-screen__playerbar,
.lw-host-explain-active .lw-screen__meta,
.lw-host-explain-active .lw-screen__infobar > *:not(.is-host-highlight) {
  opacity: 0.34;
  filter: saturate(0.5) brightness(0.78);
  transition: opacity 0.35s ease, filter 0.35s ease;
}

.lw-host-explain-active .is-host-highlight {
  opacity: 1 !important;
  filter: none !important;
}

/* مساحة للإطار الخارجي — بدون قصّ من overflow */
.lw-host-explain-active .lw-wheel-col:has(.is-host-highlight),
.lw-host-explain-active .lw-keys-col:has(.is-host-highlight) {
  overflow: visible;
  z-index: 30;
  position: relative;
  padding: 8px 6px;
  box-sizing: border-box;
}

.lw-host-explain-active .lw-main:has(.is-host-highlight) {
  overflow: visible;
}

.lw-host-explain-active .lw-play:has(.is-host-highlight) {
  overflow: visible;
  z-index: 8;
}

.lw-host-explain-active .lw-screen:has(.is-host-highlight) {
  overflow: visible;
}

.lw-host-focus.is-host-highlight {
  outline: none;
  position: relative;
  z-index: 12;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lw-wheel-card.lw-host-focus.is-host-highlight,
.lw-keys-card.lw-host-focus.is-host-highlight {
  overflow: visible !important;
  border-color: #fcd34d !important;
  box-shadow:
    inset 0 0 0 3px rgba(255, 233, 168, 0.8),
    inset 0 0 0 6px rgba(251, 191, 36, 0.38);
  animation: lw-host-card-inset-pulse 1.05s ease-in-out infinite;
}

.lw-wheel-card.lw-host-focus.is-host-highlight::before,
.lw-keys-card.lw-host-focus.is-host-highlight::before {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: calc(var(--radius) + 5px);
  border: 3px solid rgba(252, 211, 77, 0.95);
  box-shadow: 0 0 22px rgba(251, 191, 36, 0.55);
  pointer-events: none;
  z-index: 40;
  animation: lw-host-outer-ring 1.05s ease-in-out infinite;
}

.lw-wheel-card.lw-host-focus.is-host-highlight .lw-wheel-stage {
  overflow: visible;
  padding-top: 12px;
  box-sizing: border-box;
}

.lw-screen__board.lw-host-focus.is-host-highlight {
  overflow: visible !important;
  border-radius: 16px;
  box-shadow:
    inset 0 0 0 4px rgba(255, 233, 168, 0.8),
    inset 0 0 0 7px rgba(251, 191, 36, 0.35);
  animation: lw-host-board-inset-pulse 1.05s ease-in-out infinite;
}

.lw-screen__board.lw-host-focus.is-host-highlight::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 18px;
  border: 3px solid rgba(252, 211, 77, 0.92);
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.5);
  pointer-events: none;
  z-index: 40;
  animation: lw-host-outer-ring 1.05s ease-in-out infinite;
}

.lw-keys-helper-wrap.lw-host-focus.is-host-highlight {
  overflow: visible;
  border-radius: 14px;
  position: relative;
  z-index: 14;
  border-color: rgba(252, 211, 77, 0.85) !important;
  box-shadow:
    inset 0 0 0 3px rgba(255, 233, 168, 0.75),
    inset 0 0 0 6px rgba(251, 191, 36, 0.35);
  animation: lw-host-card-inset-pulse 1.05s ease-in-out infinite;
}

.lw-keys-helper-wrap.lw-host-focus.is-host-highlight::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 18px;
  border: 3px solid rgba(252, 211, 77, 0.95);
  box-shadow: 0 0 22px rgba(251, 191, 36, 0.55);
  pointer-events: none;
  z-index: 40;
  animation: lw-host-outer-ring 1.05s ease-in-out infinite;
}

.lw-power.lw-host-focus.is-host-highlight {
  box-shadow:
    inset 0 0 0 3px rgba(255, 233, 168, 0.65),
    0 0 0 3px rgba(251, 191, 36, 0.9);
  border-radius: 12px;
  animation: lw-host-btn-glow 1.05s ease-in-out infinite;
}

.lw-wheel-card:has(.lw-spin-btn.is-host-highlight),
.lw-wheel-card:has(.lw-power.is-host-highlight),
.lw-keys-card:has(.lw-act.is-host-highlight),
.lw-keys-card:has(.lw-keys-helper-wrap.is-host-highlight) {
  overflow: visible !important;
}

.lw-host-explain-active .lw-keys-card__body:has(.lw-keys-helper-wrap.is-host-highlight) {
  overflow: visible;
  padding-top: 10px;
  padding-bottom: 10px;
}

/* زر اللف: الشكل الظاهر داخل .lw-spin-btn__inner — لا نرسم مستطيلاً على الغلاف الشفاف */
.lw-spin-btn.lw-host-focus.is-host-highlight {
  position: relative;
  z-index: 15;
  box-shadow: none;
  animation: none;
}

.lw-spin-btn.lw-host-focus.is-host-highlight .lw-spin-btn__inner {
  animation: lw-host-spin-inner-glow 1.05s ease-in-out infinite;
}

.lw-spin-btn.lw-host-focus.is-host-highlight .lw-spin-btn__inner::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 18px;
  border: 3px solid rgba(252, 211, 77, 0.95);
  box-shadow: 0 0 22px rgba(251, 191, 36, 0.55);
  pointer-events: none;
  animation: lw-host-outer-ring 1.05s ease-in-out infinite;
}

.lw-act.lw-host-focus.is-host-highlight {
  position: relative;
  z-index: 15;
  border-radius: 14px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 233, 168, 0.85),
    0 0 0 3px rgba(251, 191, 36, 0.95),
    0 0 20px rgba(251, 191, 36, 0.55);
  animation: lw-host-btn-glow 1.05s ease-in-out infinite;
}

.lw-screen__infobar-turn.lw-host-focus.is-host-highlight,
.lw-screen__infobar-topic.lw-host-focus.is-host-highlight,
.lw-screen__infobar-round.lw-host-focus.is-host-highlight {
  color: #fff8e7 !important;
  padding: 4px 12px;
  border-radius: 10px;
  z-index: 14;
  box-shadow:
    inset 0 0 0 2px rgba(255, 233, 168, 0.85),
    0 0 0 4px rgba(251, 191, 36, 0.95),
    0 0 24px rgba(251, 191, 36, 0.55);
  text-shadow: 0 0 12px rgba(255, 233, 168, 0.65);
  animation: lw-host-topic-pulse 1.05s ease-in-out infinite;
}

@keyframes lw-host-card-inset-pulse {
  0%, 100% {
    box-shadow:
      inset 0 0 0 3px rgba(255, 233, 168, 0.65),
      inset 0 0 0 6px rgba(251, 191, 36, 0.28);
  }
  50% {
    box-shadow:
      inset 0 0 0 4px rgba(255, 248, 231, 0.95),
      inset 0 0 0 8px rgba(251, 191, 36, 0.48);
  }
}

@keyframes lw-host-board-inset-pulse {
  0%, 100% {
    box-shadow:
      inset 0 0 0 4px rgba(255, 233, 168, 0.65),
      inset 0 0 0 7px rgba(251, 191, 36, 0.28);
  }
  50% {
    box-shadow:
      inset 0 0 0 5px rgba(255, 248, 231, 0.92),
      inset 0 0 0 9px rgba(251, 191, 36, 0.45);
  }
}

@keyframes lw-host-outer-ring {
  0%, 100% {
    opacity: 0.88;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.008);
  }
}

@keyframes lw-host-btn-glow {
  0%, 100% {
    box-shadow:
      inset 0 0 0 2px rgba(255, 233, 168, 0.75),
      0 0 0 3px rgba(251, 191, 36, 0.85),
      0 0 18px rgba(251, 191, 36, 0.45);
  }
  50% {
    box-shadow:
      inset 0 0 0 2px rgba(255, 248, 231, 0.95),
      0 0 0 4px rgba(252, 211, 77, 1),
      0 0 28px rgba(251, 191, 36, 0.65);
  }
}

@keyframes lw-host-spin-inner-glow {
  0%, 100% {
    filter: brightness(1.04);
    box-shadow:
      inset 0 0 0 2px rgba(255, 233, 168, 0.8),
      0 8px 0 #92400e,
      0 0 16px rgba(251, 191, 36, 0.42),
      0 16px 32px rgba(0, 0, 0, 0.35),
      inset 0 2px 0 rgba(255, 255, 255, 0.35);
  }
  50% {
    filter: brightness(1.1);
    box-shadow:
      inset 0 0 0 4px rgba(255, 248, 231, 0.95),
      0 8px 0 #92400e,
      0 0 28px rgba(251, 191, 36, 0.62),
      0 16px 32px rgba(0, 0, 0, 0.35),
      inset 0 2px 0 rgba(255, 255, 255, 0.45);
  }
}

@keyframes lw-host-topic-pulse {
  0%, 100% {
    box-shadow:
      inset 0 0 0 2px rgba(255, 233, 168, 0.75),
      0 0 0 4px rgba(251, 191, 36, 0.82),
      0 0 18px rgba(251, 191, 36, 0.42);
  }
  50% {
    box-shadow:
      inset 0 0 0 3px rgba(255, 248, 231, 0.95),
      0 0 0 6px rgba(252, 211, 77, 1),
      0 0 32px rgba(251, 191, 36, 0.72);
  }
}

.lw-wheel-col {
  grid-column: 1;
  grid-row: 1;
  min-height: 0;
  min-width: 0;
  box-sizing: border-box;
  padding: 3px;
  overflow: hidden;
}

.lw-wheel-enlarge-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  max-width: 280px;
  margin: 0 auto 2px;
  padding: 5px 8px;
  border-radius: 12px;
  border: 1px solid rgba(168, 85, 247, 0.45);
  background: rgba(12, 4, 24, 0.72);
  color: var(--gold-light, #fde68a);
  font: inherit;
  font-weight: 800;
  font-size: clamp(0.68rem, 2.1vw, 0.78rem);
  line-height: 1.25;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}

.lw-wheel-enlarge-btn:hover:not(:disabled),
.lw-wheel-enlarge-btn:focus-visible {
  border-color: rgba(251, 191, 36, 0.65);
  background: rgba(124, 58, 237, 0.28);
  outline: none;
}

.lw-wheel-enlarge-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lw-wheel-enlarge-btn i {
  font-size: 0.92em;
  opacity: 0.92;
}

.lw-keys-col {
  grid-column: 3;
  grid-row: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  box-sizing: border-box;
  padding: 3px;
  overflow: visible;
}

/* ≤960 — نفس 3 أعمدة (عجلة | لوحة | حروف) مع أعمدة جانبية أضيق */
@media (max-width: 960px) {
  :root {
    --lw-side-col: clamp(131px, 18vw, 178px);
    --lw-layout-min-height: 400px;
    --lw-main-gap: 5px;
    --radius: 16px;
    --radius-sm: 11px;
  }

  html,
  body.lw-body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .lw-shell {
    gap: 6px;
    height: auto;
    min-height: 100dvh;
    max-height: none;
    overflow: visible;
    padding: 0 max(4px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom, 8px)) max(4px, env(safe-area-inset-left));
  }

  .lw-main {
    flex: 1 1 auto;
    min-height: var(--lw-layout-min-height);
  }

  .lw-wheel-col,
  .lw-keys-col,
  .lw-play {
    min-height: var(--lw-layout-min-height);
  }

  .lw-hd {
    gap: 6px;
    padding-top: max(8px, calc(6px + env(safe-area-inset-top, 0px)));
    padding-bottom: 8px;
  }

  .lw-hd__flank .lw-seat--hd {
    width: min(168px, 34vw);
    max-width: min(168px, 34vw);
  }

  .lw-wheel-col,
  .lw-keys-col {
    padding: 4px 3px;
  }

  .lw-wheel-card {
    padding: 5px 6px 6px;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.34);
  }

  .lw-keys-card {
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.34);
  }

  .lw-wheel-footer {
    max-width: 100%;
    gap: 3px;
  }

  .lw-power-stack {
    transform: scale(0.92);
    transform-origin: center top;
  }

  .lw-spin-btn__inner {
    padding: 8px 12px;
    font-size: 0.78rem;
  }

  .lw-screen {
    padding: 6px 8px 6px;
    border-radius: var(--radius-sm);
  }

  .lw-screen__playerbar {
    min-height: 38px;
    padding: 4px 2px 6px;
    gap: 2px;
  }

  .lw-screen__playerbar-side {
    flex: 1 1 0;
    min-width: 0;
    gap: 4px;
  }

  .lw-screen__playerbar .lw-seat--hd {
    width: auto;
    max-width: none;
    flex: 1 1 0;
    min-width: 0;
    padding: 3px 4px;
    gap: 4px;
  }

  .lw-screen__playerbar .lw-seat__ring {
    flex-shrink: 0;
  }

  .lw-screen__playerbar .lw-seat__avatar {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }

  .lw-screen__playerbar .lw-seat__body {
    gap: 4px;
  }

  .lw-screen__playerbar .lw-seat__name {
    font-size: clamp(0.72rem, 3.2vw, 0.88rem);
    line-height: 1.15;
  }

  .lw-screen__playerbar .lw-seat__score--round {
    font-size: clamp(0.72rem, 2.8vw, 0.88rem);
  }

  .lw-screen__playerbar .lw-seat__score--total {
    font-size: clamp(0.66rem, 2.5vw, 0.78rem);
  }

  .lw-screen__playerbar .lw-seat__score-unit {
    font-size: 0.82em;
  }

  .lw-keys-card {
    padding: 6px 6px max(8px, env(safe-area-inset-bottom, 6px));
    border-radius: var(--radius-sm);
  }

  .lw-keys-card__title {
    font-size: 0.68rem;
  }

  .lw-keys-helper-wrap {
    padding: 5px 4px 6px;
    margin-bottom: 2px;
  }

  .lw-keys-helper-head {
    margin-bottom: 5px;
    gap: 4px;
  }

  .lw-keys-helper__title {
    font-size: 0.68rem;
  }

  .lw-keys-helper__price {
    font-size: 0.62rem;
  }

  .lw-keys-helper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .lw-keys-helper .lw-key--helper {
    height: 36px;
    border-radius: 10px;
  }

  .lw-keys-card__foot {
    gap: 5px;
  }

  .lw-act {
    padding: 7px 6px;
    font-size: 0.72rem;
    border-radius: 10px;
  }
}

.lw-keys-card {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 8px 10px max(10px, env(safe-area-inset-bottom, 8px));
  border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(45, 26, 74, 0.92), rgba(18, 8, 32, 0.95));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  overflow: hidden;
}

.lw-keys-card__title {
  margin: 0;
  text-align: center;
  font-size: clamp(0.72rem, 1.6vw, 0.84rem);
  font-weight: 800;
  color: var(--muted);
}

.lw-keys-card__title i {
  color: var(--gold);
  margin-inline-end: 4px;
}

.lw-keys-card__body {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px 0;
}

.lw-keys-helper-wrap {
  flex-shrink: 0;
  margin-bottom: 6px;
  padding: 8px 6px 10px;
  border-radius: 14px;
  border: 1px solid rgba(251, 191, 36, 0.42);
  background:
    linear-gradient(165deg, rgba(251, 191, 36, 0.14) 0%, rgba(251, 191, 36, 0.03) 42%, rgba(26, 10, 46, 0.55) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 233, 168, 0.12),
    0 4px 14px rgba(0, 0, 0, 0.22);
}

.lw-keys-helper-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  margin-bottom: 8px;
  text-align: center;
}

.lw-keys-helper__title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: clamp(0.72rem, 1.45vw, 0.82rem);
  font-weight: 900;
  color: #fde68a;
}

.lw-keys-helper__title i {
  font-size: 0.78em;
  opacity: 0.95;
}

.lw-keys-helper__price {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: clamp(0.68rem, 1.25vw, 0.76rem);
  font-weight: 900;
  color: #1a0a2e;
  background: linear-gradient(180deg, #ffe9a8, #f0b429);
  box-shadow: 0 2px 0 #92400e;
  white-space: nowrap;
  direction: rtl;
  unicode-bidi: isolate;
}

.lw-keys-helper__price-num {
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
}

.lw-keys-helper__price-text {
  unicode-bidi: embed;
}

.lw-keys-helper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  direction: rtl;
}

.lw-letter-input-wrap {
  display: none;
  flex-shrink: 0;
}

.lw-letter-input__label {
  display: block;
  margin: 0 0 4px;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--muted);
}

.lw-letter-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 8px;
  border-radius: 12px;
  border: 2px solid rgba(167, 139, 250, 0.45);
  background: rgba(12, 4, 24, 0.75);
  color: #fff;
  font-family: inherit;
  font-weight: 900;
  font-size: 1.35rem;
  line-height: 1.2;
  text-align: center;
  direction: rtl;
}

.lw-letter-input:focus {
  outline: none;
  border-color: rgba(251, 191, 36, 0.65);
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.18);
}

.lw-letter-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lw-keys-card__foot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.lw-keys-card__foot .lw-act {
  width: 100%;
}

.lw-puzzle-grid {
  display: grid;
  gap: clamp(6px, 1.1vmin, 9px);
  justify-content: center;
  direction: rtl;
  transform-origin: center center;
  will-change: transform;
  padding: 6px 8px;
}

.lw-tile {
  position: relative;
  width: clamp(28px, 4.8vmin, 76px);
  height: clamp(32px, 5.4vmin, 84px);
  border-radius: clamp(10px, 1.4vmin, 14px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: clamp(0.85rem, 3.2vmin, 1.65rem);
  box-sizing: border-box;
}

.lw-tile--decoy {
  background:
    linear-gradient(155deg, rgba(167, 139, 250, 0.26) 0%, rgba(109, 40, 217, 0.34) 48%, rgba(67, 20, 120, 0.42) 100%);
  border: 2px solid rgba(196, 181, 253, 0.38);
  border-radius: clamp(8px, 1.2vmin, 12px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.14),
    inset 0 -3px 8px rgba(0, 0, 0, 0.22),
    0 3px 0 rgba(46, 16, 84, 0.55),
    0 5px 12px rgba(0, 0, 0, 0.18);
  opacity: 1;
}

.lw-tile--decoy::after {
  content: '';
  position: absolute;
  inset: 30%;
  border-radius: 3px;
  transform: rotate(45deg);
  border: 1px solid rgba(253, 224, 71, 0.28);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(124, 58, 237, 0.08));
  box-shadow: inset 0 0 6px rgba(167, 139, 250, 0.25);
  pointer-events: none;
}

.lw-tile--slot {
  border: none;
  box-shadow: none;
}

.lw-tile--slot.is-empty {
  background: linear-gradient(180deg, #fffef9 0%, #f5efe0 100%);
  border: 2px solid #6d28d9;
  border-radius: clamp(8px, 1.2vmin, 12px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 5px 0 #5b21b6,
    0 8px 18px rgba(0, 0, 0, 0.28);
}

.lw-tile--slot.is-empty::before {
  display: none;
}

.lw-tile--slot.is-empty::after {
  content: '';
  position: absolute;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 55%;
  height: 3px;
  border-radius: 2px;
  background: #c4b5fd;
}

.lw-tile--slot.is-empty.is-hint {
  border-color: #fbbf24;
  background: linear-gradient(180deg, #fff9e6 0%, #fde68a 55%, #fbbf24 100%);
  box-shadow:
    0 0 0 3px rgba(251, 191, 36, 0.55),
    0 0 28px rgba(251, 191, 36, 0.65),
    0 5px 0 #d97706,
    0 10px 24px rgba(251, 191, 36, 0.45);
  animation: lw-tile-hint-pulse 0.85s ease-in-out infinite;
}

.lw-tile--slot.is-empty.is-hint::after {
  background: rgba(217, 119, 6, 0.55);
  height: 4px;
  animation: lw-tile-hint-line 0.85s ease-in-out infinite;
}

@keyframes lw-tile-hint-pulse {
  0%, 100% {
    filter: brightness(1);
    transform: scale(1);
  }
  50% {
    filter: brightness(1.12);
    transform: scale(1.04);
  }
}

@keyframes lw-tile-hint-line {
  0%, 100% { opacity: 0.45; width: 45%; }
  50% { opacity: 1; width: 62%; }
}

.lw-tile--slot.is-revealed {
  color: #4c1d95;
  font-weight: 700;
  font-family: 'Noto Naskh Arabic', Tahoma, 'Segoe UI', sans-serif;
  line-height: 1;
  overflow: visible;
  z-index: 2;
  background: linear-gradient(180deg, #ffffff 0%, #faf5ff 100%);
  border: 2px solid #f0b429;
  border-radius: clamp(8px, 1.2vmin, 12px);
  box-shadow:
    0 0 0 2px rgba(124, 58, 237, 0.35),
    0 4px 0 #d97706,
    0 10px 22px rgba(251, 191, 36, 0.35);
  text-shadow: none;
  animation: lw-tile-reveal 0.48s cubic-bezier(0.34, 1.35, 0.64, 1);
}

.lw-tile__glyph {
  display: block;
  overflow: visible;
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(0.95rem, 3.5vmin, 1.78rem);
  font-feature-settings: 'liga' 0, 'calt' 0;
  font-variant-ligatures: no-contextual;
  min-width: 0.55em;
  text-align: center;
  line-height: 1.1;
  margin-inline: -0.07em;
  unicode-bidi: isolate;
}

.lw-tile--slot.is-revealed.is-join-prev {
  z-index: 3;
  margin-inline-start: -0.14em;
}

.lw-tile--slot.is-revealed.is-join-next {
  margin-inline-end: -0.14em;
}

@keyframes lw-tile-reveal {
  from {
    transform: scale(0.92);
  }
  to {
    transform: scale(1);
  }
}

/* —— Wheel card —— */
.lw-wheel-card {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 8px 10px 10px;
  border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(45, 26, 74, 0.92), rgba(18, 8, 32, 0.95));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: stretch;
  justify-items: center;
  gap: 4px;
  overflow: hidden;
}

.lw-wheel-footer {
  width: 100%;
  max-width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-bottom: max(8px, env(safe-area-inset-bottom, 6px));
}

.lw-wheel-stage {
  min-height: 0;
  width: 100%;
  height: 100%;
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lw-wheel-wrap {
  position: relative;
  height: 100%;
  width: auto;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1;
  margin-inline: auto;
  flex-shrink: 0;
}

@supports (width: 100cqw) and (height: 100cqh) {
  .lw-wheel-stage {
    container-type: size;
  }

  .lw-wheel-wrap {
    width: min(100cqw, 100cqh, 100%);
    height: min(100cqw, 100cqh, 100%);
  }
}

.lw-wheel-rotor {
  position: absolute;
  inset: 10%;
  z-index: 2;
  border-radius: 50%;
  transform-origin: 50% 50%;
  box-shadow:
    0 0 0 4px var(--gold),
    0 0 0 7px rgba(76, 29, 149, 0.55),
    0 10px 28px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.lw-wheel-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(251, 191, 36, 0.2);
  box-shadow: 0 0 40px rgba(124, 58, 237, 0.25);
  pointer-events: none;
}

.lw-wheel-pointers {
  position: absolute;
  /* نفس هندسة .lw-wheel-rotor حتى تطابق أعمدة/مسامير الرسم */
  inset: 10%;
  z-index: 6;
  pointer-events: none;
}

.lw-wptr {
  position: absolute;
  inset: 0;
  transform: rotate(var(--ptr-angle, 0deg));
  transition: opacity 0.2s;
  opacity: 0.42;
}

.lw-wptr.is-active {
  opacity: 1;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--ptr-color) 65%, transparent));
}

.lw-wptr__arrow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -100%);
  transform-origin: 50% 100%;
  width: 22px;
  height: 42px;
  background: var(--ptr-color, var(--gold));
  clip-path: polygon(
    50% 100%,
    0 52%,
    18% 52%,
    18% 8%,
    82% 8%,
    82% 52%,
    100% 52%
  );
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

.lw-wptr__arrow::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
}

.lw-wptr__arrow.is-tick-bump {
  animation: lw-ptr-tick 0.14s ease-out;
}

@keyframes lw-ptr-tick {
  0% { transform: translate(-50%, -100%) rotate(0deg); }
  35% { transform: translate(-50%, -100%) rotate(-17deg); }
  100% { transform: translate(-50%, -100%) rotate(0deg); }
}

.lw-wheel-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border-radius: 50%;
  border: none;
  box-shadow: none;
  display: block;
  transform: none !important;
}

.lw-wheel-hub {
  position: absolute;
  inset: 39%;
  border-radius: 50%;
  background: #fbbf24;
  border: 3px solid #fff;
  z-index: 5;
  pointer-events: none;
  box-shadow:
    inset 0 -2px 0 rgba(180, 83, 9, 0.35),
    0 4px 14px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

.lw-wheel-hub__logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.lw-wheel-card__result {
  flex-shrink: 0;
  min-height: 1.25em;
  margin: 0;
  text-align: center;
  font-weight: 900;
  font-size: clamp(0.78rem, 2vw, 0.88rem);
  color: var(--gold-light);
}

/* —— تدوير العجلة: عرض مركزي ملء الشاشة —— */
.lw-body.is-spin-focus {
  overflow: hidden;
}

.lw-body.is-spin-focus::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(8, 3, 18, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  pointer-events: auto;
}

.lw-body.is-spin-focus .lw-wheel-card {
  pointer-events: auto;
  position: fixed;
  z-index: 500;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  filter: none;
  width: min(98vmin, 98vw, 680px);
  height: auto;
  max-height: calc(100dvh - 16px);
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  grid-template-rows: auto auto;
  gap: 10px;
}

.lw-body.is-spin-focus .lw-wheel-stage {
  width: min(96vmin, 96vw, 660px);
  height: min(96vmin, 96vw, 660px);
  max-height: calc(100dvh - 88px);
  flex: none;
}

.lw-body.is-spin-focus .lw-wheel-footer {
  max-width: none;
  width: 100%;
}

.lw-body.is-spin-focus .lw-wheel-footer .lw-power-stack,
.lw-body.is-spin-focus .lw-wheel-footer .lw-spin-btn {
  display: none !important;
}

.lw-body.is-spin-focus .lw-wheel-card__result {
  font-size: clamp(1.05rem, 4.5vmin, 1.75rem);
  padding: 10px 14px;
  border-radius: 14px;
  min-height: 2.4em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lw-body.is-spin-focus .lw-wheel-card.is-spin-focus-result .lw-wheel-card__result:not(:empty) {
  border: 1px solid rgba(251, 191, 36, 0.55);
  background: rgba(12, 4, 24, 0.72);
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.18);
}

.lw-wheel-preview-close {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 4px 0 0;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(251, 191, 36, 0.55);
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.55), rgba(76, 29, 149, 0.75));
  color: #fff;
  font: inherit;
  font-weight: 900;
  font-size: clamp(0.95rem, 3.5vmin, 1.15rem);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.lw-wheel-preview-close:hover,
.lw-wheel-preview-close:focus-visible {
  border-color: rgba(255, 233, 168, 0.75);
  outline: none;
}

.lw-body.is-wheel-preview .lw-wheel-enlarge-btn,
.lw-body.is-spin-focus:not(.is-wheel-preview) .lw-wheel-enlarge-btn {
  display: none !important;
}

.lw-body.is-wheel-preview .lw-wheel-footer .lw-power-stack,
.lw-body.is-wheel-preview .lw-wheel-footer .lw-spin-btn,
.lw-body.is-wheel-preview .lw-wheel-footer .lw-wheel-card__result {
  display: none !important;
}

.lw-body.is-wheel-preview .lw-wheel-preview-close {
  display: flex;
}

.lw-power-stack {
  --power-ratio: 0.444;
  --power-thumb: 22px;
  --power-track-pad: 10px;
  position: relative;
  width: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.lw-power-bridge {
  position: relative;
  width: 100%;
  height: 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 var(--power-track-pad);
  margin-bottom: 2px;
  box-sizing: border-box;
}

.lw-power-bridge__hint {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--muted);
  line-height: 1;
  padding-bottom: 2px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.lw-power-bridge__hint i {
  font-size: 0.55rem;
  opacity: 0.85;
}

.lw-power {
  width: 100%;
  flex-shrink: 0;
  margin: 0;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(18, 8, 32, 0.65);
  border: 1px solid var(--border);
}

.lw-power__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--muted);
}

.lw-power__label i {
  color: var(--orange);
  margin-inline-end: 4px;
}

.lw-power__value {
  color: var(--gold-light);
  font-variant-numeric: tabular-nums;
}

.lw-power__track {
  position: relative;
  width: 100%;
  height: 28px;
  display: flex;
  align-items: center;
}

.lw-power__track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  border-radius: 999px;
  background: rgba(45, 26, 74, 0.95);
  border: 1px solid rgba(124, 58, 237, 0.35);
  pointer-events: none;
}

.lw-power__fill {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  border-radius: 999px;
  pointer-events: none;
  z-index: 1;
  width: calc(
    (var(--power-thumb) * 0.5) +
    (100% - var(--power-thumb)) * var(--power-ratio)
  );
  background: linear-gradient(90deg, #7c3aed 0%, #c084fc 45%, #fbbf24 100%);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.35);
}

.lw-power__range {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 28px;
  appearance: none;
  background: transparent;
  outline: none;
  cursor: pointer;
  margin: 0;
}

.lw-power__range:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lw-power__range::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.lw-power__range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  border: 2px solid #fff;
}

@keyframes lw-spin-icon {
  to { transform: rotate(360deg); }
}

.lw-spin-btn {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  max-width: 240px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  margin-top: 6px;
}

.lw-spin-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lw-spin-btn__inner {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 14px;
  font-weight: 900;
  font-size: clamp(0.78rem, 2vw, 0.88rem);
  line-height: 1.2;
  color: #1a0a2e;
  background: linear-gradient(165deg, var(--gold-light), var(--gold) 45%, #d97706);
  box-shadow:
    0 8px 0 #92400e,
    0 16px 32px rgba(0, 0, 0, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.12s, filter 0.12s;
}

.lw-spin-btn:not(:disabled):active .lw-spin-btn__inner {
  transform: translateY(3px);
  box-shadow:
    0 4px 0 #92400e,
    0 10px 20px rgba(0, 0, 0, 0.3);
}

.lw-spin-btn__inner i {
  font-size: 1.25rem;
}

.lw-keyboard {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(26px, 1fr);
  gap: clamp(3px, 0.45vh, 6px);
  width: 100%;
  max-width: 100%;
  direction: rtl;
}

.lw-key {
  height: 100%;
  min-height: 26px;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(56, 31, 88, 0.9), rgba(26, 10, 46, 0.95));
  color: var(--text);
  font-family: inherit;
  font-weight: 900;
  font-size: clamp(0.78rem, 2.1vh, 1.15rem);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: background 0.12s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lw-key--helper {
  padding: 0;
  border-width: 2px;
  border-color: rgba(251, 191, 36, 0.62);
  background: linear-gradient(180deg, rgba(88, 52, 14, 0.55), rgba(22, 8, 40, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 233, 168, 0.14),
    0 3px 0 rgba(120, 53, 15, 0.55);
}

.lw-key--helper .lw-key__glyph {
  font-size: clamp(1rem, 2.65vh, 1.32rem);
  line-height: 1;
  color: #fff7ed;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.lw-key--helper:hover:not(:disabled) {
  border-color: rgba(253, 224, 71, 0.85);
  background: linear-gradient(180deg, rgba(180, 120, 20, 0.65), rgba(76, 29, 149, 0.75));
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 180, 0.2),
    0 0 12px rgba(251, 191, 36, 0.35),
    0 3px 0 rgba(120, 53, 15, 0.55);
}

.lw-key--helper:active:not(:disabled) {
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(120, 53, 15, 0.55);
}

.lw-keys-helper .lw-key--helper {
  height: clamp(44px, 5.5vh, 50px);
  min-height: 44px;
  border-radius: 12px;
}

/*
 * سطح مكتب بارتفاع قصير (~1900×570) — حرفان بكل سطر، أزرار ثابتة، scroll داخل اللوحة
 * الشاشات الأطول: 4 حروف بكل سطر (القواعد الافتراضية أعلاه)
 */
@media (min-width: 961px) and (max-height: 680px) {
  html,
  body.lw-body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .lw-shell {
    height: auto;
    min-height: 100dvh;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .lw-keys-card__body {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
  }

  .lw-keys-helper-wrap {
    min-height: 132px;
    flex-shrink: 0;
  }

  .lw-keys-helper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .lw-keys-helper .lw-key--helper {
    height: 46px;
    min-height: 46px;
    max-height: 46px;
  }

  .lw-keyboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 38px;
    align-content: start;
    gap: 6px;
    min-height: 120px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .lw-keyboard .lw-key {
    height: 38px;
    min-height: 38px;
    max-height: 38px;
    font-size: clamp(0.88rem, 1.05rem, 1.08rem);
  }

  .lw-keys-card__foot {
    flex-shrink: 0;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(168, 85, 247, 0.22);
    background: linear-gradient(180deg, rgba(18, 8, 32, 0.55), rgba(18, 8, 32, 0.98));
    box-shadow: 0 -10px 16px rgba(12, 4, 24, 0.65);
  }
}

.lw-keys-helper .lw-key--helper.is-used {
  opacity: 0.28;
  border-style: dashed;
  box-shadow: none;
}

.lw-keys-helper .lw-key--helper.is-no-funds {
  opacity: 0.42;
  cursor: not-allowed;
  border-color: rgba(251, 191, 36, 0.28);
  filter: saturate(0.65);
}

.lw-keys-helper .lw-key--helper.is-no-funds:hover {
  border-color: rgba(251, 191, 36, 0.28);
  background: linear-gradient(180deg, rgba(88, 52, 14, 0.55), rgba(22, 8, 40, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 233, 168, 0.14),
    0 3px 0 rgba(120, 53, 15, 0.55);
}

.lw-key:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.55), rgba(76, 29, 149, 0.65));
  border-color: rgba(168, 85, 247, 0.55);
}

.lw-key:active:not(:disabled) {
  transform: scale(0.96);
}

.lw-key.is-used {
  opacity: 0.22;
  pointer-events: none;
}

/* ≤960px — حروف مساعدة + خانة كتابة (بدون شبكة الأزرار) */
@media (max-width: 960px) {
  .lw-keys-card__body {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    justify-content: flex-start;
  }

  .lw-keys-helper-wrap {
    flex: 0 0 auto;
  }

  .lw-keys-helper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .lw-keys-helper .lw-key--helper {
    height: 36px;
  }

  .lw-letter-input-wrap {
    display: block;
    flex: 0 0 auto;
  }

  .lw-letter-input {
    padding: 8px 6px;
    font-size: 1.2rem;
    border-radius: 10px;
  }

  .lw-keyboard {
    display: none !important;
  }

  .lw-keys-card__foot {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }

  .lw-keys-card__foot .lw-act {
    width: 100%;
    flex: 0 0 auto;
    padding: 7px 6px;
    font-size: 0.72rem;
    gap: 5px;
    white-space: nowrap;
  }

  .lw-keys-card__foot .lw-act i {
    font-size: 0.82rem;
    flex-shrink: 0;
  }
}

.lw-act {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: clamp(8px, 1.2vh, 11px) 8px;
  border-radius: 12px;
  border: none;
  font-family: inherit;
  font-weight: 900;
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.1s, filter 0.12s;
}

.lw-act:active:not(:disabled) { transform: scale(0.98); }
.lw-act:disabled { opacity: 0.42; cursor: not-allowed; }

.lw-act--pass {
  color: var(--text);
  background: rgba(26, 10, 46, 0.85);
  border: 2px solid var(--border);
}

.lw-act--pass:not(:disabled):hover {
  border-color: rgba(251, 191, 36, 0.45);
}

.lw-act--guess {
  color: #fff;
  background: linear-gradient(180deg, var(--purple-light), var(--purple));
  box-shadow: 0 6px 18px var(--purple-glow);
}

.lw-toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 22px;
  border-radius: 999px;
  background: rgba(26, 10, 46, 0.96);
  border: 1px solid rgba(251, 191, 36, 0.55);
  font-weight: 800;
  font-size: 0.88rem;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
}

.lw-toast.is-visible { opacity: 1; }

.lw-sfx {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.lw-miss-flash {
  position: fixed;
  inset: 0;
  z-index: 580;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.lw-miss-flash.is-active {
  opacity: 1;
  visibility: visible;
}

.lw-miss-flash__veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(127, 29, 29, 0.22) 0%, rgba(12, 6, 24, 0.55) 70%);
  opacity: 0;
}

.lw-miss-flash.is-active .lw-miss-flash__veil {
  animation: lw-miss-veil 1.35s ease-out forwards;
}

@keyframes lw-miss-veil {
  0% { opacity: 0; }
  12% { opacity: 1; }
  78% { opacity: 1; }
  100% { opacity: 0; }
}

.lw-miss-flash__badge {
  position: relative;
  width: clamp(7.5rem, 28vmin, 11rem);
  height: clamp(7.5rem, 28vmin, 11rem);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.5);
  opacity: 0;
}

.lw-miss-flash.is-active .lw-miss-flash__badge {
  animation: lw-miss-badge 1.35s cubic-bezier(0.34, 1.28, 0.64, 1) forwards;
}

@keyframes lw-miss-badge {
  0% {
    transform: scale(0.45) rotate(-8deg);
    opacity: 0;
  }
  16% {
    transform: scale(1.06) rotate(0deg);
    opacity: 1;
  }
  74% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: scale(0.92) rotate(2deg);
    opacity: 0;
  }
}

.lw-miss-flash__ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.lw-miss-flash__ring--outer {
  inset: -12%;
  border: 2px solid rgba(248, 113, 113, 0.35);
  opacity: 0;
}

.lw-miss-flash__ring--inner {
  inset: -4%;
  border: 1px solid rgba(254, 202, 202, 0.45);
  opacity: 0;
}

.lw-miss-flash.is-active .lw-miss-flash__ring--outer {
  animation: lw-miss-ring 1.35s ease-out forwards;
}

.lw-miss-flash.is-active .lw-miss-flash__ring--inner {
  animation: lw-miss-ring 1.35s ease-out 0.06s forwards;
}

@keyframes lw-miss-ring {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  22% {
    opacity: 1;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

.lw-miss-flash__icon {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.45));
}

.lw-miss-flash__disc {
  fill: url(#lwMissGrad);
  stroke: rgba(254, 226, 226, 0.85);
  stroke-width: 2;
}

.lw-miss-flash__mark {
  fill: none;
  stroke: #fff;
  stroke-width: 5.5;
  stroke-linecap: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
}

.lw-miss-flash.is-active .lw-miss-flash__mark {
  animation: lw-miss-stroke 0.42s cubic-bezier(0.34, 1.2, 0.64, 1) 0.12s forwards;
}

@keyframes lw-miss-stroke {
  to { stroke-dashoffset: 0; }
}

.lw-guess {
  position: fixed;
  inset: 0;
  z-index: 620;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.lw-guess[hidden] {
  display: none !important;
}

.lw-guess__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(8, 2, 18, 0.72);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.lw-guess__panel {
  position: relative;
  width: min(100%, 420px);
  padding: clamp(18px, 3vh, 26px) clamp(16px, 4vw, 24px);
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(45, 26, 74, 0.98), rgba(18, 8, 32, 0.98));
  border: 2px solid rgba(251, 191, 36, 0.45);
  box-shadow:
    0 0 0 1px rgba(124, 58, 237, 0.35),
    0 24px 48px rgba(0, 0, 0, 0.55);
  text-align: center;
  animation: lw-guess-in 0.22s cubic-bezier(0.34, 1.25, 0.64, 1);
}

@keyframes lw-guess-in {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.lw-guess__title {
  margin: 0 0 6px;
  font-size: clamp(1.05rem, 2.8vmin, 1.35rem);
  font-weight: 900;
  color: #fff;
}

.lw-guess__sub {
  margin: 0 0 14px;
  font-size: 0.88rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
}

.lw-guess__input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  margin: 0 0 16px;
  border-radius: 14px;
  border: 2px solid rgba(196, 181, 253, 0.45);
  background: rgba(255, 255, 255, 0.96);
  color: #1a0a2e;
  font-family: inherit;
  font-size: clamp(1.05rem, 3vmin, 1.25rem);
  font-weight: 800;
  text-align: center;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.lw-guess__input::placeholder {
  color: rgba(76, 29, 149, 0.45);
  font-weight: 700;
}

.lw-guess__input:focus {
  border-color: #f0b429;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.28);
}

.lw-guess__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.lw-guess__btn {
  flex: 1;
  max-width: 160px;
  padding: 12px 14px;
  border-radius: 12px;
  border: none;
  font-family: inherit;
  font-weight: 900;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.1s, filter 0.12s;
}

.lw-guess__btn:active {
  transform: scale(0.98);
}

.lw-guess__btn--ghost {
  color: #fff;
  background: rgba(26, 10, 46, 0.85);
  border: 2px solid rgba(196, 181, 253, 0.35);
}

.lw-guess__btn--primary {
  color: #1a0a2e;
  background: linear-gradient(180deg, #ffe9a8, #f0b429);
  box-shadow: 0 6px 16px rgba(251, 191, 36, 0.35);
}

.lw-body.is-guess-open {
  overflow: hidden;
}

.lw-loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 10, 46, 0.94);
  z-index: 100;
  font-weight: 800;
  color: var(--gold-light);
}

.lw-loading[hidden] { display: none !important; }

/* ——— احتفال حل الكلمة (وسط اللوحة + شرطان) ——— */
.lw-win {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: clamp(10px, 3vmin, 24px);
  pointer-events: none;
  overflow: hidden;
}

.lw-win[hidden] {
  display: none !important;
}

.lw-win.is-active {
  pointer-events: auto;
}

.lw-win__edge-btn {
  position: absolute;
  z-index: 6;
  top: clamp(8px, 2vmin, 14px);
  inset-inline-start: clamp(8px, 2vmin, 14px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  background: rgba(8, 3, 18, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
  transition: background 0.15s ease, transform 0.15s ease;
}

.lw-win__edge-btn:hover,
.lw-win__edge-btn:focus-visible {
  background: rgba(8, 3, 18, 0.72);
  outline: none;
  transform: translateY(-1px);
}

.lw-win__edge-btn i {
  font-size: 0.9rem;
  opacity: 0.95;
}

.lw-win__board-edge {
  position: absolute;
  z-index: 7;
  top: clamp(8px, 2vmin, 14px);
  inset-inline-start: clamp(8px, 2vmin, 14px);
  padding: 8px 14px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  color: #1a0a2e;
  background: linear-gradient(180deg, #ffe9a8, var(--lw-win-team, #f0b429));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
}

.lw-win__board-edge[hidden] {
  display: none !important;
}

.lw-win__board-edge:hover,
.lw-win__board-edge:focus-visible {
  filter: brightness(1.05);
  outline: none;
}

.lw-win__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 90% at 50% 42%, var(--lw-win-team-soft, rgba(56, 189, 248, 0.38)), transparent 60%),
    linear-gradient(180deg, rgba(8, 3, 18, 0.5) 0%, rgba(8, 3, 18, 0.82) 100%);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  opacity: 0;
  transition: opacity 0.45s ease;
}

.lw-win.is-active .lw-win__veil {
  opacity: 1;
}

.lw-win__bloom {
  position: absolute;
  inset: -20%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, var(--lw-win-team-glow, rgba(56, 189, 248, 0.4)) 0%, transparent 65%);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
  transition: opacity 0.5s ease, transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.lw-win.is-active .lw-win__bloom {
  opacity: 1;
  transform: scale(1);
}

.lw-win__confetti {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.lw-confetti-burst {
  position: absolute;
  width: 0;
  height: 0;
  transform: translate(-50%, 50%);
  z-index: 1;
}

.lw-confetti-burst__flash {
  position: absolute;
  left: 0;
  top: 0;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffef5 0%, var(--lw-win-team, #f0b429) 35%, transparent 72%);
  opacity: 0;
  transform: scale(0.2);
  pointer-events: none;
}

.lw-win.is-active .lw-confetti-burst__flash {
  animation: lw-popper-flash 0.55s ease-out var(--lw-burst-delay, 0s) infinite;
}

.lw-confetti {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  will-change: transform, opacity;
  box-shadow: 0 0 8px var(--lw-win-team-glow, rgba(56, 189, 248, 0.35));
}

.lw-win.is-active .lw-confetti--shard {
  animation: lw-confetti-pop ease-out infinite;
}

.lw-confetti--shard.is-streamer {
  width: var(--lw-c-w, 5px);
  height: var(--lw-c-h, 48px);
  border-radius: 999px;
  transform-origin: center bottom;
  filter: drop-shadow(0 2px 5px var(--lw-win-team-glow, rgba(56, 189, 248, 0.35)));
}

@keyframes lw-popper-flash {
  0% {
    opacity: 0;
    transform: scale(0.15);
  }
  18% {
    opacity: 1;
    transform: scale(1.35);
  }
  100% {
    opacity: 0;
    transform: scale(2.2);
  }
}

@keyframes lw-confetti-pop {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.25) rotate(0deg);
  }
  8% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1) rotate(calc(var(--lw-c-spin, 180deg) * 0.08));
  }
  28% {
    opacity: 1;
    transform: translate3d(var(--lw-pop-peak-x, 0px), var(--lw-pop-peak-y, -80px), 0)
      rotate(calc(var(--lw-c-spin, 360deg) * 0.35));
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--lw-pop-end-x, 0px), var(--lw-pop-end-y, 160px), 0)
      rotate(var(--lw-c-spin, 360deg));
  }
}

.lw-win__stage {
  position: relative;
  z-index: 4;
  width: min(100%, 420px);
  max-height: 100%;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(12px, 2.5vmin, 20px);
  margin-inline: auto;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.45s ease 0.1s, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.1s;
}

.lw-win.is-active .lw-win__stage {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.lw-win__content,
.lw-win__panel {
  position: relative;
  width: 100%;
  text-align: center;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.lw-win__content::before,
.lw-win__panel::before {
  display: none;
}

.lw-win__eyebrow {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--lw-win-team, var(--gold-light));
  text-shadow: 0 2px 20px var(--lw-win-team-glow, rgba(56, 189, 248, 0.5));
}

.lw-win__hero {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.lw-win__ring {
  position: relative;
  width: clamp(84px, 15vmin, 112px);
  height: clamp(84px, 15vmin, 112px);
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(145deg, var(--gold-light), var(--lw-win-team, #38bdf8) 45%, #7c3aed);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.15),
    0 12px 32px var(--lw-win-team-glow, rgba(56, 189, 248, 0.35));
}

.lw-win__photo,
.lw-win__initial {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #1a0a2e;
}

.lw-win__photo[hidden],
.lw-win__initial[hidden] {
  display: none !important;
}

.lw-win__initial {
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 900;
  color: #fff8e7;
}

.lw-win__name {
  margin: 0 0 6px;
  font-size: clamp(1.75rem, 7vmin, 2.65rem);
  font-weight: 900;
  line-height: 1.25;
  color: #fff;
  text-shadow:
    0 2px 24px var(--lw-win-team-glow, rgba(56, 189, 248, 0.55)),
    0 1px 0 rgba(0, 0, 0, 0.35);
}

.lw-win__tagline {
  margin: 0;
  font-size: clamp(0.9rem, 2.2vmin, 1.05rem);
  font-weight: 800;
  color: var(--lw-win-team, #38bdf8);
  text-shadow: 0 1px 16px var(--lw-win-team-glow, rgba(56, 189, 248, 0.45));
}

.lw-win__bonus {
  display: block;
  margin: 10px 0 0;
  padding: 0 4px;
  max-width: 100%;
  font-size: clamp(0.8rem, 2vmin, 0.9rem);
  font-weight: 800;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.94);
  background: none;
  border: none;
  box-shadow: none;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.45);
}

.lw-win__bonus[hidden] {
  display: none !important;
}

.lw-win__next {
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: clamp(4px, 1.5vmin, 14px);
}

.lw-win__next-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  font-size: clamp(0.95rem, 2.4vmin, 1.12rem);
  padding: 14px 20px;
  border-radius: 14px;
  color: #1a0a2e;
  background: linear-gradient(180deg, #ffe9a8, var(--lw-win-team, #f0b429));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.lw-win__next-btn:hover,
.lw-win__next-btn:focus-visible {
  filter: brightness(1.06);
  outline: none;
}

.lw-win__next-btn:active {
  transform: translateY(1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.lw-win__next-meta {
  margin: 0;
  font-size: clamp(0.78rem, 2vmin, 0.88rem);
  font-weight: 800;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

.lw-puzzle-grid.is-solving .lw-tile--slot.is-revealed {
  animation: lw-tile-reveal 0.42s cubic-bezier(0.34, 1.35, 0.64, 1);
}

/* —— جوال: اللعب أفقي فقط —— */
.lw-orientation-warning {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 24px max(20px, env(safe-area-inset-left), env(safe-area-inset-right));
  font-family: 'Cairo', sans-serif;
  color: #fff8e7;
  background: linear-gradient(145deg, #1a0a2e 0%, #4c1d95 45%, #7c3aed 100%);
}

.lw-orientation-warning h2 {
  margin: 0 0 12px;
  font-size: clamp(1.25rem, 5vw, 1.65rem);
  font-weight: 800;
}

.lw-orientation-warning p {
  margin: 0;
  font-size: clamp(0.95rem, 3.8vw, 1.1rem);
  line-height: 1.65;
  max-width: 22rem;
  color: rgba(255, 248, 231, 0.92);
}

.lw-orientation-warning__icon {
  font-size: clamp(3.5rem, 18vw, 5rem);
  margin-bottom: 1.25rem;
  animation: lw-orientation-hint 2s ease-in-out infinite;
}

@keyframes lw-orientation-hint {
  0%, 100% { transform: rotate(90deg); }
  50% { transform: rotate(0deg); }
}

@media screen and (max-width: 768px) and (orientation: portrait) {
  body.lw-body > *:not(.lw-orientation-warning) {
    display: none !important;
  }

  body.lw-body .lw-orientation-warning {
    display: flex !important;
  }
}

/* —— تلفزيون / شاشة كبيرة: تمرير القوائم + ارتفاع آمن (بدون تغيير الشكل) —— */
html.thannak-tv .lw-shell {
  height: 100vh;
  height: 100dvh;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

html.thannak-tv .lw-main {
  min-height: min(72vh, 720px);
}

html.thannak-tv .lw-wheel-stage {
  min-height: clamp(140px, 22vh, 280px);
}

html.thannak-tv .lw-keys-card__body {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

html.thannak-tv .lw-keyboard {
  flex: 1 1 0;
  min-height: 0;
  grid-auto-rows: 36px;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

html.thannak-tv .lw-keyboard .lw-key {
  height: 36px;
  min-height: 36px;
  max-height: 36px;
}

html.thannak-tv .lw-keys-card__foot {
  flex-shrink: 0;
  padding-bottom: max(10px, env(safe-area-inset-bottom, 8px));
}

/* شاشات عريضة بارتفاع متوسط (متصفحات التلفزيون) — نفس منطق التمرير */
@media (min-width: 961px) and (max-height: 920px) {
  html:not(.thannak-tv) body.lw-body .lw-shell {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
  }

  html:not(.thannak-tv) body.lw-body .lw-keys-card__body {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
  }

  html:not(.thannak-tv) body.lw-body .lw-keyboard {
    flex: 1 1 0;
    min-height: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 36px;
    align-content: start;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  html:not(.thannak-tv) body.lw-body .lw-keyboard .lw-key {
    height: 36px;
    min-height: 36px;
    max-height: 36px;
  }

  html:not(.thannak-tv) body.lw-body .lw-wheel-stage {
    min-height: clamp(120px, 20vh, 240px);
  }
}
