:root {
  --bg: #0c1410;
  --bg2: #122018;
  --panel: rgba(18, 32, 24, 0.88);
  --sand: #e8d5a8;
  --sand-dim: rgba(232, 213, 168, 0.55);
  --terracotta: #c45c3e;
  --terracotta-hot: #e07a55;
  --green: #2d6a4f;
  --green-bright: #40916c;
  --olive: #52796f;
  --text: #f4efe4;
  --muted: rgba(244, 239, 228, 0.58);
  --line: rgba(232, 213, 168, 0.18);
  --ok: #74c69d;
  --danger: #e76f51;
  --glow: rgba(64, 145, 108, 0.45);
  --font-display: "Cormorant Garamond", "Palatino Linotype", Georgia, serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse 80% 50% at 15% -10%, rgba(196, 92, 62, 0.22), transparent 50%),
    radial-gradient(ellipse 70% 45% at 90% 10%, rgba(45, 106, 79, 0.35), transparent 48%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(232, 213, 168, 0.08), transparent 45%),
    linear-gradient(165deg, #0a120e 0%, #122018 42%, #0e1a14 100%);
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}
a { color: var(--sand); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.app-wrap {
  position: relative;
  z-index: 1;
  max-width: min(1480px, 96vw);
  margin: 0 auto;
  padding: 28px 28px 64px;
}
@media (min-width: 1200px) {
  .app-wrap { padding-inline: 36px; }
}

/* Ã¢ÂÂÃ¢ÂÂ Home Ã¢ÂÂÃ¢ÂÂ */
.hero {
  text-align: center;
  padding: 48px 12px 36px;
  animation: rise 0.7s ease both;
}
.hero-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--terracotta-hot);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.hero-mark::before,
.hero-mark::after {
  content: "";
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--terracotta));
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 8vw, 4.2rem);
  margin: 0 0 10px;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--sand) 20%, #fff8e7 50%, var(--terracotta-hot) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.05;
}
.hero p {
  margin: 0 auto 18px;
  max-width: 56ch;
  color: var(--sand-dim);
  font-size: 1.05rem;
  line-height: 1.55;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 14px auto 0;
  width: min(100%, 920px);
}
.mode-picker,
.lb-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
}
.mode-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-inline-end: 4px;
}
.mode-btn {
  appearance: none;
  min-width: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(45, 106, 79, 0.2);
  color: var(--sand);
  font: 700 0.9rem var(--font-body);
  cursor: pointer;
}
.mode-btn:hover { border-color: var(--green-bright); }
.mode-btn.on {
  background: linear-gradient(145deg, var(--terracotta-hot), var(--terracotta));
  color: #1a0c08;
  border-color: transparent;
}
.lb-modes {
  justify-content: flex-start;
  margin: 0 0 14px;
}

.contact-card {
  margin: 36px auto 0;
  max-width: 720px;
  text-align: left;
  padding: 22px 24px;
  border: 1px solid rgba(232, 213, 168, 0.22);
  background: linear-gradient(160deg, rgba(18, 28, 22, 0.92), rgba(10, 16, 12, 0.88));
  border-radius: 14px;
}

.contact-card h2 {
  margin: 0 0 8px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.45rem;
  font-weight: 600;
  color: #f2e6c9;
}

.contact-card > p {
  margin: 0 0 14px;
  color: rgba(245, 243, 232, 0.72);
  font-size: 0.92rem;
  line-height: 1.45;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.contact-list li {
  display: grid;
  gap: 2px;
}

.contact-list span:first-child {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232, 213, 168, 0.7);
}

.contact-list strong,
.contact-list a {
  color: #f7f1df;
  font-weight: 600;
  text-decoration: none;
}

.contact-list a:hover {
  color: #e8d5a8;
  text-decoration: underline;
}

.contact-email-hint {
  font-size: 0.78rem;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 13px 22px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.15s ease, border-color 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(145deg, var(--terracotta-hot), var(--terracotta));
  color: #1a0c08;
  box-shadow: 0 10px 28px rgba(196, 92, 62, 0.35);
}
.btn-primary:hover { box-shadow: 0 14px 36px rgba(196, 92, 62, 0.5); }
.btn-ghost {
  background: rgba(45, 106, 79, 0.25);
  border-color: var(--line);
  color: var(--sand);
}
.btn-ghost:hover { border-color: var(--green-bright); background: rgba(64, 145, 108, 0.28); }
.btn-sand {
  background: var(--sand);
  color: #1a140c;
}
.btn-sand:hover { filter: brightness(1.05); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-sm { padding: 8px 12px; font-size: 0.85rem; border-radius: 9px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  animation: rise 0.45s ease both;
}
.panel h2 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 6px;
  font-size: 1.65rem;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* Ã¢ÂÂÃ¢ÂÂ Play Ã¢ÂÂÃ¢ÂÂ */
.play-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.play-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.9rem;
  color: var(--muted);
}
.play-meta strong { color: var(--sand); font-variant-numeric: tabular-nums; }
.score-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(196, 92, 62, 0.18);
  border: 1px solid rgba(196, 92, 62, 0.35);
  color: var(--terracotta-hot);
  font-weight: 700;
  font-size: 0.85rem;
}

.play-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 18px;
  align-items: start;
}
.play-grid.expert-layout {
  grid-template-columns: 1fr;
  max-width: 720px;
  margin-inline: auto;
}
#view-play.is-expert #guess-col,
#view-play.is-expert #btn-open-map,
#view-play.is-expert #mobile-guess-dock,
#view-play.is-expert #map-sheet {
  display: none !important;
}
.expert-result-locs {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.22);
}
.expert-result-locs p { margin: 0; line-height: 1.45; }
@media (max-width: 860px) {
  .play-grid { grid-template-columns: 1fr; }
}

.photo-stage {
  position: relative;
  width: 100%;
  max-width: 100%;
  border-radius: 16px;
  overflow: hidden;
  isolation: isolate;
  contain: paint;
  border: 1px solid var(--line);
  background: #06100a;
  aspect-ratio: 4 / 3;
  min-height: 220px;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
.photo-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #06100a;
  z-index: 0;
  /* Force hardware clip on Android Chrome Ã¢ÂÂ transforms must not widen the page */
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  contain: paint;
}
.photo-stage img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  transform-origin: center center;
  will-change: transform;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}
.photo-stage.is-panning .photo-spoiler-mask { cursor: grabbing; }
.photo-zoom-controls { z-index: 4; }
.photo-zoom-tip {
  margin: 8px 0 0;
  font-size: 0.78rem;
}
.photo-stage.reveal-0 img,
.photo-stage.reveal-1 img,
.photo-stage.reveal-2 img,
.photo-stage.reveal-3 img { filter: none; }
.photo-spoiler-mask {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  z-index: 2;
  background: transparent;
  cursor: grab;
  touch-action: none;
}
.play-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.play-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
#btn-open-map {
  display: none;
  font-weight: 700;
}
.reveal-hint {
  font-size: 0.82rem;
  color: var(--muted);
  flex: 1;
  min-width: 120px;
}
.photo-credit {
  margin: 0 0 12px;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}

.guess-col { display: flex; flex-direction: column; gap: 12px; }
.map-wrap {
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 45% 25%, rgba(64, 145, 108, 0.18), transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(12, 40, 55, 0.55), transparent 55%),
    linear-gradient(180deg, #0e1c14, #07110c);
  overflow: hidden;
  min-height: 400px;
  height: min(62vh, 600px);
  touch-action: none;
  user-select: none;
}
#map-root,
.svg-map-host {
  width: 100%;
  height: 100%;
  min-height: 400px;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.svg-map-host.is-panning { cursor: grabbing; }
.wg-algeria-map {
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
}
.map-zoom {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.map-zoom-btn {
  min-width: 36px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(232, 213, 168, 0.35);
  background: rgba(8, 16, 12, 0.88);
  color: var(--sand);
  font: 600 1rem var(--font-body);
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.map-zoom-btn:hover {
  border-color: var(--green-bright);
  background: rgba(64, 145, 108, 0.35);
}
.map-zoom-wide { font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; }
.wilaya-hit {
  cursor: pointer;
  fill: #1a5c40;
  stroke: rgba(232, 213, 168, 0.55);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
  transition: fill 0.15s ease, stroke 0.15s ease, filter 0.15s ease;
  outline: none;
}
.wilaya-hit.tone-0 { fill: #1a5c40; }
.wilaya-hit.tone-1 { fill: #1f6b4a; }
.wilaya-hit.tone-2 { fill: #245c45; }
.wilaya-hit.glow,
.wilaya-hit:hover {
  fill: #52b788;
  stroke: #f4e4bc;
  stroke-width: 2.2;
  filter: url(#wg-glow);
}
.wilaya-hit.selected {
  fill: #c45c3e;
  stroke: #fff8e7;
  stroke-width: 2.6;
  filter: drop-shadow(0 0 18px rgba(196, 92, 62, 0.75));
}
.wilaya-hit.correct {
  fill: #34d399;
  stroke: #d8f3dc;
  stroke-width: 2.6;
}
.wilaya-hit.wrong {
  fill: #f87171;
  stroke: #ffddd2;
  stroke-width: 2.2;
}
.wilaya-hit.pulse-correct {
  animation: wgPulseCorrect 1.1s ease-out 2;
}
.wilaya-hit.heat-1 { fill: #65a30d; stroke: #d9f99d; }
.wilaya-hit.heat-2 { fill: #ca8a04; stroke: #fde68a; }
.wilaya-hit.heat-3 { fill: #c2410c; stroke: #fdba74; opacity: 0.92; }
@keyframes wgPulseCorrect {
  0% { filter: drop-shadow(0 0 0 rgba(52, 211, 153, 0)); }
  40% { filter: drop-shadow(0 0 16px rgba(52, 211, 153, 0.95)); stroke-width: 3.4; }
  100% { filter: drop-shadow(0 0 0 rgba(52, 211, 153, 0)); }
}
.map-tip {
  position: absolute;
  left: 12px;
  bottom: 10px;
  right: 12px;
  font-size: 0.78rem;
  color: var(--sand-dim);
  pointer-events: none;
  z-index: 2;
  text-shadow: 0 1px 8px rgba(0,0,0,.8);
}
.selected-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(232, 213, 168, 0.08);
  border: 1px solid var(--line);
}
.selected-banner strong { font-size: 1.05rem; }
.banner-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.map-sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.map-sheet-actions .btn-confirm-lg { width: 100%; }
.map-sheet-actions .btn-skip-secondary {
  width: 100%;
  justify-content: center;
  opacity: 0.85;
  font-weight: 600;
}
.howto-card { max-width: 480px; }
.howto-list {
  margin: 12px 0 18px;
  padding-left: 1.2rem;
  color: var(--sand-dim);
  line-height: 1.55;
  font-size: 0.92rem;
}
.howto-list li { margin-bottom: 8px; }

.result-card {
  text-align: center;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  animation: pop 0.35s ease both;
  margin-top: 12px;
}
.result-card.ok { background: rgba(116, 198, 157, 0.12); border-color: rgba(116, 198, 157, 0.35); }
.result-card.close { background: rgba(234, 179, 8, 0.12); border-color: rgba(234, 179, 8, 0.4); }
.result-card.bad { background: rgba(231, 111, 81, 0.12); border-color: rgba(231, 111, 81, 0.35); }
.result-card h3 {
  font-family: var(--font-display);
  margin: 0 0 6px;
  font-size: 1.5rem;
}

/* Ã¢ÂÂÃ¢ÂÂ Lists / forms Ã¢ÂÂÃ¢ÂÂ */
.table-wrap { overflow: auto; max-height: 420px; }
table.lb {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
table.lb th, table.lb td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
table.lb th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  position: sticky;
  top: 0;
  background: #122018;
}
table.lb tr:hover td { background: rgba(64, 145, 108, 0.08); }
.rank { color: var(--terracotta-hot); font-weight: 800; width: 2.5rem; }

.form-grid {
  display: grid;
  gap: 12px;
}
.form-grid label {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}
.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font: inherit;
}
.form-grid textarea { min-height: 80px; resize: vertical; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.form-msg { min-height: 1.2em; font-size: 0.88rem; }
.form-msg.ok { color: var(--ok); }
.form-msg.bad { color: var(--danger); }

.finish-box { text-align: center; max-width: 720px; margin: 0 auto; }
.finish-box.is-duel { max-width: 1100px; }
.finish-box .big-score {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--sand);
  margin: 8px 0 18px;
}
.finish-box.is-duel .big-score { display: none; }
.finish-recap-title {
  margin: 22px 0 12px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--sand);
  text-align: left;
}
.finish-box.is-duel .finish-recap-title { display: none; }
.finish-box.is-duel #finish-recap { display: none; }
.finish-recap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  margin-bottom: 8px;
}
.recap-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: stretch;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(12, 22, 16, 0.72);
}
.recap-card.ok { border-color: rgba(116, 198, 157, 0.4); }
.recap-card.bad { border-color: rgba(231, 111, 81, 0.35); }
.recap-card.skip { border-color: rgba(232, 213, 168, 0.28); }
.recap-thumb {
  border-radius: 10px;
  overflow: hidden;
  background: #0a120e;
  aspect-ratio: 1;
}
.recap-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.recap-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}
.recap-round {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}
.recap-status {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
}
.recap-status.ok { background: rgba(116, 198, 157, 0.2); color: #9be4bd; }
.recap-status.bad { background: rgba(231, 111, 81, 0.2); color: #f0a090; }
.recap-status.skip { background: rgba(232, 213, 168, 0.14); color: var(--sand-dim); }
.recap-pts {
  margin-inline-start: auto;
  font-weight: 700;
  color: var(--sand);
  font-size: 0.9rem;
}
.recap-loc { font-weight: 600; color: var(--sand); font-size: 0.95rem; }
.recap-ar, .recap-guess { font-size: 0.8rem; margin-top: 2px; }

@media (max-width: 560px) {
  .recap-card { grid-template-columns: 76px 1fr; }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: #1a2e22;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 50;
  max-width: min(90vw, 360px);
  text-align: center;
  font-size: 0.9rem;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { border-color: rgba(231, 111, 81, 0.45); color: #ffddd2; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes pop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 560px) {
  html, body { overflow-x: hidden; max-width: 100vw; }
  .app-wrap {
    padding: 10px 12px calc(24px + env(safe-area-inset-bottom));
    max-width: 100vw;
    overflow-x: hidden;
  }
  .hero { padding: 18px 0 20px; }
  .hero h1 { font-size: clamp(2.1rem, 11vw, 2.8rem); margin-bottom: 8px; }
  .hero p {
    font-size: 0.95rem;
    margin-bottom: 14px;
    max-width: 34ch;
  }
  .hero-mark { font-size: 0.68rem; margin-bottom: 10px; }
  .settings-panel {
    width: 100%;
    margin: 4px auto 14px;
    padding: 14px 12px 12px;
    border-radius: 16px;
  }
  .settings-head { margin-bottom: 12px; padding-bottom: 10px; }
  .settings-head strong { font-size: 1.05rem; }
  .settings-row {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 12px;
  }
  .settings-chips { gap: 6px; }
  .settings-panel .mode-btn {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 0.84rem;
  }
  .settings-panel .mode-explain {
    font-size: 0.8rem;
    line-height: 1.4;
  }
  .hero-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
  }
  .hero-actions .btn {
    width: 100%;
    min-height: 46px;
    justify-content: center;
    font-size: 0.88rem;
    padding: 10px 12px;
  }
  .hero-actions #btn-play,
  .hero-actions #btn-daily {
    grid-column: 1 / -1;
  }
  .hero-actions #btn-play { min-height: 50px; font-size: 1rem; }
  .coming-grid {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 16px 0 12px;
  }
  .coming-card { padding: 14px; }
  .potw-card, .contact-card { width: 100%; }
  .lang-btn { min-width: 38px; padding: 6px 10px; font-size: 0.72rem; }
  .panel {
    padding: 12px;
    border-radius: 18px;
    overflow: hidden;
    max-width: 100%;
  }
  .site-bar { margin-bottom: 6px; }
  .play-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 12px;
  }
  .play-meta {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    width: 100%;
  }
  .play-meta > span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(0,0,0,.22);
    border: 1px solid var(--line);
    font-size: 0.72rem;
  }
  .play-meta strong { font-size: 0.95rem; }
  .score-chip {
    width: 100%;
    justify-content: space-between;
    border-radius: 12px;
    padding: 8px 10px;
  }
  #btn-quit { width: 100%; min-height: 40px; }
  .play-grid { gap: 12px; }
  .guess-col > #map-wrap { display: none; }
  /* Keep result-map visible even though desktop map column is hidden on phone */
  #result-map-host #map-wrap,
  #result-map-host #map-wrap.in-result,
  .map-sheet-body #map-wrap { display: block !important; }
  .selected-banner { display: none; }
  .photo-col {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }
  .photo-stage {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 3 / 4;
    height: auto;
    min-height: 260px;
    max-height: min(58vh, 520px);
    border-radius: 18px;
  }
  .photo-zoom-tip { display: none; }
  .photo-zoom-controls {
    top: 8px;
    right: 8px;
  }
  .map-zoom-btn { min-width: 34px; height: 32px; }
  .play-actions { margin-top: 12px; gap: 10px; }
  #view-play.round-answered .play-actions { display: none; }
  #view-play.round-answered .photo-stage {
    max-height: min(28vh, 220px);
    min-height: 120px;
  }
  .result-map-host {
    height: min(46vh, 360px);
    min-height: 240px;
  }
  .result-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .result-actions .btn { width: 100%; min-height: 46px; }
  #btn-open-map { width: 100%; min-height: 48px; }
  #view-play.round-answered #result-slot {
    position: relative;
    z-index: 2;
  }
  #view-play.round-answered .result-card {
    margin-top: 10px;
    box-shadow: 0 10px 28px rgba(0,0,0,.28);
  }
  #btn-open-map {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    font-size: 1rem;
    border-radius: 14px;
  }
  .play-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
  }
  .reveal-hint {
    flex: 1 1 100%;
    text-align: center;
    margin-top: 2px;
  }
  .map-sheet-body #map-wrap {
    display: block;
    min-height: 0;
    height: 100%;
  }
  .map-sheet-body #map-root,
  .map-sheet-body .svg-map-host {
    min-height: 0;
    height: 100%;
  }
  .mobile-guess-dock {
    display: none;
    position: fixed;
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 40;
    margin: 0;
    gap: 8px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(10, 18, 14, 0.96);
    backdrop-filter: blur(10px);
    box-shadow: 0 12px 40px rgba(0,0,0,.45);
  }
  .mobile-guess-dock.has-selection {
    display: flex;
  }
  body.wg-map-open .mobile-guess-dock { display: none !important; }
  body.wg-map-open { overflow: hidden; }
  .mobile-guess-dock .dock-selected {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: none;
    justify-content: space-between;
  }
  .mobile-guess-dock .dock-selected span {
    font-size: 0.8rem;
    color: var(--sand-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 42%;
  }
  .mobile-guess-dock #btn-confirm-mobile {
    min-height: 46px;
    padding: 12px 16px;
    font-size: 0.95rem;
    flex: 1;
  }
  #view-play.panel { padding-bottom: 24px; }
  #view-play.panel.has-dock-pad { padding-bottom: 96px; }
  .map-sheet-panel {
    height: min(82vh, 760px);
    border-radius: 22px 22px 0 0;
  }
  .map-sheet-backdrop { background: rgba(0, 0, 0, 0.45); }
  .result-slot, #result-slot { width: 100%; }
}

.site-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.site-brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--sand);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.lang-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
}
.lang-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 12px;
  font: 700 0.78rem var(--font-body);
  letter-spacing: 0.04em;
  cursor: pointer;
  min-width: 42px;
}
.lang-btn:hover { color: var(--sand); border-color: rgba(232, 213, 168, 0.25); }
.lang-btn.on {
  color: #1a0c08;
  background: linear-gradient(145deg, var(--terracotta-hot), var(--terracotta));
  border-color: transparent;
}

.mobile-guess-dock { display: none; }

.map-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
#map-root,
.svg-map-host {
  display: flex;
  align-items: center;
  justify-content: center;
}
.wg-algeria-map {
  margin: 0 auto;
  max-width: 100%;
  max-height: 100%;
}

/* Full-screen map sheet (phones) */
.map-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.map-sheet.hidden { display: none !important; }
.map-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.map-sheet-panel {
  position: relative;
  z-index: 1;
  height: min(92vh, 820px);
  display: flex;
  flex-direction: column;
  border-radius: 18px 18px 0 0;
  border: 1px solid var(--line);
  background: #0e1a14;
  padding:
    8px
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  box-shadow: 0 -20px 60px rgba(0,0,0,.5);
  animation: rise 0.25s ease both;
}
.map-sheet-grab {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  background: rgba(232, 213, 168, 0.35);
  margin: 4px auto 10px;
}
.map-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.map-sheet-body {
  flex: 1;
  min-height: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 50% 30%, rgba(64, 145, 108, 0.18), transparent 50%),
    linear-gradient(180deg, #0e1c14, #07110c);
}
.map-sheet-body .map-wrap,
.map-sheet-body #map-root {
  min-height: 100%;
  height: 100%;
}
.map-sheet-foot {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding-top: 10px;
  flex-shrink: 0;
}
.map-sheet-picked {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.map-sheet-picked .muted {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.map-sheet-picked strong,
.map-sheet-foot span {
  font-size: 0.95rem;
  color: var(--sand);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-confirm-lg {
  min-height: 48px;
  width: 100%;
  font-size: 1rem;
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
}
.map-sheet.has-selection #btn-confirm-sheet:not(:disabled) {
  box-shadow: 0 0 0 2px rgba(232, 213, 168, 0.55), 0 12px 28px rgba(196, 92, 62, 0.35);
  animation: confirmPulse 1.4s ease-in-out infinite;
}
@keyframes confirmPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,.55);
}
.modal.hidden { display: none !important; }
.modal-card {
  width: min(100%, 420px);
  background: #122018;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.skip-confirm-card { text-align: center; }
.skip-confirm-card h3 {
  font-family: var(--font-display);
  margin: 0 0 8px;
  color: var(--sand);
}
.skip-confirm-card .muted { margin: 0 0 16px; }
.skip-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.modal-card h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

html[lang="ar"] body {
  font-family: "DM Sans", "Segoe UI", Tahoma, sans-serif;
}
/* Keep LTR layout even in Arabic Ã¢ÂÂ no flip */
html[lang="ar"] { direction: ltr; }

/* ââ Modes / packs / daily / heat ââ */
.settings-panel {
  width: min(100%, 640px);
  margin: 8px auto 18px;
  padding: 16px 18px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(165deg, rgba(18, 32, 24, 0.92), rgba(10, 16, 12, 0.88));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  text-align: left;
}
.settings-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(232, 213, 168, 0.12);
}
.settings-kicker {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terracotta-hot);
}
.settings-head strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--sand);
  font-weight: 600;
}
.settings-row {
  display: grid;
  grid-template-columns: minmax(88px, 110px) 1fr;
  gap: 10px 14px;
  align-items: center;
  margin-bottom: 10px;
}
.settings-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.settings-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}
.settings-panel .mode-explain {
  margin: 8px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(232, 213, 168, 0.1);
  max-width: none;
  text-align: left;
  font-size: 0.86rem;
}
.setup-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  margin: 18px auto 8px;
  width: min(100%, 560px);
}
.mode-explain {
  margin: 0 auto 14px;
  font-size: 0.88rem;
  max-width: 52ch;
  line-height: 1.45;
  text-align: center;
}
@media (max-width: 560px) {
  .settings-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .settings-panel { padding: 14px; }
}
.coming-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 22px auto 18px;
  width: min(100%, 1100px);
}
.coming-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: rgba(0,0,0,.22);
  text-align: left;
}
.coming-card h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--sand);
}
.coming-card p { margin: 0 0 10px; color: var(--muted); font-size: 0.88rem; line-height: 1.4; }
.coming-badge {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(232,213,168,.35);
  color: var(--sand-dim);
}
.duel-beta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.duel-lobby {
  width: min(100%, 480px);
  margin: 12px auto 28px;
  text-align: center;
  padding: 8px 12px 24px;
}
.duel-lobby h2 {
  margin: 8px 0 6px;
  font-family: var(--font-display);
  color: var(--sand);
}
.duel-code-card {
  margin: 18px auto;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.28);
  display: grid;
  gap: 8px;
  justify-items: center;
}
.duel-code {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  font-weight: 800;
  letter-spacing: 0.22em;
  color: var(--sand);
  line-height: 1.1;
}
.duel-players {
  list-style: none;
  margin: 0 auto 14px;
  padding: 0;
  width: min(100%, 360px);
  display: grid;
  gap: 8px;
  text-align: left;
}
.duel-players li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.2);
  font-size: 0.92rem;
}
.duel-players li.is-ready strong { color: #86efac; }
.duel-players li.is-waiting strong { color: var(--muted); }
.duel-players li.is-here strong { color: #fde68a; }
.duel-status-line {
  min-height: 1.4em;
  margin: 0 0 14px;
  font-weight: 600;
  color: var(--sand);
}
.duel-lobby-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.duel-lobby-actions .btn-primary {
  min-width: min(100%, 200px);
  min-height: 48px;
}
.duel-meta { font-size: 0.82rem; margin: 0 0 8px; }
.duel-beta input {
  flex: 1 1 120px;
  min-width: 110px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(8, 14, 11, 0.85);
  color: var(--ink);
  font-family: inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.duel-finish {
  margin: 8px 0 4px;
  text-align: left;
}
.duel-finish-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 16px;
}
.duel-finish-side {
  padding: 14px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(12, 22, 16, 0.78);
  text-align: center;
}
.duel-finish-side.is-you { border-color: rgba(232, 213, 168, 0.45); }
.duel-finish-side.is-winner { border-color: rgba(116, 198, 157, 0.55); box-shadow: 0 0 0 1px rgba(116, 198, 157, 0.2); }
.duel-finish-role {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.duel-finish-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--sand);
  margin-bottom: 6px;
}
.duel-finish-score {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--sand);
  line-height: 1;
}
.duel-finish-vs {
  align-self: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--muted);
  font-size: 0.95rem;
}
.duel-finish-banner {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--sand);
  margin: 0 0 14px;
}
.duel-finish-wait {
  text-align: center;
  color: var(--muted);
  margin: 0 0 12px;
}
.duel-face-rounds {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.duel-face-round {
  display: grid;
  grid-template-columns: 1fr 88px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(12, 22, 16, 0.72);
}
.duel-face-side {
  min-width: 0;
}
.duel-face-side.host { text-align: left; }
.duel-face-side.guest { text-align: right; }
.duel-face-pts {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--sand);
}
.duel-face-pts.ok { color: #9be4bd; }
.duel-face-pts.bad { color: #f0a090; }
.duel-face-pts.skip { color: var(--sand-dim); }
.duel-face-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}
.duel-face-thumb {
  border-radius: 10px;
  overflow: hidden;
  background: #0a120e;
  aspect-ratio: 1;
}
.duel-face-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.duel-face-round-num {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  margin-bottom: 4px;
}
.duel-finish-actions {
  justify-content: center;
  margin-top: 18px;
}
@media (max-width: 640px) {
  .duel-finish-head { gap: 8px; }
  .duel-finish-score { font-size: 1.7rem; }
  .duel-face-round {
    grid-template-columns: 1fr 64px 1fr;
    gap: 6px;
    padding: 8px;
  }
  .duel-face-pts { font-size: 0.92rem; }
  .duel-face-meta { font-size: 0.68rem; }
}
.daily-streak { margin: 8px auto 0; font-size: 0.85rem; text-align: center; }
.potw-card {
  margin: 18px auto;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.2);
  width: min(100%, 560px);
  text-align: left;
}
.potw-card h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--sand);
}
.potw-card img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  margin-top: 10px;
}
.expert-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.25);
}
.expert-box input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.35);
  color: var(--text);
  font: inherit;
}
.expert-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hint-chip {
  display: inline-block;
  margin: 8px 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(64,145,108,.2);
  border: 1px solid rgba(64,145,108,.4);
  color: var(--sand);
  font-size: 0.82rem;
}
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.result-map-block {
  margin: 0 0 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.result-map-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 8px;
}
.result-map-head strong {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sand);
}
.result-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.map-leg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--muted);
}
.map-leg::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.map-leg-correct::before { background: #34d399; }
.map-leg-wrong::before { background: #f87171; }
.map-leg-heat1::before { background: #65a30d; }
.map-leg-heat2::before { background: #ca8a04; }
.map-leg-heat3::before { background: #c2410c; }
.result-map-host {
  height: min(42vh, 320px);
  min-height: 200px;
  position: relative;
  background: #06100a;
}
.result-map-host .map-wrap,
.result-map-host #map-root {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: 0;
}
.result-map-host .map-tip {
  font-size: 0.7rem;
  bottom: 6px;
}
.result-map-expand {
  margin: 8px 12px 12px;
}
.result-map-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 12px;
  font-size: 0.82rem;
}
#map-wrap.reveal-locked .wilaya-hit {
  cursor: default;
}
#map-wrap.in-result .map-zoom {
  top: 8px;
  right: 8px;
}
.lb-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.diff-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  line-height: 1.2;
  white-space: nowrap;
}
.diff-pill.diff-easy { color: #86efac; border-color: rgba(134,239,172,.45); background: rgba(134,239,172,.08); }
.diff-pill.diff-normal { color: var(--sand); border-color: rgba(232,213,168,.4); background: rgba(232,213,168,.08); }
.diff-pill.diff-hard { color: #fdba74; border-color: rgba(253,186,116,.45); background: rgba(253,186,116,.08); }
.diff-pill.diff-expert { color: #f9a8d4; border-color: rgba(249,168,212,.45); background: rgba(249,168,212,.08); }
.diff-pill.pack-pill { color: #7dd3fc; border-color: rgba(125,211,252,.4); background: rgba(125,211,252,.08); }
.diff-pill.kind-pill { color: #c4b5fd; border-color: rgba(196,181,253,.4); background: rgba(196,181,253,.08); }
.diff-pill.kind-daily { color: #fcd34d; border-color: rgba(252,211,77,.4); background: rgba(252,211,77,.08); }
.diff-pill.kind-expert { color: #f9a8d4; border-color: rgba(249,168,212,.45); background: rgba(249,168,212,.08); }

/* ---- Ambient music + consent ---- */
.wg-consent {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: end center;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: rgba(6, 10, 8, 0.45);
  backdrop-filter: blur(6px);
}
.wg-consent.hidden { display: none !important; }
.wg-consent-card {
  width: min(100%, 420px);
  padding: 18px 18px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(165deg, rgba(28, 40, 34, 0.92), rgba(12, 18, 14, 0.94));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  color: var(--text);
}
.wg-consent-card h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--sand);
}
.wg-consent-card p { margin: 0 0 10px; font-size: 0.9rem; line-height: 1.45; }
.wg-consent-note { font-size: 0.78rem !important; color: var(--muted); }
.wg-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}
body.wg-consent-open { overflow: hidden; }

.wg-music {
  position: fixed;
  z-index: 60;
  right: 18px;
  bottom: 18px;
  width: min(300px, calc(100vw - 28px));
  user-select: none;
  touch-action: none;
}
.wg-music.hidden { display: none !important; }
.wg-music-fab {
  display: none;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background-color: rgba(16, 24, 20, 0.55);
  background-size: cover;
  background-position: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  padding: 0;
}
.wg-music.is-playing .wg-music-fab {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.2),
    0 0 18px rgba(255, 255, 255, 0.12),
    0 10px 28px rgba(0, 0, 0, 0.4);
}
.wg-music-panel {
  position: relative;
  padding: 16px 14px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04) 45%, rgba(10, 16, 12, 0.35)),
    rgba(16, 24, 20, 0.38);
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  overflow: visible;
}
.wg-music-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.16), transparent 42%);
  pointer-events: none;
}
/* L-shaped corner grab handles */
.wg-music-grip {
  position: absolute;
  width: 22px;
  height: 22px;
  z-index: 4;
  cursor: grab;
  pointer-events: auto;
}
.wg-music-grip.tl {
  top: 0; left: 0;
  border-top: 2px solid rgba(255, 255, 255, 0.78);
  border-left: 2px solid rgba(255, 255, 255, 0.78);
  border-top-left-radius: 18px;
  box-shadow: -1px -1px 0 rgba(255, 255, 255, 0.25);
}
.wg-music-grip.tr {
  top: 0; right: 0;
  border-top: 2px solid rgba(255, 255, 255, 0.78);
  border-right: 2px solid rgba(255, 255, 255, 0.78);
  border-top-right-radius: 18px;
  box-shadow: 1px -1px 0 rgba(255, 255, 255, 0.25);
}
.wg-music-grip.bl {
  bottom: 0; left: 0;
  border-bottom: 2px solid rgba(255, 255, 255, 0.78);
  border-left: 2px solid rgba(255, 255, 255, 0.78);
  border-bottom-left-radius: 18px;
  box-shadow: -1px 1px 0 rgba(255, 255, 255, 0.25);
}
.wg-music-grip.br {
  bottom: 0; right: 0;
  border-bottom: 2px solid rgba(255, 255, 255, 0.78);
  border-right: 2px solid rgba(255, 255, 255, 0.78);
  border-bottom-right-radius: 18px;
  box-shadow: 1px 1px 0 rgba(255, 255, 255, 0.25);
}
.wg-music-grip:hover {
  border-color: #fff;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.45));
}
.wg-music.is-dragging .wg-music-grip { cursor: grabbing; }
.wg-music-x {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 2;
  border: 0;
  background: transparent;
  color: rgba(244, 239, 228, 0.7);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  display: none;
}
.wg-music-main {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  position: relative;
  z-index: 1;
  margin-bottom: 12px;
}
.wg-music-thumb {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  background: rgba(0, 0, 0, 0.25);
}
.wg-music-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wg-music-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(232, 213, 168, 0.75);
}
.wg-music-title {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wg-music-author {
  font-size: 0.78rem;
  color: rgba(244, 239, 228, 0.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wg-music-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}
.wg-music-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.wg-music-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}
.wg-music-vol {
  flex: 1;
  min-width: 0;
  accent-color: #f3efe6;
}
.wg-svg {
  display: block;
  width: 18px;
  height: 18px;
  color: #fff;
}
.wg-yt-wrap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.wg-yt-host,
.wg-yt-host iframe {
  position: absolute !important;
  width: 180px !important;
  height: 101px !important;
  opacity: 0.02 !important;
  pointer-events: none !important;
  border: 0 !important;
}

@media (max-width: 720px) {
  .wg-music {
    width: auto;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    left: auto;
    top: auto;
  }
  .wg-music-fab { display: block; }
  .wg-music:not(.open) .wg-music-panel { display: none; }
  .wg-music.open { width: min(300px, calc(100vw - 20px)); }
  .wg-music.open .wg-music-fab { display: none; }
  .wg-music.open .wg-music-panel { display: block; }
  .wg-music-x { display: inline-block; }
  .wg-music-grip { width: 20px; height: 20px; }
}
