@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;600;700&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #1a0a00;
  font-family: 'Nunito', sans-serif;
  color: #fff;
  overflow-x: hidden;
}

#ui-wrap {
  max-width: 900px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── HEADER ─────────────────────────────────────────────────────────────── */

#header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #2d1200;
  border-bottom: 3px solid #FFD700;
  position: sticky;
  top: 0;
  z-index: 100;
}

#logo {
  font-family: 'Fredoka One', cursive;
  font-size: 22px;
  color: #FFD700;
  letter-spacing: 2px;
}

#soles-display {
  font-size: 20px;
  font-weight: 700;
  color: #FFD700;
  background: #1a0a00;
  padding: 6px 16px;
  border-radius: 20px;
  border: 2px solid #FFD700;
}

/* ─── MAIN ───────────────────────────────────────────────────────────────── */

#main-area {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 12px;
  padding: 12px;
  flex: 1;
}

/* ─── NEGOCIO ACTUAL ─────────────────────────────────────────────────────── */

#negocio-actual {
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 350px;
  border: 3px solid rgba(255,255,255,0.2);
}

#negocio-emoji {
  font-size: 72px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

#negocio-nombre {
  font-family: 'Fredoka One', cursive;
  font-size: 22px;
  text-align: center;
  color: #fff;
}

#negocio-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  text-align: center;
}

#btn-click {
  background: #FFD700;
  color: #1a0a00;
  border: none;
  padding: 14px 32px;
  border-radius: 50px;
  font-family: 'Fredoka One', cursive;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  box-shadow: 0 4px 0 #b8960c;
  margin-top: 8px;
}

#btn-click:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #b8960c; }
#btn-click:active, #btn-click.clicked { transform: translateY(4px); box-shadow: 0 0px 0 #b8960c; }

#idle-info {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  text-align: center;
}

#idle-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(0,0,0,0.3);
  border-radius: 3px;
  overflow: hidden;
}

.idle-bar {
  height: 100%;
  background: #FFD700;
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}

/* ─── SIDE PANEL ─────────────────────────────────────────────────────────── */

#side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: calc(100vh - 80px);
}

.panel-titulo {
  font-family: 'Fredoka One', cursive;
  font-size: 15px;
  color: #FFD700;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

/* ─── MEJORAS ────────────────────────────────────────────────────────────── */

#mejoras-panel {
  background: #2d1200;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid #4a2000;
}

.mejora-item {
  background: #1a0a00;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid #3a1800;
  transition: border-color 0.2s;
}

.mejora-item.disponible { border-color: #FFD700; }
.mejora-item.comprada   { opacity: 0.6; }

.mejora-nombre { font-size: 13px; font-weight: 700; color: #fff; }
.mejora-desc   { font-size: 11px; color: #aaa; margin: 3px 0 6px; }
.mejora-status { font-size: 11px; color: #66BB6A; }

.btn-mejora {
  background: #FFD700;
  color: #1a0a00;
  border: none;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-mejora:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-mejora:hover:not(:disabled) { background: #ffe033; }

/* ─── NEGOCIOS ───────────────────────────────────────────────────────────── */

#negocios-panel {
  background: #2d1200;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid #4a2000;
}

.negocio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 6px;
  background: #1a0a00;
  border: 1px solid #3a1800;
  transition: border-color 0.2s;
}

.negocio-item.activo  { border-color: #FFD700; background: #2d1a00; }
.negocio-item.bloqueado { opacity: 0.5; }

.negocio-emoji { font-size: 24px; }

.negocio-info { flex: 1; }

.negocio-item-nombre {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.btn-negocio {
  background: transparent;
  border: 1px solid #FFD700;
  color: #FFD700;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-negocio:hover:not(:disabled) { background: #FFD700; color: #1a0a00; }
.btn-negocio.seleccionado { background: #FFD700; color: #1a0a00; cursor: default; }
.btn-negocio:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-desbloquear { border-color: #66BB6A; color: #66BB6A; }
.btn-desbloquear:hover:not(:disabled) { background: #66BB6A; color: #1a0a00; }

/* ─── FOOTER ─────────────────────────────────────────────────────────────── */

#footer {
  padding: 10px 16px;
  background: #2d1200;
  border-top: 1px solid #4a2000;
  text-align: center;
}

#stats { font-size: 12px; color: #888; }

/* ─── ANIMACIONES ────────────────────────────────────────────────────────── */

@keyframes floatUp {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-60px); }
}

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #FFD700;
  color: #1a0a00;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 14px;
  z-index: 999;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  #main-area {
    grid-template-columns: 1fr;
  }
  #side-panel {
    max-height: none;
  }
}



#btn-inventario {
  background: #2d1200;
  border: 2px solid #FFD700;
  color: #FFD700;
  padding: 5px 14px;
  border-radius: 20px;
  font-family: 'Fredoka One', cursive;
  font-size: 14px;
  cursor: pointer;
  pointer-events: all;
  transition: all 0.2s;
}
#btn-inventario:hover { background: #FFD700; color: #1a0a00; }

#inventario-panel {
  position: fixed;
  bottom: 0; right: 0;
  width: 280px;
  background: rgba(26,10,0,0.95);
  border-top: 2px solid #FFD700;
  border-left: 2px solid #FFD700;
  border-radius: 12px 0 0 0;
  padding: 14px;
  display: none;
  pointer-events: all;
  z-index: 30;
  max-height: 60vh;
  overflow-y: auto;
}
#inventario-titulo {
  font-family: 'Fredoka One', cursive;
  font-size: 16px;
  color: #FFD700;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.inv-item {
  background: #1a0a00;
  border: 1px solid #3a1800;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.inv-item-emoji { font-size: 28px; }
.inv-item-info { flex: 1; }
.inv-item-nombre {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}
.inv-btn {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid #FFD700;
  color: #FFD700;
  background: transparent;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  transition: all 0.2s;
}
.inv-btn:hover { background: #FFD700; color: #1a0a00; }
.inv-btn.colocado { border-color: #66BB6A; color: #66BB6A; cursor: default; }
.inv-btn.bloqueado { border-color: #555; color: #555; cursor: not-allowed; }

#modo-colocacion-msg {
  position: fixed;
  top: 70px; left: 50%;
  transform: translateX(-50%);
  background: rgba(255,215,0,0.9);
  color: #1a0a00;
  padding: 8px 20px;
  border-radius: 20px;
  font-family: 'Fredoka One', cursive;
  font-size: 14px;
  display: none;
  z-index: 50;
  pointer-events: none;
}