/* ==================================================
   GLOBAL RESET & BASE STYLES
================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f5f5f5;
}

body {
  background: radial-gradient(circle at top, #1b2735 0%, #090a0f 60%, #050508 100%);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ==================================================
   LAYOUT CONTAINERS
================================================== */
.main-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  overflow: hidden;
}

/* ==================================================
   HEADER
================================================== */
.header {
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.stats {
  display: flex;
  gap: 20px;
}

.stat-block {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.06);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.stat-block:hover {
  background: rgba(255, 255, 255, 0.12);
}

.stat-label {
  font-size: 0.7rem;
  opacity: 0.8;
  text-transform: uppercase;
}

.stat-value {
  font-size: 1rem;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.save-btn {
  padding: 6px 12px;
  background: #1e88e5;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s ease;
}

.save-btn:hover {
  background: #42a5f5;
}

.save-status {
  font-size: 0.8rem;
  opacity: 0.8;
}

/* ==================================================
   PLANET PANEL (LEFT SIDE)
================================================== */
.left-panel {
  display: flex;
  justify-content: center;
  align-items: center;
}

.planet-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

#planet-btn:active {
  transform: scale(0.97);
  box-shadow:
    0 0 20px rgba(74, 213, 255, 0.8),
    inset 0 0 25px rgba(255, 255, 255, 0.35);
}

@keyframes rotateRing {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.planet-label {
  font-size: 1.2rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.85;
}

.cd-display-big {
  font-size: 1.4rem;
  font-weight: 700;
}

.cd-icon {
  color: #ffcc80;
}

/* ==================================================
   TAP FLOATING TEXT
================================================== */
.floating-text {
  position: absolute;
  pointer-events: none;
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffeb3b;
  text-shadow: 0 0 6px rgba(0,0,0,0.8);
  animation: floatUp 0.9s ease-out forwards;
}

@keyframes floatUp {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(-40px); opacity: 0; }
}

/* ==================================================
   SHOP PANEL (RIGHT SIDE)
================================================== */
.right-panel {
  background: rgba(0, 0, 0, 0.52);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.shop-header {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 2px;
  opacity: 0.9;
}

.shop-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px 10px 14px;
  min-height: 0;
}

.shop-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(0,0,0,0.4));
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.shop-item:hover {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(0,0,0,0.5));
  box-shadow: 0 0 10px rgba(0,0,0,0.6);
  transform: translateY(-1px);
}

.shop-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.shop-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shop-item-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.shop-item-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.shop-item-type {
  font-size: 0.65rem;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.10);
}

.shop-item-desc {
  font-size: 0.78rem;
  opacity: 0.9;
}

.shop-item-owned {
  font-size: 0.75rem;
  opacity: 0.8;
}

.shop-item-cost {
  text-align: right;
  font-size: 0.8rem;
}

.shop-item-cost .value {
  font-weight: 700;
}

.shop-item-cost .label {
  font-size: 0.65rem;
  opacity: 0.7;
}

.shop-category {
  margin-bottom: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 4px;
  background: rgba(255,255,255,0.03);
}

.shop-category summary {
  cursor: pointer;
  font-weight: 700;
  padding: 6px;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

/* ==================================================
   BUY MULTIPLIER BAR
================================================== */
#buy-multiplier {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

#buy-multiplier button {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(10, 10, 20, 0.9);
  color: #f5f5f5;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.1s ease,
    box-shadow 0.15s ease;
}

#buy-multiplier button:hover {
  background: rgba(40, 40, 80, 0.95);
  border-color: rgba(150, 200, 255, 0.9);
  box-shadow: 0 0 6px rgba(120, 180, 255, 0.6);
}

#buy-multiplier button.active {
  background: linear-gradient(135deg, #3f8cff, #7b5cff);
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 10px rgba(120, 180, 255, 0.9);
  transform: translateY(-1px);
}

/* ==================================================
   FOOTER
================================================== */
.footer {
  padding: 8px 16px;
  background: rgba(0,0,0,0.55);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.highlight {
  color: #ffeb3b;
  font-weight: 600;
}

/* ==================================================
   MODAL — SHARED STYLES
================================================== */
.modal {
  position: fixed;
  top: 0; 
  left: 0;
  width: 100%; 
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.modal.hidden {
  display: none;
}

.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}

.modal-content {
  position: relative;
  background: #11141a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  width: 420px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 20px;
  color: #fff;
  text-align: center;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.modal-header {
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-body {
  padding: 12px;
  overflow-y: auto;
}

/* ==================================================
   STAT BREAKDOWN MODAL
================================================== */
.breakdown-summary {
  font-size: 1rem;
  margin-bottom: 10px;
  font-weight: 600;
}

.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.breakdown-item {
  padding: 6px 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
}

/* ==================================================
   OFFLINE MODAL
================================================== */
#offline-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

#offline-modal.hidden {
  display: none;
}

#offline-modal .modal-content {
  background: #1a1a1a;
  padding: 20px 30px;
  border-radius: 10px;
  text-align: center;
  color: white;
  max-width: 300px;
}

.modal-close-btn {
  margin-top: 15px;
  padding: 8px 16px;
  background: #4caf50;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: white;
  font-size: 16px;
}

/* ==================================================
   SETTINGS MODAL
================================================== */
.settings-button {
  position: fixed;
  top: 15px;
  right: 15px;
  background: #1a1a1a;
  color: white;
  border: 2px solid #4caf50;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  z-index: 1000;
}

#settings-modal .modal-content {
  background: #1a1a1a;
  padding: 25px 30px;
  border-radius: 10px;
  color: white;
  width: 300px;
  text-align: center;
}

.settings-row {
  margin: 12px 0;
}

.settings-row button {
  width: 100%;
  padding: 10px;
  background: #333;
  border: 1px solid #4caf50;
  color: white;
  border-radius: 6px;
  cursor: pointer;
}

.settings-info {
  margin-top: 20px;
  opacity: 0.8;
}

#style-options button {
  margin: 5px;
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: #222;
  color: #fff;
  transition: background 0.2s ease;
}

#style-options button:hover {
  background: #444;
}

#style-options button[data-style="gold"] {
  background: linear-gradient(135deg, #ffd700, #ffcc00);
  color: #000;
}

/* ==================================================
   RESPONSIVE RULES
================================================== */
@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .main-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .right-panel {
    min-height: 50vh;
  }
}

  .dev-box{
   position: fixed;
   top: 20px;
   right: 20px;
   background: #1a1a1a;
   padding: 15px;
   border-radius: 8px;
   color: black;
   z-index: 9999;
   border: 1px solid #444;
  }

/* ==================================================
   HOME PLANET COLOR SYSTEM
================================================== */

#planet-btn {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  cursor: pointer;
  border: 4px solid #ffffff22;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
  margin: 0 auto;
}

/* Blue (Default) */
.planet-blue {
  background: radial-gradient(circle at 30% 30%, #7fe1ff, #1b4b7a);
  box-shadow: 0 0 35px rgba(0, 180, 255, 0.7);
}

/* Green */
.planet-green {
  background: radial-gradient(circle at 30% 30%, #a6ff7f, #1f6b3a);
  box-shadow: 0 0 35px rgba(0, 255, 120, 0.7);
}

/* Red */
.planet-red {
  background: radial-gradient(circle at 30% 30%, #ff9f9f, #7a1b1b);
  box-shadow: 0 0 35px rgba(255, 80, 80, 0.7);
}

/* Orange */
.planet-orange {
  background: radial-gradient(circle at 30% 30%, #ffd29f, #7a3b1b);
  box-shadow: 0 0 35px rgba(255, 160, 80, 0.7);
}

/* Yellow */
.planet-yellow {
  background: radial-gradient(circle at 30% 30%, #fff7a0, #7a6b1b);
  box-shadow: 0 0 35px rgba(255, 240, 120, 0.7);
}

/* Purple */
.planet-purple {
  background: radial-gradient(circle at 30% 30%, #e3a0ff, #3b1b7a);
  box-shadow: 0 0 35px rgba(200, 120, 255, 0.7);
}

/* Gold */
.planet-gold {
  background: radial-gradient(circle at 30% 30%, #ffe680, #b8860b);
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.9);
}

/* White */
.planet-white {
  background: radial-gradient(circle at 30% 30%, #ffffff, #c0c0c0);
  box-shadow: 0 0 35px rgba(255, 255, 255, 0.8);
}

/* SETTINGS ROW — LABEL + SELECT */
.setting-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0;
  text-align: left;
}

.setting-row label {
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0.85;
  letter-spacing: 0.5px;
}

/* DROPDOWN SELECT */
#planet-color-select {
  width: 100%;
  padding: 8px 10px;
  background: #222;
  color: #fff;
  border: 1px solid #4caf50;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

/* Hover + Focus */
#planet-color-select:hover {
  background: #2d2d2d;
  border-color: #6dfc7a;
}

#planet-color-select:focus {
  outline: none;
  border-color: #8aff9c;
  background: #2f2f2f;
}

/* Dropdown options */
#planet-color-select option {
  background: #1a1a1a;
  color: #fff;
}
