/* ===================== NOSSA FAZENDA - estilos ===================== */
:root {
  --verde: #7ed957;
  --verde-esc: #2f6b3a;
  --dourado: #ffd166;
  --creme: #f6f2e6;
  --escuro: #0d1710;
  --vidro: rgba(12, 24, 16, .62);
  --borda: rgba(255, 255, 255, .14);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

.oculto { display: none !important; }

html, body {
  margin: 0; padding: 0;
  height: 100%; width: 100%;
  overflow: hidden;
  position: fixed;
  background: #0d1710;
  color: var(--creme);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#app { position: fixed; inset: 0; }

#tela { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

#hud { position: absolute; inset: 0; pointer-events: none; }

#hud::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0;
  height: 120px;
  background: linear-gradient(to bottom, rgba(6, 14, 9, .55), rgba(6, 14, 9, 0));
  pointer-events: none;
}

/* ---------------- topo ---------------- */
#topo {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 10px; right: 10px;
  display: flex; gap: 8px; align-items: center;
  justify-content: flex-start;
}

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--vidro);
  border: 1px solid var(--borda);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 15px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.pill .ico { font-size: 15px; }
.pill b { font-weight: 700; letter-spacing: .3px; font-variant-numeric: tabular-nums; }

.pill.dinheiro b { color: var(--dourado); }
.pill.dinheiro.pulso { animation: pulso .45s ease; }
@keyframes pulso {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.bolinha {
  width: 9px; height: 9px; border-radius: 50%;
  background: #ff5a5a;
  box-shadow: 0 0 0 3px rgba(255, 90, 90, .18);
}
.bolinha.on { background: var(--verde); box-shadow: 0 0 0 3px rgba(126, 217, 87, .22); }

.pill.online { margin-left: auto; font-size: 13px; padding: 7px 11px; }
.pill.online b { color: #cfe9c6; }

/* ---------------- recados ---------------- */
#recado {
  position: absolute;
  top: 74px; left: 50%;
  transform: translate(-50%, -12px);
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(20, 34, 24, .92);
  border: 1px solid var(--borda);
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0;
  transition: opacity .22s, transform .22s;
  max-width: 88vw;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#recado.show { opacity: 1; transform: translate(-50%, 0); }
#recado.erro { background: rgba(96, 26, 26, .95); }

/* ---------------- diário (log) ---------------- */
#diario {
  position: absolute;
  right: 10px;
  top: 108px;
  display: flex; flex-direction: column; gap: 5px;
  align-items: flex-end;
  max-width: 62vw;
  opacity: 0;
  transition: opacity .55s;
  pointer-events: none;
}
#diario.show { opacity: 1; }
.linha-log {
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(10, 20, 13, .58);
  border: 1px solid rgba(255, 255, 255, .07);
  color: rgba(240, 245, 235, .82);
  backdrop-filter: blur(6px);
  animation: entraLog .35s ease;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@keyframes entraLog { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

/* ---------------- barra de sementes ---------------- */
#barra {
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  padding: 12px 10px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(6, 12, 8, .92), rgba(6, 12, 8, 0));
  pointer-events: auto;
}

#sementes {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 6px;
  scrollbar-width: none;
}
#sementes::-webkit-scrollbar { display: none; }

.semente {
  flex: 0 0 auto;
  width: 76px;
  padding: 9px 6px 8px;
  border-radius: 15px;
  background: rgba(22, 38, 26, .82);
  border: 1.5px solid rgba(255, 255, 255, .1);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: transform .12s, border-color .15s, background .15s;
  position: relative;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
}
.semente .emoji { font-size: 26px; line-height: 1.05; }
.semente .nome { font-size: 10.5px; font-weight: 700; color: #dfeada; }
.semente .preco { font-size: 10.5px; color: var(--dourado); font-weight: 700; }
.semente.ativa {
  border-color: var(--verde);
  background: rgba(46, 82, 40, .95);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(126, 217, 87, .25);
}
.semente.pobre { opacity: .5; }
.semente.pobre .preco { color: #ff8b8b; }
.semente:active { transform: scale(.95); }

/* ---------------- botão ajuda ---------------- */
#btn-ajuda {
  position: absolute;
  right: 12px;
  bottom: calc(104px + env(safe-area-inset-bottom));
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--borda);
  background: var(--vidro);
  color: var(--creme);
  font-size: 17px; font-weight: 800;
  backdrop-filter: blur(10px);
  pointer-events: auto;
  cursor: pointer;
}

/* ---------------- modais ---------------- */
.modal {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  background: radial-gradient(circle at 50% 32%, rgba(22, 44, 28, .78), rgba(5, 10, 7, .93));
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 20;
  pointer-events: auto;
}
.modal.oculto { display: none; }

.cartao {
  width: 100%; max-width: 380px;
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(170deg, rgba(30, 50, 34, .96), rgba(16, 28, 20, .98));
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 24px;
  padding: 26px 22px 22px;
  text-align: center;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .6);
  animation: sobe .3s ease;
}
@keyframes sobe { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }

.logo { font-size: 46px; line-height: 1; filter: drop-shadow(0 6px 14px rgba(0,0,0,.4)); }
.cartao h1 {
  margin: 6px 0 2px;
  font-size: 26px;
  letter-spacing: -.5px;
  color: #fff;
}
.cartao h2 { margin: 0 0 14px; font-size: 20px; }
.sub { margin: 0 0 20px; font-size: 13px; color: rgba(230, 240, 225, .6); }

.cartao label {
  display: block; text-align: left;
  font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  color: rgba(230, 240, 225, .55);
  margin: 0 0 7px 3px;
}

#nome, #codigo {
  width: 100%;
  padding: 14px 15px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, .13);
  background: rgba(5, 12, 8, .6);
  color: #fff;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
#nome:focus, #codigo:focus { border-color: var(--verde); }

#grupo-codigo { margin-top: 14px; text-align: left; }
#grupo-codigo label { margin-bottom: 7px; }

.cores { display: flex; gap: 9px; justify-content: center; margin: 16px 0 20px; }
.cor {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: transform .14s, border-color .14s;
}
.cor.ativa { border-color: #fff; transform: scale(1.14); }

.botao {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(180deg, #86e05f, #4fa93a);
  color: #10240f;
  font-size: 15.5px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(90, 190, 70, .28);
  transition: transform .1s;
}
.botao:active { transform: scale(.97); }
.botao.grande { padding: 16px; font-size: 16.5px; }

.botao.secundario {
  margin-top: 10px;
  padding: 12px;
  font-size: 14px;
  background: transparent;
  color: #e6f2df;
  border: 1.5px solid rgba(255, 255, 255, .22);
  box-shadow: none;
}

.dica {
  margin: 14px 0 0;
  font-size: 11.5px;
  color: rgba(230, 240, 225, .45);
  min-height: 16px;
}
.dica.ruim { color: #ff9b9b; }

.ajuda { text-align: left; }
.ajuda ul { margin: 0; padding-left: 18px; }
.ajuda li { font-size: 13.5px; line-height: 1.65; margin-bottom: 9px; color: rgba(240, 245, 235, .88); }
.truques {
  margin: 16px 0 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(126, 217, 87, .1);
  border: 1px solid rgba(126, 217, 87, .22);
}
.truques p { margin: 0; font-size: 12.5px; color: #d6f0c8; line-height: 1.5; }
