* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface2: #1a1a26;
  --gold: #d4a843;
  --gold-dim: #a07d2e;
  --gold-bright: #f5d060;
  --green: #2ecc71;
  --red: #e74c3c;
  --text: #e8e8ee;
  --text-dim: #8888a0;
  --accent: #6c5ce7;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem;
}

header {
  text-align: center;
  padding: 1.5rem 0 1rem;
}

header h1 {
  font-size: 2rem;
  color: var(--gold);
  text-shadow: 0 0 30px rgba(212, 168, 67, 0.3);
  letter-spacing: 0.05em;
}

.tagline {
  color: var(--text-dim);
  font-style: italic;
  margin-top: 0.25rem;
  font-size: 0.9rem;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

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

/* --- Clicker Panel --- */

.clicker-panel {
  background: var(--surface);
  border: 1px solid #2a2a3a;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.money-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.25rem;
}

.money-display span {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}

.money-display small {
  color: var(--text-dim);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.rate-display {
  color: var(--green);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

#click-btn {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  background: linear-gradient(145deg, #1e1e2e, #14141e);
  color: var(--gold);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  transition: transform 0.08s, box-shadow 0.08s;
  box-shadow: 0 0 20px rgba(212, 168, 67, 0.15);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#click-btn:hover {
  box-shadow: 0 0 35px rgba(212, 168, 67, 0.3);
}

#click-btn:active {
  transform: scale(0.94);
  box-shadow: 0 0 10px rgba(212, 168, 67, 0.2);
}

.btn-icon {
  font-size: 2.5rem;
}

.btn-label {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.click-power {
  margin-top: 0.75rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

#floaters {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.floater {
  position: absolute;
  color: var(--gold-bright);
  font-weight: 700;
  font-size: 1.1rem;
  animation: float-up 0.9s ease-out forwards;
  pointer-events: none;
}

@keyframes float-up {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-80px) scale(0.6); }
}

.stats-bar {
  display: flex;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #2a2a3a;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

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

.stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stat-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

/* --- Shop Panel --- */

.shop-panel {
  background: var(--surface);
  border: 1px solid #2a2a3a;
  border-radius: 12px;
  padding: 1.25rem;
  max-height: 80vh;
  overflow-y: auto;
}

.shop-panel h2 {
  font-size: 1.1rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.mt {
  margin-top: 1.25rem;
}

.upgrade-card {
  background: var(--surface2);
  border: 1px solid #2a2a3a;
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s, opacity 0.15s;
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  align-items: center;
  gap: 0.6rem;
}

.upgrade-card:hover:not(.disabled) {
  border-color: var(--gold-dim);
}

.upgrade-card.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.upgrade-icon {
  font-size: 1.5rem;
  text-align: center;
}

.upgrade-info h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.upgrade-info p {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.1rem;
}

.upgrade-right {
  text-align: right;
}

.upgrade-cost {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
}

.upgrade-owned {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* --- News Ticker --- */

#news-ticker {
  background: var(--surface);
  border: 1px solid #2a2a3a;
  border-radius: 8px;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  overflow: hidden;
  white-space: nowrap;
}

#news-content {
  display: inline-block;
  animation: scroll-left 25s linear infinite;
  color: var(--text-dim);
  font-size: 0.8rem;
}

@keyframes scroll-left {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* --- Footer --- */

footer {
  text-align: center;
  padding: 1.5rem 0;
  color: var(--text-dim);
  font-size: 0.75rem;
}

.reset-btn {
  margin-top: 0.5rem;
  background: none;
  border: 1px solid #3a3a4a;
  color: var(--text-dim);
  padding: 0.4rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
}

.reset-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

/* --- Milestone Popup --- */

#milestone-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fade-in 0.3s;
}

#milestone-popup.hidden {
  display: none;
}

.milestone-content {
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  max-width: 360px;
  animation: pop-in 0.3s;
}

.milestone-content span {
  font-size: 3rem;
}

.milestone-content h3 {
  color: var(--gold);
  margin: 0.5rem 0 0.25rem;
}

.milestone-content p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

@keyframes fade-in {
  from { opacity: 0; } to { opacity: 1; }
}

@keyframes pop-in {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Scrollbar */
.shop-panel::-webkit-scrollbar { width: 6px; }
.shop-panel::-webkit-scrollbar-track { background: transparent; }
.shop-panel::-webkit-scrollbar-thumb { background: #2a2a3a; border-radius: 3px; }
