/* ============================================
   GAME SCREEN
   ============================================ */

#game-screen {
    flex-direction: column;
    background: var(--felt-pattern);
    /* Base padding + safe area insets for notch/home indicator */
    padding: 1rem;
    padding-top: max(1rem, env(safe-area-inset-top, 0px));
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
    padding-left: max(0.5rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.5rem, env(safe-area-inset-right, 0px));
    /* Prevent horizontal overflow */
    overflow-x: hidden;
    max-width: 100vw;
}

/* Game Info Bar */
.game-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.5rem;
    background: rgba(10, 15, 26, 0.9);
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid rgba(212, 175, 55, 0.3);
    /* Can shrink when space is limited */
    flex-shrink: 1;
}

.game-info-bar .label {
    color: var(--ivory-dark);
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.trump-display {
    display: flex;
    align-items: center;
    margin-right: 2em;
}

.deck-display {
    display: flex;
    align-items: center;
}

.deck-display {
    margin-right: 2rem;
}

#deck-count {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--gold);
}

#game-status {
    font-style: italic;
    color: var(--gold-light);
}

/* Table Area */
.table-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    /* Can shrink when space is limited - shrinks first */
    flex-shrink: 1;
    min-height: 0; /* Allow shrinking below content size */
}

.table-felt {
    background: radial-gradient(ellipse at center, #2d5a3d 0%, #1a472a 100%);
    border: 4px solid #3d2914;
    border-radius: 20px;
    padding: var(--spacing-md);
    min-width: min(500px, 95vw);
    min-height: clamp(150px, 25vh, 200px);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
}

.attack-defense-zone {
    display: flex;
    gap: clamp(0.8rem, 2vw, 1.5rem);
    justify-content: center;
    flex-wrap: wrap;
    min-height: clamp(80px, 15vh, 120px);
    align-items: center;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: clamp(0.5rem, 2vw, 1rem);
    padding: 0.5rem;
    /* Prevent overflow on small screens */
    flex-wrap: wrap;
    max-width: 100%;
    /* Safe area for landscape mode */
    padding-left: max(0.5rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.5rem, env(safe-area-inset-right, 0px));
    /* Shrink more aggressively than other elements */
    flex-shrink: 2;
}

.action-buttons .btn {
    min-width: clamp(80px, 20vw, 120px);
}

/* Player Hand Area */
.player-hand-area {
    padding: var(--spacing-sm);
    background: rgba(10, 15, 26, 0.8);
    border-radius: 15px 15px 0 0;
    border-top: 2px solid var(--gold);
    /* Enable horizontal scroll on overflow */
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: thin;
    scrollbar-color: var(--gold-dark) transparent;
    /* Shrink only as last resort, with low priority */
    flex-shrink: 0.3;
    /* Guaranteed minimum height - cards are always visible */
    min-height: 70px;
}

/* Custom scrollbar styling */
.player-hand-area::-webkit-scrollbar {
    height: 6px;
}

.player-hand-area::-webkit-scrollbar-track {
    background: transparent;
}

.player-hand-area::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: 3px;
}

.player-hand {
    display: flex;
    justify-content: center;
    gap: 0;
    /* Guaranteed minimum height for cards */
    min-height: 65px;
    /* Preferred height when space is available */
    height: clamp(65px, 15vh, 120px);
    padding: 0.5rem;
    /* Allow hand to expand beyond container if needed */
    width: max-content;
    min-width: 100%;
}
