
        * { box-sizing: border-box; user-select: none; }
        body { background-color: #09090b; color: #e2e8f0; font-family: 'Segoe UI', system-ui, sans-serif; margin: 0; padding: 10px; display: flex; flex-direction: column; align-items: center; min-height: 100vh; overflow-x: hidden; }

        /* HEADER PRINCIPAL */
        .top-bar { width: 100%; max-width: 1400px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding: 0 10px;}
        .logo-text { font-size: 24px; font-weight: 900; background: linear-gradient(90deg, #10b981, #3b82f6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: 1px;}

        .btn-cute { background: #1e293b; color: #f8fafc; border: 1px solid #334155; padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 800; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all 0.1s;}
        .btn-cute:active { transform: scale(0.95); background: #334155;}

        /* ESTRUCTURA RESPONSIVA */
        .main-layout { display: flex; flex-direction: column-reverse; width: 100%; max-width: 1400px; gap: 20px; }
        .left-panel { flex: 0.8; display: flex; flex-direction: column; gap: 15px; }
        .right-panel { flex: 1.2; display: flex; flex-direction: column; gap: 15px; }
        @media (min-width: 900px) {
            .main-layout { flex-direction: row; gap: 30px; }
            body { padding: 20px; }
        }

        /* TOURNAMENT DASHBOARD */
        .tournament-dashboard { background: #0f172a; border-radius: 12px; border: 1px solid #1e293b; padding: 15px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
        .dashboard-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #1e293b; padding-bottom: 10px; }

        .level-ctrl { display: flex; align-items: center; gap: 5px; }
        .level-badge { background: #3b82f6; color: white; padding: 6px 10px; border-radius: 6px; font-weight: 900; font-size: 12px; text-transform: uppercase;}

        .clock-container { display: flex; align-items: center; gap: 5px; background: #000; padding: 5px 10px; border-radius: 8px; border: 1px solid #334155; }
        .clock-input { background: transparent; border: none; color: #10b981; font-family: monospace; font-size: 22px; font-weight: 900; width: 32px; text-align: center; outline: none; padding: 0;}
        .clock-sep { color: #10b981; font-weight: bold; font-size: 20px; margin: 0 -2px;}
        .btn-play { background: #3b82f6; border: none; color: white; border-radius: 4px; padding: 4px 8px; font-weight: bold; cursor: pointer;}

        .stat-group { display: flex; gap: 15px; flex-wrap: wrap; justify-content: space-between;}
        .stat-box { display: flex; flex-direction: column; align-items: center; background: #09090b; padding: 8px; border-radius: 8px; flex: 1; min-width: 60px; border: 1px solid #1e293b;}
        .stat-box label { font-size: 10px; color: #64748b; font-weight: 800; text-transform: uppercase; margin-bottom: 3px;}
        .stat-box input, .stat-box span { background: transparent; border: none; color: #f8fafc; font-weight: 900; font-size: 14px; text-align: center; width: 100%; outline: none;}
        .stat-ctrl { display: flex; align-items: center; gap: 5px; width: 100%; justify-content: center;}
        .stat-ctrl button { background: #1e293b; color: white; border: none; border-radius: 4px; width: 20px; height: 20px; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center;}

        .config-select { background: #1e293b; color: #f8fafc; border: 1px solid #334155; padding: 10px; border-radius: 8px; font-size: 14px; outline: none; font-weight: bold; cursor: pointer; width: 100%; appearance: none; text-align: center;}

        /* MESA OVALADA */
        .table-container { position: relative; width: 100%; height: 220px; display: flex; justify-content: center; align-items: center; margin: 10px 0;}
        @media (min-width: 900px) { .table-container { height: 300px; } }
        .table-area { position: absolute; width: 95%; height: 100%; background: radial-gradient(circle, #064e3b 0%, #022c22 100%); border-radius: 140px; border: 8px solid #1c1917; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 30px rgba(0,0,0,0.8); }
        .table-logo { font-size: 18px; color: rgba(255,255,255,0.08); font-weight: 900; letter-spacing: 4px; text-align: center; }

        .seat { position: absolute; width: 44px; height: 44px; background-color: #1e293b; border: 2px solid #334155; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #94a3b8; font-size: 11px; transition: all 0.2s; opacity: 0; pointer-events: none; cursor: pointer; z-index: 10;}
        .seat.visible { opacity: 1; pointer-events: auto; }
        .seat.active { background: #eab308; color: #000; border: 2px solid #fff; transform: scale(1.15); box-shadow: 0 0 20px rgba(234, 179, 8, 0.4); z-index: 30;}
        .dealer-btn { position: absolute; top: -5px; right: -5px; width: 16px; height: 16px; background-color: #ef4444; border: 1px solid white; border-radius: 50%; color: white; font-size: 9px; display: flex; align-items: center; justify-content: center; font-weight: 900; }

        .blind-chip { position: absolute; bottom: -10px; right: -15px; background: #fff; color: #000; font-weight: 900; font-size: 10px; padding: 2px 6px; border-radius: 12px; border: 2px solid #3b82f6; box-shadow: 0 4px 6px rgba(0,0,0,0.5); opacity: 0; transform: scale(0); transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 40; pointer-events: none;}
        .seat.active .blind-chip.show { opacity: 1; transform: scale(1); }

        .pos-bu { top: -6%; left: 18%; } .pos-sb { top: -6%; left: 50%; transform: translateX(-50%); } .pos-bb { top: -6%; right: 18%; }
        .pos-utg { top: 30%; right: -3%; transform: translateY(-50%); } .pos-utg1 { top: 70%; right: -3%; transform: translateY(-50%); }
        .pos-utg2 { bottom: -6%; right: 18%; } .pos-mp { bottom: -6%; left: 50%; transform: translateX(-50%); }
        .pos-hj { bottom: -6%; left: 18%; } .pos-co { top: 50%; left: -3%; transform: translateY(-50%); }

        /* RESULT PANEL */
        .result-panel { background: #0f172a; border-radius: 12px; padding: 20px; text-align: center; border: 2px solid #1e293b; display: flex; flex-direction: column; justify-content: center; min-height: 120px; box-shadow: 0 10px 25px rgba(0,0,0,0.5);}
        .res-header { font-size: 12px; color: #94a3b8; margin-bottom: 8px; font-weight: 700; text-transform: uppercase; }
        .res-action { font-size: 28px; font-weight: 900; color: #cbd5e1; margin: 0; line-height: 1.1; }
        @media (min-width: 900px) { .res-action { font-size: 36px; } }
        .res-insight { font-size: 13px; color: #94a3b8; margin-top: 10px; font-style: italic; }

        /* TECLADO Y CONTROLES */
        .keypad-section { background: #0f172a; border-radius: 12px; padding: 15px; border: 1px solid #1e293b; display: flex; flex-direction: column; gap: 15px; box-shadow: 0 10px 25px rgba(0,0,0,0.5);}

        .stack-row { display: flex; align-items: center; gap: 10px; }
        .stack-input-wrapper { flex: 1; position: relative; }
        .stack-input-wrapper span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 13px; font-weight: bold; }
        .stack-input { width: 100%; background: #09090b; border: 1px solid #1e293b; color: white; border-radius: 8px; padding: 12px 12px 12px 35px; font-size: 18px; font-weight: bold; outline: none; }
        .quick-stack { display: flex; gap: 6px; }
        .quick-stack button { background: #1e293b; border: none; color: #cbd5e1; padding: 12px; border-radius: 8px; font-size: 13px; font-weight: bold; cursor: pointer; flex: 1; transition: background 0.1s;}
        .quick-stack button:active { background: #334155; }

        .card-display { display: flex; justify-content: center; gap: 10px; min-height: 75px; }
        .card-slot { width: 55px; height: 75px; background: #09090b; border: 2px dashed #334155; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 24px; font-weight: 900; color: white; cursor: pointer; }
        @media (min-width: 900px) { .card-slot { width: 65px; height: 90px; font-size: 28px;} }
        .card-slot .suit-indicator { font-size: 16px; margin-top: -2px; }
        .card-slot.active { border-color: #10b981; background: rgba(16, 185, 129, 0.1); box-shadow: 0 0 10px rgba(16, 185, 129, 0.2); }
        .card-slot.filled { border-style: solid; border-color: #cbd5e1; background: #fff; color: #000; }
        .card-slot.filled.s { color: #1e293b; } .card-slot.filled.h { color: #ef4444; } .card-slot.filled.d { color: #3b82f6; } .card-slot.filled.c { color: #10b981; }

        .keyboard-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
        .key-btn { background: #1e293b; border: none; color: white; border-radius: 8px; height: 48px; font-size: 18px; font-weight: 800; cursor: pointer; box-shadow: 0 3px 0 #09090b; touch-action: manipulation;}
        .key-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #09090b; }

        .suit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
        .suit-btn-direct { height: 48px; border: none; border-radius: 8px; font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: white; box-shadow: 0 3px 0 rgba(0,0,0,0.3); }
        .suit-btn-direct:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,0); }
        .s-s { background: linear-gradient(180deg, #334155, #1e293b); } .s-h { background: linear-gradient(180deg, #ef4444, #b91c1c); } .s-d { background: linear-gradient(180deg, #3b82f6, #1d4ed8); } .s-c { background: linear-gradient(180deg, #10b981, #047857); }

        .holdem-suit-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
        .suit-toggle-btn { height: 48px; border: none; border-radius: 8px; font-size: 14px; font-weight: 800; text-transform: uppercase; cursor: pointer; color: white; box-shadow: 0 3px 0 rgba(0,0,0,0.2); }
        .btn-suited { background: linear-gradient(180deg, #3b82f6, #1d4ed8); } .btn-offsuit { background: linear-gradient(180deg, #475569, #334155); }

        .action-row { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: auto; }
        .btn-clear { background: #ef4444; color: white; border: none; border-radius: 8px; font-weight: 800; font-size: 14px; text-transform: uppercase; box-shadow: 0 3px 0 #b91c1c; cursor: pointer; }
        .btn-next { background: linear-gradient(180deg, #10b981, #047857); color: white; border: none; border-radius: 8px; font-weight: 800; font-size: 15px; text-transform: uppercase; box-shadow: 0 3px 0 #022c22; cursor: pointer; }

        .keyboard-hint { text-align: center; color: #64748b; font-size: 11px; font-weight: 600; display: none; }
        @media (min-width: 900px) { .keyboard-hint { display: block; font-size: 12px; } }
        .keyboard-hint kbd { background: #1e293b; padding: 2px 6px; border-radius: 4px; border: 1px solid #334155; color: white; }

        
[hidden]{display:none!important}button:disabled{opacity:.45;cursor:default}button:focus-visible,select:focus-visible,input:focus-visible,a:focus-visible{outline:2px solid #10b981;outline-offset:3px}.top-bar a{color:#e2e8f0;text-decoration:none;font-size:13px}.top-bar{gap:10px;flex-wrap:wrap}.left-panel,.right-panel{min-width:0}.card-slot{padding:0}.card-slot.filled{color:#111827}.suit-toggle-btn[aria-pressed=true]{outline:2px solid white}.btn-clear,.btn-next{min-height:48px}.table-logo{pointer-events:none}.seat.active{outline:2px solid white}.seat.turn{box-shadow:0 0 12px #10b981}.seat.folded{opacity:.42}.classic-subtle{font-size:12px;color:#94a3b8;line-height:1.45;margin:0}.classic-board{display:flex;gap:5px;justify-content:center;margin-top:10px}.classic-board span{background:#fff;color:#111827;border-radius:4px;padding:7px 5px;font-weight:800;font-size:14px}.classic-board .red{color:#b91c1c}.classic-board .empty{background:#164e3c;color:#8bbaaa}.classic-center{text-align:center;max-width:80%}.classic-actions{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}.classic-actions button{border:1px solid #334155;background:#1e293b;color:#e2e8f0;border-radius:6px;padding:10px 2px;font-weight:700}.classic-actions button:not(:disabled){background:#145c43}.classic-raise{display:flex;gap:10px;align-items:center;color:#94a3b8;font-size:12px}.classic-raise input{width:90px;background:#09090b;border:1px solid #334155;color:white;padding:6px;border-radius:5px}.classic-details{font-size:12px;color:#94a3b8;text-align:left;margin-top:8px}.classic-details summary{cursor:pointer}.classic-details div{padding:5px 0;border-top:1px solid #1e293b}.classic-log{max-height:110px;overflow:auto;white-space:pre-line}.classic-setup-label{font-size:12px;color:#94a3b8}.classic-status{font-size:12px;color:#a7f3d0;text-align:center;margin:0}.classic-footer{margin-top:20px;color:#64748b;font-size:12px;text-align:center}.classic-footer a{color:#94a3b8}.seat{padding:0}.stat-box{min-width:0}.stat-box label{white-space:nowrap}.key-btn:disabled,.suit-toggle-btn:disabled{opacity:.5}.classic-result-title{margin:0;font-size:12px;color:#94a3b8}.classic-result-title strong{color:#e2e8f0}@media(max-width:420px){.table-container{width:calc(100% - 20px);margin:10px auto}.stat-group{gap:5px}.stat-box{padding:6px 2px}.classic-actions button{font-size:11px}.stack-row{gap:5px}.quick-stack{gap:3px}.quick-stack button{padding:9px}.stack-input-wrapper{min-width:75px}.stack-input{min-width:0}.seat{width:39px;height:39px}.classic-board span{padding:5px 3px}.top-bar{padding:0}.logo-text{font-size:20px}}

.card-slot.filled.red-card{color:#b91c1c}.seat.six-mid{bottom:-6%;left:50%;transform:translateX(-50%)}.seat.six-mid.active{transform:translateX(-50%) scale(1.15)}

.clock-container .clock-input{width:auto;font-size:18px;white-space:nowrap}.stat-box input{min-width:0;max-width:100%}.tournament-dashboard .classic-details>div{border-top:0}.tournament-dashboard .btn-play{min-width:26px}.tournament-dashboard .stat-group{flex-wrap:nowrap}.seat[data-pos='BTN']{font-size:10px}@media(max-width:420px){.clock-container{padding:4px 6px;gap:5px}.clock-container .clock-input{font-size:15px}.dashboard-header{gap:4px}.stat-box label{font-size:9px}.stat-box input{font-size:12px}}

#reviewPayouts{box-sizing:border-box;max-width:100%;background:#09090b;color:#e2e8f0;border:1px solid #334155;border-radius:6px;padding:8px;margin:6px 0}#icmReview .btn-play{width:auto;padding:6px 10px}#icmReview label{display:block;margin-top:8px}#reviewResult{margin-top:6px}.clock-container #pauseClock{flex-shrink:0}

.audit-scroll{overflow-x:auto}.classic-details .audit-table{width:100%;border-collapse:collapse;font-size:12px;text-align:right}.audit-table th,.audit-table td{padding:5px 4px;border-bottom:1px solid #1e293b}.audit-table th:first-child,.audit-table td:first-child{text-align:left}.audit-table th{color:#cbd5e1}#auditStatus{margin:6px 0}

#slots-container:has([data-slot='4']){gap:6px}#slots-container:has([data-slot='4']) .card-slot{width:min(65px,18%);font-size:20px}@media(max-width:420px){#slots-container:has([data-slot='4']) .card-slot{height:68px;font-size:18px}}

.omaha-choice{font-size:13px;display:flex;align-items:center;gap:8px;color:#e2e8f0}.omaha-choice input{accent-color:#10b981}.omaha-suits{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.omaha-suits button{background:#1e293b;color:#e2e8f0;border:1px solid #334155;border-radius:8px;min-height:38px;font-weight:800;cursor:pointer}.omaha-suits button[data-omaha-suit='H'],.omaha-suits button[data-omaha-suit='D']{color:#fca5a5}

#handStudy label{display:block;margin:8px 0 4px}#studyReflection{display:block;width:100%;box-sizing:border-box;resize:vertical;background:#09090b;color:#e2e8f0;border:1px solid #334155;border-radius:6px;padding:8px;font:inherit;min-height:65px;user-select:text}#handStudy .btn-play{width:auto;margin:8px 0;padding:6px 10px}#studyStatus{margin:6px 0}#handStudy a{display:inline-block;margin:6px 0}

.study-coach-config{display:grid;grid-template-columns:minmax(0,1fr);gap:6px}.study-coach-config label{color:#cbd5e1}.study-coach-config select{width:100%;min-width:0;background:#09090b;color:#e2e8f0;border:1px solid #334155;border-radius:6px;padding:8px}

.study-coach-config input{width:100%;min-width:0;box-sizing:border-box;background:#09090b;color:#e2e8f0;border:1px solid #334155;border-radius:6px;padding:8px;user-select:text}

#reviewRule{display:block;max-width:100%;width:100%;margin:6px 0;background:#09090b;color:#e2e8f0;border:1px solid #334155;border-radius:6px;padding:8px}#reviewEligibility{margin:6px 0}

.clock-container .clock-input{width:5.5ch;min-width:5.5ch;user-select:text;cursor:text;border-bottom:1px dashed #10b981}.clock-edit-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:12px;color:#94a3b8}.clock-edit-row input{width:58px;background:#09090b;color:#e2e8f0;border:1px solid #334155;border-radius:6px;padding:5px;user-select:text}.clock-edit-row #clockEditStatus{flex:1;min-width:100px}.clock-container #blindLabel{overflow-wrap:anywhere;font-size:11px}

.replay-nav{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}.replay-nav .btn-play{width:auto;padding:6px 10px}#replayBoard,#replayAction{margin:6px 0}#replayPlayers td:nth-child(2){white-space:nowrap}

.clock-presets{display:flex;align-items:center;gap:5px;flex-wrap:wrap;margin:4px 0 8px}.clock-presets button{background:#111827;color:#cbd5e1;border:1px solid #334155;border-radius:5px;font-size:11px;padding:5px 7px;cursor:pointer}.clock-presets button:hover,.clock-presets button:focus-visible{border-color:#10b981;color:#a7f3d0}

#decisionReview label{display:block;margin:8px 0 4px}#decisionPick{width:100%;background:#09090b;color:#e2e8f0;border:1px solid #334155;border-radius:6px;padding:8px}#decisionRun{width:auto;padding:7px 12px;margin:8px 0}#decisionResult{margin:6px 0}

/* Keep new study controls within the original table's responsive panel. */
#decisionHistory>label,#historyFile{display:block;margin:8px 0 4px}
#decisionHistory select,#historyFile{width:100%;max-width:100%;min-width:0;box-sizing:border-box;background:#09090b;color:#e2e8f0;border:1px solid #334155;border-radius:6px;padding:8px;font:inherit}
#decisionHistory .btn-play,#decisionSave{width:auto;max-width:100%;height:auto;min-height:32px;white-space:normal;padding:7px 12px;margin:6px 4px 6px 0}
#historyConfirmDelete{accent-color:#10b981}
#decisionHistory h3{font-size:13px;color:#cbd5e1;margin:12px 0 5px}
#historyStatus,#planStatus,#planActionStatus,#historyDataStatus,#decisionSaveStatus{margin:6px 0;overflow-wrap:anywhere}


/* Prepare first; once a hand exists, bring the table and actions forward on small screens. */
.setup-position{display:grid;grid-template-columns:auto minmax(0,1fr);gap:6px 12px;align-items:center;color:#cbd5e1;font-size:13px;margin:6px 0 10px}
.setup-position label{font-weight:700}
.setup-position select{margin:0;min-width:0;min-height:40px}
.setup-position small{grid-column:1/-1;color:#aab9c8;font-size:11px}
.classic-next-setup{min-height:44px;border:1px solid #3d806c;background:#173e33;color:#d1fae5;border-radius:9px;font-weight:800;cursor:pointer;padding:10px}
.classic-next-setup[hidden]{display:none!important}
#classicActionStatus:empty{display:none}
#classicActionStatus{margin:0;padding:8px;border-radius:7px;background:#172437}
.classic-status,.classic-subtle,.res-insight,.classic-details,.classic-details p,.classic-details pre,input,textarea{user-select:text}
button:focus-visible,select:focus-visible,input:focus-visible,summary:focus-visible{outline:2px solid #74e6b3;outline-offset:2px}
#classicTable:focus{outline:none}
@media(max-width:899px){
 body[data-hand-phase=setup] .main-layout{flex-direction:column}
 body:is([data-hand-phase=playing],[data-hand-phase=finished]) .main-layout{flex-direction:column-reverse}
 body:is([data-hand-phase=playing],[data-hand-phase=finished]) .right-panel>.table-container{order:0}
 body:is([data-hand-phase=playing],[data-hand-phase=finished]) .right-panel>.lab-action-guide{order:1}
 body:is([data-hand-phase=playing],[data-hand-phase=finished]) .right-panel>#classicActionStatus{order:2}
 body:is([data-hand-phase=playing],[data-hand-phase=finished]) .right-panel>.classic-actions{order:3}
 body:is([data-hand-phase=playing],[data-hand-phase=finished]) .right-panel>.classic-raise{order:4}
 body:is([data-hand-phase=playing],[data-hand-phase=finished]) .right-panel>.classic-next-setup{order:5}
 body:is([data-hand-phase=playing],[data-hand-phase=finished]) .right-panel>.result-panel{order:6}
 body:is([data-hand-phase=playing],[data-hand-phase=finished]) .right-panel>.tournament-dashboard{order:7}
 body:is([data-hand-phase=playing],[data-hand-phase=finished]) .right-panel>details{order:8}
 .classic-actions button{min-height:44px}
 #classicSetup,#classicTable{scroll-margin-top:10px}
}
