/* ── Uncovered · design system ─────────────────────────────────── */
:root {
  --bg: #F6F7F9;
  --card: #FFFFFF;
  --ink: #1D2B25;
  --ink2: #6C7A73;
  --line: #ECEFEA;
  --green: #2FB05C;
  --green-soft: #E4F6EA;
  --green-deep: #1F8A46;
  --blue: #1F8FFF;
  --blue-soft: #E7F2FF;
  --gold: #FFC533;
  --gold-soft: #FFF4D6;
  --purple: #A78BFA;
  --pink: #FF8FA3;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;
  --shadow: 0 6px 24px rgba(29, 43, 37, .08);
  --shadow-sm: 0 2px 10px rgba(29, 43, 37, .07);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: linear-gradient(160deg, #E8EEF3, #DDE7EE);
  color: var(--ink);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }

/* phone shell — full screen on mobile, framed on desktop */
#phone { height: 100dvh; display: flex; align-items: center; justify-content: center; }
#app {
  position: relative; width: 100%; height: 100dvh;
  background: var(--bg); overflow: hidden; display: flex; flex-direction: column;
}
@media (min-width: 520px) {
  #app {
    width: 400px; height: min(860px, 94dvh);
    border-radius: 44px; box-shadow: 0 30px 80px rgba(20, 40, 60, .35), 0 0 0 10px #1b1f24, 0 0 0 12px #3a4048;
  }
}

/* ── screens ───────────────────────────────────────────────────── */
#screens { flex: 1; position: relative; overflow: hidden; }
.screen { position: absolute; inset: 0; display: none; }
.screen.active { display: block; animation: screenIn .28s ease; }
@keyframes screenIn { from { opacity: 0; transform: translateY(6px); } }
.screen.page { overflow-y: auto; overscroll-behavior: contain; padding-bottom: 24px; }

/* ── map screen (Leaflet) ──────────────────────────────────────── */
#map { width: 100%; height: 100%; background: #EAF3F8; user-select: none; z-index: 0; }
#floatLayer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 10; }

.leaflet-container { font-family: var(--font); }
.leaflet-control-attribution {
  background: rgba(255, 255, 255, .65) !important; font-size: 9px !important;
  border-radius: 8px 0 0 0; color: var(--ink2) !important;
}
.fog-canvas { pointer-events: none; }

/* player marker */
.player-icon { pointer-events: none; }
.player-icon .p-dot {
  position: absolute; inset: 0; border-radius: 50%;
  background: var(--blue); border: 3.5px solid #fff;
  box-shadow: 0 2px 8px rgba(31, 143, 255, .55);
}
.player-icon .p-pulse {
  position: absolute; inset: -16px; border-radius: 50%;
  background: rgba(62, 155, 255, .3);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse { 0% { transform: scale(.4); opacity: .9; } 70% { transform: scale(1.4); opacity: 0; } 100% { opacity: 0; } }

/* discovery markers */
.poi-icon span {
  display: grid; place-items: center; width: 34px; height: 34px;
  background: #fff; border-radius: 50%; font-size: 17px;
  border: 2px solid #E2E8E0; box-shadow: 0 3px 8px rgba(0, 0, 0, .18);
}
.poi-icon span[data-rarity="rare"] { border-color: var(--purple); }
.poi-icon span[data-rarity="legendary"] { border-color: var(--gold); border-width: 3px; }
.poi-icon.pop span { animation: poiPop .6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes poiPop { 0% { transform: scale(0); } }

.mode-chip {
  background: rgba(255, 255, 255, .92); border-radius: 999px; padding: 6px 14px;
  font-size: 11.5px; font-weight: 700; color: var(--ink2); box-shadow: var(--shadow-sm);
}
.cta.ghost {
  background: var(--green-soft); color: var(--green-deep); box-shadow: none; margin-top: 8px;
}

/* ── HUD ───────────────────────────────────────────────────────── */
.hud-top {
  position: absolute; top: 0; left: 0; right: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 14px 30px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  background: linear-gradient(rgba(246, 247, 249, .95), rgba(246, 247, 249, 0));
  pointer-events: none;
}
.hud-top > * { pointer-events: auto; }
.hud-user {
  display: flex; gap: 10px; align-items: center;
  background: var(--card); border-radius: 999px; padding: 7px 16px 7px 8px; box-shadow: var(--shadow-sm);
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--green-soft);
  display: grid; place-items: center; font-size: 20px;
}
.user-meta { display: flex; flex-direction: column; gap: 3px; min-width: 118px; }
.row1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.row1 b { font-size: 13px; }
.lvl { font-size: 11px; font-weight: 700; color: var(--green-deep); background: var(--green-soft); padding: 1px 7px; border-radius: 999px; }
.xpbar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.xpbar i { display: block; height: 100%; width: 40%; border-radius: 999px; background: linear-gradient(90deg, #4CD97B, var(--green)); transition: width .6s ease; }
.xp-num { font-size: 10px; color: var(--ink2); font-weight: 600; }
.gem-pill {
  background: var(--card); border-radius: 999px; padding: 8px 14px;
  box-shadow: var(--shadow-sm); font-size: 13px; font-weight: 700; display: flex; gap: 5px; align-items: center;
}

.loc-chip {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 76px); left: 14px;
  background: var(--card); border-radius: var(--r-md); padding: 8px 14px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; line-height: 1.25;
}
.loc-chip b { font-size: 14px; }
.loc-chip span { font-size: 11px; color: var(--green-deep); font-weight: 700; }

.map-ctrls {
  position: absolute; right: 12px; top: 42%; display: flex; flex-direction: column; gap: 8px;
}
.map-ctrls button {
  width: 42px; height: 42px; border-radius: 50%; background: var(--card);
  box-shadow: var(--shadow-sm); font-size: 20px; color: var(--ink2); font-weight: 600;
  transition: transform .15s;
}
.map-ctrls button:active { transform: scale(.9); }

/* banner */
#banner {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 74px); left: 0; right: 0;
  display: flex; justify-content: center; pointer-events: none;
  transform: translateY(-140%); transition: transform .5s cubic-bezier(.2, 1.4, .4, 1); z-index: 5;
}
#banner.show { transform: translateY(0); }
.banner-card {
  background: var(--card); border-radius: 999px; padding: 10px 20px;
  box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; max-width: 86%;
}
.banner-card .b-spark { color: var(--gold); font-size: 18px; animation: spin 2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.banner-card b { font-size: 13.5px; display: block; }
.banner-card small { font-size: 11.5px; color: var(--green-deep); font-weight: 700; }

/* bottom hud */
.hud-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 0 14px 12px;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
  background: linear-gradient(rgba(246, 247, 249, 0), rgba(246, 247, 249, .9) 70%);
  pointer-events: none;
}
.hud-bottom > * { pointer-events: auto; }
.walk-btn {
  background: linear-gradient(135deg, #3ECB6F, var(--green-deep));
  color: #fff; font-weight: 800; font-size: 16px; padding: 14px 34px;
  border-radius: 999px; box-shadow: 0 8px 22px rgba(47, 176, 92, .45);
  display: flex; gap: 9px; align-items: center; transition: transform .15s;
}
.walk-btn:active { transform: scale(.95); }
.walk-btn.walking { background: linear-gradient(135deg, #FF9F5A, #F2711C); box-shadow: 0 8px 22px rgba(242, 113, 28, .4); }
.walk-btn.nudge { animation: nudge 1.1s ease infinite; }
@keyframes nudge { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.walk-ic { font-size: 18px; }

.stats-strip {
  width: 100%; background: var(--card); border-radius: var(--r-lg);
  box-shadow: var(--shadow); display: flex; padding: 10px 6px;
}
.ss { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.ss span { font-size: 15px; }
.ss b { font-size: 13.5px; }
.ss small { font-size: 10px; color: var(--ink2); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.ss + .ss { border-left: 1px solid var(--line); }

/* ── xp floats ─────────────────────────────────────────────────── */
.xpfloat {
  position: absolute; transform: translate(-50%, -50%);
  font-weight: 800; font-size: 15px; color: var(--green-deep);
  text-shadow: 0 1px 0 #fff, 0 0 8px #fff;
  animation: floatUp 1.15s ease-out forwards; pointer-events: none;
}
.xpfloat.big { font-size: 21px; color: #C77D00; }
@keyframes floatUp {
  0% { opacity: 0; margin-top: 6px; }
  15% { opacity: 1; }
  100% { opacity: 0; margin-top: -52px; }
}

/* ── toasts ────────────────────────────────────────────────────── */
#toasts {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 120px); left: 0; right: 0;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; z-index: 30;
}
.toast {
  background: var(--card); border-radius: 999px; padding: 9px 18px;
  box-shadow: var(--shadow); font-size: 13px; display: flex; gap: 8px; align-items: center;
  opacity: 0; transform: translateY(-10px) scale(.95); transition: all .35s cubic-bezier(.2, 1.4, .4, 1);
  max-width: 88%;
}
.toast.in { opacity: 1; transform: none; }
.t-ic { font-size: 15px; }

/* ── discovery card / sheet ────────────────────────────────────── */
#sheet {
  position: absolute; left: 0; right: 0; bottom: 0; top: 0; z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
  pointer-events: none; padding: 0 12px calc(env(safe-area-inset-bottom, 0px) + 78px);
  overflow: hidden;
}
#sheet.show { pointer-events: auto; }
#sheet > * { transform: translateY(130%); opacity: 0; transition: transform .45s cubic-bezier(.2, 1.3, .4, 1), opacity .3s ease .1s; }
#sheet.show > * { transform: none; opacity: 1; transition: transform .45s cubic-bezier(.2, 1.3, .4, 1), opacity .2s ease; }

.d-card {
  position: relative; width: 100%; max-width: 380px; background: var(--card);
  border-radius: var(--r-lg); box-shadow: 0 16px 44px rgba(29, 43, 37, .25);
  padding: 18px; display: flex; gap: 14px; align-items: center; overflow: hidden;
}
.d-glow { position: absolute; inset: 0; opacity: .16; pointer-events: none; }
.d-card[data-rarity="uncommon"] .d-glow { background: radial-gradient(circle at 20% 0%, var(--blue), transparent 70%); }
.d-card[data-rarity="rare"] .d-glow { background: radial-gradient(circle at 20% 0%, var(--purple), transparent 70%); }
.d-card[data-rarity="legendary"] .d-glow { background: radial-gradient(circle at 20% 0%, var(--gold), transparent 70%); }
.d-emoji {
  width: 62px; height: 62px; border-radius: 20px; background: var(--bg);
  display: grid; place-items: center; font-size: 32px; flex-shrink: 0;
  animation: poiPopIn .6s cubic-bezier(.2, 1.6, .4, 1);
}
@keyframes poiPopIn { 0% { transform: scale(0) rotate(-20deg); } }
.d-body { flex: 1; min-width: 0; }
.d-tags { display: flex; gap: 6px; margin-bottom: 3px; }
.d-type, .d-rarity { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; padding: 2px 8px; border-radius: 999px; }
.d-type { background: var(--bg); color: var(--ink2); }
.d-rarity { background: var(--green-soft); color: var(--green-deep); }
.d-card[data-rarity="uncommon"] .d-rarity { background: var(--blue-soft); color: #0A6ACF; }
.d-card[data-rarity="rare"] .d-rarity { background: #F1EAFE; color: #7C4DEB; }
.d-card[data-rarity="legendary"] .d-rarity { background: var(--gold-soft); color: #B8860B; }
.d-body h3 { font-size: 17px; margin-bottom: 2px; }
.d-body p { font-size: 12px; color: var(--ink2); line-height: 1.4; }
.d-reward { display: flex; flex-direction: column; align-items: center; gap: 3px; flex-shrink: 0; }
.d-reward b { color: var(--green-deep); font-size: 15px; }
.d-reward span { font-size: 12px; font-weight: 700; }

.sheet-card {
  width: 100%; max-width: 380px; max-height: 62vh; overflow-y: auto;
  background: var(--card); border-radius: var(--r-lg); padding: 20px;
  box-shadow: 0 16px 44px rgba(29, 43, 37, .25);
}
.sheet-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.sheet-head h2 { font-size: 19px; }
.coll-icon.big { font-size: 34px; width: 58px; height: 58px; border-radius: 18px; background: var(--bg); display: grid; place-items: center; }
.coll-list { list-style: none; margin-top: 14px; }
.coll-list li { display: flex; gap: 10px; padding: 9px 2px; font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--line); }
.coll-list li:not(.got) { color: var(--ink2); font-weight: 500; }
.sheet-close {
  margin-top: 16px; width: 100%; padding: 13px; border-radius: var(--r-md);
  background: var(--green-soft); color: var(--green-deep); font-weight: 800; font-size: 15px;
}

/* ── modal ─────────────────────────────────────────────────────── */
#modal { position: absolute; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; }
#modal.show { display: flex; }
.modal-back { position: absolute; inset: 0; background: rgba(29, 43, 37, .35); backdrop-filter: blur(3px); animation: fadeIn .3s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal-card {
  position: relative; background: var(--card); border-radius: 28px; padding: 30px 26px 22px;
  width: min(320px, 86%); text-align: center; box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
  animation: modalPop .5s cubic-bezier(.2, 1.5, .4, 1);
}
@keyframes modalPop { 0% { transform: scale(.6); opacity: 0; } }
.modal-emoji { font-size: 52px; margin-bottom: 10px; animation: nudge 1.4s ease infinite; }
.modal-card h2 { font-size: 22px; margin-bottom: 8px; }
.modal-card p { font-size: 14px; color: var(--ink2); line-height: 1.45; }
.modal-xp { margin: 14px 0 4px; font-weight: 800; color: var(--green-deep); background: var(--green-soft); display: inline-block; padding: 6px 18px; border-radius: 999px; }
.cta {
  margin-top: 14px; width: 100%; padding: 14px; border-radius: var(--r-md);
  background: linear-gradient(135deg, #3ECB6F, var(--green-deep)); color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: 0 6px 18px rgba(47, 176, 92, .4); transition: transform .15s;
}
.cta:active { transform: scale(.96); }

/* ── confetti ──────────────────────────────────────────────────── */
#confetti { position: absolute; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.conf {
  position: absolute; top: -14px; width: 9px; height: 13px; border-radius: 3px;
  animation: confFall 1.6s ease-in forwards;
}
@keyframes confFall {
  to { transform: translate(var(--x, 0), 105vh) rotate(var(--r, 360deg)); opacity: .7; }
}

/* ── intro ─────────────────────────────────────────────────────── */
#intro {
  position: absolute; inset: 0; z-index: 70; display: none;
  align-items: center; justify-content: center;
  background: rgba(246, 247, 249, .8); backdrop-filter: blur(14px);
}
#intro.show { display: flex; }
.intro-card {
  width: min(320px, 86%); background: var(--card); border-radius: 30px; padding: 34px 28px 24px;
  text-align: center; box-shadow: 0 24px 60px rgba(29, 43, 37, .18); animation: modalPop .5s cubic-bezier(.2, 1.5, .4, 1);
}
.intro-emoji { font-size: 58px; margin-bottom: 14px; }
.intro-card h2 { font-size: 21px; margin-bottom: 8px; }
.intro-card p { font-size: 14px; color: var(--ink2); line-height: 1.5; }
.intro-dots { display: flex; gap: 6px; justify-content: center; margin-top: 18px; }
.intro-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: all .3s; }
.intro-dots i.on { background: var(--green); width: 20px; border-radius: 999px; }

/* ── tab bar ───────────────────────────────────────────────────── */
#tabbar {
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding: 8px 8px calc(env(safe-area-inset-bottom, 0px) + 8px); z-index: 20;
}
#tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 0 5px; border-radius: 16px; color: #9AA79E; transition: all .2s; font-weight: 600;
}
#tabbar svg { width: 24px; height: 24px; fill: currentColor; }
#tabbar span { font-size: 10.5px; letter-spacing: .2px; }
#tabbar button.on { color: var(--green-deep); background: var(--green-soft); }
#tabbar button:active { transform: scale(.94); }

/* ── page screens (explore / challenges / profile) ─────────────── */
.page-head { padding: calc(env(safe-area-inset-top, 0px) + 22px) 20px 6px; }
.page-head h1 { font-size: 27px; letter-spacing: -.4px; }
.page-head p { font-size: 13.5px; color: var(--ink2); margin-top: 2px; }
.page-body { padding: 12px 14px 20px; display: flex; flex-direction: column; gap: 14px; }

.card {
  background: var(--card); border-radius: var(--r-lg); padding: 18px;
  box-shadow: var(--shadow-sm);
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.card-head h2 { font-size: 16.5px; }
.muted { color: var(--ink2); font-size: 12px; font-weight: 600; }
.hint { font-size: 12.5px; color: var(--ink2); margin-top: 10px; background: var(--bg); border-radius: var(--r-sm); padding: 9px 12px; line-height: 1.4; }
.hint.center { text-align: center; background: none; }

.bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; flex: 1; }
.bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4CD97B, var(--green)); transition: width .8s cubic-bezier(.2, .8, .3, 1); }
.bar.gold i { background: linear-gradient(90deg, #FFD66B, #F2A81C); }
.bar.gray i { background: #C9D2CC; }

/* explore: world card */
.world-card { display: flex; gap: 18px; align-items: center; }
.world-ring { position: relative; flex-shrink: 0; }
.ring-fill { transition: stroke-dashoffset 1s cubic-bezier(.2, .8, .3, 1); }
.world-ring-txt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.world-ring-txt b { font-size: 24px; letter-spacing: -.5px; }
.world-ring-txt span { font-size: 11px; color: var(--ink2); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.world-rows { flex: 1; display: flex; flex-direction: column; gap: 9px; }
.w-row { display: flex; justify-content: space-between; font-size: 14px; padding: 7px 12px; background: var(--bg); border-radius: var(--r-sm); font-weight: 600; }
.w-row b { color: var(--green-deep); }

/* explore: districts */
.district-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.d-name { width: 128px; font-size: 13.5px; font-weight: 700; }
.here { display: block; font-size: 9.5px; color: var(--blue); font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.d-pct { width: 42px; text-align: right; font-size: 13.5px; }
.district-row.complete .d-pct { color: #C77D00; }

/* explore: discoveries */
.disc-scroll { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.disc-scroll::-webkit-scrollbar { display: none; }
.disc-card {
  flex: 0 0 118px; background: var(--bg); border-radius: var(--r-md); padding: 14px 10px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center;
  border: 2px solid transparent;
}
.disc-card[data-rarity="rare"] { border-color: #E4D8FE; background: #FAF7FF; }
.disc-card[data-rarity="legendary"] { border-color: #FFE4A1; background: #FFFBF0; }
.disc-card.locked { opacity: .65; }
.disc-emoji { font-size: 30px; margin-bottom: 3px; }
.disc-card b { font-size: 12px; line-height: 1.2; }
.disc-card small { font-size: 10px; color: var(--ink2); }
.disc-rar { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--green-deep); margin-top: 4px; }
.disc-card[data-rarity="rare"] .disc-rar { color: #7C4DEB; }
.disc-card[data-rarity="legendary"] .disc-rar { color: #B8860B; }
.disc-card.locked .disc-rar { color: var(--ink2); }

/* explore: collections */
.coll-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.coll-card {
  background: var(--bg); border-radius: var(--r-md); padding: 14px 12px 12px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
  transition: transform .15s;
}
.coll-card:active { transform: scale(.96); }
.coll-card.complete { background: var(--gold-soft); }
.coll-icon { font-size: 24px; }
.coll-card b { font-size: 13px; }
.coll-card small { font-size: 11px; color: var(--ink2); font-weight: 700; }
.coll-card .bar { width: 100%; height: 6px; margin-top: 4px; }

/* challenges */
.seg-ctrl {
  margin: 10px 14px 0; display: flex; background: #E9EDEA; border-radius: 14px; padding: 4px;
}
.seg-ctrl button {
  flex: 1; padding: 9px 0; border-radius: 11px; font-size: 13px; font-weight: 700; color: var(--ink2);
  transition: all .2s;
}
.seg-ctrl button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }

.quest { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.quest:last-child { border-bottom: none; }
.q-icon { font-size: 22px; width: 40px; height: 40px; background: var(--bg); border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.quest.done .q-icon { background: var(--green-soft); }
.q-mid { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.q-mid b { font-size: 13.5px; }
.q-mid small { font-size: 11px; color: var(--ink2); font-weight: 600; }
.quest.done .q-mid small { color: var(--green-deep); }
.q-xp { font-size: 12px; font-weight: 800; color: var(--green-deep); background: var(--green-soft); padding: 4px 9px; border-radius: 999px; flex-shrink: 0; }

.ach { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ach:last-child { border-bottom: none; }
.a-icon { font-size: 22px; width: 42px; height: 42px; background: var(--gold-soft); border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.ach.locked .a-icon { background: var(--bg); filter: grayscale(1); opacity: .6; }
.a-mid { flex: 1; }
.a-mid b { font-size: 13.5px; display: block; }
.a-mid small { font-size: 11.5px; color: var(--ink2); }
.ach.locked .a-mid b { color: var(--ink2); }
.a-right { font-size: 11px; font-weight: 700; color: var(--ink2); flex-shrink: 0; }

.friend { display: flex; gap: 11px; align-items: center; padding: 9px 0; }
.friend.you { background: var(--green-soft); border-radius: var(--r-md); padding: 9px 10px; margin: 0 -4px; }
.f-rank { width: 26px; text-align: center; font-size: 16px; font-weight: 800; color: var(--ink2); }
.f-ava { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; flex-shrink: 0; }
.friend.small .f-ava { width: 32px; height: 32px; font-size: 15px; }
.f-mid { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.f-mid b { font-size: 13.5px; }
.f-pct { width: 44px; text-align: right; font-size: 14px; }
.race-card .card-foot { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }

/* profile */
.profile-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; }
.p-ava-wrap { position: relative; margin-bottom: 8px; }
.p-ava { position: absolute; inset: 10px; border-radius: 50%; background: var(--green-soft); display: grid; place-items: center; font-size: 36px; }
.profile-hero h2 { font-size: 21px; }
.p-title { font-size: 13px; font-weight: 700; color: var(--green-deep); }
.streak-row { display: flex; gap: 6px; margin-top: 12px; }
.streak-day {
  width: 32px; height: 32px; border-radius: 50%; background: var(--bg);
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--ink2);
}
.streak-day.on { background: var(--gold-soft); font-size: 15px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: var(--bg); border-radius: var(--r-md); padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.stat span { font-size: 17px; }
.stat b { font-size: 13.5px; }
.stat small { font-size: 9px; color: var(--ink2); font-weight: 700; text-transform: uppercase; letter-spacing: .3px; line-height: 1.2; }

.heatmap-wrap { display: flex; justify-content: center; }
.minimap { width: 100%; max-width: 320px; border-radius: 14px; }

.badge-row { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  width: 48px; height: 48px; border-radius: 16px; background: var(--gold-soft);
  display: grid; place-items: center; font-size: 23px; box-shadow: var(--shadow-sm);
}
.region-done { display: flex; gap: 8px; align-items: baseline; padding: 8px 0; font-size: 14px; }
.region-done .muted { margin-left: auto; }

.setting-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--line); }
.setting-row:last-of-type { border-bottom: none; }
.switch { width: 48px; height: 28px; border-radius: 999px; background: #D5DBD6; position: relative; transition: background .25s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: left .25s; }
.switch.on { background: var(--green); }
.switch.on i { left: 23px; }
.text-btn { font-size: 13px; font-weight: 700; padding: 7px 14px; border-radius: 999px; background: var(--bg); }
.text-btn.danger { color: #E5484D; background: #FEECEC; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01s !important; transition-duration: .01s !important; }
}
