:root {
  --bg: var(--tg-theme-bg-color, #0f1115);
  --text: var(--tg-theme-text-color, #ffffff);
  --hint: var(--tg-theme-hint-color, #8b8f97);
  --button: var(--tg-theme-button-color, #f7b500);
  --button-text: var(--tg-theme-button-text-color, #0f1115);
  --secondary-bg: var(--tg-theme-secondary-bg-color, #1a1d24);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100vh;
  padding: 16px 16px 28px;
}

#status-banner {
  width: 100%;
  text-align: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--secondary-bg);
  color: var(--text);
  font-size: 14px;
  margin-bottom: 8px;
}

.hidden {
  display: none !important;
}

.top-stats {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}

.coin-total {
  font-size: 40px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.coin-icon {
  font-size: 32px;
}

.som-value {
  color: var(--hint);
  font-size: 14px;
}

.streak {
  color: var(--hint);
  font-size: 13px;
  margin-top: 2px;
}

.tap-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tap-btn {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 35% 30%, #ffe27a, var(--button) 70%);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.35), 0 12px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.06s ease;
  touch-action: manipulation;
}

.tap-btn:active,
.tap-btn.pressed {
  transform: translateY(6px) scale(0.97);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 6px 14px rgba(0, 0, 0, 0.3);
}

.tap-btn.disabled {
  filter: grayscale(1) brightness(0.6);
  cursor: default;
}

.tap-btn-emoji {
  font-size: 92px;
  pointer-events: none;
}

.float-coin {
  position: fixed;
  font-weight: 800;
  font-size: 20px;
  color: var(--button);
  pointer-events: none;
  animation: float-up 0.7s ease-out forwards;
  z-index: 50;
}

@keyframes float-up {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-60px);
  }
}

.energy-wrap {
  width: 100%;
  max-width: 320px;
}

.energy-label {
  display: flex;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  color: var(--hint);
  margin-bottom: 6px;
}

.energy-bar-track {
  width: 100%;
  height: 10px;
  border-radius: 6px;
  background: var(--secondary-bg);
  overflow: hidden;
}

.energy-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffd15c, var(--button));
  transition: width 0.2s ease;
}
