/* ══════════════════════════════════════════
   TuntunCoin — стили
   Тёмная тема, оранжево-жёлтые акценты
══════════════════════════════════════════ */

:root {
  --bg: #0e0e12;
  --bg-2: #1a1a24;
  --card: #23232e;
  --card-hover: #2a2a38;
  --accent: #ffb800;
  --accent-2: #ff7a00;
  --text: #ffffff;
  --text-dim: #8e8e9a;
  --success: #38d16b;
  --danger: #ff4d4d;
  --border: rgba(255,255,255,0.06);
  --header-h: 64px;
  --nav-h: 72px;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  user-select: none;
  -webkit-user-select: none;
}

body {
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 0%, #1e1a2e 0%, var(--bg) 60%);
}

/* ══════════ ШАПКА ══════════ */
.header {
  height: var(--header-h);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding-top: calc(8px + env(safe-area-inset-top));
  height: calc(var(--header-h) + env(safe-area-inset-top));
}

.user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--accent);
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.username {
  font-weight: 600;
  font-size: 15px;
}

.level {
  font-size: 11px;
  color: var(--text-dim);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background: var(--card);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s;
}

.icon-btn:active {
  background: var(--card-hover);
  transform: scale(0.95);
}

/* ══════════ ЭКРАНЫ ══════════ */
.screen {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 24px;
  padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

.screen-title {
  font-size: 24px;
  font-weight: 700;
  margin: 16px 0 20px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 24px 0 12px;
}

/* ══════════ ЭКРАН TAP ══════════ */
#screen-tap {
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
}

.balance-box {
  text-align: center;
  margin-top: 12px;
}

.balance {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: transform 0.1s;
}

.balance.pop {
  transform: scale(1.08);
}

.balance-hint {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-top: 4px;
  font-weight: 600;
}

.tap-zone {
  position: relative;
  width: 260px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.tap-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,184,0,0.25) 0%, transparent 70%);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}

.tap-symbol {
  font-size: 140px;
  position: relative;
  z-index: 1;
  transition: transform 0.08s;
  filter: drop-shadow(0 8px 24px rgba(255,184,0,0.4));
}

.tap-zone:active .tap-symbol {
  transform: scale(0.92);
}

.tap-float {
  position: absolute;
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  pointer-events: none;
  animation: floatUp 0.9s ease-out forwards;
  z-index: 10;
}

@keyframes floatUp {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-120px) scale(1.4); opacity: 0; }
}

.energy-box {
  width: 100%;
  margin-bottom: 8px;
}

.energy-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  justify-content: center;
}

.energy-icon {
  color: var(--accent);
}

.energy-bar {
  width: 100%;
  height: 12px;
  background: var(--card);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.energy-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: 8px;
  transition: width 0.3s ease;
  box-shadow: 0 0 12px rgba(255,184,0,0.4);
}

/* ══════════ КАРТОЧКИ ══════════ */
.card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--card);
  border-radius: 16px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  transition: background 0.15s;
}

.card:active {
  background: var(--card-hover);
}

.card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.card-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 2px;
}

.card-desc {
  font-size: 12px;
  color: var(--text-dim);
}

.card-btn {
  padding: 8px 14px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
  flex-shrink: 0;
}

.card-btn:active {
  transform: scale(0.95);
}

.card-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.daily-card {
  border: 1px solid rgba(255,184,0,0.3);
  background: linear-gradient(135deg, rgba(255,184,0,0.08), var(--card));
}

/* ══════════ СТАТИСТИКА (FRIENDS) ══════════ */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  border: 1px solid var(--border);
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-dim);
}

/* ══════════ БОЛЬШИЕ КНОПКИ ══════════ */
.big-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #000;
  border: none;
  border-radius: 16px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  margin-top: 10px;
  transition: transform 0.1s;
  box-shadow: 0 4px 16px rgba(255,184,0,0.3);
}

.big-btn:active {
  transform: scale(0.97);
}

.big-btn.secondary {
  background: var(--card);
  color: var(--text);
  box-shadow: none;
  border: 1px solid var(--border);
}

/* ══════════ НИЖНЕЕ МЕНЮ ══════════ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(14,14,18,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s;
  padding: 0;
}

.nav-btn.active {
  color: var(--accent);
}

.nav-icon {
  font-size: 22px;
  line-height: 1;
}

.nav-label {
  font-size: 11px;
  font-weight: 500;
}

/* ══════════ СКРОЛЛБАР ══════════ */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}