:root {
    --bg-felt: #0f5227;
    --bg-felt-dark: #083318;
    --wood-border: #4a2711;
    --gold-accent: #ffd700;
    --card-w: 64px;
    --card-h: 96px;
}

@media (min-width: 600px) {
    :root {
        --card-w: 85px;
        --card-h: 128px;
    }
}

#game-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 680px;
    margin: 0 auto;
    background: radial-gradient(circle at center, var(--bg-felt) 0%, var(--bg-felt-dark) 100%);
    border: 8px solid var(--wood-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px;
    box-shadow: 0 0 30px rgba(0,0,0,0.8) inset, 0 10px 25px rgba(0,0,0,0.5);
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #ffffff;
}

/* HEADER & MARCADOR */
#game-container header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.4);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
}

#game-container .brand {
    font-weight: bold;
    color: var(--gold-accent);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
}

#game-container .scoreboard {
    display: flex;
    gap: 15px;
    text-align: center;
}

#game-container .score-box {
    display: flex;
    flex-direction: column;
}

#game-container .score-num {
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
}

#game-container .score-stage {
    font-size: 0.65rem;
    color: #aaa;
    text-transform: uppercase;
}

/* TABLERO DE JUEGO */
#game-container .play-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px 0;
    position: relative;
}

#game-container .player-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

#game-container .avatar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.3);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
}

#game-container .hand {
    display: flex;
    justify-content: center;
    gap: 8px;
    min-height: var(--card-h);
}

#game-container .table-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    margin: 8px 0;
}

#game-container .played-cards-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    align-items: center;
}

#game-container .played-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    min-height: calc(var(--card-h) * 0.85);
}

/* CARTAS REALISTAS */
#game-container .card {
    width: var(--card-w);
    height: var(--card-h);
    background-color: #fff8ee;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4), 0 0 1px rgba(0,0,0,0.8);
    position: relative;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #d4c5b0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px;
}

#game-container .card:hover:not(.disabled) {
    transform: translateY(-8px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.5);
}

#game-container .card.disabled {
    cursor: default;
    opacity: 0.9;
}

#game-container .card-back {
    background: #1a365d;
    background-image: radial-gradient(#2b4c7e 2px, transparent 2px);
    background-size: 8px 8px;
    border: 3px solid #ffffff;
    border-radius: 6px;
    width: 100%;
    height: 100%;
}

#game-container .card-corner {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

#game-container .card-value {
    font-size: 0.9rem;
    font-weight: 800;
    font-family: 'Georgia', serif;
}

#game-container .card-suit-icon {
    width: 12px;
    height: 12px;
    margin-top: 1px;
}

#game-container .card-center-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50%;
    height: 50%;
    opacity: 0.85;
}

#game-container .card-corner.bottom-right {
    transform: rotate(180deg);
}

/* PALOS COLORES */
#game-container .espadas { color: #1e3d59; }
#game-container .bastos { color: #2b580c; }
#game-container .copas { color: #b80d57; }
#game-container .oros { color: #d68000; }

/* GLOBOS DE CANTOS */
#game-container .speech-bubble {
    position: absolute;
    background: #fff;
    color: #111;
    padding: 6px 14px;
    border-radius: 16px;
    font-weight: bold;
    font-size: 0.85rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border: 2px solid var(--gold-accent);
    z-index: 10;
    animation: popIn 0.25s ease-out;
    pointer-events: none;
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* BOTONERA DE ACCIONES */
#game-container .action-panel {
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    padding: 8px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid rgba(255,255,255,0.1);
}

#game-container .button-group {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

#game-container .btn {
    background: linear-gradient(180deg, #3a3d40 0%, #1f2224 100%);
    color: #fff;
    border: 1px solid #555;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    flex: 1;
    min-width: 70px;
    max-width: 110px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

#game-container .btn:active:not(:disabled) {
    transform: scale(0.96);
}

#game-container .btn-call {
    background: linear-gradient(180deg, #d48806 0%, #8c5300 100%);
    border-color: #ffc04d;
}

#game-container .btn-accept {
    background: linear-gradient(180deg, #278036 0%, #12471c 100%);
    border-color: #5cdb6d;
}

#game-container .btn-reject {
    background: linear-gradient(180deg, #a82020 0%, #5e0d0d 100%);
    border-color: #ff6b6b;
}

#game-container .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
}

#game-container .status-bar {
    text-align: center;
    font-size: 0.75rem;
    color: #ffd700;
    min-height: 1.1rem;
    font-weight: 600;
}

/* OVERLAY MODAL */
#game-container .modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding: 20px;
    text-align: center;
}

#game-container .modal-card {
    background: #182232;
    border: 2px solid var(--gold-accent);
    padding: 20px;
    border-radius: 12px;
    max-width: 320px;
    width: 100%;
}

#game-container .modal-card h2 {
    color: var(--gold-accent);
    margin-bottom: 12px;
}

#game-container .modal-card p {
    font-size: 0.85rem;
    margin-bottom: 15px;
    color: #ccc;
}

#game-container .start-btn {
    background: linear-gradient(180deg, #28a745 0%, #155724 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
}

#game-container .option-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.85rem;
}