/* Rendimiento: el mapa en dos capas y pausas durante efectos grandes */
/* ═════════════ rendimiento: dos capas para el mapa ═════════════ */
#board-base, #board { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; will-change: transform; }
#board { pointer-events: none; cursor: inherit; }
#board .spot, #board .espot, #board .hspot, #board [data-owner], #board .robber.pickable .rob-hit { pointer-events: auto; }
#board-wrap { cursor: grab; touch-action: none; }
#board-wrap:has(#board.dragging) { cursor: grabbing; }
#board.dragging * { pointer-events: none !important; }
#phase-msg, #timer, #zoomctl { z-index: 4; }
/* mientras hay un efecto grande, el paisaje se queda quieto (más fluido en celular) */
body.fx-busy .sway, body.fx-busy .wave, body.fx-busy .graze, body.fx-busy .waves, body.fx-busy .bk-hop, body.fx-busy .bk-glint, body.fx-busy .spark, body.fx-busy .ear { animation-play-state: paused !important; }

/* ═════════════ barcos (mapa Mega con islas) ═════════════ */
#board .shipspot { pointer-events: auto; cursor: pointer; }
.espot.ship { stroke: rgba(130,210,255,.9); }
.shipspot-disc { fill: rgba(20,60,100,.75); stroke: #8fd3ff; stroke-width: 2; animation: spot 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.shipspot-ico { font-size: 16px; text-anchor: middle; pointer-events: none; }
.ship.new .ship-bob { animation: shipIn .9s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes shipIn { from { transform: translateY(-30px) scale(.4); opacity: 0; } }
.ship-bob { animation: bob 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; }
body.no-anim .ship-bob { animation: none; }

/* ═════════════ vida marina decorativa ═════════════ */
#l-sea { pointer-events: none; }
.ripple { fill: none; stroke: rgba(255,255,255,.55); stroke-width: 2; }
.shark { animation: shark 7s ease-in-out forwards; }
@keyframes shark { 0% { transform: translate(-30px, 8px) scale(.6); opacity: 0; } 12% { opacity: 1; transform: translate(-24px, 0) scale(1); }
  50% { transform: translate(18px, 2px) scale(1); } 75% { transform: translate(28px, -2px) scaleX(-1); } 90% { opacity: 1; } 100% { transform: translate(6px, 10px) scaleX(-1) scale(.6); opacity: 0; } }
.volcano { transform-box: fill-box; transform-origin: center bottom; animation: volcano 7s ease-in-out forwards; }
@keyframes volcano { 0% { transform: translateY(18px) scale(.3); opacity: 0; } 15% { transform: translateY(0) scale(1); opacity: 1; } 80% { transform: none; opacity: 1; } 100% { transform: translateY(20px) scale(.4); opacity: 0; } }
.smoke { fill: rgba(70,70,70,.65); animation: smoke 2.2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.smoke.s2 { animation-delay: .7s; } .smoke.s3 { animation-delay: 1.4s; }
@keyframes smoke { 0% { transform: translateY(0) scale(.5); opacity: .9; } 100% { transform: translateY(-28px) scale(2); opacity: 0; } }
.lavadrop { fill: #ffb347; animation: lava 1.4s ease-out infinite; }
.lavadrop.d2 { animation-delay: .6s; animation-name: lava2; }
@keyframes lava { 0% { transform: translate(0, 0); opacity: 1; } 100% { transform: translate(-12px, 14px); opacity: 0; } }
@keyframes lava2 { 0% { transform: translate(0, 0); opacity: 1; } 100% { transform: translate(13px, 12px); opacity: 0; } }

/* ═════════════ cartas de desarrollo (nuevo diseño) ═════════════ */
#devhand { display: flex; gap: 7px; align-items: center; }
.dcard { width: 58px; height: 82px; border-radius: 10px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 7px 3px 5px; border: 2px solid #2a1c0e; box-shadow: 0 3px 0 #120a04, inset 0 0 0 2px rgba(255,255,255,.45); flex: none; transition: transform .2s; }
.dcard::before { content: ''; position: absolute; inset: 4px; border-radius: 6px; border: 1.5px dashed rgba(90,58,30,.35); pointer-events: none; }
.dcard .de { font-size: 26px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.dcard .dn { font-size: 8.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .3px; text-align: center; line-height: 1.05; }
.dc-foot { font-size: 9px; font-weight: 900; color: #ffd56b; background: rgba(30,18,8,.82); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.dcard.play .dc-foot { background: #c8372d; color: #fff; }
.dcard.fresh .dc-foot { background: #3d8a2e; color: #fff; }
.dcard .dx { z-index: 1; }
.dcard.dev-knight { background: linear-gradient(165deg, #f1f5fb, #8ea1c3); }
.dcard.dev-vp { background: linear-gradient(165deg, #fff6cf, #e3ad3f); }
.dcard.dev-monopoly { background: linear-gradient(165deg, #f4e9ff, #a77ad9); }
.dcard.dev-plenty { background: linear-gradient(165deg, #effbe6, #7cc35a); }
.dcard.dev-roads { background: linear-gradient(165deg, #fbeedd, #c08a4c); }
.dcard.play { cursor: pointer; animation: btnGlow 1.6s infinite; }
.dcard.play:hover { transform: translateY(-6px) rotate(-2deg); }
.dcard.used { opacity: .6; filter: grayscale(.65); transform: rotate(-4deg) scale(.92); box-shadow: 0 2px 0 #120a04; }
.dcard.used .stamp { position: absolute; top: 44%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); padding: 0 4px; border-radius: 4px;
  border: 2px solid #c8372d; color: #c8372d; background: rgba(255,255,255,.85); font: 900 10px 'Nunito', sans-serif; letter-spacing: .5px; }
.army { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 8px; border-radius: 10px; background: rgba(20,12,4,.65);
  color: #fbeccb; border: 1.5px solid rgba(255,213,107,.45); flex: none; min-width: 64px; }
.army b { font-size: 13px; } .army small { font-size: 10px; font-weight: 800; opacity: .8; }
.armybar { width: 56px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.18); overflow: hidden; }
.armybar i { display: block; height: 100%; background: linear-gradient(90deg, #8ea1c3, #ffd56b); }
.army.got { border-color: #ffd56b; box-shadow: 0 0 12px rgba(255,213,107,.6); }
@media (max-height: 820px) and (min-width: 761px) { .dcard { width: 52px; height: 74px; } .dcard .de { font-size: 22px; } }
@media (max-width: 760px) {
  .dcard { width: 46px; height: 64px; padding: 5px 2px 3px; } .dcard .de { font-size: 18px; } .dcard .dn { font-size: 7px; } .dc-foot { font-size: 7.5px; padding: 0 4px; }
  .army { min-width: 54px; padding: 3px 5px; } .army b { font-size: 11px; } .armybar { width: 46px; }
}
@media (max-height: 520px) and (orientation: landscape) { .dcard { width: 40px; height: 54px; } .dcard .dn { display: none; } .army small { display: none; } }
/* celular: las cartas de desarrollo en su propia fila (deslizable) para que se vean todas */
@media (max-width: 760px) {
  #hand { order: 1; }
  #devhand { order: 2; flex: 1 1 100% !important; max-width: 100%; overflow-x: auto; padding: 2px 2px 4px !important; }
  #devhand:has(.dev-empty) { display: none; }
  #actions { order: 3; }
}
@media (max-width: 760px) { .dcard .dn { font-size: 6.5px; letter-spacing: 0; } }

/* ═════════════ descarte: las cartas van al ladrón ═════════════ */
.flycard.feast { z-index: 62; }
.flycard.back { background: repeating-linear-gradient(45deg, #5a3517 0 6px, #4a2a10 6px 12px); border-color: #e3ad3f; display: grid; place-items: center; }
.flycard.back span { font: 900 22px 'Cinzel', serif; color: #ffd56b; }
.robber-bob.gulping { animation: gulp 1.9s ease-in-out; }
@keyframes gulp { 0% { transform: scale(1); } 15% { transform: scale(1.35) rotate(-6deg); } 30% { transform: scale(1.25) rotate(6deg); }
  45% { transform: scale(1.4) rotate(-5deg); } 60% { transform: scale(1.3) rotate(4deg); } 75% { transform: scale(1.55); } 88% { transform: scale(.9); } 100% { transform: scale(1); } }
.gulp { position: fixed; z-index: 63; pointer-events: none; transform: translate(-50%, -50%); display: grid; place-items: center; }
.gulp-ring { position: absolute; width: 40px; height: 40px; border-radius: 50%; border: 4px solid #b06bff; box-shadow: 0 0 18px #b06bff; animation: gulpRing .9s ease-out forwards; }
.gulp-ring.r2 { border-color: #ff5a4a; box-shadow: 0 0 18px #ff5a4a; animation-delay: .15s; opacity: 0; }
@keyframes gulpRing { 0% { transform: scale(.3); opacity: 1; } 100% { transform: scale(3.2); opacity: 0; } }
.gulp-txt { font: 900 22px 'Cinzel', serif; color: #fff; text-shadow: 0 2px 0 #2a0505, 0 0 12px #ff3b2e; animation: gulpTxt 1.2s ease-out forwards; white-space: nowrap; }
@keyframes gulpTxt { 0% { transform: translateY(0) scale(.4); opacity: 0; } 25% { transform: translateY(-14px) scale(1.25); opacity: 1; } 100% { transform: translateY(-42px) scale(1); opacity: 0; } }
@media (max-width: 760px) { .gulp-txt { font-size: 18px; } .flycard.feast { transform-origin: center; } }

/* nombres de las cartas de desarrollo: que entren bien */
.dcard .dn { text-transform: none; letter-spacing: 0; font-size: 9.5px; max-width: 100%; padding: 0 3px; overflow-wrap: anywhere; }
@media (max-height: 820px) and (min-width: 761px) { .dcard .dn { font-size: 8.5px; } }
@media (max-width: 760px) { .dcard .dn { font-size: 7.5px; padding: 0 2px; } .dc-foot { font-size: 7px; padding: 0 3px; } }
@media (max-width: 760px) { .dcard .dn { font-size: 6.6px; white-space: nowrap; overflow-wrap: normal; letter-spacing: -.1px; } }
