:root{
  --bg:#09111f;--bg2:#0f1f36;--panel:rgba(255,255,255,.08);--panel2:rgba(255,255,255,.14);--text:#f8fafc;--muted:#b6c2d1;--line:rgba(255,255,255,.18);--green:#22c55e;--red:#ef4444;--amber:#f59e0b;--blue:#38bdf8;
}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:radial-gradient(circle at 10% 5%,#1d4ed8 0,#09111f 36%,#050812 100%);color:var(--text)}a{color:inherit}button,input,select{font:inherit}button{border:0;border-radius:14px;padding:12px 16px;font-weight:900;cursor:pointer;color:#06101d;background:linear-gradient(135deg,#fff,#cbd5e1);box-shadow:0 8px 20px rgba(0,0,0,.22);transition:.18s transform,.18s opacity}button:hover{transform:translateY(-1px)}button:disabled{opacity:.45;cursor:not-allowed;transform:none}.btn-primary{background:linear-gradient(135deg,#38bdf8,#2563eb);color:white}.btn-good{background:linear-gradient(135deg,#4ade80,#16a34a);color:white}.btn-warn{background:linear-gradient(135deg,#fbbf24,#f97316);color:#111827}.btn-danger{background:linear-gradient(135deg,#fb7185,#dc2626);color:white}.btn-ghost{background:rgba(255,255,255,.10);color:white;border:1px solid var(--line);box-shadow:none}.input,select{width:100%;border:1px solid var(--line);border-radius:14px;padding:12px 14px;background:rgba(2,6,23,.55);color:white;outline:none}select option{color:#111827;background:white}.wrap{width:min(1440px,calc(100vw - 28px));margin:0 auto;padding:18px 0 32px}.header{display:flex;gap:16px;align-items:center;justify-content:space-between;margin-bottom:16px}.brand{display:flex;gap:14px;align-items:center}.logo{width:62px;height:62px;border-radius:18px;display:grid;place-items:center;background:linear-gradient(135deg,#f59e0b,#ef4444,#2563eb);font-size:30px;box-shadow:0 14px 34px rgba(0,0,0,.35)}h1{margin:0;font-size:clamp(28px,3vw,48px);letter-spacing:-.05em;line-height:.95}.sub{margin:6px 0 0;color:var(--muted);font-weight:700}.pill{display:inline-flex;align-items:center;gap:8px;border:1px solid var(--line);background:rgba(255,255,255,.1);border-radius:999px;padding:9px 12px;color:#e5e7eb;font-weight:900;text-decoration:none}.grid{display:grid;gap:16px}.grid-2{grid-template-columns:1.1fr .9fr}.grid-3{grid-template-columns:repeat(3,1fr)}.card{border:1px solid var(--line);background:linear-gradient(180deg,rgba(255,255,255,.11),rgba(255,255,255,.06));border-radius:24px;padding:18px;box-shadow:0 24px 60px rgba(0,0,0,.28);backdrop-filter:blur(8px)}.card h2,.card h3{margin:0 0 12px;letter-spacing:-.03em}.muted{color:var(--muted)}.small{font-size:12px}.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.stack{display:grid;gap:12px}.spacer{height:8px}.stat{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center;padding:12px;border:1px solid var(--line);border-radius:18px;background:rgba(2,6,23,.25)}
.player{display:flex;align-items:center;gap:10px;padding:10px;border-radius:16px;background:rgba(255,255,255,.08);border:1px solid var(--line);flex-wrap:wrap}.dot{width:14px;height:14px;border-radius:50%;box-shadow:0 0 0 4px rgba(255,255,255,.12)}.player-name{font-weight:1000}.score{margin-left:auto;font-size:22px;font-weight:1000}.active{outline:3px solid rgba(56,189,248,.65);box-shadow:0 0 30px rgba(56,189,248,.18)}.badge{display:inline-flex;align-items:center;gap:5px;border-radius:999px;padding:5px 8px;font-size:11px;font-weight:1000;border:1px solid rgba(255,255,255,.18)}.badge-ok{background:rgba(34,197,94,.18);color:#86efac}.badge-wait{background:rgba(245,158,11,.18);color:#fde68a}.badge-block{background:rgba(239,68,68,.16);color:#fecaca}.badge-info{background:rgba(56,189,248,.16);color:#bae6fd}
.tile{cursor:grab;touch-action:manipulation;width:52px;height:70px;border-radius:12px;background:#f8fafc;color:#111827;display:inline-grid;place-items:center;margin:4px;position:relative;box-shadow:0 8px 0 rgba(0,0,0,.2),0 12px 20px rgba(0,0,0,.22);border:2px solid rgba(255,255,255,.55);font-weight:1000;font-size:27px;user-select:none}.tile::after{content:'';position:absolute;inset:5px;border-radius:9px;border:1px solid rgba(0,0,0,.08);pointer-events:none}.tile .mini{position:absolute;top:5px;left:7px;font-size:9px;font-weight:1000;color:inherit}.tile-blue{color:#1e6bff}.tile-black{color:#111827}.tile-red{color:#ef233c}.tile-yellow{color:#d97706}.tile-joker{color:#7c3aed;background:linear-gradient(135deg,#fff,#ede9fe)}.tile.selected{outline:4px solid #38bdf8;transform:translateY(-4px)}.tile.dragging{opacity:.5}.tile-remove{position:absolute;right:-7px;top:-8px;width:22px;height:22px;border-radius:999px;background:#ef4444;color:white;font-size:12px;display:grid;place-items:center;box-shadow:0 4px 10px rgba(0,0,0,.25);padding:0}.tile.tap-moving{outline:4px solid #22c55e;transform:translateY(-4px)}
.board{display:grid;gap:12px}.set{border:1px dashed rgba(255,255,255,.28);border-radius:20px;background:rgba(2,6,23,.32);padding:12px;position:relative}.set.drop{outline:4px solid rgba(34,197,94,.45)}.set-head{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:8px}.set-title{font-weight:1000;color:white}.set-owner{color:var(--muted);font-size:12px;font-weight:800}.set-status{font-size:12px;border-radius:999px;padding:6px 9px;font-weight:1000;white-space:nowrap}.ok{background:rgba(34,197,94,.18);color:#86efac}.bad{background:rgba(239,68,68,.18);color:#fecaca}.empty{background:rgba(255,255,255,.12);color:#e2e8f0}.tiles{min-height:78px}.slot-grid{display:grid;gap:7px;align-items:stretch}.slot-grid.run{grid-template-columns:repeat(13,minmax(44px,1fr))}.slot-grid.group{grid-template-columns:repeat(4,minmax(64px,1fr));max-width:440px}.slot{cursor:pointer;touch-action:manipulation;min-height:82px;border:1px dashed rgba(255,255,255,.25);border-radius:14px;background:rgba(255,255,255,.045);display:grid;place-items:center;position:relative;overflow:visible}.slot:hover{background:rgba(56,189,248,.11)}.slot.can-place{outline:3px solid rgba(56,189,248,.28)}.slot.occupied{border-style:solid;background:rgba(255,255,255,.08)}.slot.drop{outline:4px solid rgba(34,197,94,.45)}.slot-ghost{position:absolute;inset:auto 0 4px 0;text-align:center;font-size:10px;color:rgba(255,255,255,.38);font-weight:1000;letter-spacing:.02em;z-index:0}.slot .tile{margin:0;width:50px;height:68px;font-size:25px;z-index:2}.group .slot{min-height:90px}.ghost-blue{color:#93c5fd}.ghost-black{color:#e5e7eb}.ghost-red{color:#fecaca}.ghost-yellow{color:#fde68a}.admin-layout{display:grid;grid-template-columns:370px 1fr;gap:16px}.toolbar{position:sticky;top:12px;align-self:start}.manual-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.rack{border:1px solid var(--line);border-radius:20px;background:rgba(255,255,255,.07);padding:12px;min-height:108px}.toast{position:fixed;left:50%;bottom:16px;transform:translateX(-50%);background:rgba(15,23,42,.95);border:1px solid var(--line);padding:12px 16px;border-radius:16px;font-weight:900;z-index:50;box-shadow:0 18px 45px rgba(0,0,0,.35);max-width:min(92vw,680px);text-align:center}.actionbar{position:sticky;bottom:10px;z-index:40;background:rgba(8,17,31,.86);border:1px solid var(--line);border-radius:22px;padding:12px;backdrop-filter:blur(10px);box-shadow:0 12px 35px rgba(0,0,0,.28)}
.tv{height:100vh;overflow:hidden;padding:14px;background:radial-gradient(circle at 50% 0,#1e40af 0,#08111f 38%,#020617 100%)}.tv-shell{height:calc(100vh - 28px);display:grid;grid-template-columns:1fr 300px;gap:14px}.tv-main{border:1px solid var(--line);border-radius:28px;background:rgba(255,255,255,.07);padding:16px;overflow:hidden}.tv-board{height:calc(100% - 104px);display:grid;grid-template-columns:repeat(2,1fr);gap:12px;align-content:start;overflow:hidden}.tv .set{padding:10px}.tv .set-head{margin-bottom:6px}.tv .slot{min-height:56px;border-radius:10px}.tv .slot .tile{width:38px;height:52px;font-size:20px;border-radius:9px}.tv .tile .mini{font-size:7px;top:4px;left:5px}.tv .slot-grid.run{gap:4px;grid-template-columns:repeat(13,minmax(29px,1fr))}.tv .slot-grid.group{gap:6px}.tv-side{display:grid;grid-template-rows:auto 1fr auto;gap:12px}.fullscreen{position:fixed;left:10px;top:10px;z-index:99;background:rgba(255,255,255,.14);color:white;border:1px solid rgba(255,255,255,.2);box-shadow:none;padding:8px 10px;font-size:12px}.legend{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}.legend span{padding:7px 10px;border-radius:999px;background:rgba(255,255,255,.12);font-weight:900;font-size:12px}.hidden{display:none!important}
@media(max-width:1100px){.admin-layout{grid-template-columns:1fr}.toolbar{position:static}.slot-grid.run{grid-template-columns:repeat(7,minmax(42px,1fr))}.tv-board{grid-template-columns:1fr}.tv-shell{grid-template-columns:1fr}.tv-side{display:none}.tv{overflow:auto}.tv-shell,.tv-board{height:auto}}
@media(max-width:700px){.grid-2,.grid-3{grid-template-columns:1fr}.header{align-items:flex-start;flex-direction:column}.tile{width:46px;height:62px;font-size:23px}.slot .tile{width:44px;height:60px;font-size:22px}.slot{min-height:74px}.slot-grid.run{grid-template-columns:repeat(5,minmax(48px,1fr))}.slot-grid.group{grid-template-columns:repeat(4,1fr);max-width:none}.wrap{width:min(100vw - 18px,900px);padding-top:10px}button{width:100%}.row button{width:auto;flex:1}.manual-grid{grid-template-columns:1fr}.card{border-radius:20px;padding:14px}.player{align-items:flex-start}.score{margin-left:0}}

/* v1.3.3: movimiento por arrastre/toque, tercias de 3 y corridas de 3+ */
.slot.can-place{box-shadow:inset 0 0 0 2px rgba(56,189,248,.35),0 0 0 2px rgba(56,189,248,.12)}
.tile:active{cursor:grabbing}

.field-inline{display:flex;align-items:center;gap:10px;color:#cbd5e1;font-weight:800;flex-wrap:wrap}
.small-select{width:auto;min-width:260px;padding:9px 10px;font-size:13px}
.type-row{margin-top:8px;margin-bottom:2px}

/* v1.3.3: celular compacto + pantalla dividida en Escaleras y Póquer/Tercias */
body.phone{min-height:100vh;overflow-x:hidden}
.phone-wrap{padding-bottom:260px}
.phone-header{margin-bottom:10px}
.phone-header .logo{width:52px;height:52px;border-radius:15px;font-size:24px}
.phone-header h1{font-size:34px}
.phone-toplinks .pill{padding:7px 9px;font-size:12px}
.phone-game{display:grid;gap:12px}
.mobile-status-card,.mobile-instructions{padding:14px;border-radius:18px}
.turn-assist{margin-top:10px;padding:10px;border:1px solid rgba(255,255,255,.15);border-radius:16px;background:rgba(2,6,23,.32);font-weight:800;line-height:1.35}
.mobile-rack-card{position:fixed;left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));bottom:max(8px,env(safe-area-inset-bottom));z-index:80;border:1px solid var(--line);background:linear-gradient(180deg,rgba(15,23,42,.97),rgba(3,7,18,.98));border-radius:22px;padding:10px;box-shadow:0 -18px 55px rgba(0,0,0,.48);backdrop-filter:blur(12px);max-height:62vh;overflow:auto}
.rack-title-row{display:flex;justify-content:space-between;gap:8px;align-items:flex-start;margin:0 0 8px}.rack-title-row>div{display:grid;gap:2px}.mini-pill{font-size:11px;padding:6px 8px;white-space:nowrap}.mobile-rack{min-height:84px;max-height:27vh;overflow:auto;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:2px;padding:8px;border-radius:16px}.mobile-rack .tile{width:42px;height:56px;font-size:21px;margin:2px;border-radius:10px}.mobile-rack .tile .mini{font-size:7px;top:4px;left:5px}.compact-controls{display:grid;grid-template-columns:1fr auto auto;gap:8px;margin:8px 0}.compact-select{width:100%;min-width:0;font-size:12px;padding:9px}.mini-btn{padding:9px 10px;font-size:12px;box-shadow:none}.mobile-buttons{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:8px}.mobile-buttons button,.backup-mobile{padding:9px 7px;border-radius:13px;font-size:12px;min-height:44px;box-shadow:0 6px 16px rgba(0,0,0,.25)}.backup-mobile{width:100%;margin-top:8px}.mobile-hint{text-align:center;margin:8px 0 0}.login-card{max-width:720px;margin-inline:auto}

.tv .tv-main{display:flex;flex-direction:column}.tv-header .logo{width:52px;height:52px;border-radius:16px;font-size:24px}.tv-header h1{font-size:38px}.tv-legend{margin-bottom:8px}.split-board{height:calc(100% - 96px);display:grid;grid-template-columns:minmax(0,1.28fr) minmax(0,.92fr);gap:12px;overflow:hidden}.tv-area{min-height:0;border:1px solid rgba(255,255,255,.18);border-radius:22px;background:rgba(255,255,255,.055);padding:10px;display:flex;flex-direction:column;overflow:hidden}.area-title{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 6px 10px;color:#e0f2fe;text-transform:uppercase;font-weight:1000;letter-spacing:.04em;font-size:14px}.area-title span{text-transform:none;letter-spacing:0;font-size:11px;color:#b6c2d1}.area-grid{min-height:0;overflow:hidden;display:grid;gap:7px;align-content:start}.run-area .area-grid{grid-template-columns:1fr}.group-area .area-grid{grid-template-columns:1fr}.tv .tv-set{padding:7px;border-radius:15px}.tv .tv-set .set-head{margin-bottom:4px}.tv .set-title{font-size:12px}.tv .set-owner{font-size:10px}.tv .set-status{font-size:10px;padding:4px 6px}.tv .run .slot{min-height:45px}.tv .group .slot{min-height:48px}.tv .run .slot .tile{width:32px;height:43px;font-size:17px}.tv .group .slot .tile{width:36px;height:48px;font-size:18px}.tv .slot-ghost{font-size:8px;bottom:2px}.quick-guide p{margin:8px 0;color:#cbd5e1;font-size:12px;line-height:1.35}.turn-hint{margin-top:10px;line-height:1.35}

@media(max-width:700px){
  body.phone .wrap{width:calc(100vw - 12px);padding-top:8px;padding-bottom:260px}
  body.phone .header{gap:8px}
  body.phone .sub{font-size:12px}
  body.phone .mobile-instructions{display:none}
  body.phone .card h2{font-size:19px}
  body.phone .row{gap:6px}
  body.phone .pill{font-size:11px;padding:6px 8px}
  body.phone button{width:auto}
  body.phone .mobile-buttons{grid-template-columns:repeat(2,1fr)}
  body.phone .mobile-buttons button{width:100%;font-size:12px}
  body.phone .compact-controls{grid-template-columns:1fr 1fr 1fr}
}
@media(max-height:720px){.tv .slot{min-height:40px}.tv .run .slot .tile{width:29px;height:39px;font-size:15px}.tv .group .slot .tile{width:32px;height:42px;font-size:16px}.tv .set-title{font-size:11px}.tv .set-owner{display:none}.legend span{font-size:11px;padding:5px 8px}.quick-guide{display:none}.tv-side{grid-template-rows:auto 1fr auto}}

/* v1.3.5: tablero fijo con auto acomodo: escaleras por color y póquer/tercias por número */
.tv .run-area{flex:1.15}.tv .group-area{flex:.85}
.tv .run-area .area-grid{gap:6px}.tv .group-area .area-grid{gap:4px}
.tv .tv-set.run{padding:6px 7px;border-style:solid;background:rgba(2,6,23,.28)}
.tv .tv-set.group{display:grid;grid-template-columns:92px 1fr;align-items:center;gap:6px;padding:4px 6px;border-radius:12px;border-style:solid;background:rgba(2,6,23,.24)}
.tv .tv-set.group .set-head{margin:0;display:block;min-width:0}.tv .tv-set.group .set-owner{display:none}.tv .tv-set.group .set-status{display:none}.tv .tv-set.group .set-title{font-size:14px;color:#e0f2fe;white-space:nowrap}.tv .tv-set.run .set-owner{display:none}.tv .tv-set.run .set-status.empty{display:none}
.tv .tv-set.group .slot-grid.group{max-width:none;grid-template-columns:repeat(4,minmax(34px,1fr));gap:5px}.tv .tv-set.group .slot{min-height:38px;border-radius:8px}.tv .tv-set.group .slot .tile{width:30px;height:37px;font-size:15px;border-radius:8px}.tv .tv-set.group .tile .mini{display:none}
.tv .slot-ghost{display:grid;place-items:center;line-height:1;pointer-events:none}.tv .slot-ghost small{display:block;font-size:7px;opacity:.72;margin-top:1px}.tv .slot-ghost b{font-size:12px}
.tv .slot.occupied{background:rgba(255,255,255,.18);box-shadow:inset 0 0 0 2px rgba(255,255,255,.16),0 0 12px rgba(255,255,255,.08)}
.tv .slot:not(.occupied){background:rgba(0,0,0,.22)}
.tv .lane-blue{border-color:rgba(59,130,246,.55)}.tv .lane-black{border-color:rgba(229,231,235,.38)}.tv .lane-red{border-color:rgba(239,68,68,.55)}.tv .lane-yellow{border-color:rgba(245,158,11,.55)}
.tv .run .slot:not(.occupied).lane-blue{box-shadow:inset 0 0 0 1px rgba(59,130,246,.24)}.tv .run .slot:not(.occupied).lane-black{box-shadow:inset 0 0 0 1px rgba(229,231,235,.18)}.tv .run .slot:not(.occupied).lane-red{box-shadow:inset 0 0 0 1px rgba(239,68,68,.24)}.tv .run .slot:not(.occupied).lane-yellow{box-shadow:inset 0 0 0 1px rgba(245,158,11,.24)}
.tv .group-slot:not(.occupied){box-shadow:inset 0 0 0 1px rgba(255,255,255,.11)}
@media(max-height:720px){.tv .tv-set.group{grid-template-columns:80px 1fr;padding:3px 5px}.tv .tv-set.group .set-title{font-size:12px}.tv .tv-set.group .slot{min-height:32px}.tv .tv-set.group .slot .tile{width:26px;height:32px;font-size:13px}.tv .slot-ghost b{font-size:10px}.tv .slot-ghost small{display:none}.tv .tv-set.run{padding:5px}.tv .run .slot{min-height:36px}.tv .run .slot .tile{width:27px;height:35px;font-size:14px}}


/* v1.3.5: ventana de jugador horizontal en computadora */
.player-desktop-layout{display:grid;gap:14px}
.player-left-column{display:grid;gap:12px;align-content:start}
.player-board-preview{display:none}
.mini-board-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:12px}.mini-board-head h2{margin:0 0 4px}.mini-board-preview-grid{min-height:320px;border:1px solid rgba(255,255,255,.12);border-radius:18px;background:rgba(2,6,23,.25);padding:10px;overflow:auto}.mini-board-split{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr);gap:10px}.mini-section{border:1px solid rgba(255,255,255,.14);border-radius:16px;background:rgba(255,255,255,.045);padding:9px}.mini-section h3{margin:0 0 8px;text-transform:uppercase;letter-spacing:.04em;color:#e0f2fe;font-size:14px}.mini-color-block{border:1px solid rgba(255,255,255,.12);border-radius:14px;padding:7px;margin-bottom:7px;background:rgba(0,0,0,.18)}body.phone .mini-color-title{display:flex;align-items:center;gap:6px;font-size:11px;font-weight:1000;text-transform:uppercase;color:#dbeafe;margin-bottom:5px}.mini-color-title span{width:9px;height:9px;border-radius:50%;display:inline-block}.color-blue .mini-color-title span{background:#3b82f6}.color-black .mini-color-title span{background:#e5e7eb}.color-red .mini-color-title span{background:#ef4444}.color-yellow .mini-color-title span{background:#f59e0b}.mini-run-row{display:grid;grid-template-columns:25px 1fr;gap:5px;align-items:center;margin:4px 0}.mini-row-tag{height:25px;border:1px solid rgba(255,255,255,.2);border-radius:7px;display:grid;place-items:center;font-weight:1000;font-size:11px;background:rgba(255,255,255,.08)}.mini-slots{display:grid;gap:3px}.run-slots{grid-template-columns:repeat(13,minmax(20px,1fr))}.group-slots{grid-template-columns:repeat(4,minmax(26px,1fr))}.mini-slot{position:relative;display:grid;place-items:center;min-height:28px;border:1px dashed rgba(255,255,255,.22);border-radius:7px;background:rgba(0,0,0,.22);overflow:hidden}.mini-slot.occupied{border-style:solid;background:rgba(255,255,255,.14);box-shadow:inset 0 0 0 1px rgba(255,255,255,.12)}.mini-ghost{position:absolute;inset:0;display:grid;place-items:center;font-size:9px;font-weight:1000;color:rgba(255,255,255,.38);pointer-events:none}.mini-ghost small{display:none}.mini-ghost b{font-size:10px}.mini-board-tile{width:24px!important;height:27px!important;margin:0!important;border-radius:6px!important;font-size:11px!important;box-shadow:0 3px 0 rgba(0,0,0,.25)!important;z-index:2}.mini-board-tile .mini{display:none}.mini-group-head{display:grid;grid-template-columns:34px repeat(4,1fr);gap:4px;color:#b6c2d1;font-size:9px;font-weight:1000;text-align:center;margin-bottom:5px}.mini-group-row{display:grid;grid-template-columns:34px 1fr;gap:5px;align-items:center;margin:4px 0}.mini-number{height:28px;border-radius:7px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.12);display:grid;place-items:center;font-size:12px;font-weight:1000}
@media(min-width:900px){
  body.phone{overflow:hidden}
  body.phone .wrap{width:calc(100vw - 24px);max-width:1680px;height:100vh;padding:12px 0 14px;display:flex;flex-direction:column}
  body.phone .phone-header{flex:0 0 auto;margin-bottom:10px}
  body.phone .phone-game{min-height:0;flex:1;display:block}
  body.phone .player-desktop-layout{height:100%;min-height:0;display:grid;grid-template-columns:420px minmax(0,1fr);gap:14px}
  body.phone .player-left-column{min-height:0;overflow:auto;padding-right:2px}
  body.phone .player-board-preview{display:block;min-width:0;min-height:0;overflow:hidden;padding:14px}
  body.phone .mobile-rack-card{position:static;max-height:none;overflow:visible;border-radius:22px;background:linear-gradient(180deg,rgba(15,23,42,.88),rgba(3,7,18,.9));box-shadow:0 18px 45px rgba(0,0,0,.25)}
  body.phone .mobile-rack{max-height:38vh;min-height:190px;justify-content:flex-start;align-content:flex-start}
  body.phone .mobile-rack .tile{width:54px;height:70px;font-size:26px;margin:4px}
  body.phone .mobile-rack .tile .mini{font-size:8px}
  body.phone .mobile-buttons{grid-template-columns:repeat(2,1fr)}
  body.phone .mobile-buttons button, body.phone .backup-mobile{font-size:13px;min-height:46px;padding:10px}
  body.phone .compact-controls{grid-template-columns:1fr 70px 78px}
  .mini-board-preview-grid{height:calc(100vh - 180px);overflow:auto}
}
@media(min-width:1250px){body.phone .player-desktop-layout{grid-template-columns:460px minmax(0,1fr)}.mini-board-preview-grid{overflow:hidden}.mini-slot{min-height:30px}.mini-board-tile{width:25px!important;height:29px!important}}
@media(max-width:899px){.player-desktop-layout{display:block}.player-board-preview{display:none!important}}

/* v1.3.8: tablero unificado en index, pantalla y admin + validación por jugadores */
.pending-tile{opacity:.62;filter:saturate(.75);box-shadow:0 0 0 2px rgba(255,255,255,.22),0 0 18px rgba(250,204,21,.45)!important;animation:pendingPulse 1.4s ease-in-out infinite}.pending-tile::before{content:'VALIDAR';position:absolute;left:50%;bottom:-12px;transform:translateX(-50%);font-size:6px;letter-spacing:.08em;background:rgba(250,204,21,.92);color:#111827;border-radius:999px;padding:1px 4px;z-index:4}@keyframes pendingPulse{0%,100%{opacity:.52}50%{opacity:.88}}
.approval-panel{margin-top:10px;padding:10px;border:1px solid rgba(250,204,21,.35);border-radius:16px;background:rgba(250,204,21,.09)}.approval-panel b{color:#fde68a}.approval-panel .row{margin-top:8px}.approval-status{padding:10px;border-radius:16px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.06)}.approval-status.pending{border-color:rgba(250,204,21,.35);background:rgba(250,204,21,.08)}.approval-status.ok{border-color:rgba(34,197,94,.38);background:rgba(34,197,94,.09)}.approval-status b{display:block;margin-bottom:4px}.approval-status p{margin:4px 0;line-height:1.35}.last-action{font-weight:1000;font-size:17px;margin-top:6px;line-height:1.25}

/* Pantalla limpia: usa el mismo tablero miniatura del index, pero escalado para TV */
body.tv-v138{padding:12px}.clean-tv-shell{height:calc(100vh - 24px);grid-template-columns:minmax(0,1fr) 295px;gap:12px}.clean-tv-main{padding:14px;display:grid!important;grid-template-rows:auto minmax(0,1fr) auto;gap:10px}.clean-tv-header{margin:0}.clean-tv-header h1{font-size:34px}.clean-tv-header .logo{width:54px;height:54px}.status-pills .pill{padding:10px 14px}.tv-board-card{padding:10px;min-height:0;overflow:hidden}.tv-unified-board{height:100%;min-height:0;overflow:hidden;border-radius:18px;padding:12px;background:rgba(2,6,23,.28)}.tv-unified-board .mini-board-split{height:100%;grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr);gap:12px}.tv-unified-board .mini-section{min-height:0;overflow:hidden;padding:10px;border-radius:18px}.tv-unified-board .mini-section h3{font-size:19px;margin-bottom:10px;text-align:center}.tv-unified-board .mini-color-block{padding:7px 8px;margin-bottom:8px;border-radius:15px}.tv-unified-board .mini-color-title{font-size:12px;margin-bottom:5px}.tv-unified-board .mini-run-row{grid-template-columns:32px 1fr;gap:6px;margin:5px 0}.tv-unified-board .mini-row-tag{height:31px;font-size:13px;border-radius:9px}.tv-unified-board .mini-slots{gap:4px}.tv-unified-board .run-slots{grid-template-columns:repeat(13,minmax(26px,1fr))}.tv-unified-board .mini-slot{min-height:33px;border-radius:8px}.tv-unified-board .mini-board-tile{width:27px!important;height:31px!important;font-size:13px!important;border-radius:7px!important}.tv-unified-board .mini-ghost{font-size:10px}.tv-unified-board .mini-ghost b{font-size:11px}.tv-unified-board .mini-group-head{grid-template-columns:36px repeat(4,1fr);font-size:10px;margin-bottom:6px}.tv-unified-board .mini-group-row{grid-template-columns:36px 1fr;gap:6px;margin:5px 0}.tv-unified-board .mini-number{height:31px;font-size:13px;border-radius:8px}.tv-unified-board .group-slots{grid-template-columns:repeat(4,minmax(34px,1fr))}.tv-bottom-note{display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.06);border-radius:18px;padding:10px 12px;color:#dbeafe;font-weight:900;font-size:12px}.clean-side{grid-template-rows:auto auto 1fr auto;gap:10px}.clean-side .card{padding:15px;border-radius:20px}.clean-side h2{font-size:22px;margin-bottom:10px}.players-card{overflow:hidden}.turn-card .stat{padding:10px}.approval-card{border-color:rgba(250,204,21,.22)}

/* Admin: tablero igual a Pantalla, sin taches sobre fichas */
.admin-clean-layout{grid-template-columns:390px minmax(0,1fr)}.admin-board-card{min-height:0}.admin-unified-board{height:calc(100vh - 260px);min-height:540px;overflow:auto;border-radius:18px;background:rgba(2,6,23,.28)}.admin-unified-board .mini-board-split{grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr);gap:12px}.admin-unified-board .mini-section{padding:10px}.admin-unified-board .mini-section h3{font-size:18px;text-align:center}.admin-unified-board .mini-slot{min-height:33px}.admin-unified-board .mini-board-tile{width:27px!important;height:31px!important;font-size:13px!important}.mini-validation{min-width:150px;text-align:right}.admin-v138 .tile-remove{display:none!important}

/* Mantener el celular centrado en fichas y botones */
@media(max-width:899px){.approval-panel{font-size:12px}.approval-panel .row{display:grid;grid-template-columns:1fr 1fr}.approval-panel .row button{width:100%}body.phone .mobile-rack-card{z-index:30}.mini-board-preview-grid{height:auto}.pending-tile::before{display:none}}
@media(max-width:1200px){.clean-tv-shell{grid-template-columns:1fr}.clean-side{display:none}.tv-unified-board .mini-board-split{grid-template-columns:1fr}.tv-unified-board{overflow:auto}.tv-bottom-note{display:none}}
@media(max-height:760px){.clean-tv-header h1{font-size:28px}.clean-tv-header .sub{font-size:13px}.clean-tv-header .logo{width:46px;height:46px}.status-pills .pill{padding:7px 10px}.tv-unified-board .mini-section h3{font-size:15px;margin-bottom:6px}.tv-unified-board .mini-color-block{padding:5px 6px;margin-bottom:5px}.tv-unified-board .mini-run-row{grid-template-columns:26px 1fr;margin:3px 0}.tv-unified-board .mini-row-tag{height:24px;font-size:10px}.tv-unified-board .mini-slot{min-height:25px}.tv-unified-board .mini-board-tile{width:22px!important;height:25px!important;font-size:10px!important}.tv-unified-board .mini-number{height:24px;font-size:11px}.tv-unified-board .mini-group-row{margin:3px 0;grid-template-columns:30px 1fr}.tv-unified-board .mini-group-head{grid-template-columns:30px repeat(4,1fr);font-size:9px}.tv-bottom-note{padding:7px 10px;font-size:11px}.clean-side .card{padding:12px}.clean-side h2{font-size:18px}}


/* v1.3.8: tablero 1-13, validación más clara y móvil horizontal */
.instructions-toggle{width:auto;align-self:flex-start;padding:8px 11px;font-size:12px;box-shadow:none}
.mobile-instructions.hidden{display:none!important}
.finish-disabled-note{font-size:11px;color:#fde68a;text-align:center;margin-top:4px;font-weight:900}
.mini-slot.group-blue{border-color:rgba(59,130,246,.65);box-shadow:inset 0 0 0 1px rgba(59,130,246,.18)}
.mini-slot.group-black{border-color:rgba(229,231,235,.55);box-shadow:inset 0 0 0 1px rgba(229,231,235,.15)}
.mini-slot.group-red{border-color:rgba(239,68,68,.65);box-shadow:inset 0 0 0 1px rgba(239,68,68,.18)}
.mini-slot.group-yellow{border-color:rgba(245,158,11,.70);box-shadow:inset 0 0 0 1px rgba(245,158,11,.18)}
.mini-slot.group-blue.occupied,.mini-slot.group-black.occupied,.mini-slot.group-red.occupied,.mini-slot.group-yellow.occupied{box-shadow:inset 0 0 0 2px rgba(255,255,255,.14),0 0 14px rgba(255,255,255,.08)}
.tv-unified-board .run-slots{grid-template-columns:repeat(13,minmax(22px,1fr))}
.tv-unified-board .mini-board-tile{width:24px!important;height:29px!important;font-size:12px!important}
.tv-unified-board .mini-slot{min-height:31px}
.tv-unified-board .mini-color-block{margin-bottom:6px}
.tv-unified-board .mini-section h3{margin-bottom:7px}
.admin-unified-board .run-slots{grid-template-columns:repeat(13,minmax(22px,1fr))}
.admin-unified-board .mini-board-tile{width:24px!important;height:29px!important;font-size:12px!important}
@media(max-height:760px){.tv-unified-board .run-slots{grid-template-columns:repeat(13,minmax(18px,1fr))}.tv-unified-board .mini-board-tile{width:20px!important;height:24px!important;font-size:10px!important}.tv-unified-board .mini-slot{min-height:24px}}
@media(max-width:899px) and (orientation:landscape){
  body.phone{overflow:hidden}
  body.phone .wrap{width:calc(100vw - 10px);height:100vh;padding:6px 0;display:flex;flex-direction:column}
  body.phone .phone-header{display:none}
  body.phone .login-card{margin-top:8px}
  body.phone .phone-game{display:block;min-height:0;flex:1}
  body.phone .player-desktop-layout{height:100vh;display:grid;grid-template-columns:42vw minmax(0,1fr);gap:8px;min-height:0}
  body.phone .player-left-column{min-height:0;overflow:auto;display:flex;flex-direction:column;gap:6px}
  body.phone .mobile-status-card{padding:8px;border-radius:14px}
  body.phone .mobile-status-card h2{font-size:15px;margin-bottom:2px}
  body.phone .mobile-status-card .pill{display:none}
  body.phone .turn-assist{font-size:11px;padding:7px;margin-top:6px}
  body.phone .instructions-toggle{padding:6px 8px;font-size:11px}
  body.phone .mobile-instructions{position:absolute;left:8px;top:8px;z-index:90;width:min(52vw,420px);font-size:11px;padding:10px;box-shadow:0 18px 50px rgba(0,0,0,.45)}
  body.phone .mobile-rack-card{position:static;flex:1;max-height:none;min-height:0;overflow:auto;border-radius:16px;padding:7px}
  body.phone .rack-title-row{margin-bottom:4px}.rack-title-row .small{display:none}
  body.phone .mobile-rack{min-height:88px;max-height:31vh;justify-content:flex-start;padding:5px}
  body.phone .mobile-rack .tile{width:35px;height:46px;font-size:17px;margin:1px;border-radius:8px}
  body.phone .mobile-rack .tile .mini{display:none}
  body.phone .compact-controls{grid-template-columns:1fr 54px 62px;gap:4px;margin:5px 0}
  body.phone .compact-controls button,body.phone .compact-controls select{font-size:10px;padding:6px}
  body.phone .mobile-buttons{grid-template-columns:repeat(2,1fr);gap:5px;margin-top:5px}
  body.phone .mobile-buttons button,body.phone .backup-mobile{min-height:34px;font-size:10px;padding:6px;border-radius:10px}
  body.phone .player-board-preview{display:block!important;min-width:0;min-height:0;overflow:hidden;padding:7px;border-radius:16px}
  body.phone .mini-board-head{margin-bottom:5px}.mini-board-head .muted,.mini-board-head a{display:none}.mini-board-head h2{font-size:13px;margin:0}
  body.phone .mini-board-preview-grid{height:calc(100vh - 58px);min-height:0;overflow:auto;padding:5px;border-radius:12px}
  body.phone .mini-board-split{grid-template-columns:1fr;gap:5px}
  body.phone .mini-section{padding:5px;border-radius:10px}.mini-section h3{font-size:10px;margin-bottom:4px}
  body.phone .mini-color-block{padding:4px;margin-bottom:4px}body.phone .mini-color-title{font-size:8px;margin-bottom:2px}
  body.phone .mini-run-row{grid-template-columns:18px 1fr;gap:3px;margin:2px 0}.mini-row-tag{height:18px;font-size:8px;border-radius:5px}
  body.phone .mini-slots{gap:2px}.run-slots{grid-template-columns:repeat(13,minmax(14px,1fr))}.group-slots{grid-template-columns:repeat(4,minmax(18px,1fr))}
  body.phone .mini-slot{min-height:20px;border-radius:5px}.mini-board-tile{width:17px!important;height:20px!important;font-size:8px!important;border-radius:4px!important}.mini-ghost{font-size:7px}.mini-ghost b{font-size:8px}.mini-group-head{font-size:7px;grid-template-columns:22px repeat(4,1fr)}.mini-group-row{grid-template-columns:22px 1fr;margin:2px 0}.mini-number{height:20px;font-size:9px;border-radius:5px}
}


/* v1.3.8: móvil horizontal más aprovechado, mini tablero ajustable y botón de pantalla completa */
:root{--app-height:100dvh}
.button-pill{appearance:none;border:1px solid var(--line);background:rgba(255,255,255,.08);color:#e2e8f0;cursor:pointer;font:inherit;font-weight:900}
.landscape-fullscreen{display:none}
@media(max-width:899px){
  body.phone{min-height:var(--app-height)}
  body.phone .wrap{min-height:var(--app-height)}
  body.phone .mobile-status-card{position:relative}
  body.phone .turn-assist{line-height:1.25}
  body.phone .approval-panel{border-radius:13px;padding:8px;margin-top:7px}
}
@media(max-width:899px) and (orientation:portrait){
  body.phone .phone-header .brand .sub{display:none}
  body.phone .player-board-preview{display:none!important}
  body.phone .mobile-rack{max-height:34vh}
  body.phone .mobile-rack .tile{width:40px;height:54px;font-size:20px}
  body.phone .compact-controls{grid-template-columns:1fr 1fr 1fr auto}
  body.phone .landscape-fullscreen{display:inline-flex;align-items:center;justify-content:center}
}
@media(max-width:899px) and (orientation:landscape){
  body.phone{height:var(--app-height);overflow:hidden;background:radial-gradient(circle at 30% 10%,rgba(59,130,246,.22),transparent 34%),var(--bg)}
  body.phone .wrap{width:calc(100vw - 8px);height:var(--app-height);min-height:0;padding:4px 0;display:flex;flex-direction:column}
  body.phone .phone-header{display:none!important}
  body.phone .phone-game{display:block;min-height:0;flex:1}
  body.phone .player-desktop-layout{height:calc(var(--app-height) - 8px);display:grid;grid-template-columns:minmax(258px,39vw) minmax(0,1fr);gap:7px;min-height:0}
  body.phone .player-left-column{min-height:0;overflow:hidden;display:flex;flex-direction:column;gap:5px;padding:0}
  body.phone .mobile-status-card{flex:0 0 auto;padding:6px 8px;border-radius:13px;background:linear-gradient(90deg,rgba(15,23,42,.95),rgba(30,41,59,.88));box-shadow:none}
  body.phone .mobile-status-card .row{display:grid;grid-template-columns:1fr auto;align-items:center;gap:6px}
  body.phone .mobile-status-card h2{font-size:13px;line-height:1;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  body.phone .mobile-status-card .pill{display:inline-flex;font-size:10px;padding:4px 6px}
  body.phone #playerStatus{display:none}
  body.phone .turn-assist{font-size:10.5px;padding:5px 7px;margin-top:4px;border-radius:10px;max-height:34px;overflow:hidden}
  body.phone .turn-assist .badge{font-size:9px;padding:3px 5px;margin-right:3px}
  body.phone .approval-panel{font-size:10px;padding:6px;margin-top:4px}.approval-panel p{margin:3px 0}.approval-panel .mini-btn{min-height:28px;padding:5px 6px;font-size:10px}
  body.phone .instructions-toggle{position:absolute;right:4px;top:4px;z-index:60;padding:4px 6px;font-size:0;border-radius:9px;opacity:.82}.instructions-toggle::after{content:'?';font-size:11px}
  body.phone .mobile-instructions{position:absolute;left:6px;top:6px;z-index:90;width:min(48vw,380px);font-size:10px;padding:9px;box-shadow:0 18px 50px rgba(0,0,0,.45)}
  body.phone .mobile-rack-card{position:static;flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;border-radius:14px;padding:6px;background:linear-gradient(180deg,rgba(15,23,42,.92),rgba(3,7,18,.94));box-shadow:none}
  body.phone .rack-title-row{display:grid;grid-template-columns:1fr auto;gap:4px;align-items:center;margin-bottom:4px}.rack-title-row .small{display:none!important}.mini-pill{font-size:9px;padding:4px 6px}
  body.phone .mobile-rack{flex:1;min-height:0;max-height:none;overflow:auto;justify-content:flex-start;align-content:flex-start;padding:4px;border-radius:12px;gap:1px}
  body.phone .mobile-rack .tile{width:34px;height:45px;font-size:17px;margin:1px;border-radius:8px}.mobile-rack .tile .mini{display:none!important}
  body.phone .compact-controls{flex:0 0 auto;display:grid;grid-template-columns:minmax(80px,1fr) 48px 56px 34px;gap:4px;margin:4px 0}
  body.phone .compact-controls button,body.phone .compact-controls select{font-size:10px;padding:5px 4px;min-height:30px;border-radius:9px}
  body.phone .landscape-fullscreen{display:inline-flex;align-items:center;justify-content:center}
  body.phone .mobile-buttons{flex:0 0 auto;grid-template-columns:repeat(4,1fr);gap:4px;margin-top:3px}
  body.phone .mobile-buttons button,body.phone .backup-mobile{min-height:31px;font-size:9.5px;padding:5px 4px;border-radius:9px;line-height:1.05}
  body.phone .backup-mobile{margin-top:4px;min-height:28px}
  body.phone .mobile-hint{display:none}
  body.phone .player-board-preview{display:block!important;min-width:0;min-height:0;overflow:hidden;padding:6px;border-radius:14px}
  body.phone .mini-board-head{display:none!important}
  body.phone .mini-board-preview-grid{height:100%;min-height:0;overflow:hidden;padding:4px;border-radius:11px}
  body.phone .mini-board-split{height:100%;display:grid;grid-template-columns:minmax(0,1.17fr) minmax(0,.83fr);gap:5px}
  body.phone .mini-section{min-height:0;overflow:hidden;padding:4px;border-radius:9px}.mini-section h3{font-size:9px;margin-bottom:3px;letter-spacing:.02em}
  body.phone .mini-color-block{padding:3px;margin-bottom:3px;border-radius:8px}body.phone .mini-color-title{font-size:7px;margin-bottom:1px;line-height:1}.mini-color-title span{width:6px;height:6px}
  body.phone .mini-run-row{grid-template-columns:15px 1fr;gap:2px;margin:1px 0}.mini-row-tag{height:15px;font-size:7px;border-radius:4px}
  body.phone .mini-slots{gap:1px}.run-slots{grid-template-columns:repeat(13,minmax(8px,1fr))}.group-slots{grid-template-columns:repeat(4,minmax(12px,1fr))}
  body.phone .mini-slot{min-height:15px;border-radius:4px;border-width:1px}.mini-board-tile{width:14px!important;height:16px!important;font-size:7px!important;border-radius:3px!important}.mini-ghost{font-size:6px}.mini-ghost b{font-size:7px}.mini-group-head{font-size:6px;grid-template-columns:18px repeat(4,1fr);gap:1px;margin-bottom:2px}.mini-group-row{grid-template-columns:18px 1fr;margin:1px 0;gap:2px}.mini-number{height:15px;font-size:7px;border-radius:4px}
}
@media(max-width:899px) and (orientation:landscape) and (max-height:430px){
  body.phone .player-desktop-layout{grid-template-columns:minmax(250px,38vw) minmax(0,1fr);gap:5px}
  body.phone .mobile-status-card{padding:4px 6px}.mobile-status-card h2{font-size:12px!important}.turn-assist{display:none!important}
  body.phone .mobile-rack .tile{width:30px;height:39px;font-size:15px}
  body.phone .mobile-buttons button,body.phone .backup-mobile{min-height:27px;font-size:8.8px;padding:4px 3px}
  body.phone .compact-controls button,body.phone .compact-controls select{min-height:27px;font-size:9px}
  body.phone .mini-section h3{display:none}.mini-color-block{margin-bottom:2px!important;padding:2px!important}body.phone .mini-color-title{display:none!important}
  body.phone .mini-slot{min-height:13px}.mini-board-tile{width:12px!important;height:14px!important;font-size:6px!important}.mini-row-tag,.mini-number{height:13px!important;font-size:6px!important}.mini-run-row{grid-template-columns:13px 1fr!important}.mini-group-row{grid-template-columns:16px 1fr!important}
}

/* v1.3.9: móvil más limpio, movimientos desde tablero miniatura y botones prioritarios */
.board-move-tile{cursor:pointer}
.mini-slot.move-target{outline:1px solid rgba(56,189,248,.35);box-shadow:inset 0 0 0 1px rgba(56,189,248,.18)}
.mini-slot.move-target:hover{background:rgba(56,189,248,.16)}
body.phone .mobile-buttons{grid-template-columns:1.25fr 1fr 1fr 1fr}
body.phone .mobile-buttons button{white-space:normal}
body.phone .backup-mobile{background:rgba(239,68,68,.12);border-color:rgba(239,68,68,.28);color:#fecaca}
body.phone .turn-assist{max-height:30px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
body.phone .approval-panel button{width:auto}
@media(max-width:899px){
  body.phone .mobile-buttons{grid-template-columns:repeat(4,1fr)}
  body.phone .mobile-buttons button{font-size:9px;min-height:30px}
  body.phone .backup-mobile{font-size:9px}
  body.phone .instructions-toggle{opacity:.7}
}
@media(max-width:520px) and (orientation:portrait){
  body.phone .player-desktop-layout{grid-template-columns:1fr!important}
  body.phone .player-board-preview{display:none!important}
  body.phone .mobile-rack .tile{width:38px;height:50px;font-size:19px}
  body.phone .mobile-rack{max-height:none}
}

/* v1.3.10: móvil prioriza bandeja arriba, orden por color/número y elimina estorbos de header */
@media(max-width:899px){
  body.phone.in-game{height:var(--app-height);overflow:hidden}
  body.phone.in-game .phone-header{display:none!important}
  body.phone.in-game .wrap{width:calc(100vw - 8px);height:var(--app-height);min-height:0;padding:4px 0;display:flex;flex-direction:column}
  body.phone.in-game .phone-game{display:block;flex:1;min-height:0}
  body.phone.in-game .player-desktop-layout{height:calc(var(--app-height) - 8px);min-height:0}
  body.phone.in-game .player-left-column{display:flex;flex-direction:column;min-height:0;overflow:hidden;gap:5px}

  /* La bandeja sube al primer lugar en celulares */
  body.phone.in-game .mobile-rack-card{order:1;display:flex;flex-direction:column;min-height:0;overflow:hidden;box-shadow:none}
  body.phone.in-game .mobile-status-card{order:2;flex:0 0 auto;padding:6px 8px;border-radius:13px;box-shadow:none;background:linear-gradient(90deg,rgba(15,23,42,.96),rgba(30,41,59,.88))}
  body.phone.in-game .instructions-toggle{order:3;align-self:flex-end;opacity:.55;font-size:0;padding:4px 6px;min-height:24px;border-radius:8px;box-shadow:none}
  body.phone.in-game .instructions-toggle::after{content:'?';font-size:11px;font-weight:1000}
  body.phone.in-game .mobile-instructions{order:4;max-height:34vh;overflow:auto;font-size:10px;padding:8px;border-radius:12px}

  body.phone.in-game .rack-title-row{display:grid;grid-template-columns:1fr auto;gap:5px;align-items:center;margin-bottom:4px}
  body.phone.in-game .rack-title-row b{font-size:13px;letter-spacing:-.02em}
  body.phone.in-game .rack-title-row .small{display:none!important}
  body.phone.in-game .mini-pill{font-size:9px;padding:4px 6px}
  body.phone.in-game .mobile-rack{flex:1;min-height:0;overflow:auto;justify-content:flex-start;align-content:flex-start;padding:5px;border-radius:12px;background:rgba(2,6,23,.32);gap:2px}
  body.phone.in-game .mobile-rack .tile{margin:1px;border-radius:8px}
  body.phone.in-game .mobile-rack .tile .mini{display:none!important}

  /* Ordenar por color/número queda pegado a la bandeja */
  body.phone.in-game .compact-controls{order:2;display:grid;grid-template-columns:minmax(84px,1fr) 64px 70px 34px;gap:4px;margin:4px 0 3px}
  body.phone.in-game .compact-controls button,
  body.phone.in-game .compact-controls select{min-height:30px;font-size:10px;padding:5px 4px;border-radius:9px;box-shadow:none}
  body.phone.in-game .mobile-buttons{order:3;display:grid;grid-template-columns:1.25fr 1fr 1fr 1fr;gap:4px;margin-top:2px}
  body.phone.in-game .mobile-buttons button{min-height:31px;font-size:9.5px;line-height:1.05;padding:5px 4px;border-radius:9px;box-shadow:none}
  body.phone.in-game .backup-mobile{order:4;margin-top:3px;min-height:27px;font-size:9px;padding:5px 4px;border-radius:9px;box-shadow:none}
  body.phone.in-game .mobile-hint{display:none!important}

  /* Barra de turno pequeña, sin ocupar pantalla */
  body.phone.in-game .mobile-status-card .row{display:grid;grid-template-columns:1fr auto;align-items:center;gap:5px}
  body.phone.in-game .mobile-status-card h2{font-size:12px;line-height:1;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
  body.phone.in-game #playerStatus{display:none!important}
  body.phone.in-game .mobile-status-card .pill{font-size:9px;padding:4px 6px}
  body.phone.in-game .turn-assist{font-size:10px;line-height:1.1;margin-top:4px;padding:5px 6px;max-height:25px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-radius:9px}
  body.phone.in-game .turn-assist .badge{font-size:8.5px;padding:2px 5px;margin-right:3px}
  body.phone.in-game .approval-panel{font-size:9.5px;padding:6px;margin-top:4px;border-radius:10px}
  body.phone.in-game .approval-panel p{margin:2px 0}.approval-panel .mini-btn{min-height:26px;font-size:9px;padding:5px 6px}
}

@media(max-width:899px) and (orientation:portrait){
  body.phone.in-game .player-desktop-layout{display:grid;grid-template-columns:1fr!important;gap:0;height:calc(var(--app-height) - 8px)}
  body.phone.in-game .player-board-preview{display:none!important}
  body.phone.in-game .mobile-rack-card{flex:1 1 auto;padding:7px;border-radius:14px}
  body.phone.in-game .mobile-rack{max-height:none}
  body.phone.in-game .mobile-rack .tile{width:42px;height:55px;font-size:20px}
  body.phone.in-game .mobile-status-card{flex:0 0 auto;margin-top:4px}
  body.phone.in-game .compact-controls{grid-template-columns:minmax(92px,1fr) 1fr 1fr 34px}
  body.phone.in-game .mobile-buttons{grid-template-columns:1.2fr 1fr 1fr 1fr}
}

@media(max-width:899px) and (orientation:landscape){
  body.phone.in-game .player-desktop-layout{display:grid;grid-template-columns:minmax(300px,45vw) minmax(0,1fr);gap:6px;height:calc(var(--app-height) - 8px)}
  body.phone.in-game .mobile-rack-card{padding:6px;border-radius:14px;flex:1 1 auto}
  body.phone.in-game .mobile-rack .tile{width:34px;height:44px;font-size:17px}
  body.phone.in-game .player-board-preview{display:block!important;min-width:0;min-height:0;overflow:hidden;padding:5px;border-radius:14px}
  body.phone.in-game .mini-board-head{display:none!important}
  body.phone.in-game .mini-board-preview-grid{height:100%;min-height:0;overflow:hidden;padding:4px;border-radius:11px}
}

@media(max-width:899px) and (orientation:landscape) and (max-height:430px){
  body.phone.in-game .player-desktop-layout{grid-template-columns:minmax(310px,47vw) minmax(0,1fr);gap:5px}
  body.phone.in-game .mobile-status-card{padding:4px 6px}
  body.phone.in-game .turn-assist{display:none!important}
  body.phone.in-game .mobile-rack .tile{width:31px;height:39px;font-size:15px}
  body.phone.in-game .mobile-buttons button{min-height:26px;font-size:8.6px;padding:4px 3px}
  body.phone.in-game .compact-controls button,
  body.phone.in-game .compact-controls select{min-height:26px;font-size:8.8px}
  body.phone.in-game .backup-mobile{min-height:24px;font-size:8.6px}
}


/* v1.3.11: movimiento más claro en fantasmas, fichas sueltas y tablero miniatura táctil */
.mini-slot.move-target{cursor:pointer;outline:2px solid rgba(56,189,248,.45);box-shadow:inset 0 0 0 1px rgba(56,189,248,.2),0 0 12px rgba(56,189,248,.10)}
.mini-slot.move-target:not(.occupied):active{background:rgba(56,189,248,.22)}
.pending-tile{filter:drop-shadow(0 0 10px rgba(250,204,21,.85));outline:2px solid rgba(250,204,21,.85)!important}
.pending-tile::before{content:'pendiente';position:absolute;left:50%;top:-12px;transform:translateX(-50%);font-size:7px;text-transform:uppercase;letter-spacing:.04em;background:rgba(250,204,21,.92);color:#111827;border-radius:999px;padding:1px 5px;z-index:6}
body.phone.in-game .phone-header{display:none!important}
body.phone.in-game .instructions-toggle{display:none!important}
body.phone.in-game .mobile-status-card{font-size:10px}
@media(max-width:899px){
  body.phone.in-game .approval-panel{max-height:82px;overflow:auto}
  body.phone.in-game .mobile-status-card h2{display:none}
  body.phone.in-game .mobile-status-card .row{display:flex;justify-content:space-between}
  body.phone.in-game .rack-title-row{margin-bottom:3px}
  body.phone.in-game .mobile-rack-card{order:1!important}
  body.phone.in-game .mobile-status-card{order:2!important}
  body.phone.in-game .player-board-preview{order:3!important}
}
@media(max-width:899px) and (orientation:portrait){
  body.phone.in-game .mobile-rack .tile{width:40px;height:52px;font-size:20px}
}
@media(max-width:899px) and (orientation:landscape){
  body.phone.in-game .mobile-rack-card{order:1!important}
  body.phone.in-game .player-board-preview{order:2!important}
  body.phone.in-game .mobile-rack{max-height:none}
}

/* v1.3.12: botón de maximizar siempre disponible en móvil y modo reacomodo más claro */
.mobile-fullscreen-fab{display:none;position:fixed;right:8px;top:8px;z-index:120;width:38px!important;height:34px!important;min-height:0!important;padding:0!important;border-radius:12px!important;background:rgba(56,189,248,.20)!important;border:1px solid rgba(56,189,248,.55)!important;color:#e0f2fe!important;box-shadow:0 10px 28px rgba(0,0,0,.35)!important;font-size:18px!important;line-height:1!important}
body.phone.in-game .mini-slot.move-target{outline:2px solid rgba(34,197,94,.60)!important;box-shadow:inset 0 0 0 1px rgba(34,197,94,.22),0 0 14px rgba(34,197,94,.18)!important}
body.phone.in-game .mini-slot.move-target .mini-ghost{font-weight:1000;opacity:.96}
body.phone.in-game .mini-slot.occupied.move-target{outline-color:rgba(250,204,21,.65)!important}
body.phone.in-game .board-move-tile.tap-moving{outline:3px solid #22c55e!important;filter:drop-shadow(0 0 12px rgba(34,197,94,.85))}
@media(max-width:899px){
  body.phone.in-game .mobile-fullscreen-fab{display:grid;place-items:center}
  body.phone.in-game .compact-controls .landscape-fullscreen{display:inline-flex!important;align-items:center;justify-content:center}
}
@media(max-width:899px) and (orientation:landscape){
  body.phone.in-game .mobile-fullscreen-fab{top:auto;bottom:8px;right:8px;width:34px!important;height:30px!important;font-size:15px!important;opacity:.82}
}

/* v1.3.13 · validación compacta + zonas de arrastre */
.approval-button{
  margin-top:8px;width:100%;border:1px solid rgba(250,204,21,.45);border-radius:14px;
  background:linear-gradient(180deg,rgba(250,204,21,.18),rgba(250,204,21,.08));
  color:#fde68a;font-weight:1000;padding:9px 10px;box-shadow:none;cursor:pointer
}
.approval-modal{position:fixed;inset:0;z-index:300;display:grid;place-items:center;background:rgba(2,6,23,.62);backdrop-filter:blur(6px);padding:18px}
.approval-dialog{position:relative;width:min(92vw,520px);max-height:86vh;overflow:auto;border:1px solid rgba(250,204,21,.35);border-radius:22px;background:linear-gradient(180deg,rgba(15,23,42,.98),rgba(2,6,23,.98));box-shadow:0 28px 80px rgba(0,0,0,.55);padding:18px}
.approval-dialog h3{margin:0 36px 8px 0;color:#fde68a;font-size:20px}.approval-close{position:absolute;right:10px;top:10px;width:32px;height:32px;border-radius:11px;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.09);color:white;font-size:22px;line-height:1;cursor:pointer}.approval-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}.mini-drop-zone{transition:outline .15s ease,background .15s ease,transform .15s ease}.mini-drop-zone.drag-over{outline:3px solid rgba(34,197,94,.6);background:rgba(34,197,94,.10);transform:scale(.998)}.mini-section h3 small{font-size:10px;color:#7dd3fc;text-transform:none;letter-spacing:0;margin-left:6px}.mini-board-tile,.mobile-rack .tile{cursor:grab}.mini-board-tile:active,.mobile-rack .tile:active{cursor:grabbing}.button-pill,.landscape-fullscreen,.mobile-fullscreen-fab{white-space:nowrap}
@media(max-width:900px){
  body.phone.in-game .approval-button{position:fixed;right:8px;top:8px;z-index:125;width:auto;max-width:44vw;margin:0;padding:7px 9px;font-size:10px;border-radius:12px;background:rgba(250,204,21,.18);backdrop-filter:blur(8px)}
  body.phone.in-game .approval-dialog{width:min(94vw,440px);padding:14px;border-radius:18px}
  body.phone.in-game .approval-dialog h3{font-size:16px}.approval-actions{grid-template-columns:1fr;gap:8px}
  body.phone.in-game .approval-panel{display:none!important}
}
@media(max-width:900px) and (orientation:landscape){
  body.phone.in-game .approval-button{top:6px;right:46px;font-size:9px;padding:6px 8px;max-width:36vw}
  body.phone.in-game .mobile-fullscreen-fab{z-index:130}
}

/* v1.3.14: Póquer/Tercias con dos líneas por número, número de referencia al centro */
.mini-board-split-v1314{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.mini-groups-v1314 .mini-group-head{display:none!important}
.mini-group-pair-head{display:grid;grid-template-columns:minmax(0,1fr) 30px minmax(0,1fr);gap:5px;align-items:end;margin:0 0 5px}
.mini-group-colhead{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:3px;text-align:center;color:#b6c2d1;font-size:8px;font-weight:1000;line-height:1}
.mini-group-colhead b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mini-group-pair-row{display:grid;grid-template-columns:minmax(0,1fr) 30px minmax(0,1fr);gap:5px;align-items:center;margin:3px 0}
.mini-number.center-number{height:26px;border-radius:999px;background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.20);display:grid;place-items:center;font-size:12px;font-weight:1000;color:#f8fafc;box-shadow:inset 0 0 0 1px rgba(2,6,23,.45)}
.mini-group-pair-row .group-slots{grid-template-columns:repeat(4,minmax(16px,1fr));gap:3px}
.mini-groups-v1314 .mini-slot{min-height:27px}
.mini-groups-v1314 .mini-ghost{font-size:6px;line-height:1;text-transform:uppercase;letter-spacing:.02em}
.mini-groups-v1314 .mini-ghost small{display:block!important;font-size:6px;opacity:.85}
.mini-groups-v1314 .mini-ghost b{display:none!important}
.group-blue{border-color:rgba(59,130,246,.48)!important;box-shadow:inset 0 0 0 1px rgba(59,130,246,.13)}
.group-black{border-color:rgba(229,231,235,.38)!important;box-shadow:inset 0 0 0 1px rgba(229,231,235,.10)}
.group-red{border-color:rgba(239,68,68,.48)!important;box-shadow:inset 0 0 0 1px rgba(239,68,68,.12)}
.group-yellow{border-color:rgba(245,158,11,.50)!important;box-shadow:inset 0 0 0 1px rgba(245,158,11,.14)}
.mini-groups-v1314 .mini-slot.occupied{box-shadow:inset 0 0 0 1px rgba(255,255,255,.16),0 0 10px rgba(255,255,255,.05)}
.tv-unified-board .mini-board-split-v1314,.admin-unified-board .mini-board-split-v1314{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}
.tv-unified-board .mini-group-pair-head,.admin-unified-board .mini-group-pair-head{grid-template-columns:minmax(0,1fr) 34px minmax(0,1fr);gap:5px}
.tv-unified-board .mini-group-pair-row,.admin-unified-board .mini-group-pair-row{grid-template-columns:minmax(0,1fr) 34px minmax(0,1fr);gap:5px;margin:3px 0}
.tv-unified-board .mini-groups-v1314 .group-slots,.admin-unified-board .mini-groups-v1314 .group-slots{grid-template-columns:repeat(4,minmax(20px,1fr));gap:3px}
.tv-unified-board .mini-groups-v1314 .mini-slot,.admin-unified-board .mini-groups-v1314 .mini-slot{min-height:29px;border-radius:7px}
.tv-unified-board .mini-number.center-number,.admin-unified-board .mini-number.center-number{height:29px;font-size:12px;border-radius:999px}
.tv-unified-board .mini-groups-v1314 .mini-board-tile,.admin-unified-board .mini-groups-v1314 .mini-board-tile{width:24px!important;height:28px!important;font-size:11px!important;border-radius:6px!important}
@media(max-height:720px){
  .tv-unified-board .mini-group-pair-row{margin:2px 0;grid-template-columns:minmax(0,1fr) 28px minmax(0,1fr)}
  .tv-unified-board .mini-group-pair-head{grid-template-columns:minmax(0,1fr) 28px minmax(0,1fr)}
  .tv-unified-board .mini-groups-v1314 .mini-slot{min-height:24px}
  .tv-unified-board .mini-number.center-number{height:24px;font-size:10px}
  .tv-unified-board .mini-groups-v1314 .mini-board-tile{width:20px!important;height:23px!important;font-size:9px!important}
  .tv-unified-board .mini-group-colhead{font-size:7px}
}
@media(max-width:899px){
  body.phone .mini-board-split-v1314{grid-template-columns:minmax(0,1.02fr) minmax(0,.98fr)}
  body.phone .mini-group-pair-head{grid-template-columns:minmax(0,1fr) 18px minmax(0,1fr);gap:2px;margin-bottom:2px}
  body.phone .mini-group-colhead{font-size:5px;gap:1px}
  body.phone .mini-group-pair-row{grid-template-columns:minmax(0,1fr) 18px minmax(0,1fr);gap:2px;margin:1px 0}
  body.phone .mini-number.center-number{height:15px;font-size:7px;border-radius:5px}
  body.phone .mini-groups-v1314 .group-slots{grid-template-columns:repeat(4,minmax(8px,1fr));gap:1px}
  body.phone .mini-groups-v1314 .mini-slot{min-height:15px;border-radius:4px}
  body.phone .mini-groups-v1314 .mini-ghost small{display:none!important}
  body.phone .mini-groups-v1314 .mini-board-tile{width:12px!important;height:14px!important;font-size:6px!important;border-radius:3px!important}
}
@media(max-width:899px) and (orientation:landscape) and (max-height:430px){
  body.phone .mini-group-pair-head{display:none}
  body.phone .mini-group-pair-row{grid-template-columns:minmax(0,1fr) 15px minmax(0,1fr);gap:1px}
  body.phone .mini-number.center-number{height:12px;font-size:6px}
  body.phone .mini-groups-v1314 .mini-slot{min-height:12px}
  body.phone .mini-groups-v1314 .mini-board-tile{width:10px!important;height:12px!important;font-size:5px!important}
}

/* v1.3.15: selector superior de destino y fantasmas de Póquer/Tercias con número visible */
.mobile-zone-toolbar{
  display:none;
  align-items:center;
  gap:6px;
  padding:6px;
  border:1px solid rgba(255,255,255,.12);
  background:linear-gradient(90deg,rgba(15,23,42,.96),rgba(30,41,59,.92));
  border-radius:14px;
  margin-bottom:6px;
  box-shadow:0 10px 30px rgba(0,0,0,.24);
}
.mobile-zone-toolbar span{font-size:11px;font-weight:1000;color:#bfdbfe;text-transform:uppercase;letter-spacing:.04em;white-space:nowrap}
.zone-btn{width:auto!important;min-height:30px!important;padding:6px 10px!important;border-radius:10px!important;border:1px solid rgba(255,255,255,.16)!important;background:rgba(255,255,255,.06)!important;color:#e5e7eb!important;font-size:11px!important;font-weight:1000!important;box-shadow:none!important;white-space:nowrap}
.zone-btn.active{background:linear-gradient(180deg,rgba(56,189,248,.30),rgba(37,99,235,.22))!important;border-color:rgba(56,189,248,.75)!important;color:white!important;box-shadow:0 0 0 1px rgba(56,189,248,.18),0 0 18px rgba(56,189,248,.18)!important}
.mini-groups-v1314 .mini-ghost{display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:0;text-align:center;line-height:.9}
.mini-groups-v1314 .mini-ghost b{display:block!important;font-size:10px!important;line-height:1;color:rgba(255,255,255,.55)}
.mini-groups-v1314 .mini-ghost small{display:block!important;font-size:5.5px!important;opacity:.62;line-height:1;text-transform:uppercase;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mini-groups-v1314 .mini-slot.occupied .mini-ghost{opacity:.18}
body.phone.in-game .mini-groups-v1314 .mini-ghost b{font-size:6px!important}
body.phone.in-game .mini-groups-v1314 .mini-ghost small{display:none!important}
@media(max-width:899px){
  body.phone.in-game .mobile-zone-toolbar{display:flex;position:sticky;top:0;z-index:115;margin:0 0 5px;border-radius:11px;padding:4px;overflow-x:auto;max-width:100%}
  body.phone.in-game .mobile-zone-toolbar span{font-size:8.5px}
  body.phone.in-game .zone-btn{font-size:9px!important;min-height:27px!important;padding:5px 7px!important;border-radius:8px!important}
  body.phone.in-game .player-desktop-layout{height:calc(var(--app-height) - 42px)!important}
}
@media(max-width:899px) and (orientation:landscape) and (max-height:430px){
  body.phone.in-game .mobile-zone-toolbar{padding:3px;margin-bottom:3px}
  body.phone.in-game .mobile-zone-toolbar span{display:none}
  body.phone.in-game .zone-btn{font-size:8.3px!important;min-height:24px!important;padding:4px 6px!important}
  body.phone.in-game .player-desktop-layout{height:calc(var(--app-height) - 32px)!important}
}
@media(min-width:900px){
  body.phone .mobile-zone-toolbar{display:flex;max-width:460px}
}


/* v1.3.16: barra superior móvil compacta con estado + más espacio para tablero miniatura */
.mobile-zone-toolbar{justify-content:space-between;gap:8px}
.mobile-zone-actions{display:flex;align-items:center;gap:6px;min-width:0;flex:0 0 auto}
.mobile-top-status{display:flex;align-items:center;justify-content:flex-end;gap:5px;min-width:0;flex:1;color:#dbeafe;font-size:11px;font-weight:1000;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:2px 4px;text-align:right}
.mobile-top-status .badge{font-size:9px;padding:3px 6px;flex:0 0 auto}.mobile-top-status b{font-size:10px;color:#e0f2fe;font-weight:1000}
@media(max-width:899px){
  body.phone.in-game .mobile-zone-toolbar{height:32px;min-height:32px;align-items:center;margin-bottom:3px;padding:3px 5px;overflow:hidden;position:sticky;top:0;z-index:115}
  body.phone.in-game .mobile-zone-actions{gap:4px;flex:0 0 auto}
  body.phone.in-game .zone-btn{font-size:8.8px!important;min-height:24px!important;padding:4px 7px!important;border-radius:8px!important;line-height:1!important}
  body.phone.in-game .mobile-top-status{font-size:9px;line-height:1;padding:0 2px}body.phone.in-game .mobile-top-status .badge{font-size:8px;padding:2px 5px}body.phone.in-game .mobile-top-status b{font-size:8.5px}
  body.phone.in-game .player-desktop-layout{height:calc(var(--app-height) - 36px)!important}
  body.phone.in-game .mobile-status-card{display:none!important}
  body.phone.in-game .approval-button{top:36px;right:8px}
}
@media(max-width:899px) and (orientation:portrait){
  body.phone.in-game .mobile-zone-toolbar{height:auto;min-height:30px}
  body.phone.in-game .mobile-top-status{font-size:9px;justify-content:flex-start}
  body.phone.in-game .player-desktop-layout{height:calc(var(--app-height) - 38px)!important}
}
@media(max-width:899px) and (orientation:landscape){
  body.phone.in-game .mobile-zone-toolbar{height:28px;min-height:28px;margin-bottom:2px;border-radius:9px}
  body.phone.in-game .player-desktop-layout{grid-template-columns:minmax(285px,42vw) minmax(0,1fr);gap:5px;height:calc(var(--app-height) - 34px)!important}
  body.phone.in-game .mobile-rack-card{padding:5px;border-radius:12px}
  body.phone.in-game .rack-title-row{margin-bottom:2px}body.phone.in-game .rack-title-row b{font-size:12px}
  body.phone.in-game .mobile-rack{padding:3px;gap:1px}
  body.phone.in-game .mobile-rack .tile{width:31px;height:39px;font-size:15px;margin:1px;border-radius:7px}
  body.phone.in-game .compact-controls{grid-template-columns:minmax(74px,1fr) 45px 52px 30px;gap:3px;margin:3px 0 2px}
  body.phone.in-game .compact-controls button,body.phone.in-game .compact-controls select{min-height:25px;font-size:8.5px;padding:3px 4px;border-radius:8px}
  body.phone.in-game .mobile-buttons{gap:3px;margin-top:2px}body.phone.in-game .mobile-buttons button{min-height:27px!important;font-size:8.4px!important;padding:3px 3px!important;border-radius:8px!important}
  body.phone.in-game .backup-mobile{min-height:24px!important;font-size:8.3px!important;padding:3px!important;margin-top:3px!important}
  body.phone.in-game .player-board-preview{padding:4px;border-radius:12px}
  body.phone.in-game .mini-board-preview-grid{padding:3px;border-radius:9px}
  body.phone.in-game .mini-board-split-v1314{grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr);gap:4px}
  body.phone .mini-color-block{padding:2px!important;margin-bottom:2px!important}body.phone .mini-color-title{font-size:6px!important;margin-bottom:1px!important}
  body.phone .mini-run-row{grid-template-columns:13px 1fr!important;gap:1px!important;margin:1px 0!important}.mini-row-tag{height:13px!important;font-size:6px!important;border-radius:4px!important}
  body.phone .run-slots{grid-template-columns:repeat(13,minmax(7px,1fr));gap:1px!important}body.phone .group-slots{gap:1px!important}
  body.phone .mini-slot{min-height:13px!important;border-radius:3px!important}body.phone .mini-ghost{font-size:5px!important}body.phone .mini-board-tile{width:11px!important;height:13px!important;font-size:5.5px!important;border-radius:3px!important}
  body.phone .mini-group-pair-row{grid-template-columns:minmax(0,1fr) 14px minmax(0,1fr)!important;gap:1px!important;margin:1px 0!important}body.phone .mini-number.center-number{height:12px!important;font-size:6px!important;border-radius:4px!important}
  body.phone .mini-groups-v1314 .group-slots{grid-template-columns:repeat(4,minmax(7px,1fr))!important;gap:1px!important}body.phone .mini-groups-v1314 .mini-slot{min-height:12px!important}body.phone .mini-groups-v1314 .mini-ghost b{font-size:5px!important}
}
@media(max-width:899px) and (orientation:landscape) and (max-height:430px){
  body.phone.in-game .mobile-zone-toolbar{height:25px;min-height:25px;padding:2px 4px}
  body.phone.in-game .zone-btn{font-size:7.7px!important;min-height:21px!important;padding:3px 5px!important}
  body.phone.in-game .mobile-top-status{font-size:7.8px}body.phone.in-game .mobile-top-status .badge{font-size:7px;padding:2px 4px}body.phone.in-game .mobile-top-status b{display:none}
  body.phone.in-game .player-desktop-layout{height:calc(var(--app-height) - 29px)!important;grid-template-columns:minmax(278px,40vw) minmax(0,1fr)}
}
@media(max-width:620px) and (orientation:landscape){
  body.phone.in-game .player-desktop-layout{grid-template-columns:minmax(248px,40vw) minmax(0,1fr)}
  body.phone.in-game .zone-btn{font-size:7.4px!important;padding-left:4px!important;padding-right:4px!important}
  body.phone.in-game .mobile-top-status{max-width:34vw}
}

/* v1.3.17: Robar siempre termina el turno; si había movimientos pendientes, se restaura el respaldo antes de robar. */


/* v1.3.19: ganador visible en pantalla, index y admin */
.winner-overlay{position:fixed;inset:0;z-index:600;display:flex;align-items:center;justify-content:center;padding:22px;background:radial-gradient(circle at 50% 20%,rgba(56,189,248,.24),rgba(2,6,23,.88) 55%,rgba(0,0,0,.95));backdrop-filter:blur(8px)}
.winner-overlay.hidden{display:none!important}.winner-card{position:relative;width:min(760px,calc(100vw - 28px));border-radius:30px;padding:34px 28px;text-align:center;border:1px solid rgba(250,204,21,.42);background:linear-gradient(180deg,rgba(15,23,42,.96),rgba(30,41,59,.94));box-shadow:0 30px 90px rgba(0,0,0,.55),0 0 50px rgba(250,204,21,.20);overflow:hidden}.winner-card:before{content:"";position:absolute;inset:-120px;background:conic-gradient(from 30deg,rgba(250,204,21,.0),rgba(250,204,21,.20),rgba(56,189,248,.18),rgba(34,197,94,.18),rgba(239,68,68,.16),rgba(250,204,21,.0));animation:winnerSpin 8s linear infinite;opacity:.9}.winner-inner{position:relative;z-index:1}.winner-trophy{font-size:86px;line-height:1;filter:drop-shadow(0 12px 30px rgba(250,204,21,.38));animation:winnerPop 1.4s ease-in-out infinite alternate}.winner-kicker{margin:6px 0 0;color:#fef3c7;font-size:17px;font-weight:1000;letter-spacing:.18em;text-transform:uppercase}.winner-name{margin:8px 0 6px;font-size:clamp(36px,7vw,78px);line-height:1;font-weight:1000;color:#fff;text-shadow:0 0 28px rgba(56,189,248,.35)}.winner-sub{font-size:18px;color:#dbeafe;font-weight:800;margin:8px 0 14px}.winner-stats{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:12px}.winner-chip{border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.08);border-radius:999px;padding:8px 12px;font-size:13px;font-weight:900;color:#e5e7eb}.winner-scores{margin:18px auto 0;max-width:520px;display:grid;gap:7px}.winner-score-row{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:center;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.06);border-radius:14px;padding:9px 12px;text-align:left;font-weight:900}.winner-score-row b{color:#fde68a}.winner-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin-top:18px}.winner-actions button,.winner-actions a{width:auto!important;border-radius:999px!important;min-height:0!important;padding:10px 15px!important;text-decoration:none}.winner-confetti{position:absolute;inset:0;pointer-events:none;background-image:radial-gradient(circle,#facc15 0 3px,transparent 4px),radial-gradient(circle,#38bdf8 0 3px,transparent 4px),radial-gradient(circle,#22c55e 0 3px,transparent 4px),radial-gradient(circle,#ef4444 0 3px,transparent 4px);background-size:120px 120px,150px 150px,170px 170px,140px 140px;background-position:0 -30px,40px -90px,100px -60px,160px -120px;animation:confettiFall 3.8s linear infinite;opacity:.55}@keyframes confettiFall{to{background-position:0 420px,40px 360px,100px 390px,160px 340px}}@keyframes winnerSpin{to{transform:rotate(360deg)}}@keyframes winnerPop{from{transform:translateY(0) scale(1)}to{transform:translateY(-6px) scale(1.06)}}.winner-banner{border:1px solid rgba(250,204,21,.36);background:linear-gradient(90deg,rgba(250,204,21,.18),rgba(56,189,248,.12));border-radius:18px;padding:12px 14px;color:#fff;font-weight:1000;box-shadow:0 15px 40px rgba(0,0,0,.25)}
@media(max-width:899px){.winner-overlay{padding:10px}.winner-card{border-radius:22px;padding:22px 16px}.winner-trophy{font-size:58px}.winner-kicker{font-size:12px}.winner-sub{font-size:13px}.winner-chip{font-size:11px;padding:6px 9px}.winner-score-row{font-size:12px;padding:7px 9px}.winner-actions{margin-top:12px}.winner-actions button,.winner-actions a{font-size:12px!important;padding:8px 10px!important}}
@media(max-width:899px) and (orientation:landscape){.winner-card{padding:14px 16px;width:min(720px,calc(100vw - 20px));max-height:calc(100vh - 20px);overflow:auto}.winner-trophy{font-size:44px}.winner-name{font-size:38px}.winner-sub{margin:4px 0 8px}.winner-stats{margin-top:6px}.winner-scores{margin-top:8px;grid-template-columns:repeat(2,minmax(0,1fr));max-width:100%}.winner-score-row{font-size:11px}.winner-actions{margin-top:8px}}
