/* Telegram's own theme (`--tg-theme-*`, set by telegram-web-app.js), so the game
   looks like the client it is opened in, light or dark. Fallbacks are for the
   first paint before the script has run. */
:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #000000);
  --hint: var(--tg-theme-hint-color, #8e8e93);
  --accent: var(--tg-theme-button-color, #2481cc);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --panel: var(--tg-theme-secondary-bg-color, #f2f2f7);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Bengali", sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

main {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 32px 16px calc(24px + env(safe-area-inset-bottom));
}

.score { text-align: center; }
.label { margin: 0; color: var(--hint); font-size: 14px; }
.points { margin: 4px 0 0; font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; }

.tap {
  position: relative;
  width: min(68vw, 280px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe08a, #f5b301 60%, #c98a00);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2), inset 0 -8px 0 rgba(0, 0, 0, 0.12);
  touch-action: none;
  cursor: pointer;
  transition: transform 80ms ease-out;
}
.tap:active { transform: scale(0.96); }
.tap:disabled { filter: grayscale(0.8); opacity: 0.6; }
.coin { font-size: min(30vw, 120px); font-weight: 800; color: #7a5200; }

.plus {
  position: fixed;
  pointer-events: none;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  animation: rise 700ms ease-out forwards;
}
@keyframes rise {
  to { transform: translateY(-80px); opacity: 0; }
}

.energy { width: 100%; max-width: 420px; }
.energy-row { display: flex; justify-content: space-between; color: var(--hint); font-size: 14px; }
.bar { height: 10px; margin-top: 6px; border-radius: 5px; background: var(--panel); overflow: hidden; }
#energy-bar { height: 100%; width: 0; background: var(--accent); transition: width 200ms linear; }

.invite {
  width: 100%;
  max-width: 420px;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
}

.note, .status { margin: 0; max-width: 420px; text-align: center; color: var(--hint); font-size: 13px; }
.status:empty { display: none; }

.outside { justify-content: center; text-align: center; color: var(--hint); }

@media (prefers-reduced-motion: reduce) {
  .tap, #energy-bar { transition: none; }
  .plus { display: none; }
}
