/* ===== ÁREA PRINCIPAL — llena todo el #app ===== */
#main-content {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* ===== HEADER / BARRA DE RECURSOS — flota arriba ===== */
#recursos-bar {
  position: absolute;
  top: calc(4px + env(safe-area-inset-top));
  left: 4px;
  right: 4px;
  height: 64px;
  z-index: 20;
  background-image: url('../img/header_container.webp');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 5px 6px;
}

.recurso-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 0 4px;
  border-right: 1px solid rgba(212,160,23,0.25);
  min-width: 0;
}

.recurso-item:last-child {
  border-right: none;
}

.recurso-item .recurso-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.recurso-item .recurso-label {
  font-family: var(--font-heading);
  font-size: 9px;
  color: var(--color-gold-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1;
}

.recurso-item .recurso-valor {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

.recurso-item .recurso-valor.flash {
  animation: flash-gold 0.7s ease-out;
}

/* ===== BOTTOM ACTION BAR — flota sobre el mapa ===== */
#cosechar-bar {
  position: absolute;
  bottom: var(--nav-height);
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  height: 62px;
  z-index: 10;
}

/* ===== BOTTOM NAV — gris pizarra con degradado (tono panel superior) ===== */
#bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: var(--nav-height);
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: linear-gradient(180deg, var(--panel-grey-top) 0%, var(--panel-grey-bot) 100%);
  border-top: 2px solid var(--color-gold-dark);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 -4px 12px rgba(0,0,0,0.45);
  z-index: 20;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 2px;
  position: relative;
  transition: background 0.15s;
}

.nav-btn:active {
  background: rgba(212,160,23,0.12);
}

.nav-btn img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  opacity: 0.65;
  transition: opacity 0.15s;
}

.nav-btn span {
  font-family: var(--font-heading);
  font-size: 9px;
  color: var(--color-text-dark);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: color 0.15s;
}

.nav-btn.active img {
  opacity: 1;
  filter: drop-shadow(0 0 4px var(--color-gold));
}

.nav-btn.active span {
  color: var(--color-gold-light);
}

.nav-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--color-gold);
  border-radius: 2px 2px 0 0;
}

/* ===== WELCOME SCREEN ===== */
.welcome-screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-color: #0a0803;
}

.welcome-bg {
  position: absolute;
  inset: 0;
  background-image: url('../img/castillo_bg.webp');
  background-size: cover;
  background-position: center;
  opacity: 0.4;
  z-index: 0;
}

.welcome-panel {
  position: relative;
  z-index: 1;
  background-image: url('../img/parchment_bg.webp');
  background-size: cover;
  border: 2px solid var(--color-gold-dark);
  border-radius: 8px;
  padding: 30px 20px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8), inset 0 0 20px rgba(139,105,20,0.3);
}

.welcome-title {
  font-family: var(--font-title);
  font-size: 36px;
  color: #2a1400;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.4);
  margin-bottom: 5px;
}

.welcome-subtitle {
  font-family: var(--font-heading);
  font-size: 14px;
  color: #6b4010;
  margin-bottom: 25px;
}

.welcome-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  text-align: left;
}

.welcome-form label {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: #3d1f00;
}

.welcome-form input {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--color-gold-dark);
  border-radius: 4px;
  padding: 10px;
  font-family: var(--font-body);
  font-size: 16px;
  color: #2a1400;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.welcome-form input:focus {
  background: rgba(255, 255, 255, 0.8);
  border-color: var(--color-gold);
  box-shadow: 0 0 5px rgba(212,160,23,0.5);
}

.welcome-btn {
  margin-top: 10px;
  width: 100%;
  padding: 12px;
  font-size: 14px;
}

.welcome-error {
  color: var(--color-danger);
  font-family: var(--font-body);
  font-size: 12px;
  text-align: center;
  min-height: 16px;
  font-weight: 700;
}
