/* EXP Tracker: a MapleStory-style night theme on top of Bootstrap 5.3.
   Night sky + hills behind everything, wooden "windows" for panels, orange pill buttons,
   and an in-game style lime EXP bar. Fredoka for headings and numbers, Nunito for text. */
:root,
:root[data-bs-theme="dark"] {
  --sky-top: #0b1533;
  --sky-bottom: #26386a;
  --wood: #2b2119;          /* window body */
  --wood-2: #352a20;        /* rows and tiles inside a window */
  --wood-3: #1f1812;        /* inputs, wells */
  --wood-line: #6b4a2f;
  --wood-line-2: #3d3026;
  --title-top: #7a4f2a;
  --title-bottom: #5a3819;
  --ink: #f6ead6;
  --ink-2: #d9c3a0;
  --muted: #a88f6e;
  --cream: #fbe9cc;
  --orange-top: #ffb23e;
  --orange-bottom: #e8660c;
  --orange-line: #b4500a;
  --leaf: #f08a2c;
  --gold: #bd982d;
  --live: #4cc23a;

  --exp: #b8e01c;           /* EXP chart + accents */
  --meso: #ffb23e;          /* mesos chart + accents */
  --gain: #4cc23a;
  --level: #b9a2ff;
  --good: #4cc23a;          /* level-up marker, always with a label */
  --bad: #ff6b5e;           /* death marker, always with a label */
  --box-exp: #b8e01c;
  --box-anchor: #f08a2c;
  --box-meso: #4cc23a;
  --box-chat: #b9a2ff;
  --loot: #6ea8fe;          /* loot value accents */
  --total: #ff7eb6;         /* total value accents */

  --font-display: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;

  --bs-body-font-family: var(--font-body);
  --bs-body-bg: var(--sky-top);
  --bs-body-color: var(--ink);
  --bs-body-color-rgb: 246, 234, 214;
  --bs-secondary-color: var(--muted);
  --bs-tertiary-color: var(--muted);
  --bs-border-color: var(--wood-line);
  --bs-border-color-translucent: rgba(246, 234, 214, .09);
  --bs-link-color: var(--orange-top);
  --bs-link-color-rgb: 255, 178, 62;
  --bs-link-hover-color: #ffd28a;
  --bs-link-hover-color-rgb: 255, 210, 138;
  --bs-heading-color: #fff;
  --bs-emphasis-color: #fff;
}

body {
  font-size: 15px; min-height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 70%) fixed;
}
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 700; color: #fff; }
.num { font-variant-numeric: tabular-nums; }
.text-muted-wood { color: var(--muted); }
.text-ink-2 { color: var(--ink-2); }

/* ---------- scenery ---------- */
.sky { position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; }
.cloud { position: absolute; width: 220px; height: 60px; border-radius: 60px; background: rgba(190, 205, 240, .12); filter: blur(.5px); }
.cloud::before, .cloud::after { content: ""; position: absolute; background: inherit; border-radius: 50%; }
.cloud::before { width: 100px; height: 80px; left: 30px; top: -40px; }
.cloud::after { width: 80px; height: 60px; right: 30px; top: -28px; }
/* Clouds drift slowly left to right across the whole sky and wrap around. Each has its own height,
   size and speed (slower = further away); the negative delays spread them out from the start. */
.cloud { left: 0; animation: float var(--dur) linear var(--delay) infinite; will-change: translate; }
.cloud.c1 { top: 9%; --dur: 140s; --delay: -20s; }
.cloud.c2 { top: 26%; transform: scale(.75); --dur: 190s; --delay: -120s; opacity: .8; }
.cloud.c3 { top: 58%; transform: scale(1.2); opacity: .7; --dur: 120s; --delay: -75s; }
.cloud.c4 { top: 16%; transform: scale(.55); opacity: .6; --dur: 240s; --delay: -170s; }
.cloud.c5 { top: 42%; transform: scale(.9); opacity: .75; --dur: 165s; --delay: -40s; }
@keyframes float { from { translate: -300px 0; } to { translate: calc(100vw + 60px) 0; } }
.hills {
  position: fixed; left: 0; right: 0; bottom: 0; height: 90px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 140px at 20% 100%, #23462a 60%, transparent 61%),
    radial-gradient(90% 120px at 85% 100%, #17331d 60%, transparent 61%);
}
/* twinkling stars (spawned by app.js) */
.stars { position: absolute; inset: 0 0 45% 0; }
.star {
  position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: #fff8e1;
  box-shadow: 0 0 6px rgba(255, 248, 225, .8); opacity: .25; animation: twinkle var(--dur) ease-in-out var(--delay) infinite;
}
@keyframes twinkle { 50% { opacity: .9; } }

/* falling maple leaves (spawned by app.js), behind the panels */
.leaves { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.leaf {
  position: absolute; top: -40px; left: var(--x); width: var(--size); height: var(--size); opacity: .85;
  animation: fall var(--dur) linear var(--delay) infinite; will-change: transform;
}
.leaf-sway { width: 100%; height: 100%; animation: sway var(--sway) ease-in-out infinite alternate; }
.leaf svg {
  width: 100%; height: 100%; fill: currentColor; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .3));
  animation: spin var(--dur) linear var(--delay) infinite;
}
@keyframes fall { to { transform: translate(var(--drift), calc(100vh + 80px)); } }
@keyframes sway { from { transform: translateX(-18px) rotate(-12deg); } to { transform: translateX(18px) rotate(12deg); } }
@keyframes spin { to { transform: rotate(var(--spin)); } }

/* monsters patrolling the hills: walk to --to, turn around, walk back */
.mobs { position: fixed; left: 0; right: 0; bottom: 0; height: 80px; z-index: -1; pointer-events: none; overflow: hidden; }
.mob { position: absolute; left: 0; bottom: var(--y); animation: patrol var(--dur) ease-in-out var(--delay) infinite; will-change: transform; }
.mob .face { animation: turn var(--dur) steps(1, end) var(--delay) infinite; }
.mob .art { display: block; overflow: visible; transform-origin: 50% 100%; }
.mob.mushroom .art { animation: hop .7s ease-in-out infinite; }
.mob.mushroom.small .art { animation-duration: .55s; }
.mob.snail .art { animation: crawl 1.6s ease-in-out infinite; }
.mob.slime .art { animation: bounce 1.1s ease-in-out infinite; }
@keyframes patrol { 0%, 100% { transform: translateX(var(--from)); } 50% { transform: translateX(var(--to)); } }
@keyframes turn { 0% { transform: scaleX(1); } 50% { transform: scaleX(-1); } 100% { transform: scaleX(-1); } }
@keyframes hop { 0%, 100% { transform: translateY(0) scale(1, 1); } 15% { transform: translateY(0) scale(1.06, .94); } 50% { transform: translateY(-5px) scale(.97, 1.03); } }
@keyframes crawl { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(1.07); } }
@keyframes bounce { 0%, 100% { transform: translateY(0) scale(1.1, .9); } 45% { transform: translateY(-9px) scale(.94, 1.07); } 70% { transform: translateY(-4px) scale(1, 1); } }

@media (prefers-reduced-motion: reduce) {
  .cloud, .live-dot, .star, .mob, .mob .face, .mob .art { animation: none !important; }
  .mob { transform: translateX(var(--from)); }
  .leaves { display: none; }
}

/* ---------- header ---------- */
.site-header {
  width: 100%; max-width: 1040px; margin: 0 auto; padding: 24px 16px 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-leaf { width: 34px; height: 34px; fill: var(--leaf); filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .25)); flex: none; }
.brand-name { display: block; font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.1; }
.brand-sub { display: block; font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .85); }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 16px 16px 140px; flex: 1; }
.wrap > * + * { margin-top: 20px; }
.site-foot { text-align: center; font-size: 12px; color: rgba(246, 234, 214, .65); padding: 0 16px 110px; position: relative; }

/* pill tabs (nav, filters) */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 800; text-decoration: none; color: var(--ink-2);
  background: var(--wood-2); border: 2px solid var(--wood-line);
}
.tab:hover { color: var(--cream); border-color: #8a6440; }
.tab.active { color: #fff; background: linear-gradient(var(--orange-top), var(--orange-bottom)); border-color: var(--orange-line); text-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
/* Ko-fi: support the tracker (opens in a new tab, so live tracking keeps running) */
.tab.kofi { color: #fff; background: #29abe0; border-color: #1b7ea6; }
.tab.kofi:hover { background: #1f9bcf; color: #fff; }
.tab.kofi .bi { color: #ff5e5b; }
.kofi-note { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.kofi-note .bi-cup-hot-fill { font-size: 2rem; color: #29abe0; }
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--live); flex: none;
  box-shadow: 0 0 0 3px rgba(76, 194, 58, .25); animation: blink 1.6s ease-in-out infinite;
}
.live-dot.paused { background: var(--orange-top); box-shadow: 0 0 0 3px rgba(255, 178, 62, .25); animation: none; }
.live-dot[hidden] { display: none; }
@keyframes blink { 50% { box-shadow: 0 0 0 6px rgba(76, 194, 58, .05); } }

/* logged-in player (hosted copy) */
.user-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 3px 4px 3px 4px; border-radius: 999px;
  background: var(--wood-2); border: 2px solid var(--wood-line); color: var(--ink-2); font-weight: 800; font-size: 13px;
}
.user-chip[hidden] { display: none; }
.user-chip img, .avatar-fallback { width: 28px; height: 28px; border-radius: 50%; flex: none; }
.avatar-fallback { display: grid; place-items: center; background: #5865f2; color: #fff; font-family: var(--font-display); }
.user-chip .user-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .btn { --bs-btn-padding-x: .55rem; --bs-btn-padding-y: .15rem; }
.btn-discord {
  --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff;
  --bs-btn-bg: #5865f2; --bs-btn-border-color: #3c45a5; --bs-btn-hover-bg: #4752c4; --bs-btn-hover-border-color: #3c45a5;
  --bs-btn-active-bg: #3c45a5; --bs-btn-active-border-color: #2f3685;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 2px 0 rgba(0, 0, 0, .3);
}

/* ---------- windows (panels) ---------- */
.window {
  background: var(--wood); border: 2px solid var(--wood-line); border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
}
.window-title {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 7px 14px;
  background: linear-gradient(var(--title-top), var(--title-bottom)); border-bottom: 2px solid var(--wood-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); color: var(--cream);
}
.window-name { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; }
.window-name .bi { color: var(--leaf); }
.window-aside { font-size: 12px; font-weight: 700; }
.window-body { padding: 16px; }
.window-body.lg { padding: 24px; }

/* ---------- board rows ---------- */
.board { display: grid; gap: 10px; }
.board-row {
  display: grid; grid-template-columns: auto minmax(0, 1.1fr) minmax(0, 2fr) minmax(110px, auto); align-items: center; gap: 16px;
  padding: 12px 16px; border-radius: 10px; background: var(--wood-2); border: 1px solid var(--wood-line-2);
  color: var(--ink); text-decoration: none; transition: border-color .15s, background .15s;
}
a.board-row:hover { color: var(--ink); border-color: var(--wood-line); background: #3b2f24; }
.board-row.best { border-color: var(--gold); }
.rank {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--ink-2); background: var(--wood-3);
  border: 2px solid rgba(0, 0, 0, .15); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15), 0 2px 4px rgba(0, 0, 0, .15);
}
.rank.r1 { background: radial-gradient(circle at 35% 30%, #fff3b0, #f4c430 60%); color: #7a5200; }
.rank.r2 { background: radial-gradient(circle at 35% 30%, #fff, #c7ccd4 60%); color: #4a5160; }
.rank.r3 { background: radial-gradient(circle at 35% 30%, #ffd7b0, #d58a4a 60%); color: #fff; }
.rank.live { background: radial-gradient(circle at 35% 30%, #b9f5a6, #3f9e2a 65%); color: #fff; font-size: 16px; }
.rank.rec { background: radial-gradient(circle at 35% 30%, #c9d8ff, #5a78d6 65%); color: #fff; font-size: 16px; }
.who { min-width: 0; }
.who-name { font-family: var(--font-display); font-size: 18px; font-weight: 600; line-height: 1.25; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-meta { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.status-live { color: var(--live); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.status-rec { color: #8fb0ff; font-weight: 700; }
.row-sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.score { text-align: right; }
.score-value { font-family: var(--font-display); font-size: 24px; font-weight: 700; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.score-unit { font-size: 12px; color: var(--muted); white-space: nowrap; }
@media (max-width: 767px) {
  .board-row { grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px 12px; }
  .board-row .row-mid { grid-column: 1 / -1; grid-row: 2; }
  .board-row .score { grid-column: 3; grid-row: 1; }
  .score-value { font-size: 20px; }
}

/* ---------- top 5 maps ---------- */
.map-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; margin: -6px 0; }
.map-table th { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 2px 12px; }
.map-table td { padding: 10px 12px; background: var(--wood-2); border-top: 1px solid var(--wood-line-2); border-bottom: 1px solid var(--wood-line-2); vertical-align: middle; }
.map-table td:first-child { border-left: 1px solid var(--wood-line-2); border-radius: 10px 0 0 10px; }
.map-table td:last-child { border-right: 1px solid var(--wood-line-2); border-radius: 0 10px 10px 0; }
.map-table tr.best td { border-color: var(--gold); background: linear-gradient(90deg, rgba(189, 152, 45, .18), var(--wood-2) 45%); }
.map-table .r { text-align: right; }
.map-table .rank-col { width: 52px; }
.rank.sm { width: 30px; height: 30px; font-size: 15px; }
.map-name { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.map-meta { font-size: 12px; color: var(--muted); }
.map-rate { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; line-height: 1.1; }
.map-bar { margin: 5px 0 0 auto; width: 120px; max-width: 100%; height: 6px; border-radius: 3px; background: var(--wood-3); overflow: hidden; }
.map-bar span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #86b80a, var(--exp)); }
.map-meso { font-weight: 800; color: var(--meso); font-variant-numeric: tabular-nums; }

/* ---------- your sessions (scrollable list) ---------- */
.session-tools { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--wood-line-2); color: var(--muted); }
.session-tools .form-control { max-width: 280px; }
.session-scroll { max-height: 560px; overflow-y: auto; padding: 0 12px 12px; scrollbar-width: thin; scrollbar-color: var(--wood-line) var(--wood-3); }
.session-scroll::-webkit-scrollbar { width: 10px; }
.session-scroll::-webkit-scrollbar-track { background: var(--wood-3); }
.session-scroll::-webkit-scrollbar-thumb { background: var(--wood-line); border-radius: 5px; border: 2px solid var(--wood-3); }
.session-day {
  position: sticky; top: 0; z-index: 1; margin: 0 -12px; padding: 10px 16px 6px; background: var(--wood);
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--orange-top);
}
.session-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-top: 6px;
  padding: 10px 14px; border-radius: 10px; background: var(--wood-2); border: 1px solid var(--wood-line-2);
  color: var(--ink); text-decoration: none; transition: border-color .15s, background .15s, transform .15s;
}
.session-item:hover { color: var(--ink); border-color: var(--wood-line); background: #3b2f24; transform: translateX(2px); }
.session-item[hidden], .session-day[hidden] { display: none; }
.session-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 15px; border: 2px solid rgba(0, 0, 0, .2); }
.session-icon.live { background: radial-gradient(circle at 35% 30%, #b9f5a6, #3f9e2a 65%); }
.session-icon.rec { background: radial-gradient(circle at 35% 30%, #c9d8ff, #5a78d6 65%); }
.session-name { font-family: var(--font-display); font-size: 16px; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-meta { font-size: 12px; color: var(--muted); }
.session-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.chip { font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: var(--wood-3); border: 1px solid var(--wood-line-2); color: var(--ink-2); white-space: nowrap; }
.chip.exp { color: var(--exp); }
.chip.lvl { color: var(--level); }
.chip.bad { color: var(--bad); }
.chip.meso { color: var(--meso); }
.chip.loot { color: var(--loot); }
.session-score { text-align: right; }
.session-score .score-value { font-size: 22px; }
.session-value { font-size: 11px; font-weight: 800; color: var(--total); margin-top: 2px; white-space: nowrap; }
@media (max-width: 575px) {
  .session-item { grid-template-columns: auto minmax(0, 1fr); }
  .session-score { grid-column: 2; text-align: left; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
  .session-score .score-value { font-size: 18px; }
}

/* ---------- in-game EXP bar ---------- */
.expbar {
  position: relative; height: 22px; border-radius: 6px; overflow: hidden;
  background: #5b5b60; border: 2px solid #3a3a3e; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .35);
}
.expbar.lg { height: 30px; }
.expbar-fill {
  position: absolute; inset: 0 auto 0 0; transition: width .6s ease;
  background: linear-gradient(#f2fb7a 0%, #b8e01c 55%, #86b80a 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}
.expbar.meso .expbar-fill { background: linear-gradient(#ffe08a 0%, #ffb23e 55%, #e8660c 100%); }
.expbar-text {
  position: relative; height: 100%; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; font-weight: 800; color: #fff; white-space: nowrap;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .7), 0 0 3px rgba(0, 0, 0, .6);
}
.expbar.lg .expbar-text { font-size: 14px; }
.expbar-label { font-family: var(--font-display); font-weight: 700; color: #f2fb7a; }

/* ---------- stat tiles ---------- */
.stat {
  height: 100%; padding: 14px 16px; border-radius: 10px; background: var(--wood-2);
  border: 1px solid var(--wood-line-2); border-top: 3px solid var(--accent);
}
.stat .label { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 600; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
.stat .label .bi { color: var(--accent); font-size: 1.05rem; }
.stat .value { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.15; margin-top: 6px; color: #fff; font-variant-numeric: tabular-nums; }
.stat .value img { width: 22px; height: 22px; image-rendering: pixelated; vertical-align: -2px; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- buttons: orange pills like the game UI ---------- */
.btn {
  --bs-btn-font-family: var(--font-body); --bs-btn-font-weight: 800; --bs-btn-border-width: 2px;
  --bs-btn-border-radius: 999px; --bs-btn-padding-x: 1.1rem; --bs-btn-padding-y: .45rem;
  --bs-btn-border-radius-lg: 999px; --bs-btn-border-radius-sm: 999px;
  --bs-btn-focus-box-shadow: 0 0 0 .2rem rgba(255, 178, 62, .35);
}
.btn-primary, .btn-success, .btn-danger, .btn-warning, .btn-info {
  --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff; --bs-btn-disabled-color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .25); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 rgba(0, 0, 0, .3);
}
.btn-primary { --bs-btn-bg: var(--orange-bottom); --bs-btn-border-color: var(--orange-line); --bs-btn-hover-bg: var(--orange-bottom); --bs-btn-hover-border-color: var(--orange-line); --bs-btn-active-bg: #c95a0c; --bs-btn-active-border-color: var(--orange-line); --bs-btn-disabled-bg: #7a5a3c; --bs-btn-disabled-border-color: #5a4330; background-image: linear-gradient(var(--orange-top), var(--orange-bottom)); }
.btn-success { --bs-btn-bg: #3f9e2a; --bs-btn-border-color: #2b6f1c; --bs-btn-hover-bg: #3f9e2a; --bs-btn-hover-border-color: #2b6f1c; --bs-btn-active-bg: #34871f; --bs-btn-active-border-color: #2b6f1c; --bs-btn-disabled-bg: #4a6b3e; --bs-btn-disabled-border-color: #3a5530; background-image: linear-gradient(#8be35f, #3f9e2a); }
.btn-danger { --bs-btn-bg: #c9302c; --bs-btn-border-color: #8e1f1c; --bs-btn-hover-bg: #c9302c; --bs-btn-hover-border-color: #8e1f1c; --bs-btn-active-bg: #a82824; --bs-btn-active-border-color: #8e1f1c; background-image: linear-gradient(#ff7b6b, #c9302c); }
.btn-warning { --bs-btn-bg: #c99a14; --bs-btn-border-color: #8c6a0a; --bs-btn-hover-bg: #c99a14; --bs-btn-hover-border-color: #8c6a0a; --bs-btn-active-bg: #b0860f; --bs-btn-active-border-color: #8c6a0a; background-image: linear-gradient(#ffe066, #c99a14); }
.btn-info { --bs-btn-bg: #3a6fd8; --bs-btn-border-color: #26489a; --bs-btn-hover-bg: #3a6fd8; --bs-btn-hover-border-color: #26489a; --bs-btn-active-bg: #2f5dbd; --bs-btn-active-border-color: #26489a; background-image: linear-gradient(#8fb4ff, #3a6fd8); }
.btn-primary:hover, .btn-success:hover, .btn-danger:hover, .btn-warning:hover, .btn-info:hover { filter: brightness(1.08); }
.btn:disabled, .btn.disabled { background-image: none; box-shadow: none; text-shadow: none; opacity: .7; }
.btn-wood, .btn-outline-secondary, .btn-outline-primary, .btn-outline-danger {
  --bs-btn-color: var(--ink-2); --bs-btn-bg: var(--wood-2); --bs-btn-border-color: var(--wood-line);
  --bs-btn-hover-color: var(--cream); --bs-btn-hover-bg: #3b2f24; --bs-btn-hover-border-color: #8a6440;
  --bs-btn-active-color: var(--cream); --bs-btn-active-bg: #44362a; --bs-btn-active-border-color: #8a6440;
  --bs-btn-disabled-color: var(--muted); --bs-btn-disabled-bg: var(--wood-2); --bs-btn-disabled-border-color: var(--wood-line-2);
}
.btn-outline-danger { --bs-btn-color: #ff9a8f; --bs-btn-hover-color: #ffc2bb; }
.btn-group > .btn { border-radius: 999px !important; margin-left: 0 !important; }
.btn-group { gap: 6px; }
.btn-check:checked + .btn-wood, .btn-wood.active {
  color: #fff; background-image: linear-gradient(var(--orange-top), var(--orange-bottom)); border-color: var(--orange-line);
}
.btn-link { --bs-btn-color: var(--orange-top); --bs-btn-hover-color: #ffd28a; }

/* ---------- forms ---------- */
.form-label { font-weight: 700; color: var(--ink-2); }
.form-control, .form-select {
  --bs-body-bg: var(--wood-3); background-color: var(--wood-3); color: var(--ink);
  border: 2px solid var(--wood-line); border-radius: 10px;
}
.form-control::placeholder { color: var(--muted); }
.form-control:focus, .form-select:focus {
  background-color: var(--wood-3); color: var(--ink); border-color: var(--orange-top); box-shadow: 0 0 0 .2rem rgba(255, 178, 62, .25);
}
.input-group-text { background: var(--wood-2); color: var(--ink-2); border: 2px solid var(--wood-line); }
.input-group > .form-control { border-left-width: 0; }
.input-group > .btn { border-radius: 0 10px 10px 0 !important; }
.form-range::-webkit-slider-thumb { background: linear-gradient(var(--orange-top), var(--orange-bottom)); border: 2px solid var(--orange-line); }
.form-range::-moz-range-thumb { background: var(--orange-bottom); border: 2px solid var(--orange-line); }
.form-range::-webkit-slider-runnable-track { background: var(--wood-3); border: 1px solid var(--wood-line); }
summary { cursor: pointer; color: var(--orange-top); font-weight: 700; }

/* ---------- alerts / badges / misc ---------- */
.alert { border-radius: 10px; border: 1px solid; color: var(--ink); }
.alert-info, .alert-primary { background: rgba(58, 111, 216, .18); border-color: rgba(143, 180, 255, .45); }
.alert-warning { background: rgba(255, 178, 62, .14); border-color: rgba(255, 178, 62, .5); }
.alert-danger { background: rgba(255, 107, 94, .14); border-color: rgba(255, 107, 94, .5); }
.alert .bi { color: inherit; }
.alert-primary .bi, .alert-info .bi { color: #8fb4ff; }
.alert-warning .bi { color: var(--orange-top); }
.alert-danger .bi { color: var(--bad); }
.badge-map { background: rgba(240, 138, 44, .16); color: var(--orange-top); border: 1px solid rgba(240, 138, 44, .35); font-weight: 700; border-radius: 999px; padding: .3em .7em; }
.spinner-border { color: var(--orange-top); }
.progress { --bs-progress-bg: #5b5b60; height: 22px; border: 2px solid #3a3a3e; border-radius: 6px; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .35); }
.progress-bar { background: linear-gradient(#f2fb7a 0%, #b8e01c 55%, #86b80a 100%); }
.table { --bs-table-bg: transparent; --bs-table-color: var(--ink); --bs-table-border-color: var(--wood-line-2); --bs-table-hover-bg: rgba(255, 255, 255, .04); }
.table thead th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.table td.r, .table th.r { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { max-height: 320px; overflow: auto; }
.well { background: var(--wood-3); border: 1px solid var(--wood-line-2); border-radius: 10px; padding: 12px 14px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.kv + .kv { margin-top: 4px; }
.kv .k { color: var(--muted); }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .bi { font-size: 2.5rem; color: var(--wood-line); display: block; margin-bottom: 8px; }
.page-title { font-size: 28px; margin: 0; text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.page-sub { color: rgba(255, 255, 255, .8); font-weight: 600; }
.back { color: rgba(255, 255, 255, .85); font-weight: 700; text-decoration: none; }
.back:hover { color: #fff; }

/* home: start cards */
.start-icon {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; color: #fff; flex: none;
  border: 2px solid rgba(0, 0, 0, .2); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15), 0 2px 4px rgba(0, 0, 0, .2);
}
.start-icon.live { background: radial-gradient(circle at 35% 30%, #b9f5a6, #3f9e2a 65%); }
.start-icon.rec { background: radial-gradient(circle at 35% 30%, #c9d8ff, #5a78d6 65%); }
.drop-zone {
  display: flex; align-items: center; gap: 14px; padding: 18px; cursor: pointer; border-radius: 10px;
  border: 2px dashed var(--wood-line); background: var(--wood-3); color: var(--ink); transition: border-color .15s, background .15s;
}
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.over { border-color: var(--orange-top); background: #2a2018; outline: none; }
.drop-zone .bi { font-size: 1.8rem; color: var(--orange-top); }
.step-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-2); }
.step-list li { display: flex; gap: 10px; align-items: flex-start; }
.step-num {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-top: 1px;
  font-family: var(--font-display); font-weight: 700; font-size: 12px; color: #fff; background: linear-gradient(var(--orange-top), var(--orange-bottom));
}

/* ---------- calibration ---------- */
.step-pill { border-radius: 999px; padding: 5px 14px; font-weight: 800; font-size: 13px; background: var(--wood-2); color: var(--muted); border: 2px solid var(--wood-line); }
.step-pill.on { color: #fff; background: linear-gradient(var(--orange-top), var(--orange-bottom)); border-color: var(--orange-line); }
.step-pill.done { color: var(--live); border-color: #2f6b22; }
.stage-wrap { max-height: 70vh; overflow: auto; border-radius: 8px; background: #000; border: 2px solid #000; }
.stage { position: relative; display: inline-block; vertical-align: top; cursor: crosshair; touch-action: none; user-select: none; }
.stage.fit { display: block; }
.stage img { display: block; width: 100%; }
.box { position: absolute; border: 2px solid; box-shadow: 0 0 0 1px #000, inset 0 0 0 1px #000; pointer-events: none; }
.box .tag { position: absolute; left: -2px; bottom: 100%; padding: 1px 6px; font-size: 11px; font-weight: 800; white-space: nowrap; color: #1a1208; border-radius: 4px 4px 0 0; }
.box.exp { border-color: var(--box-exp); } .box.exp .tag { background: var(--box-exp); }
.box.anchor { border-color: var(--box-anchor); } .box.anchor .tag { background: var(--box-anchor); }
.box.meso { border-color: var(--box-meso); } .box.meso .tag { background: var(--box-meso); }
.box.chat { border-color: var(--box-chat); } .box.chat .tag { background: var(--box-chat); }
/* ---------- public home page ---------- */
.hero { padding: 12px 0 4px; }
.hero-title { font-size: clamp(32px, 5vw, 48px); line-height: 1.05; margin: 0 0 14px; text-shadow: 0 3px 0 rgba(0, 0, 0, .3); }
.hero-title span { display: block; color: var(--orange-top); }
.hero-lead { font-size: 18px; color: rgba(255, 255, 255, .88); font-weight: 600; margin: 0; }
.stat.feature { height: 100%; }
.stat.feature p { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }
.faq details { border-bottom: 1px solid var(--wood-line-2); padding: 10px 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { font-family: var(--font-display); font-weight: 600; font-size: 17px; cursor: pointer; color: var(--ink); }
.faq details p { margin: 8px 0 0; color: var(--ink-2); }
.site-foot a { color: inherit; }

/* ---------- feedback ---------- */
.feedback-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.feedback-kind input { position: absolute; opacity: 0; pointer-events: none; }
.feedback-kind span {
  display: grid; grid-template-columns: auto 1fr; gap: 0 10px; align-items: center; padding: 12px 14px; cursor: pointer;
  border-radius: 10px; background: var(--wood-2); border: 2px solid var(--wood-line-2); transition: border-color .15s, background .15s;
}
.feedback-kind .bi { grid-row: span 2; font-size: 1.5rem; color: var(--orange-top); }
.feedback-kind strong { font-family: var(--font-display); font-weight: 600; color: var(--ink); }
.feedback-kind small { color: var(--muted); font-size: 12px; }
.feedback-kind input:checked + span { border-color: var(--orange-top); background: #3b2f24; }
.feedback-kind input:focus-visible + span { outline: 2px solid var(--orange-top); outline-offset: 2px; }
.feedback-list { display: grid; gap: 10px; max-height: 620px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; scrollbar-color: var(--wood-line) var(--wood-3); }
.feedback-item { padding: 12px 14px; border-radius: 10px; background: var(--wood-2); border: 1px solid var(--wood-line-2); }
.feedback-item.new { border-color: var(--orange-top); }
.feedback-item.done { opacity: .7; }
.feedback-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.feedback-badge { font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: var(--wood-3); border: 1px solid var(--wood-line-2); }
.feedback-badge.bug { color: var(--bad); }
.feedback-badge.idea { color: var(--meso); }
.feedback-badge.other { color: var(--loot); }
.feedback-badge.new { color: #fff; background: linear-gradient(var(--orange-top), var(--orange-bottom)); border-color: var(--orange-line); }
.feedback-message { margin: 8px 0 0; white-space: pre-wrap; color: var(--ink); }
.feedback-info { margin-top: 6px; font-size: 12px; color: var(--muted); }
.feedback-info summary { cursor: pointer; }
.feedback-info dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 6px 0 0; }
.feedback-info dt { font-weight: 800; text-transform: capitalize; }
.feedback-info dd { margin: 0; word-break: break-word; }
.nav-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 800; color: #fff; background: var(--bad); margin-left: 2px;
}

/* ---------- admin ---------- */
.admin-avatar { width: 24px; height: 24px; border-radius: 50%; vertical-align: -6px; display: inline-grid; place-items: center; font-size: 12px; }
.admin-icon { width: 24px; height: 24px; image-rendering: pixelated; vertical-align: -6px; }
.admin-chart { width: 100%; height: auto; display: block; }
.admin-chart .admin-bar { fill: var(--exp); }
.admin-chart .admin-bar:hover { fill: var(--orange-top); }
.admin-chart .tick { fill: var(--muted); font-size: 10px; }
.admin-h { font-family: var(--font-display); color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; font-size: 13px; }

/* ---------- guide ---------- */
.guide-shot { margin: 0; }
.guide-frame { position: relative; border-radius: 8px; border: 2px solid #000; background: #000; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.guide-frame img { display: block; width: 100%; height: auto; border-radius: 6px; }
.guide-frame img.px { image-rendering: pixelated; }
.box.popout { border-color: var(--live); border-style: dashed; } .box.popout .tag { background: var(--live); }
.guide-shot figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }
.guide-step .window-name .step-num { width: 26px; height: 26px; font-size: 14px; margin: 0 4px 0 0; }
.guide-list { font-size: 15px; gap: 10px; }
.guide-more { border: 1px solid var(--wood-line-2); border-radius: 10px; background: var(--wood-3); padding: 12px 16px; }
.guide-more > summary { cursor: pointer; list-style: none; font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--ink); }
.guide-more > summary::-webkit-details-marker { display: none; }
.guide-more > summary .bi { display: inline-block; margin-right: 8px; color: var(--orange-top); transition: transform .15s; }
.guide-more[open] > summary .bi { transform: rotate(90deg); }
.guide-sub { display: flex; align-items: center; gap: 8px; font-size: 18px; margin: 24px 0 12px; }
.guide-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: 15px; color: var(--ink-2); }
.guide-checks li { display: flex; gap: 10px; align-items: flex-start; }
.guide-checks .bi { color: var(--orange-top); font-size: 1.2rem; line-height: 1.3; }
.guide-tip { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 14px;
  background: var(--wood-3); border: 1px solid var(--wood-line-2); color: var(--ink-2); }
.guide-tip > .bi { font-size: 1.1rem; line-height: 1.3; }
.guide-tip.good > .bi { color: var(--live); }
.guide-tip.bad > .bi { color: #ff7a6b; }
.guide-tip.info > .bi { color: var(--orange-top); }
kbd { background: var(--wood-2); border: 1px solid var(--wood-line); color: var(--ink); }
.loot-lines { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); }

/* ---------- loot ---------- */
.loot-list { display: grid; gap: 8px; max-height: 360px; overflow: auto; }
.loot-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 8px; background: var(--wood-2); border: 1px solid var(--wood-line-2);
}
.loot-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; }
.loot-icon.equip { background: radial-gradient(circle at 35% 30%, #c9d8ff, #5a78d6 65%); }
.loot-icon.scroll { background: radial-gradient(circle at 35% 30%, #ffe08a, #e8660c 65%); }
.loot-icon.use { background: radial-gradient(circle at 35% 30%, #ffc2d1, #d6336c 65%); }
.loot-icon.etc { background: radial-gradient(circle at 35% 30%, #d8f5a2, #5c940d 65%); }
.loot-icon.setup { background: radial-gradient(circle at 35% 30%, #c5f6fa, #1098ad 65%); }
.loot-icon.cash { background: radial-gradient(circle at 35% 30%, #e5dbff, #7048e8 65%); }
.loot-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loot-meta { font-size: 12px; color: var(--muted); }
.loot-price { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: #fff; text-align: right; }
.loot-list.tall { max-height: none; }
.loot-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.not-mine { --bs-btn-padding-y: .1rem; --bs-btn-padding-x: .55rem; --bs-btn-font-size: 11px; opacity: .75; }
.not-mine:hover { opacity: 1; --bs-btn-hover-color: #ff9a8f; }
/* the game's item icon in an inventory-style slot */
.item-slot {
  width: 42px; height: 42px; display: grid; place-items: center; flex: none; border-radius: 6px;
  background: radial-gradient(circle at 50% 40%, #5a5a62, #2e2e33); border: 2px solid #1d1d20;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15);
}
.item-slot img { max-width: 34px; max-height: 34px; image-rendering: pixelated; }
.item-slot.sm { width: 34px; height: 34px; }
.item-slot.sm img { max-width: 28px; max-height: 28px; }
.stat-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 2px; }
.stat-chip {
  font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px;
  color: #d8f5a2; background: rgba(184, 224, 28, .12); border: 1px solid rgba(184, 224, 28, .3);
}
.loot-meta a { color: var(--orange-top); }
.best-find { display: flex; align-items: center; gap: 8px; font-size: 20px !important; }
.best-find span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.credit { font-size: 12px; color: var(--muted); }
.read-preview { border-radius: 6px; background: #000; max-width: 100%; image-rendering: pixelated; border: 2px solid var(--wood-line); }
.text-success { color: var(--live) !important; }
.text-danger { color: var(--bad) !important; }

/* ---------- live ---------- */
.preview video { width: 100%; border-radius: 8px; background: #000; display: block; border: 2px solid #000; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; min-height: 220px; }
.chart svg { display: block; overflow: visible; font-family: var(--font-body); }
.chart .grid { stroke: rgba(246, 234, 214, .08); stroke-width: 1; }
.chart .axis { stroke: var(--wood-line); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 12px; font-weight: 700; }
.chart .line { fill: none; stroke: var(--series); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--series); opacity: .14; }
.chart .ev-label { fill: var(--ink); font-size: 12px; font-weight: 800; }
.chart .ev-up { fill: var(--good); stroke: var(--wood); stroke-width: 2; }
.chart .ev-down { stroke: var(--bad); stroke-width: 3; stroke-linecap: round; }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { fill: var(--series); stroke: var(--wood); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: crosshair; }
.tip {
  position: absolute; pointer-events: none; z-index: 2; padding: 8px 12px; font-size: 13px; line-height: 1.5; white-space: nowrap;
  background: var(--wood-3); color: var(--ink); border: 2px solid var(--wood-line); border-radius: 8px; box-shadow: 0 8px 20px rgba(0, 0, 0, .4);
}
.tip .k { color: var(--muted); }

/* ---------- pop-out window ---------- */
.pip-body { background: var(--wood); min-height: 100vh; }
.pip { padding: 12px 14px; }
.pip .big { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1.15; color: #fff; font-variant-numeric: tabular-nums; }
.pip-toggle {
  margin-top: 8px; width: 100%; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; cursor: pointer;
  color: var(--ink-2); background: var(--wood-2); border: 1px solid var(--wood-line);
}
.pip-toggle.on { color: #fff; border-color: var(--orange-line); background: linear-gradient(var(--orange-top), var(--orange-bottom)); }
.pip .kv { font-size: 13px; }
