/* STELA – "by Anže Levec" suite tokens (Edit/styles.scss), dark only: an outdoor
   app read at night as often as by day, on top of a dark map. */

@font-face { font-family: Barlow; font-weight: 400; font-display: swap; src: url('../fonts/barlow-latin-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Barlow; font-weight: 500; font-display: swap; src: url('../fonts/barlow-latin-500.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Barlow; font-weight: 600; font-display: swap; src: url('../fonts/barlow-latin-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Barlow; font-weight: 400; font-display: swap; src: url('../fonts/barlow-latin-ext-400.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Barlow; font-weight: 500; font-display: swap; src: url('../fonts/barlow-latin-ext-500.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Barlow; font-weight: 600; font-display: swap; src: url('../fonts/barlow-latin-ext-600.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg-0: #08090b;
  --bg-1: #0e1014;
  --bg-2: #14171d;
  --bg-3: #1b1f27;
  --bg-4: #232833;
  --line: #23272f;
  --line-strong: #333944;
  --text-1: #eceef1;
  --text-2: #99a1ad;
  --text-3: #656d79;
  --accent: #4f7cff;
  --accent-hover: #6b91ff;
  --accent-press: #3d68e6;
  --accent-soft: rgba(79, 124, 255, 0.14);
  --accent-ring: rgba(79, 124, 255, 0.35);
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.13);
  --warn: #f0b429;
  --warn-soft: rgba(240, 180, 41, 0.13);
  --bad: #f4726b;
  --bad-soft: rgba(244, 114, 107, 0.13);
  --dawn: linear-gradient(135deg, #ffd27a 0%, #ff7a5c 50%, #b06cff 100%);
  --sky: linear-gradient(160deg, #232a52 0%, #121633 55%, #080a18 100%);
  --stone: #2a2e36;
  --radius-sm: 6px;
  --radius-md: 9px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 999px;
  --shadow-md: 0 6px 20px -6px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, 0.7);
  --font-sans: Barlow, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'Roboto Mono', Consolas, monospace;
  --transition: 140ms cubic-bezier(0.4, 0, 0.2, 1);
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg-0);
  color: var(--text-1);
  font: 400 15px/1.45 var(--font-sans);
  overflow: hidden;
  overscroll-behavior: none;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-hover); }
[hidden] { display: none !important; }

#app {
  position: fixed;
  inset: 0;
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg-0);
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  background: var(--bg-3); color: var(--text-1);
  font-weight: 600; font-size: 15px; letter-spacing: 0.01em;
  transition: background var(--transition), transform var(--transition), opacity var(--transition);
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.dawn { background: var(--dawn); border-color: transparent; color: #1a0f1f; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: var(--radius-md); }
.btn.block { width: 100%; }
.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: var(--radius-full); border: 1px solid var(--line-strong);
  background: rgba(20, 23, 29, 0.88); backdrop-filter: blur(10px);
  color: var(--text-1);
}
.icon-btn svg, .btn svg { width: 20px; height: 20px; flex: none; }
.icon-btn.active { background: var(--accent); border-color: transparent; }

/* ---------- top brand (suite) ---------- */
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 14px 7px 8px; border-radius: var(--radius-full);
  background: rgba(14, 16, 20, 0.86); backdrop-filter: blur(12px);
  border: 1px solid var(--line);
}
.brand img { width: 22px; height: 22px; display: block; }
.brand .name { font-size: 15px; font-weight: 600; letter-spacing: 0.04em; }
.brand .by { font-size: 11.5px; color: var(--text-3); }

/* ---------- views ---------- */
.view { position: absolute; inset: 0 0 calc(var(--nav-h) + var(--safe-b)) 0; overflow: hidden; }
.page {
  position: absolute; inset: 0; z-index: 30;
  background: var(--bg-0);
  display: flex; flex-direction: column;
  animation: slideIn 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.page-head {
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) 12px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
  flex: none;
}
.page-head h1 { margin: 0; font-size: 17px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-head .icon-btn { background: transparent; border-color: transparent; }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 16px calc(32px + var(--safe-b)); }
.view .scroll { position: absolute; inset: 0; padding-top: calc(16px + var(--safe-t)); }

h2.section { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); margin: 26px 0 10px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); font-size: 13px; }
.mono { font-family: var(--font-mono); }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }

.card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 14px;
}
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 500; background: var(--bg-4); color: var(--text-2);
  white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.accent { background: var(--accent-soft); color: var(--accent-hover); }
.badge.partner { background: rgba(255, 210, 122, 0.14); color: #ffd27a; }
.badge.event { background: rgba(176, 108, 255, 0.16); color: #cfa8ff; }

/* ---------- bottom nav ---------- */
.nav {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(14, 16, 20, 0.96); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.nav button {
  border: 0; background: none; color: var(--text-3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11.5px; font-weight: 500; letter-spacing: 0.02em;
}
.nav button svg { width: 23px; height: 23px; }
.nav button.active { color: var(--text-1); }
.nav button.active svg { color: var(--accent-hover); }

/* ---------- map ---------- */
#map { position: absolute; inset: 0; z-index: 0; background: #0b0c0f; }
.mini-map, #amap { position: relative; z-index: 0; }
/* OSM ploščice potemnjene v slog zbirke (prototip – v produkciji temni slog ponudnika) */
.leaflet-tile-pane { filter: invert(1) hue-rotate(195deg) brightness(0.82) contrast(0.92) saturate(0.45); }
.leaflet-container { font-family: var(--font-sans); background: #0b0c0f; }
.leaflet-control-attribution { background: rgba(8, 9, 11, 0.7) !important; color: var(--text-3) !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: var(--text-2) !important; }
.map-top {
  position: absolute; top: calc(12px + var(--safe-t)); left: 12px; right: 12px; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; pointer-events: none;
}
.map-top > * { pointer-events: auto; }
.map-fabs {
  position: absolute; right: 12px; z-index: 10;
  bottom: 16px; display: flex; flex-direction: column; gap: 10px;
  transition: bottom 220ms ease;
}
.sim-banner {
  position: absolute; top: calc(64px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 10;
  padding: 6px 12px; border-radius: var(--radius-full); font-size: 12.5px; font-weight: 500;
  background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(240, 180, 41, 0.3);
  backdrop-filter: blur(10px); white-space: nowrap;
}

.stela-pin { width: 34px; height: 46px; position: relative; }
.stela-pin svg { width: 34px; height: 46px; display: block; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.6)); overflow: visible; }
.stela-pin.near::before {
  content: ''; position: absolute; left: 50%; top: 58%; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 138, 76, 0.55), transparent 65%);
  animation: pulse 1.6s ease-out infinite;
}
.stela-pin.selected svg { transform: scale(1.18); transform-origin: 50% 100%; }
@keyframes pulse { from { transform: scale(0.5); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }

.me-dot { width: 22px; height: 22px; position: relative; }
.me-dot .dot { position: absolute; inset: 4px; border-radius: 50%; background: var(--accent); border: 2.5px solid #fff; box-shadow: 0 0 0 6px var(--accent-ring); }
.me-dot .cone {
  position: absolute; left: 50%; top: 50%; width: 70px; height: 70px; margin: -70px 0 0 -35px;
  transform-origin: 50% 100%;
  background: conic-gradient(from -25deg at 50% 100%, rgba(79, 124, 255, 0.45), rgba(79, 124, 255, 0) 50deg, transparent 50deg);
  -webkit-mask: radial-gradient(circle at 50% 100%, #000 0, #000 60%, transparent 70%);
  mask: radial-gradient(circle at 50% 100%, #000 0, #000 60%, transparent 70%);
}
.me-dot.sim .dot { background: var(--warn); box-shadow: 0 0 0 6px var(--warn-soft); }

/* ---------- bottom sheet ---------- */
.sheet {
  position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 15;
  background: rgba(20, 23, 29, 0.97); backdrop-filter: blur(16px);
  border: 1px solid var(--line-strong); border-radius: var(--radius-xl);
  padding: 8px 16px 16px; box-shadow: var(--shadow-lg);
  animation: sheetIn 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes sheetIn { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet .grip { width: 38px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 2px auto 12px; }
.sheet h3 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: 0.01em; }
.sheet .hint { margin: 4px 0 0; color: var(--text-2); font-style: italic; }
.sheet .meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 14px; }
.sheet .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sheet .actions .wide { grid-column: 1 / -1; }
.dist { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.dist .arrow {
  width: 46px; height: 46px; border-radius: 50%; background: var(--bg-3); border: 1px solid var(--line-strong);
  display: grid; place-items: center; flex: none;
}
.dist .arrow svg { width: 22px; height: 22px; transition: transform 200ms linear; color: #ffb057; }
.dist .num { font-size: 26px; font-weight: 600; line-height: 1; }
.dist .lbl { font-size: 12.5px; color: var(--text-3); }

/* ---------- onboarding ---------- */
.onboard {
  position: absolute; inset: 0; z-index: 50; overflow-y: auto;
  background: radial-gradient(120% 70% at 85% 100%, rgba(255, 138, 76, 0.18), transparent 60%), var(--sky);
  padding: calc(48px + var(--safe-t)) 24px calc(32px + var(--safe-b));
  display: flex; flex-direction: column;
}
.onboard .logo { width: 88px; height: 88px; }
.onboard h1 { font-size: 44px; font-weight: 600; letter-spacing: 0.22em; margin: 18px 0 2px; }
.onboard .by { color: var(--text-3); font-size: 13px; margin-bottom: 18px; }
.onboard .def { color: var(--text-2); font-style: italic; border-left: 2px solid rgba(255, 176, 87, 0.6); padding-left: 12px; margin: 0 0 24px; }
.onboard ol { padding: 0; margin: 0 0 28px; list-style: none; counter-reset: s; }
.onboard li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; color: var(--text-1); }
.onboard li::before {
  content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 600;
  background: rgba(255, 255, 255, 0.08); color: #ffd27a;
}
.onboard .spacer { flex: 1; min-height: 12px; }

.field { display: block; }
.field > span { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.input, textarea.input {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border-radius: var(--radius-lg); border: 1px solid var(--line-strong);
  background: var(--bg-1); color: var(--text-1); outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
textarea.input { resize: none; min-height: 120px; line-height: 1.5; }

/* ---------- wall ---------- */
.slab {
  position: relative; overflow: hidden;
  border-radius: 120px 120px var(--radius-lg) var(--radius-lg);
  padding: 44px 22px 22px; text-align: center;
  background:
    radial-gradient(120% 80% at 80% 110%, rgba(255, 138, 76, 0.16), transparent 60%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 7px),
    linear-gradient(180deg, #2b303a, #1a1d24);
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), var(--shadow-md);
}
.slab .kicker { font-size: 11.5px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--text-3); }
.slab h2 {
  margin: 8px 0 8px; font-size: 28px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: #d9dce2; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.08);
}
.slab p { margin: 0 auto; max-width: 36ch; color: var(--text-2); }
.slab .counts { display: flex; justify-content: center; gap: 22px; margin-top: 16px; }
.slab .counts b { display: block; font-size: 22px; font-weight: 600; }
.slab .counts span { font-size: 12px; color: var(--text-3); }

.state-banner { margin-top: 14px; display: flex; gap: 12px; align-items: center; }
.state-banner .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--bg-4); }
.state-banner .ico svg { width: 20px; height: 20px; }
.state-banner.ok .ico { background: var(--ok-soft); color: var(--ok); }
.state-banner.go .ico { background: rgba(255, 138, 76, 0.15); color: #ffb057; }
.state-banner b { display: block; font-weight: 600; }

.entry {
  position: relative; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 14px 14px 12px; margin-top: 10px;
}
.entry.mine { border-color: rgba(255, 176, 87, 0.35); box-shadow: inset 3px 0 0 #ffb057; }
.entry .who { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 10px; flex: none; display: grid; place-items: center;
  font-weight: 600; font-size: 14px; color: #1a0f1f; background: var(--dawn);
}
.entry .name { font-weight: 600; }
.entry .when { font-size: 12px; color: var(--text-3); }
.entry .msg { margin: 10px 0 0; white-space: pre-wrap; word-wrap: break-word; font-size: 15.5px; }
.entry .photo { margin-top: 10px; border-radius: var(--radius-md); overflow: hidden; background: var(--bg-1); }
.entry .photo img { display: block; width: 100%; max-height: 360px; object-fit: cover; }
.entry .sig { margin-top: 8px; height: 56px; }
.entry .sig svg { height: 100%; width: auto; max-width: 100%; }
.entry .more { position: absolute; top: 8px; right: 6px; background: none; border: 0; color: var(--text-3); width: 36px; height: 36px; border-radius: 50%; }
.sig path { fill: none; stroke: #ffc27a; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }

.token-chip {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-lg); margin-top: 8px;
  width: 100%; text-align: left; color: inherit;
}
.coin {
  width: 40px; height: 40px; border-radius: 50%; flex: none; position: relative;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.55), transparent 40%), var(--c, #ffb057);
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(255, 255, 255, 0.06);
}
.coin::after { content: ''; position: absolute; inset: 9px; border-radius: 50%; border: 2px dashed rgba(0, 0, 0, 0.28); }
.coin.big { width: 84px; height: 84px; }
.coin.big::after { inset: 16px; border-width: 3px; }

/* ---------- compose ---------- */
.counter { text-align: right; font-size: 12px; color: var(--text-3); margin-top: 4px; }
.counter.over { color: var(--bad); }
.photo-slot {
  position: relative; border-radius: var(--radius-lg); border: 1.5px dashed var(--line-strong);
  min-height: 120px; display: grid; place-items: center; background: var(--bg-1); overflow: hidden;
}
.photo-slot img { width: 100%; display: block; max-height: 320px; object-fit: cover; }
.photo-slot .remove { position: absolute; top: 8px; right: 8px; }
.sigpad {
  width: 100%; height: 140px; display: block; touch-action: none;
  border-radius: var(--radius-lg); border: 1px solid var(--line-strong);
  background: repeating-linear-gradient(0deg, transparent 0 109px, rgba(255, 255, 255, 0.07) 109px 110px), var(--bg-1);
}
.rules { font-size: 13px; color: var(--text-2); background: var(--warn-soft); border: 1px solid rgba(240, 180, 41, 0.25); border-radius: var(--radius-lg); padding: 12px 14px; }
.rules b { color: var(--warn); }

/* ---------- camera / AR ---------- */
.cam { position: absolute; inset: 0; z-index: 40; background: #000; overflow: hidden; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam .nocam {
  position: absolute; inset: 0;
  background: radial-gradient(90% 60% at 50% 110%, rgba(255, 138, 76, 0.25), transparent 70%), var(--sky);
}
.cam .top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  padding: calc(12px + var(--safe-t)) 12px 30px;
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(rgba(0, 0, 0, 0.6), transparent);
}
.cam .top .title { flex: 1; font-weight: 600; text-shadow: 0 1px 3px #000; }
.cam .bottom {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 3; text-align: center;
  padding: 40px 20px calc(28px + var(--safe-b));
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
}
.cam .instr { font-size: 17px; font-weight: 600; text-shadow: 0 1px 4px #000; min-height: 26px; }
.cam .sub { font-size: 13px; color: rgba(255, 255, 255, 0.7); margin-top: 4px; }
.reticle {
  position: absolute; left: 50%; top: 46%; width: 220px; height: 220px; margin: -110px 0 0 -110px; z-index: 2;
  pointer-events: none;
}
.reticle .corner { position: absolute; width: 36px; height: 36px; border: 3px solid rgba(255, 255, 255, 0.85); }
.reticle .tl { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 14px 0 0 0; }
.reticle .tr { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 14px 0 0; }
.reticle .bl { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 14px; }
.reticle .br { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 14px 0; }
.reticle.lock .corner { border-color: #ffb057; }
.reticle svg.ring { position: absolute; inset: -14px; width: 248px; height: 248px; transform: rotate(-90deg); }
.reticle svg.ring circle { fill: none; stroke-width: 5; }
.reticle svg.ring .bg { stroke: rgba(255, 255, 255, 0.12); }
.reticle svg.ring .fg { stroke: #ffb057; stroke-linecap: round; transition: stroke-dashoffset 80ms linear; }
.marker {
  position: absolute; left: 50%; top: 46%; width: 132px; height: 132px; margin: -66px 0 0 -66px; z-index: 1;
  will-change: transform; pointer-events: none;
}
.marker svg { width: 100%; height: 100%; filter: drop-shadow(0 0 18px rgba(255, 160, 90, 0.7)); animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(2deg); } }
.side-hint {
  position: absolute; top: 46%; z-index: 2; margin-top: -28px;
  width: 56px; height: 56px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(0, 0, 0, 0.45); color: #ffb057;
  animation: nudge 1s ease-in-out infinite;
}
.side-hint svg { width: 30px; height: 30px; }
.side-hint.left { left: 14px; }
.side-hint.right { right: 14px; }
@keyframes nudge { 50% { transform: translateX(var(--nx, -6px)); } }
.side-hint.right { --nx: 6px; }
.flash { position: absolute; inset: 0; z-index: 5; background: #fff; animation: flash 600ms ease-out forwards; pointer-events: none; }
@keyframes flash { from { opacity: 0.9; } to { opacity: 0; } }
.shutter {
  width: 72px; height: 72px; border-radius: 50%; border: 4px solid #fff; background: rgba(255, 255, 255, 0.25);
  margin: 0 auto; display: block;
}
.shutter:active { background: #fff; }

/* ---------- celebration ---------- */
.reveal {
  position: absolute; inset: 0; z-index: 45; display: grid; place-items: center; text-align: center; padding: 24px;
  background: radial-gradient(70% 50% at 50% 40%, rgba(255, 138, 76, 0.3), rgba(8, 9, 11, 0.985) 70%), rgba(8, 9, 11, 0.9);
  animation: fadeIn 300ms ease;
}
.reveal .glyph svg { width: 100%; height: 100%; display: block; }
.reveal .glyph { width: 104px; height: 140px; margin: 0 auto 16px; animation: rise 700ms cubic-bezier(0.2, 0.9, 0.2, 1.2); }
.reveal h2 { font-size: 30px; letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 6px; }
@keyframes rise { from { transform: translateY(40px) scale(0.7); opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } }

/* ---------- toast & dialog ---------- */
.toasts { position: absolute; left: 12px; right: 12px; top: calc(70px + var(--safe-t)); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  max-width: 100%; padding: 11px 16px; border-radius: var(--radius-lg);
  background: rgba(35, 40, 51, 0.97); border: 1px solid var(--line-strong); box-shadow: var(--shadow-md);
  font-size: 14px; font-weight: 500; animation: toastIn 220ms ease; pointer-events: auto;
}
.toast.bad { border-color: rgba(244, 114, 107, 0.45); color: #ffc9c5; }
.toast.ok { border-color: rgba(52, 211, 153, 0.4); }
.toast.warm { border-color: rgba(255, 176, 87, 0.5); }
@keyframes toastIn { from { transform: translateY(-10px); opacity: 0; } }
.dialog-back { position: absolute; inset: 0; z-index: 95; background: rgba(0, 0, 0, 0.6); display: grid; align-items: end; padding: 12px; animation: fadeIn 160ms; }
.dialog {
  background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: var(--radius-xl);
  padding: 20px; box-shadow: var(--shadow-lg); margin-bottom: var(--safe-b);
  animation: sheetIn 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.dialog h3 { margin: 0 0 8px; font-size: 19px; }
.dialog p { margin: 0 0 18px; color: var(--text-2); }
.dialog .btns { display: grid; gap: 8px; }

.lightbox { position: absolute; inset: 0; z-index: 96; background: rgba(0, 0, 0, 0.94); display: grid; place-items: center; animation: fadeIn 160ms; }
.lightbox img { max-width: 100%; max-height: 100%; }

/* ---------- profile / tokens ---------- */
.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-head .avatar { width: 60px; height: 60px; border-radius: 18px; font-size: 26px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px; }
.stat b { display: block; font-size: 22px; font-weight: 600; }
.stat span { font-size: 12px; color: var(--text-3); }
.progress { height: 6px; border-radius: 6px; background: var(--bg-4); overflow: hidden; margin-top: 8px; }
.progress > i { display: block; height: 100%; background: var(--dawn); }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line);
  background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; color: inherit;
}
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 28px; background: var(--bg-4); transition: background var(--transition); }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform var(--transition); }
.switch input:checked + i { background: var(--warn); }
.switch input:checked + i::after { transform: translateX(18px); }
.products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.product { text-align: center; padding: 14px 8px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-lg); color: inherit; }
.product b { display: block; font-size: 20px; margin: 8px 0 2px; }
.product .price { color: #ffd27a; font-weight: 600; }
.product.best { border-color: rgba(255, 176, 87, 0.5); background: linear-gradient(180deg, rgba(255, 138, 76, 0.1), var(--bg-2)); }
.mini-map { height: 240px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 26px; }
.timeline li::before { content: ''; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--c, #ffb057); }
.timeline li::after { content: ''; position: absolute; left: 10.5px; top: 18px; bottom: 0; width: 1px; background: var(--line-strong); }
.timeline li:last-child::after { display: none; }
.empty { text-align: center; padding: 30px 10px; color: var(--text-3); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--bg-4); border-top-color: var(--accent); animation: spin 800ms linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- v0.2: tokens, ranks, gems, likes, profiles ---------- */
.token-pill {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--text-1);
  padding: 7px 13px 7px 10px; border-radius: var(--radius-full);
  background: rgba(14, 16, 20, 0.86); backdrop-filter: blur(12px); border: 1px solid rgba(255, 210, 122, 0.35);
}
.token-pill svg { width: 16px; height: 16px; color: #ffd27a; }
.token-pill b { font-weight: 600; font-variant-numeric: tabular-nums; }
.drop-pin {
  width: 30px; height: 30px; border-radius: 50%; position: relative;
  display: grid; place-items: center; color: #1a0f1f;
  background: radial-gradient(circle at 35% 30%, #fff6d8, #ffd27a 45%, #ff9a5c);
  box-shadow: 0 0 0 3px rgba(255, 210, 122, 0.25), 0 0 18px rgba(255, 190, 100, 0.8);
  animation: twinkle 2.2s ease-in-out infinite;
}
.drop-pin svg { width: 15px; height: 15px; }
.drop-pin b { position: absolute; right: -6px; top: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #0e1014; color: #ffd27a; font-size: 11px; line-height: 17px; text-align: center; border: 1px solid rgba(255, 210, 122, 0.5); }
.drop-pin.selected { transform: scale(1.2); }
.drop-pin.near::before { content: ''; position: absolute; inset: -16px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 210, 122, 0.55), transparent 65%); animation: pulse 1.6s ease-out infinite; }
@keyframes twinkle { 50% { box-shadow: 0 0 0 5px rgba(255, 210, 122, 0.12), 0 0 26px rgba(255, 190, 100, 1); } }

.badge.community { background: rgba(92, 200, 255, 0.14); color: #8fd8ff; }
.badge.rank { background: rgba(255, 210, 122, 0.14); color: #ffd27a; margin-right: 4px; }
.badge.rank.lv4, .badge.rank.lv5 { background: rgba(176, 108, 255, 0.18); color: #d6b4ff; }
.badge.rank.lv6 { background: var(--dawn); color: #1a0f1f; }

.gem-chip {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-lg); margin-top: 8px;
  width: 100%; text-align: left; color: inherit;
}
.gem-svg { flex: none; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5)); }
.product .gem-svg { display: block; margin: 0 auto; }

.entry .who a { color: inherit; text-decoration: none; }
.entry-foot { display: flex; align-items: center; gap: 6px; margin: 10px -6px -4px; }
.entry-foot button {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--text-3);
  padding: 6px 8px; border-radius: var(--radius-md); font-size: 13.5px; font-weight: 500;
}
.entry-foot button svg { width: 19px; height: 19px; }
.entry-foot button:active { background: var(--bg-3); }
.entry-foot .like.on { color: #ff6b8a; }
.entry-foot .like:disabled { opacity: 0.55; }

.profile-head .icon-btn { flex: none; }
.bio { margin: 12px 0 0; color: var(--text-2); white-space: pre-wrap; }
.links { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.link-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-3); border: 1px solid var(--line-strong); color: var(--text-1); }
.link-btn svg { width: 20px; height: 20px; }
.link-field > span { display: flex !important; align-items: center; gap: 6px; }
.link-field > span svg { width: 16px; height: 16px; }

.rank-card {
  border-radius: var(--radius-lg); padding: 16px; border: 1px solid rgba(255, 176, 87, 0.3);
  background: radial-gradient(120% 120% at 100% 0%, rgba(255, 138, 76, 0.16), transparent 60%), var(--bg-2);
}
.rank-card .rank-name { font-size: 26px; font-weight: 600; letter-spacing: 0.02em; }
.rank-card .balance { display: flex; align-items: center; gap: 6px; }
.rank-card .balance svg { width: 22px; height: 22px; color: #ffd27a; }
.rank-card .balance b { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rank-card .balance span { font-size: 12px; color: var(--text-3); align-self: flex-end; margin-bottom: 6px; }
.rank-card .progress { margin-top: 12px; }
.ladder { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 10px; font-size: 12px; color: var(--text-3); }
.ladder span.done { color: var(--text-2); }
.ladder span.on { color: #ffd27a; font-weight: 600; }
.earn { margin-top: 10px; }
.earn ul { list-style: none; margin: 8px 0 0; padding: 0; }
.earn li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.earn li b { color: #ffd27a; }
.stats.six { grid-template-columns: repeat(3, 1fr); }
.ledger .row { padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ledger .row:first-child { border-top: 0; padding-top: 0; }
.ledger .plus { color: #ffd27a; }
.ledger .minus { color: var(--text-3); }
a.list-item { text-decoration: none; }
.list-item svg { color: var(--text-3); }

.rule-list { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 14px; }
.rule-list li { margin-bottom: 6px; }
.rule-list b { color: var(--text-1); }
.raise-map { height: 200px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: #ffb057; flex: none; }
.icon-btn.inline { display: inline-grid; width: 32px; height: 32px; vertical-align: middle; background: transparent; }
.icon-btn.inline svg { width: 16px; height: 16px; }
.share-preview { margin: 0 0 16px; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--line); max-height: 46vh; display: grid; place-items: center; background: var(--bg-0); }
.share-preview img { max-width: 100%; max-height: 46vh; display: block; }
.dialog { max-height: calc(100% - 24px); overflow-y: auto; }