/* === VARIABLES === */
:root {
    --card-w: 80px;
    --card-h: 112px;
    --gap: 12px;
}

/* Prevent zoom on mobile devices including iOS */
* {
    touch-action: manipulation;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
}

/* Section titles */
.section-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    letter-spacing: 0.5px;
    text-transform: capitalize;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #4A90E2, transparent);
}

* {
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
    width: 100%;
}

body {
    background: #f8f9fa;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.container {
    max-width: 880px;
}

/* === TARJETAS GENERALES === */
.card {
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.card-body {
    padding: 1.5rem;
}

/* === TÍTULO === */
h1 {
    font-size: 2.1rem;
    font-weight: 700;
}

/* =========================================
   LÍNEA "ESTÁS EN ..." + CHIPS
   ========================================= */
#spotLine {
    text-align: center;
    font-size: 1rem;
    color: #444;
    margin-bottom: 0.2rem;
}

.spot-title {
    font-size: 1rem;
    font-weight: 500;
    color: #333;
}

.spot-line-inner .separator {
    font-size: 1.1rem;
    font-weight: 600;
    color: #888;
}

/* Open-Raise */
#spotLine .tag-or {
    display: inline-block;
    padding: 3px 10px;
    margin: 0 4px;
    border-radius: 999px;
    background: #e3f0ff;
    color: #0b5ed7;
    font-weight: 600;
    font-size: 0.95rem;
}

/* 3-Bet (no se usa ahora pero lo dejamos por si) */
#spotLine .tag-3bet {
    display: inline-block;
    padding: 3px 10px;
    margin: 0 4px;
    border-radius: 999px;
    background: #e9f8ec;
    color: #18833c;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Posición (SIN RELLENO, SOLO BORDE) */
#spotLine .tag-pos,
.tag-pos {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 2px solid #93C5FD;
    color: #1D4ED8;
    background-color: transparent !important;
}

/* === CARTAS === */
#handDisplay {
    display: flex;
    gap: var(--gap);
    justify-content: center;
    align-items: center;
    margin: .75rem 0 1rem;
}

.card-box {
    width: var(--card-w);
    height: var(--card-h);
    border: 2px solid #111;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: 700;
    background: #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .18);
    user-select: none;
    transition: transform .15s ease;
}

.card-box:hover {
    transform: scale(1.05);
}

.card-box.red {
    color: #d02222;
}

.card-box.black {
    color: #111;
}

.card-box.blue {
    color: #2f80ed;
}

.card-box.green {
    color: #219653;
}

/* === FRASE BAJO LAS CARTAS === */
.spot-hint {
    margin-top: 0;
    margin-bottom: 0;
    text-align: center;
    font-size: 1rem;
    color: #444;
    min-height: 0;
    /* Ensure it doesn't take space if empty */
    display: none !important;
}

/* Pull controls up closer to cards */
#controlsOR,
#controls3BET {
    margin-top: -10px !important;
}

/* COLD4BET needs more space to avoid overlapping cards */
#controlsCOLD4BET {
    margin-top: 90px !important;
}

/* Cards container with circular buttons */
.cards-container-with-buttons {
    position: relative;
    display: flex;
    justify-content: center;
    margin: 0 0 -45px 0;
}

/* Next hand button */
.btn-next-hand {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid #999;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.btn-next-hand:hover {
    background: #4A90E2;
    border-color: #4A90E2;
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.btn-next-hand:active {
    transform: translateY(-50%) scale(0.95);
}

.btn-next-hand svg {
    flex-shrink: 0;
}

/* Active state when answer is correct - green */
.btn-next-hand.active.correct {
    background: #1a5f3a;
    border-color: #1a5f3a;
    color: white;
    animation: pulse-green 1.5s ease-in-out infinite;
}

.btn-next-hand.active.correct:hover {
    background: #0d4d2b;
    border-color: #0d4d2b;
    color: white;
}

/* Active state when answer is wrong - red */
.btn-next-hand.active.wrong {
    background: #C62828;
    border-color: #C62828;
    color: white;
    animation: pulse-red 1.5s ease-in-out infinite;
}

.btn-next-hand.active.wrong:hover {
    background: #B71C1C;
    border-color: #B71C1C;
    color: white;
}

@keyframes pulse-green {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(26, 95, 58, 0.7);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(26, 95, 58, 0);
    }
}

@keyframes pulse-red {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.7);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(198, 40, 40, 0);
    }
}

/* View table button - mirror of next hand button on the left */
.btn-view-table {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid #999;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.btn-view-table:hover {
    background: #4A90E2;
    border-color: #4A90E2;
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.btn-view-table:active {
    transform: translateY(-50%) scale(0.95);
}

.btn-view-table svg {
    flex-shrink: 0;
}

/* === BOTONES ACCIÓN === */
#controlsOR .btn,
#controls3BET .btn,
#controlsCOLD4BET .btn {
    min-width: 130px;
    font-weight: 700;
    white-space: nowrap;
}

/* Minimal gap between button rows */
.button-row-gap {
    margin-bottom: 0 !important;
}

/* SB Layout: Single row with 3 buttons */
.sb-layout {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0 0.75rem;
    justify-items: center;
}

/* All buttons in first row */
.sb-layout #raiseContainer {
    grid-column: 1;
    grid-row: 1;
}

.sb-layout #limpBtnContainer {
    grid-column: 2;
    grid-row: 1;
}

.sb-layout #foldContainer {
    grid-column: 3;
    grid-row: 1;
}

/* Reduce spacing of percentage displays */
.action-pct {
    margin-top: 0.3rem !important;
    margin-bottom: 0.05rem !important;
    font-size: 0.65rem;
    line-height: 0.9;
}

/* Ensure all button containers align at the top */
#controlsOR .d-flex,
#controls3BET .d-flex,
#controlsCOLD4BET .d-flex {
    align-items: flex-start;
}

.btn-3bet {
    background: transparent;
    color: #EF6C00;
    border: 3px solid #EF6C00;
    font-weight: 700;
}

.btn-3bet:hover {
    background: rgba(239, 108, 0, 0.1);
    color: #EF6C00;
    border-color: #EF6C00;
}

.btn-call {
    background: transparent;
    color: #2E7D32;
    border: 3px solid #2E7D32;
    font-weight: 700;
}

.btn-call:hover {
    background: rgba(46, 125, 50, 0.1);
    color: #2E7D32;
    border-color: #2E7D32;
}

.btn-fold {
    background: transparent;
    color: #C62828;
    border: 3px solid #C62828;
    font-weight: 700;
}

.btn-fold:hover {
    background: rgba(198, 40, 40, 0.1);
    color: #C62828;
    border-color: #C62828;
}

.btn-limp {
    background: transparent;
    color: #2196F3;
    border: 3px solid #2196F3;
    font-weight: 700;
}

.btn-limp:hover {
    background: rgba(33, 150, 243, 0.1);
    color: #2196F3;
    border-color: #2196F3;
}

/* Remove focus/active background on disabled buttons */
.btn:disabled,
.btn:disabled:hover,
.btn:disabled:active,
.btn:disabled:focus,
.btn.active,
.btn-selected,
.btn-selected:hover,
.btn-selected:active,
.btn-selected:focus,
.btn-selected.active,
.btn-dimmed,
.btn-dimmed:hover,
.btn-dimmed:active,
.btn-dimmed:focus,
.btn-dimmed.active {
    outline: none !important;
    box-shadow: none !important;
}

.btn-3bet:disabled,
.btn-3bet:disabled:hover,
.btn-3bet:disabled:active,
.btn-3bet:disabled:focus,
.btn-3bet.active,
.btn-3bet:disabled.active {
    background: transparent !important;
    color: #FB8C00 !important;
    border-color: #FB8C00 !important;
}

.btn-call:disabled,
.btn-call:disabled:hover,
.btn-call:disabled:active,
.btn-call:disabled:focus,
.btn-call.active,
.btn-call:disabled.active {
    background: transparent !important;
    color: #43A047 !important;
    border-color: #43A047 !important;
}

.btn-fold:disabled,
.btn-fold:disabled:hover,
.btn-fold:disabled:active,
.btn-fold:disabled:focus,
.btn-fold:disabled.active {
    background: transparent !important;
    color: #E53935 !important;
    border-color: #E53935 !important;
}

.btn-limp:disabled,
.btn-limp:disabled:hover,
.btn-limp:disabled:active,
.btn-limp:disabled:focus,
.btn-limp.active,
.btn-limp:disabled.active {
    background: transparent !important;
    color: #2196F3 !important;
    border-color: #2196F3 !important;
}

/* === SIGUIENTE MANO === */
#nextBtn {
    background: #fff;
    color: #495057;
    border: 1px solid #cfd4da;
    border-radius: 14px;
    padding: .35rem .8rem;
    font-weight: 600;
    font-size: 15px;
    box-shadow: none;
    transition: background .15s ease, transform .12s ease;
    margin-bottom: 0.15rem !important;
}

#nextBtn:hover {
    background: #f7f7f7;
    transform: translateY(-1px);
}

/* === FEEDBACK === */
#feedback {
    white-space: pre-line;
    text-align: center;
    margin-top: 0.1rem !important;
    padding-top: 0 !important;
}

/* Tamaño para CORRECTO / INCORRECTO (más pequeño) */
/* Tamaño para CORRECTO / INCORRECTO (más pequeño) */
#feedback .main-line {
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 800;
    margin: 8px 0;
    padding: 6px 12px;
    border-radius: 50px;
    color: white;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#feedback .detail-line {
    display: block;
    font-size: 0.95rem;
    color: #444;
    margin-top: 5px;
}

#feedback.ok .main-line {
    background: linear-gradient(135deg, #43A047 0%, #2E7D32 100%);
}

#feedback.bad .main-line {
    background: linear-gradient(135deg, #E53935 0%, #C62828 100%);
}

/* Animaciones */
.feedback {
    opacity: 0;
    transform: translateY(-6px);
    transition: .25s ease;
}

.feedback.show {
    opacity: 1;
    transform: translateY(0);
}

#handDisplay.glow-ok {
    box-shadow: 0 0 0 3px rgba(46, 204, 113, .25);
    border-radius: 12px;
}

#handDisplay.glow-bad {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, .25);
    border-radius: 12px;
}

.btn-pulse-ok {
    animation: pulseOk 280ms ease;
}

@keyframes pulseOk {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
    }
}

.btn-shake-bad {
    animation: shakeBad 300ms ease;
}

@keyframes shakeBad {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* === MARCADOR === */
.badge {
    font-size: 15px !important;
    padding: .45rem .8rem !important;
    border-radius: 12px !important;
    font-weight: 600;
    letter-spacing: .2px;
    background: transparent !important;
    border: 2px solid transparent !important;
    color: #444 !important;
}

/* Aciertos */
.text-bg-success {
    border-color: #56C870 !important;
    color: #1f7a36 !important;
}

/* Fallos */
.text-bg-secondary {
    border-color: #E57373 !important;
    color: #b12828 !important;
}

/* % */
.text-bg-info {
    border-color: #5C6BC0 !important;
    color: #3949AB !important;
}

/* Racha */
.text-bg-warning {
    border-color: #FFB74D !important;
    color: #C77700 !important;
}

/* Top */
.text-bg-violet {
    border-color: #BA68C8 !important;
    color: #8E24AA !important;
}

/* === TABLA DE FALLOS === */
.table {
    font-size: .92rem;
}

.table th {
    background: #f2f2f2;
    font-weight: 600;
}

.table tr:hover {
    background: #fafafa;
}

/* === FORMULARIOS === */
.form-select,
.form-control {
    border-radius: 8px;
}

button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* === RESPONSIVE === */
/* Tablets and smaller desktops */
@media (max-width:768px) {
    :root {
        --card-w: 70px;
        --card-h: 98px;
        --gap: 10px;
    }
}

/* Large phones like iPhone Pro Max */
@media (min-width: 390px) and (max-width: 480px) {
    :root {
        --card-w: 75px;
        --card-h: 105px;
        --gap: 10px;
    }

    /* Better button positioning for large phones */
    .btn-next-hand {
        right: 20px !important;
    }

    .btn-view-table {
        left: 20px !important;
    }
}

/* Small phones */
@media (max-width:389px) {
    :root {
        --card-w: 70px;
        --card-h: 98px;
        --gap: 8px;
    }

    /* Adjust next hand button position for narrow screens */
    .btn-next-hand {
        right: 10px !important;
        top: 50%;
        transform: translateY(calc(-50% + 10px));
        width: 40px;
        height: 40px;
    }

    .btn-next-hand svg {
        width: 20px;
        height: 20px;
    }

    /* Adjust view table button position for narrow screens */
    .btn-view-table {
        left: 10px !important;
        top: 50%;
        transform: translateY(calc(-50% + 10px));
        width: 40px;
        height: 40px;
    }

    .btn-view-table svg {
        width: 20px;
        height: 20px;
    }

    /* Reduce spacing between cards and action buttons on small screens */
    .cards-container-with-buttons {
        margin-bottom: -30px !important;
    }

    #controlsOR .btn,
    #controls3BET .btn {
        min-width: 95px;
        font-size: 0.9rem;
    }
}



/* === LINK REINICIAR === */
#resetBtn {
    font-size: 0.85rem;
    text-decoration: underline;
    color: #777 !important;
}

#resetBtn:hover {
    color: #444 !important;
}

/* === BOTONES RESPUESTA === */
#controlsOR {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--gap);
    width: calc((2 * var(--card-w)) + var(--gap));
    margin: .25rem auto 0;
}

.btn-success-soft,
.btn-danger-soft {
    width: var(--card-w);
    height: var(--card-w);
    padding: 0 !important;
    border-radius: 12px;
    background: #fff;
    border: 2px solid #e6e9ef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.btn-success-soft:hover {
    background: #e6f8ed;
    transform: scale(1.05);
}

.btn-danger-soft:hover {
    background: #fdeaea;
    transform: scale(1.05);
}

/* === CHECK === */
.btn-checkpass {
    background: transparent;
    color: #4D8FFF;
    border: 3px solid #4D8FFF;
    font-weight: 700;
}

.btn-checkpass:hover {
    background: rgba(77, 143, 255, 0.1);
    color: #4D8FFF;
    border-color: #4D8FFF;
}

/* === TOGGLE SWITCH === */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    cursor: pointer;
    margin-right: -8px;
    /* Ajuste fino para pegar más a la derecha */
    margin-top: -8px;
    /* Ajuste fino para pegar más arriba */
}

.toggle-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    user-select: none;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.toggle-slider {
    background-color: #2196F3;
    /* Azul o Verde según preferencia, usaré azul por defecto */
}

input:checked+.toggle-slider:before {
    transform: translateX(20px);
}

/* Estilo verde como en la imagen */
input:checked+.toggle-slider.green-toggle {
    background-color: #4CAF50;
}

/* === INFO SPOT (BADGES) === */
.spot-container {
    display: flex;
    flex-direction: column;
    /* Layout vertical: Modo arriba, Posiciones abajo */
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 1rem;
}

.spot-row-mode {
    width: 100%;
    display: flex;
    justify-content: center;
}

.spot-row-pos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.spot-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spot-badge-mode {
    /* Color base oscuro para el texto en todos los modos suaves */
    color: #00695C;
    background: #E0F2F1;
    border: 1px solid #B2DFDB;
}

/* Unificar todos los modos al mismo estilo Teal suave */
.spot-badge-mode.or,
.spot-badge-mode.mode-3bet,
.spot-badge-mode.limp,
.spot-badge-mode.squeeze {
    background: #E0F2F1;
    color: #00695C;
    border: 1px solid #B2DFDB;
}

.spot-badge-pos {
    /* Posiciones con estilo azul para diferenciarse del modo */
    background: #E3F0FF;
    color: #0b5ed7;
    border: 1px solid #93C5FD;
}

.spot-badge-pos.hero {
    /* Hero mantiene el estilo azul */
    border-color: #93C5FD;
    color: #0b5ed7;
    background: #E3F0FF;
}

.spot-badge-pos.villain {
    /* Villain con estilo rojo para diferenciarse */
    border-color: #EF9A9A;
    color: #C62828;
    background: #FFEBEE;
}

.spot-badge-pos.or-pos {
    /* OR position con estilo rojo (igual que villain) */
    border-color: #EF9A9A;
    color: #C62828;
    background: #FFEBEE;
}

.spot-badge-pos.call-pos {
    /* CALL position con estilo naranja para diferenciarse */
    border-color: #FFB74D;
    color: #E65100;
    background: #FFF3E0;
}

.spot-separator {
    font-size: 0.9rem;
    font-weight: 700;
    color: #999;
    text-transform: lowercase;
    font-style: italic;
}


/* ===================================
   VISUAL POKER TABLE STYLES (UPDATED)
   =================================== */

.visual-table-container {
    width: 100%;
    /* Responsive */
    max-width: 360px;
    /* Aumentado para ordenador - evita superposición de fichas */
    margin: 0 auto;
    padding: 10px 0;
}

.poker-table {
    position: relative;
    width: 100%;
    /* Responsive */
    max-width: 360px;
    /* Aumentado para ordenador */
    aspect-ratio: 3 / 4;
    /* Mantener proporción 315:420 (vertical) */
    /* Reduced from 120% to make table less elongated */
    background: linear-gradient(135deg, #0d4d2b 0%, #1a5f3a 50%, #0d4d2b 100%);
    border-radius: 50%;
    border: 12px solid #000;
    box-shadow:
        inset 0 0 40px rgba(0, 0, 0, 0.5),
        0 15px 40px rgba(0, 0, 0, 0.6);
}

/* Seat container */
.seat {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
}

/* Avatar circle */
.seat-avatar {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border: 3px solid #7f8c8d;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Seat info (position label) */
.seat-info {
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid #444;
    border-radius: 6px;
    padding: 4px 12px;
    min-width: 70px;
    text-align: center;
}

.seat-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
}

/* Small cards on seats */
.seat-cards {
    display: flex;
    gap: 2px;
    margin-top: 2px;
}

.seat-cards .mini-card {
    width: 18px;
    height: 26px;
    background: #fff;
    border-radius: 2px;
    border: 1px solid #000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Seat positions - 6-max oval layout (standard poker order) */
.seat-sb {
    top: 2%;
    left: 50%;
    transform: translateX(-50%);
}

.seat-bb {
    top: 18%;
    right: 8%;
}

.seat-utg {
    bottom: 18%;
    right: 8%;
}

.seat-hj {
    bottom: 2%;
    left: 50%;
    transform: translateX(-50%);
}

.seat-co {
    bottom: 18%;
    left: 8%;
}

.seat-btn {
    top: 18%;
    left: 8%;
}

/* Hero state - always at bottom */
.seat.hero .seat-avatar {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    border-color: #3498db;
    box-shadow: 0 0 25px rgba(52, 152, 219, 0.8);
    transform: scale(1.15);
}

.seat.hero .seat-info {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    border-color: #3498db;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.6);
}

/* Villain states */
.seat.villain .seat-avatar {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    border-color: #e74c3c;
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.7);
    transform: scale(1.1);
}

.seat.villain .seat-info {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    border-color: #e74c3c;
}

.seat.or-villain .seat-avatar {
    background: linear-gradient(135deg, #d35400 0%, #e67e22 100%);
    border-color: #e67e22;
    box-shadow: 0 0 18px rgba(230, 126, 34, 0.7);
    transform: scale(1.08);
}

.seat.or-villain .seat-info {
    background: linear-gradient(135deg, #d35400 0%, #e67e22 100%);
    border-color: #e67e22;
}

.seat.call-villain .seat-avatar {
    background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%);
    border-color: #f39c12;
    box-shadow: 0 0 18px rgba(243, 156, 18, 0.7);
    transform: scale(1.08);
}

.seat.call-villain .seat-info {
    background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%);
    border-color: #f39c12;
}

/* Dealer button indicator */
.seat.dealer .seat-avatar::after {
    content: "D";
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    background: #fff;
    color: #000;
    border: 2px solid #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 900;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .seat-avatar {
        width: 50px;
        height: 50px;
    }

    .seat-info {
        padding: 3px 8px;
        min-width: 60px;
    }

    .seat-label {
        font-size: 0.65rem;
    }

    /* Adjust chip positions for mobile - same logic as desktop but scaled */
    .seat-sb .blind-chip,
    .seat-bb .blind-chip,
    .seat-utg .blind-chip,
    .seat-hj .blind-chip,
    .seat-co .blind-chip,
    .seat-btn .blind-chip {
        top: 78px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        margin: 0 !important;
        bottom: auto !important;
        right: auto !important;
    }

    /* Hero and neighbors - chips above avatar on mobile */
    .seat.hero .blind-chip,
    .seat.hero-neighbor .blind-chip {
        top: -18px !important;
    }
}

/* Position hero cards below the visual table when active */
.visual-table-container:not(.d-none)~#handDisplay {
    position: relative;
    margin-top: -120px;
    z-index: 100;
}

/* Make cards slightly smaller when in visual table mode */
.visual-table-container:not(.d-none)~#handDisplay .card {
    transform: scale(0.85);
}

/* Hero cards container inside the table */
.hero-cards-container {
    position: absolute;
    top: 110%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 8px;
    z-index: 60;
}

/* Adjust visual table container to be relative for absolute positioning */
.visual-table-container {
    position: relative;
}

/* Blind chip indicators */
.blind-chip {
    position: absolute;
    background: conic-gradient(from 0deg,
            #e74c3c 0deg 45deg,
            #fff 45deg 90deg,
            #e74c3c 90deg 135deg,
            #fff 135deg 180deg,
            #e74c3c 180deg 225deg,
            #fff 225deg 270deg,
            #e74c3c 270deg 315deg,
            #fff 315deg 360deg);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0;
    border-radius: 50%;
    border: 2px solid #8b0000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 3px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    width: 32px;
    height: 32px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 20;
    position: relative;
}

/* Inner circle for the chip value */
.blind-chip::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: #c0392b;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.4);
    z-index: -1;
}

/* Position blind chips around avatars based on visual seat location */
/* All chips: centered below avatar and position label */
.seat-sb .blind-chip,
.seat-bb .blind-chip,
.seat-utg .blind-chip,
.seat-hj .blind-chip,
.seat-co .blind-chip,
.seat-btn .blind-chip {
    position: absolute;
    top: 92px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
}

/* Exception: Hero position and neighbors - chips above avatar */
.seat.hero .blind-chip,
.seat.hero-neighbor .blind-chip {
    top: -20px;
    bottom: auto;
}

/* Hero cards container inside table */


.hero-cards-container .card {
    transform: scale(0.8);
}

/* Move action buttons down when visual table is active to avoid overlap */
/* Adjust spacing below visual table to accommodate overlapping cards */
.visual-table-container:not(.d-none)~.spot-hint,
.visual-table-container:not(.d-none)~#controlsOR,
.visual-table-container:not(.d-none)~#controls3BET {
    margin-top: 95px !important;
}

/* Reduce margin on smaller screens to keep buttons closer to cards */
@media (max-width: 360px) {

    .visual-table-container:not(.d-none)~.spot-hint,
    .visual-table-container:not(.d-none)~#controlsOR,
    .visual-table-container:not(.d-none)~#controls3BET {
        margin-top: 70px !important;
    }
}

/* Percentage display below action buttons */
.action-pct {
    font-size: 0.85rem;
    font-weight: 700;
    color: #555;
    min-height: 1.2em;
    /* Reserve space to avoid layout shift */
}

/* Game Mode Title */
.game-mode-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: #fff;
    display: inline-block;
    padding: 6px 16px;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #eee;
    margin-top: -10px;
}

.game-mode-dropdown {
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.game-mode-dropdown::after {
    content: '▼';
    font-size: 0.7rem;
    margin-left: 8px;
    opacity: 0.6;
}

.game-mode-dropdown:hover {
    background: #f8f9fa;
    border-color: #4A90E2;
    color: #4A90E2;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
}

.dropdown-menu-center {
    left: 50% !important;
    transform: translateX(-50%) !important;
}

/* Button Feedback States - Must override button-specific colors */
.btn.btn-selected,
.btn-3bet.btn-selected,
.btn-call.btn-selected,
.btn-fold.btn-selected,
.btn-limp.btn-selected {
    opacity: 1 !important;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(67, 160, 71, 0.4) !important;
    border: 3px solid #43A047 !important;
    /* Green for correct */
    color: #43A047 !important;
    background: transparent !important;
    z-index: 10;
}

.btn.btn-wrong,
.btn-3bet.btn-wrong,
.btn-call.btn-wrong,
.btn-fold.btn-wrong,
.btn-limp.btn-wrong {
    border-color: #E53935 !important;
    /* Red for incorrect */
    color: #E53935 !important;
    box-shadow: 0 0 15px rgba(229, 57, 53, 0.4) !important;
    background: transparent !important;
}

.btn-dimmed {
    opacity: 0.3 !important;
    filter: grayscale(80%);
    transform: scale(0.95);
    pointer-events: none;
}

/* === COMPACT STATS === */
.stats-compact {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.stat-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
}

.stat-item span {
    font-weight: 600;
}

/* Responsive: smaller on mobile */
@media (max-width: 480px) {
    .stats-compact {
        font-size: 0.85rem;
        gap: 0.5rem;
    }
}

/* Reset stats button */
.btn-reset-stats {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid #999;
    color: #999;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    margin-left: 0.5rem;
}

.btn-reset-stats:hover {
    background: #f44336;
    border-color: #f44336;
    color: white;
    transform: scale(1.1);
}

.btn-reset-stats:active {
    transform: scale(0.95);
}

.btn-reset-stats svg {
    flex-shrink: 0;
}

/* Menu icon */
.menu-icon {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid #999;
    color: #999;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.menu-icon:hover {
    background: #4A90E2;
    border-color: #4A90E2;
    color: white;
    transform: scale(1.1);
}

.menu-icon:active {
    transform: scale(0.95);
}

.menu-icon svg {
    flex-shrink: 0;
}

/* Settings icon */
.settings-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid #999;
    color: #999;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.settings-icon:hover {
    background: #4A90E2;
    border-color: #4A90E2;
    color: white;
    transform: rotate(90deg) scale(1.1);
}

.settings-icon:active {
    transform: rotate(90deg) scale(0.95);
}

.settings-icon svg {
    flex-shrink: 0;
}

/* Settings Modal */
.settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.settings-modal.active {
    display: flex;
}

.settings-modal-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 90%;
    width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.settings-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid #999;
    color: #999;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-modal-close:hover {
    background: #f44336;
    border-color: #f44336;
    color: white;
    transform: rotate(90deg);
}

.settings-modal-close svg {
    flex-shrink: 0;
}

/* Menu options */
.menu-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.menu-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    font-weight: 500;
    color: #495057;
}

.menu-option:not(:disabled):hover {
    background: #4A90E2;
    border-color: #4A90E2;
    color: white;
    transform: translateX(5px);
}

.menu-option:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.menu-option svg {
    flex-shrink: 0;
}

.menu-option span {
    flex: 1;
    text-align: left;
}

/* Mistake Counter Badge */
.mistake-count {
    background: #e74c3c;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    margin-left: auto;
    min-width: 24px;
    text-align: center;
}

.mistake-count:empty {
    display: none;
}

/* Mistakes Section Header */
.mistakes-header {
    position: relative;
    margin-bottom: 2rem;
}

.back-btn {
    position: absolute;
    left: 0;
    top: 0;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    color: #333;
}

.back-btn:hover {
    background: #4A90E2;
    border-color: #4A90E2;
    color: white;
}

.back-btn svg {
    flex-shrink: 0;
}


/* Mistakes List */
#mistakesContent {
    max-height: 60vh;
    overflow-y: auto;
}

.mistake-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.mistake-item:hover {
    border-color: #4A90E2;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1);
}

.mistake-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.mistake-hand-cards {
    display: flex;
    gap: 0.25rem;
}

.mistake-card {
    width: 40px;
    height: 56px;
    border-radius: 4px;
    background: white;
    border: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mistake-hand {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

.mistake-time {
    font-size: 0.75rem;
    color: #999;
}

.mistake-details {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.75rem;
}

.mistake-actions {
    display: flex;
    gap: 0.5rem;
}

.mistake-btn {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.mistake-btn-review {
    background: #4A90E2;
    color: white;
}

.mistake-btn-review:hover {
    background: #357ABD;
}

.mistake-btn-delete {
    background: #e74c3c;
    color: white;
}

.mistake-btn-delete:hover {
    background: #c0392b;
}

.no-mistakes {
    text-align: center;
    padding: 2rem;
    color: #999;
}

.clear-all-btn {
    width: 100%;
    padding: 0.75rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
}

.clear-all-btn:hover {
    background: #5a6268;
}

/* Review Modal (inside mistakes section) */
.review-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.review-modal-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.review-modal-content .modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: #999;
    transition: color 0.2s;
    z-index: 10;
}

.review-modal-content .modal-close:hover {
    color: #333;
}

.review-info {
    background: transparent;
    padding: 0;
    border-radius: 0;
    text-align: center;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem !important;
}

.review-info strong {
    color: #333;
    font-size: 1.3rem;
    display: block;
    margin-bottom: 0.25rem;
}

.review-info .review-subtitle {
    font-size: 0.95rem;
    color: #666;
    font-weight: 500;
}

.review-table-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e9ecef;
}

.review-range-table h6 {
    color: #666;
    font-weight: 600;
    margin-bottom: 1rem;
}

.mini-range-table {
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    gap: 2px;
    background: #f0f0f0;
    padding: 4px;
    border-radius: 8px;
    max-width: 400px;
    margin: 0 auto;
}

.range-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 2px;
    color: #666;
    transition: all 0.2s;
}

.range-cell.highlighted-hand {
    background: #ffd700;
    color: #333;
    font-weight: 700;
    box-shadow: 0 0 0 2px #ff6b6b;
    transform: scale(1.1);
    z-index: 10;
}

/* Cards and Actions Row */
.cards-actions-row {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.review-cards {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.review-card {
    width: 60px;
    height: 84px;
    border-radius: 6px;
    background: white;
    border: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.review-actions-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.review-action-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: white;
    border: 2px solid transparent;
}

.review-action-row.correct {
    background: #d4edda;
    border: 2px solid #28a745;
}

.review-action-row.wrong {
    background: #f8d7da;
    border: 2px solid #dc3545;
}

.review-action-label {
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 70px;
    white-space: nowrap;
}

.review-action-label.correct {
    color: #28a745;
}

.review-action-label.wrong {
    color: #dc3545;
}

.review-action-btn {
    flex: 1;
    padding: 0.5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
    background: white;
    border: 2px solid #dee2e6;
}

.review-action-row.correct .review-action-btn {
    border-color: #28a745;
    color: #28a745;
}

.review-action-row.wrong .review-action-btn {
    border-color: #dc3545;
    color: #dc3545;
}


/* Adjustments for Galaxy S23 and smaller screens */
@media (max-width: 380px) {

    /* Reduce button min-width to fit 3 in a row */
    .btn-3bet,
    .btn-call,
    .btn-fold,
    .btn-limp {
        min-width: 95px !important;
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
        font-size: 0.9rem !important;
    }

    /* Ensure gap is small enough */
}

/* Modern Settings Panel Styles */
.settings-container {
    padding: 0.5rem;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.setting-group.align-end {
    margin-left: auto;
}

.setting-label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.setting-select {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 0.35rem 2rem 0.35rem 0.75rem;
    font-size: 0.9rem;
    background-color: #f8f9fa;
    cursor: pointer;
    min-width: 100px;
}

.settings-divider {
    border-top: 1px solid #eee;
    margin: 1.5rem 0;
    opacity: 1;
}

/* iOS Toggle Switch */
.ios-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    margin-bottom: 0;
}

.ios-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ios-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.ios-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.ios-slider {
    background-color: #4cd964;
}

input:checked+.ios-slider:before {
    transform: translateX(22px);
}

/* Positions Container */
.positions-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.positions-container.single-column {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
}

.position-card {
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 1.5rem 1rem 1rem;
    position: relative;
    background: #fff;
}

.position-header {
    position: absolute;
    top: -12px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
}

.position-badge {
    background: white;
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
}

.position-badge.hero {
    color: #4A90E2;
}

.position-badge.villain {
    color: #e57373;
}

.position-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.position-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.position-option:hover {
    background: #f8f9fa;
}

.position-option input[type="radio"] {
    margin-top: 0.25rem;
    accent-color: #4A90E2;
    width: 18px;
    height: 18px;
}

.villain-pos-card .position-option input[type="radio"] {
    accent-color: #e57373;
}

.option-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.option-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
}

.position-option select {
    border: none;
    background: transparent;
    padding: 0;
    font-weight: 600;
    color: #4A90E2;
    cursor: pointer;
    width: auto;
}

.villain-pos-card .position-option select {
    color: #e57373;
}

.position-option select:disabled {
    color: #999;
    cursor: not-allowed;
}

.vs-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-style: italic;
    font-size: 0.9rem;
    min-height: 100px;
}

@media (max-width: 480px) {
    .positions-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Mantener settings en una fila pero reducir espacio */
    .settings-row {
        gap: 0.5rem;
    }

    .setting-label {
        font-size: 0.85rem;
    }

    .setting-select {
        padding: 0.25rem 1.5rem 0.25rem 0.5rem;
        font-size: 0.85rem;
        min-width: 80px;
    }
}