/* World Explorer — styles. Big, colorful, kid-friendly, portrait-first.
   Reuses the football game's design language (same palette + big tap targets). */
:root {
  --brand: #2C3A43;
  --brand-2: #517485;
  --accent: #E84E0F;
  --green: #2E9E4F;
  --gold: #FFD700;
  --danger: #D2434D;
  --bg: #eaf2f6;
  --card: #ffffff;
  --ink: #1e2b33;
  --radius: 18px;
  --shadow: 0 6px 18px rgba(44, 58, 67, 0.14);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(160deg, #dbe9f0 0%, #eaf2f6 45%, #f4e9dd 100%);
  color: var(--ink);
  min-height: 100%;
}
.app { max-width: 640px; margin: 0 auto; min-height: 100vh; padding: 16px 16px 32px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- topbar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.topbar-title { font-weight: 800; font-size: 18px; color: var(--brand); flex: 1; text-align: center; }
.hub-btn { font-size: 16px; }
.home-topbar { display: flex; justify-content: flex-end; gap: 8px; padding: 4px 0; }

/* ---------- buttons ---------- */
.btn { min-height: 58px; padding: 12px 20px; border: none; border-radius: 14px; background: var(--brand-2); color: #fff; font: inherit; font-weight: 700; font-size: 17px; cursor: pointer; box-shadow: var(--shadow); min-width: 80px; }
.btn:active { transform: scale(0.97); }
.btn.small { min-height: 46px; font-size: 15px; padding: 8px 14px; background: var(--brand); }
.btn.primary { background: var(--accent); }
.btn.warn { background: var(--danger); }
.btn-block { width: 100%; }

/* ---------- home / map ---------- */
.mascot { font-size: 88px; text-align: center; line-height: 1; animation: bob 2.2s ease-in-out infinite; margin-top: 1vh; filter: drop-shadow(0 8px 10px rgba(0,0,0,0.15)); }
.mascot-name { text-align: center; font-weight: 900; color: var(--brand-2); font-size: 16px; margin-top: -6px; }
.home-title { font-size: clamp(26px, 6vw, 40px); font-weight: 800; text-align: center; color: var(--brand); letter-spacing: -0.5px; }
.home-fyi { text-align: center; color: var(--brand-2); font-size: 16px; margin-top: -6px; opacity: .9; }
.dialogue-bubble { max-width: 86%; margin: 4px auto 0; padding: 12px 16px; border-radius: 16px 16px 16px 4px; background: var(--card); box-shadow: var(--shadow); text-align: center; color: var(--brand); font-weight: 700; font-size: 17px; }
.map-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.world-map { width: 100%; max-width: 560px; margin: 0 auto; }
.world-map svg { width: 100%; height: auto; display: block; }
.region { cursor: pointer; transition: transform .12s ease, opacity .2s; }
.region:active { transform: scale(0.96); }
.region:hover { opacity: .9; }
.region-label { font-weight: 800; fill: #2C3A43; pointer-events: none; text-anchor: middle; }
.home-links { display: flex; justify-content: center; gap: 12px; }

/* ---------- home shortcuts (album / passport / settings) ---------- */
.shortcut-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 6px; }
.shortcut { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 96px; padding: 12px 8px; border: none; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); cursor: pointer; font: inherit; border-bottom: 4px solid var(--brand-2); }
.shortcut:active { transform: scale(0.96); }
.shortcut-ico { font-size: 34px; line-height: 1; }
.shortcut-label { font-weight: 800; font-size: 14px; color: var(--brand); }
.shortcut-sub { font-size: 12px; color: var(--brand-2); opacity: .85; }

/* ---------- region / place list ---------- */
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.panel h2 { color: var(--brand); margin: 0 0 12px; font-size: 22px; }
.panel h3 { color: var(--brand-2); margin: 0 0 8px; font-size: 17px; }
.place-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.place-card { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 120px; padding: 14px 8px; border: none; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); cursor: pointer; font: inherit; border-bottom: 4px solid var(--brand-2); }
.place-card:active { transform: scale(0.96); }
.place-flag { width: 76px; height: 50px; border-radius: 8px; box-shadow: var(--shadow); object-fit: cover; background: #fff; }
.place-name { font-weight: 800; font-size: 16px; color: var(--brand); text-align: center; }
.place-stamp { font-size: 12px; color: var(--accent); font-weight: 800; }
.muted { color: var(--brand-2); opacity: .8; }
.center { text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }

/* ---------- arrival / postcard ---------- */
.postcard { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; text-align: center; }
.postcard-flag { width: 150px; height: 100px; border-radius: 10px; box-shadow: var(--shadow); object-fit: cover; margin: 6px auto 10px; background: #fff; }
.postcard-title { font-size: 30px; font-weight: 900; color: var(--brand); margin: 4px 0; }
.postcard-facts { color: var(--brand-2); font-size: 18px; margin: 8px 0 16px; }
.postcard-dialogue { max-width: 86%; margin: 10px auto 0; padding: 12px 16px; border-radius: 16px 16px 4px 16px; background: #eef4f8; color: var(--brand); font-weight: 700; font-size: 16px; }

/* ---------- question ---------- */
.question-area { display: flex; flex-direction: column; gap: 16px; }
.q-clue { display: flex; flex-direction: column; align-items: center; gap: 12px; min-height: 130px; justify-content: center; }
.q-clue .flag { width: 130px; height: 86px; border-radius: 10px; box-shadow: var(--shadow); object-fit: cover; background: #fff; }
.q-clue .clue-capital { font-size: 22px; font-weight: 800; color: var(--brand-2); }
.q-prompt { font-size: clamp(20px, 5vw, 28px); font-weight: 800; text-align: center; color: var(--brand); display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.streak-pip-wrap { display: inline-flex; }
.streak-pip { background: var(--accent); color: #fff; font-size: 15px; padding: 4px 10px; border-radius: 999px; font-weight: 800; box-shadow: var(--shadow); }
.q-choices { display: grid; gap: 12px; }
.choice { min-height: 64px; padding: 16px; border: none; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); font: inherit; font-weight: 700; font-size: 20px; color: var(--brand); cursor: pointer; border-left: 5px solid var(--brand-2); transition: transform .1s ease, background .2s; }
.choice:active { transform: scale(0.98); }
.choice.is-answer { background: var(--green); color: #fff; border-left-color: #1b6a37; }
.choice.is-picked { background: #f7d9d9; color: var(--danger); border-left-color: var(--danger); }
.choice:disabled { cursor: default; opacity: .9; }
.q-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- feedback ---------- */
.feedback { margin-top: 12px; text-align: center; }
.feedback.good { animation: pop-in .35s ease; }
.feedback-title { font-size: 32px; font-weight: 900; color: var(--green); }
.feedback.ok .feedback-title { color: var(--accent); }
.feedback-sub { font-size: 17px; color: var(--brand-2); margin-top: 4px; }
.feedback-fact { margin: 10px auto; max-width: 90%; padding: 10px 14px; border-radius: 12px; background: #f0f5f8; color: var(--brand); font-weight: 700; font-size: 16px; }
.sticker-pop { width: 150px; margin: 16px auto 8px; padding: 14px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.sticker-pop span { font-size: 54px; display: block; }
.sticker-pop-label { font-weight: 800; font-size: 18px; color: var(--brand); margin-top: 6px; }
.sticker-pop-rarity { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); }
.sticker-pop.rare { border: 3px solid #b06ab3; }
.sticker-pop.shiny { border: 3px solid var(--gold); animation: glow 1.4s ease-in-out infinite; }
.feedback-actions { margin-top: 14px; }

/* ---------- album & passport ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab-btn { flex: 1; min-height: 48px; border: 2px solid var(--brand-2); background: #fff; color: var(--brand-2); border-radius: 12px; font: inherit; font-weight: 800; cursor: pointer; }
.tab-btn.on { background: var(--brand-2); color: #fff; }
.album-progress { height: 22px; background: #e3ecf1; border-radius: 999px; overflow: hidden; }
.album-progress .bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); transition: width .5s ease; }
.album-grid { margin-top: 16px; }
.album-section { margin-bottom: 16px; }
.album-stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.sticker { background: #fff; border: 2px solid #e0e8ee; border-radius: 12px; padding: 8px; box-shadow: var(--shadow); }
.sticker.rare { border-color: #b06ab3; }
.sticker.shiny { border-color: var(--gold); animation: glow 1.6s ease-in-out infinite; }
.sticker-emoji { font-size: 40px; display: block; text-align: center; }
.sticker-label { font-size: 12px; font-weight: 700; color: var(--brand); text-align: center; margin-top: 4px; overflow-wrap: anywhere; }
.passport-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.passport.card { background: #fff; border: 2px solid #e0e8ee; border-radius: 14px; padding: 12px 8px; text-align: center; box-shadow: var(--shadow); }
.passport.card.visited { border-color: var(--accent); }
.passport.flag { width: 64px; height: 42px; border-radius: 6px; object-fit: cover; margin: 0 auto 6px; background: #fff; }
.passport.name { font-weight: 800; font-size: 14px; color: var(--brand); }
.passport.date { font-size: 11px; color: var(--brand-2); margin-top: 2px; }
.passport.trip-stamp { font-size: 10px; color: #fff; background: var(--accent); border-radius: 8px; padding: 2px 6px; margin-top: 4px; display: inline-block; font-weight: 800; }

/* ---------- settings ---------- */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; }
.setting-row label { font-weight: 700; color: var(--brand); }
.seg { display: inline-flex; gap: 6px; }
.seg-btn { min-height: 48px; padding: 6px 16px; border: 2px solid var(--brand-2); background: #fff; color: var(--brand-2); border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer; }
.seg-btn.on { background: var(--brand-2); color: #fff; }

/* ---------- map + text clues ---------- */
.landmark-clue { width: 100%; max-width: 380px; margin: 0 auto; }
.landmark-clue img.landmark-photo { width: 100%; height: 190px; object-fit: cover; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); display: block; margin-bottom: 10px; background: #eee; }
.locator-clue { width: 100%; max-width: 400px; margin: 0 auto; }
.locator-clue img.loc-map { width: 100%; height: auto; display: block; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); background: #dceef7; }
.map-clue { width: 100%; max-width: 440px; margin: 0 auto; pointer-events: none; }
.map-clue svg { width: 100%; height: auto; display: block; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); background: #dceef7; }
.map-clue .region { cursor: default; }
.map-pin { pointer-events: none; }
.map-pin .pin-core { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.map-pin .pin-ring { fill: none; stroke: var(--accent); stroke-width: 2.5; transform-box: fill-box; transform-origin: center; animation: pulsering 1.6s ease-out infinite; }
.clue-big { font-size: clamp(24px, 6vw, 34px); font-weight: 900; color: var(--brand); text-align: center; background: var(--card); box-shadow: var(--shadow); border-radius: 16px; padding: 20px 22px; max-width: 90%; margin: 0 auto; }
.clue-big.fact { background: #f0f5f8; }
@keyframes pulsering { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.9); opacity: 0; } }

/* ---------- difficulty --- */
.diff-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.diff-label { font-weight: 800; color: var(--brand-2); font-size: 15px; }

/* ---------- theme quiz --- */
.quiz-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.quiz-card { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 64px; padding: 12px 10px; border: none; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); cursor: pointer; font: inherit; border-bottom: 4px solid var(--brand-2); }
.quiz-card:active { transform: scale(0.97); }
.quiz-card .attack-ico { font-size: 26px; line-height: 1; }
.quiz-card .attack-title { font-weight: 800; font-size: 15px; color: var(--brand); }
.quiz-card--all { border-bottom-color: var(--accent); grid-column: 1 / -1; }
.quiz-hud { display: flex; flex-direction: column; gap: 8px; }
.quiz-mode { font-weight: 900; font-size: 20px; color: var(--brand); text-align: center; }

/* ---------- badges --- */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.badge { background: #fff; border: 2px solid #e0e8ee; border-radius: 14px; padding: 12px 8px; text-align: center; box-shadow: var(--shadow); }
.badge.earned { border-color: var(--gold); }
.badge.locked { opacity: .5; filter: grayscale(.6); }
.badge-emoji { font-size: 34px; display: block; }
.badge-label { font-size: 12px; font-weight: 700; color: var(--brand); margin-top: 4px; overflow-wrap: anywhere; }
.badge-done { color: var(--green); font-weight: 800; }
.badge-lock { color: var(--brand-2); }

/* ---------- time attack ---------- */
.attack-card-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.attack-card { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 104px; padding: 14px 10px; border: none; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); cursor: pointer; font: inherit; border-top: 4px solid var(--accent); }
.attack-card:active { transform: scale(0.97); }
.attack-ico { font-size: 32px; line-height: 1; }
.attack-title { font-weight: 800; font-size: 16px; color: var(--brand); }
.attack-desc { font-size: 12px; color: var(--brand-2); opacity: .85; text-align: center; }

.attack-hud { position: relative; display: flex; flex-direction: column; gap: 8px; }
.attack-quit { position: absolute; top: -4px; right: -4px; align-self: flex-end; background: var(--danger); }
.attack-mode { font-weight: 900; font-size: 20px; color: var(--brand); text-align: center; }
.attack-stats { display: flex; justify-content: space-around; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 8px 6px; font-weight: 700; color: var(--brand-2); }
.attack-stat strong { color: var(--accent); font-size: 20px; }
.attack-timer { height: 12px; background: #e3ecf1; border-radius: 999px; overflow: hidden; margin: 2px 0 12px; }
.attack-timer-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); transition: width .25s linear; }
.attack-timer-bar.low { background: var(--danger); }
.attack-question { display: flex; flex-direction: column; gap: 14px; }
.attack-flash .feedback-title { font-size: 24px; }
.result-score { font-size: 72px; font-weight: 900; color: var(--accent); line-height: 1; margin: 6px 0 2px; }
.new-best { font-weight: 800; color: var(--gold); font-size: 22px; }
.mascot.small { font-size: 48px; }

/* ---------- confetti ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 9999; overflow: hidden; }
.confetti span { position: absolute; top: -20px; display: block; border-radius: 3px; animation: fall linear forwards; }

/* ---------- animations ---------- */
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes pop-in { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes glow { 0%,100% { box-shadow: 0 0 6px var(--gold); } 50% { box-shadow: 0 0 22px var(--gold); } }
@keyframes fall { 0% { transform: translateY(-30px) rotate(0); opacity: 1; } 100% { transform: translateY(105vh) rotate(720deg); opacity: 0; } }

@media (min-width: 520px) {
  .place-list { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}
