:root {
  font-family: 'Comic Sans MS', 'Trebuchet MS', Arial, sans-serif;
  color: #10243a;
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #bfe9ff 0%, #eafff5 55%, #fff8dc 100%);
}
a { color: inherit; }

.jj-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(6px);
  border-bottom: 4px solid #ffcf4d;
  position: sticky;
  top: 0;
  z-index: 20;
}
.jj-brand {
  font-weight: 900;
  font-size: 1.3rem;
  text-decoration: none;
  color: #1c6fb0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.jj-points {
  background: #ffcf4d;
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 900;
  font-size: .95rem;
  color: #6b4b00;
}

.jj-wrap { max-width: 900px; margin: 0 auto; padding: 24px 18px 60px; }

.jj-hero {
  text-align: center;
  padding: 28px 16px;
}
.jj-hero h1 {
  font-size: clamp(1.8rem, 6vw, 3rem);
  margin: 0 0 8px;
  color: #1c6fb0;
}
.jj-hero p { font-size: 1.1rem; color: #2a4a5c; max-width: 640px; margin: 0 auto; }

.jj-level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-top: 28px;
}
.jj-level-card {
  background: #fff;
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 10px 24px rgba(20,80,120,.15);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 3px solid transparent;
  transition: transform .15s, border-color .15s;
}
.jj-level-card:hover { transform: translateY(-4px); border-color: #ffcf4d; }
.jj-level-card .badge { font-size: 2.2rem; }
.jj-level-card h2 { margin: 0; color: #1c6fb0; font-size: 1.3rem; }
.jj-level-card .age { font-weight: 800; color: #ff8a3d; font-size: .85rem; text-transform: uppercase; }
.jj-level-card p { margin: 0; color: #446; font-size: .95rem; }

.jj-card {
  background: #fff;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 10px 24px rgba(20,80,120,.15);
  margin-bottom: 18px;
}

.jj-scene {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.jj-avatar {
  font-size: 4rem;
  min-width: 90px;
  text-align: center;
}
.jj-scene-text { flex: 1; min-width: 220px; }
.jj-scene-text .who { font-weight: 900; color: #1c6fb0; margin-bottom: 4px; }
.jj-scene-text .say { font-size: 1.25rem; line-height: 1.4; }

.jj-options { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.jj-option-btn {
  padding: 14px 18px;
  border-radius: 16px;
  border: 3px solid #bfe0f5;
  background: #f5fcff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.jj-option-btn:hover { border-color: #1c6fb0; }
.jj-option-btn.correct { background: #d7f7dd; border-color: #34b768; }
.jj-option-btn.wrong { background: #ffe1e1; border-color: #e05555; }
.jj-option-btn:disabled { cursor: default; }

.jj-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.jj-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  background: #1c6fb0;
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  text-decoration: none;
}
.jj-btn.secondary { background: #fff; color: #1c6fb0; border: 3px solid #1c6fb0; }
.jj-btn:disabled { opacity: .5; cursor: default; }

.jj-progress { height: 12px; border-radius: 999px; background: #dceffb; overflow: hidden; margin: 16px 0; }
.jj-progress-bar { height: 100%; background: linear-gradient(90deg,#ffcf4d,#ff8a3d); border-radius: 999px; transition: width .3s; }

.jj-leaderboard table { width: 100%; border-collapse: collapse; }
.jj-leaderboard th, .jj-leaderboard td { text-align: left; padding: 8px 10px; }
.jj-leaderboard th { color: #1c6fb0; font-size: .8rem; text-transform: uppercase; }
.jj-leaderboard tr:nth-child(odd) td { background: #f5fcff; }
.jj-leaderboard tr:first-child td { font-weight: 900; }

/* --- Level 3 city --- */
.jj-city-shell { max-width: 1100px; margin: 0 auto; padding: 18px; }
.jj-city-map {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(180deg,#bfe9ff 0%,#c9f2c9 60%,#a9dca0 100%);
  border-radius: 28px;
  border: 4px solid #fff;
  box-shadow: 0 14px 30px rgba(20,80,120,.2);
  overflow: hidden;
  touch-action: none;
}
.jj-zone {
  position: absolute;
  width: 15%;
  min-width: 90px;
  padding: 10px 6px;
  border-radius: 20px;
  background: rgba(255,255,255,.9);
  border: 3px solid #fff;
  text-align: center;
  cursor: pointer;
  font-weight: 800;
  font-size: .85rem;
  color: #1c6fb0;
  box-shadow: 0 6px 14px rgba(0,0,0,.15);
  transition: transform .15s;
}
.jj-zone:hover { transform: scale(1.06); }
.jj-zone .emoji { font-size: 1.8rem; display: block; }
.jj-zone.done { border-color: #34b768; }
.jj-zone.storefront { background: rgba(255,207,77,.95); }

.jj-player {
  position: absolute;
  font-size: 2.2rem;
  transition: left .25s, top .25s;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 4px 4px rgba(0,0,0,.25));
}

.jj-modal-backdrop {
  position: fixed; inset: 0; background: rgba(10,30,50,.5);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.jj-modal {
  background: #fff; border-radius: 24px; padding: 24px; max-width: 480px; width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
}

.jj-nickname-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.jj-nickname-form input {
  flex: 1; min-width: 160px; padding: 12px 14px; border-radius: 14px; border: 3px solid #bfe0f5; font-size: 1rem;
}

.jj-footnote { text-align: center; color: #557; font-size: .85rem; margin-top: 30px; }

@media (max-width: 640px) {
  .jj-zone { width: 26%; }
}
