/* Adaptación a celular, tablet y laptop */
/* ═════════════════════════ RESPONSIVE ═════════════════════════ */
.mobile-only { display: none; }

/* toques: zonas para tocar más grandes */
@media (pointer: coarse) {
  .spot { r: 15px; }
  .spot.city { r: 20px; }
  .espot { stroke-width: 15; }
}

/* laptops (pantallas medianas o bajitas) */
@media (max-width: 1400px) {
  #main { grid-template-columns: 1fr 270px; }
  .bank { gap: 7px; font-size: 13px; }
}
@media (max-height: 820px) and (min-width: 761px) {
  #topbar { padding: 5px 14px; }
  .brand { font-size: 19px; }
  #bottom { padding: 6px 12px; }
  .rcard { width: 54px; height: 72px; }
  .rcard .ico { width: 36px; height: 36px; }
  .dcard { width: 48px; height: 66px; }
  #players { gap: 6px; }
  .pl { padding: 6px 9px; }
  .pl-stats { font-size: 12px; }
  #timer { top: 48px; }
}

/* tablets */
@media (max-width: 1000px) and (min-width: 761px) {
  #main { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  #side { order: -1; flex-direction: row; border-left: 0; }
  #players { display: flex; overflow-x: auto; max-height: none; flex: 1; }
  .pl { min-width: 180px; }
  #log, #chat { display: none; }
  .mobile-only { display: inline-block; }
  .bank span:nth-child(n) { font-size: 12px; }
}

/* celulares (vertical) */
@media (max-width: 760px) {
  .mobile-only { display: inline-block; }
  #topbar { gap: 6px; padding: 5px 6px; overflow-x: auto; scrollbar-width: none; }
  .brand { font-size: 15px; }
  .brand .code-pill, .goal .code-pill, .bank, .ports-title, .emote-top .txt { display: none; }
  .goal { font-size: 12px; white-space: nowrap; }
  .roll-mini { min-width: 0; font-size: 12px; }
  .mini-die { width: 19px; height: 19px; font-size: 12px; }
  #myports { margin-left: auto; }
  .pchip { font-size: 10px; padding: 0 5px; }
  .pchip .ico { width: 13px; height: 13px; }
  #topbar .btn.small { padding: 3px 7px; font-size: 15px; flex: none; }

  #main { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  #side { order: -1; flex-direction: row; border-left: 0; background: rgba(10,20,30,.55); }
  #players { display: flex; overflow-x: auto; padding: 5px; gap: 5px; max-height: none; flex: 1; scrollbar-width: none; }
  .pl { min-width: 128px; padding: 4px 7px; border-radius: 9px; }
  .pl.active { transform: none; }
  .pl-top { gap: 5px; }
  .pl-house { width: 18px; }
  .pl-name { font-size: 12px; }
  .pl-name em { display: none; }
  .pl-vp { font-size: 17px; }
  .pl-stats { font-size: 10.5px; gap: 6px; }
  .pl-awards span { font-size: 9px; padding: 0 4px; }
  .pl-wait { font-size: 10px; }
  #log, #chat { display: none; }

  #phase-msg { top: 4px; font-size: 12px; padding: 5px 12px; max-width: 96%; }
  #phase-msg small { display: none; }
  #timer { top: 36px; min-width: 0; width: 88%; height: 22px; font-size: 11px; }

  #bottom { padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); gap: 6px; justify-content: center; }
  #hand { gap: 5px; }
  .rcard { width: 54px; height: 70px; border-radius: 7px; }
  .rcard .ico { width: 32px; height: 32px; margin-top: -10px; }
  .rcard .lbl { font-size: 9px; }
  .rcard .cnt { min-width: 22px; height: 22px; font-size: 13px; top: -7px; right: -6px; }
  #devhand { max-width: 100%; overflow-x: auto; }
  .dcard { width: 44px; height: 60px; flex: none; }
  .dcard .de { font-size: 18px; }
  .dcard .dn { font-size: 7.5px; }
  .dev-empty { display: none; }
  #actions { margin: 0; width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
  #actions:empty { display: none; }
  #actions .btn { font-size: 12px; padding: 7px 4px; }
  #actions .btn.build { padding: 4px 2px; }
  #actions .btn.huge, #actions .btn:only-child { grid-column: 1 / -1; font-size: 18px; padding: 10px; }
  .cost .ico { width: 12px; height: 12px; }

  .modal-card { padding: 14px 10px; }
  .modal-card h2 { font-size: 20px; }
  .picker { width: 58px; padding: 6px 2px; }
  .picker .ico { width: 30px; height: 30px; }
  .pk-ctrl { gap: 2px; }
  .btn.round.small { width: 22px; height: 22px; font-size: 14px; }
  #trade-float { left: 6px; right: 6px; top: 100px; bottom: auto; max-height: 46vh; }
  .tf { width: auto; }
  #emote-pop { left: 6px; right: 6px; width: auto; top: 44px; }
  .ep-grid { grid-template-columns: repeat(6, 1fr); }
  .ep-btn { font-size: 26px; padding: 6px 0; }
  #toasts { top: 100px; bottom: auto; left: 8px; right: 8px; align-items: center; }
  .toast { font-size: 13px; }
  .dice-row { transform: scale(.75); }
  .dice-sum { font-size: 52px; }
  .robber-big { width: 170px; height: 200px; }
  .shield { transform: scale(.7); }
  .bigcard { width: 110px; height: 150px; }
  .wake-hand { font-size: 62vmin; }

  /* portada y lobby */
  .title { font-size: 42px; }
  #lobby { padding: 8px; }
  .lobby-card { padding: 14px 12px; }
  .room-code b { font-size: 22px; letter-spacing: 4px; }
  .maps, .lobby-row { grid-template-columns: 1fr; }
  .slots, .slots.four { grid-template-columns: 1fr 1fr; gap: 6px; }
  .slot { min-height: 56px; padding: 8px; gap: 6px; }
  .slot-house { width: 22px; }
  .slot-name { font-size: 13px; }
  .stylepick { width: calc(25% - 5px); }
  .swatch { width: 32px; height: 32px; }
  .btn.big { font-size: 15px; }
}

/* celulares en horizontal */
@media (max-height: 520px) and (orientation: landscape) {
  .mobile-only { display: inline-block; }
  #topbar { padding: 3px 8px; gap: 8px; }
  .brand { font-size: 15px; }
  .brand .code-pill, .bank, .ports-title, .emote-top .txt { display: none; }
  #main { grid-template-columns: 1fr 190px; grid-template-rows: 1fr; }
  #side { order: 0; flex-direction: column; }
  #players { display: grid; max-height: none; padding: 5px; gap: 5px; }
  .pl { padding: 4px 7px; min-width: 0; }
  .pl-stats, .pl-awards { font-size: 10px; }
  .pl-vp { font-size: 16px; }
  #log, #chat { display: none; }
  #phase-msg { font-size: 11px; padding: 3px 10px; top: 2px; }
  #phase-msg small { display: none; }
  #timer { top: 28px; height: 20px; font-size: 10px; min-width: 220px; }
  #bottom { padding: 4px 8px; gap: 6px; flex-wrap: nowrap; }
  .rcard { width: 42px; height: 54px; }
  .rcard .ico { width: 26px; height: 26px; margin-top: -8px; }
  .rcard .lbl { display: none; }
  .rcard .cnt { min-width: 19px; height: 19px; font-size: 11px; top: -6px; right: -6px; }
  .dcard { width: 38px; height: 52px; }
  .dcard .dn { display: none; }
  .dev-empty { display: none; }
  #actions .btn { font-size: 11px; padding: 5px 7px; }
  #actions .btn.build span:first-child { font-size: 11px; }
  .btn.huge { font-size: 15px; padding: 8px 16px; }
  .cost { display: none; }
  .modal-card { max-height: 94vh; padding: 10px; }
  .dice-row { transform: scale(.65); }
}

/* 🖕 a pantalla completa */
.wakefx { background: radial-gradient(circle, rgba(255,40,30,.35), rgba(0,0,0,.85)); animation: fadeIn .1s, quake .35s .05s 4; }
.wake-hand { font-size: 46vmin; line-height: 1; animation: wakeIn .5s cubic-bezier(.3,1.8,.5,1) both, wakeShake .2s .5s 6; filter: drop-shadow(0 0 40px rgba(255,90,74,.9)); }
@keyframes wakeIn { from { transform: scale(.1) rotate(-30deg); opacity: 0; } }
@keyframes wakeShake { 50% { transform: rotate(8deg) scale(1.05); } }
.ep-btn.wake { border-color: #ff5a4a; background: rgba(255,90,74,.18); }
.ep-btn:disabled { opacity: .45; cursor: not-allowed; }
.ep-btn small { font-size: 14px; font-weight: 900; }
@media (max-width: 760px) {
  #bottom { flex-wrap: wrap; }
  #hand { flex: none; }
  #devhand { flex: 1 1 0; min-width: 0; overflow-x: auto; scrollbar-width: none; padding-top: 6px; }
}
@media (max-width: 440px) {
  .brand { display: none; }
  .rcard { width: 50px; height: 66px; }
  #hand { gap: 4px; }
  .dcard { width: 40px; height: 58px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  #players { align-content: start; overflow-y: auto; }
}
