:root {
  --bg: #08111f;
  --panel: rgba(10, 18, 34, 0.88);
  --panel-border: rgba(135, 198, 255, 0.2);
  --text: #eef7ff;
  --muted: #9eb5d2;
  --good: #89ff9a;
  --warn: #ffcf7a;
  --danger: #ff668f;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  font-family: "Outfit", sans-serif;
  background:
    radial-gradient(circle at top, rgba(137, 255, 154, 0.15), transparent 24%),
    radial-gradient(circle at bottom right, rgba(98, 158, 255, 0.12), transparent 30%),
    linear-gradient(160deg, #030712 0%, #09111f 45%, #102547 100%);
}

button { font: inherit; cursor: pointer; border: 0; }
.app-shell { width: min(1200px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 36px; }
.hero { display: flex; gap: 24px; justify-content: space-between; align-items: end; margin-bottom: 22px; }
.eyebrow, .stat-label, .side-label, .hero-card-label, .overlay-kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--muted);
}
.eyebrow span, .character-picked { color: var(--good); }
h1, h2, h3 { font-family: "Chakra Petch", sans-serif; margin: 0; }
h1 { margin-top: 8px; font-size: clamp(2.8rem, 6vw, 4.4rem); line-height: 0.95; }
.subtitle { max-width: 700px; color: #d9e8f8; font-size: 1.04rem; line-height: 1.55; margin-top: 14px; }

.panel, .hero-card, .overlay-card, .upgrade-card, .character-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-card { min-width: 220px; padding: 18px; }
.hero-card p { margin: 7px 0; }
.top-auth-panel {
  margin-bottom: 20px;
  padding: 18px 20px;
  border-color: rgba(137,255,154,0.35);
  background:
    linear-gradient(135deg, rgba(137,255,154,0.08), rgba(110,200,255,0.08)),
    var(--panel);
}
.account-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.account-banner h2,
.account-banner p { margin: 0; }
.account-banner-text { margin-top: 8px; color: #d9e8f8; }
.account-banner-badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(137,255,154,0.12);
  border: 1px solid rgba(137,255,154,0.4);
  color: var(--good);
  font-weight: 800;
  white-space: nowrap;
}
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; }
.game-panel { padding: 18px; }
.equipment-panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 22px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}
.equipment-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.equipment-header p:last-child {
  margin: 0;
  color: #d9e8f8;
}
.equipment-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.equipment-card {
  padding: 14px;
  border-radius: 18px;
  color: var(--text);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(135, 198, 255, 0.18);
  text-align: left;
}
.equipment-card.active {
  border-color: rgba(137,255,154,0.65);
  background: rgba(137,255,154,0.12);
}
.equipment-card strong,
.equipment-card span {
  display: block;
}
.equipment-card span {
  margin-top: 6px;
  color: #d9e8f8;
  font-size: 0.92rem;
}
.equipment-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
}
.equipment-icon-none::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #d9e8f8;
}
.equipment-icon-magnet::before,
.equipment-icon-magnet::after {
  content: "";
  position: absolute;
  top: 8px;
  width: 7px;
  height: 16px;
  border: 3px solid #ffcf7a;
  border-top: 0;
}
.equipment-icon-magnet::before {
  left: 7px;
  border-right: 0;
  border-bottom-left-radius: 8px;
}
.equipment-icon-magnet::after {
  right: 7px;
  border-left: 0;
  border-bottom-right-radius: 8px;
}
.equipment-icon-slingshot::before,
.equipment-icon-slingshot::after {
  content: "";
  position: absolute;
  background: #d9e8f8;
}
.equipment-icon-slingshot::before {
  width: 4px;
  height: 18px;
  left: 10px;
  top: 7px;
  transform: rotate(-20deg);
}
.equipment-icon-slingshot::after {
  width: 4px;
  height: 18px;
  right: 10px;
  top: 7px;
  transform: rotate(20deg);
}
.equipment-icon-gun::before,
.equipment-icon-gun::after {
  content: "";
  position: absolute;
  background: #d9e8f8;
}
.equipment-icon-gun::before {
  width: 18px;
  height: 6px;
  left: 8px;
  top: 10px;
}
.equipment-icon-gun::after {
  width: 8px;
  height: 10px;
  left: 12px;
  top: 16px;
}
.equipment-icon-block::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 3px solid #ffcf7a;
}
.block-toggle {
  position: absolute;
  right: 18px;
  bottom: 18px;
  padding: 12px 16px;
  border-radius: 16px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(255,207,122,0.22), rgba(255,102,143,0.2));
  border: 1px solid rgba(255,207,122,0.4);
  font-weight: 700;
  z-index: 3;
}
.block-timer {
  position: absolute;
  right: 18px;
  bottom: 72px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(8, 17, 31, 0.84);
  border: 1px solid rgba(255,207,122,0.5);
  color: #ffcf7a;
  font-weight: 700;
  z-index: 3;
}
.side-panel { padding: 22px 20px; }
.side-panel section + section { margin-top: 24px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.08); }
.side-panel p, .loadout-list { color: #d9e8f8; line-height: 1.55; }
.loadout-list { margin: 12px 0 0; padding-left: 18px; }

.hud { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 12px; margin-bottom: 14px; }
.stat { padding: 12px 14px; border-radius: 18px; background: rgba(255,255,255,0.04); }
.stat strong { display: block; margin-top: 6px; font-size: 1.45rem; }
.fullscreen-button,
.hud-button {
  padding: 0 18px;
  border-radius: 18px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(137,255,154,0.22), rgba(98,158,255,0.25));
  border: 1px solid rgba(137,255,154,0.35);
  font-weight: 700;
}

.canvas-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: #020611;
  border: 1px solid rgba(255,255,255,0.08);
}

canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(1, 5, 15, 0.62);
}
.hidden { display: none; }
.overlay-card { width: min(100%, 430px); padding: 28px; text-align: center; }
.overlay-card.wide { width: min(100%, 840px); }
.overlay-card.start-card {
  width: min(100%, 1080px);
  max-height: calc(100% - 12px);
  overflow: auto;
}
.overlay-card p { line-height: 1.55; }
.overlay-card button {
  margin-top: 12px;
  padding: 14px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--good), #6ec8ff);
  color: #071118;
  font-weight: 800;
}

.character-grid, .upgrade-grid { display: grid; gap: 14px; margin-top: 18px; }
.character-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.upgrade-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.character-card, .upgrade-card { padding: 18px; text-align: left; transition: transform 160ms ease, border-color 160ms ease; }
.character-card.active, .upgrade-card:hover {
  border-color: rgba(137,255,154,0.65);
  background: rgba(16, 32, 52, 0.98);
  transform: translateY(-3px);
}
.character-card h4, .upgrade-card h4 { margin: 8px 0 6px; font-size: 1.08rem; }
.character-card p, .upgrade-card p { margin: 0; color: #d9e8f8; }
.character-picked { margin: 10px 0 0; font-weight: 700; }
.auth-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.auth-tab,
.auth-action {
  margin-top: 0;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid rgba(135, 198, 255, 0.24);
  font-weight: 700;
}
.auth-tab.active {
  background: rgba(137,255,154,0.14);
  border-color: rgba(137,255,154,0.55);
}
.auth-form { margin-top: 16px; }
.auth-grid { display: grid; gap: 12px; }
.auth-grid.one { grid-template-columns: 1fr; }
.auth-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.auth-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.auth-form label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}
.auth-form input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(135, 198, 255, 0.22);
  background: rgba(255,255,255,0.04);
  color: var(--text);
}
.auth-inline-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  flex-wrap: wrap;
}
.auth-link-button,
.auth-action.secondary {
  background: transparent;
  color: #d9e8f8;
  border: 1px solid rgba(255,255,255,0.14);
  padding: 12px 18px;
  border-radius: 999px;
}
.auth-message { margin: 14px 0 0; color: #d9e8f8; }
.auth-message.good { color: var(--good); }
.auth-message.bad { color: #ff9db6; }
.account-summary {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: rgba(255,255,255,0.05);
}
.account-summary.hidden {
  display: none;
}
.avatar-shop {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.avatar-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(135, 198, 255, 0.18);
}
.avatar-card.owned { border-color: rgba(137,255,154,0.4); }
.avatar-card.selected { background: rgba(137,255,154,0.1); }
.avatar-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.avatar-card h4,
.avatar-card p { margin: 0; }
.avatar-price {
  color: #d9e8f8;
  font-size: 0.9rem;
  margin-top: 6px;
}
.avatar-preview {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.45);
}
.avatar-card button {
  margin-top: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.14);
}
.avatar-card button:disabled { opacity: 0.6; cursor: default; }
.avatar-detail-panel {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.avatar-detail-panel h3,
.avatar-detail-panel p {
  margin: 0;
}
.avatar-detail-panel p:last-child {
  margin-top: 8px;
  color: #d9e8f8;
}
.blog-panel {
  margin-top: 20px;
  padding: 20px;
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.blog-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.blog-card h3,
.blog-card p {
  margin: 0;
}
.blog-card p {
  margin-top: 8px;
  color: #d9e8f8;
  line-height: 1.6;
}

:fullscreen .app-shell { width: 100%; max-width: none; min-height: 100vh; padding: 12px; }
:fullscreen .game-layout { grid-template-columns: minmax(0, 1fr) 300px; min-height: calc(100vh - 24px); }
:fullscreen .game-panel { display: flex; flex-direction: column; }
:fullscreen .canvas-wrap { flex: 1; min-height: 0; }
:fullscreen canvas { width: 100%; height: 100%; aspect-ratio: auto; }

@media (max-width: 980px) {
  .hero, .game-layout { display: grid; grid-template-columns: 1fr; }
  .hud { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .character-grid, .upgrade-grid, .avatar-picker { grid-template-columns: 1fr; }
  .equipment-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .auth-grid.two,
  .auth-grid.three { grid-template-columns: 1fr; }
  .account-banner { display: grid; grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .app-shell { width: min(100% - 20px, 1200px); padding-top: 18px; }
  .game-panel, .side-panel { padding: 14px; }
}
