/* ==========================================================================
   Las Granjitas — estilos de la interfaz (pantallas y HUD)
   ========================================================================== */
:root {
  --green: #4caf3a;
  --green-dark: #2f7d24;
  --blue: #3a8fd8;
  --blue-dark: #22629c;
  --ink: #1d2a17;
  --muted: #5b6b52;
  --card: #fffdf5;
  --panel: rgba(20, 30, 15, 0.72);
  --gem: #b46cff;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #98e052; color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  user-select: none; -webkit-user-select: none;
}
button, input, select, textarea { font-family: inherit; }
.hidden { display: none !important; }

/* ---------- Pantallas a pantalla completa ---------- */
.screen {
  position: fixed; inset: 0; z-index: 20; overflow-y: auto;
  background: radial-gradient(circle at 50% 20%, #c4f09a, #5fae3c 75%);
  display: flex; align-items: flex-start; justify-content: center; padding: 16px;
}
/* margin:auto centra la tarjeta y, si es más alta que la pantalla, deja ver el principio */
.screen > .card { margin: auto; }
.card {
  width: 100%; max-width: 380px; background: var(--card); color: var(--ink);
  border-radius: 22px; padding: 24px 20px; box-shadow: 0 10px 0 #3d7d26, 0 20px 40px rgba(0,0,0,.25);
}
.card h1 { margin: 0 0 4px; font-size: 28px; text-align: center; }
.sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; text-align: center; }
input.field, select.field {
  width: 100%; font-size: 16px; padding: 12px 14px; border-radius: 12px; border: 2px solid #d5e3c7;
  outline: none; margin-bottom: 10px; background: #fff; color: var(--ink);
}
input.field:focus { border-color: var(--green); }
.btn {
  width: 100%; font-size: 16px; font-weight: 800; padding: 12px; border: none; border-radius: 12px;
  color: #fff; cursor: pointer; background: var(--green); box-shadow: 0 4px 0 var(--green-dark);
  transition: transform .05s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--green-dark); }
.btn.blue { background: var(--blue); box-shadow: 0 4px 0 var(--blue-dark); }
.btn.purple { background: #8e44ad; box-shadow: 0 4px 0 #5e2d73; }
.btn.orange { background: #f39c12; box-shadow: 0 4px 0 #b06f00; }
.btn.gray { background: #8a948a; box-shadow: 0 4px 0 #5f675f; }
.btn.small { width: auto; padding: 8px 14px; font-size: 14px; }
.btn:disabled { opacity: .55; }
.error { min-height: 18px; margin-top: 8px; color: #c0392b; font-size: 14px; text-align: center; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs button {
  flex: 1; padding: 10px; border: none; border-radius: 10px; font-weight: 800; cursor: pointer;
  background: #e8f0de; color: var(--muted);
}
.tabs button.active { background: var(--green); color: #fff; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

/* ---------- Inicio ---------- */
.home { max-width: 420px; text-align: center; }
.topline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.gems { font-weight: 900; color: #7b2fbf; background: #f1e4ff; padding: 6px 12px; border-radius: 20px; }
.preview { width: 100%; height: 220px; display: block; border-radius: 16px; background: linear-gradient(#e7f7d6, #c7eaa6); touch-action: none; }
.farm-info { margin: 8px 0 12px; color: var(--muted); font-size: 14px; }
.home .btn { margin-bottom: 9px; }

/* ---------- Editor y tienda ---------- */
.wide { max-width: 860px; display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
.wide .preview { height: 340px; }
@media (max-width: 720px) {
  .wide { grid-template-columns: 1fr; }
  .wide .preview { height: 220px; }
  .screen { align-items: flex-start; }
}
.cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cats button {
  padding: 7px 11px; border: none; border-radius: 18px; font-weight: 700; cursor: pointer;
  background: #e8f0de; color: var(--muted); font-size: 13px;
}
.cats button.active { background: var(--green); color: #fff; }
.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 300px; overflow-y: auto; padding: 2px; }
.opt {
  border: 3px solid transparent; background: #f2f7ec; border-radius: 12px; padding: 10px 6px; cursor: pointer;
  font-size: 13px; font-weight: 700; color: var(--ink); text-align: center; position: relative;
}
.opt.selected { border-color: var(--green); background: #e3f6d6; }
.opt.locked { opacity: .6; }
.opt .price { display: block; font-size: 12px; color: #7b2fbf; margin-top: 4px; }
.opt .owned { display: block; font-size: 11px; color: var(--green-dark); margin-top: 4px; }
.rarity { display: inline-block; font-size: 10px; padding: 2px 6px; border-radius: 8px; margin-top: 4px; color: #fff; }
.rarity.común { background: #8a948a; }
.rarity.raro { background: #3a8fd8; }
.rarity.épico { background: #8e44ad; }
.rarity.legendario { background: #e67e22; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #ccc; cursor: pointer; }
.swatch.selected { box-shadow: 0 0 0 3px var(--green); }
.label { font-size: 13px; font-weight: 800; color: var(--muted); margin: 8px 0 4px; }
.actions { display: flex; gap: 8px; margin-top: 12px; }

/* ---------- HUD de partida ---------- */
#game { position: fixed; inset: 0; }
#game canvas { display: block; touch-action: none; }
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.top {
  position: absolute; top: calc(10px + var(--safe-top)); left: 10px; right: 10px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
}
.col { display: flex; flex-direction: column; gap: 6px; }
.col.right { align-items: flex-end; }
.chip {
  background: var(--panel); border-radius: 14px; padding: 7px 11px; font-weight: 800; font-size: 14px;
  display: flex; align-items: center; gap: 6px; pointer-events: auto;
}
.chip button {
  background: rgba(255,255,255,.18); border: none; color: #fff; border-radius: 8px; padding: 3px 7px;
  font-size: 13px; cursor: pointer;
}
#moneyBox {
  position: absolute; top: calc(12px + var(--safe-top)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; transition: transform .12s;
}
#moneyBox.pulse { transform: translateX(-50%) scale(1.1); }
#moneyBox .pill {
  background: rgba(40,40,40,.72); border-radius: 22px; height: 40px; min-width: 130px;
  margin-left: -22px; padding: 0 20px 0 34px; display: flex; align-items: center; justify-content: flex-end;
  font-size: 24px; font-weight: 900; text-shadow: 0 2px 0 rgba(0,0,0,.35);
}
.bill {
  position: relative; z-index: 1; width: 64px; height: 40px; border-radius: 6px;
  background: linear-gradient(160deg, #6dff8a, #22c55e 55%, #15a34a);
  border: 3px solid #e9ffe9; box-shadow: 4px 4px 0 #128a3b, 0 4px 10px rgba(0,0,0,.3);
  transform: rotate(-12deg); display: flex; align-items: center; justify-content: center;
}
.bill::after { content: ''; width: 22px; height: 22px; border-radius: 50%; background: #1c9e4a; border: 2px solid #b9ffc8; }
.stack-info { position: absolute; top: calc(60px + var(--safe-top)); left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 700; }
@media (max-width: 560px) { .top { top: calc(84px + var(--safe-top)); } }

.round-btn {
  position: absolute; width: 60px; height: 60px; border-radius: 50%; border: 4px solid #fff;
  font-size: 26px; pointer-events: auto; cursor: pointer; box-shadow: 0 6px 16px rgba(0,0,0,.3);
}
#micBtn { right: 16px; bottom: calc(20px + var(--safe-bottom)); background: #c0392b; }
#micBtn.on { background: var(--green); }
#emoteBtn { right: 16px; bottom: calc(92px + var(--safe-bottom)); background: #f39c12; }
#emoteMenu {
  position: absolute; right: 86px; bottom: calc(92px + var(--safe-bottom)); pointer-events: auto;
  background: var(--panel); border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 6px;
}
#emoteMenu button { border: none; border-radius: 10px; padding: 8px 12px; font-weight: 800; cursor: pointer; background: rgba(255,255,255,.9); color: var(--ink); }
#hint {
  position: absolute; left: 12px; bottom: calc(14px + var(--safe-bottom)); font-size: 12px;
  background: var(--panel); padding: 6px 10px; border-radius: 10px; opacity: .85;
}
@media (pointer: coarse) { #hint .pc { display: none; } }
@media (pointer: fine) { #hint .mobile { display: none; } }
#toast {
  position: absolute; top: 28%; left: 50%; transform: translate(-50%, -10px); opacity: 0;
  background: var(--panel); padding: 10px 16px; border-radius: 14px; font-weight: 800;
  transition: opacity .25s, transform .25s; text-align: center; max-width: 86vw;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#banner {
  position: absolute; top: 38%; left: 0; right: 0; text-align: center; font-size: 36px; font-weight: 900;
  color: #fff7b0; text-shadow: 0 4px 0 #b06a00, 0 8px 20px rgba(0,0,0,.4);
  opacity: 0; transform: scale(.6); transition: opacity .3s, transform .3s;
}
#banner.show { opacity: 1; transform: scale(1); }
#joyBase {
  position: fixed; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%;
  background: rgba(255,255,255,.18); border: 3px solid rgba(255,255,255,.55); display: none; z-index: 11; pointer-events: none;
}
#joyKnob { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: rgba(255,255,255,.85); }
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 9; overflow: hidden; }
.floater {
  position: absolute; font-weight: 900; font-size: 20px; color: #7dff6b; white-space: nowrap;
  text-shadow: 0 2px 0 #145c12, 0 0 6px rgba(0,0,0,.4); transform: translate(-50%, -50%);
}
.gem-pop { color: #e3b6ff; text-shadow: 0 2px 0 #4a1a73; }

/* ---------- Flecha guía y panel de jugadores ---------- */
.guide {
  position: absolute; top: calc(84px + var(--safe-top)); left: 50%; transform: translateX(-50%);
  background: rgba(255, 235, 59, 0.95); color: #3e2f00; font-weight: 800; font-size: 14px;
  padding: 7px 14px; border-radius: 16px; box-shadow: 0 4px 10px rgba(0,0,0,.2); white-space: nowrap;
  max-width: 92vw; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 560px) { .guide { top: calc(136px + var(--safe-top)); font-size: 13px; } }
.players-panel {
  position: absolute; right: 10px; top: calc(190px + var(--safe-top)); width: 240px; pointer-events: auto;
  background: var(--panel); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 6px;
}
.players-panel .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 14px; }
.players-panel button { border: none; border-radius: 8px; padding: 5px 9px; font-weight: 800; cursor: pointer; }
.players-panel .muted { background: #c0392b; color: #fff; }
.players-panel .title { font-size: 12px; opacity: .8; }

/* ---------- Récords ---------- */
.records { margin-top: 14px; text-align: left; background: #f5f9ef; border-radius: 14px; padding: 10px 12px; }
.records-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 14px; margin-bottom: 6px; }
.records-tabs { display: inline-flex; flex-wrap: wrap; gap: 3px; justify-content: flex-end; }
.records-tabs button { border: none; background: #e3ecd8; color: var(--muted); font-weight: 800; font-size: 12px; padding: 4px 8px; border-radius: 8px; cursor: pointer; }
.records-tabs button.active { background: var(--green); color: #fff; }
.records-list { margin: 0; padding: 0; list-style: none; max-height: 230px; overflow-y: auto; }
.records-list li { padding: 6px 0; border-top: 1px solid #e3ecd8; font-size: 12.5px; color: var(--ink); }
.records-list li:first-child { border-top: none; }
.records-list .pos { display: inline-block; min-width: 26px; font-weight: 900; }
.records-list .time { font-weight: 900; color: var(--green-dark); }
.records-list .who { color: var(--muted); }
.records-list .nums { display: block; margin-left: 26px; color: #555; }
.records-list .muted { color: var(--muted); }
.stats-panel { top: calc(150px + var(--safe-top)); left: 10px; right: auto; width: 220px; font-weight: 700; font-size: 14px; }

/* ---------- Minimapa y mapa grande ---------- */
.minimap {
  position: absolute; left: 12px; bottom: calc(46px + var(--safe-bottom)); width: 132px; height: 132px;
  border-radius: 14px; pointer-events: auto; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.35); background: #3d6b2a;
}
@media (max-width: 560px) { .minimap { width: 108px; height: 108px; } }
.bigmap { position: fixed; inset: 0; z-index: 15; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 12px; }
.bigmap-card { background: #1f2a17; border-radius: 18px; padding: 12px; width: min(94vw, 720px); color: #fff; }
.bigmap-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.bigmap-head button { border: none; background: rgba(255,255,255,.15); color: #fff; border-radius: 10px; padding: 6px 12px; font-size: 16px; cursor: pointer; }
.bigmap canvas { width: 100%; height: min(70vh, 640px); display: block; border-radius: 12px; }
.bigmap-legend { font-size: 12px; opacity: .85; margin-top: 8px; line-height: 1.5; }

/* ---------- Salas públicas ---------- */
.rooms { margin-top: 14px; text-align: left; background: #eef6ff; border-radius: 14px; padding: 10px 12px; }
.rooms-list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.rooms-list .muted { color: var(--muted); font-size: 13px; padding: 4px 0; }
.room-card { background: #fff; border-radius: 12px; padding: 8px 10px; display: flex; gap: 8px; align-items: center; box-shadow: 0 1px 0 #d6e4f5; }
.room-card .info { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink); }
.room-card .title { font-weight: 900; font-size: 13.5px; }
.room-card .sub { color: #555; line-height: 1.35; }
.room-card .join { flex: 0 0 auto; border: none; border-radius: 10px; padding: 8px 12px; font-weight: 900; color: #fff; background: var(--blue); box-shadow: 0 3px 0 var(--blue-dark); cursor: pointer; }
.room-card .join:disabled { background: #9aa5b1; box-shadow: none; }
.room-card .badge { display: inline-block; font-size: 10.5px; font-weight: 800; padding: 1px 6px; border-radius: 8px; background: #e3ecd8; color: var(--green-dark); margin-left: 4px; }
.room-card .badge.hard { background: #ffe0cc; color: #b34700; }
.rooms-online { font-weight: 600; color: var(--muted); font-size: 12px; }

/* ---------- Logo ---------- */
.card h1.logo { margin: -6px 0 2px; line-height: 0; }
.card h1.logo img { width: 100%; max-width: 300px; height: auto; filter: drop-shadow(0 4px 6px rgba(0,0,0,.18)); }

.join-pending { background: #fff3cd; color: #6b4b00; border-radius: 12px; padding: 10px; font-size: 14px; font-weight: 700; line-height: 1.4; }

/* ==========================================================================
   Pantalla de entrada (login / registro)
   ========================================================================== */
body { font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.auth-screen {
  --a-ink: #16301b; --a-muted: #5d6f61; --a-line: #dfe8d9; --a-brand: #3fae3a;
  --a-glass: rgba(255, 255, 255, .86);
  display: block; padding: 0; overflow-x: hidden;
  background: linear-gradient(180deg, #7fd0ff 0%, #b9e7ff 38%, #e6f7d8 70%, #a9dc72 100%);
}
.auth-sky { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.auth-sky .hills { position: absolute; left: 0; bottom: 0; width: 100%; height: 42vh; }
.auth-sky .h1 { fill: #9ad66a; }
.auth-sky .h2 { fill: #77c04d; }
.auth-sky .h3 { fill: #5aa83a; }
.cloud { position: absolute; width: 180px; height: 56px; background: #fff; border-radius: 60px; opacity: .85; animation: drift 70s linear infinite; }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 80px; height: 80px; top: -38px; left: 26px; }
.cloud::after { width: 64px; height: 64px; top: -26px; left: 92px; }
.cloud.c1 { top: 9%; left: -200px; }
.cloud.c2 { top: 22%; left: -200px; transform: scale(.7); animation-duration: 95s; animation-delay: -40s; opacity: .7; }
.cloud.c3 { top: 4%; left: -200px; transform: scale(.55); animation-duration: 120s; animation-delay: -80s; opacity: .6; }
@keyframes drift { to { translate: calc(100vw + 400px) 0; } }

.auth-layout {
  position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; min-height: calc(100% - 40px);
  padding: calc(28px + var(--safe-top)) 20px 20px;
  display: grid; grid-template-columns: 1.05fr 400px 1fr; gap: 26px; align-items: start;
}
.auth-hero { color: var(--a-ink); padding-top: 18px; }
.auth-logo { width: 100%; max-width: 340px; display: block; filter: drop-shadow(0 6px 10px rgba(20, 60, 20, .22)); }
.auth-tagline { font-size: 26px; line-height: 1.2; font-weight: 900; margin: 14px 0 16px; letter-spacing: -.3px; }
.auth-tagline span { background: linear-gradient(90deg, #ff8a00, #e8467c 55%, #7b4dff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-features { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.auth-features li {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px;
  background: rgba(255, 255, 255, .72); font-weight: 800; font-size: 14px; color: var(--a-ink);
  box-shadow: 0 2px 8px rgba(20, 60, 20, .08);
}
.auth-features i { font-style: normal; }
.auth-eras { display: flex; flex-wrap: wrap; gap: 6px; }
.auth-eras span {
  width: 42px; height: 42px; display: grid; place-items: center; font-size: 21px; border-radius: 13px;
  background: rgba(255, 255, 255, .6); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7);
  cursor: default; transition: transform .15s;
}
.auth-eras span:hover { transform: translateY(-3px) scale(1.08); }

.auth-card {
  background: var(--a-glass); color: var(--a-ink); border-radius: 26px; padding: 22px 22px 18px;
  box-shadow: 0 24px 60px rgba(20, 70, 30, .22), 0 2px 0 rgba(255, 255, 255, .9) inset;
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, .7);
}
.auth-card.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: #edf3e8; border-radius: 14px; padding: 4px; margin-bottom: 18px; }
.seg button { position: relative; z-index: 1; border: none; background: none; padding: 10px; font-weight: 900; font-size: 15px; color: var(--a-muted); cursor: pointer; border-radius: 11px; transition: color .2s; }
.seg button.active { color: var(--a-ink); }
.seg-pill { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); background: #fff; border-radius: 11px; box-shadow: 0 2px 8px rgba(20, 60, 20, .14); transition: transform .28s cubic-bezier(.3, 1.3, .5, 1); }
.auth-card[data-mode="register"] .seg-pill { transform: translateX(100%); }
.auth-title { margin: 0; font-size: 24px; font-weight: 900; letter-spacing: -.3px; }
.auth-subtitle { margin: 2px 0 16px; color: var(--a-muted); font-size: 14.5px; font-weight: 600; }
.auth-field { display: block; margin-bottom: 12px; }
.auth-label { display: block; font-size: 12px; font-weight: 800; color: var(--a-muted); margin: 0 0 5px 3px; text-transform: uppercase; letter-spacing: .5px; }
.auth-input {
  display: flex; align-items: center; gap: 8px; background: #fff; border: 2px solid var(--a-line); border-radius: 14px;
  padding: 0 6px 0 12px; transition: border-color .15s, box-shadow .15s;
}
.auth-input:focus-within { border-color: var(--a-brand); box-shadow: 0 0 0 4px rgba(63, 174, 58, .16); }
.auth-input svg { width: 20px; height: 20px; flex: 0 0 auto; fill: #9bb092; }
.auth-input:focus-within svg { fill: var(--a-brand); }
.auth-input input { flex: 1; min-width: 0; border: none; outline: none; background: none; font: inherit; font-weight: 700; font-size: 16px; padding: 13px 0; color: var(--a-ink); user-select: text; -webkit-user-select: text; }
.auth-input input::placeholder { color: #a9b6a3; font-weight: 600; }
.auth-eye { border: none; background: none; font-size: 18px; cursor: pointer; padding: 6px 8px; border-radius: 10px; }
.auth-eye:hover { background: #f1f5ee; }
.auth-hint { display: none; margin: -4px 0 12px 3px; font-size: 12.5px; color: var(--a-muted); line-height: 1.4; }
.auth-card[data-mode="register"] .auth-hint { display: block; }
.auth-submit {
  position: relative; width: 100%; border: none; border-radius: 15px; padding: 15px; cursor: pointer;
  font: inherit; font-size: 17px; font-weight: 900; color: #fff; letter-spacing: .2px;
  background: linear-gradient(180deg, #5cc94a, #2f9a35); box-shadow: 0 5px 0 #23782a, 0 12px 22px rgba(40, 140, 50, .3);
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.auth-submit:hover { filter: brightness(1.05); }
.auth-submit:active { transform: translateY(4px); box-shadow: 0 1px 0 #23782a, 0 6px 12px rgba(40, 140, 50, .25); }
.auth-submit:disabled { cursor: default; }
.auth-submit.loading span { visibility: hidden; }
.auth-submit.loading::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border: 3px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.auth-error { min-height: 0; margin-top: 10px; }
.auth-error:empty { display: none; }
.auth-error:not(:empty):not(:has(.join-pending)) { background: #fdecea; color: #b3261e; border-radius: 12px; padding: 9px 12px; font-weight: 700; font-size: 13.5px; }
.auth-foot { margin: 12px 0 0; text-align: center; font-size: 12.5px; color: var(--a-muted); font-weight: 700; }
.auth-warn { margin-top: 10px; background: #fff3cd; color: #8a5a00; border-radius: 12px; padding: 9px 12px; font-size: 13px; font-weight: 700; }

.auth-side { display: flex; flex-direction: column; gap: 14px; }
.auth-panel.rooms, .auth-panel.records {
  margin: 0; background: rgba(255, 255, 255, .8); border-radius: 20px; padding: 14px;
  box-shadow: 0 10px 30px rgba(20, 70, 30, .14); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .7); color: var(--a-ink);
}
.auth-panel .records-head { font-size: 15px; margin-bottom: 8px; }
.auth-panel .records-head b { display: inline-flex; align-items: center; gap: 7px; font-weight: 900; }
.auth-panel.records > .records-tabs { display: flex; gap: 4px; margin-bottom: 8px; justify-content: flex-start; }
.auth-panel .records-tabs button { background: #eef3ea; border-radius: 9px; padding: 5px 9px; font-size: 12px; }
.auth-panel .records-tabs button.active { background: var(--a-ink); color: #fff; }
.auth-panel .rooms-list, .auth-panel .records-list { max-height: 210px; }
.auth-panel .room-card { box-shadow: none; border: 1px solid #e6eee1; border-radius: 14px; }
.auth-panel .room-card .join { background: linear-gradient(180deg, #4aa3f0, #2b7fd0); box-shadow: 0 3px 0 #1f5f9e; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #2ecc40; animation: live 1.8s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(46, 204, 64, .6); } 70%, 100% { box-shadow: 0 0 0 8px rgba(46, 204, 64, 0); } }
.auth-footer { position: relative; z-index: 1; text-align: center; color: rgba(255, 255, 255, .95); font-weight: 800; font-size: 12.5px; padding: 10px 0 calc(14px + var(--safe-bottom)); text-shadow: 0 1px 2px rgba(0, 0, 0, .3); }

@media (max-width: 1100px) {
  .auth-layout { grid-template-columns: 1fr 400px; }
  .auth-side { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .auth-layout { grid-template-columns: 1fr; max-width: 440px; gap: 16px; padding: calc(16px + var(--safe-top)) 16px 16px; }
  .auth-hero { padding-top: 0; text-align: center; }
  .auth-logo { margin: 0 auto; max-width: 260px; }
  .auth-tagline { font-size: 19px; margin: 8px 0 10px; }
  .auth-features { justify-content: center; margin-bottom: 0; }
  .auth-features li { font-size: 12.5px; padding: 6px 10px; }
  .auth-eras { display: none; }
  .auth-side { grid-template-columns: 1fr; }
  .auth-card { padding: 18px 16px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .cloud, .live-dot { animation: none; }
}

/* Ajustes finos del login */
.auth-layout { min-height: calc(100vh - 44px); align-content: center; }
.auth-eras { max-width: 240px; }
.auth-panel .records-head { flex-wrap: wrap; row-gap: 6px; }
.auth-panel .records-head b { white-space: nowrap; }
.auth-panel .rooms-online { font-weight: 700; }
.auth-panel .records-tabs { flex-wrap: nowrap; }
.auth-panel.records > .records-tabs { overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.auth-panel.records > .records-tabs::-webkit-scrollbar { display: none; }
.auth-panel .records-tabs button { flex: 0 0 auto; padding: 5px 8px; }
@media (max-width: 760px) { .auth-layout { min-height: 0; align-content: start; } }

/* ---------- Nombre de la finca ---------- */
.auth-farm em { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 700; opacity: .8; }
.farm-name { margin: 0 0 12px; text-align: left; }
.farm-name-view {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px;
  background: linear-gradient(135deg, #fff7df, #eaf7d9); border: 1px solid #e3ecd0;
}
.fn-icon { font-size: 26px; }
.fn-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.fn-text small { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.fn-text b { font-size: 18px; font-weight: 900; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fn-code { font-size: 12px; font-weight: 800; color: var(--green-dark); letter-spacing: .5px; }
.fn-edit { border: none; background: #fff; border-radius: 10px; padding: 7px 9px; cursor: pointer; font-size: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.farm-name-form { background: #fff7df; border: 1px dashed #e0c98a; border-radius: 16px; padding: 10px; }
.farm-name-form small { display: block; font-size: 12.5px; font-weight: 700; color: #7a5a12; margin-bottom: 6px; }
.farm-name-form .field { margin: 0; }
.farm-name-form .btn { flex: 0 0 auto; }
.fn-preview { display: block; font-size: 12px; font-weight: 800; color: var(--green-dark); margin-top: 5px; min-height: 14px; }
.farm-name .error:empty { display: none; }

/* ==========================================================================
   Pantalla de inicio (después de entrar)
   ========================================================================== */
.home-layout {
  position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; min-height: calc(100vh - 44px);
  padding: calc(22px + var(--safe-top)) 20px 20px; align-content: center;
  display: grid; grid-template-columns: 330px minmax(0, 1fr) 320px; gap: 20px; align-items: start;
}
.glass {
  background: rgba(255, 255, 255, .86); color: var(--a-ink, #16301b); border-radius: 24px; padding: 18px;
  box-shadow: 0 20px 50px rgba(20, 70, 30, .18), 0 2px 0 rgba(255, 255, 255, .9) inset;
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, .7);
}
.home-screen .auth-side { gap: 14px; }

/* ---- Perfil ---- */
.profile-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.profile-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.profile-name small { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: #5d6f61; }
.profile-name b { font-size: 20px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gems-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; padding: 7px 12px; border-radius: 999px; font-weight: 900; font-size: 15px; color: #6a1fb0; background: linear-gradient(135deg, #f6e9ff, #ead4ff); box-shadow: inset 0 0 0 1px #dcc2f5; }
.preview-wrap { border-radius: 18px; overflow: hidden; background: radial-gradient(circle at 50% 30%, #f3fbe8, #cdeab0 70%, #b7dd98); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8); }
.home-profile .preview { height: 260px; background: none; border-radius: 0; }
.profile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.profile-foot { display: flex; gap: 8px; margin-top: 8px; }
.profile-foot > * { flex: 1; }

/* Botones redondeados de la pantalla de inicio */
.hbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: none; border-radius: 14px;
  padding: 12px 14px; font: inherit; font-weight: 900; font-size: 15px; color: #fff; cursor: pointer; text-decoration: none;
  transition: transform .08s, filter .15s, box-shadow .08s;
}
.hbtn:hover { filter: brightness(1.05); }
.hbtn:active { transform: translateY(3px); box-shadow: none !important; }
.hbtn.purple { background: linear-gradient(180deg, #a35ad6, #7b2fbf); box-shadow: 0 4px 0 #58208a; }
.hbtn.orange { background: linear-gradient(180deg, #ffb13b, #f08a00); box-shadow: 0 4px 0 #b06400; }
.hbtn.blue { background: linear-gradient(180deg, #4aa3f0, #2b7fd0); box-shadow: 0 4px 0 #1f5f9e; }
.hbtn.ghost { background: #eef3ea; color: #3f5244; box-shadow: 0 3px 0 #d5dfd0; }

/* ---- Tu finca ---- */
.home-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.farm-head { display: flex; align-items: center; gap: 12px; }
.farm-emoji { width: 54px; height: 54px; display: grid; place-items: center; font-size: 30px; border-radius: 16px; background: linear-gradient(135deg, #fff2c6, #ffd98a); box-shadow: inset 0 0 0 1px #f3d58a; }
.farm-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.farm-title small { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: #5d6f61; }
.farm-title b { font-size: 24px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.farm-title .fn-code { font-size: 12.5px; font-weight: 800; color: #2b8f3b; }
.farm-card .fn-edit { flex: 0 0 auto; }
.farm-card .farm-name-form { margin-top: 12px; }
.farm-progress { margin: 16px 0 14px; }
.fp-row { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 800; color: #3f5244; margin-bottom: 6px; }
.fp-bar { height: 12px; border-radius: 999px; background: #e6eee1; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .08); }
.fp-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #7ed957, #2f9a35); transition: width .6s cubic-bezier(.3, 1, .4, 1); }
.fp-eras { display: flex; justify-content: space-between; gap: 3px; margin-top: 10px; }
.fp-eras span { flex: 1; aspect-ratio: 1; max-width: 34px; display: grid; place-items: center; font-size: 15px; border-radius: 10px; background: #f0f4ec; opacity: .55; }
.fp-eras span.done { opacity: 1; background: #e4f5da; }
.fp-eras span.now { opacity: 1; background: linear-gradient(135deg, #fff2c6, #ffd98a); box-shadow: 0 0 0 2px #f5b400; transform: scale(1.12); }
.play-btn {
  width: 100%; border: none; border-radius: 18px; padding: 14px 16px; cursor: pointer; color: #fff; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 2px; font: inherit;
  background: linear-gradient(180deg, #5cc94a, #2f9a35); box-shadow: 0 6px 0 #23782a, 0 14px 26px rgba(40, 140, 50, .3);
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.play-btn:hover { filter: brightness(1.05); }
.play-btn:active { transform: translateY(5px); box-shadow: 0 1px 0 #23782a; }
.play-btn .pb-main { font-size: 20px; font-weight: 900; letter-spacing: .2px; }
.play-btn .pb-sub { font-size: 12.5px; font-weight: 700; opacity: .9; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.opt-btn {
  display: flex; align-items: center; gap: 9px; text-align: left; border: 2px solid #e3ecd8; border-radius: 16px; padding: 9px 10px;
  background: #fff; cursor: pointer; font: inherit; color: #16301b; transition: border-color .15s, background .15s;
}
.opt-btn.on { border-color: #9ad66a; background: #f3fae9; }
.opt-btn.hard { border-color: #ffb13b; background: #fff6e6; }
.ob-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; font-size: 18px; border-radius: 10px; background: #f0f4ec; }
.ob-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.ob-text small { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: #5d6f61; }
.ob-text b { font-size: 12.5px; font-weight: 800; }
.ob-switch { flex: 0 0 auto; width: 38px; height: 22px; border-radius: 999px; background: #cfd8c9; position: relative; transition: background .2s; }
.ob-switch i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.opt-btn.on .ob-switch { background: #3fae3a; }
.opt-btn.on .ob-switch i { transform: translateX(16px); }
.opt-btn.hard .ob-switch { background: #f08a00; }

/* ---- Unirse ---- */
.join-head { display: flex; flex-direction: column; line-height: 1.25; margin-bottom: 10px; }
.join-head b { font-size: 16px; font-weight: 900; }
.join-head small { font-size: 12.5px; font-weight: 600; color: #5d6f61; }
.join-row { display: flex; gap: 8px; }
.join-row .auth-input { flex: 1; min-width: 0; }
.join-row .auth-input input { padding: 11px 0; }
.join-row .hbtn { flex: 0 0 auto; padding: 0 22px; }

@media (max-width: 1100px) {
  .home-layout { grid-template-columns: 300px minmax(0, 1fr); }
  .home-screen .auth-side { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .home-layout { grid-template-columns: 1fr; max-width: 460px; gap: 14px; min-height: 0; align-content: start; padding: calc(14px + var(--safe-top)) 14px 14px; }
  .home-profile .preview { height: 210px; }
  .home-screen .auth-side { grid-template-columns: 1fr; }
  .farm-title b { font-size: 21px; }
  .opts { grid-template-columns: 1fr; }
  .glass { padding: 16px; border-radius: 20px; }
}

/* ---------- Saldo y recargas ---------- */
.chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.usd-chip {
  display: inline-flex; align-items: center; gap: 5px; border: none; cursor: pointer; font: inherit; font-weight: 900; font-size: 14px;
  padding: 7px 10px 7px 12px; border-radius: 999px; color: #0b5e2e; background: linear-gradient(135deg, #e6f9ea, #c9f0d4); box-shadow: inset 0 0 0 1px #a8e0b8;
}
.usd-chip i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; background: #2f9a35; color: #fff; display: grid; place-items: center; font-size: 15px; line-height: 1; }
.usd-chip:hover { filter: brightness(1.04); }
.opt .price.usd { color: #0b5e2e; }
.pay-modal { position: fixed; inset: 0; z-index: 40; background: rgba(10, 30, 15, .55); display: flex; align-items: center; justify-content: center; padding: 14px; backdrop-filter: blur(3px); }
.pay-card { width: min(94vw, 460px); max-height: 92vh; overflow-y: auto; background: #fffdf5; color: var(--ink); border-radius: 22px; padding: 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.pay-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.pay-head b { font-size: 20px; font-weight: 900; display: block; }
.pay-head small { color: var(--muted); font-weight: 700; }
.pay-head button { border: none; background: #eef3ea; width: 36px; height: 36px; border-radius: 50%; font-size: 16px; cursor: pointer; }
.pay-balance { font-size: 15px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.pay-balance b { color: #0b5e2e; font-size: 20px; font-weight: 900; }
.pay-hint { font-size: 13.5px; font-weight: 700; color: #8a5a00; background: #fff3cd; border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; }
.pay-hint:empty { display: none; }
.pay-amounts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.pay-amount { border: 2px solid #dfe8d9; background: #fff; border-radius: 16px; padding: 12px; cursor: pointer; font: inherit; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: border-color .15s, transform .08s; }
.pay-amount:hover { border-color: #3fae3a; }
.pay-amount:active { transform: scale(.97); }
.pay-amount b { font-size: 24px; font-weight: 900; color: #0b5e2e; }
.pay-amount small { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.pay-off, .pay-wait, .pay-err { border-radius: 12px; padding: 10px 12px; font-weight: 700; font-size: 14px; }
.pay-off { background: #eef3ea; color: var(--muted); grid-column: 1 / -1; }
.pay-wait { background: #eef3ea; color: var(--muted); }
.pay-err { background: #fdecea; color: #b3261e; }
.pay-current { background: #f3fae9; border: 1px solid #c9e7b3; border-radius: 16px; padding: 12px; }
.pc-head { display: flex; justify-content: space-between; font-weight: 800; font-size: 14.5px; margin-bottom: 8px; }
.pc-ok { font-weight: 900; color: #0b5e2e; }
.pay-go { display: block; text-align: center; text-decoration: none; color: #fff; font-weight: 900; font-size: 16px; padding: 12px; border-radius: 14px; background: linear-gradient(180deg, #5cc94a, #2f9a35); box-shadow: 0 4px 0 #23782a; margin-bottom: 8px; }
.pay-current small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; line-height: 1.4; }
.pay-list { margin-top: 12px; }
.pl-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 4px; }
.pl-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center; font-size: 12.5px; font-weight: 700; padding: 6px 0; border-top: 1px solid #e3ecd8; }
.pl-row a { color: var(--blue); font-weight: 900; }
.pay-sandbox { margin-top: 10px; font-size: 12.5px; font-weight: 800; color: #8a5a00; background: #fff3cd; border-radius: 10px; padding: 6px 10px; }
.pay-foot { margin: 12px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.4; }

/* ---------- Radio ---------- */
#radioBtn.off { opacity: .55; }
.radio-panel {
  position: absolute; left: 10px; top: calc(150px + var(--safe-top)); width: 250px; pointer-events: auto; z-index: 3;
  background: var(--panel); border-radius: 14px; padding: 10px; color: #fff; display: flex; flex-direction: column; gap: 8px;
}
.radio-head { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.radio-head button { border: none; background: rgba(255, 255, 255, .15); color: #fff; border-radius: 8px; width: 26px; height: 26px; cursor: pointer; }
.radio-now { font-size: 12.5px; opacity: .9; font-weight: 700; min-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radio-row { display: flex; align-items: center; gap: 8px; }
.radio-power { border: none; border-radius: 10px; padding: 6px 9px; font-weight: 800; font-size: 12.5px; cursor: pointer; background: rgba(255, 255, 255, .18); color: #fff; white-space: nowrap; }
.radio-power.on { background: #4caf3a; }
.radio-vol { display: flex; align-items: center; gap: 4px; flex: 1; font-size: 12px; font-weight: 700; }
.radio-vol input { flex: 1; min-width: 0; accent-color: #7ed957; }
.radio-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; opacity: .75; }
.radio-stations { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.radio-stations button { display: flex; align-items: center; gap: 7px; border: none; border-radius: 10px; padding: 7px 9px; cursor: pointer; background: rgba(255, 255, 255, .12); color: #fff; font-weight: 800; font-size: 13px; text-align: left; }
.radio-stations button.active { background: #4caf3a; }
.radio-stations button small { margin-left: auto; font-weight: 700; opacity: .75; font-size: 11px; }

/* ---------- HUD compacto ---------- */
.hud-toggle {
  position: absolute; left: 10px; top: calc(10px + var(--safe-top)); width: 38px; height: 38px; border-radius: 12px; border: none;
  background: var(--panel); color: #fff; font-size: 18px; font-weight: 900; pointer-events: auto; cursor: pointer; z-index: 4;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.top .col:not(.right) { padding-top: 44px; }
@media (max-width: 560px) { .top .col:not(.right) { padding-top: 0; } }
#hud.compact .top, #hud.compact #guideText, #hud.compact #hint, #hud.compact #playersPanel, #hud.compact #statsPanel { display: none !important; }
#hud.compact #emoteMenu { right: 76px; bottom: calc(82px + var(--safe-bottom)); } /* los gestos siguen funcionando con los menús ocultos */
#hud.compact .round-btn { width: 50px; height: 50px; font-size: 22px; border-width: 3px; }
#hud.compact #emoteBtn { bottom: calc(82px + var(--safe-bottom)); }

/* ---------- Miniaturas de la tienda ---------- */
.opt .thumb { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; margin: -4px auto 4px; border-radius: 10px; background: radial-gradient(circle at 50% 40%, #ffffff, #e9f3dd 80%); }
.opt.locked .thumb { filter: saturate(.6); opacity: .85; }
.options { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); max-height: 340px; }

/* ---------- Avisos (campanita) ---------- */
.bell { position: relative; border: none; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1px #e3ecd8; font-size: 17px; }
.bell i { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #e53935; color: #fff; font-size: 11px; font-weight: 900; font-style: normal; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
.inbox-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.inbox-item { background: #f5f9ef; border-radius: 14px; padding: 10px 12px; }
.inbox-item.new { background: #e8f7df; box-shadow: inset 0 0 0 2px #9ad66a; }
.inbox-item b { display: block; font-size: 15px; }
.inbox-item p { margin: 4px 0 6px; font-size: 13.5px; line-height: 1.4; }
.inbox-item small { color: var(--muted); font-weight: 700; }
.inbox-link { border: none; background: none; color: var(--blue); font: inherit; font-weight: 900; cursor: pointer; padding: 0; }
/* Dentro de la app: respetar la zona segura del teléfono */
html.native .auth-layout, html.native .home-layout { padding-top: calc(28px + var(--safe-top)); }

/* ---------- Vida del jugador ---------- */
.hp-bar { position: absolute; top: calc(82px + var(--safe-top)); left: 50%; transform: translateX(-50%); width: 160px; height: 16px; border-radius: 9px; background: rgba(0, 0, 0, .45); overflow: hidden; box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
.hp-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #66bb6a, #43a047); transition: width .3s, background .3s; }
.hp-bar.mid i { background: linear-gradient(90deg, #ffb300, #f57c00); }
.hp-bar.low i { background: linear-gradient(90deg, #ff5252, #d50000); animation: hpblink .8s infinite; }
@keyframes hpblink { 50% { opacity: .55; } }
.hp-bar span { position: absolute; inset: 0; font-size: 11px; font-weight: 900; text-align: center; line-height: 16px; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
@media (max-width: 560px) { .hp-bar { top: calc(78px + var(--safe-top)); width: 130px; } .top { top: calc(104px + var(--safe-top)); } }
#hurtFx { position: fixed; inset: 0; pointer-events: none; z-index: 12; box-shadow: inset 0 0 0 rgba(255, 0, 0, 0); }
#hurtFx.on { animation: hurt .55s ease-out; }
@keyframes hurt { 15% { box-shadow: inset 0 0 160px rgba(255, 0, 0, .8); } 100% { box-shadow: inset 0 0 0 rgba(255, 0, 0, 0); } }
.death-card { text-align: center; }
.death-icon { font-size: 56px; line-height: 1; margin: 6px 0 8px; }
.death-title { display: block; font-size: 24px; font-weight: 900; margin-bottom: 4px; }
.death-card p { margin: 0 0 16px; color: var(--muted); font-weight: 700; line-height: 1.4; }

/* La barra de vida va encima del texto guía: bajamos un poco el texto */
.hp-bar { width: 180px; height: 18px; }
.hp-bar span { line-height: 18px; font-size: 12px; }
.guide { top: calc(108px + var(--safe-top)) !important; }
@media (max-width: 560px) { .guide { top: calc(158px + var(--safe-top)) !important; } }

/* ---------- Mochila ---------- */
.mini-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; margin-left: 5px; border-radius: 9px; background: #e53935; color: #fff; font-size: 11px; font-weight: 900; font-style: normal; }
.profile-foot { flex-wrap: wrap; }
.bp-card { width: min(96vw, 620px); }
.bp-tabs { margin-bottom: 10px; }
.bp-hint { font-size: 12.5px; color: var(--muted); font-weight: 600; margin: 0 0 8px; }
.bp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 42vh; overflow-y: auto; padding: 2px; }
.bp-grid.small { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); max-height: 26vh; }
.bp-item { position: relative; border: 3px solid transparent; background: #f2f7ec; border-radius: 14px; padding: 6px; cursor: pointer; text-align: center; font-size: 12px; font-weight: 800; color: var(--ink); }
.bp-item img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 10px; background: radial-gradient(circle at 50% 40%, #fff, #e9f3dd 80%); }
.bp-item .bp-emoji { display: grid; place-items: center; aspect-ratio: 1; font-size: 34px; border-radius: 10px; background: radial-gradient(circle at 50% 40%, #fff, #e9f3dd 80%); }
.bp-item .usd { position: absolute; top: 4px; right: 4px; font-size: 13px; }
.bp-item.locked { opacity: .55; cursor: default; }
.bp-item.sel { border-color: #7b2fbf; background: #f3e8ff; }
.bp-send { margin-top: 10px; background: #f8f3ff; border-radius: 16px; padding: 10px; }
.bp-sel { font-size: 13px; font-weight: 800; margin-bottom: 6px; }
.bp-offer { background: #f5f9ef; border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; }
.bp-offer .who { font-weight: 900; font-size: 14px; }
.bp-offer .things { font-size: 13px; margin: 4px 0; line-height: 1.5; }
.bp-offer .msg { font-size: 12.5px; color: var(--muted); font-style: italic; }
.bp-offer .row { margin-top: 6px; }
.bp-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 10px 0 6px; }
.decor-row { display: flex; align-items: center; gap: 6px; }
.decor-row span { flex: 1; font-weight: 800; font-size: 13px; }
.decor-row button { border: none; border-radius: 8px; padding: 5px 8px; font-weight: 800; font-size: 12px; cursor: pointer; background: #4caf3a; color: #fff; }
.decor-row button.rm { background: rgba(255, 255, 255, .2); }

.auth-remember { display: flex; align-items: center; gap: 8px; margin: -2px 0 12px 3px; font-size: 14px; font-weight: 700; color: var(--a-muted, #5d6f61); cursor: pointer; user-select: none; }
.auth-remember input { width: 20px; height: 20px; accent-color: #3fae3a; cursor: pointer; }

/* ---------- Recuperar cuenta / PIN ---------- */
.auth-pin em { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 700; opacity: .8; }
.auth-link { display: block; margin: 10px auto 0; border: none; background: none; color: #2b7fd0; font: inherit; font-weight: 800; font-size: 13.5px; cursor: pointer; }
.recover, .pin-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; background: #f3f7ff; border-radius: 16px; padding: 12px; }
.recover small, .pin-form small { color: var(--muted, #5d6f61); font-weight: 600; font-size: 12.5px; }
.recover .auth-input input, .pin-form .auth-input input { padding: 11px 0; }
.pin-form { background: #f8f3ff; margin-top: 14px; }

/* Aviso para crear el PIN de recuperación */
.pin-alert { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: linear-gradient(135deg, #fff4d6, #ffe7b0); border: 2px solid #f5c25a; box-shadow: 0 8px 24px rgba(160, 110, 0, .18); color: #5a3d00; animation: pinpulse 2.4s ease-in-out infinite; }
.pin-alert .pa-icon { font-size: 26px; }
.pin-alert .pa-text { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.pin-alert b { font-size: 15px; font-weight: 900; }
.pin-alert small { font-size: 12.5px; font-weight: 600; }
.pin-alert .hbtn { flex: 0 0 auto; padding: 10px 14px; }
@keyframes pinpulse { 50% { box-shadow: 0 8px 30px rgba(220, 150, 0, .4); } }
@media (prefers-reduced-motion: reduce) { .pin-alert { animation: none; } }

html.native .web-only { display: none; }

.danger-zone { margin-top: 14px; border-radius: 14px; background: #fff3f3; padding: 10px 12px; }
.danger-zone summary { cursor: pointer; font-weight: 800; color: #b3261e; }
.danger-zone p { font-size: 13px; color: #7a2e2a; margin: 8px 0; }
.danger-zone .hbtn { width: 100%; margin-top: 8px; background: #c62828; color: #fff; box-shadow: 0 3px 0 #8e1b1b; }
.auth-footer a { color: inherit; }

.records-list .farm-link { border: none; background: #eaf6e2; color: #1f6b33; font: inherit; padding: 2px 8px; border-radius: 999px; cursor: pointer; }
.records-list .farm-link:hover { background: #d6efc8; }
.records-list .farm-link .go { font-size: 11px; font-weight: 800; color: #2f9a35; }

/* ---------- Móvil del personaje: contactos e invitaciones ---------- */
#phoneBtn { right: 16px; bottom: calc(164px + var(--safe-bottom)); background: #2c3e50; }
#hud.compact #phoneBtn { bottom: calc(144px + var(--safe-bottom)); }
#phoneBtn .mini-badge { position: absolute; top: -6px; right: -6px; margin: 0; }
.phone-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(10, 20, 10, .45); padding: 12px; }
.phone {
  position: relative; width: min(360px, 94vw); height: min(680px, 88vh); border-radius: 42px; background: #111;
  padding: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.5), inset 0 0 0 2px #333; display: flex; flex-direction: column;
  animation: phoneUp .28s ease-out;
}
@keyframes phoneUp { from { transform: translateY(40px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.phone-notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 92px; height: 24px; border-radius: 14px; background: #000; z-index: 2; }
.phone-status { display: flex; justify-content: space-between; padding: 8px 26px 4px; font-size: 13px; font-weight: 800; color: #fff; background: #1b2a3a; border-radius: 32px 32px 0 0; }
.phone-body { flex: 1; min-height: 0; background: #f4f7fb; color: #1d2a17; display: flex; flex-direction: column; border-radius: 0 0 32px 32px; overflow: hidden; }
.phone-homebar { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); width: 120px; height: 6px; border-radius: 3px; background: rgba(0,0,0,.35); border: none; cursor: pointer; padding: 0; }
.phone-wall { flex: 1; background: linear-gradient(180deg, #1b2a3a, #3a8fd8 60%, #7fd0ff); color: #fff; padding: 26px 18px; display: flex; flex-direction: column; }
.phone-date { text-align: center; font-weight: 800; text-transform: capitalize; opacity: .9; margin-bottom: 26px; }
.phone-apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.phone-app { background: none; border: none; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; cursor: pointer; }
.phone-app .ico { position: relative; width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; font-size: 30px; box-shadow: 0 4px 10px rgba(0,0,0,.25); }
.phone-app .ico.green { background: linear-gradient(180deg, #5ee07a, #1f9a45); }
.phone-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; border-radius: 10px; background: #e53935; color: #fff; font-size: 12px; font-style: normal; display: grid; place-items: center; padding: 0 5px; }
.phone-hint { margin-top: auto; text-align: center; font-size: 13px; font-weight: 700; background: rgba(0,0,0,.2); border-radius: 12px; padding: 8px; }
.phone-app-head { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; padding: 10px 8px; background: #fff; border-bottom: 1px solid #e3e8ef; text-align: center; font-size: 17px; }
.phone-app-head button { background: none; border: none; font-size: 30px; line-height: 1; color: #3a8fd8; cursor: pointer; }
.friend-form { display: flex; gap: 6px; padding: 10px; background: #fff; }
.friend-form input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 2px solid #dfe8d9; font-size: 15px; }
.phone-msg { font-size: 12.5px; font-weight: 700; padding: 0 12px; min-height: 0; }
.phone-msg.ok { color: #2f9a35; padding: 6px 12px; }
.phone-msg.err { color: #c62828; padding: 6px 12px; }
.phone-scroll { flex: 1; overflow-y: auto; padding-bottom: 30px; }
.phone-sec { font-size: 11.5px; font-weight: 900; color: #6b7a8c; text-transform: uppercase; letter-spacing: .4px; padding: 12px 14px 4px; }
.contacts { list-style: none; margin: 0; padding: 0 8px; }
.contact { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 9px 10px; margin: 6px 0; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.contact.empty { color: #6b7a8c; font-size: 13px; justify-content: center; }
.avatar-dot { position: relative; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; background: #c9d6e3; color: #1b2a3a; font-weight: 900; display: grid; place-items: center; }
.contact.on .avatar-dot { background: #bdf0c7; }
.avatar-dot i { position: absolute; bottom: 0; right: 0; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; background: #b0b8c2; }
.contact.on .avatar-dot i { background: #2ecc71; }
.contact-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.contact-info b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-info small { font-size: 12px; color: #5b6b7a; }
.contact-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.pbtn { border: none; border-radius: 10px; padding: 7px 10px; font-weight: 800; font-size: 12.5px; cursor: pointer; color: #fff; }
.pbtn.green { background: #2f9a35; }
.pbtn.blue { background: #3a8fd8; }
.pbtn.off { background: #9aa5b1; }
.pbtn.ghost { background: #eef1f5; color: #5b6b7a; }
.pbtn:disabled { opacity: .7; cursor: default; }
.invite-card {
  position: fixed; z-index: 70; left: 50%; top: calc(12px + var(--safe-top)); transform: translateX(-50%); width: min(360px, 92vw);
  background: #fff; color: #1d2a17; border-radius: 18px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35); animation: phoneUp .25s ease-out;
}
.invite-title { font-weight: 900; font-size: 15px; }
.invite-sub { font-size: 13.5px; margin: 4px 0 10px; color: #3d4b38; }
.invite-actions { display: flex; justify-content: flex-end; gap: 8px; }
.invite-actions .pbtn { padding: 9px 16px; font-size: 14px; }
/* ---- Intercambios en Contactos (propuestas y pantalla de propuesta) ---- */
.pbtn.purple { background: #7b2fbf; }
.pbtn.big { display: block; width: calc(100% - 24px); margin: 10px 12px 0; padding: 12px; font-size: 15px; }
.contact.offer { flex-direction: column; align-items: stretch; gap: 6px; }
.offer-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; }
.offer-head small { color: #6b7a8c; font-size: 11px; white-space: nowrap; }
.offer-body { font-size: 12.5px; color: #3d4b38; display: flex; flex-direction: column; gap: 3px; }
.offer-item { display: inline-flex; align-items: center; gap: 3px; background: #f2f7ec; border-radius: 8px; padding: 1px 6px 1px 2px; margin: 1px 2px 1px 0; font-weight: 800; color: #1d2a17; }
.offer-item img { width: 22px; height: 22px; object-fit: contain; border-radius: 6px; }
.offer-item i { font-style: normal; font-size: 15px; margin-left: 3px; }
.offer-price { font-weight: 900; color: #1b2a3a; }
.offer-price.pay { color: #b3261e; }
.offer-price.get { color: #2f9a35; }
.offer-msg { font-style: italic; color: #5b6b7a; }
.offer-actions { display: flex; justify-content: flex-end; align-items: center; gap: 6px; flex-wrap: wrap; }
.offer-wait { margin-right: auto; font-size: 12px; color: #6b7a8c; font-weight: 700; }
.trade-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 12px; }
.trade-grid .bp-item { font-size: 11px; padding: 4px; border-radius: 12px; }
.trade-hint { font-size: 12.5px; color: #6b7a8c; padding: 2px 14px; }
.trade-money { padding: 0 12px; display: flex; flex-direction: column; gap: 8px; }
.seg3 { display: grid; grid-template-columns: repeat(3, 1fr); background: #e6ebf2; border-radius: 12px; padding: 3px; gap: 3px; }
.seg3 button { border: none; background: none; border-radius: 10px; padding: 8px 4px; font-weight: 800; font-size: 12.5px; color: #5b6b7a; cursor: pointer; }
.seg3 button.on { background: #fff; color: #1b2a3a; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.trade-amount { display: flex; align-items: center; gap: 8px; }
.trade-amount input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 2px solid #dfe8d9; font-size: 16px; font-weight: 800; }
.trade-amount span { font-weight: 800; color: #5b6b7a; font-size: 13px; }
.trade-payer { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; }
.trade-payer label { display: flex; align-items: center; gap: 6px; }
.trade-wallet { font-size: 12px; color: #6b7a8c; }
.trade-msg { display: block; margin: 10px 12px 0; width: calc(100% - 24px); box-sizing: border-box; padding: 10px 12px; border-radius: 12px; border: 2px solid #dfe8d9; font-size: 14px; }
.trade-summary { margin: 8px 12px 0; font-size: 13px; font-weight: 700; color: #1b2a3a; background: #fff; border-radius: 12px; padding: 8px 10px; }
.bp-price select { min-width: 0; }
.home-notice { position: fixed; z-index: 65; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0; transition: .25s; background: rgba(20,30,15,.9); color: #fff; padding: 10px 16px; border-radius: 14px; font-weight: 700; pointer-events: none; max-width: 90vw; text-align: center; }
.home-notice.show { opacity: 1; transform: translateX(-50%); }
.players-panel .row button + button { margin-left: 4px; }
.players-panel .owner-acts { justify-content: flex-end; margin-top: -2px; }
.players-panel .owner-acts button { font-size: 12px; padding: 4px 8px; }
.players-panel .bans { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid rgba(0,0,0,.12); padding-top: 6px; margin-top: 2px; max-height: 160px; overflow-y: auto; }

/* ==========================================================================
   Rediseño 2026 · login con paisaje pintado
   ========================================================================== */
.auth-screen { background: #9ad66a; }
.auth-sky {
  position: fixed; inset: 0; pointer-events: none;
  background: #f3c98a url("../img/bg/login-wide.jpg") center 40% / cover no-repeat;
  background-image: image-set(url("../img/bg/login-wide.webp") type("image/webp"), url("../img/bg/login-wide.jpg") type("image/jpeg"));
}
/* Velo suave para que se lean los textos (más oscuro a la izquierda, detrás del lema) */
.auth-sky::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(18, 48, 12, .38) 0%, rgba(18, 48, 12, .12) 32%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, .05) 100%),
              linear-gradient(180deg, rgba(0, 0, 0, 0) 60%, rgba(20, 40, 10, .25) 100%);
}
@media (max-aspect-ratio: 4/5) {
  .auth-sky {
    background-image: url("../img/bg/login-tall.jpg");
    background-image: image-set(url("../img/bg/login-tall.webp") type("image/webp"), url("../img/bg/login-tall.jpg") type("image/jpeg"));
    background-position: center top;
  }
  .auth-sky::after { background: linear-gradient(180deg, rgba(10, 30, 60, .18) 0%, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0) 70%, rgba(20, 40, 10, .3) 100%); }
}

/* Presentación (izquierda) */
.auth-hero { color: #fff; }
.auth-logo { max-width: 420px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .35)); }
.auth-tagline {
  font-size: 40px; line-height: 1.08; margin: 18px 0 8px; letter-spacing: -.6px; color: #fff;
  text-shadow: 0 3px 0 rgba(20, 50, 10, .55), 0 6px 18px rgba(0, 0, 0, .35);
}
.auth-tagline span {
  display: inline-block; position: relative; background: none; -webkit-background-clip: initial; background-clip: initial;
  color: #ffc832; font-style: italic; transform: rotate(-2deg); padding-bottom: 4px;
}
.auth-tagline span::after {
  content: ""; position: absolute; left: 4%; right: -2%; bottom: -2px; height: 7px; border-radius: 6px;
  background: linear-gradient(90deg, #ff9f1a, #ffd23f); transform: rotate(-1.5deg); box-shadow: 0 2px 4px rgba(0, 0, 0, .25);
}
.auth-lead { margin: 10px 0 18px; font-size: 19px; font-weight: 800; color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, .55); }
.auth-features li {
  background: rgba(255, 252, 240, .94); color: #1f4d22; font-size: 15px; padding: 10px 16px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}
.auth-features i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #e3f4d6; font-size: 14px; }

/* Tarjeta de entrada (centro) */
.auth-card {
  position: relative; background: rgba(255, 252, 244, .93); border: 2px solid rgba(255, 255, 255, .85);
  border-radius: 30px; padding: 26px 26px 18px; box-shadow: 0 30px 70px rgba(30, 40, 10, .35), inset 0 2px 0 #fff;
}
.auth-card::before, .auth-card::after { content: "🌿"; position: absolute; font-size: 26px; opacity: .55; pointer-events: none; }
.auth-card::before { top: 10px; left: 14px; transform: rotate(-30deg); }
.auth-card::after { bottom: 10px; right: 14px; transform: rotate(150deg); }
.auth-title { text-align: center; font-size: 34px; color: #183d1b; letter-spacing: -.8px; margin-top: 4px; }
.auth-subtitle { text-align: center; font-size: 16px; margin: 2px 0 18px; }
.auth-card .seg { order: 0; background: #eef3e6; border-radius: 18px; padding: 5px; margin: 0 0 20px; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 15.5px; padding: 11px 10px; }
.seg button svg { width: 18px; height: 18px; fill: currentColor; }
.seg button.active { color: #fff; }
.seg-pill { background: linear-gradient(180deg, #45b83f, #2a8a2f); border-radius: 14px; box-shadow: 0 3px 0 #1f6b23, 0 6px 14px rgba(40, 120, 40, .3); }
.auth-label { color: #3d5a3f; }
.auth-input { border-radius: 16px; background: #fff; border-color: #e3e9dc; }
.auth-input input { padding: 14px 0; }
.auth-remember input { accent-color: #2f9a35; width: 20px; height: 20px; }
.auth-submit {
  border-radius: 18px; padding: 17px; font-size: 19px;
  background: linear-gradient(180deg, #63d04f, #2e9434); box-shadow: 0 6px 0 #20702a, 0 14px 26px rgba(40, 140, 50, .35);
}
.auth-submit span::before { content: "🌱 "; }
.auth-link { display: block; margin: 12px auto 0; color: #2b78c9; font-weight: 800; }
.auth-foot { color: #5f7360; margin-top: 10px; }

/* Paneles de la derecha */
.auth-panel.rooms, .auth-panel.records, .auth-panel.online-panel {
  margin: 0; background: rgba(255, 252, 244, .92); border-radius: 24px; padding: 14px 16px;
  box-shadow: 0 16px 40px rgba(30, 40, 10, .25); border: 2px solid rgba(255, 255, 255, .85); color: #183d1b;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.online-panel .records-head b { text-transform: uppercase; font-size: 14px; letter-spacing: .4px; }
.online-faces { display: flex; gap: 6px; margin: 6px 0 8px; min-height: 52px; flex-wrap: wrap; }
.online-faces .face {
  width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 21px; color: #fff;
  border: 3px solid #7ccf4a; box-shadow: 0 3px 8px rgba(0, 0, 0, .18); text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.online-faces .face.more { background: #eef3e6; color: #3d5a3f; font-size: 15px; text-shadow: none; }
.online-note { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #4a6a4c; }
.online-note .live-dot { flex: 0 0 auto; }

.auth-panel .rooms-list { max-height: 300px; gap: 8px; }
.room-card {
  width: 100%; text-align: left; font: inherit; cursor: pointer; border: 1px solid #ebe6d6 !important; background: #fff;
  border-radius: 18px; padding: 8px; gap: 10px; transition: transform .12s, box-shadow .12s;
}
.room-card:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(30, 60, 20, .15); }
.room-card:disabled { opacity: .65; cursor: default; }
.room-thumb {
  flex: 0 0 auto; width: 92px; height: 62px; border-radius: 12px; background: #9ad66a url("../img/bg/login-wide.jpg") no-repeat;
  background-size: 420%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}
.room-card .info { display: flex; flex-direction: column; gap: 2px; }
.room-card .title { font-size: 15px; color: #183d1b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-card .sub { font-size: 11.5px; color: #6a7a68; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-chips { display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.room-chips .lvl { background: #2f9a35; color: #fff; font-weight: 900; font-size: 12px; padding: 3px 9px; border-radius: 8px; }
.room-chips .cnt { font-weight: 800; font-size: 12.5px; color: #3d5a3f; }
.room-chips .full { background: #fdecea; color: #b3261e; font-weight: 900; font-size: 11px; padding: 2px 7px; border-radius: 8px; }
.room-card .go { font-size: 26px; color: #9fb39a; font-weight: 900; padding-right: 4px; }

.auth-footer { text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.auth-footer a { color: #fff; }

@media (max-width: 1100px) {
  .auth-tagline { font-size: 32px; }
}
@media (max-width: 760px) {
  .auth-hero { padding-top: 6px; }
  .auth-logo { max-width: 280px; }
  .auth-tagline { font-size: 25px; margin: 10px 0 4px; }
  .auth-lead { font-size: 15px; margin: 4px 0 10px; }
  .auth-features li { font-size: 12.5px; padding: 7px 11px; }
  .auth-features i { width: 22px; height: 22px; font-size: 12px; }
  .auth-card { padding: 20px 16px 14px; border-radius: 26px; }
  .auth-title { font-size: 27px; }
  .online-faces .face { width: 42px; height: 42px; font-size: 18px; }
}
/* Ajustes del rediseño */
.auth-layout { max-width: 1400px; grid-template-columns: minmax(0, 1.25fr) 430px minmax(0, .95fr); gap: 30px; }
.auth-layout > * { min-width: 0; }
.auth-tagline br + span { margin-top: 2px; }
.auth-subtitle { margin-bottom: 16px; }
.auth-eye { display: grid; place-items: center; }
.auth-eye svg { width: 22px; height: 22px; fill: #7a8f76; }
.auth-eye.on svg { fill: #2f9a35; }
.auth-features { flex-wrap: nowrap; }
@media (max-width: 1100px) {
  .auth-layout { grid-template-columns: minmax(0, 1fr) 420px; }
  .auth-features { flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .auth-layout { grid-template-columns: minmax(0, 1fr); max-width: 460px; }
  .auth-tagline br { display: none; }
  .auth-features { flex-wrap: wrap; }
}

.room-card .info { align-items: flex-start; text-align: left; }
.room-card .info > span { max-width: 100%; }
.room-thumb { background-size: 260%; }

/* ==========================================================================
   Rediseño 2026 · pantalla de inicio
   ========================================================================== */
.home-screen .auth-sky::after { background: linear-gradient(180deg, rgba(0, 0, 0, .04), rgba(0, 0, 0, 0) 40%, rgba(20, 40, 10, .25)); }
.home-top {
  position: relative; z-index: 1; max-width: 1400px; margin: 0 auto; padding: calc(16px + var(--safe-top)) 24px 0;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.home-logo { width: min(360px, 52vw); filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .3)); }
.wood-sign {
  position: relative; display: flex; flex-direction: column; align-items: center; padding: 10px 22px 12px; margin-top: 18px;
  font-weight: 900; font-size: 20px; line-height: 1.1; color: #fff3d6; transform: rotate(3deg);
  background: repeating-linear-gradient(180deg, #a8672f 0 22px, #93561f 22px 24px), #a8672f; border-radius: 10px;
  border: 3px solid #6e3d13; box-shadow: 0 10px 20px rgba(0, 0, 0, .3), inset 0 2px 0 rgba(255, 255, 255, .2); text-shadow: 0 2px 0 #5a300c;
}
.wood-sign::before, .wood-sign::after { content: ""; position: absolute; top: -26px; width: 6px; height: 28px; background: #6e3d13; border-radius: 3px; }
.wood-sign::before { left: 26px; }
.wood-sign::after { right: 26px; }
.wood-sign i { font-style: normal; color: #ff5a5a; }
.home-screen .home-layout { max-width: 1400px; min-height: 0; padding-top: 14px; grid-template-columns: 320px minmax(0, 1fr) 340px; align-content: start; }
.home-screen .glass { background: rgba(255, 252, 244, .93); border: 2px solid rgba(255, 255, 255, .85); border-radius: 26px; box-shadow: 0 20px 50px rgba(30, 40, 10, .3); }

/* Perfil */
.home-profile { position: relative; padding: 14px; }
.home-profile .profile-top { justify-content: flex-start; margin-bottom: 10px; }
.me-face { position: relative; width: 46px; height: 46px; flex: 0 0 auto; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #cfe8c0; border: 3px solid #fff; box-shadow: 0 0 0 2px #7ccf4a; font-weight: 900; color: #1f4d22; }
.me-face img { width: 100%; height: 100%; object-fit: cover; }
.profile-name b { font-size: 19px; color: #183d1b; }
.profile-name small { display: flex; align-items: center; gap: 5px; text-transform: none; letter-spacing: 0; font-size: 12.5px; color: #2f9a35; }
.dot-on { width: 9px; height: 9px; border-radius: 50%; background: #2ecc40; box-shadow: 0 0 0 3px rgba(46, 204, 64, .2); }
.home-profile .preview-wrap {
  border-radius: 18px; background: #9ad66a url("../img/bg/tienda.jpg") no-repeat; background-size: cover; background-position: 50% 82%;
  background-image: image-set(url("../img/bg/tienda.webp") type("image/webp"), url("../img/bg/tienda.jpg") type("image/jpeg"));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7);
}
.home-profile .preview { height: 240px; }
.me-level { display: flex; align-items: center; gap: 10px; margin: 12px 2px 8px; }
.lvl-star { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(180deg, #2f8a3a, #1d5e27); color: #ffd23f; font-size: 22px; box-shadow: 0 3px 0 #164a1e; }
.lvl-info { flex: 1; min-width: 0; }
.lvl-row { display: flex; justify-content: space-between; align-items: baseline; }
.lvl-row b { font-size: 16px; color: #183d1b; }
.lvl-row small { font-weight: 800; color: #5d6f61; }
.lvl-bar { height: 9px; border-radius: 99px; background: #e6eee1; overflow: hidden; margin-top: 4px; }
.lvl-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7ed957, #2f9a35); border-radius: 99px; transition: width .6s; }
.me-money { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.me-money .gems-chip, .me-money .usd-chip { justify-content: center; padding: 9px 10px; border-radius: 14px; font-size: 16px; background: #fff; color: #183d1b; box-shadow: inset 0 0 0 2px #ebe6d6; }
.me-money .coin { font-size: 17px; }
.me-money .usd-chip b { color: #0b5e2e; }
.big-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: none; border-radius: 18px; padding: 12px 8px;
  font: inherit; font-weight: 900; font-size: 15px; color: #fff; cursor: pointer; transition: transform .08s, filter .15s;
}
.big-tile span { font-size: 24px; line-height: 1; }
.big-tile.purple { background: linear-gradient(180deg, #a35ad6, #7b2fbf); box-shadow: 0 5px 0 #58208a; }
.big-tile.orange { background: linear-gradient(180deg, #ffb13b, #f08a00); box-shadow: 0 5px 0 #b06400; }
.big-tile:hover { filter: brightness(1.06); }
.big-tile:active { transform: translateY(4px); box-shadow: none; }
.tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; border: none; border-radius: 16px; padding: 10px 4px 9px;
  background: #fff; box-shadow: 0 3px 0 #e3dccb, inset 0 0 0 1px #efe9da; font: inherit; font-size: 12.5px; font-weight: 800; color: #2e4a31; cursor: pointer;
  transition: transform .08s, background .15s;
}
.tile:hover { background: #fbfff5; }
.tile:active { transform: translateY(2px); box-shadow: none; }
.tile .ti { width: 38px; height: 38px; display: grid; place-items: center; font-size: 21px; border-radius: 12px; background: linear-gradient(180deg, #e9f6df, #d3ecc2); }
.tile.soon { opacity: .75; }
.tile-badge { position: absolute; top: 4px; right: 10px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #e53935; color: #fff; font-size: 11.5px; font-weight: 900; font-style: normal; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
.settings-menu { position: absolute; z-index: 5; left: 14px; right: 14px; bottom: 74px; background: #fff; border-radius: 16px; padding: 6px; box-shadow: 0 16px 40px rgba(0, 0, 0, .25); display: flex; flex-direction: column; }
.set-row { border: none; background: none; text-align: left; font: inherit; font-weight: 800; font-size: 15px; padding: 12px; border-radius: 12px; color: #183d1b; cursor: pointer; text-decoration: none; }
.set-row:hover { background: #f1f6ec; }
.set-row.danger { color: #c62828; }

/* Tu finca */
.home-screen .farm-card { padding: 18px 20px; }
.farm-emoji { width: 62px; height: 62px; font-size: 34px; border-radius: 18px; }
.farm-title b { font-size: 30px; color: #183d1b; letter-spacing: -.5px; }
.farm-title small { text-transform: none; font-size: 13px; letter-spacing: 0; }
.fn-code-row { display: inline-flex; align-items: center; gap: 6px; }
.fn-copy { border: none; background: #eef6e8; color: #2f9a35; border-radius: 8px; width: 26px; height: 24px; cursor: pointer; font-size: 14px; font-weight: 900; }
.farm-progress { margin: 14px 0 12px; }
.fp-row { font-size: 15px; color: #183d1b; }
.fp-bar { height: 14px; }
.fp-eras span { border-radius: 12px; background: #f3efe2; font-size: 16px; }
.farm-pic {
  height: 170px; border-radius: 18px; margin-bottom: 14px; background: #9ad66a url("../img/bg/login-wide.jpg") no-repeat; background-size: 190%;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7), 0 6px 16px rgba(0, 0, 0, .12);
}
.play-btn { flex-direction: row; text-align: left; gap: 14px; padding: 14px 18px; border-radius: 20px; }
.pb-icon { width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; font-size: 28px; border-radius: 14px; background: rgba(255, 255, 255, .2); }
.pb-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.play-btn .pb-main { font-size: 23px; }
.pb-go { font-size: 34px; font-weight: 900; line-height: 1; opacity: .9; }
.opt-btn { border-radius: 18px; padding: 10px 12px; }
.home-screen .join-card { padding: 16px 20px; }

/* Columna derecha del inicio */
.home-screen .auth-side .auth-panel { padding: 12px 14px; }
.home-screen .rooms-list { max-height: 190px; }
.records-list .rec { display: flex; align-items: center; gap: 9px; padding: 7px 4px; border-top: 1px solid #efe9da; }
.records-list .rec:first-child { border-top: none; }
.rank { width: 26px; height: 26px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; font-weight: 900; font-size: 13px; background: #eef1ea; color: #4a5a48; }
.rank.r1 { background: linear-gradient(180deg, #ffd23f, #f0a500); color: #5a3a00; }
.rank.r2 { background: linear-gradient(180deg, #e6ecf5, #b9c6d8); color: #33415a; }
.rank.r3 { background: linear-gradient(180deg, #f6c08f, #d9894a); color: #5a2e0a; }
.records-list .face, .friends-panel .face, .online-faces .face { position: relative; overflow: hidden; }
.records-list .face { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #fff; border: 2px solid #fff; box-shadow: 0 0 0 2px #cfe8c0; }
.face.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rec-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.rec-info b { font-size: 13.5px; color: #183d1b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-info small { font-size: 12px; color: #4c6a4e; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-info .time { color: #2f8a3a; font-weight: 900; }
.rec-info .nums { font-size: 11px; color: #7a8a78; font-weight: 600; display: block; margin: 0; }
.rec-go { flex: 0 0 auto; border: none; background: #eef6e8; color: #2f9a35; width: 30px; height: 30px; border-radius: 10px; font-size: 20px; font-weight: 900; cursor: pointer; }
.rec-go:hover { background: #dff0d2; }
.records-list .farm-link.rec-go { padding: 0; }
.friends-panel .records-head { display: flex; justify-content: space-between; }
.see-all { border: none; background: none; color: #2b78c9; font-weight: 800; font-size: 12.5px; cursor: pointer; }
.fr-faces { gap: 6px; }
.fr-faces .face { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 900; border: 3px solid #7ccf4a; }
.fr-empty { font-size: 13px; color: #6a7a68; font-weight: 700; padding: 8px 0; }
.avatar-dot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-dot img + span { display: none; }

@media (max-width: 1100px) {
  .home-screen .home-layout { grid-template-columns: 300px minmax(0, 1fr); }
  .wood-sign { display: none; }
}
@media (max-width: 760px) {
  .home-top { padding: calc(10px + var(--safe-top)) 14px 0; justify-content: center; }
  .home-logo { width: min(280px, 80vw); }
  .home-screen .home-layout { grid-template-columns: minmax(0, 1fr); }
  .farm-title b { font-size: 24px; }
  .farm-pic { height: 130px; }
  .home-profile .preview { height: 210px; }
}

/* Ajustes del inicio */
.auth-panel.friends-panel {
  margin: 0; background: rgba(255, 252, 244, .92); border-radius: 24px; padding: 12px 14px;
  box-shadow: 0 16px 40px rgba(30, 40, 10, .25); border: 2px solid rgba(255, 255, 255, .85); color: #183d1b;
}
.home-profile .preview-wrap { background-size: cover; background-position: 50% 82%; }
@media (max-width: 760px) {
  .home-screen .home-main { order: -1; }
  .home-profile .preview { height: 180px; }
}

/* ==========================================================================
   Rediseño 2026 · botones de juego, tienda y HUD de la partida
   ========================================================================== */
/* ---- Botón de juego: relieve, brillo arriba, destello que pasa y "aplastado" al tocar ---- */
.gbtn, .btn, .hbtn, .big-tile, .play-btn { position: relative; overflow: hidden; isolation: isolate; }
.round-btn { isolation: isolate; } /* va en position: absolute */
.gbtn {
  --c1: #5cc94a; --c2: #2f9a35; --edge: #23782a;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: none; border-radius: 16px;
  padding: 13px 18px; font: inherit; font-weight: 900; font-size: 16px; color: #fff; cursor: pointer; letter-spacing: .2px;
  background: linear-gradient(180deg, var(--c1), var(--c2));
  box-shadow: 0 5px 0 var(--edge), 0 10px 18px rgba(20, 50, 10, .22), inset 0 -3px 0 rgba(0, 0, 0, .12);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .22);
  transition: transform .09s, box-shadow .09s, filter .15s;
}
.gbtn.small { padding: 8px 13px; font-size: 13.5px; border-radius: 12px; box-shadow: 0 4px 0 var(--edge), 0 6px 12px rgba(20, 50, 10, .18); }
.gbtn.purple { --c1: #b36ae6; --c2: #7b2fbf; --edge: #58208a; }
.gbtn.orange { --c1: #ffbe4d; --c2: #f08a00; --edge: #b06400; }
.gbtn.blue { --c1: #5db2f5; --c2: #2b7fd0; --edge: #1f5f9e; }
.gbtn.red { --c1: #f2675c; --c2: #c62828; --edge: #8e1b1b; }
.gbtn.cream { --c1: #fffaf0; --c2: #f1e6cf; --edge: #d2bf98; color: #5b4a2a; text-shadow: none; }
/* Brillo de la parte de arriba */
.gbtn::before, .btn::before, .hbtn::before, .big-tile::before, .play-btn::before, .round-btn::before {
  content: ""; position: absolute; z-index: -1; left: 6%; right: 6%; top: 3px; height: 42%; border-radius: 12px 12px 40% 40% / 12px 12px 14px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0)); pointer-events: none;
}
.round-btn::before { left: 14%; right: 14%; top: 4px; height: 45%; border-radius: 50% 50% 45% 45%; }
.gbtn.cream::before { background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0)); }
/* Destello diagonal que cruza el botón de vez en cuando */
.gbtn.green::after, .gbtn.buy::after, .play-btn::after {
  content: ""; position: absolute; z-index: -1; top: -20%; bottom: -20%; width: 34%; left: -50%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .5), rgba(255, 255, 255, 0));
  transform: skewX(-18deg); animation: shine 4.5s ease-in-out infinite; pointer-events: none;
}
.gbtn.buy::after { animation-duration: 2.6s; }
@keyframes shine { 0%, 62% { left: -50%; } 82%, 100% { left: 130%; } }
.gbtn:hover:not(:disabled) { filter: brightness(1.07) saturate(1.05); transform: translateY(-1px); }
.gbtn:active:not(:disabled) { transform: translateY(4px) scale(.98); box-shadow: 0 1px 0 var(--edge), 0 3px 6px rgba(20, 50, 10, .2); }
.gbtn:disabled { filter: grayscale(.6); opacity: .6; cursor: default; }
.gbtn:disabled::after { display: none; }

/* ---- Entradas animadas de pantallas y tarjetas ---- */
@keyframes cardIn { from { opacity: 0; transform: translateY(26px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.7); } 70% { opacity: 1; transform: scale(1.05); } 100% { transform: none; } }
@keyframes floaty { 50% { transform: translateY(-6px); } }
.screen:not(.hidden) .glass { animation: cardIn .45s cubic-bezier(.2, .9, .3, 1.1) both; }
.home-screen:not(.hidden) .home-main > .glass:nth-child(2) { animation-delay: .07s; }
.home-screen:not(.hidden) .auth-side > :nth-child(1) { animation-delay: .1s; }
.home-screen:not(.hidden) .auth-side > :nth-child(2) { animation-delay: .16s; }
.home-screen:not(.hidden) .auth-side > :nth-child(3) { animation-delay: .22s; }
.big-tile span, .tile .ti { transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.big-tile:hover span, .tile:hover .ti { transform: translateY(-3px) rotate(-6deg) scale(1.1); }
.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #e3dccb, 0 10px 18px rgba(60, 50, 20, .12), inset 0 0 0 1px #efe9da; }

/* ---- Tienda / Personalizar ---- */
.editor-screen:not(.hidden) { display: flex; align-items: center; justify-content: center; padding: calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bottom)); }
.shop-card {
  position: relative; z-index: 1; width: min(1120px, 100%); display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 22px;
  padding: 20px; color: var(--a-ink); border-radius: 28px !important; overflow: visible;
}
.shop-card::before { content: "🌿"; position: absolute; top: -14px; left: -10px; font-size: 34px; transform: rotate(-35deg); filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .2)); pointer-events: none; }
.shop-card::after { content: "🌻"; position: absolute; bottom: -16px; right: -8px; font-size: 38px; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .25)); animation: floaty 4s ease-in-out infinite; pointer-events: none; }
.shop-stage { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.stage-wrap {
  position: relative; border-radius: 22px; overflow: hidden; aspect-ratio: 4 / 5;
  background: radial-gradient(ellipse at 50% 88%, rgba(255, 240, 180, .9), rgba(255, 240, 180, 0) 45%),
              linear-gradient(180deg, #bfe6ff 0%, #e8f7ff 45%, #d8efb8 70%, #a9d878 100%);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .9), inset 0 -30px 50px rgba(60, 110, 30, .25), 0 8px 20px rgba(40, 60, 20, .15);
}
.stage-wrap .preview { position: absolute; inset: 0; width: 100%; height: 100% !important; background: none; border-radius: 0; }
.stage-glow { position: absolute; left: 50%; bottom: 8%; width: 70%; height: 14%; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0)); pointer-events: none; animation: glowPulse 3s ease-in-out infinite; }
@keyframes glowPulse { 50% { opacity: .55; transform: translateX(-50%) scale(1.08); } }
.stage-emotes { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.stage-emotes:empty { display: none; }
.stage-emotes .gbtn { flex: 1 1 auto; }
.shop-main { display: flex; flex-direction: column; min-width: 0; }
.shop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.shop-title { margin: 0; font-size: 30px; font-weight: 900; letter-spacing: -.5px; color: #183d1b; }
/* Pestañas con icono (una fila que se desliza) */
.shop-cats { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin: 0 -2px 4px; scrollbar-width: thin; scroll-snap-type: x proximity; }
.shop-cats button {
  flex: 0 0 auto; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 76px;
  border: none; border-radius: 16px; padding: 8px 10px 7px; font: inherit; font-size: 12px; font-weight: 900; color: #4a5d47; cursor: pointer;
  background: #fff; box-shadow: 0 3px 0 #e3dccb, inset 0 0 0 1px #efe9da; transition: transform .12s, background .15s, color .15s;
}
.shop-cats button i { font-style: normal; font-size: 22px; line-height: 1; transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.shop-cats button:hover { transform: translateY(-2px); }
.shop-cats button:hover i { transform: scale(1.15) rotate(-6deg); }
.shop-cats button.active { color: #fff; background: linear-gradient(180deg, #5cc94a, #2f9a35); box-shadow: 0 4px 0 #23782a, 0 8px 14px rgba(40, 140, 50, .3); text-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.shop-cats button.active i { animation: popIn .35s both; }
/* Rejilla de artículos */
.options.shop-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 12px; max-height: min(52vh, 460px); padding: 6px 6px 12px; margin: 0 -6px; }
.shop-grid .opt {
  --rar: #cfd8c9; position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: none; border-radius: 18px; padding: 8px 8px 10px; background: #fff; cursor: pointer;
  box-shadow: 0 4px 0 #e6dfcd, inset 0 0 0 2px #f0ebdd; font-size: 13px; font-weight: 900; color: #2e4a31; text-align: center;
  animation: popIn .32s calc(var(--i, 0) * 25ms) both; transition: transform .14s, box-shadow .14s;
}
.shop-grid .opt:hover { transform: translateY(-4px); box-shadow: 0 8px 0 #e6dfcd, 0 14px 22px rgba(60, 50, 20, .14), inset 0 0 0 2px #f0ebdd; }
.shop-grid .opt:active { transform: translateY(2px) scale(.98); }
.shop-grid .opt .thumb, .shop-grid .opt .thumb-emoji { width: 100%; aspect-ratio: 1; margin: 0 0 4px; border-radius: 13px; background: radial-gradient(circle at 50% 38%, #fff, #eef6e4 62%, #dcebcb); }
.shop-grid .opt .thumb-emoji { display: grid; place-items: center; font-size: 40px; color: #9fb39a; }
.shop-grid .opt .name { line-height: 1.2; }
.shop-grid .opt .lock { position: absolute; top: 8px; left: 8px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .92); font-size: 14px; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.shop-grid .opt.locked { opacity: 1; }
.shop-grid .opt.locked .thumb { filter: saturate(.75) brightness(.97); opacity: 1; }
.shop-grid .opt .price { margin-top: 2px; padding: 3px 10px; border-radius: 999px; background: linear-gradient(135deg, #f6e9ff, #e6ccff); color: #6a1fb0; font-size: 12.5px; font-weight: 900; box-shadow: inset 0 0 0 1px #dcc2f5; }
.shop-grid .opt .price.usd { background: linear-gradient(135deg, #e6f9ea, #c9f0d4); color: #0b5e2e; box-shadow: inset 0 0 0 1px #a8e0b8; }
.shop-grid .opt .rarity { position: absolute; top: 8px; right: 8px; margin: 0; font-size: 9.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .4px; padding: 3px 7px; border-radius: 8px; background: var(--rar); box-shadow: 0 2px 4px rgba(0, 0, 0, .15); }
.shop-grid .opt .owned { margin-top: 2px; padding: 3px 9px; border-radius: 999px; background: #e4f5da; color: #2f7d24; font-size: 11.5px; }
/* Marco según la rareza */
.shop-grid .opt.r-común { --rar: #8a948a; }
.shop-grid .opt.r-raro { --rar: #3a8fd8; box-shadow: 0 4px 0 #cfe2f5, inset 0 0 0 2px #d6e8fa; }
.shop-grid .opt.r-épico { --rar: #8e44ad; box-shadow: 0 4px 0 #e2d0ee, inset 0 0 0 2px #e8d6f3; }
.shop-grid .opt.r-legendario { --rar: linear-gradient(135deg, #ffb300, #ff6d00); box-shadow: 0 4px 0 #f3d9a6, inset 0 0 0 2px #ffd27a, 0 0 18px rgba(255, 170, 0, .25); }
.shop-grid .opt.r-legendario .thumb { background: radial-gradient(circle at 50% 38%, #fff, #fff3d1 60%, #ffe0a0); }
.shop-grid .opt.r-legendario::after {
  content: ""; position: absolute; inset: 0; border-radius: 18px; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%) 150% 0 / 250% 100% no-repeat;
  animation: legend 3.2s ease-in-out infinite;
}
@keyframes legend { 0%, 55% { background-position: 150% 0; } 100% { background-position: -150% 0; } }
.shop-grid .opt.selected { background: #f1fbe9; box-shadow: 0 4px 0 #9ad66a, inset 0 0 0 3px #4caf3a, 0 0 0 4px rgba(76, 175, 58, .18); }
.shop-grid .opt.selected::before { content: "✔"; position: absolute; z-index: 1; bottom: -8px; right: -6px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #2f9a35; color: #fff; font-size: 14px; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); animation: popIn .3s both; }
.editor-screen .label { color: #4a5d47; }
.editor-screen .label:empty, .editor-screen .swatches:empty { display: none; }
.editor-screen .swatch { width: 32px; height: 32px; transition: transform .12s; }
.editor-screen .swatch:hover { transform: scale(1.15); }
.shop-buy { margin-top: 10px; color: #6a5a3a; font-weight: 700; }
.shop-buy:empty { display: none; }
.shop-buy .gbtn.buy { width: 100%; font-size: 17px; animation: popIn .3s both; }
.shop-actions { margin-top: auto; padding-top: 14px; display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }
@media (max-width: 860px) {
  .shop-card { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 14px; }
  .stage-wrap { aspect-ratio: auto; height: 27vh; min-height: 170px; }
  .stage-emotes .gbtn { flex: 0 1 auto; }
  .options.shop-grid { max-height: none; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .shop-title { font-size: 24px; }
  .shop-actions { position: sticky; bottom: 0; z-index: 2; background: linear-gradient(180deg, rgba(255, 252, 244, 0), rgba(255, 252, 244, .97) 30%); padding: 14px 4px 4px; margin: 0 -4px; }
  .editor-screen:not(.hidden) { align-items: flex-start; }
}

/* ---- HUD de la partida: paneles verdes con borde claro ---- */
#hud {
  --hud-bg: linear-gradient(180deg, rgba(38, 66, 28, .9), rgba(22, 42, 16, .9));
  --hud-edge: rgba(255, 255, 255, .22);
}
#hud .chip, .hud-toggle {
  background: var(--hud-bg); border: 2px solid var(--hud-edge); border-radius: 16px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .25), 0 8px 18px rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .15);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .4);
}
#hud .chip { padding: 6px 10px; animation: cardIn .35s both; }
#hud .chip button {
  background: linear-gradient(180deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, .1)); border-radius: 10px; padding: 5px 9px; font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 2px 0 rgba(0, 0, 0, .25); transition: transform .08s, background .15s;
}
#hud .chip button:hover { background: linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .16)); }
#hud .chip button:active { transform: translateY(2px); box-shadow: none; }
#hud #copyBtn { background: linear-gradient(180deg, #5cc94a, #2f9a35); box-shadow: 0 2px 0 #1f6b23; }
#hud #exitBtn { background: linear-gradient(180deg, #f2675c, #c62828); box-shadow: 0 2px 0 #8e1b1b; }
#hud .col.right .chip { min-width: 96px; justify-content: center; font-size: 15px; }
#hud .top .col:not(.right) { align-items: flex-start; }
/* Dinero: píldora verde con billete que flota */
#moneyBox .pill {
  background: linear-gradient(180deg, rgba(38, 66, 28, .92), rgba(22, 42, 16, .92)); border: 2px solid rgba(255, 255, 255, .25);
  height: 44px; min-width: 150px; font-size: 26px; box-shadow: 0 4px 0 rgba(0, 0, 0, .25), 0 10px 20px rgba(0, 0, 0, .2);
  transition: color .2s;
}
#moneyBox .bill { position: relative; z-index: 1; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .3)); animation: floaty 3s ease-in-out infinite; }
#moneyBox.pulse .pill { color: #b6ff9c; }
.hp-bar { border-radius: 999px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .55), 0 4px 10px rgba(0, 0, 0, .25); }
/* Botones redondos: degradado, aro blanco y "aplastado" */
.round-btn {
  box-shadow: 0 5px 0 rgba(0, 0, 0, .28), 0 10px 20px rgba(0, 0, 0, .28);
  transition: transform .1s, box-shadow .1s; text-shadow: 0 2px 2px rgba(0, 0, 0, .25);
}
.round-btn:hover { transform: translateY(-2px) scale(1.04); }
.round-btn:active { transform: translateY(4px) scale(.96); box-shadow: 0 1px 0 rgba(0, 0, 0, .28), 0 4px 8px rgba(0, 0, 0, .25); }
#emoteBtn { background: radial-gradient(circle at 50% 30%, #ffd166, #f39c12 70%, #d27d00); }
#micBtn { background: radial-gradient(circle at 50% 30%, #ff7b6e, #c0392b 70%, #962b20); }
#micBtn.on { background: radial-gradient(circle at 50% 30%, #8ee07a, #3fae3a 70%, #2b7d24); animation: micOn 1.4s ease-out infinite; }
@keyframes micOn { 0% { box-shadow: 0 5px 0 rgba(0, 0, 0, .28), 0 0 0 0 rgba(76, 175, 58, .6); } 100% { box-shadow: 0 5px 0 rgba(0, 0, 0, .28), 0 0 0 16px rgba(76, 175, 58, 0); } }
#phoneBtn { background: radial-gradient(circle at 50% 30%, #6b84a3, #2c3e50 70%, #1b2836); overflow: visible; }
#emoteMenu button { border-radius: 12px; padding: 9px 13px; box-shadow: 0 3px 0 #d2bf98; background: linear-gradient(180deg, #fffaf0, #f1e6cf); color: #5b4a2a; animation: popIn .25s both; }
#emoteMenu button:active { transform: translateY(2px); box-shadow: none; }
.minimap { border: 3px solid #fff8e6; border-radius: 18px; box-shadow: 0 4px 0 rgba(0, 0, 0, .25), 0 10px 20px rgba(0, 0, 0, .25); }
.players-panel, .radio-panel { background: linear-gradient(180deg, rgba(38, 66, 28, .95), rgba(22, 42, 16, .95)); border: 2px solid rgba(255, 255, 255, .2); border-radius: 18px; box-shadow: 0 10px 24px rgba(0, 0, 0, .3); animation: cardIn .25s both; }

@media (prefers-reduced-motion: reduce) {
  .gbtn::after, .play-btn::after, .shop-grid .opt, .shop-grid .opt::after, .stage-glow, .shop-card::after, #moneyBox .bill, #micBtn.on,
  .screen .glass, #hud .chip, #emoteMenu button, .players-panel, .radio-panel { animation: none !important; }
}

/* ---- Mapa grande: marco de madera y pergamino ---- */
.bigmap { background: rgba(20, 14, 6, .6); backdrop-filter: blur(3px); }
.bigmap-card {
  background: linear-gradient(180deg, #8a5a2e, #6b4222); border-radius: 22px; padding: 12px 14px 12px; color: #fff3d6;
  box-shadow: 0 0 0 3px #4a2c12, inset 0 2px 0 rgba(255, 220, 160, .35), 0 24px 60px rgba(0, 0, 0, .5); animation: cardIn .3s both;
}
.bigmap-head b { font-family: Georgia, "Palatino Linotype", serif; font-size: 20px; letter-spacing: .3px; text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.bigmap-head button { background: linear-gradient(180deg, #f2675c, #c62828); box-shadow: 0 3px 0 #8e1b1b; border-radius: 12px; font-weight: 900; }
.bigmap canvas { border-radius: 12px; box-shadow: inset 0 0 0 2px rgba(60, 35, 10, .5), 0 0 0 3px #d9bf8c; }
.bigmap-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-weight: 700; opacity: 1; }
.bigmap-legend span { display: inline-flex; align-items: center; gap: 5px; }
.bigmap-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff3d6; }
.bigmap-legend .lg-me { background: #00b8d9; }
.bigmap-legend .lg-pl { background: #ff9800; }
.bigmap-legend .lg-bot { background: #fffaf0; border-color: #5a3d1a; }
.bigmap-legend .lg-wild { background: #e53935; }
.minimap { background: #e2cc9a; }
.bigmap-tools { display: inline-flex; gap: 6px; }
.bigmap-head .bigmap-tools button { background: linear-gradient(180deg, #fff7e6, #eedcb6); color: #5b3d17; box-shadow: 0 3px 0 #b8935a; min-width: 38px; }
.bigmap-head .bigmap-tools #bigMapClose { background: linear-gradient(180deg, #f2675c, #c62828); color: #fff; box-shadow: 0 3px 0 #8e1b1b; }
.bigmap canvas { cursor: grab; }
.bigmap canvas:active { cursor: grabbing; }

/* ---- Botones del HUD (voz, gestos, móvil): cuadrados redondeados con icono dibujado ---- */
.game-btn {
  --c1: #ffd166; --c2: #f08a00; --edge: #a85f00;
  width: 64px; height: 64px; border-radius: 20px; border: 3px solid rgba(255, 255, 255, .92); padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: #fff;
  background: linear-gradient(180deg, var(--c1), var(--c2));
  box-shadow: 0 5px 0 var(--edge), 0 10px 20px rgba(0, 0, 0, .3), inset 0 -4px 0 rgba(0, 0, 0, .12);
  text-shadow: none; font-size: 0;
}
.game-btn::before { left: 10%; right: 10%; top: 3px; height: 42%; border-radius: 16px 16px 40% 40% / 16px 16px 14px 14px; }
.game-btn .gi { width: 30px; height: 30px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .28)); transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.game-btn .gl { font-size: 10px; font-weight: 900; letter-spacing: .3px; line-height: 1; text-transform: uppercase; text-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.game-btn:hover .gi { transform: scale(1.12) rotate(-6deg); }
.game-btn:active { transform: translateY(4px) scale(.96); box-shadow: 0 1px 0 var(--edge), 0 4px 8px rgba(0, 0, 0, .25); }
#emoteBtn.game-btn { --c1: #ffcf5c; --c2: #f28b0c; --edge: #a85f00; background: linear-gradient(180deg, var(--c1), var(--c2)); }
#phoneBtn.game-btn { --c1: #6fb4ff; --c2: #2f6fd6; --edge: #1d4a96; background: linear-gradient(180deg, var(--c1), var(--c2)); overflow: visible; }
#micBtn.game-btn { --c1: #ff8a7a; --c2: #d63a2b; --edge: #8e1f15; background: linear-gradient(180deg, var(--c1), var(--c2)); animation: none; }
#micBtn.game-btn.on { --c1: #8ee07a; --c2: #34a33a; --edge: #1f6b23; background: linear-gradient(180deg, var(--c1), var(--c2)); animation: micOn 1.4s ease-out infinite; }
#micBtn .mic-on { display: none; }
#micBtn.on .mic-on { display: block; }
#micBtn.on .mic-off { display: none; }
#phoneBtn .mini-badge { top: -8px; right: -8px; min-width: 22px; height: 22px; border-radius: 11px; font-size: 12px; box-shadow: 0 0 0 2px #fff; animation: popIn .3s both; }
#hud.compact .game-btn { width: 54px; height: 54px; border-radius: 17px; font-size: 0; }
#hud.compact .game-btn .gi { width: 26px; height: 26px; }
#hud.compact .game-btn .gl { display: none; }
/* Separación entre botones (son un poco más altos que las bolitas) */
#micBtn.game-btn { bottom: calc(20px + var(--safe-bottom)); }
#emoteBtn.game-btn { bottom: calc(98px + var(--safe-bottom)); }
#phoneBtn.game-btn { bottom: calc(176px + var(--safe-bottom)); }
#hud.compact #emoteBtn.game-btn { bottom: calc(86px + var(--safe-bottom)); }
#hud.compact #phoneBtn.game-btn { bottom: calc(152px + var(--safe-bottom)); }

/* ---- App de Chat del móvil ---- */
.phone-app .ico.blue { background: linear-gradient(180deg, #6fb4ff, #2f6fd6); }
.chat-row { cursor: pointer; transition: background .15s; }
.chat-row:hover { background: #f4f8ff; }
.chat-row.unread .contact-info b { color: #0d47a1; }
.chat-row.unread .contact-info small { color: #1d2a3a; font-weight: 800; }
.chat-row .contact-info small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 0 0 auto; }
.chat-meta small { font-size: 11px; color: #6b7a8c; }
.chat-unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #2f9a35; color: #fff; font-size: 11.5px; font-weight: 900; font-style: normal; display: grid; place-items: center; }
.chat-go { font-size: 24px; color: #a5b1c0; }
.avatar-dot img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar-dot { overflow: visible; }
.avatar-dot span { position: relative; z-index: 0; }
.avatar-dot img + span { visibility: hidden; }
.chat-head { grid-template-columns: 40px 1fr 10px; text-align: left; }
.chat-who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.chat-who .avatar-dot { width: 34px; height: 34px; }
.chat-who b { display: block; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-who small { display: block; font-size: 11.5px; color: #5b6b7a; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-msgs {
  flex: 1; min-height: 0; overflow-y: auto; padding: 10px 10px 6px; display: flex; flex-direction: column; gap: 4px;
  background: #e7efe2 radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .5) 0 2px, transparent 3px) 0 0 / 26px 26px;
}
.chat-empty { margin: auto; text-align: center; color: #5b6b52; font-weight: 700; font-size: 13.5px; line-height: 1.5; padding: 20px; }
.chat-day { align-self: center; margin: 8px 0 4px; padding: 3px 10px; border-radius: 10px; background: rgba(255, 255, 255, .85); color: #5b6b7a; font-size: 11px; font-weight: 800; text-transform: capitalize; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.bubble {
  position: relative; max-width: 80%; padding: 7px 10px 6px; border-radius: 16px; font-size: 14px; line-height: 1.35; color: #1d2a17;
  box-shadow: 0 1px 1.5px rgba(0, 0, 0, .14); animation: popIn .22s both; word-wrap: break-word; overflow-wrap: anywhere;
}
.bubble.mine { align-self: flex-end; background: #d4f5c4; border-bottom-right-radius: 5px; }
.bubble.theirs { align-self: flex-start; background: #fff; border-bottom-left-radius: 5px; }
.chat-text { white-space: pre-wrap; user-select: text; -webkit-user-select: text; }
.chat-time { display: inline-flex; align-items: center; gap: 3px; float: right; margin: 6px 0 -2px 10px; font-size: 10.5px; color: #6b7a6b; }
.chat-tick { font-weight: 900; color: #8a9a8a; letter-spacing: -2px; }
.chat-tick.seen { color: #2b8be0; }
.voice-play { display: inline-flex; align-items: center; gap: 8px; border: none; background: none; padding: 2px 0; cursor: pointer; font: inherit; color: inherit; min-width: 170px; }
.voice-play i { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; color: #fff; background: linear-gradient(180deg, #5cc94a, #2f9a35); box-shadow: 0 2px 0 #23782a; }
.bubble.theirs .voice-play i { background: linear-gradient(180deg, #6fb4ff, #2f6fd6); box-shadow: 0 2px 0 #1d4a96; }
.voice-wave { position: relative; flex: 1; height: 6px; border-radius: 3px; background: rgba(0, 0, 0, .12); overflow: hidden; }
.voice-wave span { position: absolute; left: 0; top: 0; bottom: 0; background: #2f9a35; border-radius: 3px; transition: width .2s linear; }
.bubble.theirs .voice-wave span { background: #2f6fd6; }
.voice-play small { font-size: 11.5px; font-weight: 800; color: #4a5a4a; }
.voice-gone { font-style: italic; color: #7a8a7a; font-size: 13px; }
.chat-bar, .chat-rec { display: flex; align-items: center; gap: 6px; padding: 8px 8px calc(30px + 8px); background: #f4f7fb; border-top: 1px solid #e3e8ef; }
.chat-bar input { flex: 1; min-width: 0; border: 2px solid #dfe8d9; border-radius: 20px; padding: 10px 14px; font: inherit; font-size: 15px; outline: none; background: #fff; user-select: text; -webkit-user-select: text; }
.chat-bar input:focus { border-color: #3fae3a; }
.chat-btn { flex: 0 0 auto; width: 42px; height: 42px; border: none; border-radius: 50%; display: grid; place-items: center; font-size: 18px; cursor: pointer; color: #fff; transition: transform .08s; }
.chat-btn:active { transform: scale(.92); }
.chat-btn.send { background: linear-gradient(180deg, #5cc94a, #2f9a35); box-shadow: 0 3px 0 #23782a; }
.chat-btn.mic { background: linear-gradient(180deg, #6fb4ff, #2f6fd6); box-shadow: 0 3px 0 #1d4a96; }
.chat-btn.ghost { background: #eef1f5; box-shadow: 0 3px 0 #d3dae3; }
.chat-rec b { font-size: 16px; font-variant-numeric: tabular-nums; color: #c62828; }
.chat-rec .rec-hint { flex: 1; font-size: 13px; font-weight: 700; color: #5b6b7a; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #e53935; animation: hpblink .9s infinite; margin-left: 6px; }
@media (prefers-reduced-motion: reduce) { .bubble, #micBtn.game-btn.on { animation: none; } }

/* ---- Tienda: el personaje posa sobre el césped, delante de la granja pintada (img/bg/tienda) ---- */
.editor-screen .stage-wrap {
  background: #9ad66a url("../img/bg/tienda.jpg") 50% 100% / cover no-repeat;
  background-image: image-set(url("../img/bg/tienda.webp") type("image/webp"), url("../img/bg/tienda.jpg") type("image/jpeg"));
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .9), 0 8px 20px rgba(40, 60, 20, .2);
}
.editor-screen .stage-wrap::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 245, 220, .08) 0%, rgba(255, 245, 220, 0) 45%, rgba(40, 70, 20, .18) 100%),
              radial-gradient(ellipse at 50% 62%, rgba(255, 250, 230, .28), rgba(255, 250, 230, 0) 55%);
}
.editor-screen .stage-wrap .preview { z-index: 1; }
.editor-screen .stage-glow { z-index: 0; }
@media (max-width: 860px) {
  .editor-screen .stage-wrap { background-size: cover; background-position: 50% 78%; }
}

/* ---- Botón de subir / bajar del coche ---- */
.car-bar { position: absolute; left: 50%; bottom: calc(26px + var(--safe-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; z-index: 3; pointer-events: none; }
.car-btn { pointer-events: auto; font-size: 17px; padding: 13px 22px; border-radius: 18px; animation: popIn .3s both; white-space: nowrap; }
.car-public {
  pointer-events: auto; border: 2px solid rgba(255, 255, 255, .25); border-radius: 999px; padding: 9px 14px; font: inherit; font-weight: 900; font-size: 13.5px; color: #fff; cursor: pointer;
  background: linear-gradient(180deg, rgba(38, 66, 28, .92), rgba(22, 42, 16, .92)); box-shadow: 0 4px 0 rgba(0, 0, 0, .25); white-space: nowrap;
}
.car-public.on { background: linear-gradient(180deg, #5cc94a, #2f9a35); border-color: rgba(255, 255, 255, .6); }
.car-public:active { transform: translateY(3px); box-shadow: none; }
@media (max-width: 560px) { .car-bar { flex-direction: column-reverse; gap: 8px; } .car-btn { font-size: 15px; padding: 11px 16px; } }
.car-btn kbd { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 6px; background: rgba(0, 0, 0, .22); font: 800 12px system-ui, sans-serif; text-shadow: none; }
@media (pointer: coarse) { .car-btn kbd { display: none; } }
/* Mochila: mis coches */
.bp-cars { margin-bottom: 10px; }
.bp-car { display: flex; align-items: center; gap: 10px; background: #f2f7ec; border-radius: 14px; padding: 6px 10px 6px 6px; margin-bottom: 6px; border: 2px solid transparent; }
.bp-car.on { border-color: #4caf3a; background: #e8f7df; }
.bp-car img { width: 64px; height: 44px; object-fit: contain; border-radius: 10px; background: radial-gradient(circle at 50% 40%, #fff, #e9f3dd 80%); }
.bp-car span { flex: 1; font-weight: 900; font-size: 14px; color: var(--ink); }
.bp-car em { font-style: normal; font-size: 11px; font-weight: 900; color: #fff; background: #2f9a35; border-radius: 8px; padding: 2px 7px; margin-left: 6px; }
.bp-car .hbtn { padding: 8px 14px; font-size: 13.5px; }

/* ---- Varias fincas: pestañas en "Tu finca" ---- */
.farm-tabs { display: flex; gap: 6px; margin: -4px 0 12px; overflow-x: auto; scrollbar-width: none; }
.farm-tabs::-webkit-scrollbar { display: none; }
.farm-tab { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; border: 2px solid #e3ecd8; background: #fff; border-radius: 14px; padding: 7px 10px; font: inherit; cursor: pointer; color: #2e4a31; text-align: left; transition: transform .12s, border-color .15s; }
.farm-tab span { font-weight: 900; font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.farm-tab small { font-size: 11px; font-weight: 800; color: #6a7a68; }
.farm-tab:hover { transform: translateY(-2px); }
.farm-tab.on { border-color: #4caf3a; background: linear-gradient(180deg, #f1fbe9, #e1f4d3); box-shadow: 0 3px 0 #9ad66a; }
.farm-tab.add { border-style: dashed; background: #fbfdf8; color: #2f7d24; }
#farmNewForm { margin-bottom: 12px; }

/* Botón para cerrar el móvil (fuera de la pantalla, arriba a la derecha) */
.phone-close {
  position: absolute; top: -14px; right: -14px; z-index: 5; width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fff;
  display: grid; place-items: center; font: 900 18px system-ui, sans-serif; color: #fff; cursor: pointer;
  background: linear-gradient(180deg, #f2675c, #c62828); box-shadow: 0 4px 0 #8e1b1b, 0 8px 16px rgba(0, 0, 0, .35);
}
.phone-close:active { transform: translateY(3px); box-shadow: 0 1px 0 #8e1b1b; }
@media (max-width: 420px) { .phone-close { top: -8px; right: -6px; } }

/* ---- HUD ordenado: paneles con cabecera y ✕, avisos pequeños ---- */
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.panel-head b { font-size: 15px; }
.panel-close {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .7); display: grid; place-items: center;
  background: linear-gradient(180deg, #f2675c, #c62828); color: #fff; font: 900 14px system-ui, sans-serif; cursor: pointer; padding: 0;
}
.players-panel, .stats-panel, .radio-panel { z-index: 20; }
#toast { z-index: 15; font-size: 14px; padding: 8px 14px; border-radius: 999px; pointer-events: none; max-width: 70vw; }
@media (max-width: 560px) {
  /* Paneles como hoja inferior que tapa todo lo de debajo: se lee bien y se cierra fácil */
  .players-panel, .stats-panel {
    position: fixed; left: 10px; right: 10px; top: auto !important; bottom: calc(90px + var(--safe-bottom)); width: auto;
    max-height: 52vh; overflow-y: auto; padding: 12px; z-index: 30;
    background: linear-gradient(180deg, #2f5523, #1c3613) !important; box-shadow: 0 -6px 30px rgba(0, 0, 0, .45);
  }
  .players-panel .row { padding: 6px 0; border-top: 1px solid rgba(255, 255, 255, .12); }
  /* Avisos: pequeños, abajo en el centro, sin tapar los menús de arriba */
  #toast { top: auto; bottom: calc(196px + var(--safe-bottom)); font-size: 12.5px; padding: 6px 12px; max-width: 78vw; line-height: 1.3; }
  #toast.show { transform: translate(-50%, 0); }
  /* "Próximo desbloqueo": pequeño y abajo, encima de los avisos */
  .guide { top: auto !important; bottom: calc(150px + var(--safe-bottom)); font-size: 12px !important; padding: 5px 11px !important; max-width: 64vw; }
  #banner { font-size: 26px; }
  /* Con un panel abierto abajo, los avisos y el "Próximo" suben al centro para no quedar detrás */
  #hud:has(.players-panel:not(.hidden)) #toast, #hud:has(.stats-panel:not(.hidden)) #toast { bottom: auto; top: calc(300px + var(--safe-top)); }
  #hud:has(.players-panel:not(.hidden)) .guide, #hud:has(.stats-panel:not(.hidden)) .guide { display: none !important; }
}

/* ---- Girar la cámara (encima del minimapa: así no la tapan los botones del coche) ---- */
.cam-rot { position: absolute; left: 12px; bottom: calc(186px + var(--safe-bottom)); display: flex; gap: 8px; pointer-events: auto; z-index: 4; }
.cam-rot button {
  width: 42px; height: 42px; border-radius: 14px; border: 2px solid rgba(255, 255, 255, .3); cursor: pointer; font: 900 20px system-ui, sans-serif; color: #fff;
  background: linear-gradient(180deg, rgba(38, 66, 28, .92), rgba(22, 42, 16, .92)); box-shadow: 0 4px 0 rgba(0, 0, 0, .25);
}
.cam-rot button:active { transform: translateY(3px); box-shadow: none; }
@media (max-width: 560px) { .cam-rot { bottom: calc(162px + var(--safe-bottom)); } .cam-rot button { width: 46px; height: 46px; font-size: 20px; } }

/* Botón del Pueblo en el inicio */
.pueblo-btn { background: linear-gradient(180deg, #ffb74d, #f57c00) !important; box-shadow: 0 6px 0 #b85c00, 0 12px 24px rgba(0,0,0,.25) !important; margin-bottom: 10px; }
