/* Colheita Feliz 2026 — visual de jogo rústico isométrico */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #2c1810;
  color: #3a2515;
  user-select: none;
  -webkit-user-select: none;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
.font-display { font-family: 'Fredoka','Inter',sans-serif; }
.hidden { display: none !important; }
.font-mono { font-family: ui-monospace, 'JetBrains Mono', monospace; }

/* === AUTH SCREEN === */
.auth-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  z-index: 100;
  overflow: hidden;
}
.auth-bg-scene {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 110%, #84cc16 0%, #65a30d 35%, #166534 75%),
    linear-gradient(180deg, #7dd3fc 0%, #fde68a 50%, #84cc16 75%);
  background-blend-mode: multiply;
}
.auth-bg-scene::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.95) 0 18px, transparent 19px),
    radial-gradient(circle at 80% 24%, rgba(255,255,255,.85) 0 22px, transparent 23px),
    radial-gradient(circle at 35% 12%, rgba(255,255,255,.7) 0 14px, transparent 15px),
    radial-gradient(circle at 92% 60%, rgba(252,211,77,.65) 0 38px, transparent 40px); /* sol */
}
.auth-bg-scene::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 36%;
  background:
    repeating-linear-gradient( 100deg, transparent 0 24px, rgba(0,0,0,.07) 24px 26px ),
    linear-gradient(180deg, transparent 0%, #15803d 40%, #14532d 100%);
  clip-path: polygon(0 32%, 18% 18%, 35% 30%, 55% 14%, 75% 28%, 90% 18%, 100% 32%, 100% 100%, 0 100%);
}
.auth-card {
  position: relative; z-index: 2;
  background:
    repeating-linear-gradient(90deg, rgba(120,72,40,.08) 0 3px, transparent 3px 7px),
    linear-gradient(180deg, #fef3c7 0%, #fde68a 100%);
  border: 6px solid #78350f;
  border-radius: 28px;
  padding: 28px 26px 22px;
  width: 100%; max-width: 420px;
  box-shadow:
    0 0 0 4px #fde68a inset,
    0 24px 60px rgba(0,0,0,.45);
  animation: pop .45s cubic-bezier(.34,1.56,.64,1);
}
.auth-logo {
  text-align: center; position: relative;
  margin-bottom: 6px;
}
.auth-logo h1 {
  font-family: 'Fredoka','Inter',sans-serif;
  font-size: 36px; line-height: 1; margin: 0;
  color: #78350f; letter-spacing: -.02em;
  text-shadow: 2px 2px 0 #fde68a, 4px 4px 0 rgba(0,0,0,.12);
}
.logo-emoji {
  font-size: 64px; line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.25));
  animation: bob 3s ease-in-out infinite;
}
.year-badge {
  position: absolute; top: 4px; right: -10px;
  background: #dc2626; color: white;
  padding: 4px 10px; border-radius: 8px;
  font-weight: 800; font-size: 11px;
  transform: rotate(8deg);
  box-shadow: 0 2px 0 #7f1d1d, 0 4px 8px rgba(0,0,0,.3);
}
.auth-tag {
  text-align: center; margin: 6px 0 18px;
  color: #92400e; font-size: 13px;
}
.auth-tabs {
  display: flex; background: #78350f; border-radius: 14px;
  padding: 4px; margin-bottom: 16px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.35);
}
.auth-tab {
  flex: 1; padding: 9px;
  border-radius: 10px;
  font-weight: 700; font-size: 14px;
  color: #fed7aa;
  transition: all .15s;
}
.auth-tab.active {
  background: linear-gradient(180deg, #fde68a, #fbbf24);
  color: #78350f;
  box-shadow: 0 2px 0 #92400e, 0 1px 3px rgba(0,0,0,.2);
}
.auth-pane { display: flex; flex-direction: column; gap: 10px; }
.auth-pane input {
  padding: 12px 14px;
  background: #fef3c7;
  border: 3px solid #92400e;
  border-radius: 12px;
  font-size: 15px; color: #3a2515;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.1);
  transition: all .15s;
}
.auth-pane input:focus { border-color: #16a34a; background: white; }
.btn-wood {
  background: linear-gradient(180deg, #16a34a 0%, #15803d 100%);
  color: white;
  font-family: 'Fredoka','Inter',sans-serif; font-weight: 700; font-size: 16px;
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 4px 0 #14532d, 0 6px 12px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.3);
  transition: transform .1s;
  text-shadow: 0 -1px 0 rgba(0,0,0,.2);
}
.btn-wood:hover { filter: brightness(1.05); }
.btn-wood:active { transform: translateY(2px); box-shadow: 0 2px 0 #14532d, 0 3px 6px rgba(0,0,0,.2); }
.btn-wood.danger { background: linear-gradient(180deg, #ef4444, #b91c1c); box-shadow: 0 4px 0 #7f1d1d, 0 6px 12px rgba(0,0,0,.2); }
.btn-wood.danger:active { box-shadow: 0 2px 0 #7f1d1d; }
.btn-wood.amber { background: linear-gradient(180deg, #f59e0b, #d97706); box-shadow: 0 4px 0 #78350f, 0 6px 12px rgba(0,0,0,.2); }
.btn-wood.amber:active { box-shadow: 0 2px 0 #78350f; }
.btn-wood.sky { background: linear-gradient(180deg, #0ea5e9, #0369a1); box-shadow: 0 4px 0 #0c4a6e, 0 6px 12px rgba(0,0,0,.2); }
.btn-wood.sky:active { box-shadow: 0 2px 0 #0c4a6e; }
.auth-foot {
  margin: 14px 0 0; text-align: center;
  color: #92400e; font-size: 12px;
}

@keyframes pop {
  from { transform: scale(.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
@keyframes bob {
  0%,100% { transform: translateY(0) rotate(-3deg); }
  50%     { transform: translateY(-8px) rotate(3deg); }
}

/* === GAME SHELL === */
#game {
  position: fixed; inset: 0;
  background: #0c1e08;
  overflow: hidden;
}
#gameCanvas {
  position: absolute; inset: 0;
  z-index: 1;
}
#gameCanvas canvas { display: block; width: 100% !important; height: 100% !important; }

/* === HUD === */
.hud-top {
  position: absolute; top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(120,53,15,.85), rgba(120,53,15,.6) 70%, transparent);
  pointer-events: none;
}
.hud-top > * { pointer-events: auto; }
.hud-brand {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,247,200,.95);
  padding: 6px 12px; border-radius: 14px;
  border: 3px solid #78350f;
  box-shadow: 0 3px 0 #92400e, 0 4px 10px rgba(0,0,0,.3);
}
.hud-emoji { font-size: 28px; line-height: 1; }
.hud-title {
  font-family: 'Fredoka','Inter',sans-serif;
  font-weight: 700; font-size: 16px; line-height: 1;
  color: #78350f;
}
.hud-weather {
  font-size: 11px; color: #92400e; font-weight: 600;
}
.hud-stats {
  display: flex; gap: 8px; align-items: center;
}
.stat-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,247,200,.95);
  padding: 6px 12px; border-radius: 12px;
  border: 3px solid #78350f;
  box-shadow: 0 3px 0 #92400e, 0 4px 8px rgba(0,0,0,.3);
  font-weight: 800; font-size: 14px;
  color: #78350f;
  font-variant-numeric: tabular-nums;
}
.stat-pill.coin span:first-child  { filter: drop-shadow(0 0 4px #fbbf24); }
.stat-pill.xp    { background: linear-gradient(180deg, #ddd6fe, #c4b5fd); border-color: #5b21b6; box-shadow: 0 3px 0 #4c1d95, 0 4px 8px rgba(0,0,0,.3); color: #4c1d95; }
.stat-pill.energy{ background: linear-gradient(180deg, #fecaca, #fca5a5); border-color: #991b1b; box-shadow: 0 3px 0 #7f1d1d, 0 4px 8px rgba(0,0,0,.3); color: #991b1b; }
.logout-btn {
  width: 38px; height: 38px;
  background: rgba(255,247,200,.95);
  border: 3px solid #78350f;
  border-radius: 12px;
  box-shadow: 0 3px 0 #92400e, 0 4px 8px rgba(0,0,0,.3);
  font-size: 18px;
}
.logout-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #92400e; }

/* Level bar */
.hud-level {
  position: absolute; top: 60px; left: 14px; right: 14px;
  z-index: 19;
  display: flex; align-items: center; gap: 8px;
  background: rgba(120,53,15,.7);
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  pointer-events: none;
}
#lvlBadge { color: #fde68a; }
.lvl-bar {
  flex: 1; height: 8px;
  background: rgba(0,0,0,.4); border-radius: 999px; overflow: hidden;
}
#lvlBar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  border-radius: 999px;
  transition: width .4s;
  box-shadow: 0 0 8px rgba(251,191,36,.6);
}
#lvlXp { color: #fde68a; min-width: 50px; text-align: right; }

/* Bottom tab bar */
.hud-bottom {
  position: absolute; bottom: 0; left: 0; right: 0;
  z-index: 20;
  display: flex; overflow-x: auto;
  background: linear-gradient(0deg, rgba(120,53,15,.95), rgba(120,53,15,.75));
  padding: 8px 6px env(safe-area-inset-bottom, 8px);
  scrollbar-width: none;
  gap: 4px;
}
.hud-bottom::-webkit-scrollbar { display: none; }
.tab-btn {
  flex: 1; min-width: 60px;
  display: flex; flex-direction: column; align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: 10px;
  background: transparent; color: #fde68a;
  font-size: 11px; font-weight: 700;
  position: relative;
  transition: all .15s;
}
.tab-btn span:first-child { font-size: 22px; line-height: 1; }
.tab-btn.active {
  background: rgba(254,243,199,.95);
  color: #78350f;
  box-shadow: 0 -2px 6px rgba(0,0,0,.15), inset 0 -3px 0 #f59e0b;
}
.tab-btn:hover { background: rgba(255,255,255,.1); }
.tab-btn.active:hover { background: rgba(254,243,199,1); }
.badge {
  position: absolute; top: 2px; right: 8px;
  min-width: 16px; height: 16px;
  background: #dc2626; color: white;
  padding: 0 4px; border-radius: 999px;
  font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

/* Drawer */
.drawer {
  position: absolute; left: 0; right: 0; bottom: 80px;
  top: 100px;
  z-index: 25;
  background:
    repeating-linear-gradient(90deg, rgba(120,72,40,.06) 0 3px, transparent 3px 7px),
    linear-gradient(180deg, #fef3c7 0%, #fde68a 100%);
  border-top: 6px solid #78350f;
  border-bottom: 6px solid #78350f;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,.4);
  display: flex; flex-direction: column;
  animation: slideUp .3s ease-out;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  border-bottom: 3px solid #92400e;
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
  border-radius: 16px 16px 0 0;
}
.drawer-head h2 {
  margin: 0; color: #78350f;
  font-family: 'Fredoka','Inter',sans-serif; font-size: 22px;
  text-shadow: 0 2px 0 rgba(255,255,255,.4);
}
.drawer-close {
  width: 34px; height: 34px;
  background: white; color: #b91c1c;
  border-radius: 10px; font-size: 18px; font-weight: 800;
  border: 3px solid #92400e;
  box-shadow: 0 2px 0 #92400e;
}
.drawer-close:active { transform: translateY(2px); box-shadow: 0 0 0 #92400e; }
.drawer-body {
  flex: 1; overflow-y: auto;
  padding: 14px;
  -webkit-overflow-scrolling: touch;
}

/* Action menu (popover sobre o slot) */
.action-menu {
  position: absolute; z-index: 30;
  background:
    repeating-linear-gradient(90deg, rgba(120,72,40,.08) 0 3px, transparent 3px 7px),
    linear-gradient(180deg, #fef3c7, #fde68a);
  border: 4px solid #78350f;
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  display: flex; gap: 6px; flex-wrap: wrap;
  max-width: 320px;
  animation: pop .2s cubic-bezier(.34,1.56,.64,1);
}
.action-menu .act-btn {
  padding: 8px 12px;
  border-radius: 10px;
  background: white;
  border: 2px solid #92400e;
  font-weight: 700; font-size: 13px;
  color: #78350f;
  display: flex; align-items: center; gap: 4px;
  box-shadow: 0 2px 0 #92400e;
}
.action-menu .act-btn:active { transform: translateY(2px); box-shadow: 0 0 0 #92400e; }
.action-menu .act-btn.primary { background: linear-gradient(180deg, #16a34a, #15803d); color: white; border-color: #14532d; box-shadow: 0 2px 0 #14532d; }
.action-menu .act-btn.water { background: linear-gradient(180deg, #38bdf8, #0284c7); color: white; border-color: #0c4a6e; box-shadow: 0 2px 0 #0c4a6e; }
.action-menu .act-btn.fertil { background: linear-gradient(180deg, #f59e0b, #d97706); color: white; border-color: #78350f; box-shadow: 0 2px 0 #78350f; }
.action-menu .act-btn.pesti { background: linear-gradient(180deg, #f43f5e, #be123c); color: white; border-color: #881337; box-shadow: 0 2px 0 #881337; }
.action-menu .act-btn.danger { background: #475569; color: white; border-color: #1e293b; box-shadow: 0 2px 0 #1e293b; }

/* Seed picker (variante do action menu) */
.seed-picker {
  position: absolute; z-index: 30;
  background:
    repeating-linear-gradient(90deg, rgba(120,72,40,.08) 0 3px, transparent 3px 7px),
    linear-gradient(180deg, #fef3c7, #fde68a);
  border: 4px solid #78350f;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  display: grid; grid-template-columns: repeat(5, 56px); gap: 8px;
  max-width: 340px;
  animation: pop .25s cubic-bezier(.34,1.56,.64,1);
}
.seed-pick {
  width: 56px; height: 70px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: white;
  border: 2px solid #92400e;
  border-radius: 10px;
  box-shadow: 0 2px 0 #92400e;
  position: relative;
  transition: transform .1s;
}
.seed-pick:hover:not(.locked) { transform: translateY(-2px); }
.seed-pick:active:not(.locked) { transform: translateY(2px); box-shadow: 0 0 0 #92400e; }
.seed-pick .em { font-size: 28px; line-height: 1; }
.seed-pick .qty {
  font-size: 11px; font-weight: 800; color: #78350f;
}
.seed-pick.locked {
  opacity: .45; cursor: not-allowed;
  background: #d1d5db;
}
.seed-pick.locked::after {
  content: '🔒'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.seed-pick .tier {
  position: absolute; top: -4px; right: -4px;
  width: 8px; height: 8px;
  border-radius: 50%;
}
.tier-c { background: #94a3b8; }
.tier-r { background: #3b82f6; }
.tier-e { background: #a855f7; box-shadow: 0 0 6px #a855f7; }
.tier-l { background: linear-gradient(45deg, #fbbf24, #fef3c7, #fbbf24); box-shadow: 0 0 10px #fbbf24; }

/* === DRAWER CONTENT (cards) === */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.card-tile {
  background: white;
  border: 3px solid #92400e;
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
  position: relative;
  box-shadow: 0 4px 0 #78350f;
  transition: transform .1s;
}
.card-tile:hover { transform: translateY(-2px); }
.card-tile.locked { opacity: .55; }
.card-tile .em { font-size: 44px; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,.2)); margin-bottom: 4px; }
.card-tile .nm { font-weight: 800; color: #3a2515; font-size: 14px; }
.card-tile .sub { font-size: 11px; color: #78350f; margin: 2px 0; }
.card-tile .pr { color: #d97706; font-weight: 800; margin-top: 4px; font-size: 14px; }
.card-tile .tag {
  position: absolute; top: 6px; right: 6px;
  font-size: 9px; font-weight: 800; text-transform: uppercase;
  padding: 2px 6px; border-radius: 8px;
  letter-spacing: .04em;
}
.card-tile button {
  margin-top: 8px; width: 100%;
  padding: 6px;
  background: linear-gradient(180deg, #16a34a, #15803d);
  border-radius: 10px;
  color: white; font-weight: 800; font-size: 13px;
  border: 2px solid #14532d;
  box-shadow: 0 2px 0 #14532d;
}
.card-tile button:active { transform: translateY(2px); box-shadow: 0 0 0 #14532d; }
.card-tile button:disabled { background: #94a3b8; border-color: #475569; box-shadow: 0 2px 0 #475569; }
.card-tile button.cancel { background: linear-gradient(180deg, #ef4444, #b91c1c); border-color: #7f1d1d; box-shadow: 0 2px 0 #7f1d1d; }
.tag-comum    { background: #e2e8f0; color: #475569; }
.tag-rara     { background: #dbeafe; color: #1d4ed8; }
.tag-epica    { background: #f3e8ff; color: #6b21a8; }
.tag-lendaria {
  background: linear-gradient(90deg, #fde68a, #fbbf24, #fde68a);
  color: #78350f;
  background-size: 200% 100%; animation: shine 2.5s linear infinite;
}
@keyframes shine { 0%{background-position:-200% 0} 100%{background-position:200% 0} }

/* sub-tabs no drawer (loja seeds/tools, mercado all/seed/harvest/mine) */
.sub-tabs {
  display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap;
}
.sub-tab {
  padding: 6px 14px;
  background: white;
  border: 2px solid #92400e;
  border-radius: 999px;
  font-weight: 700; font-size: 13px;
  color: #78350f;
  box-shadow: 0 2px 0 #92400e;
}
.sub-tab.active {
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
  color: #78350f;
}
.sub-tab:active { transform: translateY(2px); box-shadow: 0 0 0 #92400e; }

/* Inventory cell */
.inv-cell {
  background: white;
  border: 3px solid #92400e;
  border-radius: 12px;
  padding: 10px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 3px 0 #78350f;
}
.inv-cell .em { font-size: 32px; line-height: 1; }
.inv-cell .nm { font-weight: 800; font-size: 14px; color: #3a2515; }
.inv-cell .sub { font-size: 11px; color: #78350f; }
.inv-cell .qty {
  margin-left: auto; font-weight: 800; color: #15803d;
  background: #dcfce7; padding: 4px 8px; border-radius: 8px;
}

/* Friend rows */
.friend-row {
  background: white;
  border: 3px solid #92400e;
  border-radius: 14px;
  padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
  box-shadow: 0 3px 0 #78350f;
}
.friend-row .avatar { font-size: 32px; }
.friend-row .info { flex: 1; }
.friend-row .info .nm { font-weight: 800; color: #3a2515; }
.friend-row .info .sub { font-size: 11px; color: #78350f; }

/* Mission card */
.mission-card {
  background: white;
  border: 3px solid #92400e;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 3px 0 #78350f;
  margin-bottom: 10px;
}
.mission-card.complete { background: linear-gradient(135deg, #ecfdf5, #fef3c7); }
.mission-card .head { display: flex; justify-content: space-between; align-items: center; }
.mission-card .nm { font-weight: 800; color: #3a2515; font-size: 14px; }
.mission-card .prog { font-size: 12px; color: #78350f; font-weight: 700; font-family: ui-monospace, monospace; }
.mission-card .bar { height: 10px; background: #f3e8ff; border-radius: 999px; overflow: hidden; margin: 8px 0; }
.mission-card .bar > div { height: 100%; background: linear-gradient(90deg, #22c55e, #16a34a); transition: width .4s; }
.mission-card .foot { display: flex; justify-content: space-between; align-items: center; }
.mission-card .reward { font-size: 13px; font-weight: 700; color: #78350f; }
.mission-card .claim {
  padding: 6px 16px; border-radius: 10px;
  background: linear-gradient(180deg, #f59e0b, #d97706); color: white;
  font-weight: 800; font-size: 13px;
  border: 2px solid #78350f; box-shadow: 0 2px 0 #78350f;
}
.mission-card .claim:disabled { background: #94a3b8; border-color: #475569; box-shadow: 0 2px 0 #475569; cursor: not-allowed; }

/* Leaderboard */
.lb-grid { display: grid; gap: 14px; }
@media (min-width: 768px) { .lb-grid { grid-template-columns: repeat(3, 1fr); } }
.lb-card {
  background: white;
  border: 3px solid #92400e;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 4px 0 #78350f;
}
.lb-card h3 {
  margin: 0 0 10px;
  color: #78350f;
  font-family: 'Fredoka','Inter',sans-serif; font-size: 18px;
  text-align: center;
}
.lb-card ol { list-style: none; counter-reset: r; padding: 0; margin: 0; }
.lb-card li {
  counter-increment: r;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 4px;
  border-bottom: 1px dashed #fbbf24;
  font-size: 14px;
}
.lb-card li:last-child { border-bottom: none; }
.lb-card li::before {
  content: counter(r);
  width: 22px; height: 22px; border-radius: 999px;
  background: #fef3c7; color: #78350f;
  font-weight: 800; font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid #92400e;
}
.lb-card li:nth-child(1)::before { background: linear-gradient(135deg, #fde68a, #fbbf24); color: #78350f; }
.lb-card li:nth-child(2)::before { background: linear-gradient(135deg, #e5e7eb, #cbd5e1); color: #1f2937; }
.lb-card li:nth-child(3)::before { background: linear-gradient(135deg, #fed7aa, #fb923c); color: #7c2d12; }
.lb-name { flex: 1; font-weight: 700; color: #3a2515; }
.lb-val { color: #78350f; font-weight: 800; font-size: 12px; font-family: ui-monospace, monospace; }

/* visit cards */
.visit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 8px; margin-bottom: 12px; }
.visit-card {
  background: white;
  border: 3px solid #92400e;
  border-radius: 12px;
  padding: 10px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 3px 0 #78350f;
  cursor: pointer;
}
.visit-card:hover { background: #fef3c7; }

/* Mini-farm rendered no drawer (visit view) */
.visit-farm-canvas {
  background: linear-gradient(180deg, #86efac, #4ade80);
  border: 4px solid #92400e;
  border-radius: 12px;
  position: relative;
  height: 320px;
  overflow: hidden;
  margin: 10px 0;
}

/* === MODAL === */
.modal-bg {
  position: fixed; inset: 0; background: rgba(15,23,42,.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 1rem;
}
.modal-box {
  background:
    repeating-linear-gradient(90deg, rgba(120,72,40,.06) 0 3px, transparent 3px 7px),
    linear-gradient(180deg, #fef3c7, #fde68a);
  border: 6px solid #78350f;
  border-radius: 22px;
  padding: 22px;
  max-width: 440px; width: 100%;
  box-shadow: 0 0 0 4px #fde68a inset, 0 24px 60px rgba(0,0,0,.5);
  animation: pop .3s cubic-bezier(.34,1.56,.64,1);
}
.modal-box h3 {
  margin: 0 0 6px;
  color: #78350f;
  font-family: 'Fredoka','Inter',sans-serif;
  font-size: 22px;
}
.modal-box label { display: block; margin-top: 10px; font-weight: 700; color: #78350f; font-size: 13px; }
.modal-box input[type="number"],
.modal-box input[type="text"] {
  width: 100%; padding: 10px 12px;
  background: white;
  border: 3px solid #92400e;
  border-radius: 12px;
  font-size: 15px; color: #3a2515;
  font-family: inherit;
  margin-top: 4px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.08);
}
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.modal-actions .btn-wood { flex: 1; }

/* === TOASTS === */
.toast-stack {
  position: absolute; top: 110px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px;
  z-index: 50; pointer-events: none;
  width: 90%; max-width: 360px;
}
.toast {
  background: linear-gradient(180deg, #fef3c7, #fde68a);
  border: 4px solid #78350f;
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 6px 0 #92400e, 0 10px 20px rgba(0,0,0,.3);
  font-weight: 700; font-size: 14px;
  color: #3a2515;
  animation: dropIn .35s cubic-bezier(.34,1.56,.64,1);
  text-align: center;
}
.toast.success { background: linear-gradient(180deg, #d1fae5, #86efac); border-color: #15803d; box-shadow: 0 6px 0 #14532d, 0 10px 20px rgba(0,0,0,.3); color: #064e3b; }
.toast.error   { background: linear-gradient(180deg, #fee2e2, #fca5a5); border-color: #b91c1c; box-shadow: 0 6px 0 #7f1d1d, 0 10px 20px rgba(0,0,0,.3); color: #7f1d1d; }
.toast.warn    { background: linear-gradient(180deg, #fef3c7, #fcd34d); border-color: #b45309; box-shadow: 0 6px 0 #78350f, 0 10px 20px rgba(0,0,0,.3); color: #78350f; }
.toast.info    { background: linear-gradient(180deg, #dbeafe, #93c5fd); border-color: #1d4ed8; box-shadow: 0 6px 0 #1e3a8a, 0 10px 20px rgba(0,0,0,.3); color: #1e3a8a; }
@keyframes dropIn {
  0% { transform: translateY(-30px) scale(.8); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* Floating "+N" texts coming out of the canvas */
.float-text {
  position: absolute; z-index: 40; pointer-events: none;
  font-family: 'Fredoka','Inter',sans-serif; font-weight: 800; font-size: 24px;
  color: #fef3c7;
  text-shadow: 2px 2px 0 #78350f, -2px -2px 0 #78350f, 2px -2px 0 #78350f, -2px 2px 0 #78350f, 0 4px 10px rgba(0,0,0,.5);
  animation: floatUp 1.2s ease-out forwards;
}
.float-text.gain { color: #fde68a; }
.float-text.coin { color: #fbbf24; }
.float-text.xp { color: #c4b5fd; }
.float-text.lose { color: #fca5a5; }
@keyframes floatUp {
  0%   { transform: translateY(0) scale(.6); opacity: 0; }
  20%  { transform: translateY(-10px) scale(1.1); opacity: 1; }
  100% { transform: translateY(-80px) scale(1.2); opacity: 0; }
}

/* Tip for empty states */
.empty-tip {
  text-align: center;
  padding: 30px 12px;
  color: #92400e;
  font-style: italic;
}

/* Small helpers */
.flex-row { display: flex; gap: 8px; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.row-spread { display: flex; justify-content: space-between; align-items: center; }
.text-amber { color: #d97706; }
.text-emerald { color: #15803d; }
.text-slate { color: #475569; }
.text-xs { font-size: 11px; }
.text-sm { font-size: 13px; }
.font-bold { font-weight: 800; }

/* Responsividade */
@media (max-width: 480px) {
  .stat-pill { padding: 4px 8px; font-size: 12px; }
  .hud-emoji { font-size: 22px; }
  .hud-title { font-size: 13px; }
  .hud-weather { font-size: 10px; }
  .tab-btn span:first-child { font-size: 18px; }
  .tab-btn { font-size: 10px; }
}
