:root {
  --cream: #fff7e6; --cream2: #f6e7c8; --wood: #b9783f; --wood-d: #7a4a26;
  --green: #5cc93a; --green-d: #3b8f22; --ink: #4a2e14;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #5a6e4a; font-family: Fredoka, system-ui, apple-system, sans-serif; color: var(--ink); user-select: none; -webkit-user-select: none; touch-action: none; overscroll-behavior: none; }
canvas#game { position: fixed; inset: 0; display: block; touch-action: none; background: #5a6e4a; }
button { font-family: inherit; cursor: pointer; border: 0; color: inherit; }

#loading { position: fixed; inset: 0; z-index: 99; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(#7fd3ee, #4fb0d8); color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.2); }
#loading h1 { margin: 6px 0; font-size: 38px; }
.ld-logo { font-size: 80px; animation: spinY 1.4s ease-in-out infinite; }
@keyframes spinY { 50% { transform: scale(1.15) rotate(15deg); } }

/* ---------- HUD ---------- */
#hud { position: fixed; top: calc(6px + var(--safe-t)); left: 6px; right: 6px; z-index: 10; display: flex; flex-direction: column; gap: 5px; pointer-events: none; }
.hud-row { display: flex; gap: 5px; }
.pill { pointer-events: auto; display: flex; align-items: center; gap: 4px; background: rgba(255,247,230,.94); border: 2.5px solid var(--wood-d); border-radius: 20px; padding: 2px 9px 2px 4px; box-shadow: 0 3px 0 rgba(60,30,10,.35); font-weight: 700; font-size: 15px; min-width: 0; flex: 1; height: 34px; }
.pill span { font-size: 19px; line-height: 1; }
.pill[data-a] { cursor: pointer; }
#hud-troph { cursor: default; pointer-events: none; }
.pill b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-row.small .pill { height: 28px; font-size: 13px; flex: 0 0 auto; }
.hud-row.small .pill span { font-size: 15px; }
.pill.lvl { flex: 0 0 84px; padding-left: 2px; }
.star { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #fff3a0, #ffc21a 60%, #e08a00); border-radius: 50%; color: #6a3a00; font-weight: 700; font-size: 15px !important; border: 2px solid #a86200; }
.xp { flex: 1; height: 10px; background: #e8d6b0; border-radius: 6px; overflow: hidden; border: 1.5px solid var(--wood-d); }
.xp i { display: block; height: 100%; background: linear-gradient(#8ff06a, #45b82a); transition: width .4s; }
.pill.env { flex: 1; justify-content: flex-start; gap: 5px; font-size: 12px; }
.pill.env b { font-size: 15px; } .pill.env small { opacity: .75; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill.gear { flex: 0 0 34px; justify-content: center; padding: 0; font-size: 16px; }
.pill.heart b { color: hsl(calc(var(--h, 50) * 1.2), 70%, 38%); }
#hud-inv.full { background: #ffd6d0; animation: pulse 1s infinite; }
.bump { animation: bump .35s; }
@keyframes bump { 40% { transform: scale(1.18); } }
@keyframes pulse { 50% { transform: scale(1.05); } }

/* ---------- nav ---------- */
#nav { position: fixed; left: 6px; right: 6px; bottom: max(6px, calc(var(--safe-b) - 18px)); z-index: 10; display: flex; gap: 5px; justify-content: center; }
#nav button { position: relative; flex: 1; max-width: 86px; height: 58px; border-radius: 16px; background: linear-gradient(#fff9ec, #f3dfb6); border: 2.5px solid var(--wood-d); box-shadow: 0 4px 0 var(--wood-d); display: flex; flex-direction: column; align-items: center; justify-content: center; transition: transform .08s; }
#nav button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--wood-d); }
#nav span { font-size: 24px; line-height: 1; display: flex; align-items: center; justify-content: center; }
#nav span .ei { width: 1.35em; height: 1.35em; vertical-align: middle; }
#nav small { font-size: 10.5px; font-weight: 700; margin-top: 2px; }
#nav button.locked { filter: grayscale(.8); opacity: .75; }
.dot { position: absolute; top: -4px; right: -3px; width: 16px; height: 16px; border-radius: 50%; background: #ff3b3b; border: 2px solid #fff; display: none; animation: pulse .9s infinite; }
.dot.on { display: block; }
body.placing #nav, body.in-battle #nav, body.in-battle #hud .hud-row.small, body.in-battle #brush { display: none; }
body.in-battle #hud { opacity: .0; pointer-events: none; }

/* ---------- brush / banner / toast ---------- */
.brush { position: fixed; top: calc(80px + var(--safe-t)); left: 50%; transform: translate(-50%, -20px); z-index: 11; background: #fff7e6; border: 2.5px solid var(--green-d); border-radius: 18px; padding: 5px 6px 5px 12px; display: flex; align-items: center; gap: 6px; font-size: 14px; box-shadow: 0 3px 0 rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: .2s; white-space: nowrap; }
.brush.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.brush span { font-size: 22px; } .brush small { display: none; }
.brush button { background: #ff6b6b; color: #fff; width: 26px; height: 26px; border-radius: 50%; font-weight: 700; }
@media (min-width: 520px) { .brush small { display: inline; opacity: .7; } }
.banner { position: fixed; top: calc(118px + var(--safe-t)); left: 50%; transform: translate(-50%, -30px) scale(.9); z-index: 12; padding: 10px 16px; border-radius: 16px; font-weight: 700; font-size: 15px; text-align: center; color: #fff; opacity: 0; transition: .3s; pointer-events: none; max-width: 92vw; text-shadow: 0 2px 0 rgba(0,0,0,.25); box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.banner.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.banner.good { background: linear-gradient(#6ee048, #3b9f22); border: 2.5px solid #2a7414; }
.banner.bad { background: linear-gradient(#ff7a6b, #d6382b); border: 2.5px solid #8f1f15; }
#toasts { position: fixed; bottom: calc(76px + var(--safe-b)); left: 0; right: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { background: rgba(60,35,15,.92); color: #fff; padding: 8px 14px; border-radius: 14px; font-size: 14px; font-weight: 600; animation: tin .25s; max-width: 90vw; text-align: center; }
.toast.out { opacity: 0; transform: translateY(10px); transition: .4s; }
@keyframes tin { from { opacity: 0; transform: translateY(10px) scale(.9); } }

/* ---------- buttons ---------- */
.btn { display: block; width: 100%; margin: 8px 0; padding: 12px 14px; border-radius: 14px; font-size: 16px; font-weight: 700; color: #fff; background: linear-gradient(#7fe05a, #45b02a); border: 2.5px solid #2c7a17; box-shadow: 0 4px 0 #2c7a17; text-shadow: 0 2px 0 rgba(0,0,0,.2); transition: transform .08s; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #2c7a17; }
.btn.small { width: auto; display: inline-block; padding: 7px 11px; font-size: 14px; margin: 0; }
.btn.gem { background: linear-gradient(#8fc8ff, #4f7dff); border-color: #2d4fb0; box-shadow: 0 4px 0 #2d4fb0; }
.btn.red { background: linear-gradient(#ff8a6b, #e0452f); border-color: #9a2414; box-shadow: 0 4px 0 #9a2414; }
.btn.ghost { background: #fff7e6; color: var(--ink); border-color: var(--wood); box-shadow: 0 4px 0 var(--wood); text-shadow: none; }
.btn.ghost.red { color: #c0392b; }
.btn[disabled] { filter: grayscale(.6); opacity: .65; }
.row2 { display: flex; gap: 8px; } .row2 .btn { flex: 1; }

/* ---------- sheet ---------- */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; transform: translateY(calc(100% + 40px)); transition: transform .28s cubic-bezier(.2,.9,.3,1.1); pointer-events: none; }
.sheet.open { transform: none; pointer-events: auto; }
.sheet-card { position: relative; margin: 0 auto; max-width: 560px; background: var(--cream); border: 3px solid var(--wood-d); border-bottom: 0; border-radius: 24px 24px 0 0; box-shadow: 0 -6px 0 rgba(122,74,38,.25), 0 -10px 30px rgba(0,0,0,.25); padding: 14px 14px calc(14px + var(--safe-b)); }
.sheet-card::before { content: ''; position: absolute; top: 6px; left: 50%; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: #d9c39a; }
#sheet-body { max-height: 58vh; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding: 2px 2px 6px; }
.x { position: absolute; top: -14px; right: 12px; width: 36px; height: 36px; border-radius: 50%; background: #ff6b6b; color: #fff; font-weight: 700; font-size: 16px; border: 3px solid #fff; box-shadow: 0 3px 0 rgba(0,0,0,.25); z-index: 2; }
h2 { margin: 4px 0 4px; font-size: 21px; } h3 { margin: 14px 0 6px; font-size: 16px; }
.sub { margin: 2px 0 8px; font-size: 14px; opacity: .85; }
.hint { font-size: 12.5px; opacity: .7; margin: 8px 0; text-align: center; }
.center { text-align: center; margin: 6px 0; font-weight: 600; }
.big { font-size: 38px; line-height: 1; }
.row.head { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.row.head .big { font-size: 48px; filter: drop-shadow(0 3px 0 rgba(0,0,0,.15)); }
.lv { font-size: 13px; background: #ffcf33; border-radius: 10px; padding: 1px 7px; vertical-align: middle; }
.pbar { height: 16px; background: #ead7b0; border: 2px solid var(--wood-d); border-radius: 10px; overflow: hidden; margin: 6px 0; }
.pbar i { display: block; height: 100%; background: linear-gradient(#8ff06a, #45b82a); border-radius: 8px; transition: width .4s; }
.pbar.red i { background: linear-gradient(#ff8a6b, #e0452f); }
.tabs { display: flex; gap: 5px; margin: 8px 0; overflow-x: auto; }
.tabs button { flex: 1; padding: 8px 6px; border-radius: 12px; background: #f1dfba; font-weight: 700; font-size: 13px; white-space: nowrap; border: 2px solid transparent; }
.tabs button.on { background: #fff; border-color: var(--wood); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(102px, 1fr)); gap: 8px; }
.card { position: relative; background: #fff; border: 2.5px solid #e1c99a; border-radius: 16px; padding: 8px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; box-shadow: 0 3px 0 #e1c99a; transition: transform .08s; }
.card:active { transform: scale(.95); }
.card b { font-size: 13.5px; } .card small { font-size: 11px; opacity: .75; line-height: 1.15; }
.card .big { font-size: 36px; filter: drop-shadow(0 2px 0 rgba(0,0,0,.12)); }
.card .price { margin-top: 3px; background: #fff3c4; border-radius: 10px; padding: 2px 8px; font-weight: 700; font-size: 13px; }
.card .tip { color: #3b8f22; opacity: 1; }
.card .cnt { position: absolute; top: 4px; right: 6px; font-weight: 700; }
.card.locked { filter: grayscale(.85); opacity: .6; }
.card.mut { border-color: #c99bff; box-shadow: 0 3px 0 #a97be0; background: linear-gradient(#fff, #f3e9ff); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.chip { background: #fff; border: 2px solid #e1c99a; border-radius: 12px; padding: 3px 9px; font-size: 13px; font-weight: 600; }
.list { display: flex; flex-direction: column; gap: 7px; }
.li { display: flex; align-items: center; gap: 8px; background: #fff; border: 2px solid #e8d4ab; border-radius: 14px; padding: 6px 8px; }
.li > div { flex: 1; display: flex; flex-direction: column; } .li small { opacity: .75; font-size: 12px; }
.li .big { font-size: 30px; } .li.unk { opacity: .7; } .li.leg { background: linear-gradient(90deg, #fff6d0, #fff); border-color: #ffcf33; }
.quest { display: flex; gap: 8px; align-items: center; background: #fff; border: 2px solid #e8d4ab; border-radius: 14px; padding: 8px 10px; }
.quest > div { flex: 1; } .quest b { font-size: 14px; } .quest small { font-size: 12px; opacity: .75; }
.quest.done { border-color: #5cc93a; background: #f0ffe8; }
.orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.order { background: #fffdf5; border: 2.5px solid #e1c99a; border-radius: 16px; padding: 8px; display: flex; flex-direction: column; gap: 5px; box-shadow: 0 3px 0 #e1c99a; }
.order.ok { border-color: #5cc93a; box-shadow: 0 3px 0 #3b8f22; background: #f4ffec; }
.order.wait { align-items: center; justify-content: center; opacity: .8; text-align: center; }
.order .btn { margin: 0; padding: 8px; font-size: 14px; }
.npc { display: flex; align-items: center; gap: 6px; } .npc span { font-size: 28px; } .npc b { font-size: 13px; }
.needs { display: flex; flex-wrap: wrap; gap: 4px; }
.need { background: #ffe3dc; border-radius: 10px; padding: 2px 7px; font-size: 14px; } .need.have { background: #dcf8cf; }
.reward { font-size: 13px; font-weight: 700; color: #8a5a12; }
.inv { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
.slot { background: #fff; border: 2px solid #e8d4ab; border-radius: 12px; padding: 5px; display: flex; flex-direction: column; align-items: center; }
.slot span { font-size: 26px; } .slot b { font-size: 14px; } .slot small { font-size: 10px; opacity: .7; }
.slot.unk { opacity: .5; } .slot.mut { border-color: #c99bff; }
.queue { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; font-size: 26px; margin: 8px 0; }
.queue span { display: flex; flex-direction: column; align-items: center; } .queue small { font-size: 12px; font-weight: 700; }
.up { color: #2c9a17; } .down { color: #d6382b; }
.help p { margin: 7px 0; font-size: 14.5px; text-align: left; }

/* wheel */
.wheel-wrap { position: relative; width: 260px; height: 260px; margin: 10px auto; }
.wheel { width: 100%; height: 100%; border-radius: 50%; border: 6px solid var(--wood-d); box-shadow: 0 5px 0 var(--wood-d), inset 0 0 0 4px #fff; position: relative; }
.wl { position: absolute; left: 50%; top: 0; width: 0; height: 50%; transform-origin: bottom center; }
.wl span { position: absolute; top: 14px; left: -24px; width: 48px; text-align: center; font-size: 26px; display: flex; flex-direction: column; align-items: center; }
.wl small { font-size: 12px; font-weight: 700; }
.pointer { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); z-index: 2; font-size: 30px; color: #e0452f; text-shadow: 0 2px 0 #fff, 0 3px 0 rgba(0,0,0,.3); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; background: rgba(20,30,40,.55); padding: 20px; }
.modal.show { display: flex; animation: fin .2s; }
@keyframes fin { from { opacity: 0; } }
.modal-card { position: relative; overflow: hidden; width: 100%; max-width: 380px; background: var(--cream); border: 3px solid var(--wood-d); border-radius: 26px; padding: 18px; text-align: center; box-shadow: 0 6px 0 var(--wood-d); animation: pop .35s cubic-bezier(.2,1.6,.4,1); max-height: 90vh; overflow-y: auto; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.modal-card > *:not(.confetti) { position: relative; z-index: 1; }
.lvlbadge { width: 90px; height: 90px; margin: 4px auto; border-radius: 50%; display: grid; place-items: center; font-size: 44px; font-weight: 700; color: #6a3a00; background: radial-gradient(circle at 35% 30%, #fff3a0, #ffc21a 60%, #e08a00); border: 4px solid #a86200; animation: wob 1s infinite; }
.mutbig { font-size: 76px; animation: wob 1.2s infinite; filter: drop-shadow(0 4px 0 rgba(0,0,0,.15)); }
@keyframes wob { 50% { transform: scale(1.1) rotate(-6deg); } }
.confetti { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.confetti i { position: absolute; top: -10px; width: 8px; height: 12px; border-radius: 2px; animation: fall linear infinite; }
@keyframes fall { to { top: 110%; transform: rotate(720deg) translateX(30px); } }
.days { display: flex; gap: 4px; justify-content: center; margin: 8px 0; }
.day { width: 42px; padding: 4px 0; background: #fff; border: 2px solid #e1c99a; border-radius: 10px; font-size: 18px; display: flex; flex-direction: column; } .day small { font-size: 9px; }
.day.got { background: #dcf8cf; border-color: #5cc93a; }
.stars { display: flex; gap: 2px; color: rgba(0,0,0,.25); font-size: 18px; } .stars span.on { color: #ffc21a; text-shadow: 0 2px 0 #a86200; }
.stars.big { justify-content: center; font-size: 56px; } .stars.big span.on { animation: pop .5s backwards; }

/* ---------- place bar ---------- */
.placebar { position: fixed; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translate(-50%, 140%); z-index: 15; background: var(--cream); border: 3px solid var(--wood-d); border-radius: 20px; padding: 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; box-shadow: 0 5px 0 var(--wood-d); transition: .25s; min-width: 260px; }
.placebar.show { transform: translate(-50%, 0); }
.placebar span { font-weight: 700; } .placebar small { opacity: .7; font-size: 12px; } .placebar div { display: flex; gap: 10px; }

/* ---------- battle (armonizado con la estética cálida de la granja) ---------- */
.battleui { position: fixed; inset: 0; z-index: 9; pointer-events: none; display: none; }
.battleui.show { display: block; }
.b-top { position: absolute; top: calc(8px + var(--safe-t)); left: 8px; right: 8px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; max-width: 760px; margin: 0 auto; }
.b-info, .b-stats { background: linear-gradient(#fff9ec, #f3dfb6); color: var(--ink); border: 2.5px solid var(--wood-d); border-radius: 16px; padding: 7px 12px; box-shadow: 0 3px 0 var(--wood-d); display: flex; flex-direction: column; gap: 2px; }
.b-info b { font-size: 15px; line-height: 1.15; }
.b-info small { font-size: 12px; color: #7a5228; font-weight: 700; }
.b-stats { align-items: flex-end; }
.b-metrics { display: flex; align-items: baseline; gap: 8px; }
.b-stats b { font-size: 19px; color: var(--ink); }
.b-stats span { font-size: 13px; font-weight: 700; color: #7a5228; }
#b-loot { color: #9a5b00; font-weight: 800; }
.b-hint { position: absolute; top: calc(82px + var(--safe-t)); left: 50%; transform: translateX(-50%); background: rgba(255,247,230,.96); color: var(--ink); border: 2.5px solid var(--wood-d); box-shadow: 0 3px 0 rgba(90,53,24,.3); padding: 7px 14px; border-radius: 14px; font-size: 13px; font-weight: 700; width: max-content; max-width: 92vw; text-align: center; animation: pulse 1.8s infinite; }
.b-bottom { position: absolute; left: 8px; right: 8px; bottom: calc(8px + var(--safe-b)); max-width: 760px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; pointer-events: auto; background: rgba(255,247,230,.92); border: 2.5px solid var(--wood-d); border-radius: 18px; padding: 6px 8px; box-shadow: 0 4px 0 var(--wood-d); }
.b-troops { flex: 1; display: flex; gap: 6px; overflow-x: auto; padding-top: 6px; }
.troop { width: 58px; height: 64px; flex: 0 0 58px; border-radius: 14px; background: linear-gradient(#fffdf6, #f3dfb6); border: 2.5px solid var(--wood-d); box-shadow: 0 3px 0 var(--wood-d); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 3px; color: var(--ink); }
.troop img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.troop .tr-name { font-size: 10.5px; font-weight: 800; color: #6a3f1a; line-height: 1.1; }
.troop span { font-size: 24px; } .troop b { font-size: 13px; }
.troop.sel { border-color: #d99000; background: linear-gradient(#fff6c0, #ffd860); transform: translateY(-5px); box-shadow: 0 4px 0 #a86200; }
.troop.empty { filter: grayscale(1); opacity: .5; }

#hud-inv b { font-size: 13px; } #hud-inv { flex: 1.15; }
.order .row2 .btn.small { flex: 0 0 44px; }

.pill b { font-size: 14px; }
.b-bottom .btn.small { padding: 7px 9px; font-size: 13px; }
.b-troops { padding-top: 8px; }

/* ---------- loading ---------- */
#loading { transition: opacity .5s, transform .5s; overflow: hidden; }
#loading.out { opacity: 0; transform: scale(1.08); pointer-events: none; }
.ld-sun { position: absolute; width: 520px; height: 520px; border-radius: 50%; background: repeating-conic-gradient(rgba(255,255,255,.14) 0 12deg, transparent 12deg 24deg); animation: rot 18s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
#loading > *:not(.ld-sun) { position: relative; }
.ld-bar { width: 200px; height: 16px; border-radius: 10px; background: rgba(0,0,0,.2); border: 3px solid #fff; overflow: hidden; margin: 10px 0 4px; }
.ld-bar i { display: block; height: 100%; width: 0; background: linear-gradient(#ffe066, #ffb21a); animation: load 1.3s ease-out forwards; }
@keyframes load { to { width: 100%; } }

/* ---------- quest tracker ---------- */
.qtrack { position: fixed; left: 8px; top: calc(86px + var(--safe-t)); z-index: 9; display: flex; flex-direction: column; gap: 8px; }
.qb { position: relative; width: 48px; height: 48px; border-radius: 50%; padding: 0; background: conic-gradient(#45b82a var(--f), #e8d6b0 0); box-shadow: 0 3px 0 rgba(60,30,10,.35); display: grid; place-items: center; animation: qin .4s backwards; }
.qb::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--cream); border: 2px solid var(--wood-d); }
.qb span { position: relative; font-size: 22px; }
.qb i { position: absolute; right: -4px; top: -4px; width: 20px; height: 20px; border-radius: 50%; background: #45b82a; color: #fff; font-style: normal; font-weight: 700; font-size: 12px; display: grid; place-items: center; border: 2px solid #fff; }
.qb.done { animation: qdone 1s infinite; }
@keyframes qdone { 50% { transform: scale(1.12) rotate(-6deg); } }
@keyframes qin { from { transform: scale(0); } }
body.tut-on .qtrack, body.placing .qtrack, body.in-battle .qtrack { display: none; }
.hud-row.small { margin-left: 0; }
.banner { top: calc(86px + var(--safe-t)); }
.brush { top: calc(86px + var(--safe-t)); }

/* ---------- tutorial ---------- */
.tut { position: fixed; left: 0; right: 0; top: calc(84px + var(--safe-t)); z-index: 35; display: none; justify-content: center; padding: 0 8px; pointer-events: none; }
.tut.show { display: flex; }
.tut-bubble { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; max-width: 460px; width: 100%; background: #fffdf5; border: 3px solid var(--wood-d); border-radius: 20px; padding: 10px 12px; box-shadow: 0 5px 0 var(--wood-d), 0 10px 24px rgba(0,0,0,.25); }
.tut-bubble.pop { animation: pop .4s cubic-bezier(.2,1.6,.4,1); }
.tut-avatar { flex: 0 0 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 38px; background: radial-gradient(circle at 40% 35%, #fff6d0, #ffd27a); border: 3px solid #e0a020; animation: talk 1.4s ease-in-out infinite; }
@keyframes talk { 50% { transform: rotate(-6deg) scale(1.05); } }
.tut-body { flex: 1; font-size: 15px; line-height: 1.35; }
.tut-name { font-weight: 700; color: #b0602a; font-size: 13px; display: flex; justify-content: space-between; }
.tut-name span { opacity: .6; }
#tut-text small { display: block; margin-top: 4px; color: #3b8f22; font-weight: 700; }
.tut-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; gap: 8px; }
.tut-actions .btn.small { margin-left: auto; }
.tut-skip { background: none; font-size: 12px; opacity: .55; text-decoration: underline; padding: 4px 0; }
.tut-hand { position: fixed; left: 0; top: 0; z-index: 50; font-size: 44px; pointer-events: none; display: none; filter: drop-shadow(0 4px 2px rgba(0,0,0,.35)); will-change: transform; }
.tut-hand.tap { animation: tapHand 1s ease-in-out infinite; }
@keyframes tapHand { 0%, 100% { margin-top: 10px; } 50% { margin-top: 0; } 55% { margin-top: 2px; } }
.tut-ring { position: fixed; left: 0; top: 0; z-index: 49; width: 60px; height: 60px; border-radius: 50%; border: 4px solid #fff; pointer-events: none; display: none; box-shadow: 0 0 0 3px rgba(255,200,40,.8); animation: ringP 1s ease-out infinite; }
@keyframes ringP { from { scale: .4; opacity: 1; } to { scale: 1.4; opacity: 0; } }
.tut-glow { position: relative; z-index: 60 !important; animation: glow 1s ease-in-out infinite !important; }
@keyframes glow { 50% { box-shadow: 0 0 0 5px #ffd34d, 0 0 24px 8px rgba(255,210,60,.9); } }
body.tut-on .sheet { z-index: 36; }

/* friendly hint chip */
.hint-chip { position: fixed; left: 0; top: 0; z-index: 48; pointer-events: none; background: #fffdf5; color: var(--ink); border: 2.5px solid var(--wood-d); border-radius: 14px; padding: 6px 11px; font-weight: 700; font-size: 14px; white-space: nowrap; box-shadow: 0 3px 0 var(--wood-d); opacity: 0; transition: opacity .3s; }
.hint-chip.show { opacity: 1; animation: chipB 1.6s ease-in-out infinite; }
@keyframes chipB { 50% { margin-top: -4px; } }
.hint-chip::before { content: ''; position: absolute; left: 50%; top: -9px; margin-left: -7px; border: 7px solid transparent; border-bottom-color: var(--wood-d); border-top: 0; }

/* ---------- shop extras ---------- */
.badge { position: absolute; top: -7px; left: -5px; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 8px; color: #fff; z-index: 1; transform: rotate(-8deg); box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.badge.new { background: #ff4d6d; } .badge.sale { background: #ff8a1f; left: auto; right: -5px; transform: rotate(8deg); }
.card.deal { border-color: #ff8a1f; box-shadow: 0 3px 0 #d06a10; background: linear-gradient(#fff, #fff1e0); }
.card s { opacity: .5; font-weight: 500; }
.dealbar { width: 100%; text-align: left; background: linear-gradient(90deg, #ffefd6, #fff); border: 2px dashed #ff8a1f; border-radius: 12px; padding: 7px 10px; font-size: 13.5px; margin: 4px 0; }
.tabs button { position: relative; }
.tdot { position: absolute; top: 2px; right: 3px; width: 9px; height: 9px; border-radius: 50%; background: #ff3b3b; }
.nextlvl { background: #fff6d0; border: 2px solid #ffd34d; border-radius: 12px; padding: 6px 10px; font-size: 13px; font-weight: 600; margin: 6px 0 10px; }
/* factory */
.slots { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.slot2 { position: relative; overflow: hidden; width: 64px; height: 64px; border-radius: 14px; background: #fff; border: 2.5px solid #e1c99a; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.slot2 span { font-size: 26px; line-height: 1; } .slot2 small { font-size: 10.5px; font-weight: 700; opacity: .75; }
.slot2.empty { border-style: dashed; opacity: .6; } .slot2.ready { border-color: #5cc93a; background: #effde6; animation: pulse 1s infinite; cursor: pointer; }
.slot2.work { border-color: #4fb8ff; } .slot2 i { position: absolute; left: 0; bottom: 0; height: 5px; background: #4fb8ff; }
.recipe.ok { border-color: #9ae07a; }
.recipe.locked { opacity: .62; border-style: dashed; background: #f6f0e4; }
.recipe.locked .big { filter: grayscale(.55); }
.recipe .have { color: #2c9a17; font-weight: 700; } .recipe .miss { color: #d6382b; font-weight: 700; }
/* event */
.evbtn { position: fixed; right: 8px; top: calc(86px + var(--safe-t)); z-index: 9; width: 56px; height: 62px; border-radius: 16px; background: linear-gradient(#fff, #ffeccc); border: 3px solid var(--c, #e8a820); box-shadow: 0 3px 0 rgba(60,30,10,.35); display: flex; flex-direction: column; align-items: center; justify-content: center; animation: evb 2.4s ease-in-out infinite; }
.evbtn span { font-size: 26px; line-height: 1; } .evbtn small { font-size: 10px; font-weight: 700; }
.evbtn .dot { top: -6px; right: -6px; }
@keyframes evb { 0%, 80%, 100% { transform: none; } 85% { transform: rotate(-8deg); } 90% { transform: rotate(8deg); } 95% { transform: rotate(-4deg); } }
body.tut-on .evbtn, body.placing .evbtn, body.in-battle .evbtn, body.editing .evbtn, body.editing .qtrack { display: none !important; }
.evhead { display: flex; gap: 12px; align-items: center; background: linear-gradient(135deg, var(--c), #fff 140%); color: #fff; border-radius: 18px; padding: 12px; text-shadow: 0 2px 0 rgba(0,0,0,.2); }
.evhead .big { font-size: 52px; } .evhead h2 { margin: 0; } .evhead p { margin: 2px 0; font-size: 14px; }
.evtok { text-align: center; font-size: 30px; margin: 6px 0; } .evtok b { font-size: 34px; }
.tier.got { opacity: .6; } .tier.can { border-color: #5cc93a; background: #f0ffe8; }
/* edit mode */
.editbar { position: fixed; left: 8px; right: 8px; bottom: calc(8px + var(--safe-b)); z-index: 15; background: var(--cream); border: 3px solid var(--wood-d); border-radius: 20px; padding: 8px 10px; box-shadow: 0 5px 0 var(--wood-d); transform: translateY(160%); transition: .25s; display: flex; flex-direction: column; gap: 6px; max-width: 560px; margin: 0 auto; }
.editbar.show { transform: none; }
.et { font-weight: 700; font-size: 14px; color: #b0602a; }
.ea { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-height: 34px; } .ea b { font-size: 14px; margin-right: auto; } .ehint { opacity: .65; font-size: 13px; }
.eb { display: flex; gap: 8px; justify-content: space-between; }
.eb b { background: #ff4d6d; color: #fff; border-radius: 8px; padding: 0 5px; font-size: 11px; }
.eb b:empty { display: none; }
body.editing #nav, body.editing #brush { display: none; }
body.editing #game { cursor: grab; }
.ea b { flex-basis: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ea .btn.small { flex: 1; padding: 7px 6px; font-size: 13px; }
.ea .btn.small.red { flex: 0 0 44px; }
body.editing #toasts, body.placing #toasts { bottom: calc(190px + var(--safe-b)); }

.ei { height: 1.15em; width: 1.15em; vertical-align: -0.22em; display: inline-block; object-fit: contain; }
.big .ei, .mutbig .ei { height: 1em; width: 1em; vertical-align: middle; }

/* ---------- right column ---------- */
.rcol { position: fixed; right: 8px; top: calc(86px + var(--safe-t)); z-index: 9; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.rcol .evbtn { position: relative; right: auto; top: auto; }
.rbtn { position: relative; width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(#fff9ec, #f3dfb6); border: 2.5px solid var(--wood-d); box-shadow: 0 3px 0 var(--wood-d); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rbtn span { font-size: 24px; line-height: 1; display: flex; align-items: center; justify-content: center; } .rbtn span .ei { width: 1.3em; height: 1.3em; vertical-align: middle; } .rbtn small { font-size: 9.5px; font-weight: 700; }
.rbtn:active { transform: translateY(2px); }
body.tut-on .rcol, body.placing .rcol, body.in-battle .rcol, body.editing .rcol, body.visiting .rcol, body.cutscene .rcol, body.in-salon .rcol, body.in-pond .rcol { display: none; }
body.cutscene #hud, body.cutscene #nav, body.cutscene .qtrack, body.cutscene .tut, body.in-salon #nav, body.in-salon .tut, body.in-pond #nav, body.in-pond .tut, body.visiting #nav, body.visiting .qtrack, body.visiting #brush, body.visiting .tut { display: none !important; }
.av { width: 40px; height: 40px; border-radius: 50%; flex: 0 0 40px; box-shadow: 0 2px 0 rgba(0,0,0,.15); }
.npc .av { width: 38px; height: 38px; }
img.tut-avatar { object-fit: cover; padding: 0; background: #fff6d0; }

/* ---------- cutscene ---------- */
.cut { position: fixed; inset: 0; z-index: 80; display: none; background: radial-gradient(ellipse at 50% 30%, rgba(255,240,200,.08), rgba(20,15,30,.62)); cursor: pointer; }
.cut.show { display: block; animation: fin .35s; }
.cut-title { position: absolute; left: 0; right: 0; top: 34%; text-align: center; color: #fff; font-size: clamp(30px, 8vw, 46px); font-weight: 700; text-shadow: 0 4px 0 rgba(0,0,0,.3), 0 0 30px rgba(255,200,80,.6); opacity: 0; pointer-events: none; }
.cut-title small { display: block; font-size: 16px; letter-spacing: 2px; color: #ffe066; }
.cut.title .cut-title { animation: ctitle 1.9s ease forwards; }
.cut.title .cut-box { opacity: 0; }
@keyframes ctitle { 0% { opacity: 0; transform: scale(.8); } 20%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-20px); } }
.cut-box { position: absolute; left: 10px; right: 10px; bottom: calc(18px + var(--safe-b)); max-width: 620px; margin: 0 auto; display: flex; align-items: flex-end; gap: 0; transition: opacity .2s; }
.cut-box.r { flex-direction: row-reverse; }
.cut-pic { width: clamp(110px, 32vw, 170px); height: clamp(110px, 32vw, 170px); border-radius: 50%; border: 5px solid #fff; box-shadow: 0 6px 0 rgba(0,0,0,.25), 0 10px 30px rgba(0,0,0,.35); flex: 0 0 auto; position: relative; z-index: 2; margin-bottom: 30px; }
.cut-pic.pop { animation: cpop .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes cpop { from { transform: scale(.5) translateY(30px); opacity: 0; } }
.cut-box.l .cut-pic { margin-right: -26px; } .cut-box.r .cut-pic { margin-left: -26px; }
.cut-bubble { flex: 1; position: relative; background: #fffdf5; border: 3.5px solid var(--wood-d); border-radius: 22px; padding: 14px 18px 12px; box-shadow: 0 6px 0 var(--wood-d); min-height: 130px; }
.cut-box.l .cut-bubble { padding-left: 34px; } .cut-box.r .cut-bubble { padding-right: 34px; }
.cut-bubble b { display: inline-block; color: #fff; border-radius: 12px; padding: 3px 12px; font-size: 15px; position: absolute; top: -16px; box-shadow: 0 3px 0 rgba(0,0,0,.2); text-shadow: 0 1px 0 rgba(0,0,0,.25); }
.cut-box.l .cut-bubble b { left: 34px; } .cut-box.r .cut-bubble b { right: 34px; }
.cut-bubble p { margin: 10px 0 6px; font-size: 17px; line-height: 1.4; min-height: 72px; }
.cut-box.nar .cut-bubble { background: #fff6dc; font-style: italic; }
.cut-next { display: block; text-align: right; opacity: .55; font-size: 12px; animation: pulse 1.2s infinite; }
.cut-skip { position: absolute; top: calc(12px + var(--safe-t)); right: 12px; background: rgba(255,255,255,.85); border-radius: 14px; padding: 7px 12px; font-weight: 700; font-size: 13px; }
.joinpic { width: 130px; height: 130px; border-radius: 50%; border: 5px solid #fff; box-shadow: 0 5px 0 rgba(0,0,0,.2); animation: wob 1.2s infinite; }

/* ---------- family ---------- */
.fam { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 9px; }
.fcard { background: linear-gradient(#fff, #fff8ec); border: 3px solid var(--c); border-radius: 18px; padding: 10px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 3px; box-shadow: 0 4px 0 var(--c); }
.fcard > img { width: 84px; height: 84px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 3px 0 rgba(0,0,0,.12); }
.fcard b { font-size: 15px; } .fcard small { font-size: 11.5px; opacity: .75; } .fcard p { margin: 2px 0 4px; font-size: 12px; line-height: 1.25; }
.fcard.locked { border-color: #ccc; box-shadow: 0 4px 0 #bbb; } .fcard.locked img { filter: brightness(0) opacity(.35); }
.li.chap .num { width: 36px; height: 36px; border-radius: 50%; background: #ffcf33; display: grid; place-items: center; font-weight: 700; flex: 0 0 36px; }
.li.chap.locked { opacity: .6; } .li.chap.locked .num { background: #ddd; }

/* ---------- expand ---------- */
.exp { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.exp canvas { width: 280px; max-width: 100%; height: 160px; background: #3a9cc9; border-radius: 16px; border: 3px solid var(--wood-d); }
.exp > div { flex: 1; min-width: 200px; }
.dirs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dir { background: #fff; border: 2.5px solid #e1c99a; border-radius: 14px; padding: 6px; display: flex; flex-direction: column; align-items: center; box-shadow: 0 3px 0 #e1c99a; }
.dir b { font-size: 24px; line-height: 1; } .dir small { font-size: 11.5px; font-weight: 700; }
.dir.on { border-color: #ffb21a; background: #fff6c0; box-shadow: 0 3px 0 #d0900a; } .dir[disabled] { opacity: .45; }

/* ---------- friends & visiting ---------- */
.fr-me { display: flex; gap: 10px; align-items: center; background: #fff; border: 2px solid #e8d4ab; border-radius: 16px; padding: 8px; margin-bottom: 6px; }
.fr-me img { width: 56px; height: 56px; border-radius: 50%; } .fr-me div { flex: 1; } .fr-me small { opacity: .7; font-size: 12px; }
#farmname, .inp { width: 100%; font: 700 16px Fredoka, sans-serif; border: 2px solid #e1c99a; border-radius: 10px; padding: 7px 10px; color: var(--ink); background: #fffdf5; }
.code { background: #fff3c4; padding: 2px 8px; border-radius: 8px; letter-spacing: 2px; }
.linkbox { width: 100%; height: 90px; font-size: 12px; border-radius: 10px; border: 2px solid #e1c99a; padding: 6px; }
h3 small { font-size: 11px; opacity: .6; font-weight: 600; }
.visitbar { position: fixed; left: 8px; right: 8px; bottom: calc(10px + var(--safe-b)); z-index: 15; max-width: 520px; margin: 0 auto; background: linear-gradient(#f0ffe8, #dff7cf); border: 3px solid #3b8f22; border-radius: 20px; padding: 8px 10px; display: none; align-items: center; gap: 10px; box-shadow: 0 5px 0 #2c7a17; }
.visitbar.show { display: flex; animation: pop .4s; }
.visitbar img { width: 50px; height: 50px; border-radius: 50%; border: 3px solid #fff; }
.visitbar > div { flex: 1; min-width: 0; } .visitbar b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .visitbar small { font-size: 12px; opacity: .75; }
.vb-bar { height: 8px; background: #fff; border-radius: 6px; overflow: hidden; margin-top: 3px; } .vb-bar i { display: block; height: 100%; background: linear-gradient(90deg, #5ddc3c, #ffd23a); transition: width .3s; }

/* ---------- beauty salon (playful) ---------- */
.salon { position: fixed; inset: 0; z-index: 75; display: none; flex-direction: column; background: radial-gradient(circle at 20% 15%, #ffd6ec 0 12%, transparent 13%), radial-gradient(circle at 85% 30%, #c9f0ff 0 10%, transparent 11%), radial-gradient(circle at 70% 85%, #fff1a8 0 9%, transparent 10%), linear-gradient(160deg, #ffb6dc, #c9a6ff 55%, #8fd6ff); padding: calc(8px + var(--safe-t)) 10px calc(10px + var(--safe-b)); gap: 8px; }
.salon.show { display: flex; animation: fin .3s; }
.salon-top { display: flex; align-items: center; gap: 10px; color: #fff; text-shadow: 0 2px 0 rgba(120,40,120,.4); }
.salon-top h2 { margin: 0; flex: 1; font-size: 22px; } #salon-name { font-weight: 700; background: rgba(255,255,255,.3); padding: 3px 10px; border-radius: 12px; }
.sbtn { width: 46px; height: 46px; border-radius: 50%; background: #fff; color: #a02a80; font-weight: 700; text-shadow: none; font-size: 22px; box-shadow: 0 4px 0 rgba(120,40,120,.35); border: 3px solid #ff6fd1; flex: 0 0 46px; }
.sbtn:active { transform: translateY(3px) scale(.95); }
.sbtn.dice { animation: wob 2s infinite; }
.salon-chars { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; flex: 0 0 auto; }
.sc { flex: 0 0 64px; display: flex; flex-direction: column; align-items: center; background: none; }
.sc img { width: 58px; height: 58px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 3px 0 rgba(120,40,120,.3); transition: transform .2s; }
.sc small { color: #fff; font-weight: 700; font-size: 11px; text-shadow: 0 1px 0 rgba(0,0,0,.3); }
.sc.on img { border-color: #ffd23a; transform: scale(1.12) rotate(-5deg); box-shadow: 0 0 0 4px rgba(255,210,58,.5), 0 3px 0 rgba(0,0,0,.2); }
.salon-stage { position: relative; flex: 1; min-height: 180px; }
.mirror { position: absolute; left: 50%; top: 4%; transform: translateX(-50%); width: min(62%, 300px); height: 88%; border-radius: 48% 48% 18px 18px; background: linear-gradient(135deg, rgba(255,255,255,.55), rgba(255,255,255,.15)); border: 8px solid #ffd23a; box-shadow: 0 0 0 4px #ff9ad5, inset 0 0 30px rgba(255,255,255,.6); }
#salon-cv { position: absolute; inset: 0; width: 100%; height: 100%; }
.salon-side { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 10px; }
.salon-tabs { display: flex; gap: 6px; overflow-x: auto; flex: 0 0 auto; padding-bottom: 2px; }
.salon-tabs button { flex: 0 0 auto; min-width: 62px; padding: 6px 8px; border-radius: 16px; background: rgba(255,255,255,.55); display: flex; flex-direction: column; align-items: center; border: 3px solid transparent; }
.salon-tabs button span { font-size: 22px; } .salon-tabs button small { font-size: 11px; font-weight: 700; }
.salon-tabs button.on { background: #fff; border-color: #ff6fd1; transform: translateY(-3px); box-shadow: 0 3px 0 rgba(120,40,120,.25); }
.salon-opts { flex: 0 0 auto; min-height: 96px; max-height: 26vh; overflow-y: auto; background: rgba(255,255,255,.85); border-radius: 22px; padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; box-shadow: inset 0 2px 8px rgba(120,40,120,.15); }
.row-o { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.sw { width: 44px; height: 44px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 3px 0 rgba(0,0,0,.18); transition: transform .15s; }
.sw.on { transform: scale(1.18); box-shadow: 0 0 0 3px #ff6fd1, 0 3px 0 rgba(0,0,0,.2); }
.opt { padding: 9px 13px; border-radius: 16px; background: #fff; border: 3px solid #f0d0ff; font-weight: 700; font-size: 14px; box-shadow: 0 3px 0 #e0b0f0; }
.opt.on { background: #ffeefa; border-color: #ff6fd1; box-shadow: 0 3px 0 #d04fa8; transform: translateY(-2px); }
.sw:active, .opt:active { transform: scale(.9); }
.salon-bottom { display: flex; gap: 8px; flex: 0 0 auto; }
.salon-bottom .btn { margin: 0; flex: 1; min-width: 0; font-size: 13px; }
.salon-done { margin: 0; flex: 1; background: linear-gradient(#ff8fd8, #e04fb0); border-color: #a02a80; box-shadow: 0 4px 0 #a02a80; }
.salon-bottom .avatar-btn { flex: 1.25; background: linear-gradient(#fff9ec, #ffe3f4); border-color: #ff6fd1; box-shadow: 0 4px 0 #a02a80; color: #a02a80; }

.troop img { width: 40px; height: 40px; border-radius: 50%; } .tpic { width: 54px; height: 54px; border-radius: 50%; }

/* family tree */
.tree { overflow-x: auto; margin: 6px -4px; padding-bottom: 6px; }
.tree-in { min-width: 560px; display: flex; flex-direction: column; align-items: center; }
.troot { display: flex; flex-direction: column; align-items: center; }
.troot small { font-weight: 700; color: #9b7fd1; }
.tline { width: 76%; height: 16px; border: 3px solid #c9a26b; border-bottom: 0; border-radius: 12px 12px 0 0; margin-top: 4px; }
.trow { display: flex; gap: 8px; width: 100%; justify-content: space-between; }
.tbranch { flex: 1; display: flex; flex-direction: column; align-items: center; background: rgba(255,255,255,.6); border-radius: 16px; padding: 6px 4px; border: 2px dashed #e1c99a; }
.tcouple { display: flex; align-items: center; gap: 2px; }
.heart { font-size: 13px; }
.tkids { display: flex; gap: 4px; justify-content: center; margin-top: 8px; position: relative; padding-top: 8px; border-top: 3px solid #c9a26b; }
.tn { width: 58px; display: flex; flex-direction: column; align-items: center; }
.tn img { width: 50px; height: 50px; border-radius: 50%; border: 3px solid var(--c); background: #fff; }
.tn b { font-size: 11px; text-align: center; line-height: 1.1; margin-top: 2px; }
.tn.locked img { filter: brightness(0) opacity(.3); border-color: #ccc; }
.tn.star img { box-shadow: 0 0 0 3px #ffd23a, 0 0 12px rgba(255,210,58,.8); }
.tn.empty { height: 50px; }
.tother { display: flex; gap: 10px; justify-content: space-around; margin-top: 8px; }
.tother small { display: block; text-align: center; font-weight: 700; opacity: .7; }
.joinrow { display: flex; justify-content: center; gap: 6px; } .joinrow .joinpic { width: 110px; height: 110px; }
.tree-in { min-width: 0; }
.trow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tline { width: 52%; }
@media (min-width: 620px) { .trow { grid-template-columns: repeat(4, 1fr); } .tline { width: 76%; } }

/* salon fixes + tools */
.salon-chars, .salon-tabs, .salon-opts, .tree { scrollbar-width: none; }
.salon-chars::-webkit-scrollbar, .salon-tabs::-webkit-scrollbar, .salon-opts::-webkit-scrollbar, .tree::-webkit-scrollbar { display: none; }
.sc small { color: #5a2060; text-shadow: 0 1px 0 #fff, 0 0 4px #fff; margin-top: 2px; }
.sc.on small { color: #a02a80; }
#salon-name { color: #7a2a7a; background: rgba(255,255,255,.75); text-shadow: none; }
.salon-chars { padding: 8px 4px 8px; }
#salon-cv { touch-action: none; cursor: crosshair; }
.salon.tooling .salon-side { display: none; }
.tools { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; width: 100%; }
.tool { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: 16px; background: #fff; border: 3px solid #f0d0ff; box-shadow: 0 3px 0 #e0b0f0; }
.tool span { font-size: 26px; line-height: 1.1; } .tool small { font-size: 10.5px; font-weight: 700; }
.tool.on { background: #ffeefa; border-color: #ff6fd1; box-shadow: 0 3px 0 #d04fa8; transform: translateY(-3px) rotate(-3deg); }
.tool.on span { animation: wob 1s infinite; }
.row-o.paint .sw { width: 34px; height: 34px; border-width: 3px; }
.shint { width: 100%; margin: 2px 0 0; text-align: center; font-weight: 700; font-size: 13px; color: #7a2a7a; }
@media (max-width: 360px) { .tool small { font-size: 9px; } }
/* herd (animals per pen) */
.herd{background:#fff7e6;border:2px solid #f0d9a8;border-radius:16px;padding:10px;margin:10px 0}
.herd-top{display:flex;justify-content:space-between;align-items:baseline;gap:8px;flex-wrap:wrap}
.herd-top small{color:#8a6a3a}
.herd-slots{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}
.herd-slots span{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;font-size:22px;background:#f3e6c8;color:#c7a66a;font-weight:900;border:2px dashed #dcc08a}
.herd-slots span.on{background:#e4f6d2;border:2px solid #9fd06b;animation:herdpop .4s ease}
@keyframes herdpop{0%{transform:scale(.4)}70%{transform:scale(1.15)}100%{transform:scale(1)}}
/* pond minigames */
.pond{position:fixed;inset:0;z-index:76;display:none;flex-direction:column;background:linear-gradient(180deg,#8fdcff,#5ec0e8 40%,#3aa0cf);padding:calc(8px + var(--safe-t)) 10px calc(10px + var(--safe-b));gap:8px}
.pond.show{display:flex;animation:fin .3s}
.pond-top{display:flex;align-items:center;gap:10px;color:#fff;text-shadow:0 2px 0 rgba(0,60,100,.35)}
.pond-top h2{margin:0;flex:1;font-size:22px}
#pond-plays{font-weight:900;background:rgba(255,255,255,.35);padding:4px 12px;border-radius:14px}
.pond-menu{flex:1;display:flex;flex-direction:column;gap:12px;overflow:auto;scrollbar-width:none;max-width:560px;width:100%;margin:0 auto}
.pgame{display:grid;grid-template-columns:70px 1fr;gap:6px 12px;align-items:center;background:#fffdf3;border-radius:22px;padding:14px;box-shadow:0 5px 0 rgba(0,60,100,.25)}
.pgame .pg-art{font-size:46px;width:70px;height:70px;border-radius:20px;display:grid;place-items:center;background:linear-gradient(160deg,#c9f0ff,#7fd0f0)}
.pgame.frog .pg-art{background:linear-gradient(160deg,#dff7c4,#8fd36a)}
.pgame h3{margin:0 0 2px;color:#2a5a7a}.pgame p{margin:0;font-size:13px;color:#4a5a66}.pgame small{color:#b07a10;font-weight:800}
.pgame .btn{grid-column:1/-1}
.pcoll{background:rgba(255,255,255,.85);border-radius:20px;padding:12px;text-align:center}
.pcoll>div{display:flex;justify-content:center;gap:8px;margin:8px 0;flex-wrap:wrap}
.pcoll span{position:relative;width:46px;height:46px;border-radius:14px;display:grid;place-items:center;font-size:26px;background:#dbe9ef;color:#9ab;font-weight:900}
.pcoll span.on{background:#fff3c4;box-shadow:inset 0 0 0 2px #f0c94a}
.pcoll span small{position:absolute;right:3px;bottom:1px;font-size:10px;color:#7a5a10}
.pond-game{flex:1;position:relative;border-radius:22px;overflow:hidden;display:none;box-shadow:0 6px 0 rgba(0,60,100,.25)}
#pond-cv{position:absolute;inset:0;width:100%;height:100%;touch-action:none}
.pond-hud{position:absolute;left:0;right:0;top:0;pointer-events:none}
.ph-bar{display:flex;gap:8px;align-items:center;justify-content:center;flex-wrap:wrap;margin:10px;padding:8px 12px;border-radius:16px;background:rgba(0,40,70,.45);color:#fff;font-size:15px;text-align:center}
.ph-bar span{background:rgba(255,255,255,.2);padding:2px 10px;border-radius:10px;font-weight:800}
.pond-res{pointer-events:auto;position:absolute;left:50%;top:50%;transform:translate(-50%,40%);width:min(88%,360px);background:#fffdf3;border-radius:24px;padding:18px;text-align:center;box-shadow:0 8px 0 rgba(0,60,100,.3);animation:fin .35s}
.pond-res h2{margin:0 0 8px;color:#2a5a7a}
.pr-items{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;font-size:20px;font-weight:900}
.pr-items span{background:#eaf7ff;padding:4px 10px;border-radius:12px}
.pr-rew{font-size:20px;font-weight:900;color:#b07a10}
.mine{background:linear-gradient(160deg,#eef4ff,#e4dcff);border-radius:16px;padding:10px;margin:8px 0}
.mine-g{display:flex;flex-wrap:wrap;gap:4px;justify-content:center;margin-bottom:6px}
.mine-g span{font-size:22px;filter:grayscale(1) opacity(.3)}.mine-g span.on{filter:none;animation:herdpop .4s}
.card .badge.sea{position:absolute;top:4px;right:4px;background:#fff;border-radius:10px;padding:0 4px;font-size:13px}
.card .badge.off{position:absolute;top:4px;right:4px;background:#ffe9d6;border-radius:10px;padding:0 4px;font-size:13px}
.festbar{background:linear-gradient(90deg,#ffe066,#ffb3d9);border-radius:12px;padding:6px 10px;font-size:14px}
/* calendar */
.calhead{display:flex;gap:12px;align-items:center;background:linear-gradient(120deg,var(--c),#fff4d6);border-radius:18px;padding:10px 14px;margin-bottom:8px}
.calhead>span{font-size:40px}.calhead b{display:block;font-size:17px}.calhead small{color:#5a4030}
.calweek{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;margin:8px 0}
.cday{background:#fff7e6;border:2px solid #f0d9a8;border-radius:12px;padding:4px 2px;text-align:center;min-height:74px;display:flex;flex-direction:column;align-items:center}
.cday small{font-size:10px;color:#8a6a3a;font-weight:700}.cday b{font-size:16px}
.cday div{display:flex;flex-wrap:wrap;justify-content:center;gap:1px}.cday img{width:22px;height:22px;border-radius:50%;background:#fff}.cday span{font-size:17px}
.cday.today{background:#fff;border-color:#ff8a3a;box-shadow:0 0 0 2px #ffcc80}.cday.past{opacity:.55}.cday.fest{background:#fff0c4}
.calev{display:flex;gap:10px;align-items:center}.calev img{width:44px;height:44px;border-radius:50%;background:#ffe9f4}.calev>div{flex:1}
.calev small{display:block;color:#7a5a3a}
.chip.lock{opacity:.5}
.bigport{width:110px;height:110px;border-radius:50%;background:#ffe9f4;display:block;margin:0 auto 6px}
/* version + patch notes */
.verbox{display:flex;flex-wrap:wrap;gap:6px;align-items:center;background:#f3f8ff;border-radius:14px;padding:8px 10px;margin-top:8px}
.verbox>b{flex:1 1 100%}.verbox>small{flex:1 1 100%;color:#3a6a3a}
.patch{max-height:52vh;overflow:auto;text-align:left;scrollbar-width:none}
.pv{background:#fff7e6;border-radius:14px;padding:8px 10px;margin:6px 0}.pv>small{color:#8a6a3a;margin-left:6px}
.pv ul{list-style:none;margin:6px 0 0;padding:0}.pv li{display:flex;gap:8px;align-items:flex-start;margin:5px 0}.pv li span{font-size:18px}.pv li p{margin:0;font-size:14px}
.upd{position:fixed;left:50%;top:calc(110px + var(--safe-t));transform:translate(-50%,-30px);opacity:0;pointer-events:none;z-index:68;background:linear-gradient(90deg,#7a4fc4,#e0559a);color:#fff;border:0;border-radius:20px;padding:10px 16px;font:inherit;font-size:14px;box-shadow:0 4px 0 rgba(60,20,80,.35);transition:.35s}
.upd.show{opacity:1;transform:translate(-50%,0);pointer-events:auto;animation:updpulse 2s infinite}
@keyframes updpulse{50%{box-shadow:0 4px 0 rgba(60,20,80,.35),0 0 0 6px rgba(224,85,154,.25)}}
.ctabs{display:grid!important;grid-template-columns:repeat(4,1fr);gap:4px}.ctabs button{display:flex;flex-direction:column;align-items:center;padding:4px 2px!important;min-width:0}.ctabs small{font-size:11px}
.card .badge.sea,.card .badge.off{left:auto;top:-6px;right:-4px;transform:rotate(8deg);padding:1px 5px;font-size:14px;line-height:1.2}
.herd-slots span.baby{background:#fff6d0;border:2px solid #f2cf55;position:relative;font-size:17px}
.herd-slots span.baby i{position:absolute;bottom:-7px;left:50%;transform:translateX(-50%);font-size:9px;font-style:normal;background:#f2cf55;color:#5a4010;border-radius:6px;padding:0 3px;white-space:nowrap}
.herd .row2 .btn small{display:block;font-size:11px;opacity:.85;font-weight:600}
/* salon v2: interactive hairdresser */
.salon.tooling .salon-side{display:flex}
.salon.tooling #salon-cv{border-radius:22px;box-shadow:0 6px 0 rgba(120,40,120,.25)}
.salon.tooling .mirror{display:none}
#salon-tabs{flex-direction:column;align-items:stretch;gap:6px;overflow:visible}
.smodes{display:flex;gap:6px;background:rgba(255,255,255,.45);border-radius:16px;padding:4px;align-self:center}
.smodes button{min-width:0!important;flex-direction:row!important;padding:6px 14px!important;border-radius:12px!important;font-weight:800;font-size:14px;background:transparent!important;color:#7a2a7a}
.smodes button.on{background:#fff!important;box-shadow:0 2px 0 rgba(120,40,120,.25);transform:none!important}
.tray{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding:4px 2px 6px;background:linear-gradient(#e7b47a,#c98d4f);border-radius:18px;box-shadow:inset 0 -4px 0 rgba(90,50,20,.3)}
.tray::-webkit-scrollbar{display:none}
.tray.tabs2{background:none;box-shadow:none}
.ttool{flex:0 0 auto;width:66px;min-width:66px!important;display:flex;flex-direction:column;align-items:center;padding:4px 2px!important;border-radius:14px!important;background:rgba(255,255,255,.25)!important;border:2px solid transparent}
.ttool svg{width:44px;height:44px;filter:drop-shadow(0 2px 0 rgba(0,0,0,.2))}
.ttool small{color:#4a2a10;font-weight:800;font-size:11px}
.ttool.on{background:rgba(255,255,255,.85)!important;border-color:#ff6fd1;transform:translateY(-4px)}
/* inside the house */
.inhouse{position:fixed;inset:0;z-index:77;display:none;flex-direction:column;gap:8px;background:linear-gradient(180deg,#ffe9c7,#f6c98f);padding:calc(8px + var(--safe-t)) 10px calc(10px + var(--safe-b))}
.inhouse.show{display:flex;animation:fin .3s}
.ih-top{display:flex;align-items:center;gap:10px}.ih-top>div{flex:1}.ih-top h2{margin:0;font-size:20px;color:#5a3518}.ih-top small{color:#7a4a26;font-weight:700}
#ih-coins{font-weight:900;background:#fff7e6;border-radius:14px;padding:4px 10px}
.ih-stage{flex:1;position:relative;border-radius:22px;overflow:hidden;background:radial-gradient(circle at 50% 40%,#fff3dc,#e8c08a);box-shadow:inset 0 0 0 3px rgba(122,74,38,.2)}
#ih-cv{position:absolute;inset:0;width:100%;height:100%;touch-action:none}
.ih-tip{position:absolute;left:10px;right:10px;top:8px;text-align:center;background:rgba(90,53,24,.75);color:#fff;border-radius:12px;padding:6px 10px;font-size:13px;pointer-events:none}
.ih-sel{position:absolute;left:8px;right:8px;bottom:8px;display:none;flex-direction:column;gap:6px;background:#fffdf3;border-radius:16px;padding:8px 10px;box-shadow:0 4px 0 rgba(90,53,24,.25)}
.ih-sel.show{display:flex}.ih-sel small{color:#7a5a3a}.ih-sel .row2{display:flex;gap:6px}.ih-sel .row2 .btn{flex:1;margin:0}
.ih-cols{display:flex;gap:4px;flex-wrap:wrap}.ih-cols .sw{width:24px;height:24px}
.ih-tabs{display:grid;grid-template-columns:repeat(5,1fr);gap:4px}
.ih-tabs button{display:flex;flex-direction:column;align-items:center;padding:4px 2px;border-radius:12px;background:rgba(255,255,255,.5);border:2px solid transparent}
.ih-tabs button.on{background:#fff;border-color:#e8a04a}.ih-tabs span{font-size:20px}.ih-tabs small{font-size:11px;font-weight:800;color:#5a3518}
.ih-cat{max-height:30vh;overflow:auto;scrollbar-width:none}
.ih-items{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.ih-card{display:flex;flex-direction:column;align-items:center;gap:1px;background:#fffdf3;border-radius:14px;padding:6px 2px;border:2px solid #f0d9a8}
.ih-card span{font-size:26px}.ih-card b{font-size:11px;text-align:center;line-height:1.1}.ih-card small{font-size:10px;color:#8a6a3a}
.ih-card.on{border-color:#ff8a3a;background:#fff3d6}.ih-card.poor{opacity:.55}
.ih-row{display:flex;flex-wrap:wrap;gap:5px;align-items:center;margin-bottom:8px}.ih-row b{width:100%;font-size:13px;color:#5a3518}
body.in-house #nav,body.in-house .rcol,body.in-house .tut{display:none!important}
.ih-rooms{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;flex:0 0 auto}
.ih-rooms::-webkit-scrollbar{display:none}
.ih-rooms button{flex:0 0 auto;padding:6px 12px;border-radius:14px;background:rgba(255,255,255,.55);font-weight:800;font-size:13px;color:#5a3518;border:2px solid transparent;white-space:nowrap}
.ih-rooms button.on{background:#fff;border-color:#e8a04a}.ih-rooms button.add{background:#7fd35a;color:#fff;text-shadow:0 1px 0 rgba(0,0,0,.2)}.ih-rooms button.add.on{border-color:#3c8a2a}
.ih-p{margin:4px 2px 8px;font-size:13px;color:#5a3518}
.ih-fams{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.ih-fam{display:grid;grid-template-columns:34px 1fr;grid-template-rows:auto auto auto;gap:0 6px;text-align:left;background:#fffdf3;border-radius:14px;padding:8px;border:2px solid #f0d9a8;align-items:center}
.ih-fam span{grid-row:1/4;font-size:26px}.ih-fam b{font-size:12px}.ih-fam small{font-size:11px;color:#8a6a3a}.ih-fam i{font-style:normal;font-weight:900;color:#b07a10;font-size:12px}
.ih-fam:disabled{opacity:.5}
.dirs.compass{grid-template-columns:repeat(3,1fr);gap:4px}.dirs.compass .dir{padding:4px 2px;min-height:44px}.dirs.compass .dir small{font-size:10px}.dirs.compass .mid{display:grid;place-items:center;font-size:22px;opacity:.8}
.crew{display:flex;flex-direction:column;align-items:center;gap:4px;margin:4px 0;width:100%}
.crew .stars{color:#ffb400;font-size:15px;letter-spacing:1px;text-shadow:0 1px 0 #a06a00}
.crew small{font-size:10.5px;color:#6a4a2a;text-align:center}
.crew .btn{width:100%;margin:0}
.li.rep img{width:44px;height:44px;border-radius:50%;background:#fff3d6;flex:0 0 auto}.li.rep small{display:block}.warn{color:#c0392b;font-weight:700}
.fcard img.ei,.li img.ei{width:1.1em!important;height:1.1em!important;border:0!important;box-shadow:none!important;border-radius:0!important;background:none!important;vertical-align:-0.15em}
/* arcade */
.arcade{position:fixed;inset:0;z-index:78;display:none;flex-direction:column;gap:8px;background:linear-gradient(180deg,#7a4fc4,#e0559a);padding:calc(8px + var(--safe-t)) 10px calc(10px + var(--safe-b))}
.arcade.show{display:flex;animation:fin .3s}
.ar-top{display:flex;align-items:center;gap:10px;color:#fff;text-shadow:0 2px 0 rgba(60,20,80,.4)}.ar-top h2{margin:0;flex:1;font-size:20px}
#ar-e{font-weight:900;background:rgba(255,255,255,.3);padding:4px 10px;border-radius:14px;text-align:center;line-height:1.1}#ar-e small{display:block;font-size:10px;font-weight:700}
.ar-menu{flex:1;display:flex;flex-direction:column;gap:10px;overflow:auto;scrollbar-width:none;max-width:560px;width:100%;margin:0 auto}
.ar-who{background:#fffdf3;border-radius:20px;padding:10px}.ar-who>b{color:#5a2a7a}
.ar-chars{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding:6px 0}
.ar-chars button{flex:0 0 auto;display:flex;flex-direction:column;align-items:center;background:#f6ecff;border:2px solid transparent;border-radius:14px;padding:4px 6px;min-width:62px}
.ar-chars button.on{border-color:#e0559a;background:#fff}.ar-chars img{width:42px;height:42px;border-radius:50%}.ar-chars small{font-size:11px;font-weight:800}.ar-chars i{font-style:normal;font-size:10px;color:#b07a10;font-weight:800}
.ar-xp{display:flex;gap:10px;align-items:center}.ar-xp img{width:54px;height:54px;border-radius:50%;background:#ffe9f4}.ar-xp>div{flex:1}.ar-xp small{color:#6a4a2a}
.ar-xp .bar,.xpb{height:10px;border-radius:6px;background:#eadcf5;overflow:hidden;margin:4px 0}.ar-xp .bar i,.xpb i{display:block;height:100%;background:linear-gradient(90deg,#b38cff,#ff6fd1);border-radius:6px}
.ar-xp.small img{width:40px;height:40px}
.ar-list{display:flex;flex-direction:column;gap:8px}
.ar-card{display:grid;grid-template-columns:58px 1fr auto;gap:10px;align-items:center;text-align:left;background:#fffdf3;border-radius:20px;padding:10px;border:0;box-shadow:0 4px 0 rgba(60,20,80,.25);border-left:8px solid var(--c)}
.ar-card>span{font-size:38px;width:58px;height:58px;display:grid;place-items:center;border-radius:16px;background:var(--c)}
.ar-card b{display:block;color:#3a2a4a;font-size:15px}.ar-card small{display:block;font-size:12px;color:#6a5a7a}.ar-card i{font-style:normal;font-size:11px;font-weight:800;color:#b07a10}
.ar-card em{font-style:normal;font-weight:900;background:#ffe066;border-radius:12px;padding:6px 8px;color:#5a3a00}
.ar-game{flex:1;position:relative;border-radius:22px;overflow:hidden;display:none;box-shadow:0 6px 0 rgba(60,20,80,.3)}
#ar-cv{position:absolute;inset:0;width:100%;height:100%;touch-action:none}
.ar-hud{position:absolute;left:0;right:0;top:0;pointer-events:none}
.ar-bar{display:flex;gap:8px;justify-content:center;align-items:center;flex-wrap:wrap;margin:8px;padding:6px 10px;border-radius:16px;background:rgba(40,20,60,.5);color:#fff;font-size:15px}
.ar-bar span{background:rgba(255,255,255,.2);padding:2px 9px;border-radius:10px;font-weight:800}
.ar-result{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(88%,360px);background:#fffdf3;border-radius:24px;padding:16px;text-align:center;box-shadow:0 8px 0 rgba(60,20,80,.3);animation:fin .35s}
.ar-result h2{margin:0;color:#5a2a7a;font-size:20px}.ar-score{font-size:40px;font-weight:900;color:#e0559a;margin:6px 0}.ar-score small{font-size:14px;color:#7a5a8a}
.ar-rew{display:flex;gap:8px;justify-content:center;margin-bottom:8px}.ar-rew span{background:#fff3c4;border-radius:12px;padding:4px 10px;font-weight:900;color:#7a5a10}
.ar-result .row2{display:flex;gap:6px}.ar-result .row2 .btn{flex:1;margin:0}
body.in-arcade #nav,body.in-arcade .rcol,body.in-arcade .tut{display:none!important}

/* ===== El Valle (extras) ===== */
.xgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.xtile{position:relative;display:flex;flex-direction:column;align-items:center;gap:2px;padding:10px 4px;border:0;border-radius:16px;background:#fffdf3;box-shadow:0 3px 0 rgba(90,50,20,.18);text-align:center}
.xtile span{font-size:30px}.xtile b{font-size:12.5px;color:#4a2e14}.xtile small{font-size:10px;color:#8a6a4a;line-height:1.15}
.xtile.lock{opacity:.55;filter:grayscale(.6)}.xtile .tdot{position:absolute;top:6px;right:6px}
.xback{margin:0 0 6px}
.xsheet h3{margin:14px 0 6px;font-size:15px;color:#5a3a1a}
.xcard{display:grid;grid-template-columns:44px 1fr auto;gap:8px;align-items:center;background:#fffdf3;border-radius:14px;padding:8px;margin:6px 0;box-shadow:0 2px 0 rgba(90,50,20,.15)}
.xcard>span{font-size:30px;text-align:center}.xcard b{display:block;font-size:14px;color:#4a2e14}.xcard small{display:block;font-size:11.5px;color:#7a5a3a}.xcard em{font-style:normal;color:#b07a10;font-size:11px}
.xcard .btn.small{white-space:nowrap}
.xdeal{background:linear-gradient(135deg,#ffe08a,#ffb3d1);border-radius:16px;padding:6px 8px 2px;font-weight:800;color:#7a2a4a;margin:6px 0}
.xreq{display:grid;grid-template-columns:48px 1fr auto;gap:8px;align-items:center;background:#fffdf3;border-radius:14px;padding:8px;margin:6px 0}
.xreq img{width:48px;height:48px;border-radius:50%;background:#ffe9c7}.xreq b{display:block;font-size:14px}.xreq small{display:block;font-size:11.5px;color:#7a5a3a}
.xchests{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
.xchest{display:flex;flex-direction:column;align-items:center;gap:3px;padding:10px;border-radius:16px;background:linear-gradient(#fffdf3,#fff3d6);border:3px solid var(--c,#ccc);text-align:center}
.xchest span{font-size:36px;filter:drop-shadow(0 0 6px var(--c))}.xchest b{font-size:12.5px}.xchest small{font-size:11px;color:#7a5a3a}
.xchest.empty{border-style:dashed;color:#b9a58a;justify-content:center;min-height:110px}
.xrank{background:#fffdf3;border-radius:12px;padding:6px 10px;margin:6px 0}.xrank summary{font-weight:800;font-size:14px}.xrank p{margin:3px 0;font-size:13px;display:flex;gap:6px}.xrank p b{margin-left:auto}.xrank p.me{color:#2c7a17;font-weight:800}
.xalbum{background:#fffdf3;border-radius:14px;padding:8px 10px;margin:6px 0}.xalbum>div{display:flex;flex-wrap:wrap;gap:4px;margin:6px 0}
.xalbum span{width:34px;height:34px;display:grid;place-items:center;border-radius:10px;background:#eee3cf;color:#b9a58a;font-weight:800;font-size:20px}.xalbum span.on{background:#c9f0b0}
.xalbum small{display:block;font-size:11.5px;color:#7a5a3a;margin-bottom:4px}
.xpass{display:flex;flex-direction:column;gap:5px}
.xpt{display:grid;grid-template-columns:28px 1fr 1fr;gap:6px;align-items:center;opacity:.6}.xpt.on{opacity:1}
.xpt em{font-style:normal;font-weight:900;text-align:center;color:#7a5a3a}
.xpt button{border:0;border-radius:12px;padding:8px 6px;font-size:12px;font-weight:800;background:#fffdf3;color:#4a2e14;box-shadow:0 2px 0 rgba(90,50,20,.18)}
.xpt button.prem{background:linear-gradient(#fff2b0,#ffd36b)}.xpt button:not([disabled]){outline:3px solid #5ddc3c;animation:pulse 1.2s infinite}
.xpt button.got{opacity:.45;text-decoration:line-through}
.btn.gold{background:linear-gradient(#ffe066,#f2a900);border-color:#a86f00;box-shadow:0 4px 0 #a86f00}
.xprice{display:flex;gap:6px;margin:6px 0}.xprice button{flex:1;border:0;border-radius:10px;padding:7px;font-weight:800;background:#fffdf3}.xprice button.on{background:#7fe05a;color:#fff}
.xinv{display:grid;grid-template-columns:repeat(6,1fr);gap:5px}.xinv button{border:0;border-radius:10px;background:#fffdf3;font-size:22px;padding:5px 0;position:relative}.xinv small{position:absolute;right:3px;bottom:1px;font-size:10px;font-weight:800}
.xtiers{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;margin-top:8px}.xtiers>div{background:#fffdf3;border-radius:12px;padding:6px 4px;text-align:center;font-size:11px}.xtiers b{display:block;font-size:14px}.xtiers small{display:block;min-height:28px}
.xloot{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin:8px 0}.xloot span{background:#fff6dc;border-radius:12px;padding:6px 10px;font-weight:800}
.xportrait{width:96px;height:96px;border-radius:50%;display:block;margin:0 auto;background:#ffe9c7}
.xline{font-style:italic;text-align:center;font-size:16px}
.xlist p{margin:4px 0;text-align:center;font-weight:700}
.ar-diff{text-align:center;color:#fff;font-weight:800;font-size:13px;margin:4px 0 8px}.ar-diff small{display:block;font-weight:600;opacity:.85}
.ar-wrap{display:flex;flex-direction:column;gap:4px}
.ar-pw{align-self:flex-end;border:0;border-radius:12px;padding:5px 10px;font-size:12px;font-weight:800;background:rgba(255,255,255,.6);color:#5a3a6a}.ar-pw.on{background:#c9f7b0;color:#2c6a17}
.xsos{position:fixed;inset:0;z-index:60;background:#223;display:flex;flex-direction:column}
.xsos-top{display:flex;align-items:center;gap:8px;padding:calc(env(safe-area-inset-top) + 10px) 12px 10px;color:#fff;background:#3a2a5a}
.xsos-top b{flex:1;font-size:15px}.xsos-top span{font-weight:800}.xsos-top button{border:0;border-radius:50%;width:36px;height:36px;font-size:18px;background:#fff}
.xsos canvas{flex:1;width:100%;touch-action:none}
.xsos-res{position:absolute;left:16px;right:16px;top:30%;background:#fffdf3;border-radius:22px;padding:16px;text-align:center;box-shadow:0 10px 30px rgba(0,0,0,.4)}
.works{background:#fff3d6;border:2px dashed #e0a800;border-radius:14px;padding:8px 10px;margin:6px 0}.works p{margin:4px 0 0;font-size:12.5px}
/* ===== invasión (defensa por oleadas) ===== */
body.in-td #nav,body.in-td .rcol,body.in-td .qtrack,body.in-td .tut,body.in-td .hint-chip{display:none!important}
#td{position:fixed;left:0;right:0;bottom:0;z-index:40;padding:8px 8px calc(env(safe-area-inset-bottom) + 8px);background:linear-gradient(rgba(40,25,60,.0),rgba(40,25,60,.85) 30%);color:#fff;pointer-events:auto}
#td .td-top{display:flex;justify-content:space-between;align-items:center;padding:0 6px 6px;font-size:15px;text-shadow:0 2px 0 rgba(0,0,0,.4)}
#td .td-e{background:#ffd23a;color:#5a3a00;border-radius:999px;padding:3px 12px;font-weight:900;box-shadow:0 3px 0 #b08500}
#td .td-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(44px,1fr));gap:5px;padding-bottom:2px}
#td .td-cards button{position:relative;min-width:0;height:68px;padding:0;border:0;border-radius:14px;background:#fffdf3;box-shadow:0 4px 0 #b9a58a;display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:hidden}
#td .td-cards button span{font-size:26px;line-height:1.1}#td .td-cards button small{font-weight:900;color:#7a5a00;font-size:11px}
#td .td-cards button em{position:absolute;top:2px;left:4px;font-style:normal;font-size:9px;font-weight:800;color:#8a6a4a}
#td .td-cards button.sel{outline:4px solid #5ddc3c;transform:translateY(-6px)}
#td .td-cards button.off{filter:grayscale(.7);opacity:.75}
#td .td-cards button i{position:absolute;left:0;right:0;bottom:0;background:rgba(0,0,0,.35)}
#td .td-hint{margin:6px 4px 0;font-size:12px;text-align:center;opacity:.9}

.td-glow{outline:4px solid #ffe066!important;border-radius:16px;animation:pulse 1s infinite}
.td-tut{position:fixed;left:0;right:0;top:22%;z-index:45;display:flex;justify-content:center;pointer-events:none}
.td-tutbox{pointer-events:auto;max-width:330px;margin:0 14px;background:#fffdf3;border:4px solid #7a4a26;border-radius:20px;padding:12px 14px;box-shadow:0 8px 20px rgba(0,0,0,.35);text-align:center}
.td-tutbox small{color:#a0784a;font-weight:800}.td-tutbox p{margin:6px 0 10px;font-size:15px;font-weight:700;color:#4a2e14}
.td-ghost{position:fixed;left:0;top:0;z-index:60;margin:-26px 0 0 -26px;width:52px;height:52px;display:grid;place-items:center;font-size:40px;pointer-events:none;filter:drop-shadow(0 6px 6px rgba(0,0,0,.35));border-radius:50%;background:rgba(120,230,120,.35);border:3px solid #5fd35a}
.td-ghost.bad{background:rgba(255,90,90,.35);border-color:#ff5a5a}
#td .td-cards button{touch-action:none}
/* ===== ayuda ===== */
.hl-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:6px 0 8px}
.hl-tabs button{border:0;border-radius:12px;padding:8px 4px;font-weight:800;font-size:13px;background:#fffdf3;color:#5a3a1a;box-shadow:0 2px 0 rgba(90,50,20,.18)}
.hl-tabs button.on{background:#7fe05a;color:#fff;box-shadow:0 2px 0 #4a9a2a}
.hl-card{background:#fffdf3;border-radius:16px;padding:10px;margin:8px 0;box-shadow:0 2px 0 rgba(90,50,20,.15)}
.hl-head{display:flex;align-items:center;gap:10px;margin-bottom:8px}.hl-head>span{font-size:32px;text-align:center;flex:0 0 auto}.hl-head>div{flex:1;min-width:0}
.hl-head b{display:block;font-size:15px;color:#4a2e14}.hl-head small{display:block;font-size:12px;color:#7a5a3a}
.hl-steps{margin:8px 0 0;padding-left:22px;font-size:13px;color:#4a2e14}.hl-steps li{margin:4px 0}
.hl-guide,.hl-ver{background:#fffdf3;border-radius:14px;padding:10px 14px;margin:8px 0;border:1.5px solid #ead4a6;box-shadow:0 2px 0 rgba(90,50,20,.1)}
.hl-guide summary,.hl-ver summary{font-weight:800;font-size:14px;color:#4a2e14;cursor:pointer}.hl-guide em{font-style:normal;color:#a0784a;font-size:12px}
.hl-guide p{margin:6px 0;font-size:13px;color:#5a3a1a}
.hl-ver summary small{color:#a0784a;font-weight:600;margin-left:6px}.hl-ver ul{list-style:disc;padding:0 0 0 20px;margin:8px 0 2px}
.hl-ver li{display:list-item;font-size:13.5px;color:#5a4028;margin:6px 0;line-height:1.45}.hl-ver li p{margin:0}
.xprev{width:56px;height:56px;display:block;margin:-6px auto;filter:drop-shadow(0 3px 3px rgba(0,0,0,.18))}
.xcard:has(.xprev){grid-template-columns:60px 1fr auto}
#td .td-cards button .tdimg{width:40px;height:40px;display:block;margin-top:2px}
.td-ghost img{width:56px;height:56px}
/* mercader viajera */
.xcard.merch.sold{opacity:.55}
.merch-head h2{margin-bottom:2px}
/* adornos de edificios */
.paints{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin:6px 0 14px}
.paint{width:38px;height:38px;border-radius:50%;border:3px solid #fff;box-shadow:0 0 0 2px #2b2456}
.paint.on{box-shadow:0 0 0 3px #ffd34d,0 0 0 5px #2b2456}
.xcard.own{background:#f3ffe8}
.ornlist{display:flex;flex-direction:column;gap:8px;margin:8px 0}
.ornlist .xcard{display:flex;align-items:center;gap:10px}
.ornlist .xcard>span{font-size:28px}
.ornlist .xcard>div{flex:1}
/* mejoras de edificios de servicio */
details.perks{background:#fff7e6;border:2px solid #f0d9a8;border-radius:14px;padding:8px 12px;margin:6px 0 10px}
details.perks summary{font-weight:800;cursor:pointer;color:#7a4a12}
details.perks ul,.perklist{list-style:none;padding:0;margin:8px 0;font-size:14px}
details.perks li,.perklist li{padding:3px 0;opacity:.6}
details.perks li.got,.perklist li.got{opacity:1}
/* ===== pulido de interfaz ===== */
/* avisos: si hay un panel abierto, salen arriba para no tapar los botones */
body.sheet-open #toasts { bottom: auto; top: calc(130px + var(--safe-t, 0px)); }
/* tutorial: solo el botón que se indica responde */
body.tut-lock #nav button:not(.tut-glow), body.tut-lock #rcol button:not(.tut-glow), body.tut-lock #qtrack button:not(.tut-glow), body.tut-lock #lcol button,
body.tut-lock #hud [data-a]:not(.tut-glow), body.tut-lock .lbtn:not(.tut-glow) { pointer-events: none; filter: grayscale(1) brightness(.88); }
body.tut-on.tut-quests .qtrack { display: flex !important; }
body.tut-lock.tut-ui #sheet-body [data-a]:not(.tut-glow) { pointer-events: none; opacity: .5; }
/* número de avance en las misiones de la izquierda */
.qb em { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); background: var(--wood-d, #7a4a26); color: #fff; font: 800 10px/1 Fredoka, system-ui; padding: 2px 5px; border-radius: 8px; font-style: normal; white-space: nowrap; }
/* bloque de mejoras igual para todos */
details.perks summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; list-style: none; font-size: 16px; }
details.perks summary::-webkit-details-marker { display: none; }
details.perks summary em { font-style: normal; background: #ffd34d; color: #5a3a0a; border-radius: 10px; padding: 1px 8px; font-size: 13px; }
details.perks summary em::after { content: ' ▾'; }
details.perks[open] summary em::after { content: ' ▴'; }
details.perks li { display: grid; grid-template-columns: 22px 44px 1fr; gap: 4px; align-items: start; padding: 4px 0; border-bottom: 1px dashed #f0d9a8; }
details.perks li:last-child { border-bottom: 0; }
details.perks li.next { opacity: 1; background: #fffbe0; border-radius: 8px; }
details.perks li i { font-style: normal; }
details.perks .works small { display: block; font-weight: 500; opacity: .8; }
.bld-n { display: block; text-align: center; opacity: .75; margin-top: 4px; }
/* tarjetas de familia compactas */
.fcard { position: relative; }
.fc-look { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--wood-d, #7a4a26); background: #fff; font-size: 18px; display: grid; place-items: center; padding: 0; box-shadow: 0 2px 0 rgba(60,30,10,.3); }
.crew .cstat { display: block; margin: 2px 0 6px; opacity: .8; }
.crew .btn { width: 100%; margin-top: 4px; }
details.perks .pk-next { flex-basis: 100%; margin-top: 4px; color: #8a5a20; font-weight: 600; font-size: 13px; }
details.perks[open] .pk-next { display: none; }
/* botones que no puedes pagar: apagados y diciendo qué falta */
.btn.cant, .card.cant { filter: grayscale(.75); opacity: .62; cursor: not-allowed; box-shadow: none; transform: none; }
.btn:disabled { cursor: not-allowed; }
.why { display: block; font-size: 10.5px; font-weight: 800; color: #c0392b; margin-top: 2px; line-height: 1.15; text-shadow: none; }
.btn.gem .why, .btn.red .why { color: #ffe1dc; }
/* tarjetas de la familia: el texto ocupa el espacio libre y estrellas, datos y botón quedan alineados abajo en todas */
.fcard > p { flex: 1 1 auto; }
.fcard > .crew { margin-top: auto; }
.fcard > .crew .btn { width: 100%; }
/* cuenta en la nube (Google + Supabase) */
.cloudbox { display: flex; flex-direction: column; gap: 5px; padding: 11px 12px; margin: 6px 0; border-radius: 16px; background: linear-gradient(#f3f9ff, #e6f2ff); border: 2px solid #9cc8f0; }
.cloudbox.on { background: linear-gradient(#f2fff0, #e3f7dd); border-color: #8fd17d; }
.cloudbox > b { font-size: 15px; } .cloudbox > small { font-size: 12px; line-height: 1.3; opacity: .85; }
.cloudbox .fcode { font-size: 14px; letter-spacing: 2px; background: #fff; padding: 1px 7px; border-radius: 7px; border: 1.5px dashed #6aa85b; }
.btn.gbtn { background: #fff; color: #3c4043; border: 2px solid #dadce0; box-shadow: 0 3px 0 #c8cbd0; display: flex; align-items: center; justify-content: center; gap: 10px; text-shadow: none; }
.btn.linkish { background: none; border: 0; box-shadow: none; color: #b0413e; text-decoration: underline; font-size: 12px; padding: 2px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.card.cpick small { display: block; font-size: 11.5px; }
/* ===== HUD móvil ordenado (1.31): un solo tamaño de botón, menos cosas a la vista ===== */
:root { --rb: 50px; }
.rcol { gap: 7px; }
.rbtn, .rcol .evbtn { width: var(--rb); height: var(--rb); border-radius: 14px; flex: 0 0 auto; }
.rbtn span { font-size: 22px; } .rcol .evbtn span { font-size: 22px; }
.rbtn small, .rcol .evbtn small { font-size: 9px; max-width: calc(var(--rb) - 6px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.15; }
.rcol .evbtn { border-width: 2.5px; }
.rbtn .dot, .rcol .evbtn .dot { top: -5px; right: -5px; width: 14px; height: 14px; }
.rbtn.more span { font-size: 20px; font-weight: 800; color: var(--wood-d, #7a4a26); }
body.more-open .rbtn.more { background: linear-gradient(#ffe7a8, #ffd36b); }
/* "Más": un panel que se abre hacia la izquierda, sin alargar la columna */
.rmore { position: absolute; right: calc(var(--rb) + 8px); bottom: 0; display: none; grid-template-columns: repeat(2, var(--rb)); gap: 7px; padding: 8px; border-radius: 18px; background: rgba(255,247,230,.97); border: 2.5px solid var(--wood-d, #7a4a26); box-shadow: 0 4px 0 rgba(60,30,10,.3), 0 8px 18px rgba(0,0,0,.18); }
.rmore::after { content: ''; position: absolute; right: -8px; bottom: 18px; border: 7px solid transparent; border-left-color: var(--wood-d, #7a4a26); border-right: 0; }
body.more-open .rmore { display: grid; animation: moreIn .16s ease-out; }
@keyframes moreIn { from { opacity: 0; transform: translateX(8px) scale(.96); } to { opacity: 1; transform: none; } }
/* misiones de la izquierda: mismo ritmo que la columna derecha */
.qtrack { gap: 7px; }
.qb { width: 46px; height: 46px; } .qb span { font-size: 20px; }
/* fila de abajo del HUD: el clima se encoge, el lápiz y el engrane nunca */
.hud-row.small .pill.env { min-width: 0; }
.hud-row.small .pill.gear { flex: 0 0 32px; min-width: 32px; }
/* pantallas grandes: sobra espacio, todo a la vista */
@media (min-width: 700px) and (min-height: 760px) {
  #btn-more { display: none; }
  .rmore { display: contents !important; }
  .rmore::after { display: none; }
}
.hud-row.small .pill.env { flex: 1 1 0; min-width: 0; overflow: hidden; }
.qb { width: var(--rb); height: var(--rb); }
#nav button { flex: 1 1 0; min-width: 0; }
#nav small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#nav button { padding: 0 1px; }
#nav small { font-size: 10px; letter-spacing: -.15px; text-overflow: clip; }
.rmore { grid-template-columns: repeat(2, 60px); }
.rmore .rbtn { width: 60px; }
.rmore .rbtn small { max-width: 56px; }
@media (max-width: 380px) {
  .hud-row { gap: 4px; }
  .pill.lvl { flex-basis: 66px; }
  .hud-row:not(.small) .pill { padding-right: 6px; gap: 3px; }
  .hud-row:not(.small) .pill span { font-size: 16px; }
  .hud-row:not(.small) .pill b { font-size: 13px; }
  #nav { gap: 4px; left: 4px; right: 4px; }
  #nav small { font-size: 9.5px; }
}
@media (min-width: 700px) and (min-height: 760px) {
  :root { --rb: 58px; }
  .rmore .rbtn { width: var(--rb); }
  .rmore .rbtn small { max-width: calc(var(--rb) - 6px); }
}
/* tendencia por producto en el mercado */
.trend { font-style: normal; font-size: 12px; margin-left: 4px; padding: 1px 6px; border-radius: 8px; vertical-align: middle; }
.trend.up { background: #e2f6dc; color: #2c9a17; } .trend.down { background: #fde3df; color: #d6382b; } .trend.flat { background: #efe8dc; color: #9a8466; }
.flat { color: #9a8466; }
/* ===== amigos (nube) ===== */
.codebox { text-align: center; background: linear-gradient(#fffbe9, #fff1c4); border: 2.5px dashed #e3b74a; border-radius: 16px; padding: 8px 10px 10px; margin: 8px 0; }
.codebox small { display: block; font-size: 12px; opacity: .8; }
.codebox .code { display: block; font-size: 30px; letter-spacing: 6px; margin: 2px 0 6px; color: #6a4a12; }
.addfr { margin: 6px 0; } .addfr .inp { flex: 1; text-transform: uppercase; letter-spacing: 2px; }
.wish { display: flex; align-items: center; gap: 8px; margin: 10px 0 2px; font-size: 13px; font-weight: 700; } .wish select { flex: 1; padding: 6px; border-radius: 10px; border: 2px solid #e3cfa6; font: inherit; background: #fff; }
.li.fr { align-items: center; } .fr-btns { display: flex; gap: 4px; } .fr-btns .btn { min-width: 38px; padding-left: 6px; padding-right: 6px; position: relative; }
.badge { position: absolute; top: -6px; right: -6px; background: #e8463a; color: #fff; font-style: normal; font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; line-height: 16px; text-align: center; }
.giftgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 10px; } .giftgrid .card { padding: 8px 4px; } .giftgrid .card.wish { outline: 3px solid #ffb020; } .giftgrid .card small { display: block; color: #c76a00; font-weight: 800; }
.chat { max-height: 34vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 8px; background: #f7efe0; border-radius: 14px; margin: 6px 0; }
.msg { align-self: flex-start; max-width: 80%; background: #fff; border-radius: 14px 14px 14px 4px; padding: 6px 10px; box-shadow: 0 1px 0 rgba(0,0,0,.08); }
.msg.mine { align-self: flex-end; background: #d9f5c8; border-radius: 14px 14px 4px 14px; } .msg small { display: block; font-size: 10px; opacity: .6; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 10px; max-height: 26vh; overflow-y: auto; }
.chip { border: 2px solid #e3cfa6; background: #fff; border-radius: 16px; padding: 6px 10px; font: 700 13px Fredoka, sans-serif; color: #5a3a1a; cursor: pointer; } .chip:active { transform: scale(.96); }
.inbox p { margin: 6px 0; text-align: left; }
.addfr .inp::placeholder { text-transform: none; letter-spacing: 0; }
/* calendario del año */
.mhead { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 6px; } .mhead b { font-size: 16px; }
.mgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.mw { text-align: center; font-size: 11px; font-weight: 800; opacity: .6; }
.mday { position: relative; min-height: 38px; border-radius: 9px; background: #fff8ea; border: 1.5px solid #efdfbf; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1px; }
.mday b { font-size: 11px; line-height: 1; } .mday span { font-size: 16px; line-height: 1.1; min-height: 16px; }
.mday.empty { background: none; border: none; } .mday.past { opacity: .45; }
.mday.ev { background: linear-gradient(#fff1c7, #ffe08a); border-color: #f1b93a; } .mday.sat span { font-size: 12px; opacity: .8; }
.mday.today { outline: 3px solid #39a845; outline-offset: -1px; background: #eaffdf; }
.keep-h { pointer-events: none; }

/* ---------- manual del juego ---------- */
.manual{position:fixed;inset:0;z-index:82;display:none;flex-direction:column;gap:8px;background:linear-gradient(180deg,#fff6e2,#f3dfba);padding:calc(8px + var(--safe-t)) 10px calc(10px + var(--safe-b))}
.manual.show{display:flex;animation:fin .25s}
.manual>.mm-top,.manual>.mm-tabs,.manual>.mm-search,.manual>.mm-chips,.manual>.mm-list{width:100%;max-width:880px;margin-left:auto;margin-right:auto}
.mm-top{display:flex;align-items:center;gap:10px;flex:0 0 auto}
.mm-top>div{flex:1}.mm-top h2{margin:0;font-size:20px;color:#5a3518}.mm-top small{color:#8a6a3a;font-weight:700}
.mm-links{display:flex;gap:6px;flex-wrap:wrap}.mm-links .btn{flex:1 1 30%;font-size:12px;padding:7px 6px;min-width:0}
.mm-search{position:relative;display:flex;align-items:center;flex:0 0 auto}
.mm-search input{width:100%;font:inherit;font-weight:700;padding:11px 40px 11px 14px;border-radius:16px;border:3px solid #e8c98f;background:#fffdf6;color:#5a3518}
.mm-search span{position:absolute;right:12px;font-size:18px;pointer-events:none}
.mm-chips{display:flex;gap:6px;overflow-x:auto;flex:0 0 auto;padding-bottom:2px;scrollbar-width:none}
.mm-chips::-webkit-scrollbar{display:none}
.mm-chips .chip{flex:0 0 auto;border-radius:999px;background:#fff;border:2px solid #e8c98f;color:#7a4a26;font-weight:800;padding:5px 11px;font-size:13px}
.mm-list{flex:1 1 auto;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:10px;padding:2px 4px 16px 0}
.mm-list>*{flex:0 0 auto}
.mm-sec{flex:0 0 auto;background:#fffdf6;border-radius:18px;padding:12px 14px;box-shadow:0 3px 0 rgba(122,74,38,.14)}
.mm-sec h3{display:flex;gap:8px;align-items:center;margin:0 0 6px;font-size:15.5px;color:#7a3a12}
.mm-sec h3 span{font-size:22px}
.mm-sec p,.mm-sec li{font-size:13.5px;color:#5a4028;line-height:1.45}
.mm-sec ul{padding-left:18px;margin:6px 0}
.mm-sec .btn{margin-top:6px}
.mm-table{display:flex;flex-direction:column;gap:6px;margin-top:6px}
.mm-row{display:grid;grid-template-columns:36px 1fr auto;gap:10px;align-items:center;background:#fff8e8;border-radius:12px;padding:7px 10px}
.mm-row .mm-ico{width:34px;height:34px;border-radius:10px;background:#fffdf6;border:1.5px solid #ead4a6;display:grid;place-items:center;font-size:20px;line-height:1;flex:0 0 auto;overflow:hidden}
.mm-row .mm-ico img{width:28px;height:28px;object-fit:contain}
.mm-row span:not(.mm-ico){font-size:19px;text-align:center}
.mm-row b{font-size:13px;color:#5a3518;display:block}
.mm-row small{font-size:11.5px;color:#8a6a44;line-height:1.3;display:block}
.mm-row i{font-style:normal;font-size:11.5px;font-weight:800;color:#b07a10;white-space:nowrap}
.mm-empty{text-align:center;color:#8a6a44;font-weight:700;padding:24px 10px}
body.in-manual #nav,body.in-manual #hud,body.in-manual #rcol,body.in-manual .qtrack,body.in-manual #brush{display:none!important}

/* ---------- recordatorios ---------- */
.remind{position:fixed;left:8px;right:8px;bottom:calc(74px + var(--safe-b));z-index:40;display:none;flex-direction:column;gap:6px;background:#fffdf3;border:3px solid #e0b060;border-radius:18px;padding:10px 12px;box-shadow:0 6px 0 rgba(90,53,24,.25)}
.remind.show{display:flex;animation:qin .3s}
.rm-body{display:flex;gap:8px;align-items:flex-start}
.rm-ico{font-size:24px;line-height:1.1}
.rm-text{margin:0;font-size:13.5px;color:#5a3518;font-weight:700;line-height:1.35}
.rm-btns{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.rm-btns .btn{flex:1;min-width:110px;margin:0}
.rm-never{background:none;border:0;color:#8a6a44;font-size:12px;font-weight:700;text-decoration:underline;padding:4px}
body.in-battle .remind,body.cutscene .remind,body.tut-on .remind,body.in-salon .remind,body.in-house .remind,body.in-manual .remind,body.visiting .remind{display:none!important}

/* ---------- video recompensado (modo prueba) ---------- */
.adtest{position:fixed;inset:0;z-index:95;display:grid;place-items:center;background:rgba(20,12,26,.78);padding:16px}
.adtest-card{background:#fffdf3;border-radius:20px;padding:18px 20px;max-width:340px;text-align:center;box-shadow:0 10px 0 rgba(0,0,0,.3)}
.adtest-card b{display:block;font-size:15px;color:#7a3a12;margin-bottom:4px}
.adtest-card p{font-size:13px;color:#5a4028;margin:0 0 12px}
.adtest-card code{background:#ffe9b8;border-radius:6px;padding:1px 5px}
.adtest-bar{height:10px;border-radius:6px;background:#eadcc0;overflow:hidden}
.adtest-bar i{display:block;height:100%;width:0;background:linear-gradient(90deg,#ffcf33,#ff8a3a);animation:adfill linear forwards}
.adtest-card small{display:block;margin-top:8px;font-weight:900;color:#7a4a26}
@keyframes adfill{to{width:100%}}
.rbtn.on small{color:#2f8a2f}
.rbtn.on span{filter:drop-shadow(0 0 6px #7fe05a)}

/* ---------- casa: caber en pantallas cortas y ver dónde colocas ---------- */
.inhouse{height:100vh;height:100dvh;min-height:0}
.inhouse .ih-stage{min-height:0}
.inhouse .ih-cat{min-height:0}
.inhouse.placing .ih-cat,.inhouse.placing .ih-tip{display:none!important}
.inhouse.placing .ih-stage{flex:1 1 auto}
.inhouse.placing .ih-sel{bottom:6px;padding:6px 8px}
@media (max-height:740px){
  .inhouse{gap:5px;padding-top:calc(4px + var(--safe-t));padding-bottom:calc(4px + var(--safe-b))}
  .ih-top h2{font-size:17px}.ih-top small{font-size:11px}
  .ih-cat{max-height:23vh}
  .ih-items{grid-template-columns:repeat(5,1fr);gap:4px}
  .ih-card span{font-size:21px}.ih-card b{font-size:10px}.ih-card small{display:none}
  .ih-tabs span{font-size:17px}.ih-tabs small{font-size:10px}
  .ih-sel{padding:6px 8px}.ih-sel .row2 .btn{font-size:12px;padding:6px 4px}
  .salon-opts{max-height:21vh}.salon-stage{min-height:130px}
  .salon-top h2{font-size:18px}
}

/* ---------- salón: niveles y prendas premium ---------- */
.sc.locked{opacity:.55;filter:grayscale(.45)}
.sc.locked small{color:#8a4a6a}
.salon .slots{margin-left:auto;background:rgba(255,255,255,.65);border-radius:10px;padding:2px 8px;font-weight:900;font-size:12px;color:#7a2a7a}
.opt.prem{background:linear-gradient(160deg,#fff6d0,#ffe7a0);border:2px solid #e8c05a;color:#7a4a10}
.opt.prem.used{background:#e8ffe0;border-color:#7fd35a;color:#2f6a22}

/* ---------- notas y buzón ---------- */
.notes{display:flex;flex-direction:column;gap:8px}
.note-card{background:#fff8e8;border:2px solid #ecd6a6;border-radius:14px;padding:8px 10px}
.note-card.unread{background:#fffdf0;border-color:#ffc94a;box-shadow:0 0 0 2px rgba(255,201,74,.25) inset}
.note-card .nc-top{display:flex;justify-content:space-between;gap:8px;align-items:center}
.note-card b{font-size:13px;color:#6a3a12}
.note-card small{font-size:11px;color:#9a7a4a}
.note-card p{margin:4px 0 0;font-size:13.5px;color:#5a4028}
.notecard{margin-top:10px;background:#fff3cf;border:2px solid #ffd27a;border-radius:14px;padding:8px 10px;font-size:13.5px;color:#5a3a12}
.btn.ghost.hasnote{background:#fff3cf;border-color:#ffc94a}
.xnote{margin:6px 0 10px;background:#fff3cf;border:2px dashed #e8bf6a;border-radius:12px;padding:8px 10px;font-size:13px;color:#6a4a1a}

/* ---------- manual: resultados de búsqueda compactos ---------- */
.mm-row.mm-hit{width:100%;font:inherit;text-align:left;border:0;cursor:pointer;background:#fff8e8;padding:7px 8px}
.mm-row.mm-hit:hover,.mm-row.mm-hit:focus-visible{background:#ffefcf}
.mm-row.mm-hit i{color:#2f7d32}
.mm-row.mm-hit small{white-space:normal}

/* ---------- códigos de regalo ---------- */
.gfields label{display:flex;flex-direction:column;gap:4px;font-size:12px;font-weight:800;color:#7a4a26;flex:1;min-width:0}
.gfields select,.gfields input{font:inherit;font-weight:700;padding:8px 10px;border-radius:12px;border:2px solid #e8c98f;background:#fffdf6;color:#5a3518;width:100%}
.giftinput{width:100%;margin:6px 0 10px;text-transform:uppercase;letter-spacing:2px;font-weight:900;font-size:20px;text-align:center}
.giftcode{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:1.5px;font-size:16px}
.giftcode-row{display:flex;gap:6px;align-items:center;justify-content:space-between;background:#fff8e8;border:2px solid #ecd6a6;border-radius:12px;padding:6px 8px;margin:5px 0}
.giftcode-row>div{min-width:0}
.giftcode-row small{display:block;font-size:11px;color:#8a6a44;line-height:1.3}
.giftcode-row .btn{flex:0 0 auto}

/* ---------- ranking de amigos ---------- */
.rkhead{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:2px 0 4px}
.rkhead h2{margin:0}
.rkby{display:flex;gap:6px;flex-wrap:wrap;margin:6px 0 8px}
.rkby .chip{background:#fff;border:2px solid #e8c98f;border-radius:999px;padding:4px 10px;font-weight:800;font-size:12px;color:#7a4a26}
.rkby .chip.on{background:#ffcf33;border-color:#b07a10;color:#5a3518}
.rkrow{display:grid;grid-template-columns:26px 38px 1fr;gap:8px;align-items:center;background:#fff8e8;border-radius:12px;padding:6px 8px;margin:4px 0}
.rkrow.me{background:#e9ffe0;border:2px solid #7fd35a}
.rkrow .av{width:34px;height:34px;border-radius:50%;background:#fff;object-fit:cover}
.rkrow b{font-size:13px;color:#5a3518;display:block}
.rkrow small{font-size:11px;color:#8a6a44}
.rkpos{font-weight:900;color:#b07a10;text-align:center;font-size:15px}

/* ===== correctivos de UI (auditoría) ===== */
/* el confeti no debe inflar el scroll del modal ni tapar el texto */
.confetti { overflow: hidden; border-radius: 22px; opacity: .85; }
.modal-card.celebrate > h2, .modal-card.celebrate > p, .modal-card.celebrate > .sub {
  text-shadow: 0 1px 0 var(--cream), 0 0 10px rgba(255,247,230,.92);
}
/* un solo scrollbar visible: el strip de tabs no muestra el suyo */
.tabs { scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
#sheet-body { overflow-x: hidden; }
/* pista de que el sheet sigue hacia abajo */
.sheet-card::after {
  content: ''; position: absolute; left: 3px; right: 3px; bottom: 0; height: 22px;
  background: linear-gradient(rgba(255,247,230,0), var(--cream)); pointer-events: none;
}
/* con un modal abierto, lo de abajo no parece clickeable (porque no lo es) */
body.modal-open #nav, body.modal-open .rcol, body.modal-open #sheet .x {
  filter: brightness(.5) saturate(.5); pointer-events: none;
}
/* estado de la nube (sin conexión / guardando / en espera) */
.netstate {
  position: fixed; right: calc(8px + var(--safe-t)); bottom: calc(72px + var(--safe-b)); z-index: 12;
  width: 30px; height: 30px; display: grid; place-items: center; padding: 0;
  transform: translateY(7px) scale(.9); border-radius: 50%;
  background: rgba(60,35,15,.88); color: #fff; font-size: 16px;
  box-shadow: 0 2px 0 rgba(0,0,0,.25); opacity: 0; pointer-events: none;
  transition: .2s; max-width: none; text-align: center;
}
.netstate.show { opacity: 1; transform: none; }
.netstate .ei { width: 17px; height: 17px; }
.netstate.off { background: rgba(150,70,20,.95); }
.netstate.sync { background: rgba(40,90,140,.95); }
.netstate.wait { background: rgba(150,110,20,.95); }
body.sheet-open .netstate, body.modal-open .netstate { display: none; }
/* sin conexión no tiene sentido invitar a entrar con Google */
body.net-off .remind { display: none; }
/* el recordatorio de la nube no debe tapar el panel que el jugador acaba de abrir */
body.sheet-open .remind, body.modal-open .remind { display: none; }
/* pantallas anchas: el HUD no se estira de lado a lado */
@media (min-width: 700px) {
  #hud { left: 50%; right: auto; transform: translateX(-50%); width: min(760px, calc(100% - 12px)); }
  .hud-row:not(.small) .pill { max-width: 210px; }
}
/* landscape de teléfono: mantener ambos botones plegables compactos */
@media (orientation: landscape) and (max-height: 520px) {
  .qtrack, .rcol { top: calc(74px + var(--safe-t)) !important; }
}

/* ===== pantallas chicas: aprovechar el espacio ===== */
/* iPhone SE / Android pequeños: botones y textos más compactos, más mundo visible */
@media (max-width: 380px) {
  :root { --rb: 42px; }
  #nav { left: 5px; right: 5px; gap: 4px; }
  #nav button { height: 50px; border-radius: 13px; }
  #nav span { font-size: 20px; }
  #nav small { font-size: 8.8px; margin-top: 1px; }
  .qb { width: 40px; height: 40px; }
  .qb span { font-size: 17px; }
  .qb i { width: 16px; height: 16px; font-size: 10px; }
  .rbtn span { font-size: 19px; }
  .rbtn small { font-size: 8.5px; }
  .remind { bottom: calc(64px + var(--safe-b)); padding: 7px 9px; gap: 4px; border-width: 2.5px; border-radius: 15px; }
  .rm-ico { font-size: 19px; }
  .rm-text { font-size: 12.2px; line-height: 1.28; }
  .rm-btns { gap: 5px; }
  .rm-btns .btn { min-width: 0; padding: 7px 8px; font-size: 12px; }
  .rm-never { font-size: 10.5px; padding: 2px; }
  .sheet-card { padding: 10px 10px calc(10px + var(--safe-b)); }
  #sheet-body { max-height: 62vh; }
  h2 { font-size: 19px; }
  .card b { font-size: 12.5px; }
  .card small { font-size: 10.5px; }
}
/* pantallas bajas: barra inferior más baja y recordatorios sin tapar el juego */
@media (max-height: 640px) {
  #nav button { height: 48px; }
  #nav span { font-size: 18px; }
  #nav small { font-size: 8.5px; }
  .remind { bottom: calc(58px + var(--safe-b)); }
}
/* pantallas muy angostas: el texto del clima no cabe, se queda el icono y la hora */
@media (max-width: 380px) {
  .pill.env small { display: none; }
}
/* ===== teléfonos grandes (iPhone Pro/Max, Pixel XL): la interfaz crece ===== */
/* antes se quedaba con tamaños de teléfono chico y se veía diminuta con aire de sobra */
@media (min-width: 385px) and (max-width: 480px) and (min-height: 700px) {
  #nav { left: 8px; right: 8px; gap: 6px; }
  #nav button { height: 66px; max-width: 104px; border-radius: 18px; }
  #nav span { font-size: 28px; }
  #nav small { font-size: 11.5px; margin-top: 3px; }
  .pill { height: 38px; font-size: 16px; }
  .pill span { font-size: 21px; }
  .pill.lvl { flex-basis: 92px; }
  .hud-row.small .pill { height: 32px; font-size: 14px; }
  .hud-row.small .pill.gear { flex-basis: 36px; min-width: 36px; }
  :root { --rb: 56px; }
  .qb { width: 52px; height: 52px; }
  .qb span { font-size: 22px; }
  .qb i { width: 20px; height: 20px; font-size: 12px; }
  .rbtn span { font-size: 25px; }
  .rbtn small { font-size: 10px; }
  .sheet-card { padding: 16px 16px calc(16px + var(--safe-b)); }
  #sheet-body { max-height: 60vh; }
  h2 { font-size: 23px; }
  #toasts { bottom: calc(84px + var(--safe-b)); }
  .remind { bottom: calc(84px + var(--safe-b)); }
  body.sheet-open #toasts { top: calc(140px + var(--safe-t, 0px)); }
  .qtrack { top: calc(94px + var(--safe-t)); }
}
/* barras ocultas: además de desplazarse no deben verse ni atrapar toques
   (en pantallas altas con safe-area se asomaban por abajo y bloqueaban el centro) */
.placebar:not(.show), .editbar:not(.show) { opacity: 0; pointer-events: none; }
.placebar.show, .editbar.show { opacity: 1; pointer-events: auto; }
/* ---------- tablero de ranking ---------- */
.rkrow { grid-template-columns: 26px 38px 1fr auto; }
.rk-acts { display: flex; gap: 4px; }
.rk-acts .btn { min-width: 36px; padding: 6px 8px; }
.rk-you { color: #7a5a3a; font-weight: 800; font-size: 11px; }
.rk-tabs { margin: 6px 0 2px; }
.rk-tabs button { font-size: 13.5px; }

/* ---------- mejoras: botón compacto y ficha descriptiva ---------- */
.perks-btn { width:100%; display:flex; align-items:center; gap:9px; text-align:left; background:linear-gradient(#fffdf5,#f7e6c4); border:2.5px solid #e8c98f; border-radius:16px; padding:9px 10px; box-shadow:0 3px 0 #d8b77a; color:#5a3518; }
.perks-btn .pb-ic { font-size:20px; flex:0 0 24px; text-align:center; }
.perks-btn .pb-txt { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.perks-btn .pb-txt b { font-size:14px; }
.perks-btn .pb-txt small { font-size:11px; color:#8a6a44; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.perks-btn em { font-style:normal; font-weight:900; font-size:12px; background:#ffcf33; border:2px solid #b07a10; border-radius:999px; padding:2px 8px; color:#5a3518; }
.up-head { display:flex; gap:10px; align-items:flex-start; }
.up-head>div { flex:1; min-width:0; } .up-head h2 { margin:2px 0 3px; font-size:20px; }
.up-prev { display:flex; align-items:center; justify-content:center; gap:8px; margin:8px 0; }
.up-prev figure { margin:0; flex:1; min-width:0; text-align:center; background:#fffdf5; border:2px solid #e8d4ab; border-radius:16px; padding:4px 2px; }
.up-prev figure.next { border-color:#9ae07a; background:#f4ffec; }
.up-prev img { width:100%; max-width:150px; height:120px; object-fit:contain; image-rendering:auto; }
.up-prev figcaption { font-size:11px; font-weight:800; color:#7a5a3a; }
.up-prev .up-arrow { font-size:20px; flex:0 0 20px; }
.up-stats { display:grid; grid-template-columns:1fr 1fr; gap:7px; margin:7px 0; }
.up-stats>div { background:#fffdf5; border:2px solid #e8d4ab; border-radius:14px; padding:7px 9px; }
.up-stats>div.next { border-color:#9ae07a; background:#f4ffec; }
.up-stats small { display:block; font-size:10px; color:#8a6a44; text-transform:uppercase; letter-spacing:.4px; }
.up-stats b { display:block; font-size:12px; margin-top:2px; line-height:1.25; }
@media (max-width:380px){ .up-prev img{height:96px;} .up-stats b{font-size:11px;} }

/* productos que abren su ficha */
.inv .slot[data-a] { cursor: pointer; transition: transform .08s, border-color .12s; }
.inv .slot[data-a]:active { transform: scale(.94); border-color: #d9a520; }
.li b[data-a="itemInfo"] { cursor: pointer; text-decoration: underline dotted rgba(138,90,50,.5); text-underline-offset: 3px; }

/* fichas de colecciones y almanaque */
.xalbum span[data-x], .inv .slot[data-a], .li[data-a] { cursor: pointer; }
.xalbum span[data-x]:active { transform: scale(.9); }

/* mejoras en la esquina del encabezado */
.bhead { align-items: flex-start !important; }
.bhead .bhead-main { flex: 1; min-width: 0; }
.bhead .bhead-up { flex: 0 0 auto; margin-left: auto; }
.bhead .bhead-up { margin-top: 1px; }
.bhead .perks-btn { width: auto; min-width: 108px; max-width: 140px; padding: 7px 9px; gap: 4px; flex-direction: column; align-items: center; text-align: center; border-radius: 14px; box-shadow: 0 3px 0 #d8b77a; white-space: nowrap; }
.bhead .perks-btn .pb-ic { font-size: 17px; flex: 0 0 auto; line-height: 1; }
.bhead .perks-btn .pb-txt { display: block; flex: 0 0 auto; }
.bhead .perks-btn .pb-txt b { font-size: 12px; line-height: 1.1; }
.bhead .perks-btn .pb-txt small { display: none; }
.bhead .perks-btn em { font-size: 10px; padding: 2px 7px; line-height: 1.1; }
@media (max-width: 380px) { .bhead .perks-btn { min-width: 96px; max-width: 120px; padding: 6px 7px; gap: 3px; } .bhead .perks-btn .pb-ic { font-size: 16px; } .bhead .perks-btn .pb-txt b { font-size: 11px; } .bhead .perks-btn em { font-size: 9.5px; padding: 1px 5px; } }

/* miniatura real del edificio en el encabezado */
.bhead-pic { width: 52px; height: 52px; flex: 0 0 52px; display: grid; place-items: center; background: #fffdf5; border: 2px solid #e8d4ab; border-radius: 13px; overflow: hidden; }
.bhead-pic img { width: 100%; height: 100%; object-fit: contain; }


/* ===== Auditoría v2 + v1.80: HUD alineado, Valle visible en todos los dispositivos, Centro de Ayuda y Batalla armonizada ===== */
:root { --hud-h: 90px; }
:focus-visible { outline: 3px solid #ffcf33 !important; outline-offset: 2px; }
.hud-row.small .pill.gear { min-width: 40px; min-height: 32px; }

/* Alineación idéntica entre columna izquierda (misiones) y columna derecha (Valle) */
.qtrack, .rcol { top: calc(var(--hud-h) + var(--safe-t)) !important; }
.qtrack { left: 8px; }
.rcol { right: 8px; }
@media (max-width: 380px) { :root { --hud-h: 84px; } }
@media (min-width: 385px) and (max-width: 480px) and (min-height: 700px) { :root { --hud-h: 98px; } }
@media (min-width: 700px) { :root { --hud-h: 92px; } }

/* Botón Valle visible y consistente en escritorio y móvil; el cajón se despliega al tocarlo */
.rcol-toggle { display: flex !important; min-width: var(--rb, 50px); min-height: var(--rb, 50px); background: linear-gradient(#fff7d6, #f7d98b); }
body.valle-open .rcol-toggle { background: linear-gradient(#ffe68a, #f2be38); border-color: #8a520c; }
.rcol-items { display: none; margin-top: 4px; background: rgba(255, 247, 230, .94); border: 2.5px solid var(--wood-d); padding: 6px; border-radius: 18px; box-shadow: 0 4px 0 rgba(90, 53, 24, .32); flex-direction: column; gap: 7px; align-items: center; }
body.valle-open .rcol-items { display: flex; animation: pop .18s ease-out; }
.rcol-help { display: none; }
@media (max-width: 699px) {
  .troph-pill, .manual-btn { display: none !important; }
  .rcol-help { display: flex !important; }
  .rbtn { min-width: 46px; min-height: 46px; }
}

/* Guardia nocturno en Familia */
.guard-bar { background: #fff6dc; border: 2px solid #e2c280; border-radius: 14px; padding: 9px 11px; margin-bottom: 10px; }
.guard-bar small { display: block; color: #7a5a3a; font-size: 11.5px; margin-top: 2px; }
.guard-picks { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }

/* Árbol de especialización (Talentos) */
.tal-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 8px; }
.tal-card, .tal-active { background: #fffdf5; border: 2.5px solid var(--c, #c98d4f); border-radius: 16px; padding: 11px 12px; box-shadow: 0 3px 0 rgba(90,53,24,.15); }
.tal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tal-head > span { font-size: 30px; }
.tal-head small { display: block; color: #7a5a3a; font-size: 12px; }
.tal-list { margin: 0 0 10px 18px; padding: 0; font-size: 12.5px; color: #5a3518; display: flex; flex-direction: column; gap: 4px; }

/* Hechizos agrícolas en HUD de batalla (paleta cálida crema/madera) */
.b-spells { display: flex; gap: 5px; align-items: center; }
.b-spell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 54px; min-height: 52px; padding: 5px 7px; border-radius: 13px; border: 2.5px solid var(--wood-d); background: linear-gradient(#fff9ec, #f3dfb6); color: var(--ink); font-weight: 800; font-size: 11px; box-shadow: 0 3px 0 var(--wood-d); cursor: pointer; }
.b-spell small { font-size: 10px; color: #7a5228; line-height: 1.1; }
.b-spell b { font-size: 13px; line-height: 1.1; }
.b-spell.on { border-color: #d99000; background: linear-gradient(#fff6c0, #ffd860); box-shadow: 0 3px 0 #a86200, 0 0 0 3px rgba(255,204,51,.45); transform: translateY(-3px); }
.b-spell:disabled { opacity: .42; filter: grayscale(1); }

/* Batalla naval PvP (armonizada con la estética de la granja) */
.pvp-wrap { position: fixed; inset: 0; z-index: 9999; background: #163345; color: var(--ink); font-family: Fredoka, system-ui, sans-serif; display: flex; flex-direction: column; }
.pvp-top { position: absolute; top: calc(8px + var(--safe-t)); left: 8px; right: 8px; z-index: 4; display: flex; align-items: flex-start; gap: 8px; max-width: 780px; margin: 0 auto; pointer-events: none; }
.pvp-card { pointer-events: auto; flex: 1; min-width: 0; background: rgba(255,247,230,.95); border: 2.5px solid var(--wood-d); border-radius: 16px; padding: 8px 11px; box-shadow: 0 3px 0 var(--wood-d); display: flex; flex-direction: column; gap: 5px; }
.pvp-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pvp-meta { min-width: 0; }
.pvp-meta b { display: block; font-size: 14.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pvp-meta small { display: block; font-size: 11.5px; color: #7a5228; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pvp-pct-box { text-align: right; flex: 0 0 auto; }
.pvp-pct-lbl { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .4px; color: #8a6a44; font-weight: 700; }
.pvp-pct-box b { font-size: 19px; line-height: 1; color: var(--ink); }
.pvp-bar { height: 9px; background: #ead7b0; border: 1.5px solid var(--wood-d); border-radius: 6px; overflow: hidden; }
.pvp-bar i { display: block; height: 100%; width: 0%; background: linear-gradient(#ffd34d, #e69500); transition: width .2s; }
.pvp-loot-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; font-weight: 700; }
.pvp-loot { color: #8a5200; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pvp-phase { flex: 0 0 auto; background: #f3dfb6; border: 1.5px solid #d4b078; color: #6a3f1a; border-radius: 999px; padding: 1px 8px; font-size: 10.5px; }
.pvp-acts { pointer-events: auto; display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.pvp-acts .btn.small { min-height: 36px; padding: 6px 11px; font-size: 12.5px; white-space: nowrap; }
.pvp-cv { flex: 1; width: 100%; height: 100%; min-height: 0; display: block; touch-action: none; cursor: grab; }
.pvp-log { position: absolute; left: 8px; right: 8px; bottom: calc(10px + var(--safe-b)); z-index: 4; max-width: 680px; margin: 0 auto; background: rgba(255,247,230,.95); color: var(--ink); border: 2.5px solid var(--wood-d); border-radius: 14px; padding: 8px 13px; box-shadow: 0 3px 0 var(--wood-d); font-size: 12.5px; font-weight: 700; text-align: center; pointer-events: none; }

/* Centro de Ayuda unificado y tarjetas "Dónde se siembra / cómo conseguirlo" */
.mm-tabs { display: flex; gap: 6px; flex: 0 0 auto; }
.mm-tabs button { flex: 1; padding: 9px 6px; border-radius: 13px; background: #f1dfba; border: 2px solid #d8b77a; font-weight: 800; font-size: 13px; color: #6a3f1a; }
.mm-tabs button.on { background: #fffdf6; border-color: var(--wood-d); color: var(--ink); box-shadow: 0 2px 0 var(--wood-d); }
.mm-acc { border: 2px solid #e6cfa0; padding: 0; overflow: visible; flex: 0 0 auto; }
.mm-acc summary { display: flex; align-items: center; gap: 8px; padding: 11px 14px; cursor: pointer; list-style: none; font-size: 14.5px; color: var(--ink); }
.mm-acc summary::-webkit-details-marker { display: none; }
.mm-pill { background: #f5e2b8; border: 1.5px solid #d4b078; color: #6a3f1a; font-size: 10.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; flex: 0 0 auto; }
.mm-acc-body { padding: 4px 14px 12px; border-top: 1.5px solid #f0dfc0; }
.mm-row.mm-clean { grid-template-columns: 36px 1fr auto; text-align: left; border: 1.5px solid #efe0c0; }
.mm-row.mm-clean.mm-noico { grid-template-columns: 1fr auto; }
.mm-row.mm-unk { background: #faf4e6; opacity: .95; }
.mm-row.mm-hit { cursor: pointer; width: 100%; font-family: inherit; }
.mm-row.mm-hit:hover { background: #fff1cc; border-color: #d8b26a; }
.mm-tag { font-style: normal; font-size: 10px; font-weight: 800; background: #efe0c0; color: #6a4420; padding: 1px 6px; border-radius: 999px; margin-left: 5px; vertical-align: middle; }
.mm-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.mm-sec-head h3 { margin: 0; }
.mm-shortcuts { display: flex; gap: 8px; }
.mm-shortcuts .btn { flex: 1; }
.mm-tuts { display: flex; flex-direction: column; gap: 8px; }
.mm-state { color: #8a5a12; font-weight: 700; }
.mm-chips .chip.on { background: #fff3c4; border-color: var(--wood-d); color: var(--ink); }
.howto-card { background: #fff9e6; border: 2px solid #d8b26a; border-radius: 14px; padding: 10px 12px; margin: 8px 0; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.howto-card b { font-size: 13.5px; color: var(--ink); }
.howto-card small { font-size: 12.5px; color: #6a4420; line-height: 1.35; }
.howto-card .btn { align-self: flex-start; margin-top: 4px; }

/* Decisiones narrativas en escenas de historia */
.cut-choices { display: none; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cut-choices.show { display: flex; }
.cut-choice { flex: 1 1 130px; background: linear-gradient(#ffe37a, #f2b705); color: #4a2a0a; border: 2.5px solid #8a5a12; border-radius: 12px; padding: 8px 10px; font: 800 13px Fredoka, system-ui, sans-serif; cursor: pointer; box-shadow: 0 3px 0 #8a5a12; }
.cut-choice:active { transform: translateY(2px); box-shadow: 0 1px 0 #8a5a12; }

/* Destacado del día en Arcade */
.ar-card.feat { box-shadow: 0 0 0 3px #ffcf33, 0 4px 0 rgba(0,0,0,.18); }
.feat-tag { display: inline-block; background: #ffcf33; color: #5a3518; font-style: normal; font-size: 10.5px; padding: 1px 6px; border-radius: 999px; margin-left: 5px; vertical-align: middle; }

/* Deslizadores de audio en Ajustes */
.vol-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-size: 13px; font-weight: 700; color: #5a3518; }
.vol-row input[type="range"] { flex: 1; accent-color: #4fae3b; }

/* ===== v1.83: Misiones plegables (espejo de Valle), Consejos al entrar y Tiempo de juego (Owner) ===== */
.qtrack { align-items: flex-start; gap: 6px; }
.qtrack-toggle { display: flex !important; min-width: var(--rb, 50px); min-height: var(--rb, 50px); background: linear-gradient(#fff7d6, #f7d98b); }
body.qtrack-open .qtrack-toggle { background: linear-gradient(#ffe68a, #f2be38); border-color: #8a520c; }
.qtrack-items { display: none; margin-top: 2px; background: rgba(255, 247, 230, .95); border: 2.5px solid var(--wood-d); padding: 7px 6px; border-radius: 18px; box-shadow: 0 4px 0 rgba(90, 53, 24, .32); flex-direction: column; gap: 7px; align-items: center; }
body.qtrack-open .qtrack-items { display: flex; animation: pop .18s ease-out; }
.qtrack-all { border: 2px solid #d4b078; background: #fffdf5; color: #6a3f1a; border-radius: 12px; padding: 3px 8px; font: 800 10.5px Fredoka, system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.qtrack-all:active { transform: translateY(1px); }

/* Tarjeta atractiva de consejos al entrar */
.modal.tip-modal .modal-card, .modal.pvp-alert-modal .modal-card { background: linear-gradient(180deg, #fffdf4 0%, #faecc8 100%); border: 3.5px solid var(--wood-d); box-shadow: 0 7px 0 var(--wood-d), 0 18px 40px rgba(0, 0, 0, .35); max-width: 390px; }
.tip-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.tip-head { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tip-avatar { width: 68px; height: 68px; border-radius: 50%; object-fit: cover; background: radial-gradient(circle at 40% 35%, #fff8d6, #ffd27a); border: 3px solid #d98d1a; box-shadow: 0 3px 0 rgba(120, 70, 15, .3); }
.tip-badge { display: inline-flex; align-items: center; gap: 4px; background: #fff3c4; border: 2px solid #d8a948; color: #7a480a; font-weight: 800; font-size: 11.5px; padding: 3px 11px; border-radius: 999px; }
.tip-title { margin: 2px 0 0; font-size: 20px; color: var(--ink); line-height: 1.2; }
.tip-text { margin: 0; font-size: 14px; line-height: 1.45; color: #5a3518; background: rgba(255, 255, 255, .78); border: 2px solid #e8d2a0; border-radius: 14px; padding: 10px 12px; width: 100%; }
.tip-opt { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12.5px; color: #6e4b28; font-weight: 700; cursor: pointer; margin-top: 2px; user-select: none; }
.tip-opt input { width: 17px; height: 17px; accent-color: #4fae3b; cursor: pointer; }
.tip-acts { width: 100%; margin-top: 4px; }

/* Reporte detallado de ataque PvP y perfil del atacante */
.pvp-alert-card { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.pvp-alert-card .btn { margin: 2px 0; }
.pvp-alert-head { display: flex; align-items: center; gap: 11px; }
.pvp-alert-head h2 { margin: 3px 0 1px; font-size: 19px; }
.pvp-alert-head small { display: block; font-size: 12.5px; color: #7a5228; font-weight: 600; }
.pvp-alert-av { width: 58px; height: 58px; flex: 0 0 58px; border-radius: 50%; object-fit: cover; background: radial-gradient(circle at 40% 35%, #fff8d6, #ffd27a); border: 3px solid var(--wood-d); box-shadow: 0 3px 0 rgba(90, 53, 24, .25); }
.pvp-badge { background: #ffe3dc; border-color: #d6553e; color: #8f1f15; }
.pvp-stolen-list { margin: 4px 0 0; }
.pvp-lost-chip { background: #fff5f2; border-color: #e6a89c; color: #8f1f15; font-size: 12.5px; }

/* ===== Auditoría UI/UX v1.84: escala tipográfica y tamaños de botones unificados ===== */
:root {
  --fs-h2: 20px;
  --fs-h3: 15.5px;
  --fs-body: 14px;
  --fs-sm: 12.5px;
  --fs-xs: 11.5px;
}
h2 { font-size: var(--fs-h2); line-height: 1.2; }
h3 { font-size: var(--fs-h3); line-height: 1.25; }
.sub, .help p, .modal-card > p:not(.hint):not(.mutbig) { font-size: var(--fs-body); line-height: 1.42; }
.hint, .li small, .quest small, .howto-card small { font-size: var(--fs-sm); line-height: 1.35; }
.li b, .quest b, .howto-card b { font-size: var(--fs-body); line-height: 1.25; }
.card b { font-size: 13.5px; line-height: 1.2; }
.card small { font-size: var(--fs-xs); line-height: 1.22; }
.tabs button { min-height: 36px; font-size: 13px; padding: 7px 8px; }

/* Botones con altura, tipografía y alineación uniformes en toda la interfaz */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 14px; font-size: 15px; line-height: 1.2; text-align: center; }
.btn.small { display: inline-flex; min-height: 36px; padding: 7px 11px; font-size: 13.5px; line-height: 1.15; }
.row2 { display: flex; gap: 8px; align-items: stretch; margin: 8px 0; }
.row2 > .btn { flex: 1; min-width: 0; margin: 0; }
.row2 > .btn small { display: block; font-size: 11px; font-weight: 600; opacity: .85; }
.herd .row2 > .btn { flex-direction: column; gap: 1px; padding: 8px 10px; }
.order .row2 { margin: 2px 0 0; }
.order .row2 .btn.small { flex: 0 0 44px; min-height: 38px; padding: 0; }
.modal-card .row2 { width: 100%; }

/* Analítica de tiempo de juego en Panel de Dueño */
.pt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 6px; margin: 8px 0; }
.pt-kpi { background: #fffdf5; border: 2px solid #e4cca0; border-radius: 12px; padding: 7px 6px; text-align: center; }
.pt-kpi b { display: block; font-size: 15px; color: var(--ink); line-height: 1.15; }
.pt-kpi small { display: block; font-size: 10.5px; color: #7a5228; font-weight: 700; }
.pt-bar { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.pt-bar .inp { flex: 1; margin: 0; }
.pt-list { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; padding-right: 2px; }
.pt-row { align-items: center; }
.pt-main { min-width: 0; flex: 1; }
.pt-main b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-main small { display: block; font-size: 11px; color: #7a5228; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-time { flex: 0 0 auto; text-align: right; background: #fff3c4; border: 1.5px solid #d8b060; color: #6a3f10; border-radius: 10px; padding: 4px 8px; font-size: 12.5px; }

/* ===== v1.85: Almanaque unificado con fichas visuales directas ===== */
.alm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 7px; margin-top: 6px; }
.alm-card { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 6px; border-radius: 14px; background: #fffdf5; border: 2px solid #e6cfa0; box-shadow: 0 2px 0 rgba(90, 53, 24, .14); text-align: center; cursor: pointer; font-family: inherit; color: var(--ink); transition: transform .08s, border-color .12s; }
.alm-card:active { transform: scale(.96); border-color: #d9a030; }
.alm-card.unk { background: #f8f1e2; opacity: .88; }
.alm-ico { width: 38px; height: 38px; display: grid; place-items: center; font-size: 28px; }
.alm-ico img.ei { width: 34px; height: 34px; }
.alm-card b { font-size: 12.5px; line-height: 1.15; }
.alm-card small { font-size: 10.5px; color: #7a5228; font-weight: 700; }
.alm-detail { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.alm-head { display: flex; align-items: center; gap: 11px; }
.alm-head > div { flex: 1; min-width: 0; }
.alm-head h2 { margin: 3px 0 2px; font-size: 19px; line-height: 1.18; }
.alm-head small { display: block; font-size: 12.5px; color: #6a4420; line-height: 1.35; }
.alm-pic { width: 64px; height: 64px; flex: 0 0 64px; display: grid; place-items: center; background: #fff9ec; border: 2.5px solid #e4c68e; border-radius: 16px; overflow: hidden; font-size: 36px; }
.alm-pic img { width: 100%; height: 100%; object-fit: contain; }
.alm-pic img.ei { width: 46px; height: 46px; }
.alm-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.alm-stat { background: #fffdf5; border: 1.5px solid #ead4a8; border-radius: 12px; padding: 6px 9px; }
.alm-stat small { display: block; font-size: 10.5px; color: #8a6438; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.alm-stat b { display: block; font-size: 12.5px; color: var(--ink); margin-top: 2px; line-height: 1.25; }
.alm-uses small { display: block; font-size: 11px; font-weight: 800; color: #7a5228; margin-bottom: 4px; text-transform: uppercase; }
.alm-uses .chips { justify-content: flex-start; gap: 5px; }
.alm-uses .chip { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; background: #fff4d6; border: 1.5px solid #d8b26a; }
.alm-bullets { margin: 2px 0 4px 18px; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: #5a3518; line-height: 1.4; }
.modal.alm-modal .modal-card { max-width: 410px; }

/* ===== v1.85.1: Espaciado limpio en fábricas, obras unificadas y encabezados ===== */
.slots { display: flex; gap: 7px; flex-wrap: wrap; margin: 10px 0 12px; }
.fac-acts { margin: 8px 0 14px; }
.fac-acts .btn { margin: 0; }
.fac-list { margin-top: 6px; }
.works { background: #fff6dc; border: 2px solid #e0ad38; border-radius: 16px; padding: 10px 12px; margin: 8px 0 12px; display: flex; flex-direction: column; gap: 6px; }
.works-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--ink); }
.works-top span { font-weight: 800; color: #8a5200; white-space: nowrap; }
.works p { margin: 0; font-size: 12.5px; color: #6a4420; line-height: 1.35; }
.works .works-perk { color: #366e1a; }
.works .pbar { margin: 2px 0; }
.works .btn { margin: 4px 0 0; }
.works-detail { background: #fffdf5; border: 1.5px solid #ead4a8; border-radius: 14px; padding: 9px 11px; margin: 8px 0 4px; display: flex; flex-direction: column; gap: 4px; }
.works-detail b { font-size: 13.5px; color: var(--ink); }
.works-detail small { font-size: 12.5px; color: #6a4420; line-height: 1.35; }
.bhead-pic { font-size: 30px !important; }
#sheet-body > .btn + .list, #sheet-body > .row2 + .list { margin-top: 10px; }

/* ===== v1.86: Tienda VIP, Paquetes de Gemas y Adornos Premium ===== */
.vip-hero { background: linear-gradient(135deg, #fff4cc 0%, #ffe08a 55%, #ffd266 100%); border: 2.5px solid #c98a14; border-radius: 16px; padding: 10px 13px; margin: 4px 0 10px; box-shadow: 0 3px 0 rgba(168, 110, 0, .28); }
.vip-hero h2, .vip-hero h3 { margin: 0 0 2px; color: #5a3208; }
.vip-hero small { display: block; font-size: 12.5px; color: #7a4a12; font-weight: 700; }
.vip-deal { background: linear-gradient(135deg, #ffe28a, #ffb6c9); border: 2.5px solid #d47a28; border-radius: 18px; padding: 8px 9px 4px; margin: 8px 0; }
.vip-card { border: 2px solid #ecd4a2; background: linear-gradient(180deg, #fffdf8, #fff7e4); padding: 9px 10px; border-radius: 16px; }
.vip-card.own { border-color: #82d462; background: linear-gradient(180deg, #f8fff4, #ecffe4); }
.vip-art { width: 54px; height: 54px; display: grid; place-items: center; background: #fffaf0; border: 2px solid #ebd29d; border-radius: 14px; font-size: 28px; overflow: hidden; }
.vip-art img { width: 50px; height: 50px; object-fit: contain; margin: 0 !important; }
.vip-tag { display: inline-block; font-style: normal; font-size: 9.5px; font-weight: 900; letter-spacing: .3px; background: linear-gradient(#ffe37a, #f2b424); color: #5a3208; border: 1px solid #b87c0a; border-radius: 999px; padding: 1px 6px; margin-left: 5px; vertical-align: middle; }
.orn-hero { display: flex; align-items: center; gap: 12px; background: linear-gradient(180deg, #fffdf6, #faebc6); border: 2.5px solid #e2be78; border-radius: 18px; padding: 10px 12px; margin-bottom: 10px; }
.orn-hero h2 { margin: 0 0 4px; font-size: 18px; }
.orn-prev { width: 78px; height: 78px; flex: 0 0 78px; display: grid; place-items: center; background: #fff; border: 2.5px solid #e4c68e; border-radius: 16px; overflow: hidden; font-size: 40px; }
.orn-prev img { width: 100%; height: 100%; object-fit: contain; }
.orn-paintbox { background: #fffdf5; border: 2px solid #ead4a8; border-radius: 16px; padding: 8px 10px 4px; margin-bottom: 10px; text-align: center; }
.orn-paintbox b { display: block; font-size: 13.5px; color: var(--ink); margin-bottom: 4px; }
.gem-pack { background: linear-gradient(180deg, #fffdf8, #f2f7ff); border-color: #9ec0f5; }
.gem-pack.deal { background: linear-gradient(180deg, #fffef6, #fff0cf); border-color: #e6a220; }
.freq-box { background: linear-gradient(180deg, #fffdf4, #f6edd6); border: 2px solid #e1c794; border-radius: 16px; padding: 12px; margin: 12px 0; }
.freq-box h3 { margin: 0 0 8px; }
.freq-mine { background: #fff; border: 2px solid #e7d4ab; border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.freq-head { display: flex; align-items: center; gap: 10px; }
.freq-head .big { font-size: 32px; line-height: 1; }
.freq-head b { display: block; font-size: 14px; }
.freq-head small, .freq-donors { color: #7a5c3a; font-size: 12px; }
.freq-list { margin-top: 8px; }
.freq-picker { display: flex; flex-direction: column; gap: 8px; max-height: 78vh; }
.freq-qty { justify-content: center; }
.freq-grid { max-height: 44vh; overflow-y: auto; padding: 2px; }

/* ---------- sello de tinta "USADO COMO AVATAR" en el Salón ---------- */
.salon-stamp {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
}
.salon-stamp.active { opacity: 1; }
.salon-stamp .stamp-ring {
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 4px solid rgba(184, 29, 58, .55);
  opacity: 0;
  transform: scale(.45);
}
.salon-stamp.active .stamp-ring {
  animation: stamp-wave .55s cubic-bezier(.15, .85, .35, 1) .12s forwards;
}
.salon-stamp .stamp-ink {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 14px 24px 13px;
  border: 5px solid #b81d3a;
  border-radius: 16px;
  color: #b81d3a;
  background:
    radial-gradient(circle at 18% 25%, rgba(255,255,255,.32) 0 1.2px, transparent 1.6px),
    radial-gradient(circle at 76% 68%, rgba(255,255,255,.28) 0 1.4px, transparent 1.8px),
    radial-gradient(circle at 52% 14%, rgba(255,255,255,.25) 0 1.1px, transparent 1.5px),
    radial-gradient(circle at 86% 24%, rgba(255,255,255,.30) 0 1.3px, transparent 1.7px),
    rgba(255, 245, 247, .82);
  background-size: 28px 28px, 34px 34px, 22px 22px, 30px 30px, 100% 100%;
  box-shadow:
    inset 0 0 0 3px rgba(184, 29, 58, .82),
    inset 0 0 0 6px rgba(255, 245, 247, .75),
    0 10px 26px rgba(120, 14, 38, .28),
    0 0 0 2px rgba(184, 29, 58, .18);
  text-align: center;
  transform: rotate(var(--tilt, -10deg)) scale(2.6);
  opacity: 0;
  will-change: transform, opacity, filter;
}
.salon-stamp .stamp-ink::after {
  content: '';
  position: absolute;
  inset: 5px;
  border: 2px dashed rgba(184, 29, 58, .68);
  border-radius: 10px;
  pointer-events: none;
}
.salon-stamp .stamp-top {
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 2.2px;
  opacity: .88;
}
.salon-stamp .stamp-ink b {
  font-size: clamp(20px, 5.4vw, 27px);
  font-weight: 900;
  letter-spacing: 1.4px;
  line-height: 1.08;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255,255,255,.55);
}
.salon-stamp .stamp-bot {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 1px 10px;
  border-radius: 999px;
  background: rgba(184, 29, 58, .14);
}
.salon-stamp.active .stamp-ink {
  animation: stamp-slam 2.65s cubic-bezier(.22, 1, .36, 1) forwards;
}
.salon-stage.stamp-thump {
  animation: stage-thump .24s ease-out .10s;
}
@keyframes stamp-slam {
  0%   { opacity: 0;   transform: rotate(calc(var(--tilt, -10deg) - 16deg)) scale(2.75); filter: blur(2.5px) contrast(1.1); }
  7%   { opacity: .98; transform: rotate(var(--tilt, -10deg)) scale(.90); filter: blur(0) contrast(1.2); }
  11%  { opacity: 1;   transform: rotate(calc(var(--tilt, -10deg) + 1.5deg)) scale(1.04); filter: blur(0) contrast(1.1); }
  16%  { opacity: .96; transform: rotate(var(--tilt, -10deg)) scale(1); filter: blur(0) contrast(1.05); }
  48%  { opacity: .92; transform: rotate(var(--tilt, -10deg)) scale(1); filter: blur(0) saturate(1); }
  72%  { opacity: .52; transform: rotate(var(--tilt, -10deg)) scale(.995); filter: blur(.6px) saturate(.75); }
  88%  { opacity: .20; transform: rotate(var(--tilt, -10deg)) scale(.99); filter: blur(1.4px) saturate(.5); }
  100% { opacity: 0;   transform: rotate(var(--tilt, -10deg)) scale(.985); filter: blur(2.4px) saturate(.3); }
}
@keyframes stamp-wave {
  0%   { opacity: .75; transform: scale(.42); }
  100% { opacity: 0;   transform: scale(1.55); }
}
@keyframes stage-thump {
  0%   { transform: translate(0, 0) scale(1); }
  25%  { transform: translate(-2px, 3px) scale(.988); }
  55%  { transform: translate(2px, -2px) scale(1.006); }
  80%  { transform: translate(-1px, 1px) scale(.998); }
  100% { transform: translate(0, 0) scale(1); }
}

/* ---------- evento de jefe RPG semanal (El Rey Esqueleto) ---------- */
.rbtn.boss-btn {
  background: linear-gradient(180deg, #3c1f5c, #24103a);
  border-color: #9b5de5;
  color: #f6eaff;
  box-shadow: 0 4px 0 #150824, 0 0 14px rgba(155, 93, 229, .45);
}
.rbtn.boss-btn small { color: #e2c6ff; }
.rbtn.boss-btn.live {
  background: linear-gradient(180deg, #7a1432, #3c0a1e);
  border-color: #ff5d73;
  animation: boss-pulse 1.5s infinite ease-in-out;
}
@keyframes boss-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 0 #260512, 0 0 12px rgba(255, 93, 115, .5); }
  50% { transform: scale(1.06); box-shadow: 0 4px 0 #260512, 0 0 22px rgba(255, 93, 115, .85); }
}
.boss-hud {
  position: fixed;
  top: calc(96px + var(--safe-t));
  left: 50%;
  transform: translateX(-50%);
  z-index: 42;
  width: min(320px, calc(100vw - 24px));
  background: linear-gradient(180deg, rgba(38, 16, 58, .94), rgba(22, 9, 36, .95));
  border: 2.5px solid #9b5de5;
  border-radius: 16px;
  padding: 8px 12px;
  color: #fff;
  box-shadow: 0 6px 18px rgba(10, 4, 24, .55);
  display: none;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
}
.boss-hud.show { display: flex; }
.boss-hud.warn { border-color: #ff4d4d; box-shadow: 0 6px 20px rgba(255, 50, 50, .45); }
.boss-hud.vuln { border-color: #ffd23a; box-shadow: 0 6px 22px rgba(255, 210, 58, .55); }
.boss-hud .bh-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13.5px; }
.boss-hud .bh-warn { background: #ff3b3b; color: #fff; font-size: 10.5px; font-weight: 900; padding: 2px 7px; border-radius: 999px; animation: boss-pulse .6s infinite; }
.boss-hud .bh-vuln { background: #ffd23a; color: #4a2400; font-size: 10.5px; font-weight: 900; padding: 2px 8px; border-radius: 999px; animation: boss-pulse .55s infinite; }
.boss-hud .bh-armor { background: rgba(155, 93, 229, .35); color: #e9d6ff; border: 1px solid #9b5de5; font-size: 10.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.boss-hud .bh-bar { height: 10px; background: rgba(255,255,255,.16); border-radius: 999px; overflow: hidden; border: 1px solid rgba(255,255,255,.22); }
.boss-hud .bh-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff3b5c, #c77dff, #5ef2ff); transition: width .15s linear; }
.boss-hud.vuln .bh-bar i { background: linear-gradient(90deg, #ff9a1f, #ffd23a, #fff6a0); }
.boss-hud small { font-size: 11px; color: #dcc8f5; text-align: center; }
.boss-modal { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.boss-kicker {
  background: linear-gradient(90deg, #321552, #5c1944);
  color: #7df6ff;
  border: 1.5px solid #9b5de5;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .4px;
}
.boss-showcase { display: flex; align-items: center; justify-content: center; gap: 10px; }
.boss-vs { font-size: 22px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); }
.boss-art {
  margin: 0;
  position: relative;
  width: 116px;
  height: 116px;
  border-radius: 18px;
  overflow: hidden;
  border: 3px solid #9b5de5;
  box-shadow: 0 6px 18px rgba(45, 16, 76, .35);
  display: grid;
  place-items: center;
  background: #1b0e2d;
  font-size: 56px;
}
.boss-art.reward { border-color: #e6a220; background: #6a3c12; }
.boss-art figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: rgba(20, 10, 32, .78);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  padding: 2px 4px;
}
.boss-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.boss-loot {
  width: 100%;
  background: linear-gradient(180deg, #fffdf4, #f5e9cb);
  border: 2px solid #dfc182;
  border-radius: 14px;
  padding: 10px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.boss-loot-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.boss-loot small { font-size: 12px; color: #6a4c2a; line-height: 1.35; }
.boss-badge { font-weight: 900; font-size: 12.5px; padding: 5px 12px; border-radius: 999px; }
.boss-badge.live { background: #ffe0e6; color: #a8102d; border: 1.5px solid #ff5d73; }
.boss-badge.soon { background: #ede3ff; color: #4f218c; border: 1.5px solid #9b5de5; }
.boss-badge.won { background: #e2ffe0; color: #226b22; border: 1.5px solid #5fd35a; }
