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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0f4c3a 0%, #1a5f4a 100%);
    color: white;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.75rem;
    text-align: center;
    border-bottom: 2px solid #2d5a4a;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: #ffd700;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
}

.controls label {
    font-weight: bold;
}

.controls select,
.controls button {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 5px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#current-street {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    font-weight: bold;
    border: 1px solid #ffd700;
    font-size: 0.85rem;
    min-width: 70px;
    text-align: center;
}

.controls select {
    background: white;
    color: #333;
}

.controls button {
    background: #ffd700;
    color: #333;
    font-weight: bold;
}

.controls button:hover {
    background: #ffed4a;
    transform: translateY(-2px);
}

.controls button:disabled {
    background: #666;
    color: #999;
    cursor: not-allowed;
    transform: none;
}

.poker-table-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 1rem 2rem 1rem;
    overflow: hidden;
}

.poker-table {
    position: relative;
    width: min(90vw, 600px);
    height: min(70vh, 450px);
    background: #2d5a4a;
    border: 8px solid #8b4513;
    border-radius: 50%;
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(0, 0, 0, 0.5);
}

.community-cards {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem;
    border-radius: 10px;
    z-index: 10;
    align-items: center;
}

.flop-cards,
.turn-card,
.river-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.card-group-label {
    font-size: 0.6rem;
    color: #ffd700;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.card-group {
    display: flex;
    gap: 0.25rem;
}

.card-slot {
    width: 50px;
    height: 70px;
    border: 2px dashed #666;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #999;
}

.card-slot:hover {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.card-slot.occupied {
    border: 2px solid #ffd700;
    background: white;
    color: #333;
    cursor: pointer;
}

.card {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.7rem;
    color: #333;
    position: relative;
}

.card.red {
    color: #d32f2f;
}

.card.black {
    color: #333;
}

.players-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.player {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.player[data-position="0"] {
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
}

.player[data-position="1"] {
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
}

.player[data-position="2"] {
    top: 20%;
    right: -2px;
    transform: translateX(25%);
}

.player[data-position="3"] {
    bottom: 20%;
    right: -2px;
    transform: translateX(25%);
}

.player[data-position="4"] {
    bottom: 20%;
    left: -2px;
    transform: translateX(-25%);
}

.player[data-position="5"] {
    top: 20%;
    left: -2px;
    transform: translateX(-25%);
}

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

.player-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    min-width: 80px;
}

.player-name {
    font-size: 0.8rem;
    font-weight: bold;
    color: #ffd700;
}

.equity-display {
    font-size: 0.9rem;
    font-weight: bold;
    color: white;
}

.card-selector {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    z-index: 1000;
}

.card-selector.active {
    display: flex;
    flex-direction: column;
}

.card-selector-header {
    background: linear-gradient(135deg, #2d5a4a 0%, #1a4037 100%);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #ffd700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.card-selector-header span {
    font-size: 1.1rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.close-selector {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.5);
    color: #ffd700;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.close-selector:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
    transform: scale(1.1);
}

.card-grid {
    flex: 1;
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    gap: 0.5rem;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
}

.card-grid .card {
    width: 60px;
    height: 84px;
    cursor: pointer;
    transition: transform 0.2s ease;
    font-size: 0.9rem;
}

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

.card-grid .card.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.card-grid .card.disabled:hover {
    transform: none;
}

.card .rank {
    font-size: 1.2em;
    font-weight: bold;
}

.card .suit {
    font-size: 1.5em;
    margin-top: -0.2em;
}

@media (max-width: 768px) {
    header {
        padding: 0.5rem;
    }
    
    h1 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .controls {
        gap: 0.5rem;
        font-size: 0.75rem;
    }
    
    .controls select,
    .controls button {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    
    #current-street {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
        min-width: 60px;
    }
    
.poker-table-container {
        padding: 0.75rem 0.5rem 1rem 0.5rem;
        align-items: center;
    }
    
    .poker-table {
        width: 85vw;
        height: 68vh;
        border-radius: 85vw / 68vh;
    }
    
    .community-cards {
        gap: 0.5rem;
        flex-direction: row;
        padding: 0.5rem;
    }
    
    .flop-cards,
    .turn-card,
    .river-card {
        flex-direction: column;
        gap: 0.25rem;
        align-items: center;
    }
    
    .card-group {
        gap: 0.2rem;
    }
    
    .card-slot {
        width: 44px;
        height: 62px;
        font-size: 0.7rem;
    }
    
    .player-cards .card-slot {
        width: 39px;
        height: 54px;
    }
    
    .player-info {
        font-size: 0.7rem;
        min-width: 60px;
        padding: 0.2rem 0.4rem;
    }
    
    .card-grid {
        grid-template-columns: repeat(13, 1fr);
        gap: 0.25rem;
        padding: 0.5rem;
    }
    
    .card-grid .card {
        width: auto;
        height: 60px;
        font-size: 0.6rem;
        min-width: 20px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.4rem;
    }
    
    h1 {
        font-size: 1rem;
        margin-bottom: 0.4rem;
    }
    
    .controls {
        gap: 0.4rem;
        font-size: 0.7rem;
    }
    
    .controls select,
    .controls button {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    
    #current-street {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
        min-width: 50px;
    }
    
    .poker-table-container {
        padding: 0.4rem 0.25rem 0.6rem 0.25rem;
        align-items: center;
    }
    
    .poker-table {
        width: 90vw;
        height: 62vh;
        border-radius: 90vw / 62vh;
    }
    
    .community-cards {
        gap: 0.2rem;
        padding: 0.3rem;
    }
    
    .card-slot {
        width: 39px;
        height: 54px;
        font-size: 0.65rem;
    }
    
    .player-cards .card-slot {
        width: 33px;
        height: 46px;
    }
    
    .player[data-position="2"] {
        top: 25%;
        right: 8px;
    }
    
    .player[data-position="3"] {
        bottom: 25%;
        right: 8px;
    }
    
    .player[data-position="4"] {
        bottom: 25%;
        left: 8px;
    }
    
    .player[data-position="5"] {
        top: 25%;
        left: 8px;
    }
}

@media (orientation: landscape) and (max-width: 768px) {
    .community-cards {
        flex-direction: row;
        gap: 1rem;
    }
    
    .flop-cards,
    .turn-card,
    .river-card {
        flex-direction: column;
        gap: 0.25rem;
        align-items: center;
    }
    
    .card-group-label {
        font-size: 0.7rem;
    }
}