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

:root {
  --bg: #0a0a0f;
  --surface: #13131a;
  --surface2: #1c1c28;
  --border: #2a2a3a;
  --accent: #f97316;
  --accent-dim: rgba(249, 115, 22, 0.15);
  --accent-glow: rgba(249, 115, 22, 0.3);
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.12);
  --yellow: #eab308;
  --yellow-dim: rgba(234, 179, 8, 0.12);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --text: #f1f1f5;
  --text-muted: #8888aa;
  --text-dim: #55556a;
  --radius: 16px;
  --radius-sm: 10px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 10, 15, 0.9);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.logo-icon { font-size: 1.4rem; }

.logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.logo-tagline {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(249,115,22,0.25);
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-switcher {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}

.lang-btn {
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 8px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.3px;
}

.lang-btn:hover { color: var(--text-muted); }

.lang-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ── Main ── */
main {
  flex: 1;
  padding: 0 20px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 24px 20px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

footer p {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.footer-sub {
  margin-top: 4px;
  font-size: 0.72rem !important;
}

/* ── Hero ── */
.hero {
  padding: 40px 0 32px;
  text-align: center;
}

.logo-mark {
  font-size: 3rem;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}

.hero-tagline {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.welcome-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 24px;
  text-align: left;
}

.welcome-msg {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 32px;
  color: var(--text);
}

.highlight {
  background: linear-gradient(135deg, var(--accent), #fb923c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Language strip ── */
.lang-strip {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 32px;
  text-align: left;
}

.lang-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: border-color 0.2s;
}

.lang-card:hover {
  border-color: var(--accent);
}

.lang-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(249,115,22,0.2);
  padding: 3px 7px;
  border-radius: 6px;
  white-space: nowrap;
  margin-top: 1px;
  flex-shrink: 0;
}

.lang-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Search ── */
.search-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 0 40px rgba(249,115,22,0.05);
}

.search-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.search-form {
  display: block;
}

.search-form-wrap input {
  flex: 1;
  padding: 14px 16px;
  font-size: 1rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-form-wrap input::placeholder { color: var(--text-dim); }

/* Kill browser native search/address UI decorations */
.search-form-wrap input[type="search"]::-webkit-search-decoration,
.search-form-wrap input[type="search"]::-webkit-search-cancel-button,
.search-form-wrap input[type="search"]::-webkit-search-results-button,
.search-form-wrap input[type="search"]::-webkit-search-results-decoration,
.search-form-wrap input[type="search"]::-webkit-contacts-auto-fill-button,
.search-form-wrap input[type="search"]::-webkit-credentials-auto-fill-button { display: none !important; }

.autocomplete-wrap { flex: 1; position: relative; min-width: 0; }

.search-form-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-form-wrap button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}

.search-form-wrap button:hover { background: #ea6c0a; }
.search-form-wrap button:active { transform: scale(0.97); }

/* Search form layout */
.search-form-wrap {
  display: flex;
  gap: 10px;
  position: relative;
}

/* Google Places Autocomplete dropdown — dark theme override */
.pac-container {
  background: #1c1c28 !important;
  border: 1.5px solid var(--accent) !important;
  border-radius: 12px !important;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6) !important;
  margin-top: 6px !important;
  font-family: 'Inter', -apple-system, sans-serif !important;
  overflow: hidden;
}

.pac-item {
  background: #1c1c28 !important;
  border-top: 1px solid #252535 !important;
  color: #f1f1f5 !important;
  cursor: pointer !important;
  padding: 10px 16px !important;
  font-size: 0.9rem !important;
  line-height: 1.5 !important;
  font-family: 'Inter', -apple-system, sans-serif !important;
}

.pac-item:first-child { border-top: none !important; }

.pac-item:hover,
.pac-item-selected {
  background: #252535 !important;
}

.pac-item-query {
  color: #f1f1f5 !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
}

.pac-matched {
  color: var(--accent) !important;
  font-weight: 700 !important;
}

.pac-icon { display: none !important; }

.pac-logo:after,
.hdpi.pac-logo:after { display: none !important; }

/* ── Stats row ── */
.stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 0;
}

.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-num { font-size: 1.3rem; }

.stat-text {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* ── Result ── */
.result {
  padding: 24px 0 40px;
}

.back-link {
  display: inline-block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 20px;
  transition: color 0.2s;
}

.back-link:hover { color: var(--accent); }

.result-header {
  margin-bottom: 20px;
}

.difficulty-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.d1, .d2 { background: var(--green-dim); color: var(--green); border: 1px solid rgba(34,197,94,0.25); }
.d3 { background: var(--yellow-dim); color: var(--yellow); border: 1px solid rgba(234,179,8,0.25); }
.d4, .d5 { background: var(--red-dim); color: var(--red); border: 1px solid rgba(239,68,68,0.25); }

.result-address {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.3;
}

.instruction-card {
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  box-shadow: 0 0 30px var(--accent-dim);
}

.instruction-icon { font-size: 1.6rem; flex-shrink: 0; margin-top: 2px; }

.instruction-text {
  font-size: 1.1rem;
  line-height: 1.65;
  font-weight: 500;
  color: var(--text);
}

.unit-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-bottom: 20px;
}

.unit-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.unit-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.visual-section { margin-bottom: 20px; }

.visual-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.visual-img-wrap {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.visual-img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.photos-section { margin-bottom: 20px; }

.photos-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.photo-wrap { border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }

.photo-wrap img {
  width: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 4/3;
}

.photo-caption {
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 6px 10px;
}

.help-card {
  text-align: center;
  padding: 16px;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.help-card a {
  color: var(--accent);
  text-decoration: none;
}

/* ── Tour CTA button ── */
.tour-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #f97316, #ea6c0a);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(249,115,22,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  animation: pulse-cta 2.5s ease-in-out infinite;
}
.tour-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(249,115,22,0.55);
  animation: none;
}
@keyframes pulse-cta {
  0%, 100% { box-shadow: 0 4px 20px rgba(249,115,22,0.4); }
  50% { box-shadow: 0 4px 32px rgba(249,115,22,0.7); }
}

/* ── Delivery Tour Player ── */
.tour-section {
  margin-bottom: 24px;
}

.tour-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.tour-player {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 40px var(--accent-dim);
  position: relative;
}

.tour-slides {
  position: relative;
  width: 100%;
  height: 380px;
  background: #000;
  overflow: hidden;
}

.tour-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.tour-slide.active { opacity: 1; }

.tour-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tour-slide-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  background: var(--surface);
}

/* Overlay for caption + arrows */
.tour-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.tour-step-bar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10,10,15,0.75);
  border: 1px solid rgba(249,115,22,0.3);
  border-radius: 20px;
  padding: 5px 12px;
  backdrop-filter: blur(8px);
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #555;
  transition: background 0.3s, transform 0.3s;
  cursor: pointer;
  pointer-events: all;
}
.step-dot.done { background: rgba(249,115,22,0.5); }
.step-dot.active { background: var(--accent); transform: scale(1.35); }

.step-counter {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-left: 4px;
}

.tour-caption-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(10,10,15,0.92) 40%);
  padding: 32px 18px 14px;
}

.tour-caption {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.45;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.tour-step-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  margin-bottom: 4px;
}

/* Arrow overlay */
.tour-arrow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  pointer-events: none;
  opacity: 0.9;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.7));
  transition: opacity 0.4s;
}
.tour-arrow.hidden { opacity: 0; }

/* Controls bar */
.tour-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.tour-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.tour-btn:hover { background: var(--accent); color: #fff; }
.tour-btn:disabled { opacity: 0.3; cursor: default; }
.tour-btn.primary { background: var(--accent); color: #fff; width: 44px; height: 44px; font-size: 1.2rem; }
.tour-btn.primary:hover { background: #ea6c0a; }

.tour-progress {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.tour-progress-track {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  pointer-events: all;
}

.tour-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.tour-progress-labels {
  display: flex;
  justify-content: space-between;
}

.tour-progress-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.tour-speed {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}

.speed-btn {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface2);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}
.speed-btn:hover { border-color: var(--accent); color: var(--accent); }
.speed-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.tour-fullscreen-btn {
  font-size: 0.75rem;
  margin-left: 2px;
}

/* Fullscreen tour */
.tour-player.fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  border-radius: 0;
  border: none;
}
.tour-player.fullscreen .tour-slides { height: calc(100vh - 60px); }
.tour-player.fullscreen .tour-controls { position: absolute; bottom: 0; left: 0; right: 0; z-index: 10; }

/* ── Not found ── */
.not-found {
  padding: 60px 0;
  text-align: center;
}

.not-found-icon { font-size: 3rem; margin-bottom: 16px; }

.not-found h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.not-found-addr {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 500;
}

.not-found-sub {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 28px;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.btn-back {
  display: inline-block;
  padding: 12px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: border-color 0.2s, color 0.2s;
}

.btn-back:hover { border-color: var(--accent); color: var(--accent); }

/* ── Admin ── */
.admin { padding: 32px 0; }

.admin h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 24px;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
  padding: 12px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus { border-color: var(--accent); }

.admin-form button {
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}

.admin-form button:hover { background: #ea6c0a; }

.success-msg {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(34,197,94,0.25);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-weight: 600;
  font-size: 0.9rem;
}
