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

body {
    font-family: Arial, sans-serif;
    background-color: #0d5d2e;
    color: white;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 1400px;
    width: 100%;
    padding: 20px;
}

.main-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.left-column {
    flex: 1;
    min-width: 600px;
}

.right-section {
    width: 300px;
}

.right-column {
    width: 100%;
    position: sticky;
    top: 20px;
    background: rgba(0, 0, 0, 0.3);
    padding: 25px;
    border-radius: 15px;
}

h1 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 2em;
}

.game-area {
    margin-bottom: 20px;
}

.players-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.player-container {
    text-align: center;
}

.player-container h3 {
    margin-bottom: 15px;
    font-size: 1.3em;
}

.player-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.player-header h3 {
    margin-bottom: 0;
}

.player-cards-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.hole-cards {
    display: flex;
    gap: 10px;
    min-height: 100px;
}

.best-hand-info {
    font-size: 1.1em;
    color: #ffd700;
    min-height: 25px;
}

.win-odds {
    font-size: 1.1em;
    color: #4caf50;
    font-weight: bold;
    padding: 8px 12px;
    background: rgba(76, 175, 80, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 80px;
    text-align: center;
}

.community-section {
    text-align: center;
    margin-bottom: 30px;
}

.community-section h3 {
    margin-bottom: 15px;
    font-size: 1.3em;
}

.community-cards {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
    min-height: 100px;
}

.card-placeholder {
    width: 70px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
}

.street-indicator {
    font-size: 1.2em;
    color: #ffd700;
    font-weight: bold;
}


.card {
    width: 70px;
    height: 100px;
    background: white;
    border: 2px solid #333;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-5px);
}

.card.hearts, .card.diamonds {
    color: #d00;
}

.card.spades, .card.clubs {
    color: #000;
}

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

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

.vs {
    font-size: 2em;
    font-weight: bold;
    color: #ffd700;
}

.quiz-section {
    text-align: center;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.quiz-section h3 {
    margin-bottom: 10px;
    font-size: 1.3em;
}

.quiz-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 10px;
}

.quiz-btn {
    padding: 15px 30px;
    font-size: 1.1em;
    background-color: #1976d2;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.quiz-btn:hover:not(:disabled) {
    background-color: #1565c0;
}

.quiz-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.quiz-btn:disabled {
    background-color: #666;
    cursor: not-allowed;
}

.feedback {
    font-size: 1.2em;
    min-height: 20px;
    margin-top: 5px;
}

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

.feedback.incorrect {
    color: #f44336;
}



.card.highlight {
    border: 3px solid #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.game-mode-controls {
    text-align: center;
    margin-bottom: 30px;
}

.mode-btn {
    padding: 15px 30px;
    font-size: 1.1em;
    background-color: #ff6b6b;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-bottom: 10px;
}

.mode-btn:hover {
    background-color: #ff5252;
    transform: scale(1.05);
}

.mode-btn.secondary {
    background-color: #4caf50;
}

.mode-btn.secondary:hover:not(:disabled) {
    background-color: #45a049;
}

.mode-btn:disabled {
    background-color: #666;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.timer-display {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.timer-text {
    font-size: 1.5em;
    font-weight: bold;
    color: #fff;
    margin-bottom: 10px;
}

.timer-bar-container {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.timer-bar {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    transition: width 0.1s linear;
    width: 100%;
}

.timer-bar.warning {
    background: linear-gradient(90deg, #ff9800, #ffc107);
}

.timer-bar.danger {
    background: linear-gradient(90deg, #f44336, #ff5722);
}


.feedback.quick {
    animation: quickFeedback 0.5s ease-out;
}

@keyframes quickFeedback {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

@media (max-width: 800px) {
    .main-content {
        flex-direction: column;
    }
    
    .left-column {
        min-width: auto;
        width: 100%;
    }
    
    .right-section {
        width: 100%;
        margin-top: 20px;
    }
    
    .right-column {
        position: static;
    }
}

@media (max-width: 768px) {
    .card, .card-placeholder {
        width: 60px;
        height: 85px;
        font-size: 1.2em;
    }
    
    .quiz-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .quiz-btn {
        width: 200px;
    }
    
    .players-section {
        gap: 30px;
    }
    
    .container {
        padding: 10px;
    }
    
    .right-column {
        padding: 15px;
    }
}

/* Score Display */
.score-display {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 8px;
}

.score-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-label {
    font-weight: bold;
    color: #666;
}

.score-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

.challenge-score {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
    text-align: center;
}

.last-challenge-score {
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
    text-align: center;
}

.version-info {
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 10px;
    border-radius: 5px;
}

/* iPhone-specific styles */
body.iphone {
    padding: 0;
    margin: 0;
    overflow-x: hidden;
}

body.iphone .container {
    padding: 10px;
    max-width: 100%;
}

body.iphone .main-content {
    flex-direction: column;
    gap: 15px;
}

body.iphone .left-column {
    min-width: auto;
    width: 100%;
}

body.iphone .right-section {
    display: none; /* Hide desktop controls on iPhone */
}

/* iPhone compact header */
body.iphone::before {
    content: 'Poker Trainer';
    display: block;
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

body.iphone .container {
    margin-top: 50px; /* Space for fixed header */
}

/* iPhone quiz section */
body.iphone .quiz-section {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 10px;
}

body.iphone .quiz-section h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
}

body.iphone .quiz-buttons {
    display: none; /* Hide traditional buttons on iPhone */
}

body.iphone #next-hand {
    width: 100%;
    padding: 15px;
    margin-top: 10px;
    background-color: #4caf50;
    font-size: 1.1em;
    border-radius: 12px;
    border: none;
    color: white;
    font-weight: bold;
}

/* iPhone player cards */
body.iphone .players-section {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-bottom: 20px;
    align-items: flex-start;
}

body.iphone .player-container {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 10px;
    border-radius: 15px;
    flex: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

body.iphone .player-container.touch-active,
body.iphone .player-container:active {
    transform: scale(0.95);
    background: rgba(0, 0, 0, 0.5);
}

body.iphone .player-container.selected {
    border: 3px solid #4caf50;
    background: rgba(76, 175, 80, 0.2);
}

body.iphone .player-header {
    margin-bottom: 10px;
    pointer-events: none; /* Prevent nested click handling */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

body.iphone .player-header h3 {
    font-size: 1.1em;
    pointer-events: none;
    margin-bottom: 0;
}

body.iphone .win-odds {
    font-size: 0.9em;
    padding: 4px 8px;
    pointer-events: none;
    min-width: 60px;
}

body.iphone .vs {
    display: none;
}

/* iPhone tie button */
body.iphone .tie-button-container {
    text-align: center;
    margin-bottom: 15px;
}

body.iphone .tie-button {
    background: #ff9800;
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

body.iphone .tie-button:active {
    transform: scale(0.95);
    background: #f57c00;
}

body.iphone .card {
    width: 50px;
    height: 70px;
    font-size: 1.1em;
}

body.iphone .card .rank {
    font-size: 1em;
}

body.iphone .card .suit {
    font-size: 1.2em;
}

body.iphone .card-placeholder {
    width: 50px;
    height: 70px;
}

body.iphone .hole-cards {
    gap: 5px;
    min-height: 70px;
}

body.iphone .community-cards {
    gap: 5px;
    min-height: 70px;
}

body.iphone .community-section {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 15px;
}

body.iphone .community-section h3 {
    font-size: 1.1em;
    margin-bottom: 10px;
}

body.iphone .best-hand-info {
    font-size: 0.9em;
    min-height: 20px;
}

body.iphone .street-indicator {
    font-size: 1em;
}

body.iphone .feedback {
    font-size: 1.1em;
    font-weight: bold;
}

/* iPhone score overlay */
body.iphone::after {
    content: attr(data-score);
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9em;
    z-index: 50;
}

body.iphone .version-info {
    display: none;
}

/* Disable hover effects on iPhone */
body.iphone .card:hover {
    transform: none;
}

body.iphone .quiz-btn:hover:not(:disabled) {
    background-color: #2196F3;
}

body.iphone .mode-btn:hover {
    transform: none;
}