/* Clicker UI */

.clicker-page {
  max-width: 1320px;
  margin: 2.4rem auto 3.4rem;
  padding: 0 0 2rem;
}

.clicker-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.clicker-page h1 {
  margin-bottom: 0.4rem;
}

.subtitle {
  max-width: 44rem;
}

.resource-hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 0.9rem;
  min-width: min(100%, 480px);
}

.resource-chip,
.card {
  backdrop-filter: blur(18px);
  background:
    linear-gradient(180deg, rgba(16, 24, 38, 0.88), rgba(10, 14, 24, 0.92)),
    radial-gradient(circle at top left, rgba(47, 182, 215, 0.16), transparent 58%);
  border: 1px solid rgba(87, 126, 196, 0.34);
  border-radius: 20px;
  box-shadow: 0 20px 48px rgba(1, 8, 18, 0.42);
}

.resource-chip {
  padding: 0.95rem 1rem;
}

.resource-label,
.section-meta,
.upgrade-copy,
.shop-status,
.network-node small,
.milestone-chip span,
.save-card p,
.achievement-entry small {
  color: var(--muted);
}

.resource-value {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.35rem;
  color: #f7fbff;
}

.notice-card {
  margin-bottom: 1rem;
  border-color: rgba(45, 212, 191, 0.4);
}

.clicker-main-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.98fr) minmax(420px, 1.22fr) minmax(280px, 0.92fr);
  gap: 1.25rem;
  align-items: start;
}

.clicker-main-column {
  display: grid;
  gap: 1rem;
}

.card {
  padding: 1.2rem 1.2rem 1.15rem;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 54px rgba(1, 8, 18, 0.5);
  border-color: rgba(94, 234, 212, 0.42);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.section-heading p {
  margin-bottom: 0;
}

.section-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: right;
  font-size: 0.84rem;
}

.upgrade-tier-stack {
  display: grid;
  gap: 1rem;
}

.upgrade-tier {
  border-radius: 18px;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 13, 24, 0.72);
}

.upgrade-tier.is-collapsed .upgrade-grid {
  display: none;
}

.upgrade-tier[data-locked="true"] {
  opacity: 0.48;
}

.upgrade-tier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.9rem;
}

.upgrade-tier-header h3 {
  margin: 0;
  font-size: 1rem;
}

.tier-toggle {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  border: 1px solid rgba(94, 234, 212, 0.22);
  background: rgba(12, 20, 33, 0.78);
  color: #a8f3ff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.tier-toggle:hover,
.tier-toggle:focus-visible {
  border-color: rgba(94, 234, 212, 0.52);
  background: rgba(19, 31, 49, 0.96);
}

.upgrade-tier.is-collapsed .tier-toggle {
  transform: rotate(-90deg);
}

.tier-label,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.66rem;
  font-weight: 700;
}

.upgrade-tier-core .tier-label,
.tag-click {
  background: rgba(67, 97, 238, 0.18);
  color: #9cb5ff;
  border: 1px solid rgba(67, 97, 238, 0.45);
}

.upgrade-tier-advanced .tier-label,
.tag-auto {
  background: rgba(34, 211, 238, 0.18);
  color: #93f3ff;
  border: 1px solid rgba(34, 211, 238, 0.45);
}

.upgrade-tier-special .tier-label {
  background: rgba(251, 191, 36, 0.16);
  color: #ffe29d;
  border: 1px solid rgba(251, 191, 36, 0.45);
}

.upgrade-grid,
.shop-grid,
.achievement-list {
  display: grid;
  gap: 0.9rem;
}

.upgrade-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.shop-item {
  position: relative;
  overflow: hidden;
  padding: 0.8rem 0.95rem 0.9rem;
  border-radius: 18px;
  border: 1px solid rgba(120, 146, 196, 0.25);
  background:
    linear-gradient(180deg, rgba(15, 22, 36, 0.82), rgba(6, 11, 20, 0.94)),
    radial-gradient(circle at top right, rgba(47, 182, 215, 0.14), transparent 54%);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.shop-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  transform: translateX(-120%);
  transition: transform 260ms ease;
}

.shop-item:hover {
  transform: translateY(-3px);
  border-color: rgba(94, 234, 212, 0.4);
  box-shadow: 0 18px 34px rgba(2, 12, 28, 0.42);
}

.shop-item:hover::before {
  transform: translateX(120%);
}

.shop-item h4 {
  margin: 0;
}

.shop-item p {
  margin: 0 0 0.35rem;
}

.upgrade-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin: 0.4rem 0 0.15rem;
}

.upgrade-info {
  width: 1.7rem;
  height: 1.7rem;
  position: relative;
  border-radius: 999px;
  border: 1px solid rgba(94, 234, 212, 0.32);
  background: rgba(21, 35, 56, 0.82);
  color: #9fe8f8;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  flex: 0 0 auto;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.upgrade-info:hover,
.upgrade-info:focus-visible {
  border-color: rgba(94, 234, 212, 0.6);
  background: rgba(24, 46, 70, 0.95);
  transform: translateY(-1px);
}

.upgrade-info::before,
.upgrade-info::after {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

.upgrade-info::before {
  content: "";
  left: 50%;
  bottom: calc(100% + 0.45rem);
  transform: translate(-50%, 0.2rem);
  border-width: 0.42rem 0.35rem 0;
  border-style: solid;
  border-color: rgba(10, 16, 28, 0.96) transparent transparent;
  z-index: 4;
}

.upgrade-info::after {
  content: attr(data-tooltip);
  left: 50%;
  bottom: calc(100% + 0.8rem);
  transform: translate(-50%, 0.2rem);
  min-width: 13rem;
  max-width: 16rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(94, 234, 212, 0.28);
  background:
    linear-gradient(180deg, rgba(16, 24, 38, 0.98), rgba(8, 13, 24, 0.98));
  box-shadow: 0 16px 30px rgba(2, 12, 28, 0.42);
  color: #dcecff;
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  z-index: 5;
}

.upgrade-info:hover::before,
.upgrade-info:hover::after,
.upgrade-info:focus-visible::before,
.upgrade-info:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.upgrade-stats {
  display: grid;
  gap: 0.14rem;
  margin: 0.5rem 0 0.75rem;
  font-size: 0.84rem;
}

.upgrade-stats strong {
  color: #f7fbff;
}

.btn,
.shop-btn {
  transition: transform 100ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.btn:hover,
.shop-btn:hover {
  box-shadow: 0 0 18px rgba(47, 182, 215, 0.28);
}

.btn:active,
.shop-btn:active {
  transform: scale(0.96);
}

.clicker-card {
  position: relative;
  overflow: hidden;
}

.clicker-card-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.clicker-stats {
  display: grid;
  gap: 0.3rem;
  text-align: right;
}

.clicker-stats strong {
  color: #ffffff;
}

.combo-meter-panel {
  margin-bottom: 1rem;
}

.combo-meter-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
}

.combo-meter-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(5, 12, 22, 0.85);
  border: 1px solid rgba(96, 165, 250, 0.24);
  overflow: hidden;
}

.combo-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #34d399, #38bdf8, #fb7185);
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.42);
}

.modem-screen-glow {
  position: absolute;
  inset: auto 15% 18% 15%;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.2), transparent 70%);
  filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.modem-screen-glow.is-active {
  opacity: 1;
}

.modem-click-area {
  margin: 0 auto;
  width: min(100%, 420px);
  aspect-ratio: 1;
  position: relative;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.18), transparent 18%),
    radial-gradient(circle at 50% 50%, rgba(18, 31, 56, 0.92), rgba(2, 8, 18, 0.98) 70%);
  border: 1px solid rgba(93, 188, 255, 0.34);
  box-shadow:
    0 28px 42px rgba(0, 0, 0, 0.42),
    inset 0 0 48px rgba(24, 160, 251, 0.16);
  transition: transform 110ms ease, box-shadow 110ms ease, filter 140ms ease;
  z-index: 1;
}

.modem-click-area:hover {
  box-shadow:
    0 30px 52px rgba(0, 0, 0, 0.46),
    inset 0 0 58px rgba(24, 160, 251, 0.2);
}

.modem-click-area.is-clicked {
  transform: scale(0.965);
  filter: brightness(1.06);
}

.packet-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.modem-icon {
  pointer-events: none;
}

.modem-core-ring,
.modem-pulse {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  pointer-events: none;
}

.modem-core-ring {
  border: 1px solid rgba(94, 234, 212, 0.28);
  box-shadow:
    0 0 36px rgba(56, 189, 248, 0.12),
    inset 0 0 24px rgba(94, 234, 212, 0.08);
}

.modem-pulse {
  border: 2px solid rgba(56, 189, 248, 0.4);
  transform: scale(0.88);
  opacity: 0;
}

.modem-pulse.is-active {
  animation: modemPulseBurst 480ms ease-out;
}

@keyframes modemPulseBurst {
  0% {
    transform: scale(0.88);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.12);
    opacity: 0;
  }
}

.modem-icon {
  position: relative;
  z-index: 2;
  font-size: clamp(4rem, 9vw, 5.6rem);
  text-shadow: 0 0 18px rgba(56, 189, 248, 0.48);
}

.floating-coin {
  position: absolute;
  left: 50%;
  top: 50%;
  font-weight: 700;
  pointer-events: none;
  white-space: nowrap;
  color: #e2fbff;
  text-shadow: 0 0 14px rgba(56, 189, 248, 0.55);
  animation: floatCoinText 800ms ease-out forwards;
}

@keyframes floatCoinText {
  0% {
    opacity: 0;
    transform: translate(-50%, -15%) scale(0.9);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--float-x, -50%), calc(var(--float-y, -130%) - 20px)) scale(1.05);
  }
}

.overclock-panel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.9rem;
  align-items: center;
  margin-top: 1rem;
}

.overclock-btn {
  min-width: 128px;
}

.overclock-meta,
.overclock-indicator {
  display: grid;
  gap: 0.18rem;
}

.indicator-label {
  color: var(--muted);
  font-size: 0.8rem;
}

.milestone-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.milestone-chip {
  min-width: 124px;
  padding: 0.7rem 0.8rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 12, 20, 0.68);
}

.milestone-chip strong {
  display: block;
  margin-bottom: 0.2rem;
}

.milestone-chip.is-hit {
  border-color: rgba(52, 211, 153, 0.42);
  box-shadow: inset 0 0 18px rgba(16, 185, 129, 0.08);
}

.network-map {
  display: grid;
  gap: 0.8rem;
}

.network-node {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 11, 20, 0.74);
}

.network-node[data-locked="true"] {
  opacity: 0.5;
}

.network-node-icon {
  font-size: 1.8rem;
}

.network-node strong {
  display: block;
  margin-bottom: 0.18rem;
}

.network-node button {
  min-width: 100px;
}

.prestige-tree {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.prestige-upgrade {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 10, 18, 0.76);
}

.prestige-upgrade[data-locked="true"] {
  opacity: 0.45;
}

.prestige-controls {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.prestige-history-block h3 {
  margin-bottom: 0.6rem;
}

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

.highscore-list li {
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  background: rgba(8, 12, 20, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.achievement-list {
  display: grid;
  gap: 0.9rem;
}

.achievement-entry {
  display: grid;
  gap: 0.22rem;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 12, 20, 0.74);
}

.achievement-entry.is-earned {
  border-color: rgba(250, 204, 21, 0.38);
  box-shadow: inset 0 0 18px rgba(250, 204, 21, 0.08);
}

.achievement-toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 40;
  display: grid;
  gap: 0.18rem;
  padding: 0.85rem 1rem;
  min-width: 260px;
  border-radius: 16px;
  background: rgba(9, 15, 27, 0.95);
  border: 1px solid rgba(250, 204, 21, 0.45);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
}

.save-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}

.utility-card {
  padding-top: 0.9rem;
}

.utility-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.utility-tab {
  border: 1px solid rgba(87, 126, 196, 0.28);
  border-radius: 999px;
  background: rgba(10, 16, 28, 0.72);
  color: var(--muted);
  padding: 0.55rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease, transform 120ms ease;
}

.utility-tab:hover,
.utility-tab:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(94, 234, 212, 0.4);
  color: #edf8ff;
}

.utility-tab.is-active {
  background: linear-gradient(180deg, rgba(32, 79, 112, 0.92), rgba(18, 46, 70, 0.92));
  border-color: rgba(94, 234, 212, 0.46);
  color: #f8fdff;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.1);
}

.utility-panel {
  display: grid;
  gap: 0.95rem;
}

.utility-panel[hidden] {
  display: none;
}

.collapsible-block {
  display: grid;
  gap: 0.8rem;
}

.save-actions,
.prestige-history-block {
  margin-top: 0.1rem;
}

.save-textarea {
  min-height: 140px;
  resize: vertical;
}

.nav-coins {
  margin-left: 1rem;
  white-space: nowrap;
}

body.cosmetic-gradient-mesh {
  background:
    radial-gradient(circle at 8% 16%, rgba(34, 211, 238, 0.18), transparent 40%),
    radial-gradient(circle at 88% 14%, rgba(59, 130, 246, 0.22), transparent 36%),
    radial-gradient(circle at 50% 92%, rgba(244, 114, 182, 0.14), transparent 42%),
    linear-gradient(180deg, #07101b, #03070f 72%);
  background-attachment: fixed;
}

body.cosmetic-glow-logo .modem-click-area::after {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  box-shadow: 0 0 48px rgba(56, 189, 248, 0.18);
}

body.cosmetic-particles::before,
body.cosmetic-scanlines::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body.cosmetic-particles::before {
  background:
    radial-gradient(circle at 12% 28%, rgba(56, 189, 248, 0.14) 0 2px, transparent 3px),
    radial-gradient(circle at 80% 72%, rgba(96, 165, 250, 0.12) 0 2px, transparent 3px);
  background-size: 160px 160px, 180px 180px;
  animation: particleFieldDrift 28s linear infinite;
  opacity: 0.55;
}

@keyframes particleFieldDrift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: -240px -320px, 220px 260px;
  }
}

body.cosmetic-glass .card {
  background: rgba(10, 17, 30, 0.62);
}

body.cosmetic-scanlines::after {
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.03),
    rgba(255, 255, 255, 0.03) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.18;
}

body.cosmetic-neon .card {
  box-shadow:
    0 20px 48px rgba(1, 8, 18, 0.42),
    0 0 0 1px rgba(56, 189, 248, 0.18),
    0 0 24px rgba(56, 189, 248, 0.08);
}

body.cosmetic-coin-trails .floating-coin {
  text-shadow:
    0 0 14px rgba(56, 189, 248, 0.55),
    0 0 24px rgba(250, 204, 21, 0.28);
}

@media (max-width: 1180px) {
  .clicker-main-grid {
    grid-template-columns: 1fr;
  }

  .clicker-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .resource-hud {
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .upgrade-grid,
  .resource-hud {
    grid-template-columns: 1fr;
  }

  .utility-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clicker-card-header,
  .section-heading,
  .overclock-panel {
    grid-template-columns: 1fr;
    display: grid;
  }

  .clicker-stats,
  .section-meta {
    text-align: left;
  }

  .network-node,
  .prestige-upgrade {
    grid-template-columns: 1fr;
  }
}
