/* ===== Spins Drill – Prototipo v2 ===== */
:root {
    --bg-dark: #0a0f1e;
    --table-green: #1a5c3a;
    --table-border: #3d2b1f;
    --accent-orange: #f97316;
    --card-bg: #fefefe;
    --card-black: #1e293b;
    --card-red: #dc2626;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --seat-bg: #1e293b;
    --hero-border: #f97316;
    --shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#app {
    width: 100%;
    max-width: 100%;
    /* eliminamos el límite para que use todo el ancho */
    text-align: center;
    padding: 10px;
}

header h1 {
    font-size: 2rem;
    letter-spacing: -0.5px;
    color: var(--accent-orange);
}

header p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ===== Mesa ovalada ===== */
#table {
    position: relative;
    width: 90vw;
    /* 90% del ancho de la pantalla */
    max-width: 700px;
    /* pero no más de 700px */
    aspect-ratio: 700 / 380;
    /* mantiene la proporción ovalada */
    margin: 20px auto;
    /* centrado */
    background: radial-gradient(ellipse at center, #2a7a4d 0%, var(--table-green) 60%, #0f3d24 100%);
    border: 8px solid var(--table-border);
    border-radius: 50%;
    box-shadow: var(--shadow), inset 0 0 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* Línea decorativa del tapete */
#table::before {
    content: '';
    position: absolute;
    inset: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    pointer-events: none;
}

/* ===== Asientos ===== */
.seat {
    position: absolute;
    width: clamp(120px, 20vw, 180px);
    background: var(--seat-bg);
    border-radius: 12px;
    padding: clamp(8px, 1.5vw, 12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(4px, 0.8vw, 6px);
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.seat.hero {
    border: 2px solid var(--hero-border);
    background: #1e2b3c;
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.3);
}

/* Posicionamiento de los asientos */
.seat[data-position="BTN"] {
    bottom: clamp(15px, 3vw, 25px);
    left: 50%;
    transform: translateX(-50%);
}

.seat[data-position="SB"] {
    top: clamp(15px, 3vw, 25px);
    left: clamp(10%, 3vw, 15%);
}

.seat[data-position="BB"] {
    top: clamp(15px, 3vw, 25px);
    right: clamp(10%, 3vw, 15%);
}

/* Estados de acción */
.seat.folded {
    opacity: 0.4;
    filter: grayscale(80%);
}

.seat.limped {
    background: #14532d;
    /* verde oscuro */
    border: 2px solid #22c55e;
}

.seat.raised {
    background: #78350f;
    /* marrón/amarillo */
    border: 2px solid #facc15;
}

.seat.allin {
    background: #7f1d1d;
    /* rojo oscuro */
    border: 2px solid #ef4444;
}

.seat.pending {
    background: #1e293b;
    /* color normal, esperando */
}

/* Etiqueta de acción */
.action-indicator {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
}

/* Etiqueta de posición */
.position {
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--accent-orange);
    letter-spacing: 1px;
}

/* ===== Cartas ===== */
.cards {
    display: flex;
    gap: clamp(4px, 1vw, 6px);
}

.card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(28px, 5vw, 42px);
    height: clamp(40px, 7vw, 56px);
    background: var(--card-bg);
    border-radius: 6px;
    font-size: clamp(1rem, 2.2vw, 1.4rem);
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    color: var(--card-black);
    user-select: none;
}

.card.back {
    background: repeating-linear-gradient(45deg,
            #334155,
            #334155 4px,
            #1e293b 4px,
            #1e293b 8px);
    color: transparent;
    border: 1px solid #475569;
}

/* Colores de palos */
.card[data-suit="hearts"],
.card[data-suit="diamonds"] {
    color: var(--card-red);
}

.card[data-suit="clubs"],
.card[data-suit="spades"] {
    color: var(--card-black);
}

/* ===== Stack ===== */
.stack {
    font-size: clamp(0.7rem, 1.5vw, 0.9rem);
    padding: clamp(3px, 0.5vw, 4px) clamp(6px, 1vw, 8px);
    border-radius: 20px;
    display: inline-block;
    font-weight: 600;
}

/* ===== Temporizador ===== */
#timer {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 800;
    color: var(--text-light);
    margin: clamp(8px, 2vw, 10px) 0;
    text-shadow: 0 0 20px rgba(249, 115, 22, 0.6);
}

#timer.warning {
    color: var(--card-red);
    animation: pulse 0.8s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ===== Botones de acción ===== */
#actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

#actions button {
    padding: clamp(10px, 2vw, 14px) clamp(18px, 3vw, 24px);
    font-size: clamp(0.85rem, 2vw, 1rem);
    font-weight: 700;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.5px;
    min-width: clamp(80px, 15vw, 100px);
    background: #334155;
    color: var(--text-light);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#actions button:hover {
    transform: translateY(-2px);
    filter: brightness(1.2);
}

#actions button:active {
    transform: translateY(1px);
    box-shadow: none;
}

#actions button[data-action="fold"] {
    background: #dc2626;
}

#actions button[data-action="call"] {
    background: #2563eb;
}

#actions button[data-action="raise"] {
    background: var(--accent-orange);
}

#actions button[data-action="allin"] {
    background: #7c3aed;
}

/* ===== Feedback ===== */
#feedback {
    min-height: 60px;
    margin-top: 20px;
    font-size: clamp(0.8rem, 1.8vw, 0.95rem);
    line-height: 1.5;
}

#feedback p {
    background: rgba(30, 41, 59, 0.8);
    padding: clamp(8px, 1.5vw, 12px);
    border-radius: 8px;
    margin-bottom: 8px;
}

#feedback .correct {
    color: #4ade80;
}

#feedback .incorrect {
    color: #f87171;
}

#feedback .timeout {
    color: #fbbf24;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #1e293b;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 15px;
}

.modal-content button {
    margin: 5px;
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
}

#cancel-raise {
    background: #64748b;
    color: white;
}

.hidden {
    display: none;
}

#home-screen {
    text-align: center;
}

#logo {
    width: 100px;
    height: auto;
    margin-bottom: 20px;
}

#stats-summary {
    background: #1e293b;
    padding: 15px;
    border-radius: 10px;
    margin: 20px;
}

#start-practice,
#end-practice {
    padding: 12px 24px;
    font-size: 1.1rem;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    margin-top: 15px;
}

#start-practice {
    background: var(--accent-orange);
    color: white;
}

#end-practice {
    background: #64748b;
    color: white;
    position: absolute;
    top: clamp(5px, 2vw, 10px);
    right: clamp(5px, 2vw, 10px);
    z-index: 50;
    padding: clamp(8px, 1.5vw, 12px) clamp(12px, 2vw, 24px);
    font-size: clamp(0.8rem, 1.8vw, 1.1rem);
}

#actions.disabled {
    opacity: 0.5;
    pointer-events: none;
}

#practice-screen {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#practice-screen.hidden {
    display: none !important;
}

#home-screen.hidden {
    display: none !important;
}

.position {
    font-size: clamp(0.65rem, 1.4vw, 0.85rem);
    letter-spacing: 1px;
}

.action-indicator {
    font-size: clamp(0.55rem, 1.1vw, 0.7rem);
    padding: 2px 6px;
    margin-top: 4px;
}

#table.hu .seat[data-position="BB"] {
    right: 50%;
    transform: translateX(50%);
}