/* ═══════════════════════════════════════════════════
   Passport Explorer — Geography Game for Ariana
   Travel Adventure Theme  |  Fredoka One + Nunito
═══════════════════════════════════════════════════ */

:root {
  --cream: #fdf6e3;
  --sidebar-bg: #f5ead0;
  --sidebar-border: #8b6914;
  --ink: #3d2b00;
  --muted: #7a6040;
  --shadow: 0 8px 32px rgba(61, 43, 0, 0.12);
  --radius: 18px;
  --sidebar-width: 276px;
  --topnav-height: 54px;
  --europe: #4a90e2;
  --asia: #e8a000;
  --africa: #e05c00;
  --america: #27ae60;
  --oceania: #9b59b6;
  --arctic: #00bcd4;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', 'Trebuchet MS', system-ui, sans-serif;
  font-size: 1rem;
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    linear-gradient(rgba(139, 105, 20, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 105, 20, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
  min-height: 100vh;
}

/* ── Top nav ──────────────────────────────────── */

.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9000;
  height: var(--topnav-height);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  background: linear-gradient(135deg, #fffbf0, #fff8e8);
  border-bottom: 2px solid #d4a843;
  box-shadow: 0 2px 16px rgba(139, 105, 20, 0.14);
  overflow-x: auto;
}

.nav-logo {
  margin-right: auto;
  font-family: 'Fredoka One', cursive;
  font-size: 1.2rem;
  color: #8b6914;
  white-space: nowrap;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.nav-link {
  flex-shrink: 0;
  padding: 7px 15px;
  border: 2px solid #d4a843;
  border-radius: 50px;
  color: #8b6914;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  background: transparent;
  transition: background 0.18s, color 0.18s, transform 0.15s;
}
.nav-link:hover { background: #d4a843; color: white; transform: scale(1.04); }
.nav-link.active { background: #8b6914; color: white; border-color: #8b6914; }

/* ── App shell ────────────────────────────────── */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  padding-top: var(--topnav-height);
}

/* ── Sidebar ──────────────────────────────────── */

.sidebar {
  position: sticky;
  top: var(--topnav-height);
  height: calc(100vh - var(--topnav-height));
  background: var(--sidebar-bg);
  border-right: 2px solid var(--sidebar-border);
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: white;
  border: 2px solid #d4a843;
  text-decoration: none;
}
.brand-icon { font-size: 2rem; }
.brand strong { display: block; font-family: 'Fredoka One', cursive; font-size: 1rem; color: #8b6914; }
.brand small { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 700; }

.sidebar-toggle {
  display: none;
  padding: 10px 14px;
  border: 2px solid var(--sidebar-border);
  border-radius: 12px;
  background: var(--sidebar-border);
  color: white;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-nav a {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--ink);
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background 0.15s, transform 0.15s;
}
.side-nav a:hover { background: rgba(139, 105, 20, 0.12); transform: translateX(3px); }
.side-nav a.active { background: white; border-color: var(--sidebar-border); color: #8b6914; }

.sidebar-mascot {
  margin-top: auto;
  padding: 14px;
  border-radius: var(--radius);
  background: white;
  border: 2px solid #d4a843;
  text-align: center;
}
.sidebar-mascot .mascot-icon { font-size: 2rem; display: block; margin-bottom: 4px; }
.sidebar-mascot strong { display: block; font-family: 'Fredoka One', cursive; color: #8b6914; font-size: 0.95rem; }
.sidebar-mascot p { font-size: 0.77rem; color: var(--muted); font-weight: 700; margin-top: 3px; }

/* ── Workspace & sections ─────────────────────── */

.workspace { padding: 28px; min-width: 0; }

.section-panel { display: none; animation: riseIn 0.3s ease both; }
.section-panel.active { display: block; }

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

.section-header { margin-bottom: 24px; }
.section-eyeline {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.section-title {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  color: var(--ink);
  line-height: 1.1;
}

/* ── Buttons ──────────────────────────────────── */

button, input, select { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 18px;
  border: 0;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.93rem;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, #8b3a00, #c47d00); color: white; box-shadow: 0 6px 18px rgba(139, 105, 20, 0.28); }
.btn-soft { background: #fff8e0; color: #8b6914; border: 2px solid #d4a843; }
.btn-danger { background: #fff0f0; color: #c0392b; border: 2px solid #e74c3c; }
.btn-turn { background: #ffe082; color: #8b6914; border: 2px solid #d4a843; padding: 8px 14px; font-size: 0.85rem; }

/* ── Profile section ──────────────────────────── */

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

.passport-cover {
  border-radius: var(--radius);
  background: linear-gradient(145deg, #8b3a00, #c47d00 55%, #8b6914);
  padding: 32px;
  color: white;
  position: relative;
  overflow: hidden;
  min-height: 280px;
}
.passport-cover::after {
  content: '✈';
  position: absolute;
  right: 20px; bottom: 10px;
  font-size: 8rem;
  opacity: 0.1;
  transform: rotate(-15deg);
  pointer-events: none;
}
.passport-emblem { font-size: 3.5rem; display: block; margin-bottom: 10px; }
.passport-title { font-family: 'Fredoka One', cursive; font-size: 2.2rem; line-height: 1; }
.passport-sub { font-weight: 700; opacity: 0.85; margin-top: 6px; }

.passport-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
}
.stat-box {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}
.stat-box dt { font-size: 0.72rem; font-weight: 900; opacity: 0.85; margin-bottom: 2px; }
.stat-box dd { font-family: 'Fredoka One', cursive; font-size: 1.7rem; }

.profile-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  border: 2px solid #d4a843;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.profile-card label {
  display: block;
  font-weight: 900;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}
.profile-card select,
.profile-card input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #d4a843;
  border-radius: 10px;
  font-weight: 700;
  color: var(--ink);
  background: var(--cream);
}
.profile-card select:focus,
.profile-card input:focus { outline: 3px solid rgba(212, 168, 67, 0.4); }

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

.turn-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #fff8e0;
  border: 2px solid #d4a843;
  border-radius: 12px;
}
.turn-label { font-size: 0.82rem; font-weight: 800; color: var(--muted); white-space: nowrap; }
#currentPlayerBadge { font-family: 'Fredoka One', cursive; font-size: 1rem; color: #8b6914; flex: 1; }

/* ── Map section ──────────────────────────────── */

.map-search-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.map-search-row input {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid #d4a843;
  border-radius: 50px;
  font-weight: 700;
  background: white;
  color: var(--ink);
  max-width: 340px;
}
.map-search-row input:focus { outline: 3px solid rgba(212, 168, 67, 0.4); }

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 340px;
  gap: 20px;
  align-items: start;
}

.world-map-wrap {
  background: white;
  border-radius: var(--radius);
  border: 2px solid #d4a843;
  padding: 12px;
  box-shadow: var(--shadow);
}
.world-map-wrap svg { display: block; width: 100%; }

.continent { stroke: rgba(255, 255, 255, 0.65); stroke-width: 3; }
.c-americas  { fill: #9ed8b0; }
.c-americas2 { fill: #7ec898; }
.c-europe    { fill: #a8c8f0; }
.c-africa    { fill: #f4a878; }
.c-africa2   { fill: #eea060; }
.c-asia      { fill: #f8d880; }
.c-oceania   { fill: #d4b8f0; }

.map-pin { cursor: pointer; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.22)); }
.map-pin circle { transition: r 0.15s ease; }
.map-pin:hover circle, .map-pin:focus circle { r: 17; }
.map-pin text { pointer-events: none; font-size: 15px; }
.map-pin:focus { outline: none; }
.map-pin:focus-visible circle { stroke-width: 6; }

.map-legend {
  display: flex;
  gap: 14px;
  padding: 8px 4px 2px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--muted);
  flex-wrap: wrap;
}
.legend-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

/* Discovery card */
.discovery-card {
  background: white;
  border-radius: var(--radius);
  border: 2px solid #d4a843;
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 500px;
}

.card-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 500px;
  padding: 32px;
  text-align: center;
  color: var(--muted);
  gap: 10px;
}
.card-empty .empty-icon { font-size: 4.5rem; }
.card-empty h3 { font-family: 'Fredoka One', cursive; font-size: 1.3rem; color: var(--ink); }
.card-empty p { font-weight: 700; font-size: 0.9rem; line-height: 1.5; }

.card-inner {
  border-top: 6px solid var(--continent-color, #4a90e2);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card-header { display: flex; gap: 14px; align-items: flex-start; }
.card-flag { font-size: 3.4rem; line-height: 1; flex-shrink: 0; }
.card-name { font-family: 'Fredoka One', cursive; font-size: 1.75rem; line-height: 1; color: var(--ink); margin-bottom: 4px; }
.continent-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  color: white;
  font-size: 0.76rem;
  font-weight: 900;
}

.card-facts { display: grid; gap: 5px; }
.fact-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 10px;
  background: #fdf6e3;
}
.fact-row dt { font-size: 0.8rem; font-weight: 900; color: var(--muted); }
.fact-row dd { font-weight: 700; color: var(--ink); }
.fact-highlight { background: #fff8e0; }
.fact-highlight dt { color: #8b6914; }

.story-box {
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff8e0, #fdf0d0);
  border-left: 4px solid #d4a843;
  color: #6b4000;
  font-weight: 700;
  line-height: 1.55;
  font-size: 0.9rem;
}

.card-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn-stamp {
  padding: 11px 16px;
  border: 0;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 900;
  font-size: 0.9rem;
  cursor: pointer;
  background: linear-gradient(135deg, #c0392b, #e74c3c);
  color: white;
  transition: transform 0.15s;
}
.btn-stamp:hover { transform: translateY(-2px); }
.btn-stamp.btn-stamped { background: linear-gradient(135deg, #27ae60, #2ecc71); }

.btn-story {
  padding: 11px 16px;
  border: 2px solid #d4a843;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 900;
  font-size: 0.9rem;
  cursor: pointer;
  background: #fff8e0;
  color: #8b6914;
  transition: transform 0.15s;
}
.btn-story:hover { transform: translateY(-2px); }

/* ── Flags game ───────────────────────────────── */

.flags-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.flags-header p { font-weight: 700; color: var(--muted); font-size: 0.9rem; }

.flags-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.flags-card {
  background: white;
  border-radius: var(--radius);
  border: 2px solid #d4a843;
  border-top: 6px solid var(--continent-color, #4a90e2);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.flags-card-inner { padding: 22px; }
.flags-continent-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 50px;
  color: white;
  font-size: 0.8rem;
  font-weight: 900;
  margin-bottom: 10px;
}
.flags-country-name {
  font-family: 'Fredoka One', cursive;
  font-size: 2.1rem;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 6px;
}
.flags-capital { color: var(--muted); font-weight: 700; font-size: 0.9rem; margin-bottom: 12px; }
.flags-prompt { font-weight: 800; color: #8b6914; font-size: 0.92rem; }

.flags-drop-zone {
  margin: 0 22px 20px;
  min-height: 96px;
  border: 3px dashed #d4a843;
  border-radius: 14px;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.88rem;
  transition: background 0.2s, border-color 0.2s;
}
.flags-drop-zone.drag-over { background: #fff8e0; border-color: #8b6914; border-style: solid; }

.flags-options-panel {
  background: white;
  border-radius: var(--radius);
  border: 2px solid #d4a843;
  padding: 20px;
  box-shadow: var(--shadow);
}
.flags-options-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 14px;
}
.flags-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.flag-option {
  padding: 16px 8px;
  border: 2px solid #d4a843;
  border-radius: 14px;
  background: var(--cream);
  cursor: grab;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.flag-option:hover:not(:disabled) { transform: translateY(-3px) rotate(2deg); box-shadow: 0 8px 20px rgba(139, 105, 20, 0.18); border-color: #8b6914; }
.flag-option:active { cursor: grabbing; }
.flag-option:disabled { opacity: 0.5; cursor: not-allowed; }
.flag-option.dragging { opacity: 0.35; transform: scale(0.92); }
.flag-option.touch-active { transform: scale(1.08); border-color: #8b6914; }
.flag-emoji { display: block; font-size: 2.8rem; margin-bottom: 6px; line-height: 1; }
.flag-name { display: block; font-size: 0.76rem; font-weight: 800; color: var(--muted); }

@keyframes shake {
  0%, 100% { transform: translateX(0) rotate(0); }
  20%  { transform: translateX(-7px) rotate(-2deg); }
  40%  { transform: translateX(7px) rotate(2deg); }
  60%  { transform: translateX(-4px) rotate(-1deg); }
  80%  { transform: translateX(4px) rotate(1deg); }
}
.flag-option.shake { animation: shake 0.55s ease; }

.flags-feedback {
  margin-top: 16px;
  padding: 13px 18px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.93rem;
  background: #fff8e0;
  color: #8b6914;
  border: 2px solid #d4a843;
}
.flags-feedback.correct { background: #d4edda; color: #155724; border-color: #27ae60; }
.flags-feedback.wrong   { background: #f8d7da; color: #721c24; border-color: #e74c3c; }

/* ── Passport section ─────────────────────────── */

.passport-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 22px;
  align-items: start;
}

.passport-book-page {
  background: white;
  border-radius: var(--radius);
  border: 2px solid #d4a843;
  padding: 22px;
  box-shadow: var(--shadow);
  background-image:
    linear-gradient(90deg, rgba(139, 105, 20, 0.045) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(rgba(139, 105, 20, 0.045) 1px, transparent 1px) 0 0 / 32px 32px;
  background-color: white;
}

.passport-page-heading {
  font-family: 'Fredoka One', cursive;
  font-size: 1.2rem;
  color: #8b6914;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#stampCount { font-size: 0.82rem; font-weight: 800; color: var(--muted); }

.stamp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.stamp {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 98px;
  padding: 10px 6px;
  border-radius: 50% 46% / 40% 52%;
  text-align: center;
  gap: 3px;
}
.stamp.discovered {
  border: 3px solid var(--col, #c0392b);
  color: var(--col, #c0392b);
  background: rgba(255, 255, 255, 0.92);
  transform: rotate(var(--rot, -3deg));
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.08);
}
.stamp.locked {
  border: 2px dashed #c9b48e;
  color: #c9b48e;
  background: var(--cream);
  font-size: 1.4rem;
}
.stamp-flag { font-size: 1.5rem; line-height: 1; }
.stamp-name {
  font-size: 0.6rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

.passport-sidebar { display: flex; flex-direction: column; gap: 16px; }

.passport-side-card {
  background: white;
  border-radius: var(--radius);
  border: 2px solid #d4a843;
  padding: 16px;
  box-shadow: var(--shadow);
}
.passport-side-card h3 {
  font-family: 'Fredoka One', cursive;
  font-size: 1.05rem;
  color: #8b6914;
  margin-bottom: 14px;
}

#continentProgress { display: flex; flex-direction: column; gap: 9px; }
.cont-bar {}
.cont-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.mini-meter { height: 9px; border-radius: 50px; background: #e8dcc8; overflow: hidden; }
.mini-fill { height: 100%; border-radius: 50px; transition: width 0.4s ease; min-width: 0; }

#missionList { display: flex; flex-direction: column; gap: 9px; }
.mission-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--cream);
  border: 2px solid #e8dcc8;
}
.mission-card.done { background: #d4edda; border-color: #27ae60; }
.mission-icon { font-size: 1.5rem; }
.mission-body h3 { font-size: 0.82rem; font-weight: 900; color: var(--ink); margin-bottom: 3px; }
.mission-body .mini-meter { margin-top: 4px; }
.mission-body small { font-size: 0.74rem; font-weight: 700; color: var(--muted); display: block; margin-top: 4px; }
.mission-badge { font-size: 1.3rem; }

/* ── Collections section ──────────────────────── */

.album-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.album-tab {
  padding: 9px 18px;
  border: 2px solid #d4a843;
  border-radius: 50px;
  background: var(--cream);
  color: #8b6914;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.album-tab:hover:not(.active) { background: #fff8e0; }
.album-tab.active { background: #8b6914; color: white; border-color: #8b6914; }

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 14px;
}
.album-item {
  background: white;
  border-radius: var(--radius);
  border: 2px solid #d4a843;
  border-top: 5px solid var(--continent-color, #d4a843);
  padding: 16px 12px;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.album-item:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(139, 105, 20, 0.14); }
.album-item.locked { filter: grayscale(0.8); opacity: 0.7; border-top-color: #c9b48e; }
.album-icon { font-size: 2.4rem; line-height: 1; margin-bottom: 4px; }
.album-item strong { font-weight: 800; font-size: 0.85rem; color: var(--ink); }
.album-item small { font-size: 0.72rem; color: var(--muted); font-weight: 700; }

/* ── Settings section ─────────────────────────── */

.settings-card {
  max-width: 520px;
  background: white;
  border-radius: var(--radius);
  border: 2px solid #d4a843;
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 16px;
  background: var(--cream);
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.92rem;
}
.setting-row input[type="checkbox"] { width: 22px; height: 22px; cursor: pointer; accent-color: #8b6914; }
.settings-note {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Toast ────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 22px; right: 22px;
  z-index: 9999;
  max-width: min(380px, calc(100vw - 44px));
  padding: 13px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #8b3a00, #c47d00);
  color: white;
  font-weight: 800;
  font-size: 0.93rem;
  box-shadow: 0 8px 32px rgba(139, 105, 20, 0.34);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── Stamp animation overlay ──────────────────── */

#stampAnim {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0) rotate(-20deg);
  font-size: 7rem;
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
}
#stampAnim.show {
  animation: stampDrop 0.95s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes stampDrop {
  0%   { transform: translate(-50%, -50%) scale(0)   rotate(-20deg); opacity: 0; }
  28%  { transform: translate(-50%, -50%) scale(1.35) rotate(-6deg); opacity: 1; }
  52%  { transform: translate(-50%, -50%) scale(1)    rotate(-8deg); opacity: 1; }
  82%  { transform: translate(-50%, -50%) scale(1)    rotate(-8deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(0.7)  rotate(-8deg); opacity: 0; }
}

/* ── Airplane decoration ──────────────────────── */

.airplane-trail {
  position: fixed;
  top: calc(var(--topnav-height) + 16px);
  left: 0;
  font-size: 1.4rem;
  animation: flyAcross 22s linear infinite;
  pointer-events: none;
  z-index: 8999;
  opacity: 0.45;
}
@keyframes flyAcross {
  from { transform: translateX(-80px); }
  to   { transform: translateX(calc(100vw + 80px)); }
}

/* ── Responsive ───────────────────────────────── */

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky;
    top: var(--topnav-height);
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 8px 10px;
    gap: 8px;
  }
  .sidebar-mascot { display: none; }
  .brand { padding: 6px 10px; }
  .brand small { display: none; }
  .sidebar-toggle { display: block; }
  .side-nav { display: none; width: 100%; }
  .side-nav.open { display: flex; flex-direction: column; }
  .map-layout,
  .flags-layout,
  .passport-layout,
  .profile-grid { grid-template-columns: 1fr; }
  .discovery-card, .flags-card { min-height: auto; }
  .world-map-wrap svg { min-height: 260px; }
}

@media (max-width: 680px) {
  .workspace { padding: 12px; }
  .stamp-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
  .flags-options { grid-template-columns: 1fr 1fr; }
  .album-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .passport-stats { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
