* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(180deg, #0f2f6f 0%, #1e56a0 45%, #2e7d32 45.5%, #388e3c 100%);
  color: #fff;
  min-height: 100%;
  overflow-x: hidden;
  -webkit-user-select: none;
  user-select: none;
}
#app { max-width: 760px; margin: 0 auto; padding: 12px 14px 40px; }

.card {
  background: rgba(255,255,255,0.97);
  color: #1a202c;
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  margin-bottom: 14px;
  animation: pop .25s ease;
}

.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.topbar .logo { font-size: 34px; animation: bob 2.4s ease-in-out infinite; }
.topbar .brand { font-weight: 900; font-size: 22px; letter-spacing: .5px; text-shadow: 0 2px 6px rgba(0,0,0,.35); }
.topbar .cbadge { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.pill {
  background: rgba(255,255,255,0.2);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 800;
  font-size: 15px;
  display: inline-flex; align-items: center; gap: 6px;
  backdrop-filter: blur(4px);
}
.pill.gold { background: #fbbf24; color: #7c2d12; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode-btn {
  border: none; border-radius: 18px; padding: 18px 10px 14px;
  font-size: 17px; font-weight: 900; color: #fff; cursor: pointer;
  box-shadow: 0 6px 0 rgba(0,0,0,0.25);
  transition: transform .06s ease, box-shadow .06s ease;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.mode-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,0.25); }
.mode-btn .icon { font-size: 40px; }
.mode-btn .sub { font-size: 12px; font-weight: 700; opacity: .9; }
.c-run  { background: linear-gradient(160deg, #f97316, #c2410c); }
.c-field{ background: linear-gradient(160deg, #22c55e, #15803d); }
.c-smart{ background: linear-gradient(160deg, #3b82f6, #1d4ed8); }
.c-daily{ background: linear-gradient(160deg, #a855f7, #7c3aed); }
.c-learn{ background: linear-gradient(160deg, #06b6d4, #0e7490); }
.full { grid-column: 1 / -1; }

.stars { display: flex; gap: 4px; justify-content: center; margin-top: 6px; flex-wrap: wrap; }
.star { font-size: 22px; opacity: .25; filter: grayscale(1); }
.star.on { opacity: 1; filter: none; }

h1, h2, h3 { margin: 0 0 8px; }
.center { text-align: center; }

.chip {
  display: inline-block; border-radius: 999px; padding: 5px 12px;
  font-size: 13px; font-weight: 800; color: #fff; margin-bottom: 8px;
}

.question { font-size: 21px; font-weight: 900; line-height: 1.35; margin: 8px 0 12px; }
.situation {
  background: #eef2ff; border-left: 5px solid #1e3a8a; border-radius: 14px;
  padding: 12px 14px; margin: 8px 0 12px;
}
.sit-tag {
  display: block; font-size: 11px; font-weight: 900; letter-spacing: 1.5px;
  text-transform: uppercase; color: #1e3a8a; margin-bottom: 3px;
}
.situation p { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.35; color: #1f2937; }

.opt {
  width: 100%; border: 3px solid #e2e8f0; background: #f8fafc; color: #1a202c;
  border-radius: 16px; padding: 14px; margin: 8px 0; font-size: 17px; font-weight: 800;
  text-align: left; cursor: pointer; display: flex; align-items: center; gap: 10px;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
}
.opt:active { transform: scale(.985); }
.opt .o-let {
  flex: 0 0 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: #1e3a8a; color: #fff; font-weight: 900; font-size: 17px;
}
.opt.correct { background: #dcfce7; border-color: #16a34a; }
.opt.wrong   { background: #fee2e2; border-color: #dc2626; animation: shake .4s; }
.opt.disabled { pointer-events: none; }

.answer-box {
  border-radius: 16px; padding: 14px; margin-top: 10px; font-weight: 700; font-size: 16px; line-height: 1.45;
}
.answer-box.good { background: #dcfce7; color: #14532d; }
.answer-box.oop  { background: #fef9c3; color: #713f12; }
.rule-ref { font-size: 12px; color: #6b7280; margin-top: 6px; font-weight: 600; }

.btn {
  border: none; border-radius: 999px; padding: 14px 22px; font-size: 17px; font-weight: 900; cursor: pointer;
  background: linear-gradient(160deg, #f59e0b, #d97706); color: #fff;
  box-shadow: 0 5px 0 #92400e; transition: transform .06s ease, box-shadow .06s ease;
  display: inline-block;
}
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #92400e; }
.btn.blue { background: linear-gradient(160deg, #3b82f6, #2563eb); box-shadow: 0 5px 0 #1e40af; }
.btn.ghost { background: transparent; box-shadow: none; border: 2px solid rgba(255,255,255,.7); }
.btn.small { padding: 8px 16px; font-size: 14px; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.row.left { justify-content: flex-start; }

.read-btn {
  background: #fef3c7; border: 2px solid #f59e0b; border-radius: 999px; padding: 8px 14px;
  font-weight: 900; font-size: 15px; color: #92400e; cursor: pointer; margin-top: 8px;
}

svg.field { width: 100%; height: auto; display: block; border-radius: 14px; background: #4ade80; }

.learn-card h3 { color: #1e3a8a; }
.learn-card .icon { font-size: 56px; text-align: center; margin: 8px 0; }
.learn-card p { font-size: 18px; line-height: 1.5; font-weight: 600; color: #374151; }

.badge-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.badge {
  border-radius: 14px; padding: 10px 14px; background: #f1f5f9; border: 2px solid #e2e8f0;
  display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px;
  opacity: .4; filter: grayscale(1);
}
.badge.earned { opacity: 1; filter: none; background: #fef9c3; border-color: #f59e0b; }
.badge .b-i { font-size: 22px; }

.progress-track { height: 14px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin: 8px 0; }
.progress-fill { height: 100%; background: linear-gradient(90deg,#f59e0b,#f97316); border-radius: 999px; transition: width .4s ease; }

#confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.cf { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; }

@keyframes bob { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-6px);} }
@keyframes shake { 25% { transform: translateX(-6px);} 75% { transform: translateX(6px);} }
@keyframes pop { 0% { transform: scale(0.7); opacity: 0;} 60% { transform: scale(1.05);} 100% { transform: scale(1); opacity: 1;} }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

.name-input {
  width: 100%; font-size: 20px; padding: 14px; border-radius: 14px; border: 3px solid #e2e8f0;
  text-align: center; font-weight: 800; margin: 10px 0;
}

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); top: 14px; z-index: 60;
  background: #fff; color: #1a202c; font-weight: 900; border-radius: 999px; padding: 12px 22px;
  box-shadow: 0 8px 24px rgba(0,0,0,.3); font-size: 16px; text-align: center; max-width: 90vw;
  animation: pop .3s ease;
}

.stat-row { display: flex; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.stat {
  flex: 1; min-width: 90px; background: #f1f5f9; border-radius: 14px; padding: 10px; text-align: center;
}
.stat .v { font-size: 24px; font-weight: 900; color: #1e3a8a; }
.stat .k { font-size: 12px; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: .5px; }

.hidden { display: none !important; }
.muted { color: #64748b; }

#doing-name .card h1 { font-size: 26px; }
.pigeon { font-size: 44px; text-align: center; margin: 6px 0; }
.brand-bar {
  display: block;
  text-align: center;
  background: #0b2350;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .3px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand-bar a { color: #fff; text-decoration: none; }
.brand-bar a:hover { text-decoration: underline; }
