:root {
  color-scheme: dark;
  --bg: #0f1115;
  --card: #191c24;
  --accent: #f7c948;
  --accent2: #6c5ce7;
  --text: #eef1f6;
  --muted: #8a90a2;
  --ok: #21c07a;
  --danger: #e05656;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  user-select: none;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 480px;
  margin: 0 auto;
}

/* Топбар */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
}
.balance {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 26px;
  font-weight: 800;
}
.coin-icon { font-size: 24px; }
.level {
  background: var(--card);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  color: var(--muted);
}
.level span { color: var(--accent); font-weight: 700; }

/* Табы */
.tabs {
  display: flex;
  gap: 6px;
  padding: 0 12px 10px;
}
.tab {
  flex: 1;
  background: var(--card);
  border: none;
  color: var(--muted);
  padding: 10px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.tab.active { background: var(--accent2); color: #fff; }

/* Экраны */
.screen { display: none; flex: 1; padding: 12px 18px; overflow-y: auto; }
.screen.active { display: flex; flex-direction: column; }

/* Энергия */
.energy-wrap { margin-bottom: 8px; }
.energy-bar {
  height: 10px;
  background: var(--card);
  border-radius: 6px;
  overflow: hidden;
}
#energy-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f7c948, #f79948);
  transition: width .2s;
}
.energy-text { text-align: center; margin-top: 6px; color: var(--muted); font-size: 14px; }

/* Кнопка-монета */
.coin-zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.coin-btn {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 35% 30%, #ffe08a, #f7c948 55%, #d9a520);
  box-shadow: 0 12px 40px rgba(247, 201, 72, .35), inset 0 -8px 20px rgba(0,0,0,.2);
  cursor: pointer;
  transition: transform .06s;
}
.coin-btn:active { transform: scale(.95); }
.coin-emoji { font-size: 110px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.3)); }
.per-tap { color: var(--muted); font-size: 16px; }
.per-tap span { color: var(--accent); font-weight: 700; }

/* Летящие +N */
.float-num {
  position: fixed;
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  pointer-events: none;
  animation: floatUp .8s ease-out forwards;
  z-index: 50;
}
@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-80px); }
}

/* Кнопка рекламы */
.ad-btn {
  background: var(--accent2);
  color: #fff;
  border: none;
  padding: 16px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
}
.ad-btn:disabled { opacity: .5; }

/* Магазин */
h2 { margin-bottom: 14px; font-size: 20px; }
h3 { margin: 18px 0 10px; font-size: 17px; }
.upgrade {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
  padding: 16px;
  border-radius: 14px;
  margin-bottom: 10px;
}
.up-info { display: flex; flex-direction: column; gap: 3px; }
.up-info b { font-size: 16px; }
.up-info span { font-size: 13px; color: var(--muted); }
.buy-btn, .copy-btn {
  background: var(--accent);
  color: #1a1a1a;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
}
.buy-btn:disabled { opacity: .45; cursor: not-allowed; }

/* VPN */
.hint { color: var(--muted); margin-bottom: 14px; font-size: 14px; }
.hint span { color: var(--accent); font-weight: 700; }
.server-card {
  background: var(--card);
  padding: 16px;
  border-radius: 14px;
  margin-bottom: 10px;
}
.server-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.server-name { font-weight: 700; font-size: 16px; }
.locked-badge { font-size: 12px; color: var(--danger); }
.unlocked-badge { font-size: 12px; color: var(--ok); }
/* Выбор дней VPN */
.days-picker { display: flex; flex-direction: column; gap: 10px; }
.quick-days { display: flex; gap: 8px; }
.quick-btn {
  flex: 1;
  background: #22252f;
  color: var(--text);
  border: 1px solid #2c303c;
  padding: 10px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}
.quick-btn:disabled { opacity: .4; }
.days-control { display: flex; align-items: center; gap: 8px; }
.step-btn {
  width: 42px;
  height: 42px;
  background: #22252f;
  color: var(--text);
  border: 1px solid #2c303c;
  border-radius: 10px;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
}
.step-btn:disabled { opacity: .4; }
.days-input {
  flex: 1;
  text-align: center;
  background: #0d0f14;
  color: var(--text);
  border: 1px solid #2c303c;
  border-radius: 10px;
  padding: 10px;
  font-size: 18px;
  font-weight: 700;
  -moz-appearance: textfield;
}
.days-input::-webkit-outer-spin-button,
.days-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.days-label { color: var(--muted); font-size: 14px; }
.buy-vpn-btn {
  background: var(--accent);
  color: #1a1a1a;
  border: none;
  padding: 13px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.buy-vpn-btn:disabled { opacity: .45; cursor: not-allowed; }
.buy-vpn-btn b { font-weight: 800; }
.my-subs { color: var(--muted); font-size: 14px; }
.sub-item { background: var(--card); padding: 12px 14px; border-radius: 10px; margin-bottom: 8px; color: var(--text); }
.sub-item .active-dot { color: var(--ok); }
.sub-item .expired-dot { color: var(--danger); }

.vpn-result { margin-top: 16px; background: var(--card); padding: 14px; border-radius: 14px; }
.vpn-result textarea {
  width: 100%;
  height: 80px;
  background: #0d0f14;
  color: var(--text);
  border: 1px solid #2c303c;
  border-radius: 8px;
  padding: 8px;
  font-size: 12px;
  margin: 8px 0;
  resize: none;
}

/* Тост */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #2c303c;
  color: #fff;
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 100;
  transition: opacity .3s;
}
.hidden { display: none; }
