:root {
  --bg: #111319;
  --panel: #181b23;
  --panel-2: #1f2330;
  --line: #2a2f3d;
  --text: #f5f7ff;
  --muted: #8b90a1;
  --primary: #ffffff;
  --primary-text: #000000;
  --radius-lg: 16px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  touch-action: manipulation;
}

body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  display: flex;
  justify-content: center;
  padding: 16px 14px 108px;
}

.app-shell {
  width: min(430px, 100%);
  display: grid;
  gap: 12px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 33px;
  font-weight: 800;
}

h2 {
  font-size: 22px;
  font-weight: 700;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
}

.top-header {
  padding: 2px 2px 6px;
  background: transparent;
  border: 0;
}

.title-wrap {
  display: grid;
  gap: 2px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: none;
}

.stat-pill,
.power-pill {
  background: #242a38;
  color: #d4dcf7;
  border-radius: 10px;
  border: 1px solid #31384a;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
}

.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile,
.progress {
  padding: 12px;
}

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

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #2f6bff;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-meta {
  display: grid;
  gap: 2px;
}

.name {
  font-size: 16px;
  font-weight: 700;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.power-pill {
  margin-left: auto;
}

.progress-head,
.energy-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.bar-bg {
  margin: 8px 0;
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: #272c38;
  overflow: hidden;
}

.bar-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 0.2s ease;
}

.tab-strip {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: #0c0f15;
  border-color: #1c202d;
}

.tab-btn,
.nav-btn,
.action-btn {
  border: 0;
  color: inherit;
  text-color: rgb(0, 0, 0);
  font: inherit;
  cursor: pointer;
}

.tab-btn {
  flex: 1;
  min-width: 0;
  padding: 10px 6px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.tab-btn.active,
.nav-btn.active {
  background: var(--primary);
  color: var(--primary-text);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.tap-card {
  padding: 18px 12px;
  text-align: center;
}

.tap-target {
  width: clamp(176px, 58vw, 230px);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  border: 1px solid #2d3342;
  background: #262b37;
  display: grid;
  place-items: center;
  position: relative;
  transition: transform 0.08s ease;
}

.tap-target:active {
  transform: scale(0.98);
}

.core-ring {
  width: 58%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 7px solid #364763;
}

.core-logo {
  position: absolute;
  font-size: clamp(40px, 13vw, 56px);
  font-weight: 800;
}

.tap-target.shake {
  animation: tapShake 0.2s linear;
}

@keyframes tapShake {
  25% {
    transform: scale(0.98) translateX(-2px);
  }
  75% {
    transform: scale(0.98) translateX(2px);
  }
}

.tap-hint {
  margin-top: 11px;
  color: var(--muted);
  font-size: 13px;
}

.panel {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.upgrade-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: var(--panel-2);
}

.upgrade-title {
  font-weight: 700;
}

.action-btn,
.action-btn {
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 700;
  font-size: 13px;
}

.action-btn {
  background: var(--primary);
  color: #fff;
}

.costs {
  display: grid;
  gap: 4px;
}

.leaderboard-head {
  display: grid;
  gap: 8px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0d1017;
  color: #fff;
  padding: 11px 12px;
  font: inherit;
}

input::placeholder {
  color: #666d82;
}

.leaderboard {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.leaderboard-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel-2);
}

.rank {
  width: 20px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.lb-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  overflow: hidden;
  background: #3d4354;
}

.lb-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lb-user {
  flex: 1;
  min-width: 0;
}

.lb-user p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-score {
  font-weight: 700;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(420px, calc(100% - 18px));
  padding: 7px;
  display: flex;
  gap: 6px;
  border-radius: 22px;
  border-color: #3a4050;
  background: rgba(41, 46, 59, 0.85);
  backdrop-filter: blur(6px);
  z-index: 20;
}

.nav-btn {
  flex: 1;
  min-width: 0;
  padding: 9px 6px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 86px;
  transform: translateX(-50%);
  background: #222736;
  color: #fff;
  border: 1px solid #2f3444;
  border-radius: 999px;
  padding: 8px 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.toast.show {
  opacity: 1;
}

@media (max-width: 360px) {
  h1 {
    font-size: 28px;
  }

  .tab-btn {
    font-size: 13px;
  }
}
