/* Bug Bash 2 stats dashboard — reuses the game's visual language. */
:root {
  --wood: #14100a;
  --wood-2: #1c150c;
  --cream: #ffe9b3;
  --amber: #ffc93c;
  --amber-deep: #e89c0c;
  --green: #94d94e;
  --green-deep: #5dab22;
  --red: #ff6f61;
  --parch: rgba(18, 12, 5, .82);
  --parch-edge: rgba(255, 201, 60, .18);
  --text: #f5e7c8;
  --muted: rgba(245, 231, 200, .55);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { min-height: 100%; }
body {
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255, 201, 60, .12), transparent 60%),
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px) 0 0 / 100% 38px,
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px) 0 0 / 38px 100%,
    var(--wood);
  color: var(--text);
  font-family: "Nunito", "Trebuchet MS", "Segoe UI", sans-serif;
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .btn, .logo, .card-num, .live-num { font-family: "Fredoka", "Trebuchet MS", sans-serif; }
.hidden { display: none !important; }
.dim { color: var(--muted); font-weight: 600; }

/* ---------- logo wordmark (from the game title) ---------- */
.logo {
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  letter-spacing: 1px;
  color: var(--cream);
  line-height: 1;
}
.logo .logo-accent { color: #f3c11d; text-shadow: 0 4px 0 #7a5a05, 0 8px 16px rgba(0,0,0,.6); }
.logo .logo-two { color: var(--red); text-shadow: 0 4px 0 #7a241c, 0 8px 16px rgba(0,0,0,.6); }
.logo.small { font-size: clamp(1.3rem, 3.6vw, 1.7rem); }
.logo .tag {
  font-size: .5em; letter-spacing: 3px; color: var(--amber);
  vertical-align: middle; margin-left: 6px; text-shadow: none;
}

/* Blue+orange BB2 wordmark image — same as the promo site */
.logo-img { width: min(260px, 64vw); height: auto; display: block; margin: 0 auto 2px; filter: drop-shadow(0 6px 16px rgba(0,0,0,.5)); }
.brand { display: flex; align-items: center; gap: 12px; margin: 0; }
.logo-img.small { width: auto; height: 50px; margin: 0; }
.brand .tag { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: .82rem; letter-spacing: 3px; color: var(--amber); }

/* ---------- panels ---------- */
.panel {
  background: var(--parch);
  border: 1px solid var(--parch-edge);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
}

/* ---------- buttons (candy) ---------- */
.btn {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: .5px;
  color: #4a2c06;
  background: linear-gradient(180deg, #ffe793 0%, #ffc93c 48%, #f0a818 52%, #e89c0c 100%);
  border: none;
  border-radius: 14px;
  padding: 13px 30px;
  cursor: pointer;
  position: relative;
  box-shadow: 0 5px 0 #a9710a, 0 9px 16px rgba(0,0,0,.4);
  transition: transform .12s ease, filter .12s ease;
}
.btn::before {
  content: ''; position: absolute; inset: 2px 2px auto 2px; height: 42%;
  border-radius: 12px 12px 50% 50%;
  background: linear-gradient(rgba(255,255,255,.55), rgba(255,255,255,0));
  pointer-events: none;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #a9710a, 0 4px 8px rgba(0,0,0,.4); }
.btn-big {
  font-size: 1.25rem; padding: 15px 44px; color: #1d3c0a;
  background: linear-gradient(180deg, #d2f59a 0%, #94d94e 48%, #6fbe2e 52%, #5dab22 100%);
  box-shadow: 0 5px 0 #3f7d17, 0 9px 16px rgba(0,0,0,.4);
}
.btn-big:active { box-shadow: 0 2px 0 #3f7d17, 0 4px 8px rgba(0,0,0,.4); }
.btn-small { font-size: .85rem; padding: 8px 18px; box-shadow: 0 4px 0 #a9710a, 0 6px 12px rgba(0,0,0,.4); }

/* ---------- screens ---------- */
.screen { min-height: 100vh; }
body.booting .screen { display: none; } /* avoid a login flash before auth check */
#login { display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-panel { padding: 40px 36px; text-align: center; width: min(380px, 92vw); }
.login-panel .subtitle { color: var(--amber); letter-spacing: 2px; text-transform: uppercase; font-size: .8rem; margin: 4px 0 26px; }
#login-form { display: flex; flex-direction: column; gap: 16px; }
#password {
  font-family: "Nunito", sans-serif; font-weight: 700; font-size: 1.05rem;
  text-align: center; color: var(--text);
  background: rgba(0,0,0,.35); border: 1px solid var(--parch-edge);
  border-radius: 12px; padding: 13px 16px; outline: none;
}
#password:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255,201,60,.18); }
.error { color: var(--red); font-weight: 700; margin-top: 14px; }

/* ---------- dashboard ---------- */
#dash { max-width: 980px; margin: 0 auto; padding: 22px clamp(14px, 4vw, 30px) 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.updated { color: var(--muted); font-size: .82rem; }

.live-wrap { text-align: center; padding: 30px 20px 26px; margin-bottom: 22px; position: relative; }
.live-num { font-size: clamp(3.6rem, 13vw, 6rem); font-weight: 700; color: var(--green); line-height: 1; text-shadow: 0 0 26px rgba(148,217,78,.45); }
.live-label { color: var(--muted); letter-spacing: 2px; text-transform: uppercase; font-size: .82rem; margin-top: 6px; }
.live-dot {
  width: 13px; height: 13px; border-radius: 50%; background: var(--green);
  display: inline-block; margin-bottom: 10px; box-shadow: 0 0 0 0 rgba(148,217,78,.7);
  animation: livePulse 1.8s ease-out infinite;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(148,217,78,.6); }
  70% { box-shadow: 0 0 0 16px rgba(148,217,78,0); }
  100% { box-shadow: 0 0 0 0 rgba(148,217,78,0); }
}

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.card {
  background: var(--parch); border: 1px solid var(--parch-edge); border-radius: 16px;
  padding: 20px 16px; text-align: center;
}
.card.muted { opacity: .72; }
.card-num { font-size: clamp(1.8rem, 5vw, 2.5rem); font-weight: 700; color: var(--amber); line-height: 1.1; }
.card-label { color: var(--muted); font-size: .85rem; font-weight: 700; margin-top: 4px; }
.cards-note { color: var(--muted); font-size: .8rem; text-align: center; margin: 12px 0 26px; }

.countries-panel { padding: 24px clamp(16px, 3vw, 28px); }
.section-title { font-size: 1.25rem; font-weight: 600; color: var(--cream); margin-bottom: 16px; }
.countries { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.country { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 14px; }
.country .flag {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.14); object-fit: cover; background: #0c0a06;
}
.country .cinfo { min-width: 0; }
.country .cname { font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.country .bar { height: 7px; border-radius: 5px; margin-top: 6px; background: linear-gradient(90deg, var(--amber), var(--green)); min-width: 4px; }
.country .ccount { font-family: "Fredoka", sans-serif; font-weight: 600; color: var(--amber); }

@media (max-width: 520px) {
  .topbar { justify-content: center; text-align: center; }
}
