/* ===== RPG SHARED DESIGN SYSTEM v2 ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --pink: #FFB6D9;
  --pink-dark: #FF1493;
  --pink-glow: rgba(255,182,217,0.35);
  --gold: #FFD700;
  --gold-dark: #FFA500;
  --green: #00ff88;
  --red: #ff4444;
  --bg: #000000;
  --card: rgba(255,255,255,0.03);
  --card-border: rgba(255,182,217,0.12);
  --card-border-active: rgba(255,182,217,0.45);
  --text: #ffffff;
  --text-muted: rgba(255,255,255,0.45);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 14px;
  --radius-sm: 8px;
  --nav-height: 80px;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + 1rem);
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 80% 40% at 20% 0%, rgba(255,182,217,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(255,20,147,0.04) 0%, transparent 60%);
}

/* Canvas particles */
#particles-canvas {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0; opacity: 0.35;
}

/* Page wrapper */
.page { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; padding: 1.25rem 1rem; }
.page-wide { max-width: 1300px; }

/* ---- Bottom Nav ---- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(4,4,4,0.97);
  backdrop-filter: blur(24px) saturate(1.5);
  border-top: 1px solid rgba(255,182,217,0.1);
  display: flex; z-index: 999;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  padding-top: 10px;
  gap: 4px; text-decoration: none;
  color: rgba(255,255,255,0.25);
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  transition: color 0.2s; position: relative;
}
.nav-item .ni { font-size: 1.7rem; line-height: 1; transition: filter 0.2s; }
.nav-item span:not(.ni) { white-space: nowrap; }
.nav-item:hover { color: var(--pink); }
.nav-item.active { color: var(--pink); }
.nav-item.active .ni { filter: drop-shadow(0 0 8px rgba(255,182,217,0.8)); }
.nav-item.active::before {
  content: ''; position: absolute; top: 0; left: 20%; right: 20%;
  height: 2px; background: var(--pink);
  border-radius: 0 0 4px 4px;
}

/* Mobile: too many nav items to fit evenly — switch to a horizontally
   scrollable strip with fixed-width items instead of squeezing flex:1 */
@media (max-width: 760px) {
  .bottom-nav {
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-start;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  }
  .bottom-nav::-webkit-scrollbar { display: none; }
  .nav-item {
    flex: 0 0 auto;
    width: 86px;
    padding: 10px 2px 0;
    scroll-snap-align: center;
  }
  .nav-item .ni { font-size: 1.45rem; }
  .nav-item span:not(.ni) { font-size: 0.62rem; }
}

/* ---- Cards ---- */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.card:hover { border-color: var(--card-border-active); }
.card-glow { box-shadow: 0 0 0 1px rgba(255,182,217,0.1), 0 8px 32px rgba(0,0,0,0.4); }

/* ---- Section headers ---- */
.section-title {
  font-size: 0.7rem; font-weight: 800;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--pink); margin-bottom: 1rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.section-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(255,182,217,0.2), transparent);
}

/* ---- Progress bars ---- */
.pbar {
  height: 5px; background: rgba(255,255,255,0.07);
  border-radius: 99px; overflow: hidden;
}
.pbar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--pink-dark));
  border-radius: 99px;
  transition: width 0.9s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}
.pbar-fill::after {
  content: '';
  position: absolute; right: 0; top: -2px;
  width: 6px; height: 9px; border-radius: 99px;
  background: white; opacity: 0.8;
}
.pbar-fill.green { background: linear-gradient(90deg, #00ff88, #00cc66); }
.pbar-fill.gold  { background: linear-gradient(90deg, #FFD700, #FFA500); }
.pbar-fill.red   { background: linear-gradient(90deg, #ff6666, #ff2222); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.4rem; padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm); border: none;
  font-family: var(--font); font-size: 0.85rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s; text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  color: white;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(255,20,147,0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: rgba(255,182,217,0.07);
  border: 1px solid rgba(255,182,217,0.18);
  color: var(--pink);
}
.btn-ghost:hover { background: rgba(255,182,217,0.14); border-color: rgba(255,182,217,0.35); }
.btn-danger {
  background: rgba(255,68,68,0.1);
  border: 1px solid rgba(255,68,68,0.25);
  color: #ff7777;
}
.btn-danger:hover { background: rgba(255,68,68,0.22); }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.78rem; }
.btn-icon { padding: 0.5rem; width: 36px; height: 36px; border-radius: var(--radius-sm); }

/* ---- Glow text ---- */
.glow       { text-shadow: 0 0 24px var(--pink-glow); color: var(--pink); }
.glow-gold  { text-shadow: 0 0 24px rgba(255,215,0,0.5); color: var(--gold); }
.glow-red   { text-shadow: 0 0 24px rgba(255,0,0,0.5); color: #ff5555; }
.glow-green { text-shadow: 0 0 24px rgba(0,255,136,0.4); color: var(--green); }

/* ---- Animations ---- */
@keyframes fadeUp   { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:none; } }
@keyframes fadeIn   { from { opacity:0; } to { opacity:1; } }
@keyframes pulseBorder {
  0%,100% { box-shadow: 0 0 0 1px rgba(255,182,217,0.15); }
  50%      { box-shadow: 0 0 0 3px rgba(255,182,217,0.4), 0 0 20px rgba(255,182,217,0.2); }
}
@keyframes rippleOut {
  0%   { transform: scale(0.8); opacity:0.8; }
  100% { transform: scale(2.2); opacity:0; }
}
@keyframes bounceIn {
  0%   { transform: scale(0.6); opacity:0; }
  55%  { transform: scale(1.08); }
  100% { transform: scale(1); opacity:1; }
}
@keyframes checkPop {
  0%   { transform: scale(0); }
  60%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}
@keyframes shimmerSwipe {
  0%   { background-position: -300% 0; }
  100% { background-position: 300% 0; }
}
@keyframes countUp {
  0%   { opacity:0; transform: scale(0.7) translateY(6px); }
  100% { opacity:1; transform: none; }
}
@keyframes doom {
  0%,100% { box-shadow: 0 0 20px rgba(255,0,0,0.3); }
  50%      { box-shadow: 0 0 50px rgba(255,0,0,0.7); }
}
@keyframes heartbeat {
  0%,100% { transform: scale(1); }
  14%     { transform: scale(1.05); }
  28%     { transform: scale(1); }
  42%     { transform: scale(1.04); }
}

.animate-up   { animation: fadeUp  0.4s ease both; }
.animate-in   { animation: fadeIn  0.3s ease both; }
.stagger > * { animation: fadeUp 0.4s ease both; }
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.10s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.20s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.30s; }

/* ---- Reward flash ---- */
#reward-flash {
  position: fixed; inset:0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; opacity: 0;
  transition: opacity 0.25s;
  background: rgba(0,0,0,0.5);
}
#reward-flash.show { opacity: 1; }
.rf-inner {
  background: rgba(8,8,8,0.97);
  border: 1px solid var(--pink);
  border-radius: 20px;
  padding: 2rem 2.5rem;
  text-align: center;
  box-shadow: 0 0 80px rgba(255,182,217,0.35);
  animation: bounceIn 0.4s ease;
}
.rf-xp {
  font-size: 3.5rem; font-weight: 900; letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  animation: countUp 0.3s ease;
}
.rf-label { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.5rem; font-weight: 500; }
.rf-level { color: var(--pink); font-size: 0.9rem; font-weight: 700; margin-top: 0.25rem; }

/* ---- Tags / priority chips ---- */
.tag {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 5px;
  font-size: 0.68rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.tag-asap, .tag-urgent { background: rgba(255,68,68,0.18); color: #ff7777; border: 1px solid rgba(255,68,68,0.28); }
.tag-high    { background: rgba(255,165,0,0.18); color: #ffaa55; border: 1px solid rgba(255,165,0,0.28); }
.tag-medium  { background: rgba(255,182,217,0.12); color: var(--pink); border: 1px solid rgba(255,182,217,0.2); }
.tag-low     { background: rgba(255,255,255,0.05); color: var(--text-muted); border: 1px solid rgba(255,255,255,0.08); }

/* ---- Inputs ---- */
.input {
  width: 100%; padding: 0.7rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,182,217,0.15);
  border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--font); font-size: 0.875rem;
  transition: border-color 0.2s, background 0.2s;
  outline: none;
}
.input:focus { border-color: rgba(255,182,217,0.5); background: rgba(255,182,217,0.03); }
input[type="range"].input {
  padding: 0; background: transparent; border: none; cursor: pointer;
  accent-color: var(--pink);
}
input[type="number"].input::-webkit-inner-spin-button { opacity: 0.5; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-thumb { background: rgba(255,182,217,0.15); border-radius: 99px; }

/* ---- Grid helpers ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 0.75rem; }
@media (max-width: 640px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

/* ---- Checkbox ---- */
.checkbox {
  width: 22px; height: 22px; border-radius: 6px;
  border: 2px solid rgba(255,182,217,0.3);
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
  cursor: pointer; font-size: 0.9rem;
}
.checkbox.checked {
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  border-color: transparent;
  box-shadow: 0 0 12px rgba(255,20,147,0.5);
  animation: checkPop 0.3s ease;
}

/* ---- HUD bar ---- */
.hud {
  position: sticky; top: 0; z-index: 100;
  background: rgba(4,4,4,0.96);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255,182,217,0.08);
  display: flex; gap: 0; overflow-x: auto;
  scrollbar-width: none;
}
.hud::-webkit-scrollbar { display: none; }
.hud-item {
  flex: 1; min-width: 80px; padding: 0.6rem 0.8rem;
  display: flex; align-items: center; gap: 0.5rem;
  border-right: 1px solid rgba(255,255,255,0.04);
}
.hud-icon { font-size: 1rem; }
.hud-val  { font-size: 0.85rem; font-weight: 700; white-space: nowrap; }
.hud-lbl  { font-size: 0.55rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }

/* ---- XP badge ---- */
.xp-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 99px;
  background: rgba(255,182,217,0.08);
  border: 1px solid rgba(255,182,217,0.2);
  font-size: 0.72rem; font-weight: 700; color: var(--pink);
}
.xp-pill.gold { background: rgba(255,215,0,0.08); border-color: rgba(255,215,0,0.25); color: var(--gold); }

/* ---- Lock overlay ---- */
.lock-wrap { position: relative; overflow: hidden; }
.lock-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.75);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.4rem;
  backdrop-filter: blur(3px);
}
.lock-overlay .li { font-size: 1.4rem; }
.lock-overlay .lt { font-size: 0.68rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }

/* ---- Divider ---- */
.divider { height: 1px; background: rgba(255,182,217,0.07); margin: 1.25rem 0; }

/* ---- Status dot ---- */
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-green  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot-red    { background: var(--red); box-shadow: 0 0 6px var(--red); }
.dot-yellow { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
