/* Sore Losers — shared look: deep grape, sunny yellow, mint, coral, sky blue, chunky rounded type. */
:root {
  --grape: #3D1C8F;
  --grape-deep: #2B1464;
  --grape-mid: #4E27AE;
  --grape-light: #6A43CF;
  --yellow: #FFC93C;
  --mint: #1FC7A4;
  --coral: #FF7A7A;
  --sky: #6FC3FF;
  --pink: #FF8FC0;
  --white: #FFFFFF;
  --cream: #FFF8EC;
  --ink: #2B1464;
  --muted: #BFAEF0;
  --gold: #FFC93C;
  --silver: #D9DEEA;
  --bronze: #E89A5B;
  --head: "Baloo 2", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 22px;
  --shadow: 0 6px 0 rgba(20, 5, 60, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--grape);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(111, 195, 255, 0.18), transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(255, 122, 122, 0.16), transparent 42%),
    radial-gradient(rgba(255, 255, 255, 0.06) 1.5px, transparent 1.6px);
  background-size: auto, auto, 26px 26px;
  background-attachment: fixed;
  color: var(--white);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, .head { font-family: var(--head); font-weight: 800; line-height: 1.05; margin: 0; letter-spacing: 0.2px; }
button, input, select, textarea { font: inherit; color: inherit; }

.logo { font-family: var(--head); font-weight: 800; color: var(--yellow); text-shadow: 0 4px 0 var(--grape-deep); letter-spacing: 0.5px; }
.logo b { color: var(--coral); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45em;
  border: 0; border-radius: 999px; cursor: pointer;
  padding: 0.8em 1.4em; min-height: 52px;
  font-family: var(--head); font-weight: 800; font-size: 1.15rem; line-height: 1;
  background: var(--yellow); color: var(--ink);
  box-shadow: 0 5px 0 #C98F00;
  transition: transform 0.08s, box-shadow 0.08s, opacity 0.2s;
  user-select: none; -webkit-user-select: none;
  text-decoration: none;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #C98F00; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn.mint { background: var(--mint); color: #062F27; box-shadow: 0 5px 0 #11866D; }
.btn.mint:active { box-shadow: 0 1px 0 #11866D; }
.btn.coral { background: var(--coral); color: #3A0808; box-shadow: 0 5px 0 #C24848; }
.btn.coral:active { box-shadow: 0 1px 0 #C24848; }
.btn.sky { background: var(--sky); color: #06263D; box-shadow: 0 5px 0 #3A8FC7; }
.btn.sky:active { box-shadow: 0 1px 0 #3A8FC7; }
.btn.ghost { background: rgba(255, 255, 255, 0.12); color: var(--white); box-shadow: 0 5px 0 rgba(0, 0, 0, 0.25); }
.btn.ghost:active { box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); }
.btn.small { min-height: 40px; font-size: 0.95rem; padding: 0.55em 1em; }
.btn.block { width: 100%; }
.btn.big { font-size: 1.45rem; min-height: 64px; }

.card {
  background: var(--cream); color: var(--ink);
  border-radius: var(--r); box-shadow: var(--shadow);
  padding: 18px;
}
.panel { background: rgba(255, 255, 255, 0.1); border-radius: var(--r); padding: 16px; }

/* Avatars */
.av { display: inline-block; width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%; line-height: 0; }
.av svg { width: 100%; height: 100%; display: block; }
.av.xs { width: 26px; height: 26px; }
.av.sm { width: 34px; height: 34px; }
.av.lg { width: 72px; height: 72px; }
.av.xl { width: 110px; height: 110px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14); font-weight: 700; font-size: 0.95rem; cursor: pointer; border: 2px solid transparent;
  user-select: none; -webkit-user-select: none;
}
.chip.on { background: var(--yellow); color: var(--ink); }

.medal { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; font-family: var(--head); font-weight: 800; color: var(--ink); font-size: 0.9em; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18); }
.medal.gold { background: var(--gold); }
.medal.silver { background: var(--silver); }
.medal.bronze { background: var(--bronze); }

.muted { color: var(--muted); }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; }
.hidden { display: none !important; }

/* Toasts */
#toasts { position: fixed; left: 0; right: 0; top: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 9999; pointer-events: none; }
.toast { background: var(--grape-deep); color: var(--white); font-weight: 800; padding: 10px 18px; border-radius: 999px; box-shadow: var(--shadow); animation: toastIn 0.25s; transition: opacity 0.4s, transform 0.4s; max-width: 90vw; text-align: center; }
.toast.good { background: var(--mint); color: #062F27; }
.toast.bad { background: var(--coral); color: #3A0808; }
.toast.warn { background: var(--yellow); color: var(--ink); }
.toast.out { opacity: 0; transform: translateY(-10px); }
@keyframes toastIn { from { transform: translateY(-14px) scale(0.9); opacity: 0; } }

@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes spinIn { from { transform: rotate(-12deg) scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.shake { animation: shake 0.4s; }
.pop { animation: pop 0.35s both; }

.offline-badge { position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); background: var(--coral); color: #3A0808; font-weight: 800; padding: 8px 16px; border-radius: 999px; z-index: 9998; box-shadow: var(--shadow); }
