/* ============================
   Grundlayout Clicker-Seite
   ============================ */

.page-clicker .wrapper {
  max-width: 2000px;
  width: 100%;
}

.clicker-page {
  max-width: 1900px;
  margin: 40px auto;
  padding: 0 20px;
}

.clicker-page h1 {
  font-size: 2.4rem;
  margin-bottom: 6px;
}

.clicker-page .subtitle {
  opacity: 0.8;
  margin-bottom: 30px;
}

.clicker-page h1,
.clicker-page .subtitle {
  text-align: center;
}

/* ============================
   Cards – Basis
   ============================ */

.card {
  background: rgba(12, 20, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  padding: 22px 24px;
  margin-bottom: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.card h2,
.card h3,
.card h4 {
  margin-top: 0;
}

.card p {
  margin-top: 4px;
  margin-bottom: 4px;
}

/* ============================
   Hauptlayout: links – Mitte – rechts
   ============================ */

.clicker-main-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(500px, 1.2fr) minmax(320px, 1fr);
  gap: 40px;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
}

@media (min-width: 1600px) {
  .clicker-main-grid {
    gap: 60px;
  }
}

.clicker-main-left,
.clicker-main-right {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.clicker-main-left > .card:first-child,
.clicker-main-right > .card:first-child {
  margin-top: 0;
}

.clicker-main-column > .card {
  margin-bottom: 20px;
}

/* Mitte: Clicker + Upgrades zentriert, gleiche Breite */

.clicker-main-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.clicker-main-center .clicker-card {
  width: 100%;
  max-width: 600px;
}

.upgrade-card {
  margin-top: 0;
  border-left: 3px solid rgba(34, 197, 94, 0.5);
  transition: border-left-color 0.2s ease;
}

.upgrade-card:hover {
  border-left-color: rgba(34, 197, 94, 0.8);
}

/* ============================
   Clicker-Card
   ============================ */

.clicker-card {
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.98) 0%,
    rgba(12, 20, 42, 0.96) 100%
  );
  border: 1px solid rgba(79, 70, 229, 0.2);
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.7),
    0 0 30px rgba(79, 70, 229, 0.1);
}

.clicker-card:hover {
  border-color: rgba(79, 70, 229, 0.3);
  box-shadow: 
    0 24px 60px rgba(0, 0, 0, 0.8),
    0 0 40px rgba(79, 70, 229, 0.15);
}

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

.clicker-card .clicker-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  font-size: 0.95rem;
  opacity: 0.9;
  text-align: right;
  white-space: nowrap;
}

.clicker-card .clicker-stats span {
  display: block;
  line-height: 1.4;
}

.clicker-actions {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.clicker-hint {
  font-size: 0.85rem;
  opacity: 0.75;
}

/* ============================
   Upgrades & Shop-Grids
   ============================ */

.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.shop-item {
  padding: 14px;
  border-radius: 14px;
  background: rgba(18, 28, 60, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.shop-item h4 {
  margin: 0 0 4px 0;
}

.shop-item p {
  margin: 0 0 4px 0;
}

.shop-status {
  font-size: 0.8rem;
  opacity: 0.7;
}

.shop-btn {
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: #00c6ff;
  color: #000;
  font-size: 0.85rem;
  font-weight: 600;
}

.shop-btn:hover {
  filter: brightness(1.1);
}

/* Tags für Upgrades */

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.9;
  border: 1px solid rgba(255, 255, 255, 0.24);
  margin-bottom: 6px;
}

.tag-click {
  border-color: #00eaff;
}

.tag-auto {
  border-color: #ffd000;
}

/* ============================
   Prestige & History (links)
   ============================ */

.prestige-card {
  background: linear-gradient(
    135deg,
    rgba(26, 20, 8, 0.96),
    rgba(16, 12, 6, 0.96)
  );
  border-color: rgba(255, 215, 120, 0.4);
}

.prestige-card h2 {
  display: flex;
  align-items: center;
  gap: 6px;
}

.prestige-card h2 .emoji {
  font-size: 1.4rem;
}

.prestige-stats {
  margin: 10px 0 12px 0;
  font-size: 0.95rem;
}

.prestige-stats span {
  display: inline-block;
  margin-right: 14px;
}

.prestige-hint {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-bottom: 10px;
}

#prestigeBtn {
  background: linear-gradient(135deg, #ffbf40, #ffe27a);
  color: #2a1800;
  border: none;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}

#prestigeBtn:hover {
  filter: brightness(1.05);
}

/* Prestige-Historie */

.highscore-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.highscore-list li {
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  opacity: 0.85;
}

/* ============================
   Savegame (rechts)
   ============================ */

.save-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.save-textarea {
  resize: none;
  min-height: 100px;
  max-height: 300px;
  width: 100%;
  min-width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}

.save-card {
  min-width: 0;
}

/* ============================
   Navbar Coin Counter
   ============================ */

.nav-coins {
  margin-left: 16px;
  font-size: 0.9rem;
  opacity: 0.85;
  white-space: nowrap;
  display: flex;
  align-items: center;
  padding: 0.35rem 0;
}

/* ============================
   Modem Klickfläche
   ============================ */

.modem-click-area {
  margin: 18px auto 4px auto;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, #ffffff22, #050816dd);
  border: 2px solid rgba(255, 255, 255, 0.26);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out;
  overflow: hidden;
}

.modem-click-area:focus-visible {
  outline: 2px solid #00eaff;
  outline-offset: 4px;
}

.modem-icon {
  font-size: 3.2rem;
  line-height: 1;
  position: relative;
  z-index: 2;
  display: inline-flex;
}

.modem-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(0, 255, 255, 0.5);
  animation: modemPulse 2s infinite;
}

@keyframes modemPulse {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.15);
    opacity: 0;
  }
}

.modem-click-area.is-clicked {
  transform: scale(0.94);
  box-shadow: 0 0 28px rgba(0, 255, 255, 0.8);
}

/* ============================
   Floating Coins & Partikel
   ============================ */

.floating-coin {
  position: absolute;
  font-size: 1.1rem;
  pointer-events: none;
  animation: floatingCoin 0.8s ease-out forwards;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
}

.coin-trail {
  font-family: "Press Start 2P", cursive;
  font-size: 0.85rem;
  text-shadow: 0 0 10px rgba(0, 234, 255, 0.5);
}

@keyframes floatingCoin {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-40px) scale(0.85);
    opacity: 0;
  }
}

.clicker-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #00eaff;
  opacity: 0.9;
  pointer-events: none;
  animation: particleBurst 0.6s ease-out forwards;
}

@keyframes particleBurst {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) scale(0.2);
    opacity: 0;
  }
}

/* ============================
   Cosmetics – Body-Klassen
   ============================ */

body.cosmetic-gradient-mesh {
  background:
    radial-gradient(circle at 0% 0%, rgba(0, 255, 255, 0.12), transparent 55%),
    radial-gradient(circle at 100% 0%, rgba(255, 0, 255, 0.16), transparent 55%),
    radial-gradient(circle at 50% 100%, rgba(0, 255, 128, 0.2), transparent 60%),
    #050816;
  background-attachment: fixed;
  animation: mt-gradient-move 18s ease-in-out infinite alternate;
}

@keyframes mt-gradient-move {
  0% {
    background-position: 0% 0%, 100% 0%, 50% 100%;
  }
  100% {
    background-position: 10% 20%, 90% 10%, 60% 90%;
  }
}

body.cosmetic-glow-logo .logo {
  position: relative;
}

body.cosmetic-glow-logo .logo img {
  filter: drop-shadow(0 0 8px rgba(79, 70, 229, 0.6)) 
          drop-shadow(0 0 16px rgba(79, 70, 229, 0.4))
          drop-shadow(0 0 24px rgba(79, 70, 229, 0.2));
  transition: filter 0.3s ease;
}

body.cosmetic-glow-logo .logo:hover img {
  filter: drop-shadow(0 0 12px rgba(79, 70, 229, 0.8)) 
          drop-shadow(0 0 24px rgba(79, 70, 229, 0.6))
          drop-shadow(0 0 36px rgba(79, 70, 229, 0.3));
}

body.cosmetic-particles::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    radial-gradient(circle at 10% 20%, rgba(0, 255, 255, 0.09) 2px, transparent 0),
    radial-gradient(circle at 80% 70%, rgba(255, 0, 255, 0.12) 3px, transparent 0);
  background-size: 100% 2px, 120px 120px, 160px 160px;
  mix-blend-mode: screen;
  animation: mt-particles-float 24s linear infinite;
  z-index: -1;
}

body.cosmetic-scanlines::after {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.05) 0,
    rgba(255, 255, 255, 0.02) 1px,
    transparent 2px,
    transparent 4px
  );
  mix-blend-mode: soft-light;
  opacity: 0.25;
  z-index: -1;
}

body.cosmetic-neon .card,
body.cosmetic-neon .btn,
body.cosmetic-neon .modem-click-area {
  border-color: rgba(0, 234, 255, 0.6);
  box-shadow:
    0 0 18px rgba(0, 234, 255, 0.25),
    0 0 34px rgba(79, 70, 229, 0.2);
}

body.cosmetic-neon .btn {
  color: #0c1016;
  background: linear-gradient(135deg, #67d6e2, #8ff6ff);
}

body.cosmetic-modem-skins .modem-click-area {
  border-color: rgba(255, 255, 255, 0.5);
}

body.cosmetic-coin-trails .floating-coin {
  color: #6ef2ff;
}

@keyframes mt-particles-float {
  0% {
    background-position: 0 0, 0 0, 0 0;
  }
  100% {
    background-position: 0 0, -200px -400px, 200px 300px;
  }
}

body.cosmetic-glass .tool-card,
body.cosmetic-glass .clicker-card,
body.cosmetic-glass .shop-card,
body.cosmetic-glass .upgrade-card,
body.cosmetic-glass .save-card,
body.cosmetic-glass .highscore-card {
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.4) 0%,
    rgba(30, 41, 59, 0.3) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

body.cosmetic-glass .tool-card::before,
body.cosmetic-glass .clicker-card::before,
body.cosmetic-glass .shop-card::before,
body.cosmetic-glass .upgrade-card::before,
body.cosmetic-glass .save-card::before,
body.cosmetic-glass .highscore-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s;
  pointer-events: none;
}

body.cosmetic-glass .tool-card:hover::before,
body.cosmetic-glass .clicker-card:hover::before,
body.cosmetic-glass .shop-card:hover::before,
body.cosmetic-glass .upgrade-card:hover::before,
body.cosmetic-glass .save-card:hover::before,
body.cosmetic-glass .highscore-card:hover::before {
  left: 100%;
}

body.cosmetic-hover .tool-card,
body.cosmetic-hover .clicker-card,
body.cosmetic-hover .shop-card,
body.cosmetic-hover .upgrade-card,
body.cosmetic-hover .prestige-card,
body.cosmetic-hover .save-card,
body.cosmetic-hover .highscore-card {
  transition:
    transform 0.18s ease-out,
    box-shadow 0.18s ease-out,
    border-color 0.18s;
}

body.cosmetic-hover .tool-card:hover,
body.cosmetic-hover .clicker-card:hover,
body.cosmetic-hover .shop-card:hover,
body.cosmetic-hover .upgrade-card:hover,
body.cosmetic-hover .prestige-card:hover,
body.cosmetic-hover .save-card:hover,
body.cosmetic-hover .highscore-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  border-color: rgba(0, 255, 255, 0.6);
}

/* Toast */
.toast {
  position: fixed;
  right: 1.8rem;
  bottom: 6.2rem;
  z-index: 50;

  max-width: 280px;
  padding: 0.75rem 1.1rem;
  border-radius: 999px;

  color: #f9fafb;
  font-size: 0.9rem;

  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.6);

  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.22s ease-out, transform 0.22s ease-out;
}

.toast--success {
  background: rgba(34, 197, 94, 0.9); /* grün, "Erfolg" */
}

.toast--error {
  background: rgba(239, 68, 68, 0.9); /* rot, "Fehler" */
}

/* sichtbarer Zustand */
.toast--visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================
   Responsive
   ============================ */

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

  .clicker-main-center {
    order: 0;
  }

  .clicker-main-left {
    order: 1;
  }

  .clicker-main-right {
    order: 2;
  }

  .clicker-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .clicker-card .clicker-stats {
    align-items: flex-start;
  }

  .modem-click-area {
    width: 180px;
    height: 180px;
  }
}
