: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: 1100px;
  margin: 0 auto;
  padding: 28px 18px 56px;
}

/* —— 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 28px;
  max-width: 38ch;
  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-top: 14px;
}
.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: 520px;
  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;
}
@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;
}
.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.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: 560px; margin: 0 auto; }
.finish-box .big-score {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--sand);
  margin: 8px 0 18px;
}
.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-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: 24px 4px 20px; }
  .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; }
  .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(36vh, 300px);
    min-height: 160px;
  }
  #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-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(45, 106, 79, 0.28);
  color: var(--sand);
  border-radius: 999px;
  padding: 8px 14px;
  font: 700 0.82rem var(--font-body);
  cursor: pointer;
}
.lang-btn:hover { border-color: var(--green-bright); }

.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; }
