/* ══════════════════════════════════════════
   Los! – style.css
   Shared styles for all pages
══════════════════════════════════════════ */

/* ── VARIABLES ── */
:root {
  --sky: #4DD9D9;
  --sand: #E8A84C;
  --ink: #0c1a1a;
  --ink-60: rgba(12,26,26,0.6);
  --ink-20: rgba(12,26,26,0.12);
  --white: #ffffff;
  --green: #2E7D3A;
  --green-dark: #236030;
  --red: #D95246;
  --amber: #EFA030;
  --card-bg: rgba(255,255,255,0.92);
  --card-border: rgba(255,255,255,0.6);
  --r: 16px;
  --r-sm: 10px;
}

/* ── RESET ── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html {
  scroll-behavior: smooth;
  font-size: 18px; /* base: 1rem = 18px. Scales all rem values up for comfort */
}

body {
  background: var(--sky);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--sky);
  border-bottom: 1px solid var(--ink-20);
}

.logo {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: -0.5px;
  color: var(--ink);
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 4.5px;
  cursor: pointer;
  padding: 6px;
  background: none;
  border: none;
  border-radius: 8px;
  transition: background 0.15s;
}
.hamburger:hover { background: var(--ink-20); }
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

/* ── SLIDE MENU ── */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  backdrop-filter: blur(2px);
}
.menu-overlay.open { opacity: 1; pointer-events: all; }

.menu-panel {
  position: fixed;
  top: 0; left: 0;
  width: 70%;
  max-width: 280px;
  height: 100%;
  background: var(--ink);
  z-index: 201;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
}
.menu-panel.open { transform: translateX(0); }

.menu-head {
  padding: 52px 24px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: relative;
}
.menu-close {
  position: absolute;
  top: 16px; right: 16px;
  background: rgba(255,255,255,0.08);
  border: none;
  color: white;
  font-size: 0.9rem;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.menu-close:hover { background: rgba(255,255,255,0.16); }

.menu-logo {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--sky);
}
.menu-tagline {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.38);
  margin-top: 3px;
  letter-spacing: 0.05em;
}

.menu-nav { padding: 10px 0; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  color: rgba(255,255,255,0.75);
  font-size: 1rem;
  cursor: pointer;
  border-left: 2.5px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-decoration: none;
}
.menu-item:hover {
  background: rgba(255,255,255,0.05);
  color: white;
  border-left-color: var(--sky);
}

/* ── PAGE WRAPPER ── */
.page-wrap {
  padding-top: 60px;
  min-height: 100vh;
  animation: fadeUp 0.22s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── SKYLINE ── */
/*
  Image: 1771x914px with transparent background (black removed).
  Silhouette is the sand colour, displayed as <img>.
  80% width → air on both sides. Anchored to bottom of container.
  Front page: 210px tall shows full spire.
  Inner pages (.sm): 130px shows just the roofline mass.
*/
.skyline-wrap {
  width: 100%;
  max-width: 480px;       /* constrain to content width on desktop */
  margin: 0 auto;         /* center it */
  height: 210px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}
.skyline-wrap img {
  width: 80%;
  max-width: 340px;       /* never wider than a natural desktop size */
  height: auto;
  display: block;
  flex-shrink: 0;
}
.skyline-wrap.sm {
  height: 130px;
}

/* ── SHARED TYPOGRAPHY ── */
.eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 6px;
}

.page-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.85rem;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 22px;
}

/* ── FRONT PAGE ── */
.front-content {
  padding: 22px 20px max(52px, calc(24px + env(safe-area-inset-bottom)));
  max-width: 480px;
  margin: 0 auto;
}

.front-headline {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 2rem;
  line-height: 1.12;
  color: var(--ink);
  margin-bottom: 10px;
}
.front-intro {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink);
  margin-bottom: 26px;
}

.section-divider {
  height: 1px;
  background: var(--ink-20);
  margin: 0 0 22px;
}

.tips-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 10px;
}
.tips-list {
  list-style: none;
  margin-bottom: 28px;
}
.tips-list li {
  font-size: 1rem;
  line-height: 1.75;
  padding: 13px 0 13px 28px;
  position: relative;
  color: var(--ink);
  border-bottom: 1px solid var(--ink-20);
}
.tips-list li:last-child { border-bottom: none; }
.tips-list li::before {
  content: attr(data-n);
  position: absolute;
  left: 0; top: 12px;
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--ink);
}

.start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 17px;
  background: var(--ink);
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.02em;
  border: none;
  border-radius: var(--r);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.12s;
  margin-bottom: 12px;
  text-decoration: none;
  -webkit-appearance: none;
}
.start-btn:hover { opacity: 0.87; }
.start-btn:active { transform: scale(0.98); }
.start-btn .arrow { transition: transform 0.2s; }
.start-btn:hover .arrow { transform: translateX(3px); }

.duration-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--ink-20);
  border-radius: 99px;
  padding: 9px 16px;
  font-size: 1rem;
  color: var(--ink);
}


/* ── TOUR CARDS (front page) ── */
.tour-card {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--r);
  padding: 18px 18px 18px;
  margin-bottom: 12px;
  color: var(--ink);
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

.tour-card--soon {
  opacity: 0.55;
}

.tour-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.tour-card-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 10px;
}
.tour-soon-badge {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--ink-20);
  color: var(--ink-60);
  border-radius: 99px;
  padding: 4px 10px;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 3px;
}
.tour-card-desc {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink);
  margin-bottom: 14px;
}
.tour-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tour-meta-chip {
  font-size: 0.875rem;
  background: var(--ink-20);
  border-radius: 99px;
  padding: 4px 10px;
  color: var(--ink);
}
.tour-start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  background: var(--green);
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  border: none;
  border-radius: var(--r);
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.12s;
  touch-action: manipulation;
}
.tour-start-btn:hover { opacity: 0.87; }
.tour-start-btn:active { transform: scale(0.98); }
.tour-start-btn .arrow { transition: transform 0.2s; }
.tour-start-btn:hover .arrow { transform: translateX(3px); }

/* ── TOUR TITLE BAR (game page) ── */
.tour-title-bar {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 6px 20px 0;
}

/* ── FINISH TOUR NAME ── */
.finish-tour-name {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 8px;
  min-height: 1em;
}


/* ── LANGUAGE SWITCHER ── */
#langSwitcher {
  display: flex;
  gap: 3px;
  align-items: center;
}
.lang-btn {
  background: none;
  border: none;
  padding: 4px 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink);
  opacity: 0.45;
  cursor: pointer;
  border-radius: 6px;
  transition: opacity 0.15s, background 0.15s;
  touch-action: manipulation;
  line-height: 1;
}
.lang-btn:hover { opacity: 0.8; background: var(--ink-20); }
.lang-btn--active {
  opacity: 1;
  background: var(--ink);
  color: white;
}
.lang-btn--active:hover { opacity: 1; background: var(--ink); }

/* ── GAME PAGE ── */
.progress-bar-wrap {
  padding: 10px 20px 0;
  max-width: 480px;
  margin: 0 auto;
}
.progress-track {
  height: 2.5px;
  background: var(--ink-20);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--ink);
  border-radius: 3px;
  transition: width 0.55s cubic-bezier(0.4,0,0.2,1);
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 7px;
}
.chapter-pill {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}
.scene-count { font-size: 0.82rem; color: var(--ink); }

.game-content {
  padding: 16px 20px max(52px, calc(24px + env(safe-area-inset-bottom)));
  max-width: 480px;
  margin: 0 auto;
}

.scene-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r);
  padding: 22px 20px;
  font-size: 1rem;
  line-height: 1.85;
  color: var(--ink);
  margin-bottom: 18px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
  white-space: pre-wrap;
}
.scene-card b { font-weight: 600; }
.scene-card i { font-style: italic; color: var(--ink-60); }

.feedback {
  display: none;
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 11px;
  gap: 8px;
}
.feedback.wrong {
  display: flex;
  align-items: flex-start;
  background: rgba(217,82,70,0.09);
  color: #922820;
  border: 1px solid rgba(217,82,70,0.18);
}
.feedback.hint {
  display: flex;
  align-items: flex-start;
  background: rgba(239,160,48,0.11);
  color: #6e4800;
  border: 1px solid rgba(239,160,48,0.22);
}
.fb-icon { flex-shrink: 0; font-size: 0.85rem; margin-top: 1px; }

.answer-input {
  width: 100%;
  padding: 15px 16px;
  border-radius: var(--r);
  border: 1.5px solid rgba(12,26,26,0.14);
  background: rgba(255,255,255,0.88);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 11px;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.answer-input:focus {
  border-color: var(--ink);
  background: white;
  box-shadow: 0 0 0 3px rgba(12,26,26,0.05);
}
.answer-input::placeholder { color: var(--ink-60); }

.btn-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
}
.btn {
  padding: 16px 18px;
  border: none;
  border-radius: var(--r);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.12s;
}
.btn:active { transform: scale(0.97); }
.btn:hover { opacity: 0.87; }
.btn-answer { background: var(--green); color: white; }
.btn-hint {
  background: rgba(12,26,26,0.08);
  color: var(--ink);
  white-space: nowrap;
}

/* ── ABOUT PAGE ── */
.about-content {
  padding: 28px 20px max(52px, calc(24px + env(safe-area-inset-bottom)));
  max-width: 480px;
  margin: 0 auto;
}
.about-body p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--ink);
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--ink-20);
}
.about-body p:last-child { border-bottom: none; margin-bottom: 0; }
.about-link {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── FINISH PAGE ── */
.finish-content {
  padding: 44px 20px max(52px, calc(24px + env(safe-area-inset-bottom)));
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}
.finish-badge {
  width: 66px; height: 66px;
  background: var(--sand);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  margin: 0 auto 20px;
  box-shadow: 0 4px 18px rgba(232,168,76,0.3);
}
.finish-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.85rem;
  line-height: 1.12;
  margin-bottom: 16px;
}
.finish-time-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--ink-20);
  border-radius: var(--r);
  padding: 16px 24px;
  margin-bottom: 24px;
}
.finish-time-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 4px;
}
.finish-time {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 2.4rem;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.5px;
}

.finish-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--ink);
  margin-bottom: 32px;
}
.finish-body strong { color: var(--ink); font-weight: 600; }
.finish-actions { display: flex; flex-direction: column; gap: 9px; }
.finish-btn {
  display: block;
  width: 100%;
  padding: 17px;
  border-radius: var(--r);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
  text-decoration: none;
  -webkit-appearance: none;
}
.finish-btn:hover { opacity: 0.85; }
.finish-btn-primary { background: var(--ink); color: white; }
.finish-btn-secondary { background: rgba(12,26,26,0.14); color: var(--ink); border: 1.5px solid rgba(12,26,26,0.2); }

/* ── TOUCH FIXES ── */
@media (hover: none) {
  .btn:hover, .start-btn:hover, .finish-btn:hover { opacity: 1; }
  .start-btn:hover .arrow { transform: none; }
  .hamburger:hover { background: none; }
  .menu-item:hover {
    background: none;
    color: rgba(255,255,255,0.75);
    border-left-color: transparent;
  }
}
button, .menu-item, .start-btn, .finish-btn { touch-action: manipulation; }

/* ── FOCUS RINGS (keyboard navigation) ── */
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
.menu-item:focus-visible,
.menu-close:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 2px;
}
.answer-input:focus-visible {
  outline: none; /* handled by box-shadow */
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(12,26,26,0.18);
}

/* ── COOKIE CONSENT BANNER ── */
.consent-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 300;
  background: var(--ink);
  color: white;
  padding: 16px 20px max(16px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.18);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.consent-banner.hidden { display: none; }

.consent-text {
  font-size: 0.88rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.85);
}
.consent-text a {
  color: var(--sky);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.consent-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.consent-btn {
  padding: 12px;
  border-radius: var(--r-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: opacity 0.15s;
}
.consent-btn:hover { opacity: 0.87; }
.consent-btn--accept {
  background: var(--sky);
  color: var(--ink);
}
.consent-btn--decline {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
}
