@font-face {
  font-family: "Technicality";
  src: url("assets/font/technicality1.ttf") format("truetype");
  font-display: swap;
}

/* ---------------------------------------------------------------------------
   Gotchi design system — "soft kawaii premium"
   Palette is sampled from the logo: lavender-violet body, sakura pinks,
   one warm-gold accent for decisions. Grain + layered light = atmosphere,
   never a flat purple void.
--------------------------------------------------------------------------- */
:root {
  /* surfaces (cool violet night) */
  --bg-0: #160d2e;
  --bg-1: #1f1442;
  --surface: rgba(52, 38, 92, 0.66);
  --surface-2: rgba(64, 47, 110, 0.6);
  --line: rgba(168, 132, 246, 0.26);
  --line-strong: rgba(186, 150, 255, 0.42);

  /* brand hues (from logo) */
  --violet: #b79cff;
  --violet-deep: #7b53e6;
  --sakura: #ff9ad2;
  --sakura-soft: #ffd3ec;

  /* accent — warm gold creates focal tension against the violets */
  --gold: #ffd45e;
  --gold-deep: #f0b32f;

  /* feedback */
  --good: #6fe0b0;
  --warn: #ffc25e;
  --bad: #ff7a8f;

  /* ink */
  --ink: #f6eeff;
  --muted: #c3b3e6;
  --muted-2: #9c8bc8;

  /* radii (8 → 14 → 20 → 28, proportional) */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  /* elevation — shadows tinted from the palette, never pure black */
  --shadow-1: 0 6px 18px rgba(20, 9, 46, 0.4);
  --shadow-2: 0 18px 44px rgba(24, 10, 52, 0.5);
  --shadow-glow: 0 12px 30px rgba(150, 80, 220, 0.35);

  /* z-tokens (no raw z-index anywhere) */
  --z-base: 1;
  --z-dropdown: 100;
  --z-modal: 200;
  --z-toast: 300;
  --z-tooltip: 400;

  --site-header-h: 52px;
  --site-footer-h: 76px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg-0);
  color: var(--ink);
  font-family: "Nunito", ui-sans-serif, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* film grain overlay — 3% atmosphere over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-tooltip);
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#app {
  min-height: 100svh;
  padding-top: var(--site-header-h);
  padding-bottom: var(--site-footer-h);
}

/* ----- site header / footer + community chips ----- */
.site-header,
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  z-index: var(--z-dropdown);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-color: var(--line);
}

.site-header {
  top: 0;
  padding: 8px 14px max(8px, env(safe-area-inset-top));
  background:
    linear-gradient(180deg, rgba(31, 20, 66, 0.92), rgba(22, 13, 46, 0.82));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(20, 9, 46, 0.35);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 920px;
  margin: 0 auto;
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--violet);
  text-decoration: none;
  text-shadow: 0 0 18px rgba(183, 156, 255, 0.35);
  flex-shrink: 0;
}

.site-header__brand img {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 10px rgba(190, 95, 235, 0.45));
}

.site-footer {
  bottom: 0;
  padding: 10px 16px max(10px, env(safe-area-inset-bottom));
  background:
    radial-gradient(420px 80px at 50% 0%, rgba(255, 154, 210, 0.12), transparent 70%),
    linear-gradient(0deg, rgba(22, 13, 46, 0.94), rgba(31, 20, 66, 0.86));
  border-top: 1px solid var(--line-strong);
  text-align: center;
}

.site-footer__tag {
  margin: 0 0 8px;
  font-family: "Baloo 2", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.community-links {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.community-links--footer { justify-content: center; }

.community-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(52, 38, 92, 0.55), rgba(64, 47, 110, 0.38));
  font-family: "Baloo 2", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.08s var(--ease);
}

.community-chip:hover {
  color: var(--ink);
  transform: translateY(-1px);
}

.community-chip:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.community-chip__badge {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  flex-shrink: 0;
}

.community-chip__text { white-space: nowrap; }

.community-chip__mono {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.community-chip--x .community-chip__badge {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
}

.community-chip--x:hover {
  border-color: rgba(255, 154, 210, 0.55);
  background: linear-gradient(180deg, rgba(255, 154, 210, 0.16), rgba(52, 38, 92, 0.45));
  box-shadow: 0 0 22px rgba(255, 154, 210, 0.18);
}

.community-chip--ca {
  background: linear-gradient(180deg, rgba(255, 212, 94, 0.14), rgba(52, 38, 92, 0.4));
  border-color: rgba(240, 179, 47, 0.38);
}

.community-chip--ca .community-chip__badge {
  background: rgba(255, 212, 94, 0.22);
  color: var(--gold);
  border-radius: 6px;
}

.community-chip--ca:hover {
  border-color: rgba(240, 179, 47, 0.62);
  background: linear-gradient(180deg, rgba(255, 212, 94, 0.22), rgba(52, 38, 92, 0.42));
  box-shadow: 0 0 20px rgba(240, 179, 47, 0.16);
}

@media (max-width: 520px) {
  .site-header__brand span { display: none; }
  .community-chip__text { display: none; }
  .community-chip { padding: 5px 8px; }
  .community-chip--ca .community-chip__text { display: inline; font-size: 0.72rem; }
}

h1, h2, h3, .section-title, .panel-title, .stage-name {
  font-family: "Baloo 2", "Nunito", sans-serif;
  line-height: 1.15;
  letter-spacing: 0.1px;
}

.token { color: var(--gold); font-weight: 800; letter-spacing: 0.2px; }

.brand {
  font-family: "Technicality", "Baloo 2", sans-serif;
  color: var(--violet);
  text-shadow: 0 0 26px rgba(183, 156, 255, 0.45), 0 3px 0 rgba(20, 9, 46, 0.35);
}

/* ----- screens ----- */
.screen { display: none; min-height: 100svh; }
.screen.active { display: flex; }
.hidden { display: none !important; }

/* ====================================================================== */
/* Atmosphere / backdrop                                                  */
/* ====================================================================== */
.bg-decor { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-decor .glow { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.45; animation: drift 16s var(--ease) infinite; will-change: transform; }
.glow-1 { width: 320px; height: 320px; left: -70px; top: 6%; background: var(--violet); }
.glow-2 { width: 380px; height: 380px; right: -90px; top: 26%; background: var(--sakura); animation-delay: -5s; }
.glow-3 { width: 300px; height: 300px; left: 28%; bottom: -90px; background: var(--violet-deep); animation-delay: -9s; }
@keyframes drift { 50% { transform: translate3d(0, -30px, 0) scale(1.08); } }

.bg-decor .petal {
  position: absolute; top: -26px; width: 14px; height: 14px;
  background: linear-gradient(160deg, var(--sakura-soft), var(--sakura));
  border-radius: 80% 0 80% 0; opacity: 0.85;
  animation: fall linear infinite; will-change: transform;
}
.petal-1 { left: 12%; width: 13px; height: 13px; animation-duration: 10s; animation-delay: 0s; }
.petal-2 { left: 27%; width: 10px; height: 10px; animation-duration: 13s; animation-delay: -3s; }
.petal-3 { left: 47%; width: 16px; height: 16px; animation-duration: 11s; animation-delay: -6s; }
.petal-4 { left: 66%; width: 12px; height: 12px; animation-duration: 14s; animation-delay: -2s; }
.petal-5 { left: 82%; width: 9px;  height: 9px;  animation-duration: 12s; animation-delay: -7s; }
.petal-6 { left: 92%; width: 14px; height: 14px; animation-duration: 15s; animation-delay: -5s; }
@keyframes fall {
  0%   { transform: translateY(-30px) rotate(0deg);   opacity: 0; }
  12%  { opacity: 0.85; }
  100% { transform: translateY(108svh) rotate(560deg); opacity: 0.85; }
}

#screen-entry, #screen-earn, #screen-game {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 540px at 50% -8%, rgba(255, 154, 210, 0.2), transparent 60%),
    radial-gradient(740px 640px at 90% 114%, rgba(146, 110, 246, 0.3), transparent 60%),
    radial-gradient(760px 600px at 6% 102%, rgba(255, 138, 198, 0.16), transparent 55%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
}
.bg-decor--game .watermark {
  position: absolute; right: -8%; top: 50%; transform: translateY(-50%) rotate(-6deg);
  width: min(62vw, 460px); image-rendering: pixelated; opacity: 0.05; filter: saturate(1.2);
}

@media (prefers-reduced-motion: reduce) {
  .bg-decor .glow, .bg-decor .petal, .logo, .pet-frame img, .dot { animation: none !important; }
}

/* ====================================================================== */
/* Buttons                                                                */
/* ====================================================================== */
.btn {
  --bg: var(--surface-2);
  cursor: pointer; border: 1px solid var(--line); border-radius: var(--r-md);
  min-height: 48px; padding: 12px 20px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: "Baloo 2", sans-serif; font-size: 1rem; font-weight: 700; color: var(--ink);
  background: var(--bg);
  transition: transform 0.08s var(--ease), filter 0.18s var(--ease), box-shadow 0.18s var(--ease), opacity 0.18s var(--ease);
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn[disabled] { opacity: 0.42; cursor: not-allowed; filter: grayscale(0.3); transform: none; box-shadow: none; }
.btn.is-loading { color: transparent; pointer-events: none; position: relative; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-primary {
  background: linear-gradient(180deg, #9a72ff, #6f3fe0);
  border-color: rgba(186, 150, 255, 0.6);
  box-shadow: var(--shadow-glow);
}
.btn-ghost { background: rgba(255, 255, 255, 0.04); }
.btn-gold {
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  color: #3a2900; border-color: #ffe49a; font-weight: 800;
  box-shadow: 0 10px 24px rgba(240, 179, 47, 0.3);
}
.btn-tiny { min-height: 40px; padding: 8px 14px; font-size: 0.85rem; border-radius: var(--r-sm); }

.link-btn {
  background: none; border: none; color: var(--gold); cursor: pointer;
  font-family: "Baloo 2", sans-serif; font-size: 0.95rem; font-weight: 600; padding: 8px; margin-top: 4px;
  border-radius: var(--r-sm);
}
.link-btn:hover { text-decoration: underline; }
.link-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.back-link {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-family: "Baloo 2", sans-serif; font-weight: 600; padding: 6px 2px; margin-bottom: 6px;
}
.back-link:hover { color: var(--ink); }

/* ====================================================================== */
/* Entry                                                                  */
/* ====================================================================== */
#screen-entry { align-items: center; justify-content: center; padding: 28px 16px; }
.entry-card {
  position: relative; z-index: var(--z-base);
  width: min(420px, 100%);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--line-strong); border-radius: var(--r-xl);
  padding: 30px 26px 26px; text-align: center; box-shadow: var(--shadow-2);
}
.logo {
  width: 168px; height: auto; image-rendering: pixelated; display: block; margin: 0 auto 4px;
  filter: drop-shadow(0 12px 24px rgba(190, 95, 235, 0.5));
  animation: bob 3.4s var(--ease) infinite; will-change: transform;
}
@keyframes bob { 50% { transform: translateY(-9px); } }
.brand { font-size: clamp(2.6rem, 9vw, 3.4rem); margin: 2px 0 0; }
.tagline { color: var(--muted); margin: 4px 0 12px; font-size: 1.05rem; }
.btn-claim-gotchi { width: 100%; margin: 0 0 18px; }
.entry-actions { display: grid; gap: 11px; }
.entry-note { color: var(--muted-2); font-size: 0.82rem; line-height: 1.5; margin: 16px 6px 4px; text-wrap: balance; }

/* ====================================================================== */
/* Panels (shared glass surface)                                          */
/* ====================================================================== */
.panel {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.section-title { font-size: 1.5rem; font-weight: 800; margin: 2px 0 2px; }
.sub { color: var(--muted); margin: 0 0 14px; font-size: 0.95rem; }
.panel-title { font-size: 1.05rem; font-weight: 700; margin: 0; color: var(--ink); }

/* ----- How to earn ----- */
#screen-earn { align-items: center; justify-content: center; padding: 28px 16px; }
.earn-card { position: relative; z-index: var(--z-base); width: min(540px, 100%); padding: 22px 22px 24px; }
.earn-steps { margin: 6px 0 16px; padding-left: 1.1rem; }
.earn-steps li { margin: 7px 0; color: var(--ink); }
.earn-steps li::marker { color: var(--gold); font-weight: 800; }
.tiers { width: 100%; border-collapse: separate; border-spacing: 0; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); }
.tiers th, .tiers td { padding: 9px 12px; text-align: left; font-size: 0.92rem; border-bottom: 1px solid var(--line); }
.tiers th { background: rgba(255, 255, 255, 0.05); color: var(--gold); font-family: "Baloo 2", sans-serif; }
.tiers tr:last-child td { border-bottom: none; }
.tiers td:last-child { font-weight: 700; }
.fineprint, .field-error { font-size: 0.8rem; color: var(--muted-2); margin: 12px 0 0; }

/* ====================================================================== */
/* Game — topbar                                                          */
/* ====================================================================== */
#screen-game { flex-direction: column; align-items: stretch; padding: 0; }
.topbar {
  position: sticky; top: var(--site-header-h); z-index: calc(var(--z-dropdown) - 1);
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: rgba(22, 13, 46, 0.72); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.brand-sm { display: inline-flex; align-items: center; font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 1.15rem; color: var(--violet); margin-right: auto; }
.brand-logo { width: 26px; height: 26px; image-rendering: pixelated; margin-right: 7px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05); font-size: 0.85rem; color: var(--muted);
  max-width: 100%; min-width: 0;
}
.chip b { color: var(--ink); }
.chip-token { background: rgba(255, 212, 94, 0.12); border-color: rgba(240, 179, 47, 0.4); gap: 8px; }
.chip-claim-gotchi {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  border: 1px solid #ffe49a;
  color: #3a2900;
  font-family: "Baloo 2", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(240, 179, 47, 0.25);
  transition: filter 0.15s var(--ease), transform 0.08s var(--ease);
}
.chip-claim-gotchi:hover { filter: brightness(1.06); transform: translateY(-1px); }
.chip-claim-gotchi:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.chip-name { cursor: pointer; color: var(--ink); font-weight: 700; font-family: "Baloo 2", sans-serif; }
.chip-name:hover { border-color: var(--line-strong); }
.chip-name:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.chip-name #profile-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28vw; }
.edit-pen { opacity: 0.6; font-size: 0.8rem; }
.chip-wallet { font-variant-numeric: tabular-nums; }

.guest-banner {
  text-align: center; padding: 7px 12px; font-size: 0.82rem; color: #ffd7ea;
  background: rgba(255, 122, 143, 0.16); border-bottom: 1px solid var(--line);
}

/* ----- game layout ----- */
.game-main {
  position: relative; z-index: var(--z-base);
  width: min(860px, 100%); margin: 0 auto; padding: 16px 14px 40px;
  display: grid; gap: 14px;
}
@media (min-width: 760px) {
  .game-main { grid-template-columns: 1.1fr 1fr; align-items: start; }
  .pet-stage { grid-column: 1 / -1; }
  .actions { grid-column: 1 / -1; }
}

/* ----- pet stage ----- */
.pet-stage {
  display: flex; align-items: center; gap: 18px; padding: 20px;
  background:
    radial-gradient(420px 200px at 30% 0%, rgba(255, 154, 210, 0.14), transparent 70%),
    linear-gradient(180deg, var(--surface), var(--surface-2));
}
.pet-frame {
  flex: 0 0 auto; width: 132px; height: 132px;
  display: grid; place-items: center; border-radius: var(--r-lg);
  background: radial-gradient(circle at 50% 38%, rgba(183, 156, 255, 0.22), rgba(255,255,255,0.02) 70%);
  border: 1px solid var(--line);
}
.pet-frame img { width: 104px; image-rendering: pixelated; animation: bob 1.4s var(--ease) infinite; }
.stage-meta { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 1; }

/* signature: conic level ring */
.ring {
  --pct: 0;
  flex: 0 0 auto; width: 74px; height: 74px; border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--pct) * 1%), rgba(255, 255, 255, 0.1) 0);
  display: grid; place-items: center;
  transition: background 0.5s var(--ease);
  box-shadow: 0 0 0 1px var(--line) inset;
}
.ring__core {
  width: 58px; height: 58px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #3a2a66, #241646);
  display: grid; place-items: center; line-height: 1;
  border: 1px solid var(--line);
}
.ring__core b { font-family: "Baloo 2", sans-serif; font-size: 1.4rem; font-weight: 800; color: var(--gold); }
.ring__core span { font-size: 0.55rem; letter-spacing: 1.5px; color: var(--muted-2); }
.stage-text { min-width: 0; }
.stage-name { font-size: 1.35rem; font-weight: 800; color: var(--ink); }
.stage-blurb { font-size: 0.85rem; color: var(--muted); margin-top: 1px; text-wrap: balance; }
.stage-mood { font-size: 0.82rem; color: var(--muted-2); margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px currentColor; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }

/* ----- vitals ----- */
.vitals { padding: 16px 18px; display: grid; gap: 12px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.bond-mult { font-size: 0.8rem; font-weight: 700; color: var(--gold); font-family: "Baloo 2", sans-serif; }
.stat { display: grid; grid-template-columns: 26px 1fr; align-items: center; gap: 11px; min-width: 0; }
.stat-ic { width: 22px; height: 22px; image-rendering: pixelated; justify-self: center; }
.stat-ic--emoji { font-size: 18px; text-align: center; }
.stat-main { min-width: 0; }
.stat-top { display: flex; justify-content: space-between; font-size: 0.8rem; margin-bottom: 4px; }
.stat-name { color: var(--muted); }
.stat-val { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.bar { height: 10px; border-radius: 999px; background: rgba(13, 8, 30, 0.6); overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; width: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--good), #45c98e); transition: width 0.45s var(--ease), background 0.3s; }
.bar.mid > i { background: linear-gradient(90deg, var(--warn), #f0a93a); }
.bar.low > i { background: linear-gradient(90deg, var(--bad), #e8556e); }
.bar--bond > i { background: linear-gradient(90deg, var(--sakura-soft), var(--sakura)); }

/* ----- earn panel ----- */
.earn-panel { padding: 16px 18px; }
.earn-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.earn-info { min-width: 0; }
.earn-line { font-size: 1.05rem; font-family: "Baloo 2", sans-serif; font-weight: 700; }
.earn-line b { color: var(--gold); }
.earn-line.muted { font-size: 0.82rem; color: var(--muted); font-weight: 600; font-family: "Nunito", sans-serif; }
#btn-claim { min-width: 116px; }

/* ----- actions ----- */
.actions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; }
.act {
  flex-direction: column; gap: 4px; min-height: 72px; padding: 10px 6px;
  background: linear-gradient(180deg, rgba(120, 92, 224, 0.55), rgba(94, 64, 184, 0.5));
  border-color: var(--line-strong); font-size: 0.82rem; min-width: 0;
}
.act .act-i { font-size: 1.25rem; line-height: 1; }
.act--play { background: linear-gradient(180deg, rgba(255, 154, 210, 0.5), rgba(240, 120, 185, 0.45)); border-color: rgba(255, 154, 210, 0.55); }
.act--ghost { background: rgba(255, 255, 255, 0.05); }
@media (max-width: 560px) { .actions { grid-template-columns: repeat(3, 1fr); } }

/* ====================================================================== */
/* Overlays — name modal + minigame                                       */
/* ====================================================================== */
.overlay {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  background: rgba(11, 5, 26, 0.7); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.modal-card { width: min(400px, 100%); padding: 26px 24px; text-align: center; }
.modal-logo { width: 84px; image-rendering: pixelated; margin: 0 auto 6px; display: block; filter: drop-shadow(0 8px 16px rgba(190, 95, 235, 0.45)); }
#name-form { display: grid; gap: 12px; margin-top: 6px; }
#name-input {
  width: 100%; min-width: 0; min-height: 50px; padding: 12px 16px;
  border-radius: var(--r-md); border: 1px solid var(--line-strong);
  background: rgba(13, 8, 30, 0.55); color: var(--ink);
  font-family: "Baloo 2", sans-serif; font-size: 1.05rem; text-align: center;
}
#name-input::placeholder { color: var(--muted-2); }
#name-input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-color: var(--gold); }
.field-error { color: var(--bad); margin: 0; text-align: center; }

.mg-card { width: min(700px, 100%); padding: 16px; }
.mg-hud { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; font-size: 0.9rem; flex-wrap: wrap; }
.mg-hud b { color: var(--ink); font-family: "Baloo 2", sans-serif; }
.mg-earn { color: var(--gold); }
.mg-earn b { color: var(--gold); }
.mg-hud .btn-tiny { margin-left: auto; }
#mg-canvas { width: 100%; height: auto; display: block; border-radius: var(--r-md); background: linear-gradient(180deg, #6fb3ff, #3b7fe0); touch-action: none; box-shadow: var(--shadow-1); }
.mg-hint { text-align: center; color: var(--muted); font-size: 0.82rem; margin: 9px 0 0; }

/* ====================================================================== */
/* Toast                                                                  */
/* ====================================================================== */
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: var(--z-toast); max-width: calc(100vw - 32px);
  padding: 12px 20px; border-radius: 999px; font-family: "Baloo 2", sans-serif; font-weight: 700;
  background: linear-gradient(180deg, #2a1850, #1c0f3a); color: var(--gold);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-2);
  animation: toast-in 0.32s var(--ease);
}
@keyframes toast-in { from { transform: translate(-50%, 14px); opacity: 0; } }
