:root {
  --bg-0: #0a1210;
  --bg-1: #102018;
  --lime: #b8f000;
  --lime-dim: #7aa600;
  --cyan: #3de8c8;
  --ink: #e8f5ec;
  --muted: #8aa896;
  --panel: rgba(12, 28, 22, 0.82);
  --line: rgba(184, 240, 0, 0.18);
  --danger: #ff6b6b;
  --font-display: "Orbitron", sans-serif;
  --font-body: "Space Grotesk", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: radial-gradient(1200px 700px at 15% -10%, #1a3d2e 0%, transparent 55%),
    radial-gradient(900px 600px at 100% 20%, #0d2f3a 0%, transparent 50%),
    linear-gradient(165deg, var(--bg-0), var(--bg-1) 45%, #06140f);
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(184, 240, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184, 240, 0, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  width: 40vmax;
  height: 40vmax;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(184, 240, 0, 0.12), transparent 65%);
  pointer-events: none;
  z-index: 0;
  animation: pulse-glow 4.5s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%,
  100% {
    opacity: 0.55;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
}

.view {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ——— Auth ——— */
.auth-view {
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
}

.auth-panel {
  width: min(420px, 100%);
  text-align: center;
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 9vw, 3.8rem);
  letter-spacing: 0.04em;
  color: var(--lime);
  text-shadow: 0 0 40px rgba(184, 240, 0, 0.35);
  animation: brand-in 0.8s ease-out both;
}

.brand-sm {
  font-size: 1.25rem;
  text-shadow: none;
  animation: none;
}

@keyframes brand-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.tagline {
  margin: 0.6rem 0 1.75rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.tab {
  font: inherit;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 0.45rem 1rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.tab.is-active {
  color: var(--bg-0);
  background: var(--lime);
  border-color: var(--lime);
  font-weight: 600;
}

.auth-form {
  display: grid;
  gap: 0.9rem;
  text-align: left;
}

.auth-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.auth-form input {
  font: inherit;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  outline: none;
}

.auth-form input:focus {
  border-color: var(--cyan);
}

.btn {
  font: inherit;
  font-weight: 600;
  border: none;
  cursor: pointer;
  padding: 0.7rem 1.1rem;
  transition: transform 0.15s, filter 0.15s, background 0.15s;
}

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

.btn-primary {
  background: var(--lime);
  color: var(--bg-0);
  margin-top: 0.35rem;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--muted);
}

.form-error {
  margin-top: 1rem;
  color: var(--danger);
  font-size: 0.9rem;
}

/* ——— Game ——— */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 16, 12, 0.55);
  backdrop-filter: blur(8px);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-label {
  color: var(--cyan);
  font-size: 0.9rem;
}

.game-layout {
  display: grid;
  grid-template-columns: 1fr min(380px, 100%);
  min-height: calc(100vh - 64px);
}

.click-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 3rem;
  text-align: center;
}

.stat-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--muted);
}

.rush-display {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  font-weight: 800;
  color: var(--lime);
  line-height: 1.1;
  transition: transform 0.12s ease-out;
}

.rush-display.is-bump {
  transform: scale(1.04);
}

.cps-line {
  margin: 0.4rem 0 1.75rem;
  color: var(--cyan);
  font-size: 1rem;
}

.big-click {
  position: relative;
  width: min(220px, 55vw);
  height: min(220px, 55vw);
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  outline: none;
}

.orb {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #e8ff8a, var(--lime) 35%, var(--lime-dim) 70%, #2a4000),
    conic-gradient(from 180deg, var(--cyan), transparent 40%, var(--lime));
  box-shadow:
    0 0 0 3px rgba(184, 240, 0, 0.25),
    0 20px 50px rgba(0, 0, 0, 0.45),
    0 0 60px rgba(184, 240, 0, 0.25);
  transition: transform 0.12s ease-out, box-shadow 0.12s;
  animation: orb-idle 3.2s ease-in-out infinite;
}

.orb-core {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--bg-0);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
  pointer-events: none;
}

@keyframes orb-idle {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

.big-click:hover .orb {
  box-shadow:
    0 0 0 4px rgba(61, 232, 200, 0.35),
    0 20px 50px rgba(0, 0, 0, 0.45),
    0 0 80px rgba(184, 240, 0, 0.4);
}

.big-click.is-pressed .orb {
  transform: scale(0.92);
  animation: none;
}

.click-power {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.offline-toast {
  margin-top: 1rem;
  padding: 0.55rem 0.9rem;
  background: rgba(61, 232, 200, 0.12);
  border: 1px solid rgba(61, 232, 200, 0.35);
  color: var(--cyan);
  font-size: 0.9rem;
}

/* ——— Shop ——— */
.shop {
  border-left: 1px solid var(--line);
  background: var(--panel);
  padding: 1.25rem 1rem 2rem;
  overflow-y: auto;
  max-height: calc(100vh - 64px);
}

.shop-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.shop-tab {
  flex: 1;
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.shop-tab.is-active {
  color: var(--bg-0);
  background: var(--lime);
  border-color: var(--lime);
}

.shop-empty {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.building-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.building {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 0.75rem;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, opacity 0.15s;
}

.building:hover:not(:disabled) {
  border-color: var(--lime);
  background: rgba(184, 240, 0, 0.08);
}

.building:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.building.is-owned {
  opacity: 1;
  border-color: rgba(61, 232, 200, 0.35);
  background: rgba(61, 232, 200, 0.08);
  cursor: default;
}

.building-name {
  font-weight: 600;
  grid-column: 1;
}

.building-owned {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--cyan);
}

.building-meta {
  grid-column: 1;
  font-size: 0.8rem;
  color: var(--muted);
}

.building-cost {
  color: var(--lime);
}

.building-desc {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.building-effects {
  color: var(--cyan);
}

.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.cat-tab {
  font: inherit;
  font-size: 0.75rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.cat-tab.is-active {
  background: var(--cyan);
  color: var(--bg-0);
  border-color: var(--cyan);
  font-weight: 600;
}

.panel.hidden {
  display: none !important;
}

.prestige-box {
  border: 1px solid var(--line);
  padding: 0.9rem;
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.25);
}

.prestige-box p {
  margin: 0.25rem 0;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.skill-tree {
  display: grid;
  gap: 0.65rem;
}

.skill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-node {
  flex: 1 1 120px;
  max-width: 180px;
  text-align: left;
  font: inherit;
  padding: 0.7rem;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 0.2rem;
}

.skill-node strong {
  font-size: 0.85rem;
}

.skill-node span {
  font-size: 0.75rem;
  color: var(--lime);
}

.skill-node em {
  font-style: normal;
  font-size: 0.7rem;
  color: var(--muted);
}

.skill-node.is-owned {
  border-color: var(--cyan);
  background: rgba(61, 232, 200, 0.12);
  cursor: default;
}

.skill-node.is-available {
  border-color: var(--lime);
}

.skill-node.is-locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.event-banner {
  position: relative;
  z-index: 2;
  padding: 0.55rem 1rem;
  text-align: center;
  background: linear-gradient(90deg, rgba(184, 240, 0, 0.2), rgba(61, 232, 200, 0.2));
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--lime);
}

.btn-daily {
  background: transparent;
  color: var(--cyan);
  border: 1px solid rgba(61, 232, 200, 0.4);
  font: inherit;
  font-weight: 600;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}

.btn-daily.is-ready {
  background: var(--cyan);
  color: var(--bg-0);
  animation: pulse-glow 1.6s ease-in-out infinite;
}

.combo-badge {
  margin-left: 0.5rem;
  color: #ffd24a;
  font-weight: 700;
}

.golden-combo {
  position: fixed;
  z-index: 30;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #fff6b0, #ffc107 45%, #c67c00);
  box-shadow: 0 0 30px rgba(255, 193, 7, 0.55);
  animation: golden-bounce 1.2s ease-in-out infinite;
  right: 12%;
  top: 38%;
}

@keyframes golden-bounce {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1.08);
  }
}

/* Themes (Kosmetik) */
body.theme-cyan {
  --lime: #3de8c8;
  --lime-dim: #1a9e88;
  --cyan: #7cf0ff;
}

body.theme-ember {
  --lime: #ff9f43;
  --lime-dim: #c45f12;
  --cyan: #ffd093;
  --bg-0: #140c08;
  --bg-1: #1c100c;
}

body.theme-void {
  --lime: #c4b5fd;
  --lime-dim: #7c6bb5;
  --cyan: #a78bfa;
  --bg-0: #0b0a12;
  --bg-1: #12101c;
}

body.theme-gold {
  --lime: #ffd24a;
  --lime-dim: #c9a227;
  --cyan: #ffe9a0;
}

body.theme-mythic {
  --lime: #5eead4;
  --lime-dim: #2dd4bf;
  --cyan: #f0abfc;
  --bg-0: #0a1018;
  --bg-1: #101828;
}

/* ——— Float numbers ——— */
.float-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  overflow: hidden;
}

.float-num {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--lime);
  font-size: 1.1rem;
  animation: float-up 0.85s ease-out forwards;
  text-shadow: 0 0 12px rgba(184, 240, 0, 0.5);
}

@keyframes float-up {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-70px) scale(1.15);
  }
}

@media (max-width: 860px) {
  .game-layout {
    grid-template-columns: 1fr;
  }

  .shop {
    border-left: none;
    border-top: 1px solid var(--line);
    max-height: none;
  }

  .click-zone {
    padding-bottom: 1.5rem;
  }

  .golden-combo {
    right: 1.25rem;
    top: auto;
    bottom: 1.25rem;
  }
}
