/* ── Reset & base ─────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --red:  #ff2020;
    --red2: #cc0000;
    --dark: #0d0d0d;
    --card: #161616;
}
body {
    font-family: 'Oswald', sans-serif;
    background: var(--dark);
    color: #fff;
    min-height: 100vh;
    padding: 10px 14px 24px;
    font-size: 17px;
    
}

/* ── Header ───────────────────────────────────────────────── */
.pro-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #222;
}

.pro-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.8rem;
    letter-spacing: 0.1em;
    color: #fff;
    flex-shrink: 0;
}

.pro-participants {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    min-width: 0;
}
.pro-participants::-webkit-scrollbar { display: none; }
.pro-participants img {
    width: 53px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid #333;
    transition: transform 0.2s, border-color 0.2s;
    flex-shrink: 0;
}
.pro-participants img:hover {
    transform: scale(1.12);
    border-color: var(--red);
}
.pro-participants img.p-eliminated {
    border-color: #880000;
    filter: grayscale(80%) brightness(0.45);
    opacity: 0.5;
}
.pro-participants img.p-nominated {
    border-color: #fff;
    box-shadow: 0 0 10px rgba(255,255,255,0.6);
}

.pro-nav {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}
.pro-nav-btn {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.15s, box-shadow 0.15s;
}
.pro-nav-menu {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #111;
    box-shadow: 0 0 12px rgba(255,180,0,0.4);
}
.pro-nav-menu:hover { transform: scale(1.05); box-shadow: 0 0 22px rgba(255,180,0,0.7); }

.pro-header-tts {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: 8px;
}
.pro-tts {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
}
.pro-tts-btn {
    width: 38px; height: 38px;
    border: none; border-radius: 7px;
    cursor: pointer; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.15s;
}
.pro-tts-btn:hover { transform: scale(1.12); }
.tts-play  { background: #22c55e; color: #fff; }
.tts-pause { background: #f59e0b; color: #fff; }
.tts-stop  { background: #ef4444; color: #fff; }
.tts-speed { background: #444; color: #fff; font-weight: bold; font-size: 18px; }
.pro-tts-speed { min-width: 34px; text-align: center; font-size: 0.95rem; color: #aaa; }

/* ── Main 2-column ────────────────────────────────────────── */
.pro-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
    max-width: 1400px;
    margin: 0 auto;
}
@media (max-width: 900px) { .pro-main { grid-template-columns: 1fr; } }

/* ── Grid panel ───────────────────────────────────────────── */
.pro-grid-wrap {
    background: rgba(0,0,0,0.4);
    border: 2px solid #2a2a2a;
    border-radius: 10px;
    padding: 14px;
}
.pro-grid-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.pro-grid-label {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.8rem;
    color: #fff;
    letter-spacing: 0.1em;
    text-align: left;
    margin: 0;
    flex: 1;
}

/* 6 columns × 4 rows = 24 boxes */
.pro-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 0;
}

.pro-box {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    border: 2px solid var(--red2);
    border-radius: 8px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.3rem, 2.5vw, 1.9rem);
    color: #888;
    cursor: default;
    position: relative;
    transition: all 0.2s;
    user-select: none;
}
.pro-box:not(.used):hover {
    border-color: var(--red2);
    color: #888;
    transform: none;
    box-shadow: none;
}
.pro-box.selected {
    border-color: #ff6666;
    color: #1a1a1a;
    background: rgba(255, 220, 220, 0.98);
    box-shadow: 0 0 24px rgba(255, 100, 100, 0.9);
    animation: proBoxPulse 1s ease-in-out infinite;
}
@keyframes proBoxPulse { 50% { transform: scale(1.05); } }

.pro-box.used {
    background: rgba(180,0,0,0.55);
    color: #fff;
    border-color: var(--red2);
    opacity: 0.65;
    cursor: pointer;
}
.pro-box.used:hover {
    opacity: 0.85;
    border-color: var(--red);
    color: #fff;
    transform: scale(1.06);
    box-shadow: 0 0 14px rgba(255,32,32,0.35);
}

/* Casilla seleccionada siempre en rojo claro, aunque esté "used" */
.pro-box.used.selected {
    background: rgba(255, 220, 220, 0.98);
    color: #1a1a1a;
    border-color: #ff6666;
    opacity: 1;
    box-shadow: 0 0 24px rgba(255, 100, 100, 0.9);
}

/* 👤 assignment badge */
.pro-box.has-assign::after {
    content: '👤';
    position: absolute;
    top: 2px;
    right: 3px;
    font-size: 9px;
    background: #0f0;
    border-radius: 50%;
    width: 15px;
    height: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Roll button */
.pro-roll-btn {
    width: auto;
    flex-shrink: 0;
    padding: 8px 20px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.12em;
    background: linear-gradient(135deg, var(--red2), #880000);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 0 18px rgba(200,0,0,0.45);
    transition: transform 0.15s, box-shadow 0.15s;
}
.pro-roll-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 28px rgba(255,32,32,0.65);
}
.pro-roll-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
    background: linear-gradient(135deg, #333, #222);
    color: #888;
}
.pro-roll-btn--exhausted {
    opacity: 0.45;
    cursor: pointer;
    box-shadow: none;
    background: linear-gradient(135deg, #333, #222);
    color: #888;
}
.pro-roll-msg {
    margin: 0 0 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.35);
    color: #ffe9a8;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* ── Result panel ─────────────────────────────────────────── */
.pro-result-wrap {
    background: rgba(0,0,0,0.5);
    border: 2px solid var(--red);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 0 28px rgba(255,32,32,0.12);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.35s, transform 0.35s;
}
.pro-result-wrap.visible {
    opacity: 1;
    transform: translateY(0);
}
.pro-result-wrap.pop-in { animation: proPopIn 0.4s ease; }
@keyframes proPopIn {
    0%   { opacity: 0; transform: scale(0.93) translateY(12px); }
    70%  { transform: scale(1.02) translateY(-3px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.pro-result-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #2a2a2a;
}
.pro-result-head h3 {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 2.8vw, 2.2rem);
    color: #fff;
    letter-spacing: 0.04em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.pro-result-body { line-height: 1.65; }
.pro-result-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 2.4vw, 1.9rem);
    color: #fff;
    letter-spacing: 0.03em;
    margin-bottom: 6px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.pro-result-assigned {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.pro-result-assigned img {
    width: 40px; height: 53px;
    object-fit: cover;
    border-radius: 5px;
    border: 2px solid var(--red);
    box-shadow: 0 0 8px rgba(255,32,32,0.4);
}
.pro-result-text {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(2rem, 3.6vw, 2.4rem);
    font-weight: 400;
    letter-spacing: 0.04em;
    color: #ccc;
    
    line-height: 1.35;
    margin-top: 4px;
}

/* ── Context menu ─────────────────────────────────────────── */
.pro-ctx-menu {
    position: fixed;
    background: #1e1e1e;
    border: 2px solid var(--red2);
    border-radius: 8px;
    padding: 4px 0;
    display: none;
    z-index: 3000;
    min-width: 170px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
.pro-ctx-menu.active { display: block; }
.pro-ctx-menu div {
    padding: 14px 24px;
    cursor: pointer;
    font-size: 1.3rem;
    color: #ddd;
    transition: background 0.15s;
}
.pro-ctx-menu div:hover { background: var(--red2); color: #fff; }

/* ── Assign overlay ───────────────────────────────────────── */
.pro-assign-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.82);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 4000;
}
.pro-assign-overlay.active { display: flex; }

.pro-assign-panel {
    background: #1a1a1a;
    border: 3px solid var(--red);
    border-radius: 14px;
    padding: 22px;
    max-width: 820px;
    width: 95%;
    box-shadow: 0 0 50px rgba(255,32,32,0.4);
}
.pro-assign-panel h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4rem;
    color: var(--red);
    letter-spacing: 0.1em;
    text-align: center;
    margin-bottom: 8px;
}
.assign-counter {
    text-align: center;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    padding: 6px 12px;
    border-radius: 8px;
    margin-bottom: 14px;
    transition: background 0.2s, color 0.2s;
    background: rgba(255,255,255,0.06);
    color: #aaa;
}
.assign-counter.ac-ok      { background: rgba(34,197,94,0.18);  color: #22c55e; }
.assign-counter.ac-over    { background: rgba(239,68,68,0.18);  color: #ef4444; }
.assign-counter.ac-under   { background: rgba(245,158,11,0.18); color: #f59e0b; }
.pro-assign-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.pro-assign-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    border-radius: 9px;
    padding: 8px 6px;
    border: 2px solid transparent;
    transition: border-color 0.2s, background 0.2s;
}
.pro-assign-item:hover { background: #2a2a2a; }
.pro-assign-item.selected { border-color: var(--red); background: rgba(255,32,32,0.12); }
.pro-assign-item.elim { opacity: 0.35; cursor: default; filter: grayscale(80%); }
.pro-assign-item img {
    width: 100%;
    aspect-ratio: 80/110;
    object-fit: cover;
    border-radius: 7px;
    border: 2px solid #333;
}
.pro-assign-item.selected img { border-color: var(--red); }
.pro-assign-item .assign-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-top: 5px;
    text-align: center;
}
.pro-assign-close {
    display: block;
    width: 100%;
    padding: 10px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    background: #333;
    color: #aaa;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}
.pro-assign-close:hover { background: #444; color: #fff; }

/* ── Hover tooltip ────────────────────────────────────────── */
.pro-tooltip {
    position: fixed;
    background: rgba(0,0,0,0.88);
    border: 1px solid var(--red2);
    border-radius: 7px;
    padding: 8px 12px;
    font-size: 0.9rem;
    color: #eee;
    pointer-events: none;
    z-index: 5000;
    display: none;
    max-width: 200px;
}

/* -- No-participants prompt ----------------------------------- */
.mod-no-p {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 12px 0;
    text-align: center;
}
.mod-no-p-label {
    font-family: 'Oswald', sans-serif;
    font-size: 1.3rem;
    font-weight: 400;
    color: #888;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.mod-no-p-label strong {
    color: #fff;
    font-size: 2rem;
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 0.1em;
}
.mod-no-p-btn {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    letter-spacing: 5px;
    padding: 14px 52px;
    background: #000;
    color: #fff;
    border: 3px solid #00ff55;
    border-radius: 10px;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    box-shadow: 0 0 12px rgba(0,255,85,0.7), 0 0 30px rgba(0,255,85,0.3);
    animation: mod-btn-glow 2s ease-in-out infinite alternate;
    transition: transform 0.15s;
}
@keyframes mod-btn-glow {
    from { box-shadow: 0 0 10px rgba(0,255,85,0.6), 0 0 25px rgba(0,255,85,0.25); }
    to   { box-shadow: 0 0 22px rgba(0,255,85,1),   0 0 55px rgba(0,255,85,0.5); }
}
.mod-no-p-btn:hover  { transform: scale(1.06); }
.mod-no-p-btn:active { transform: scale(0.97); }

/* ── Needs-shuffle badge on grid (NEW) ─── */
.pro-box.pro-box--needs-shuffle {
    border-color: #facc15 !important;
    opacity: 1 !important;
    box-shadow: 0 0 16px rgba(250, 204, 21, 0.55), inset 0 0 12px rgba(250, 204, 21, 0.12);
    animation: pro-needs-shuffle-pulse 1.4s ease-in-out infinite;
}
.pro-box.pro-box--needs-shuffle.selected {
    animation: pro-needs-shuffle-pulse 1.4s ease-in-out infinite;
}
.pro-box.pro-box--needs-shuffle::before {
    content: 'NEW';
    position: absolute;
    top: -8px;
    right: -6px;
    left: auto;
    padding: 2px 7px;
    border-radius: 6px;
    background: #facc15;
    color: #111;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    line-height: 1.2;
    text-shadow: none;
    pointer-events: none;
    z-index: 20;
}
@keyframes pro-needs-shuffle-pulse {
    0%, 100% { box-shadow: 0 0 12px rgba(250, 204, 21, 0.45), inset 0 0 8px rgba(250, 204, 21, 0.08); }
    50% { box-shadow: 0 0 22px rgba(250, 204, 21, 0.75), inset 0 0 14px rgba(250, 204, 21, 0.16); }
}
