/* ============================================
   FINDER — Minimalist Wordle-Style GPS Game
   ============================================ */

/* === Font Import === */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

/* === Design Tokens — HINTRACK brand charter === */
:root {
  /* Brand palette (from Hintrach-Charte.pdf) */
  --brand-marine:  #0D1B2A;  /* Bleu Marine — primary dark */
  --brand-grey:    #607D8B;  /* Bleu Gris — mid neutral */
  --brand-light:   #F4F6F8;  /* Gris Clair — surface alt */
  --brand-orange:  #FF8A00;  /* Orange Vif — accent / CTAs */
  --brand-sand:    #E6DCC3;  /* Sable — warm neutral */

  /* Surfaces — page uses Sable; cards stay white for contrast */
  --bg-main: var(--brand-sand);
  --bg-surface: #FFFFFF;
  --bg-surface-alt: var(--brand-light);
  --border-main: #D6DCE2;
  --border-heavy: var(--brand-marine);

  /* Text */
  --text-main: var(--brand-marine);
  --text-secondary: var(--brand-grey);

  /* Semantic */
  --accent: var(--brand-orange);
  --accent-dark: var(--brand-marine);
  --success: #2E9B56;
  --fail: #787C7E;
  --warning: var(--brand-orange);

  /* Mode-selection + result-card palette */
  --mode-chill:  #5BD7E8;
  --mode-walker: var(--brand-orange);
  --mode-runner: #E85C6A;
  --result-win-bg:  #BEDCC6;
  --result-miss-bg: #F8D1D6;
  --timer-ok:   #2E9B56;
  --timer-warn: var(--brand-orange);
  --timer-late: #E53E3E;

  --font-family: 'Outfit', system-ui, -apple-system, sans-serif;

  --radius: 6px;
}

/* === Reset === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background: var(--bg-main);
  color: var(--text-main);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  /* Slight global type bump to improve readability across the brand UI. */
  font-size: 1.08rem;
}

/* Prevent pull-to-refresh on mobile */
html {
  overscroll-behavior-y: none;
  height: 100%;
}


/* === Header === */
.header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  height: 60px;
  border-bottom: 2px solid var(--border-heavy);
  position: relative;
  background: var(--bg-main);
}

.header__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  height: 100%;
  padding: 6px 0;
}

.header__logo-img {
  display: block;
  height: 38px;
  width: auto;
  max-width: 60vw;
  object-fit: contain;
}

/* Legacy text-logo styling (kept for any callers still using a textual logo) */
.header__logo--text {
  font-family: var(--font-family);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-main);
}

.header__actions {
  position: absolute;
  display: flex;
  gap: 8px;
}

.header__actions--left {
  left: 16px;
}

.header__actions--right {
  right: 16px;
}

.header__btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 6px;
  transition: color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header__btn:hover,
.header__btn:active {
  color: var(--text-main);
}

.header__btn svg {
  width: 22px;
  height: 22px;
}

/* === Game Container === */
.game-container {
  flex: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* === Game Hero (full-bleed image) === */
.game-hero {
  position: relative;
  width: 100%;
  flex: 0 0 30%;
  overflow: hidden;
  background: var(--bg-surface-alt);
  flex-shrink: 0;
}

.game-hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.game-hero__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  opacity: 0.3;
  background: var(--bg-surface-alt);
}

/* === Game Body (content below image) === */
.game-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 20px 8px;
  overflow: hidden;
  gap: 6px;
  position: relative;
  z-index: 1;
}

/* === Game Meta Label === */
.game-meta {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-align: center;
  flex-shrink: 0;
}

/* === Game Headline === */
.game-headline {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-main);
  text-align: center;
  line-height: 1.2;
  flex-shrink: 0;
}

.game-headline--revealed {
  animation: nameReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.game-subdesc {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  flex-shrink: 0;
}

/* === Distance text (below compass) === */
.game-distance-text {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-main);
  text-align: center;
  flex-shrink: 0;
  animation: distancePop 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes distancePop {
  0%   { opacity: 0; transform: scale(0.85); }
  60%  { transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}

/* === Try Log (plain text rows) === */
.try-log {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.try-log__item {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  letter-spacing: 0.02em;
}

/* === Background blobs on game screen === */
.game-body::before,
.game-body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(32px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

.game-body::before {
  /* Top-right blob */
  width: 180px;
  height: 180px;
  background: #9B59B6;
  top: 55%;
  right: -50px;
}

.game-body::after {
  /* Bottom-left blob */
  width: 150px;
  height: 150px;
  background: #E91E87;
  bottom: 0;
  left: -40px;
}


/* === Target Card === */
.target-card {
  text-align: center;
  margin: 32px 0 24px;
  width: 100%;
}

.target-card__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* Image container for the mystery location */
.target-card__image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 2px solid var(--border-heavy);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
  background: var(--bg-surface-alt);
}

.target-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder shimmer when no real image is loaded */
.target-card__image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(
    135deg,
    var(--bg-surface-alt) 0%,
    var(--bg-surface) 50%,
    var(--bg-surface-alt) 100%
  );
  background-size: 200% 200%;
  animation: shimmer 2.5s ease-in-out infinite;
}

.target-card__image-placeholder-icon {
  font-size: 2.4rem;
  opacity: 0.5;
}

.target-card__image-placeholder-text {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
  opacity: 0.6;
}

@keyframes shimmer {
  0% { background-position: 200% 200%; }
  50% { background-position: 0% 0%; }
  100% { background-position: 200% 200%; }
}

/* Question mark overlay on the image */
.target-card__mystery-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: var(--bg-main);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Hidden name (revealed only after game over) */
.target-card__name {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 8px;
}

.target-card__name--hidden {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  opacity: 0.4;
  user-select: none;
}

.target-card__name--revealed {
  animation: nameReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes nameReveal {
  0% { opacity: 0; transform: translateY(8px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.target-card__desc {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.target-card__category {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 12px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  border: 2px solid var(--border-main);
  color: var(--text-secondary);
  border-radius: var(--radius);
}

/* === Day Badge === */
.day-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  padding: 6px 14px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border: 1px solid var(--border-main);
  border-radius: var(--radius);
}

.day-badge svg {
  width: 14px;
  height: 14px;
}

/* === Tries Display === */
.tries-display {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 24px 0;
}

.try-box {
  width: 52px;
  height: 52px;
  border: 2px solid var(--border-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: var(--radius);
  background: var(--bg-surface);
}

.try-box.used {
  border-color: var(--fail);
  background: var(--fail);
  color: #fff;
  animation: tryFlip 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.try-box.won {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
  animation: tryFlip 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes tryFlip {
  0% { transform: scaleY(0); }
  50% { transform: scaleY(1.15); }
  100% { transform: scaleY(1); }
}

/* === Compass Panel (inline variant, no border/bg) === */
.compass-panel--inline {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  width: auto !important;
}

/* === Compass Panel === */
.compass-panel {
  width: 100%;
  border: 2px solid var(--border-main);
  padding: 28px 20px;
  text-align: center;
  margin-bottom: 24px;
  background: var(--bg-surface);
  border-radius: var(--radius);
  animation: panelSlide 0.4s ease;
}

@keyframes panelSlide {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

.compass-panel__title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* === Compass Dial (smaller for single-screen layout) === */
.compass-dial {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 20px;
  border-radius: 50%;
  border: 3px solid var(--border-heavy);
  background: var(--bg-surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 2px 10px rgba(0,0,0,0.07),
    0 4px 20px rgba(0,0,0,0.08);
  overflow: hidden;
}

/* Inner dashed ring guide */
.compass-dial::before {
  content: '';
  position: absolute;
  top: 16px; left: 16px; right: 16px; bottom: 16px;
  border: 1px dashed var(--border-main);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

/* ── Rotating ring (spins with device heading) ── */
.compass-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transition: transform 0.12s linear;
  will-change: transform;
}

/* Cardinal letters on the rotating ring */
.compass-cardinal {
  position: absolute;
  font-family: var(--font-family);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  width: 16px;
  text-align: center;
  left: 50%;
  transform: translateX(-50%);
}

.compass-cardinal--n {
  top: 6px;
  color: var(--text-main);
  font-size: 0.65rem;
}
.compass-cardinal--s { bottom: 6px; }
.compass-cardinal--e {
  right: 6px;
  top: 50%;
  left: auto;
  transform: translateY(-50%);
  width: auto;
}
.compass-cardinal--w {
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: auto;
}

/* ── Red target dot (sits on ring at targetBearing position) ── */
.compass-target-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  margin-left: -7px;
  background: #E53E3E;
  border-radius: 50%;
  box-shadow:
    0 0 0 3px rgba(229, 62, 62, 0.25),
    0 0 10px rgba(229, 62, 62, 0.6);
  z-index: 3;
  transform-origin: center center;
  transition: transform 0.15s linear;
  will-change: transform;
}

/* ── Fixed aim marker at 12 o'clock ("what's in front of you") ── */
.compass-aim-marker {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 14px solid var(--text-main);
  z-index: 4;
}

/* ── Center hub ── */
.compass-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background: var(--bg-surface);
  border: 3px solid var(--text-main);
  border-radius: 50%;
  z-index: 5;
}

/* Distance readout */
.compass-distance {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-main);
  margin-bottom: 4px;
  transition: color 0.3s ease;
}

.compass-distance__unit {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-left: 4px;
}

/* Status line below distance */
.compass-direction {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  min-height: 1.2em;
  transition: color 0.3s ease;
}

/* When perfectly aligned — green pulse on status text */
.compass-aligned {
  color: var(--success) !important;
  animation: alignPulse 1s ease-in-out infinite;
}

@keyframes alignPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* When perfectly aligned — compass dial turns green */
.compass-dial--aligned {
  border-color: var(--success) !important;
  box-shadow:
    inset 0 2px 10px rgba(0,0,0,0.07),
    0 0 0 4px rgba(106,170,100,0.3),
    0 0 22px rgba(106,170,100,0.45) !important;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* When aligned — target dot turns green */
.compass-target-dot--aligned {
  background: var(--success) !important;
  box-shadow:
    0 0 0 3px rgba(106,170,100,0.3),
    0 0 14px rgba(106,170,100,0.7) !important;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.compass-activate-btn--slim {
  padding: 8px 14px;
  font-size: 0.7rem;
  margin: 0;
}

/* Activate button */
.compass-activate-btn {
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--bg-surface);
  color: var(--accent);
  border: 2px solid var(--accent);
  padding: 12px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  margin: 12px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  width: 100%;
}

.compass-activate-btn:hover {
  background: var(--bg-surface-alt);
}

.compass-activate-btn:active {
  transform: scale(0.98);
}

.compass-activate-btn svg {
  width: 18px;
  height: 18px;
}

/* === Hint History (list of past tries) === */
.hint-history {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.hint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 2px solid var(--border-main);
  background: var(--bg-surface);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.85rem;
  animation: panelSlide 0.3s ease;
}

.hint-row__try {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  min-width: 50px;
}

.hint-row__distance {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.hint-row__bearing {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.hint-row__bearing svg {
  width: 18px;
  height: 18px;
  color: var(--text-main);
}

/* === Action Button (GPS Check) === */
.action-area {
  width: 100%;
  margin-bottom: 24px;
}

.gps-btn {
  width: 100%;
  padding: 18px;
  font-family: var(--font-family);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--bg-main);
  border: 2px solid var(--accent);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  animation: gpsBtnPulse 2.4s ease-in-out infinite;
}

@keyframes gpsBtnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(26,42,58,0.35); }
  50%       { box-shadow: 0 0 0 10px rgba(26,42,58,0); }
}

.gps-btn:hover {
  opacity: 0.9;
}

.gps-btn:active {
  transform: scale(0.98);
}

.gps-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.gps-btn svg {
  width: 20px;
  height: 20px;
}

.gps-btn--loading {
  position: relative;
}

.gps-btn--loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: var(--bg-main);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === GPS Error Message === */
.gps-error {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--warning);
  background: var(--bg-surface);
  border-radius: var(--radius);
  margin-bottom: 16px;
  text-align: center;
  animation: panelSlide 0.3s ease;
}

.gps-error__text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
}

.gps-error__subtext {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* === Accuracy Warning === */
.accuracy-warning {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--warning);
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.accuracy-warning svg {
  width: 14px;
  height: 14px;
}

/* === Result Overlay === */
.result-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(253, 251, 247, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.4s ease;
  padding: 20px;
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.result-card {
  width: 100%;
  max-width: 380px;
  text-align: center;
  padding: 40px 28px;
  border: 2px solid var(--border-heavy);
  background: var(--bg-surface);
  border-radius: var(--radius);
  animation: cardPop 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative; /* anchor for the corner X close button */
}

/* End-of-rotation tries breakdown */
.result-tries {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
  align-items: center;
}

.result-tries__row {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.result-tries__label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  width: 64px;
  text-align: right;
  color: var(--text-secondary);
}

.result-tries .result-try-box {
  width: 30px;
  height: 30px;
  font-size: 0.8rem;
}

@keyframes cardPop {
  0% { opacity: 0; transform: scale(0.9) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.result-card__emoji {
  font-size: 3.5rem;
  margin-bottom: 20px;
}

.result-card__title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-main);
  margin-bottom: 8px;
}

.result-card__subtitle {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.4;
}

.result-card__target {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 20px;
  border: 2px solid var(--border-main);
  margin-bottom: 24px;
  border-radius: var(--radius);
}

.result-card__tries-visual {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 28px;
}

.result-try-box {
  width: 42px;
  height: 42px;
  border: 2px solid var(--border-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  border-radius: var(--radius);
}

.result-try-box.fail {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.result-try-box.success {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.result-try-box.empty {
  background: var(--bg-surface);
  border-color: var(--border-main);
}

/* === Result Action Buttons === */
.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-btn {
  width: 100%;
  padding: 16px;
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 2px solid var(--border-heavy);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.result-btn:active {
  transform: scale(0.98);
}

.result-btn--primary {
  background: var(--accent);
  color: var(--bg-main);
}

.result-btn--primary:hover {
  opacity: 0.9;
}

.result-btn--secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-main);
}

.result-btn--secondary:hover {
  background: var(--bg-surface-alt);
}

/* "Play again" — clears the rotation and reshuffles */
.result-btn--reset {
  background: var(--brand-orange);
  color: #FFFFFF;
  border-color: var(--brand-orange);
}

.result-btn--reset:hover {
  filter: brightness(1.05);
}

/* === Countdown Timer === */
.countdown {
  margin-top: 24px;
  text-align: center;
}

.countdown__label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.countdown__time {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(13, 27, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  /* Above welcome (490), mode (480), and startup (500) overlays so the
     Options/Help modals open from any screen. */
  z-index: 600;
  padding: 20px;
}

.modal-overlay.visible {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal {
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 2px solid var(--border-heavy);
  padding: 32px 24px;
  border-radius: var(--radius);
  animation: cardPop 0.3s ease;
  position: relative; /* anchor for the corner X close button */
}

/* Top-right "X" — closes the panel without affecting game state */
.modal__x {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-family: var(--font-family);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
}

.modal__x:hover {
  background: var(--brand-light);
  color: var(--text-main);
}

/* Action row at the bottom of a panel — Reset (primary) + Close (secondary) */
.modal__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.modal__actions .modal__close {
  margin-top: 0;
}

/* Reset variant — orange brand accent, replaces the legacy bottom Close */
.modal__close--reset {
  background: var(--brand-orange);
  color: #FFFFFF;
  border-color: var(--brand-orange);
}

.modal__close--reset:hover {
  filter: brightness(1.05);
  opacity: 1;
}

.modal__title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 20px;
  color: var(--text-main);
}

.modal__close {
  display: block;
  width: 100%;
  padding: 14px;
  margin-top: 20px;
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--bg-main);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.15s;
}

.modal__close:hover {
  opacity: 0.9;
}

/* === How To Play Steps === */
.step-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 8px;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  border: 2px solid var(--border-heavy);
  color: var(--text-main);
  border-radius: var(--radius);
}

.step-text {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.5;
  padding-top: 4px;
}

.step-text strong {
  font-weight: 800;
}

/* === Stats Grid === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.stat-item {
  text-align: center;
  padding: 12px 4px;
  border: 1px solid var(--border-main);
  border-radius: var(--radius);
}

.stat-item__value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
}

.stat-item__label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* === Toast === */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--accent);
  color: var(--bg-main);
  border-radius: var(--radius);
  z-index: 300;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.2s forwards;
  pointer-events: none;
}

@keyframes toastIn {
  0%   { opacity: 0; transform: translateX(-50%) translateY(-16px) scale(0.9); }
  60%  { transform: translateX(-50%) translateY(4px) scale(1.04); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@keyframes toastOut {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* === Startup Overlay === */
.startup-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, var(--brand-sand) 0%, #EDDFC2 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  overflow: hidden;
}

.startup-overlay.hidden {
  display: none !important;
}

.startup-content {
  position: relative;
  text-align: center;
  /* The wrapper carries the post-wipe settle bounce. Keeping the bounce
     on a parent (instead of the same element that animates clip-path)
     avoids restarting the wipe mid-flight. Triggers exactly when the
     wipe finishes (1.4s in). */
  animation: splashSettle 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) 1.4s both;
}

/* ── Logo entry: left-to-right wipe + blur-to-sharp focus ──
   The wipe pulls clip-path's right inset from 100% (fully clipped) down
   to 0% (fully revealed) — a typewriter-style reveal that never resizes
   the image's bounding box. Focus runs in parallel for the first 0.4s
   so the logo lands sharp before the wipe is even halfway done. */
.startup-brand {
  animation: splashWipe  1.4s cubic-bezier(0.77, 0, 0.175, 1) both,
             splashFocus 0.4s ease-out both;
}

@keyframes splashWipe {
  0%   { clip-path: inset(0 100% 0 0); }
  100% { clip-path: inset(0 0 0 0); }
}

@keyframes splashFocus {
  0%   { filter: blur(6px); opacity: 0; }
  100% { filter: blur(0);   opacity: 1; }
}

@keyframes splashSettle {
  0%   { transform: scale(0.985); }
  60%  { transform: scale(1.008); }
  100% { transform: scale(1); }
}

/* ── Shimmer pass ──
   A diagonal highlight sweeps across the logo silhouette once after the
   reveal lands. Sized and positioned to overlap the .startup-brand image
   exactly (same width/aspect ratio as the brand sizing rule below), so
   the CSS mask clips the highlight to the logo's transparent PNG alpha
   instead of painting the surrounding rectangle. */
.startup-shimmer {
  position: absolute;
  top: 0; left: 50%;
  width: min(280px, 70vw);
  /* aspect-ratio match: the logo image's height auto-scales from its
     natural ratio. We pin the shimmer to the same aspect by using the
     same intrinsic dimensions via background-size. transform centers
     horizontally; vertically we rely on the logo's own bounding box. */
  height: 100%;
  transform: translateX(-50%);
  pointer-events: none;
  background:
    linear-gradient(
      115deg,
      transparent 35%,
      rgba(255, 255, 255, 0.85) 50%,
      transparent 65%
    );
  background-size: 250% 100%;
  background-position: -120% 0;
  mix-blend-mode: overlay;
  opacity: 0;

  /* Mask to the logo silhouette — only paints over logo pixels. */
  -webkit-mask: url('icons/brand/hintrack-logo.png') center / contain no-repeat;
          mask: url('icons/brand/hintrack-logo.png') center / contain no-repeat;

  animation: splashShimmer 0.9s ease-out 1.55s 1 both;
}

@keyframes splashShimmer {
  0%   { background-position: -120% 0; opacity: 0; }
  15%  {                                opacity: 1; }
  85%  {                                opacity: 1; }
  100% { background-position:  120% 0; opacity: 0; }
}

/* "Powered by 3wdev" credit at the bottom of the splash. Fades in after
   the logo reveal so it doesn't compete with the wipe + shimmer.
   Honors the iOS safe-area-inset-bottom on notched devices. */
.startup-credit {
  position: absolute;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  animation: splashCreditFadeIn 0.6s ease-out 1.6s both;
}

.startup-credit__label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(13, 27, 42, 0.55);
}

.startup-credit__logo {
  display: block;
  height: 22px;
  width: auto;
  opacity: 0.85;
}

@keyframes splashCreditFadeIn {
  0%   { opacity: 0; transform: translate(-50%, 6px); }
  100% { opacity: 1; transform: translate(-50%, 0);   }
}

/* Exit budget 700ms (matches SPLASH_EXIT_MS in app.js). */
.startup-overlay--exiting {
  animation: splashFadeOut 0.7s ease-in forwards;
}

@keyframes splashFadeOut {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Reduced-motion fallback ──
   Strip the wipe, blur, settle bounce, and shimmer for users who request
   reduced motion. The logo simply fades in over 300ms and stays put. */
@media (prefers-reduced-motion: reduce) {
  .startup-content {
    animation: none;
  }
  .startup-brand {
    animation: splashFadeIn 0.3s ease-out both;
    clip-path: none;
    filter: none;
  }
  .startup-shimmer {
    display: none;
  }
  .startup-credit {
    animation: splashFadeIn 0.3s ease-out 0.3s both;
  }

  @keyframes splashFadeIn {
    0%   { opacity: 0; }
    100% { opacity: 1; }
  }
}

.startup-logo {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-main);
  margin-bottom: 8px;
}

.startup-emoji {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

/* Brand mark on startup — replaces the emoji + Rihla wordmark combo */
.startup-brand {
  display: block;
  margin: 0 auto 18px;
  width: min(280px, 70vw);
  height: auto;
}

.startup-tagline {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.startup-play {
  padding: 18px 48px;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--bg-main);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.startup-play:hover {
  opacity: 0.9;
}

.startup-play:active {
  transform: scale(0.98);
}

/* === Completed State === */
.completed-state {
  text-align: center;
  margin-top: 20px;
}

.completed-state__icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.completed-state__title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-main);
  margin-bottom: 8px;
}

.completed-state__sub {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* === Loading Spinner === */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  gap: 16px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border-main);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading__text {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* === Confetti Canvas === */
#confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 400;
}

/* === Responsive === */
@media (max-width: 360px) {
  .header__logo {
    font-size: 1.4rem;
    letter-spacing: 0.15em;
  }

  .target-card__name {
    font-size: 1.3rem;
  }

  .target-card__name--hidden {
    font-size: 1rem;
  }

  .try-box {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }

  .compass-distance {
    font-size: 1.6rem;
  }
}

/* === Utility: Hidden === */
.hidden {
  display: none !important;
}

/* ============================================
   AUTH STARTUP SCREEN
   ============================================ */

.startup-auth {
  margin-top: 12px;
  width: 100%;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.startup-auth__loading {
  padding: 24px 0;
}

.startup-auth__buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  animation: cardPop 0.4s ease;
}

/* Google Sign-In pill — follows Google brand guidelines */
.auth-btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 260px;
  padding: 14px 24px;
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #3c4043;
  background: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 24px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.2s ease, background 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
}

.auth-btn-google:hover {
  background: #f8f9fa;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.auth-btn-google:active {
  transform: scale(0.98);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.auth-btn-google:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-divider {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 16px 0 8px;
}

.auth-btn-guest {
  background: none;
  border: none;
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px 16px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease, transform 0.15s ease;
}

.auth-btn-guest:hover {
  color: var(--text-main);
}

.auth-btn-guest:active {
  transform: scale(0.97);
}

/* ============================================
   HEADER — USER CHIP (avatar / initial)
   ============================================ */

.user-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--border-main);
  background: none;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.user-chip:hover {
  border-color: var(--border-heavy);
  transform: scale(1.05);
}

.user-chip:active {
  transform: scale(0.95);
}

.user-chip__avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.user-chip__initial {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

/* ============================================
   STATS MODAL — USER DISPLAY
   ============================================ */

.stats-user {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 10px 16px;
  border: 1px solid var(--border-main);
  border-radius: var(--radius);
  background: var(--bg-surface-alt);
}

.stats-user__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-main);
  flex-shrink: 0;
}

.stats-user__initial {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
}

.stats-user__name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================
   STATS MODAL — POINTS TILE
   ============================================ */

.stat-item--points {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border: 2px solid var(--warning);
  border-radius: var(--radius);
  background: var(--bg-surface);
  margin-top: 10px;
  animation: cardPop 0.4s ease;
}

.stat-item--points__value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--warning);
  letter-spacing: 0.04em;
}

.stat-item--points__label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ============================================
   STATS MODAL — GUEST NUDGE
   ============================================ */

.stats-guest-note {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 16px;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

/* ============================================
   SMALL INLINE SPINNER (button loading state)
   ============================================ */

.spinner--sm {
  width: 18px;
  height: 18px;
  border-width: 2px;
  display: inline-block;
  vertical-align: middle;
}

/* ============================================
   WELCOME SCREEN
   ============================================ */

/* Full-screen overlay that sits above the game, below the header */
.welcome-overlay {
  position: fixed;
  top: 60px; /* below the header */
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-main);
  z-index: 490;
  overflow: hidden;
  animation: fadeIn 0.35s ease;
}

.welcome-overlay.hidden {
  display: none !important;
}

/* Riser entrance used when the splash hands off to the welcome page. */
.welcome-overlay--entering {
  animation: welcomeEnter 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes welcomeEnter {
  0%   { opacity: 0; transform: translateY(24px) scale(0.985); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0)    scale(1);     }
}

.welcome-overlay--entering .welcome-inner {
  animation: welcomeContentEnter 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

@keyframes welcomeContentEnter {
  0%   { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0);    }
}

/* ── Decorative blobs ── */
.welcome-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.75;
  pointer-events: none;
  z-index: 0;
}

/* Top-right cluster */
.welcome-blob--purple-tr {
  width: 200px;
  height: 200px;
  background: #9B59B6;
  top: -70px;
  right: -50px;
}

.welcome-blob--teal-tr {
  width: 130px;
  height: 130px;
  background: #00BCD4;
  top: 30px;
  right: 60px;
}

/* Bottom-left cluster */
.welcome-blob--pink-bl {
  width: 160px;
  height: 160px;
  background: #E91E87;
  bottom: -50px;
  left: -40px;
}

.welcome-blob--purple-bl {
  width: 120px;
  height: 120px;
  background: #7C3AED;
  bottom: 40px;
  left: 60px;
}

/* ── Scrollable content wrapper ── */
.welcome-scroll {
  position: relative;
  z-index: 1;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.welcome-inner {
  max-width: 420px;
  margin: 0 auto;
  padding: 32px 24px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Title ── */
.welcome-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 16px;
}

/* ── Description placeholder ── */
.welcome-desc {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 32px;
  min-height: 20px; /* keeps layout stable while empty */
}

/* ── 2 × 3 partner grid ── */
.partner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 300px;
  margin-bottom: 28px;
}

.partner-card {
  aspect-ratio: 1 / 1;
  background: var(--bg-surface);
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 8px;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  overflow: hidden;
  position: relative;
}

.partner-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.partner-card:active {
  transform: scale(0.97);
}

/* Dark highlighted card (bottom-right — e.g. Visit Rabat) */
.partner-card--highlight {
  background: #8B1A1A;
  color: #fff;
}

/* ── Partner card — ACTIVE (3WDEV, launches game) ── */
.partner-card--active {
  border: 2.5px solid var(--accent);
  box-shadow:
    0 0 0 4px rgba(106,170,100,0.25),
    0 6px 24px rgba(0,0,0,0.12);
  cursor: pointer;
  animation: activeCardGlow 2.5s ease-in-out infinite;
}

@keyframes activeCardGlow {
  0%, 100% { box-shadow: 0 0 0 3px rgba(106,170,100,0.2), 0 4px 16px rgba(0,0,0,0.1); }
  50%       { box-shadow: 0 0 0 7px rgba(106,170,100,0.08), 0 8px 28px rgba(0,0,0,0.16); }
}



/* ── Partner card — LOCKED (coming soon) ── */
.partner-card--locked {
  cursor: not-allowed;
  opacity: 0.55;
  filter: grayscale(30%);
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.partner-card--locked:hover {
  transform: none;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.partner-card--locked:active {
  transform: none;
}

/* ── Empty slot (no image, just +) ── */
.partner-card--empty {
  background: var(--bg-surface-alt);
  border: 2px dashed var(--border-main);
}

.partner-card__slot-icon {
  font-size: 1.6rem;
  color: var(--border-main);
  line-height: 1;
  margin: auto;
}

/* ── Coming Soon badge (inside locked cards) ── */
.partner-card__coming-soon {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid var(--border-main);
  white-space: nowrap;
  pointer-events: none;
}

/* ── Partner card contents (logo + label) ── */
.partner-card__logo {
  max-width: 70%;
  max-height: 55%;
  object-fit: contain;
  display: block;
  margin: auto 0;
}

.partner-card__label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-main);
  line-height: 1.2;
}

.partner-card--highlight .partner-card__label {
  color: #fff;
}

/* ============================================
   MODE SELECTION OVERLAY
   ============================================ */

.mode-overlay {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-main);
  z-index: 480;
  overflow: hidden;
  animation: fadeIn 0.35s ease;
}

.mode-overlay.hidden {
  display: none !important;
}

/* ── Decorative blobs (same palette as welcome) ── */
.mode-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(32px);
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
}

.mode-blob--purple-tr {
  width: 200px;
  height: 200px;
  background: #9B59B6;
  top: -70px;
  right: -50px;
}

.mode-blob--teal-tr {
  width: 130px;
  height: 130px;
  background: #00BCD4;
  top: 40px;
  right: 70px;
}

.mode-blob--pink-bl {
  width: 160px;
  height: 160px;
  background: #E91E87;
  bottom: -50px;
  left: -40px;
}

.mode-blob--purple-bl {
  width: 120px;
  height: 120px;
  background: #7C3AED;
  bottom: 50px;
  left: 70px;
}

.mode-scroll {
  position: relative;
  z-index: 1;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.mode-inner {
  max-width: 420px;
  margin: 0 auto;
  padding: 28px 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mode-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 14px;
}

.mode-desc {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.55;
  margin-bottom: 22px;
}

.mode-subtitle {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-main);
  text-align: center;
  line-height: 1.1;
  margin-bottom: 22px;
}

.mode-list {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 26px;
}

.mode-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 16px 22px 16px 18px;
  font-family: var(--font-family);
  border: 2px solid transparent;
  border-radius: 32px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(13, 27, 42, 0.12);
  transition:
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.25s ease,
    border-color 0.25s ease,
    background 0.3s ease,
    color 0.3s ease;
  color: #fff;
  position: relative;
  overflow: hidden;
}

/* Sweep highlight — runs across the pill when it becomes selected. */
.mode-pill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 70%
  );
  transform: translateX(-110%);
  pointer-events: none;
  opacity: 0;
}

.mode-pill:hover  { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(13, 27, 42, 0.20); }
.mode-pill:active { transform: scale(0.98); }

.mode-pill__name {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mode-pill__meta {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}

/* Per-mode body colors (kept for visual distinction even when unselected). */
.mode-pill--chill  { background: var(--mode-chill);  color: #06313a; }
.mode-pill--walker { background: var(--mode-walker); color: #3a2a00; }
.mode-pill--runner { background: var(--mode-runner); color: #fff;     }

.mode-footer-logo {
  max-width: 120px;
  max-height: 56px;
  object-fit: contain;
  margin-top: 8px;
  opacity: 0.9;
}

/* ============================================
   IN-GAME TIMER LINE
   ============================================ */

.game-timer {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.2;
  color: var(--timer-ok);
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.game-timer--warn { color: var(--timer-warn); }
.game-timer--late {
  color: var(--timer-late);
  animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* ============================================
   PER-TARGET RESULT OVERLAY (green win / pink miss)
   ============================================ */

.target-result {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  animation: cardPop 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  background: transparent;
}

.target-result__hero {
  width: 100%;
  flex: 0 0 30%;
  overflow: hidden;
  background: var(--bg-surface-alt);
  position: relative;
}

.target-result__hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.target-result__hero-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  opacity: 0.3;
}

.target-result__card {
  flex: 1;
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.target-result--win  .target-result__card { background: var(--result-win-bg); }
.target-result--miss .target-result__card { background: var(--result-miss-bg); }

.target-result__heading {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-main);
  margin-bottom: 4px;
}

.target-result__points {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-main);
  margin-bottom: 14px;
}

.target-result__divider {
  width: 42px;
  height: 2px;
  background: var(--text-main);
  opacity: 0.55;
  margin: 2px 0 14px;
}

.target-result__name {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-main);
  margin-bottom: 12px;
}

.target-result__desc {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-main);
  opacity: 0.85;
  line-height: 1.55;
  max-width: 360px;
  margin-bottom: 18px;
}

.target-result__footer-logo {
  max-width: 100px;
  max-height: 46px;
  object-fit: contain;
  opacity: 0.9;
  margin-bottom: 14px;
}

.target-result__cta {
  width: 100%;
  max-width: 320px;
  padding: 14px 18px;
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  border: none;
  border-radius: 32px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14);
  transition: transform 0.15s ease, opacity 0.15s ease;
  margin-top: auto;
}

.target-result__cta:hover  { opacity: 0.92; }
.target-result__cta:active { transform: scale(0.97); }

.target-result--win  .target-result__cta { background: #2E9B56; }
.target-result--miss .target-result__cta { background: #E85C6A; }

/* ============================================
   MODE RADIO + PLAY BUTTON
   ============================================ */

/* Native radio is hidden; the visual indicator below is the control. */
.mode-pill__radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

/* Compass-dial radio — sits at the left of every pill, ahead of the name. */
.mode-pill::before {
  content: '';
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid rgba(13, 27, 42, 0.28);
  box-shadow:
    inset 0 0 0 0 var(--brand-orange),
    0 1px 3px rgba(13, 27, 42, 0.18);
  margin-right: 4px;
  transition:
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s ease,
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Selected state — the ring fills, pill glows, sweep flashes once.
   Deep teal-green border/halo on the dark-blue mode-overlay section. */
.mode-pill--selected {
  border-color: #004E47;
  box-shadow:
    0 0 0 3px rgba(0, 78, 71, 0.40),
    0 8px 24px rgba(13, 27, 42, 0.32);
  transform: scale(1.025);
  animation: modePillBob 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.mode-pill--selected::before {
  /* Solid deep teal-green (#004E47) center — animates from 0 → 9px so the
     fill ripples outward from the middle of the dial. */
  background: #004E47;
  box-shadow:
    inset 0 0 0 9px #004E47,
    0 0 0 4px rgba(0, 78, 71, 0.40),
    0 1px 3px rgba(13, 27, 42, 0.18);
  border-color: #004E47;
  transform: rotate(-12deg) scale(1.05);
}

.mode-pill--selected::after {
  animation: modePillSweep 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes modePillBob {
  0%   { transform: scale(0.985); }
  45%  { transform: scale(1.045); }
  100% { transform: scale(1.025); }
}

@keyframes modePillSweep {
  0%   { transform: translateX(-110%); opacity: 0;   }
  20%  { opacity: 0.9; }
  100% { transform: translateX(110%);  opacity: 0;   }
}

/* Subtle inhale on the unselected pills when one is chosen — keeps focus
   on the picked option without making the others look disabled. */
.mode-list:has(.mode-pill--selected) .mode-pill:not(.mode-pill--selected) {
  opacity: 0.7;
  transform: scale(0.985);
}

/* Reduced-motion users get the visual change without animations. */
@media (prefers-reduced-motion: reduce) {
  .mode-pill,
  .mode-pill::before,
  .mode-pill::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Play button under the mode list */
.mode-play {
  width: 100%;
  max-width: 320px;
  padding: 16px 22px;
  margin-top: 4px;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #FFFFFF;
  background: var(--brand-orange);
  border: none;
  border-radius: 32px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(255,138,0,0.35);
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.mode-play:disabled {
  background: var(--brand-grey);
  color: #FFFFFF;
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.mode-play:not(:disabled):hover  { transform: translateY(-1px); }
.mode-play:not(:disabled):active { transform: scale(0.98); }

/* Options-panel section labels (Language, etc.) */
.options-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.lang-picker {
  display: inline-flex;
  border: 1px solid var(--border-main);
  border-radius: 999px;
  background: var(--bg-surface);
  padding: 4px;
  gap: 4px;
}

.lang-option {
  border: none;
  background: transparent;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  min-width: 44px;
}

.lang-option--active {
  background: var(--brand-orange);
  color: #FFFFFF;
}

/* ============================================
   AUTH PANEL (POI 1, anonymous users)
   Renders as a .modal-overlay > .modal so it shares the exact shell as
   Options / How-to-Play. The styles below only tune the inner pieces.
   ============================================ */

.auth-banner__sub {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 18px;
}

.auth-banner__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: var(--brand-marine);
  color: #FFFFFF;
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  border: 2px solid var(--brand-marine);
  border-radius: var(--radius);
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}

.auth-banner__cta:hover  { filter: brightness(1.08); }
.auth-banner__cta:active { transform: scale(0.98); }

.auth-banner__later {
  display: block;
  margin: 14px auto 0;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 8px;
}

.auth-banner__later:hover { color: var(--text-main); }

/* ============================================
   OPTIONS PANEL — language section + empty state
   ============================================ */

.options-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-main);
}

.options-empty {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ============================================
   IN-GAME HINT LINE (under "Find This Place")
   ============================================ */

.game-hint {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 4px;
}

.game-hint::before {
  content: '';
}

/* ============================================
   RTL TWEAKS for Arabic
   ============================================ */

[dir="rtl"] .header__actions--left  { left: auto; right: 16px; }
[dir="rtl"] .header__actions--right { right: auto; left: 16px; }
[dir="rtl"] .modal__x               { right: auto; left: 12px; }
[dir="rtl"] .auth-banner__close     { right: auto; left: 8px; }
[dir="rtl"] .auth-banner__title     { padding-right: 0; padding-left: 28px; }
[dir="rtl"] .auth-banner__later     { align-self: flex-end; }

