/* ===== Mini Fazenda Premium — tema "rede social 2000s" + fazenda ===== */
:root {
  --azul: #3b6fb6;
  --azul-claro: #d4e2f4;
  --rosa: #d6336c;
  --fundo: #e8eefa;
  --card: #ffffff;
  --texto: #2b2f3a;
  --muted: #6b7280;
  --terra: #8b5a2b;
  --terra-escura: #6b4220;
  --grama: #6fbf4a;
  --ouro: #f5b301;
  --sombra: 0 2px 8px rgba(30, 50, 90, .15);
  --raio: 10px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Verdana, Tahoma, "Segoe UI", sans-serif;
  font-size: 13px;
  color: var(--texto);
  background: var(--fundo);
}
h2, h3 { margin: .2em 0 .5em; color: var(--azul); }
h3 { font-size: 14px; }
.muted { color: var(--muted); }
button { font-family: inherit; cursor: pointer; }

/* ---------- topo ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 8px; padding: 8px 16px;
  background: linear-gradient(#4f86d1, var(--azul));
  color: #fff; box-shadow: var(--sombra); position: sticky; top: 0; z-index: 20;
}
.logo { font-size: 22px; letter-spacing: -1px; }
.logo b { color: #ffd6e6; }
.premium {
  font-size: 10px; letter-spacing: 1px; padding: 2px 6px; border-radius: 4px;
  background: linear-gradient(135deg, #ffe680, var(--ouro)); color: #6b4a00; vertical-align: middle;
}
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab {
  border: 0; padding: 6px 12px; border-radius: 6px 6px 0 0;
  background: rgba(255,255,255,.15); color: #fff; font-weight: bold;
}
.tab.active, .tab:hover { background: #fff; color: var(--azul); }

/* ---------- layout ---------- */
.layout {
  display: grid; grid-template-columns: 210px 1fr 260px; gap: 12px;
  max-width: 1280px; margin: 12px auto; padding: 0 12px;
}
.card {
  background: var(--card); border-radius: var(--raio); box-shadow: var(--sombra);
  padding: 12px; margin-bottom: 12px; border-top: 3px solid var(--azul-claro);
}

/* ---------- perfil ---------- */
.perfil { text-align: center; align-self: start; position: sticky; top: 64px; }
.avatar {
  font-size: 64px; width: 110px; height: 110px; margin: 0 auto 6px; border-radius: 12px;
  display: grid; place-items: center; background: linear-gradient(#fff, var(--azul-claro));
  border: 3px solid #fff; box-shadow: var(--sombra);
}
.link { background: none; border: 0; color: var(--azul); text-decoration: underline; font-size: 11px; }
.stat { display: flex; justify-content: space-between; padding: 5px 2px; border-bottom: 1px dashed #e3e8f2; }
.xpbar { height: 10px; background: #e6ecf6; border-radius: 6px; overflow: hidden; margin-top: 6px; }
.xpbar div { height: 100%; width: 0; background: linear-gradient(90deg, var(--rosa), #ff8fb3); transition: width .4s; }
.selos { margin: 8px 0; font-size: 18px; letter-spacing: 2px; }
.sync { margin-top: 8px; font-size: 11px; color: var(--muted); }

/* ---------- botões ---------- */
.btn {
  border: 0; border-radius: 6px; padding: 7px 12px; font-weight: bold; color: #fff;
  background: linear-gradient(#5c93dd, var(--azul)); box-shadow: 0 2px 0 #2a5290;
  transition: transform .08s;
}
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn.small { padding: 5px 10px; font-size: 12px; margin-top: 6px; }
.btn.rosa { background: linear-gradient(#ee5d8f, var(--rosa)); box-shadow: 0 2px 0 #a3204f; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- ferramentas ---------- */
.ferramentas { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; }
.ferr {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px;
  padding: 6px; border: 2px solid transparent; border-radius: 8px; background: #f3f6fc; font-size: 11px;
}
.ferr span { font-size: 22px; }
.ferr.active { border-color: var(--rosa); background: #ffe9f1; }
.ferr.bloq { opacity: .4; }

/* ---------- céu e cenário ---------- */
.ceu {
  position: relative; height: 110px; border-radius: var(--raio) var(--raio) 0 0; overflow: hidden;
  background: linear-gradient(#7ec8ff, #c9ecff); transition: background 2s;
}
.ceu.noite { background: linear-gradient(#0d1b3d, #3a4d7a); }
.sol {
  position: absolute; width: 50px; height: 50px; border-radius: 50%; top: 14px; left: 8%;
  background: radial-gradient(#fff6b0, #ffd23f); box-shadow: 0 0 40px #ffd23f; transition: left 1s, background 2s;
}
.ceu.noite .sol { background: radial-gradient(#fff, #cfd8ea); box-shadow: 0 0 30px #cfd8ea; }
.nuvem { position: absolute; width: 90px; height: 28px; background: #fff; border-radius: 30px; opacity: .9; animation: nuvem 60s linear infinite; }
.nuvem::before { content: ""; position: absolute; width: 44px; height: 40px; background: #fff; border-radius: 50%; top: -18px; left: 16px; }
.n1 { top: 22px; left: -100px; }
.n2 { top: 55px; left: -100px; animation-delay: -30s; transform: scale(.7); }
@keyframes nuvem { to { left: 110%; } }
.celeiro { position: absolute; right: 18px; bottom: -4px; font-size: 56px; }
.arvores { position: absolute; left: 30%; bottom: -6px; font-size: 38px; letter-spacing: -6px; }

/* ---------- terreno ---------- */
.terreno {
  position: relative; padding: 18px; border-radius: 0 0 var(--raio) var(--raio);
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.08) 2px, transparent 3px) 0 0/22px 22px,
    linear-gradient(var(--grama), #4e9a32);
  box-shadow: var(--sombra);
}
.grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.grid.mini { grid-template-columns: repeat(6, 1fr); gap: 5px; margin-bottom: 10px; }
.canteiro {
  position: relative; aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center;
  font-size: clamp(20px, 3.4vw, 38px); user-select: none; cursor: pointer;
  background: linear-gradient(#7fd05a, #5fae3e); box-shadow: inset 0 -4px 0 rgba(0,0,0,.15);
  transition: transform .1s, filter .1s;
}
.canteiro:hover { transform: scale(1.04); filter: brightness(1.08); }
.canteiro.arado, .canteiro.plantado, .canteiro.pronto {
  background:
    repeating-linear-gradient(0deg, transparent 0 7px, rgba(0,0,0,.12) 7px 9px),
    linear-gradient(var(--terra), var(--terra-escura));
}
.canteiro.regado { box-shadow: inset 0 -4px 0 rgba(0,0,0,.2), inset 0 0 0 3px #66b7ff; filter: saturate(1.2) brightness(.92); }
.canteiro.pronto { animation: pulsar 1.4s ease-in-out infinite; }
@keyframes pulsar { 50% { transform: scale(1.06); } }
.canteiro .barra {
  position: absolute; left: 8%; right: 8%; bottom: 6%; height: 5px; border-radius: 4px; background: rgba(0,0,0,.3);
}
.canteiro .barra i { display: block; height: 100%; border-radius: 4px; background: #9cff6b; }
.canteiro .praga { position: absolute; top: 2px; right: 4px; font-size: .55em; animation: tremer .4s infinite; }
@keyframes tremer { 50% { transform: rotate(12deg); } }
.canteiro .tempo { position: absolute; top: 3px; left: 5px; font-size: 10px; color: #fff; text-shadow: 0 1px 2px #000; }

.trator {
  position: absolute; font-size: 40px; left: -60px; top: 0; z-index: 5; pointer-events: none;
  transform: scaleX(-1); transition: left 1.2s linear; display: none;
}

.dica { margin-top: 8px; padding: 8px 12px; background: #fff8dc; border-left: 4px solid var(--ouro); border-radius: 6px; }

/* ---------- views ---------- */
.view { display: none; }
.view.active { display: block; animation: aparecer .25s; }
@keyframes aparecer { from { opacity: 0; transform: translateY(6px); } }

/* ---------- loja / celeiro ---------- */
.loja { display: flex; flex-direction: column; gap: 6px; }
.item {
  display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 8px;
  background: #f5f8fd; border: 2px solid transparent; cursor: pointer;
}
.item.sel { border-color: var(--rosa); background: #ffeef4; }
.item.bloq { opacity: .45; cursor: not-allowed; }
.item .ic { font-size: 24px; }
.item .info { flex: 1; line-height: 1.25; }
.item .info small { color: var(--muted); }
.celeiro-lista { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; }
.produto { padding: 4px 8px; background: #f5f8fd; border-radius: 6px; font-size: 14px; cursor: pointer; }
.produto:hover { background: #e2ecfb; }

.missoes { list-style: none; padding: 0; margin: 0; }
.missoes li { padding: 6px 0; border-bottom: 1px dashed #e3e8f2; }
.missoes li.ok { color: #2f8a2f; }
.missoes progress { width: 100%; height: 8px; }

/* ---------- vizinhos / recados / ranking ---------- */
.vizinhos { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.vizinho { text-align: center; padding: 10px; border-radius: 10px; background: #f5f8fd; }
.vizinho .av { font-size: 42px; }
.recado-form { display: flex; gap: 6px; margin-bottom: 10px; }
.recado-form input { flex: 1; padding: 8px; border: 1px solid #c9d5ea; border-radius: 6px; }
.recados { list-style: none; padding: 0; margin: 0; }
.recados li { padding: 8px; margin-bottom: 6px; background: #f5f8fd; border-left: 4px solid var(--rosa); border-radius: 6px; }
.recados li small { color: var(--muted); display: block; }
.ranking li { padding: 6px 0; }

/* ---------- ficha técnica ---------- */
.item .ficha-btn {
  border: 0; background: #fff; border-radius: 50%; width: 26px; height: 26px; font-size: 13px;
  box-shadow: var(--sombra);
}
.modal { position: fixed; inset: 0; background: rgba(20, 30, 60, .45); display: grid; place-items: center; z-index: 70; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box {
  position: relative; width: min(440px, 100%); max-height: 90vh; overflow: auto; background: #fffdf5;
  border-radius: 14px; padding: 18px; border: 4px solid #c99a5b; box-shadow: 0 10px 30px rgba(0,0,0,.3);
  background-image: repeating-linear-gradient(0deg, transparent 0 26px, rgba(201,154,91,.12) 26px 27px);
  animation: aparecer .2s;
}
.fechar { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 18px; }
.ficha-topo { display: flex; align-items: center; gap: 10px; }
.ficha-topo span { font-size: 44px; }
.ficha-status { margin: 6px 0; padding: 8px; border-radius: 8px; background: #e9f7e4; font-weight: bold; }
.ficha { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; margin: 10px 0; }
.ficha dt { font-weight: bold; color: var(--terra-escura); white-space: nowrap; }
.ficha dd { margin: 0; }
.aviso { font-size: 11px; color: var(--muted); border-top: 1px dashed #c99a5b; padding-top: 8px; margin: 0; }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 6px; z-index: 50; }
.toast {
  padding: 10px 14px; border-radius: 8px; background: #fff; box-shadow: var(--sombra);
  border-left: 5px solid var(--azul); animation: aparecer .25s; max-width: 280px;
}
.toast.bom { border-color: #39a845; }
.toast.ruim { border-color: #d64545; }
.flutuante {
  position: fixed; pointer-events: none; font-weight: bold; color: #fff; text-shadow: 0 1px 3px #000;
  animation: subir 1s forwards; z-index: 60;
}
@keyframes subir { to { transform: translateY(-40px); opacity: 0; } }

/* ---------- responsivo ---------- */
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .perfil { position: static; }
  .lateral { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .lateral .card { margin: 0; }
}
@media (max-width: 600px) {
  .lateral { grid-template-columns: 1fr; }
  .grid { gap: 5px; }
  .terreno { padding: 10px; }
  .ferr { min-width: 54px; }
}
