:root { color-scheme: light; }
body { margin: 0; font-family: system-ui, sans-serif; background: #f4f7fb; color: #1c2430; }
.top { display: flex; gap: 16px; align-items: center; padding: 14px 18px; background: #1b3a4b; color: #fff; }
.top a { color: #d6ecff; }
.top h1 { margin: 0; font-size: 1.25rem; flex: 1; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
body.arena .top h1 { flex: 0 0 auto; margin-right: 36px; }
body.arena .top .counts { color: #fff; flex: 1; flex-wrap: nowrap; white-space: nowrap; }
.top-actions > button { background: #d9e4ee; color: #1c2430; }
button.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: #d9e4ee;
  color: #1b3a4b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
button.icon-btn svg { width: 22px; height: 22px; display: block; }
.profile-label { padding: 4px 12px; border-radius: 999px; background: #fff; color: #1b3a4b; font-weight: 800; letter-spacing: .04em; }
.wrap { max-width: 920px; margin: 0 auto; padding: 16px; }
.profiles, .row { display: flex; gap: 8px; flex-wrap: wrap; }
button, .task { font: inherit; border: 0; border-radius: 12px; padding: 12px 16px; cursor: pointer; }
.profiles button { background: #d9e4ee; }
.profiles button.on { background: #1b3a4b; color: #fff; }
.section { margin: 18px 0; }
.section h2 { margin: 0 0 8px; font-size: 1rem; }
.tasks { display: grid; gap: 8px; }
.task { text-align: left; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.task small { display: block; color: #667; }
.task.later { opacity: .55; }
.shown-word { font-size: 2.4rem; font-weight: 700; text-align: center; margin: 8px 0 4px; word-break: break-word; }
.task.done { background: #e6e8eb; color: #8a9099; cursor: default; }
.task.done small { color: #8a9099; }
.panel { background: #fff; border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.hub-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.counts { display: flex; gap: 14px; flex-wrap: wrap; font-weight: 700; }
a.task.pokedex-link { display: block; width: fit-content; margin: 14px auto 4px; text-align: center; }
.pokedex { display: flex; gap: 8px; overflow-x: auto; padding-top: 8px; }
.pokedex.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); overflow: visible; }
.pokedex figure { margin: 0; width: 76px; flex: 0 0 auto; text-align: center; font-size: 0.75rem; }
.pokedex img { width: 64px; height: 64px; object-fit: contain; }
body.arena { background-color: #667eea; background-size: cover; background-position: center; background-attachment: fixed; }
#hub.panel { background: rgba(255,255,255,.675); }
.battle { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 8px 0 8px; text-align: center; }
.fighter { width: 42%; max-width: 200px; }
.meter { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: .75rem; }
.track { flex: 1; height: 12px; background: #e0e0e0; border-radius: 6px; overflow: hidden; }
.fill { height: 100%; width: 0; background: #2ecc71; transition: width 2s ease; }
.battle-msg { text-align: center; font-weight: 800; min-height: 1.2em; margin: 10px 0 0; }
.battle-row { justify-content: center; margin: 4px 0 12px; }
.battle-row button, #victoryClose, #wheelSpin, #wheelClose, #unlockSave { background: #1b3a4b; color: #fff; }
.wheel-card { max-width: 420px; }
.wheel-wrap { position: relative; width: 300px; height: 300px; margin: 8px auto 0; }
.wheel-pointer {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 2px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 20px solid #e53935;
}
#wheelCanvas { width: 300px; height: 300px; display: block; }
.wheel-actions { justify-content: center; margin-top: 8px; }
.victory { position: fixed; inset: 0; background: rgba(0,0,0,.75); display: flex; align-items: center; justify-content: center; z-index: 5; }
.victory[hidden] { display: none; }
.victory-card { background: #fff; border-radius: 20px; padding: 28px; text-align: center; max-width: 320px; }
.victory-card img { width: 150px; height: 150px; object-fit: contain; }
.maps { justify-content: center; margin-top: 40px; }
.maps a.task, .maps button { background: #1b3a4b; color: #fff; }
#hubMsg { text-align: center; }
.battle img { width: 120px; height: 120px; object-fit: contain; }
.vs { font-size: 1.4rem; font-weight: 800; }
a.task { display: inline-block; text-decoration: none; color: inherit; background: #fff; }
button:disabled { opacity: .45; cursor: default; }
label { display: block; margin: 8px 0 4px; }
input { width: 100%; max-width: 480px; padding: 10px; font: inherit; box-sizing: border-box; }
.quiz { max-width: 800px; margin: 0 auto; padding: 16px; }
.prompt, .question { font-size: 1.4rem; }
.built { min-height: 1.4rem; font-size: 1.3rem; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices button { background: #fff; min-height: 52px; font-size: 1.15rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.choices button:disabled { opacity: .45; }
.images { display: flex; gap: 8px; flex-wrap: wrap; }
.images img { width: 120px; height: 120px; object-fit: contain; }
.msg { font-weight: 700; }
#submitBtn { background: #1b3a4b; color: #fff; }
