* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

/* 顶栏 + 语言选择器 */
.topbar {
  position: fixed;
  top: 12px; right: 12px;
  z-index: 100;
}
.lang-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  padding: 6px 10px;
  border: 2px solid #2d3436;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 3px 0 #000;
}
.lang-wrap select {
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  color: #2d3436;
  cursor: pointer;
  outline: none;
  padding: 2px 4px;
}
.fallback-banner {
  position: fixed;
  top: 60px; left: 50%;
  transform: translateX(-50%);
  z-index: 99;
  background: #fff3cd;
  color: #856404;
  padding: 8px 14px;
  border: 2px solid #856404;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  max-width: 90%;
  text-align: center;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 50%, #a29bfe 100%);
  background-attachment: fixed;
  color: #2d3436;
  overflow-x: hidden;
}

body::before {
  content: "✈️ 🍜 🌮 🥖 🍔 🥐 🍣 🦘 🐼 🗽 🗼 🏯 🎡 🌶️ 🎌";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  font-size: 80px;
  opacity: 0.05;
  pointer-events: none;
  word-spacing: 60px;
  line-height: 200px;
  text-align: center;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.screen { display: none; width: 100%; max-width: 520px; }
.screen.active { display: block; animation: fadeIn 0.4s ease; }

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

.bubble {
  background: #fff;
  border-radius: 28px;
  padding: 32px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 0 0 4px #fff inset;
  border: 3px solid #2d3436;
  position: relative;
}

.title {
  font-size: 32px;
  font-weight: 900;
  text-align: center;
  letter-spacing: 1px;
}

.title-sub {
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  color: #e17055;
  margin-top: 4px;
}

.tagline {
  text-align: center;
  margin: 24px 0;
  color: #636e72;
  line-height: 1.7;
  font-size: 15px;
}

.footnote {
  text-align: center;
  margin-top: 16px;
  color: #b2bec3;
  font-size: 13px;
}

.disclaimer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #dfe6e9;
  color: #747d8c;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.mode-picker { margin: 20px 0 4px; }
.mode-label {
  margin-bottom: 8px;
  color: #636e72;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}
.mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-btn {
  padding: 11px 8px;
  background: #fff;
  color: #636e72;
  border: 2px solid #dfe6e9;
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
}
.mode-btn strong, .mode-btn span { display: block; }
.mode-btn strong { font-size: 15px; }
.mode-btn span { margin-top: 3px; font-size: 10px; }
.mode-btn.active {
  background: #fff9db;
  color: #2d3436;
  border-color: #2d3436;
  box-shadow: 0 3px 0 #000;
}

.btn-primary {
  display: block;
  width: 100%;
  padding: 16px;
  background: #2d3436;
  color: #ffeaa7;
  border: none;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 0 #000;
  margin-top: 16px;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 0 #000; }
.btn-primary:active { transform: translateY(4px); box-shadow: 0 2px 0 #000; }

.btn-ghost {
  display: block;
  width: 100%;
  padding: 12px;
  background: transparent;
  color: #636e72;
  border: 2px dashed #b2bec3;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
}
.btn-ghost:hover { background: #f5f6fa; color: #2d3436; }

/* 国家网格 */
.country-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.country-card {
  width: 100%;
  color: inherit;
  font-family: inherit;
  background: #fff;
  border: 3px solid #2d3436;
  border-radius: 20px;
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease;
  box-shadow: 0 4px 0 #000;
}
.country-card:hover { transform: translateY(-3px); box-shadow: 0 7px 0 #000; }
.country-card:active { transform: translateY(2px); box-shadow: 0 2px 0 #000; }

.country-flag { font-size: 44px; line-height: 1; }
.country-name { font-weight: 800; font-size: 16px; margin-top: 6px; }
.country-name-en { font-size: 11px; color: #b2bec3; margin-top: 2px; }

/* 答题界面 */
.quiz-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
#quiz-country-flag { font-size: 36px; }
.progress-wrap { flex: 1; }
.progress-text {
  font-size: 13px;
  font-weight: 700;
  color: #636e72;
  margin-bottom: 6px;
}
.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.streak {
  color: #e17055;
  font-size: 13px;
  font-weight: 900;
}
.progress-bar {
  height: 10px;
  background: #f1f2f6;
  border-radius: 10px;
  border: 2px solid #2d3436;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffeaa7, #fab1a0, #fd79a8);
  width: 5%;
  transition: width 0.4s ease;
}

.question {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.6;
  margin: 12px 0 20px;
  padding: 16px;
  background: #fff9db;
  border-radius: 16px;
  border-left: 5px solid #fdcb6e;
}

.options { display: flex; flex-direction: column; gap: 10px; }

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 3px solid #2d3436;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 0 #000;
  text-align: left;
}
.option:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #000; }
.option-letter {
  display: inline-flex;
  width: 28px; height: 28px;
  align-items: center; justify-content: center;
  background: #2d3436;
  color: #ffeaa7;
  border-radius: 50%;
  font-weight: 900;
  font-size: 14px;
  flex-shrink: 0;
}
.option-text { flex: 1; }

.option.correct {
  background: #d1f7c4;
  border-color: #00b894;
  box-shadow: 0 4px 0 #00b894;
}
.option.correct .option-letter { background: #00b894; color: #fff; }

.option.wrong {
  background: #ffd6d6;
  border-color: #d63031;
  box-shadow: 0 4px 0 #d63031;
  animation: shake 0.4s ease;
}
.option.wrong .option-letter { background: #d63031; color: #fff; }

.option.disabled { pointer-events: none; opacity: 0.7; }
.option.disabled.correct, .option.disabled.wrong { opacity: 1; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.explain {
  display: none;
  margin-top: 16px;
  padding: 14px;
  background: #f0f3ff;
  border-radius: 14px;
  border-left: 5px solid #6c5ce7;
  font-size: 14px;
  line-height: 1.6;
  color: #2d3436;
}
.explain.show { display: block; animation: fadeIn 0.3s ease; }
.explain b { color: #6c5ce7; }

/* 上下题导航 */
.quiz-nav {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: 16px;
}
.quiz-nav .btn-prev {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 12px 16px;
  font-size: 13px;
  white-space: nowrap;
}
.quiz-nav .btn-primary {
  flex: 1;
  margin-top: 0;
}

/* 结果页 */
.result-emoji {
  font-size: 90px;
  text-align: center;
  line-height: 1;
  margin-bottom: 10px;
}
.score {
  text-align: center;
  font-size: 48px;
  font-weight: 900;
  color: #e17055;
  margin: 12px 0;
}
.result-comment {
  text-align: center;
  font-size: 16px;
  line-height: 1.7;
  color: #2d3436;
  padding: 16px;
  background: #fff9db;
  border-radius: 16px;
  margin: 16px 0;
}
.result-comment small { color: #8395a7; }
.best-score {
  color: #6c5ce7;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}
.btn-share {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  background: #6c5ce7;
  color: #fff;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 5px 0 #4834d4;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
}
.btn-share:active { transform: translateY(3px); box-shadow: 0 2px 0 #4834d4; }
.share-status {
  min-height: 18px;
  margin-top: 10px;
  color: #636e72;
  font-size: 12px;
  text-align: center;
}
.result-actions { display: flex; flex-direction: column; gap: 8px; }

@media (max-width: 380px) {
  #app { padding: 72px 14px 18px; }
  .bubble { padding: 26px 18px; }
  .title { font-size: 26px; }
  .question { font-size: 16px; }
  .country-flag { font-size: 36px; }
}
