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

html, body {
  margin: 0;
  padding: 0;
  background: #0b0c12;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  height: 100%;
  user-select: none;
}

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

.view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.topbar { padding: 14px 20px 4px; }

.lang-switcher-mini {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 8px;
}
.lang-switcher-mini .lang-btn {
  background: #1b1d29;
  border: 1px solid #2a2d3d;
  border-radius: 10px;
  width: 34px;
  height: 30px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: .55;
}
.lang-switcher-mini .lang-btn.active {
  opacity: 1;
  border-color: #3b6cf6;
  background: #1e2440;
}

.coin-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 34px;
  font-weight: 800;
}
.coin-icon { font-size: 28px; }

.usd-value {
  color: #8b8fa3;
  font-size: 13px;
  font-weight: 600;
  margin-top: -4px;
}

.level-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.level-pill {
  background: #1b1d29;
  border: 1px solid #2a2d3d;
  color: #fff;
  padding: 6px 12px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.chev { opacity: .6; }

#level-fraction { color: #8b8fa3; font-size: 13px; font-weight: 600; }

.progress-track {
  margin-top: 8px;
  height: 8px;
  border-radius: 6px;
  background: #1b1d29;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4ade80, #a78bfa, #60a5fa);
  border-radius: 6px;
  transition: width .3s ease;
}

.tap-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.mascot-ring {
  width: 86%;
  max-width: 340px;
  aspect-ratio: 1;
  border-radius: 32px;
  background: radial-gradient(circle at 50% 40%, #1c2440, #0b0c12 72%);
  border: 10px solid #2a3560;
  box-shadow: 0 0 40px rgba(59,108,246,.35), inset 0 0 30px rgba(59,108,246,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.mascot-tap {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 22px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .08s ease;
}
.mascot-tap.pressed { transform: scale(0.94); }

.wolf-img {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 100%;
  transform-origin: 50% 100%;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .45));
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  animation: wolf-breathe 5s ease-in-out infinite;
}

@keyframes wolf-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.015); }
}

@media (prefers-reduced-motion: reduce) {
  .wolf-img { animation: none; }
}

.bottombar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px 4px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #1b1d29;
  border: 1px solid #2a2d3d;
  border-radius: 14px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}
.stat-icon { font-size: 16px; }

.boost {
  border: none;
  background: linear-gradient(135deg, #3b6cf6, #7c4dff);
  cursor: pointer;
}
.boost:disabled { opacity: .5; cursor: not-allowed; }

.tabbar {
  display: flex;
  justify-content: space-around;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  background: #10111a;
  border-top: 1px solid #1e2030;
}

.tab-btn {
  background: none;
  border: none;
  color: #7d8195;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
}
.tab-btn.active { color: #fff; background: #1b1d29; }

.tab-panel {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
}
.tab-panel.active { display: flex; flex-direction: column; }

.tab-panel h2 { margin: 0 0 14px; font-size: 20px; }

.list { display: flex; flex-direction: column; gap: 10px; }

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1b1d29;
  border: 1px solid #2a2d3d;
  border-radius: 14px;
  padding: 12px 16px;
}
.list-item .title { font-weight: 700; font-size: 14px; }
.list-item .desc { color: #8b8fa3; font-size: 12px; margin-top: 2px; }
.list-item .reward { color: #4ade80; font-weight: 700; font-size: 13px; white-space: nowrap; }
.list-item.done { opacity: .5; }
.list-item .rank-badge {
  width: 26px; height: 26px; border-radius: 50%;
  background: #2a2d3d; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; margin-right: 10px;
}
.row-left { display: flex; align-items: center; }

.muted { color: #8b8fa3; font-size: 13px; }

.section-title {
  font-size: 14px;
  color: #8b8fa3;
  margin: 22px 0 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.section-title:first-of-type { margin-top: 4px; }

.stat-card {
  display: flex;
  justify-content: space-between;
  background: #1b1d29;
  border: 1px solid #2a2d3d;
  border-radius: 14px;
  padding: 14px 16px;
  margin: 14px 0;
  font-weight: 700;
}

.primary-btn {
  background: linear-gradient(135deg, #3b6cf6, #7c4dff);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  margin-top: 10px;
}
.primary-btn.danger {
  background: linear-gradient(135deg, #f65b5b, #b23a3a);
  margin-top: 16px;
}

.text-input {
  width: 100%;
  background: #1b1d29;
  border: 1px solid #2a2d3d;
  color: #fff;
  border-radius: 14px;
  padding: 14px;
  font-size: 14px;
  margin-bottom: 10px;
}
.text-input::placeholder { color: #6b6f83; }

.task-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.list-item.clan-row { cursor: pointer; }
.join-btn {
  background: #2a2d3d;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.toast {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1b1d29;
  border: 1px solid #2a2d3d;
  color: #fff;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.float-coin {
  position: absolute;
  font-weight: 800;
  font-size: 20px;
  color: #ffd54f;
  pointer-events: none;
  animation: float-up .7s ease-out forwards;
}
@keyframes float-up {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-60px); }
}
