@font-face { font-family: Fredoka; font-weight: 500; font-display: swap; src: url(assets/fonts/fredoka-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Fredoka; font-weight: 600; font-display: swap; src: url(assets/fonts/fredoka-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Fredoka; font-weight: 700; font-display: swap; src: url(assets/fonts/fredoka-latin-700-normal.woff2) format('woff2'); }

:root {
  --wood: #7a4a24;
  --wood-dark: #5a3317;
  --wood-light: #a8703f;
  --cream: #fff6e0;
  --cream-2: #f6e7c4;
  --ink: #4a2c12;
  --muted: #8a6a4a;
  --green: #4caf50;
  --green-dark: #2e7d32;
  --gold: #ffc107;
  --gold-dark: #c79100;
  --red: #e53935;
  --blue: #29b6f6;
  --safe-top: max(env(safe-area-inset-top, 0px), var(--safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #7cc04f; }
body {
  font-family: Fredoka, 'Trebuchet MS', system-ui, sans-serif; font-weight: 500; color: var(--ink);
  user-select: none; -webkit-user-select: none; touch-action: none; overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; }
[hidden] { display: none !important; }

#farm { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* ---------- HUD ---------- */
.hud {
  position: fixed; left: 0; right: 0; top: 0; z-index: 5; pointer-events: none;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
  padding: calc(var(--safe-top) + 10px) 12px 0;
}
.hud > * { pointer-events: auto; }
.player { display: flex; align-items: center; gap: 0; min-width: 0; }
.lvl {
  position: relative; z-index: 1; width: 52px; height: 52px; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe082, var(--gold) 55%, var(--gold-dark));
  border: 3px solid var(--wood-dark); display: grid; place-items: center;
  font-weight: 700; font-size: 22px; color: var(--wood-dark); box-shadow: 0 3px 0 rgba(0,0,0,.25);
}
.lvl small { position: absolute; top: -9px; font-size: 10px; background: var(--wood-dark); color: var(--cream); padding: 0 6px; border-radius: 6px; letter-spacing: .5px; }
.pcard {
  margin-left: -14px; padding: 5px 12px 6px 22px; min-width: 0; max-width: 46vw;
  background: var(--cream); border: 3px solid var(--wood-dark); border-left: 0; border-radius: 0 14px 14px 0;
  box-shadow: 0 3px 0 rgba(0,0,0,.2);
}
.nick { font-weight: 600; font-size: 15px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xpbar { position: relative; margin-top: 3px; width: 128px; max-width: 100%; height: 14px; border-radius: 8px; background: #e2cfa6; overflow: hidden; border: 2px solid var(--wood-light); }
.xpbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#81d4fa, #039be5); border-radius: 6px; transition: width .4s; }
.xpbar span { position: relative; display: block; text-align: center; font-size: 10px; line-height: 10px; font-weight: 600; color: var(--wood-dark); }

.coins {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 6px; margin-top: 8px;
  background: var(--cream); border: 3px solid var(--wood-dark); border-radius: 20px; box-shadow: 0 3px 0 rgba(0,0,0,.2);
  font-weight: 700; font-size: 18px;
}
.coin { width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3b0, var(--gold) 50%, var(--gold-dark)); border: 2px solid #a87700; display: inline-grid; place-items: center; font-size: 12px; color: #8a5d00; font-weight: 700; }
.coin::after { content: '$'; }
.coins.bump { animation: bump .35s; }
.wallet { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.wallet .coins { margin-top: 0; }
.wallet .coins:first-child { margin-top: 8px; }
.gems { font: inherit; font-weight: 700; font-size: 16px; color: var(--ink); padding: 4px 12px 4px 6px; }
.gem { width: 22px; height: 22px; display: inline-block; background: linear-gradient(135deg, #b3f0ff, #29b6f6 45%, #0277bd); clip-path: polygon(50% 0, 100% 38%, 50% 100%, 0 38%); }
.offline { position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-bottom) + 96px); background: var(--red); color: #fff; padding: 8px 14px; border-radius: 12px; font-weight: 600; font-size: 14px; }
.tip .btn { margin: 6px auto 0; display: flex; }
body.signed-out .hud, body.signed-out .toolbar, body.signed-out .zoom { visibility: hidden; }
.card.locked .x { display: none; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.auth-tabs button { flex: 1; padding: 9px; border-radius: 12px; background: var(--cream-2); font-weight: 600; color: var(--wood); }
.auth-tabs button.on { background: var(--wood); color: var(--cream); }
.form { display: flex; flex-direction: column; gap: 10px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
.form input[type=email], .form input[type=password], .form input[type=text] { padding: 10px 12px; border-radius: 12px; border: 2px solid var(--wood-light); background: #fff; color: var(--ink); font-size: 16px; user-select: text; -webkit-user-select: text; }
.form .check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 500; font-size: 13px; }
.form .check input { width: 20px; height: 20px; flex: none; accent-color: var(--green); margin-top: 1px; }
.form a, .link { color: #1565c0; font-weight: 600; }
.link { background: none; padding: 0; font-size: 14px; text-decoration: underline; }
.msg { padding: 10px 12px; border-radius: 12px; background: #e8f5e9; color: var(--green-dark); font-size: 14px; }
.msg.err { background: #ffebee; color: #b71c1c; }
.pix { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.pix img { width: 220px; height: 220px; image-rendering: pixelated; background: #fff; padding: 8px; border-radius: 12px; border: 2px solid var(--cream-2); }
.pix textarea { width: 100%; height: 90px; font-size: 12px; border-radius: 12px; border: 2px solid var(--wood-light); padding: 8px; user-select: text; -webkit-user-select: text; resize: none; }
.pkg { display: flex; align-items: center; gap: 10px; }
.pkg .gem { width: 34px; height: 34px; flex: none; }
.status { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 8px; }
.status.pending { background: #fff3c4; color: #8a5d00; } .status.approved { background: #c8e6c9; color: #1b5e20; } .status.rejected { background: #ffcdd2; color: #b71c1c; }
@keyframes bump { 50% { transform: scale(1.15); } }

/* ---------- Barra de visita ---------- */
.visitbar {
  position: fixed; z-index: 6; left: 50%; transform: translateX(-50%); top: calc(var(--safe-top) + 74px);
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; max-width: calc(100vw - 24px);
  background: var(--wood); color: var(--cream); border-radius: 16px; border: 3px solid var(--wood-dark); box-shadow: 0 4px 0 rgba(0,0,0,.25);
  white-space: nowrap;
}
.visitbar .who { overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.visitbar .who b { color: #ffe082; }

/* ---------- Barra de ferramentas ---------- */
.toolbar {
  position: fixed; z-index: 5; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-bottom) + 12px);
  display: flex; gap: 6px; padding: 7px; border-radius: 22px;
  background: linear-gradient(var(--wood-light), var(--wood)); border: 3px solid var(--wood-dark); box-shadow: 0 5px 0 rgba(0,0,0,.25);
}
.tool {
  position: relative; width: 62px; height: 62px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: var(--cream); box-shadow: inset 0 -4px 0 var(--cream-2), 0 2px 0 rgba(0,0,0,.2); font-size: 11px; font-weight: 600; color: var(--wood-dark);
  transition: transform .08s;
}
.tool:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 var(--cream-2); }
.tool svg, .tool img { width: 32px; height: 32px; }
.tool .badge {
  position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--red); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff;
}
.tool.seed { background: #fff3c4; box-shadow: inset 0 -4px 0 #f3d98a, 0 2px 0 rgba(0,0,0,.2); }
.tool.alert::after { content: ''; position: absolute; top: 4px; right: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }

.zoom { position: fixed; z-index: 4; right: 12px; bottom: calc(var(--safe-bottom) + 104px); display: flex; flex-direction: column; gap: 6px; }
.zoom button { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,246,224,.9); border: 2px solid var(--wood-dark); font-weight: 700; font-size: 22px; line-height: 1; color: var(--wood-dark); }

/* ---------- Dica sobre canteiro ---------- */
.tip {
  position: fixed; z-index: 7; transform: translate(-50%, -100%); pointer-events: auto; /* precisa receber o toque do botão Acelerar */
  background: var(--cream); border: 3px solid var(--wood-dark); border-radius: 14px; padding: 6px 12px; text-align: center;
  box-shadow: 0 3px 0 rgba(0,0,0,.2); white-space: nowrap; font-size: 14px;
}
.tip b { display: block; font-size: 16px; }
.tip .issues { color: var(--red); font-size: 12px; }
.tip::after { content: ''; position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); border: 8px solid transparent; border-top-color: var(--wood-dark); border-bottom: 0; }

/* ---------- Painéis (bottom sheet) ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: rgba(40,20,0,.45); animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.card {
  width: min(560px, 100%); max-height: 86vh; display: flex; flex-direction: column;
  background: var(--cream); border: 4px solid var(--wood-dark); border-bottom: 0; border-radius: 24px 24px 0 0;
  padding-bottom: var(--safe-bottom); animation: up .2s ease-out; touch-action: pan-y;
}
.sheet.center { align-items: center; padding: 16px; }
.sheet.center .card { border-bottom: 4px solid var(--wood-dark); border-radius: 24px; padding-bottom: 0; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
.card > header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 10px 18px; background: var(--wood); color: var(--cream); border-radius: 18px 18px 0 0; }
.card > header h2 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: .3px; }
.x { width: 36px; height: 36px; border-radius: 50%; background: var(--red); color: #fff; font-size: 20px; font-weight: 700; border: 2px solid #fff; display: grid; place-items: center; }
.body { padding: 14px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.body p { margin: 0 0 10px; line-height: 1.35; }
.muted { color: var(--muted); font-size: 13px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.item {
  position: relative; background: #fff; border: 2px solid var(--cream-2); border-radius: 16px; padding: 10px; text-align: center;
  box-shadow: 0 2px 0 var(--cream-2);
}
.item img { width: 54px; height: 54px; }
.item h3 { margin: 2px 0 2px; font-size: 16px; }
.item .meta { font-size: 12px; color: var(--muted); line-height: 1.35; }
.item .meta b { color: var(--ink); }
.item.locked { opacity: .55; }
.item.locked::after { content: attr(data-lock); position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; color: var(--wood-dark); background: rgba(255,246,224,.55); border-radius: 14px; font-size: 15px; }
.item.sel { border-color: var(--green); box-shadow: 0 0 0 3px rgba(76,175,80,.35); }
.item .own { position: absolute; top: 6px; right: 8px; font-weight: 700; font-size: 13px; color: var(--green-dark); }
.row { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; min-height: 40px; border-radius: 12px;
  background: var(--green); color: #fff; font-weight: 600; font-size: 15px; box-shadow: inset 0 -4px 0 var(--green-dark);
}
.btn:active { transform: translateY(1px); box-shadow: inset 0 -2px 0 var(--green-dark); }
.btn.small { padding: 5px 10px; min-height: 32px; font-size: 13px; border-radius: 10px; }
.btn.gold { background: var(--gold); color: var(--wood-dark); box-shadow: inset 0 -4px 0 var(--gold-dark); }
.btn.wood { background: var(--wood-light); box-shadow: inset 0 -4px 0 var(--wood-dark); }
.btn.red { background: var(--red); box-shadow: inset 0 -4px 0 #a31515; }
.btn.ghost { background: transparent; color: var(--cream); border: 2px solid var(--cream); box-shadow: none; }
.btn.block { width: 100%; }
.btn.buy { flex: 1; flex-direction: column; gap: 0; line-height: 1.05; padding: 5px 4px; }
.btn.buy span:first-child { font-size: 11px; opacity: .85; }
.btn[disabled] { filter: grayscale(.8); opacity: .6; }

.list { display: flex; flex-direction: column; gap: 8px; }
.li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fff; border: 2px solid var(--cream-2); border-radius: 14px; }
.li img { width: 40px; height: 40px; flex: none; }
.li .grow { flex: 1; min-width: 0; }
.li .grow b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 18px; border: 2px solid var(--wood-dark); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; background: #ffe082; color: var(--wood-dark); }
.pill.green { background: #c8e6c9; color: var(--green-dark); }
h4 { margin: 14px 0 8px; font-size: 15px; color: var(--wood); text-transform: uppercase; letter-spacing: .6px; }
h4:first-child { margin-top: 0; }

.field { display: flex; gap: 8px; }
.field input {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 12px; border: 2px solid var(--wood-light); background: #fff; color: var(--ink); font-size: 16px;
  user-select: text; -webkit-user-select: text;
}
.code { font-size: 26px; font-weight: 700; letter-spacing: 3px; color: var(--wood); text-align: center; padding: 8px; background: #fff; border: 2px dashed var(--wood-light); border-radius: 14px; user-select: text; -webkit-user-select: text; }
.total { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding: 10px 12px; background: #fff3c4; border-radius: 14px; font-weight: 600; }
.switch { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--cream-2); }
.switch input { width: 22px; height: 22px; accent-color: var(--green); }
.steps { margin: 0 0 12px; padding-left: 20px; line-height: 1.45; }
.big { text-align: center; }
.big .num { font-size: 40px; font-weight: 700; color: var(--gold-dark); }
.unlocks { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.unlocks div { text-align: center; font-size: 13px; }
.unlocks img { width: 56px; height: 56px; display: block; margin: 0 auto; }
.empty { text-align: center; color: var(--muted); padding: 18px 8px; }

/* ---------- Avisos ---------- */
.toasts { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); top: calc(var(--safe-top) + 118px); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: rgba(58,32,10,.92); color: #fff; padding: 8px 14px; border-radius: 14px; font-size: 14px; text-align: center; animation: toast 2.8s forwards; box-shadow: 0 3px 8px rgba(0,0,0,.25); }
.toast.good { background: rgba(46,125,50,.95); }
.toast.bad { background: rgba(183,28,28,.95); }
@keyframes toast { 0% { opacity: 0; transform: translateY(-8px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }

.splash { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: #7cc04f; color: #fff; font-size: 28px; font-weight: 700; text-shadow: 0 3px 0 var(--green-dark); transition: opacity .3s; }

@media (max-width: 380px) {
  .tool { width: 54px; height: 56px; font-size: 10px; }
  .tool svg, .tool img { width: 28px; height: 28px; }
  .xpbar { width: 100px; }
}
@media (min-width: 900px) { .zoom { bottom: 24px; } }

/* ---------- v2.1: ajudante, animais ---------- */
.tool.on { background: #dcedc8; box-shadow: inset 0 -4px 0 #aed581, 0 2px 0 rgba(0,0,0,.2); }
.tool #helperLabel { font-variant-numeric: tabular-nums; white-space: nowrap; }
.helper-hero { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.helper-hero svg { flex: none; }
.helper-hero p { margin: 0; }
ul.sum { margin: 4px 0 10px; padding-left: 20px; }
ul.sum li { margin: 3px 0; }
.field-label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; margin: 6px 0; }
.field-label select { font: inherit; padding: 8px 10px; border-radius: 10px; border: 2px solid var(--wood-dark, #5a3317); background: #fffaf0; }
.tip .st { display: block; }
.tip .btn + .btn, .tip div + div { margin-top: 4px; }
/* 6 botões na barra: cabe em telas a partir de 320 px */
@media (max-width: 460px) {
  .toolbar { gap: 4px; padding: 6px; }
  .tool { width: 54px; height: 58px; font-size: 10px; }
  .tool svg, .tool img { width: 28px; height: 28px; }
}
@media (max-width: 360px) {
  .tool { width: 47px; height: 54px; font-size: 9px; }
  .tool svg, .tool img { width: 24px; height: 24px; }
}
/* ---------- convite de instalação (PWA) ---------- */
.install {
  position: fixed; z-index: 15; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-bottom) + 96px);
  width: min(460px, calc(100vw - 24px)); display: flex; gap: 10px; align-items: center;
  background: var(--cream); border: 3px solid var(--wood-dark); border-radius: 16px; padding: 10px; box-shadow: 0 4px 0 rgba(0,0,0,.25);
  animation: fade .2s;
}
.install img { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.install .txt { flex: 1; font-size: 13px; line-height: 1.3; }
.install .txt b:first-child { display: block; font-size: 15px; }
.install .acts { display: flex; flex-direction: column; gap: 4px; }
body.signed-out .install { bottom: calc(var(--safe-bottom) + 16px); }

/* ---------- v2.2: loja com 4 abas, máquinas, calendário ---------- */
.shop-tabs button { font-size: 14px; padding: 8px 4px; }
.cal-btn span { font-size: 13px; }
.machine-head { display: flex; gap: 12px; align-items: center; }
.machine-head img { width: 72px; height: 72px; }
.li.slot-free { border-style: dashed; opacity: .7; }
.calendar { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.cal { position: relative; background: #fff; border: 2px solid var(--cream-2); border-radius: 12px; padding: 18px 4px 6px; min-height: 64px; text-align: center; font-size: 12px; }
.cal .n { position: absolute; top: 3px; left: 6px; font-weight: 700; color: var(--wood); font-size: 12px; }
.cal .rw { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; align-items: center; }
.cal.done { background: #dcedc8; border-color: #aed581; }
.cal.done::after { content: '✓'; position: absolute; top: 2px; right: 6px; color: #33691e; font-weight: 700; }
.cal.next { border-color: #ffb300; box-shadow: 0 0 0 2px #ffe082 inset; }
.cal.lost { opacity: .45; filter: grayscale(.7); }
.cal .lock { display: block; font-size: 10px; color: var(--red); margin-top: 2px; }
.cal.opened { animation: pop .6s ease; border-color: #ffb300; background: #fff8e1; }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.cal-btn { font: inherit; font-weight: 700; color: var(--ink); padding: 4px 12px 4px 6px; gap: 4px; }
.item img.decor-ic { background: #e8f5e9; border-radius: 14px; }

/* ---------- Fases 2 e 3: social, feira, trocas, clã ---------- */
.subtabs { display: flex; gap: 6px; margin: 4px 0 10px; }
.subtabs button { flex: 1; font: inherit; font-weight: 700; padding: 7px; border-radius: 10px; border: 2px solid var(--cream-2); background: #fff; color: var(--wood); }
.subtabs button.on { background: var(--wood); color: #fff; border-color: var(--wood); }
.li .qty { width: 64px; font: inherit; padding: 6px; border-radius: 8px; border: 2px solid var(--cream-2); text-align: center; }
.li .qty.price { width: 70px; }
.li.sell-row { flex-wrap: wrap; }
.li .col { display: flex; flex-direction: column; gap: 4px; }
.tcols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.trow { display: flex; gap: 4px; margin-top: 4px; }
.trow select { flex: 1; min-width: 0; font: inherit; padding: 6px; border-radius: 8px; border: 2px solid var(--cream-2); }
.trow .qty { width: 58px; font: inherit; padding: 6px; border-radius: 8px; border: 2px solid var(--cream-2); }
@media (max-width: 460px) { .tcols { grid-template-columns: 1fr; } }
.clan-head { display: flex; gap: 10px; align-items: center; }
.clan-head .grow { flex: 1; min-width: 0; }
.clan-head .grow b { display: block; font-size: 17px; }
.clan-head .grow .muted { display: block; }
.badge-tag { background: var(--wood); color: #fff; font-weight: 700; border-radius: 12px; padding: 10px 8px; min-width: 56px; text-align: center; border: 3px solid var(--wood-dark); }
.badge-tag.small { min-width: 46px; padding: 6px; font-size: 13px; }
.xpbar.wide { width: 100%; margin-top: 4px; height: 10px; }
.battle .vs { display: flex; align-items: center; justify-content: space-around; text-align: center; background: #fff; border-radius: 14px; padding: 10px; border: 2px solid var(--cream-2); }
.battle .vs b { display: block; } .battle .vs span { font-size: 20px; font-weight: 700; color: var(--wood); }
.battle .vs .x { font-size: 26px; color: var(--red); }
.mission .bars { display: flex; flex-direction: column; gap: 3px; margin: 4px 0; }
.mission .bar { position: relative; height: 16px; background: #eee; border-radius: 8px; overflow: hidden; }
.mission .bar i { position: absolute; inset: 0 auto 0 0; background: #66bb6a; }
.mission .bar.theirs i { background: #ef5350; }
.mission .bar span { position: relative; font-size: 11px; font-weight: 700; padding-left: 6px; line-height: 16px; }
.li .rank { width: 24px; text-align: center; color: var(--wood); }

/* ---------- v3.1: celeiro, moedas, construção de cercas e fazendeiro ---------- */
.coins .plus { font-style: normal; display: grid; place-items: center; width: 18px; height: 18px; margin-left: 2px; border-radius: 50%; background: #43a047; color: #fff; font-size: 14px; font-weight: 700; line-height: 1; border: 2px solid #fff; }
.tool .badge.cap { background: #ff9800; font-size: 10px; min-width: 30px; }
.tool .badge.cap.full { background: var(--red); }
.tool.alert:has(.badge.cap:not([hidden]))::after { display: none; }
.barn-cap { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 10px; border-radius: 14px; background: #fff; border: 2px solid var(--cream-2); }
.barn-cap > div { flex: 1; min-width: 0; }
.barn-cap b, .barn-cap .muted { display: block; }
.barn-cap.full { border-color: #ef9a9a; background: #fff5f5; }
.capbar { margin-top: 6px; height: 10px; border-radius: 6px; background: #eadcc0; overflow: hidden; }
.capbar i { display: block; height: 100%; background: linear-gradient(90deg, #8bc34a, #ffb300 75%, #e53935); border-radius: 6px; }
.buildbar {
  position: fixed; z-index: 6; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-bottom) + 12px);
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; max-width: calc(100vw - 20px);
  background: var(--cream); border: 3px solid var(--wood-dark); border-radius: 18px; box-shadow: 0 5px 0 rgba(0,0,0,.25);
}
.buildbar img { width: 46px; height: 46px; flex: none; }
.buildbar .bi { min-width: 0; display: flex; flex-direction: column; }
.buildbar .bi b { font-size: 14px; color: var(--wood-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.buildbar .bi span { font-size: 11px; color: var(--wood); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.buildbar .btn { flex: none; }
.av-wrap { display: flex; gap: 14px; align-items: flex-start; }
.av-wrap canvas { width: 220px; height: 240px; flex: none; border-radius: 16px; background: linear-gradient(#e3f4ff, #fdf6e3); border: 2px solid var(--cream-2); position: sticky; top: 0; }
.av-opts { flex: 1; min-width: 0; }
.av-opts h4 { margin: 8px 0 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.chip { padding: 6px 10px; border-radius: 12px; background: var(--cream-2); color: var(--wood); font-weight: 600; font-size: 13px; border: 2px solid transparent; }
.chip.on { background: var(--wood); color: var(--cream); }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--cream-2); }
.sw.on { box-shadow: 0 0 0 3px var(--wood-dark); }
@media (max-width: 560px) {
  .av-wrap { flex-direction: column; align-items: center; }
  .av-wrap canvas { position: static; width: 180px; height: 196px; }
  .buildbar .bi span { display: none; }
}
.pill.npc { background: #e8eaf6; color: #3949ab; }

/* ---------- v3.3: mina e tarefas ---------- */
.cal-btn { position: relative; }
.cal-btn .dot { position: absolute; top: -3px; right: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }
.mine-head { padding: 10px 12px; border-radius: 14px; background: linear-gradient(#efe4d2, #e2d0b2); border: 2px solid #c9a97c; margin-bottom: 6px; }
.mine-head b, .mine-head .muted { display: block; }
.odds { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.odds div { display: flex; flex-direction: column; align-items: center; background: #fff; border: 2px solid var(--cream-2); border-radius: 12px; padding: 6px 2px; font-size: 11px; color: var(--wood); }
.odds img { width: 36px; height: 36px; }
.odds b { font-size: 14px; color: var(--wood-dark); }
.mine-found .unlocks img { width: 40px; height: 40px; }
.locked-recipe { opacity: .6; filter: grayscale(.4); }
.li.task .capbar { margin: 4px 0 2px; }
.li.task.claimed { opacity: .65; }
.bonus-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: linear-gradient(#fff8d6, #ffe9a8); border: 2px solid #f2c94c; }
.bonus-box b { flex-basis: 100%; }
.bonus-box span { flex: 1; }
.rw-inline { font-size: 13px; }
.rw-inline span, .li .grow .rw-inline span { display: inline !important; margin-right: 6px; }
.bonus-box .grow1 { flex: 1; }
.li .grow .rw-inline b { display: inline !important; }
.li .grow .rw-inline span.coin, .li .grow .rw-inline span.gem, .rw-inline span.coin, .rw-inline span.gem { display: inline-block !important; margin-right: 2px; }

/* ---------- v3.4: barco, expansão e cupom ---------- */
.boat-head { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: linear-gradient(#e3f4fb, #c9e7f3); border: 2px solid #8cc6dd; margin-bottom: 8px; }
.boat-head img { width: 60px; height: 60px; flex: none; }
.boat-head > div > b, .boat-head > div > .muted { display: block; }
.boat-head .muted b { display: inline; }
.boat-head .capbar { margin-top: 6px; }
.li.claimed { opacity: .62; }
b.ok { color: var(--green-dark, #2e7d32); display: inline; }
b.short { color: #c62828; display: inline; }
.li .grow .muted b.ok, .li .grow .muted b.short { display: inline; }
#cpForm input { text-transform: uppercase; letter-spacing: .06em; }
