/* Tennis Solitaire styles (moved out of index.html unchanged) */

/* Fonts are now loaded with <link> tags in index.html (faster than @import) */

:root {
    /* Wimbledon Official Colors */
    --wimbledon-purple: #4A3570;
    --wimbledon-green: #00875A;
    --championship-gold: #D4AF37;
    --grass-court: #3D6E4E;
    --baseline-white: #FFFFFF;
    --line-cream: #FAF6F2;
    --shadow-dark: rgba(44, 27, 71, 0.3);
    
    /* Card sizing - responsive with max constraint */
    --card-width: min(calc((100% - 48px) / 7), 126px); /* 7 cards with 6 gaps of 8px = 48px, max 126px */
    --card-aspect-ratio: 5/7;
}

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

html {
    margin: 0;
    padding: 0;
}

body {
    background: linear-gradient(135deg, var(--wimbledon-purple) 0%, #1a0f2e 100%);
    background-attachment: fixed;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    padding: 0 5px 5px 5px;
    margin: 0;
    position: relative;
    overflow-x: hidden;
}

/* Main content wrapper with sidebar */
.content-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 10px;
    max-width: 1510px; /* Game container (1200px) + sidebar (300px) + gap (10px) */
    width: 100%;
    margin: 0 auto;
    padding: 0 5px 0 5px; /* No top padding, just sides */
}

/* Direct child of content-wrapper */
.content-wrapper > div,
.game-wrapper {
    flex: 1 1 auto; /* Allow it to grow and fill available space */
}

/* Ad spaces */
.ad-space-left, .ad-space-right {
    flex-shrink: 0;
    display: none; /* Hidden by default on mobile */
}

/* Hide sidebar game buttons on mobile by default */
.sidebar-game-buttons {
    display: none;
}

/* Hide sidebar timer on mobile by default */
.sidebar-timer-container {
    display: none;
}

/* Hide sidebar podcasts on mobile by default */
.sidebar-podcasts-container {
    display: none;
}

/* Mobile game buttons - shown by default on mobile, hidden on desktop */
.mobile-game-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Mobile timer wrapper - shown on mobile, hidden on desktop */
.mobile-timer-wrapper {
    display: block;
}

/* Mobile podcasts section - shown on mobile, hidden on desktop */
.mobile-podcasts-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.mobile-podcasts-container .podcasts-label {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 600;
    color: var(--championship-gold);
    letter-spacing: 2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.mobile-podcasts-container .podcasts-link {
    width: 100%;
    text-decoration: none;
}

.mobile-podcasts-container .new-game-mode-btn {
    width: 100%;
}

/* Mobile secondary links container (podcasts, journey) - below daily fact */
.mobile-secondary-links {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 15px;
    padding: 0 10px;
}

/* Bottom banner ad - MOBILE ONLY */
.bottom-banner-ad {
    display: none; /* Hidden on desktop */
}

/* Top banner ad styling with padding */
.top-banner-ad {
    padding: 5px;
    margin-bottom: 10px;
}

/* Subtle grass court pattern overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 100px,
            rgba(0, 135, 90, 0.03) 100px,
            rgba(0, 135, 90, 0.03) 101px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 100px,
            rgba(0, 135, 90, 0.03) 100px,
            rgba(0, 135, 90, 0.03) 101px
        );
    pointer-events: none;
    z-index: 1;
}

#game-container {
    max-width: 1200px; /* Constrain width to prevent empty green space */
    width: 100%; /* Fill available space up to max */
    margin: 0 auto;
    background: linear-gradient(180deg, var(--wimbledon-green) 0%, #004d35 100%);
    padding: 10px;
    border-radius: 20px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
    border: 1px solid var(--championship-gold);
    min-height: 0;
    max-height: min(95vh, 1200px); /* Constrain height to viewport or 1200px max */
    overflow: visible; /* Allow cards to be visible */
}

/* On This Day in Tennis section */
.on-this-day-section {
    background: var(--wimbledon-green);
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 5px;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--championship-gold);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    color: var(--baseline-white);
    font-size: 13px;
    line-height: 1.5;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    max-width: 1200px; /* Match game container width */
    width: 100%;
    min-height: 120px; /* Prevent vertical layout shift when rotating facts */
}

.on-this-day-section strong {
    color: var(--championship-gold);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.on-this-day-section #tennisFact {
    color: var(--line-cream);
    font-weight: 600;
}

/* Rotating fact transition */
.on-this-day-section {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.fact-content {
    transition: opacity 0.4s ease;
}

.fact-content.fade-out {
    opacity: 0;
}

.fact-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.fact-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: background 0.3s ease;
}

.fact-dot.active {
    background: var(--championship-gold);
}

/* Hamburger menu fact rotation */
.hamburger-menu-fact {
    cursor: pointer;
}

.hamburger-fact-content {
    transition: opacity 0.4s ease;
}

.hamburger-fact-content.fade-out {
    opacity: 0;
}

.hamburger-fact-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.hamburger-fact-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: background 0.3s ease;
}

.hamburger-fact-dot.active {
    background: var(--championship-gold);
}

/* Tennis headlines in the facts box */
.fact-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.4);
    text-underline-offset: 2px;
}

.fact-link:hover {
    text-decoration-color: var(--championship-gold);
}

.fact-source {
    opacity: 0.7;
    font-size: 0.9em;
}

/* Header with score only */
.game-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1vh;
    width: 100%;
}

/* Championship Title */
#score {
    background: var(--wimbledon-purple);
    color: var(--baseline-white);
    padding: 15px 60px;
    border-radius: 12px;
    font-family: 'League Spartan', sans-serif;
    font-size: clamp(14px, 1.2vw, 18px);
    letter-spacing: 0.5px;
    text-align: center;
    box-shadow: 
        0 4px 12px var(--shadow-dark),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid var(--championship-gold);
    position: relative;
    width: 100%;
}

#score::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background-image: url('../images/Trophy.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

#score::after {
    content: '';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background-image: url('../images/Trophy.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Score value spans */
.score-value {
    transition: color 0.3s ease;
}

.score-value.active {
    color: var(--championship-gold);
}

/* Score highlight animation */
@keyframes scoreHighlight {
    0% {
        text-shadow: 0 0 0 transparent;
        transform: scale(1);
    }
    50% {
        text-shadow: 0 0 12px var(--championship-gold), 0 0 20px rgba(212, 175, 55, 0.5);
        transform: scale(1.15);
    }
    100% {
        text-shadow: 0 0 0 transparent;
        transform: scale(1);
    }
}

.score-value.highlight {
    display: inline-block;
    animation: scoreHighlight 0.5s ease-out;
}

/* Game won - bigger effect */
@keyframes gameWonHighlight {
    0% {
        text-shadow: 0 0 0 transparent;
        transform: scale(1);
    }
    50% {
        text-shadow: 0 0 16px var(--championship-gold), 0 0 30px rgba(212, 175, 55, 0.6);
        transform: scale(1.25);
    }
    100% {
        text-shadow: 0 0 0 transparent;
        transform: scale(1);
    }
}

.score-value.game-highlight {
    display: inline-block;
    animation: gameWonHighlight 0.6s ease-out;
}

/* Set won - biggest effect */
@keyframes setWonHighlight {
    0% {
        text-shadow: 0 0 0 transparent;
        transform: scale(1);
    }
    30% {
        text-shadow: 0 0 20px var(--championship-gold), 0 0 40px rgba(212, 175, 55, 0.7);
        transform: scale(1.35);
    }
    60% {
        text-shadow: 0 0 10px var(--championship-gold), 0 0 25px rgba(212, 175, 55, 0.5);
        transform: scale(1.2);
    }
    100% {
        text-shadow: 0 0 0 transparent;
        transform: scale(1);
    }
}

.score-value.set-highlight {
    display: inline-block;
    animation: setWonHighlight 0.8s ease-out;
}

/* Point deducted - warning effect */
@keyframes pointLostHighlight {
    0% {
        text-shadow: 0 0 0 transparent;
        color: var(--championship-gold);
    }
    50% {
        text-shadow: 0 0 12px #ff6b6b, 0 0 20px rgba(255, 107, 107, 0.5);
        color: #ff6b6b;
    }
    100% {
        text-shadow: 0 0 0 transparent;
    }
}

.score-value.warning-highlight {
    display: inline-block;
    animation: pointLostHighlight 0.5s ease-out;
}

/* Bottom controls area */
.bottom-controls {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
    margin-top: 15px;
    width: 100%;
}

/* New Game Section - consolidated with mode selection */
/* New Game/Mode Section - consolidated */
.new-game-mode-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    height: auto;
    min-height: 100px;
    flex-shrink: 0;
    justify-content: center;
}

/* New Game/Mode Buttons - twice as wide as timer buttons */
.new-game-mode-btn {
    background: linear-gradient(180deg, var(--wimbledon-purple), #3a2860);
    color: white;
    border: 1px solid rgba(212, 175, 55, 0.4);
    padding: 4px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    width: 200px;
    white-space: nowrap;
    min-height: 25px; /* Reduced height by 30% */
    box-sizing: border-box;
}

.new-game-mode-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #5a4590, var(--wimbledon-purple));
    border-color: var(--championship-gold);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

/* Auth/Sign-in Button Styles */
.auth-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 10px;
    width: 100%;
}

.auth-buttons-row {
    display: flex;
    flex-direction: row;
    gap: 4px;
    width: 100%;
    max-width: 300px;
}

/* Score Counter Display */
.score-counter {
    background: white;
    color: var(--wimbledon-purple);
    border: 1px solid rgba(212, 175, 55, 0.4);
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    flex: 1;
    white-space: nowrap;
    min-height: 25px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.score-counter:hover {
    background: #f5f5f5;
    border-color: var(--championship-gold);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

/* Active state when score is accumulating */
.score-counter.has-score {
    background: linear-gradient(180deg, var(--championship-gold), #b8962e);
    color: #1a0f2e;
    border-color: var(--championship-gold);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
    animation: scoreGlow 2s ease-in-out infinite;
}

@keyframes scoreGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(212, 175, 55, 0.5); }
    50% { box-shadow: 0 0 12px rgba(212, 175, 55, 0.8); }
}

.score-counter.has-score:hover {
    background: linear-gradient(180deg, #e5c54a, var(--championship-gold));
    transform: translateY(-1px);
}

.score-counter .score-value {
    font-size: 11px;
    letter-spacing: 0.5px;
}

.sign-in-btn {
    background: linear-gradient(180deg, var(--championship-gold), #b8962e);
    color: #1a0f2e;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    flex: 1;
    white-space: nowrap;
    min-height: 25px;
    box-sizing: border-box;
}

.sign-in-btn:hover {
    background: linear-gradient(180deg, #e5c54a, var(--championship-gold));
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

.save-score-btn {
    background: linear-gradient(180deg, var(--wimbledon-green), #006644);
    color: white;
    border: 1px solid rgba(212, 175, 55, 0.4);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    flex: 1;
    white-space: nowrap;
    min-height: 25px;
    box-sizing: border-box;
}

.save-score-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #00a070, var(--wimbledon-green));
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

.save-score-btn:disabled {
    background: linear-gradient(180deg, #3a3a3a, #2a2a2a);
    color: rgba(255, 255, 255, 0.3);
    border-color: rgba(212, 175, 55, 0.2);
    cursor: not-allowed;
    opacity: 0.5;
}

.user-profile-btn {
    background: linear-gradient(180deg, var(--wimbledon-green), #006644);
    color: white;
    border: 1px solid rgba(212, 175, 55, 0.4);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 9px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    flex: 1;
    min-height: 25px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.user-profile-btn:hover {
    background: linear-gradient(180deg, #00a070, var(--wimbledon-green));
    transform: translateY(-1px);
}

.user-profile-btn .user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sign-out-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: none;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 9px;
    text-decoration: underline;
}

.sign-out-btn:hover {
    color: white;
}

/* Auth Modal Styles */
.auth-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.auth-modal-overlay.active {
    display: flex;
}

.auth-modal {
    background: linear-gradient(135deg, var(--wimbledon-purple) 0%, #1a0f2e 100%);
    border: 2px solid var(--championship-gold);
    border-radius: 12px;
    padding: 24px;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.auth-modal-title {
    color: var(--championship-gold);
    font-family: 'League Spartan', sans-serif;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-modal-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    text-align: center;
    margin-bottom: 20px;
}

.auth-google-btn {
    background: white;
    color: #333;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    margin-bottom: 16px;
}

.auth-google-btn:hover {
    background: #f5f5f5;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.auth-google-btn svg {
    width: 18px;
    height: 18px;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.auth-divider span {
    padding: 0 12px;
}

.auth-email-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-email-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    padding: 10px 12px;
    color: white;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
}

.auth-email-input:focus {
    outline: none;
    border-color: var(--championship-gold);
}

.auth-email-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.auth-email-btn {
    background: linear-gradient(180deg, var(--wimbledon-green), #006644);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.auth-email-btn:hover {
    background: linear-gradient(180deg, #00a070, var(--wimbledon-green));
    transform: translateY(-1px);
}

.auth-email-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-modal-close {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: none;
    padding: 8px;
    cursor: pointer;
    font-size: 11px;
    text-align: center;
    width: 100%;
    margin-top: 12px;
}

.auth-modal-close:hover {
    color: white;
}

.auth-status-message {
    color: var(--championship-gold);
    font-size: 11px;
    text-align: center;
    margin-top: 8px;
}

/* Leaderboard Modal Styles */
.leaderboard-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.leaderboard-modal-overlay.active {
    display: flex;
}

.leaderboard-modal {
    background: linear-gradient(135deg, var(--wimbledon-purple) 0%, #1a0f2e 100%);
    border: 2px solid var(--championship-gold);
    border-radius: 12px;
    padding: 20px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.leaderboard-modal-title {
    color: var(--championship-gold);
    font-family: 'League Spartan', sans-serif;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.leaderboard-modal-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    text-align: center;
    margin-bottom: 16px;
}

.leaderboard-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 4px;
}

.leaderboard-tab {
    flex: 1;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.leaderboard-tab:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.leaderboard-tab.active {
    background: linear-gradient(180deg, var(--championship-gold), #b8962e);
    color: #1a0f2e;
}

.leaderboard-list {
    flex: 1;
    overflow-y: auto;
    max-height: 300px;
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.leaderboard-entry.current-user {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--championship-gold);
}

.leaderboard-rank {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--championship-gold);
    width: 30px;
    text-align: center;
}

.leaderboard-entry:nth-child(1) .leaderboard-rank { color: #ffd700; }
.leaderboard-entry:nth-child(2) .leaderboard-rank { color: #c0c0c0; }
.leaderboard-entry:nth-child(3) .leaderboard-rank { color: #cd7f32; }

.leaderboard-name {
    flex: 1;
    color: white;
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 8px;
}

.leaderboard-score {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--championship-gold);
    text-align: right;
}

.leaderboard-empty {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    text-align: center;
    padding: 20px;
}

.leaderboard-modal-close {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: none;
    padding: 8px;
    cursor: pointer;
    font-size: 11px;
    text-align: center;
    width: 100%;
    margin-top: 12px;
}

.leaderboard-modal-close:hover {
    color: white;
}

.new-game-mode-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.new-game-mode-btn:disabled {
    background: linear-gradient(180deg, #3a3a3a, #2a2a2a);
    color: rgba(255, 255, 255, 0.3);
    border-color: rgba(212, 175, 55, 0.2);
    cursor: not-allowed;
    opacity: 0.5;
}

/* Active mode button styling */
.new-game-mode-btn.active-mode {
    background: linear-gradient(180deg, var(--wimbledon-green), #006644);
    border-color: var(--championship-gold);
    box-shadow: 0 0 12px rgba(0, 135, 90, 0.5);
}

/* Clear the Deck Popup */
.clear-deck-popup {
    display: none;
    position: fixed;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    animation: popupSlideUp 0.3s ease-out;
}

.clear-deck-popup.active {
    display: block;
}

@keyframes popupSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.clear-deck-popup-content {
    background: linear-gradient(135deg, var(--wimbledon-purple) 0%, #1a0f2e 100%);
    border: 2px solid var(--championship-gold);
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.clear-deck-popup-title {
    color: var(--championship-gold);
    font-family: 'League Spartan', sans-serif;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.clear-deck-popup-message {
    color: white;
    font-size: 13px;
    margin-bottom: 12px;
}

.clear-deck-popup-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.clear-deck-popup-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.clear-deck-popup-btn.clear-deck-yes {
    background: linear-gradient(180deg, var(--wimbledon-green), #006040);
    color: white;
}

.clear-deck-popup-btn.clear-deck-yes:hover {
    background: linear-gradient(180deg, #00a070, var(--wimbledon-green));
    transform: translateY(-1px);
}

.clear-deck-popup-btn.clear-deck-no {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.clear-deck-popup-btn.clear-deck-no:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* End Set button - subtle button for stuck tennis games */
.end-set-btn {
    display: none;
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(74, 53, 112, 0.7);
    color: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 6px;
    padding: 5px 14px;
    font-family: 'League Spartan', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 50;
    white-space: nowrap;
}

.end-set-btn:hover {
    background: rgba(74, 53, 112, 0.95);
    color: white;
    border-color: var(--championship-gold);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.end-set-btn.visible {
    display: inline-block;
    animation: fadeInSubtle 0.5s ease-out;
}

@keyframes fadeInSubtle {
    from { opacity: 0; transform: translateX(-50%) translateY(4px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.new-game-mode-btn.active-mode:hover {
    background: linear-gradient(180deg, #00a070, var(--wimbledon-green));
}

/* Deal Mode Toggle Switch */
.deal-mode-toggle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    width: 100%;
}

.deal-mode-toggle-container.hidden {
    display: none;
}

/* Match Format Toggle (Tennis Mode only) - reuses the Deal Mode button styles */
.match-format-toggle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    width: 100%;
}

.match-format-toggle-container.hidden {
    display: none;
}

.deal-mode-label {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--championship-gold);
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.deal-mode-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.deal-mode-option {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: none;
    padding: 5px 16px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    min-height: 25px;
    box-sizing: border-box;
}

.deal-mode-option:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
}

.deal-mode-option.active {
    background: linear-gradient(180deg, var(--wimbledon-green), #006644);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* On This Day button - special styling */
.on-this-day-btn {
    background: linear-gradient(180deg, var(--wimbledon-purple), #3a2860);
    color: white;
    border: 1px solid rgba(212, 175, 55, 0.5);
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    width: 200px;
    white-space: nowrap;
}

.on-this-day-btn:hover {
    background: linear-gradient(180deg, #5a4590, var(--wimbledon-purple));
    border-color: var(--championship-gold);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

.on-this-day-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Timer container - ensure consistent height */
.timer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    flex-shrink: 0;
}

.timer-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.timer-display {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 600;
    color: var(--championship-gold);
    letter-spacing: 2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.timer-controls {
    display: flex;
    gap: 6px;
    width: 100%;
}

.timer-btn {
    background: linear-gradient(180deg, var(--wimbledon-purple), #3a2860);
    color: white;
    border: 1px solid rgba(212, 175, 55, 0.4);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    flex: 1;
    white-space: nowrap;
    min-height: 25px; /* Reduced by 30% from 36px */
    box-sizing: border-box;
}

.timer-btn.active {
    background: linear-gradient(180deg, var(--wimbledon-green), #006644);
    border-color: var(--championship-gold);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

/* Serve Clock button spans full width in tennis mode */
.serve-clock-btn {
    grid-column: 1 / -1;
    width: 100%;
}

.serve-clock-btn:not(.active) {
    background: linear-gradient(180deg, #3a3a3a, #2a2a2a);
    opacity: 0.6;
}

.timer-btn:hover {
    background: linear-gradient(180deg, #5a4590, var(--wimbledon-purple));
    border-color: var(--championship-gold);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

.timer-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Card Styles - Now responsive */
.card {
    width: 100%;
    height: 100%;
    background: var(--baseline-white);
    border-radius: 6px;
    display: block;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.2),
        0 1px 2px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-family: 'Libre Baskerville', serif;
}

.card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 
        0 12px 24px rgba(0, 0, 0, 0.3),
        0 6px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    z-index: 10;
}

.card.back {
    background-image: url('../Images/CardBack700x980.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 
        0 2px 8px rgba(44, 27, 71, 0.4),
        inset 0 1px 0 rgba(212, 175, 55, 0.3);
}

.card.empty {
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(212, 175, 55, 0.3);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.card.selected {
    border: 2px solid var(--championship-gold) !important;
    box-shadow: 
        0 0 20px rgba(212, 175, 55, 0.6),
        0 8px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

.card.auto-moving {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

/* Card content styling */
.card div {
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Specific suit colors */
.card .hearts-diamonds {
    color: #00875A !important;
}

.card .spades-clubs {
    color: #4A3570 !important;
}

/* Main game area - use flexbox column layout */
.game-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Top row and tableau wrapper - ensures alignment */
.card-play-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    overflow: visible; /* Allow cards to extend beyond without growing container */
}

/* Top row - Stock, Waste, and Foundations */
.top-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-bottom: 5px;
    gap: 8px;
    width: 100%;
}

.left-section {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

.right-section {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
    margin-left: auto;
}

/* Empty spacers to align with tableau */
.spacer {
    width: var(--card-width);
    flex-shrink: 0;
}

/* Foundation and Tableau Piles - all same size */
.foundation-pile, .tableau-pile {
    width: var(--card-width);
    aspect-ratio: var(--card-aspect-ratio);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed rgba(212, 175, 55, 0.2);
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

/* Foundation pile background images */
.foundation-pile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.8;
    pointer-events: none;
    z-index: 1;
}

/* Individual foundation backgrounds - ordered left to right */
.foundation-pile[data-foundation="0"]::before {
    background-image: url('../Images/Foundation_Background_White_-_Serving_Woman.png');
}

.foundation-pile[data-foundation="1"]::before {
    background-image: url('../Images/Foundation_Background_White_-_Ballkid.png');
}

.foundation-pile[data-foundation="2"]::before {
    background-image: url('../Images/Foundation_Background_White_-_Umpire.png');
}

.foundation-pile[data-foundation="3"]::before {
    background-image: url('../Images/Foundation_Background_White_Stretch.png');
}

/* Hide background image when foundation has cards */
.foundation-pile.has-cards::before {
    display: none;
}

/* Stock and Waste containers - match tableau size */
.stock-container, .waste-container {
    width: var(--card-width);
    aspect-ratio: var(--card-aspect-ratio);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed rgba(212, 175, 55, 0.2);
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

/* Waste pile background image */
.waste-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../Images/Waste_Background_Racket.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.8;
    pointer-events: none;
    z-index: 1;
}

/* Hide background image when waste has cards */
.waste-container.has-cards::before {
    display: none;
}

.foundation-pile:hover, .tableau-pile:hover {
    background: rgba(212, 175, 55, 0.05);
    border-color: rgba(212, 175, 55, 0.4);
}

.tableau-pile {
    position: relative;
    min-height: 180px; /* Fixed height to prevent container growth */
    overflow: visible; /* Allow cards to extend beyond pile boundaries */
}

.foundation-pile.valid-target, .tableau-pile.valid-target {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--championship-gold);
    box-shadow: 
        inset 0 0 20px rgba(212, 175, 55, 0.2),
        0 0 10px rgba(212, 175, 55, 0.3);
}

/* Tableau area */
.tableau {
    display: flex;
    justify-content: center;
    gap: 8px;
    min-height: 320px;
    width: 100%;
    overflow: visible; /* Allow cards to extend beyond container */
}

/* Smooth transition for card positioning within tableau piles */
.tableau-pile .card {
    transition: top 0.15s ease-out;
}

/* Tableau card hover effect - only for face-up cards, not face-down */
.tableau-pile .card:not(.back) {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tableau-pile .card:not(.back):hover {
    transform: translateY(-12px);
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(212, 175, 55, 0.4);
    z-index: 1000 !important;
}

/* Ensure selected cards don't conflict with hover */
.tableau-pile .card.selected:not(.back):hover {
    transform: translateY(-14px);
}

/* Analog Timer */
@keyframes popIn {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Only animate cards when first dealt */
.card.dealing {
    animation: dealCard 0.3s ease-out;
}

@keyframes dealCard {
    from {
        transform: translateY(-20px) rotate(-5deg);
        opacity: 0;
    }
    to {
        transform: translateY(0) rotate(0);
        opacity: 1;
    }
}

/* Winner animation */
@keyframes winner {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.winner {
    animation: winner 1s ease-in-out infinite;
}

/* Help button styling - standalone version */
.help-button-container {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 10;
}

.help-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.9), rgba(184, 148, 31, 0.9));
    border: 2px solid rgba(212, 175, 55, 1);
    color: #2a1a40;
    font-size: 20px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.help-button:hover {
    background: linear-gradient(135deg, rgba(255, 213, 0, 0.9), rgba(212, 175, 55, 0.9));
    transform: scale(1.1);
    box-shadow: 
        0 6px 16px rgba(212, 175, 55, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 0 12px rgba(212, 175, 55, 0.6);
}

.help-button:active {
    transform: scale(1.05);
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Help modal/popup styling */

/* Toast Notification System */
.toast-container {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    pointer-events: none;
    width: 100%;
    max-width: 450px;
}

.toast {
    background: linear-gradient(135deg, rgba(74, 53, 112, 0.95) 0%, rgba(42, 26, 64, 0.95) 100%);
    color: #FFFFFF;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 1px rgba(212, 175, 55, 0.5);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    text-align: center;
    pointer-events: auto;
    cursor: pointer;
    transform: translateY(-150%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.hiding {
    transform: translateY(-150%);
    opacity: 0;
}

/* Toast with confirm button should not dismiss on click */
.toast.confirm {
    cursor: default;
}

/* Toast variants */
.toast.success {
    background: linear-gradient(135deg, rgba(0, 135, 90, 0.95) 0%, rgba(0, 90, 60, 0.95) 100%);
    box-shadow: 
        0 4px 12px rgba(0, 135, 90, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 0 1px rgba(212, 175, 55, 0.5);
}

.toast.warning {
    background: linear-gradient(135deg, rgba(74, 53, 112, 0.95) 0%, rgba(42, 26, 64, 0.95) 100%);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 1px rgba(212, 175, 55, 0.4);
}

.toast.celebration {
    background: linear-gradient(135deg, rgba(0, 135, 90, 0.95) 0%, rgba(0, 90, 60, 0.95) 100%);
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 600;
    padding: 16px 24px;
    box-shadow: 
        0 6px 16px rgba(0, 135, 90, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 0 1px rgba(212, 175, 55, 0.8);
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.toast.celebration .toast-title {
    font-size: 16px;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.toast-message {
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    opacity: 0.9;
    line-height: 1.3;
    font-weight: 400;
}

.toast.celebration .toast-message {
    font-size: 14px;
}

/* Toast button styling */
.toast-button {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 20px;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.9), rgba(184, 148, 31, 0.9));
    color: #2a1a40;
    border: 1px solid rgba(212, 175, 55, 0.8);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toast-button:hover {
    background: linear-gradient(180deg, rgba(255, 213, 0, 0.9), rgba(212, 175, 55, 0.9));
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.toast-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Confetti animation for celebration toasts - more subtle */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100%) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(500%) rotate(360deg);
        opacity: 0;
    }
}

.confetti {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(212, 175, 55, 0.6);
    top: 0;
    animation: confetti-fall 3s linear infinite;
}

.confetti:nth-child(2n) {
    background: rgba(255, 255, 255, 0.4);
    animation-delay: 0.3s;
}

.confetti:nth-child(3n) {
    background: rgba(212, 175, 55, 0.8);
    animation-delay: 0.6s;
}

/* Footer styling */
.game-footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    margin-top: 10px;
}

/* How and Why to Play Section */
.how-to-play-section {
    background: white;
    border: 1px solid var(--championship-gold);
    border-radius: 12px;
    padding: 30px 40px;
    margin-top: 50vh; /* Creates page break effect - section starts below viewport */
    margin-bottom: 40px;
    max-width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.how-to-play-title {
    font-family: 'Libre Baskerville', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--wimbledon-purple);
    margin-bottom: 30px;
    text-align: center;
    letter-spacing: 0.5px;
}

.how-to-play-content {
    color: var(--wimbledon-purple);
}

.how-to-play-content .help-section {
    margin-bottom: 30px;
}

.how-to-play-content .help-section:last-child {
    margin-bottom: 0;
}

.how-to-play-content .help-section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--wimbledon-purple);
    margin-bottom: 12px;
    font-family: 'Libre Baskerville', serif;
}

.how-to-play-content .help-content {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

.how-to-play-content .help-content p {
    margin-bottom: 10px;
    color: var(--wimbledon-purple);
}

.how-to-play-content .help-content ul {
    list-style-type: none;
    padding-left: 0;
}

.how-to-play-content .help-content li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
    color: var(--wimbledon-purple);
}

.how-to-play-content .help-content li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--championship-gold);
    font-weight: bold;
}

.how-to-play-content .help-content strong {
    color: var(--wimbledon-purple);
    font-weight: 600;
}

.how-to-play-content .help-content a {
    color: var(--wimbledon-purple);
    text-decoration: underline;
    transition: color 0.2s;
}

.how-to-play-content .help-content a:hover {
    color: var(--championship-gold);
}

/* Tutorial Button Styling - Matching how-to-play page design */
.tutorial-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--wimbledon-green) 0%, #004d35 100%);
    padding: 40px 60px;
    border-radius: 20px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    border: 4px solid var(--championship-gold);
    text-decoration: none !important;
    transition: all 0.3s ease;
    margin: 20px 0;
}

.tutorial-button:hover {
    box-shadow: 
        0 12px 48px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
    text-decoration: none !important;
}

.tutorial-button:active {
    transform: translateY(0);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    text-decoration: none !important;
}

.tutorial-text-content {
    font-family: 'League Spartan', 'Arial Black', sans-serif;
    font-size: clamp(24px, 4vw, 42px);
    font-weight: 700;
    color: var(--baseline-white);
    margin: 0;
    letter-spacing: 1px;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(255, 255, 255, 0.3);
    text-decoration: none !important;
}

.tutorial-next-btn {
    background: var(--championship-gold);
    color: var(--wimbledon-purple);
    border: none;
    padding: 15px 40px;
    border-radius: 10px;
    font-family: 'League Spartan', 'Arial Black', sans-serif;
    font-size: clamp(16px, 2vw, 22px);
    font-weight: 700;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tutorial-button:hover .tutorial-next-btn {
    background: #e8c547;
    transform: translateY(-2px);
    box-shadow: 
        0 6px 16px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.tutorial-button:active .tutorial-next-btn {
    transform: translateY(0);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.footer-links {
    margin-bottom: 8px;
}

.footer-links a {
    color: rgba(212, 175, 55, 0.8);
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

.footer-links a:hover {
    color: rgba(212, 175, 55, 1);
    text-decoration: underline;
}

.footer-separator {
    margin: 0 10px;
    color: rgba(255, 255, 255, 0.4);
}

.footer-copyright {
    font-size: 11px;
    opacity: 0.5;
}

/* On This Day Modal Styling */
.on-this-day-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.on-this-day-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.on-this-day-content {
    background: linear-gradient(135deg, rgba(74, 53, 112, 0.98) 0%, rgba(42, 26, 64, 0.98) 100%);
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 2px rgba(212, 175, 55, 0.6);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.on-this-day-modal.active .on-this-day-content {
    transform: scale(1);
}

.on-this-day-title {
    font-family: 'Libre Baskerville', serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--championship-gold);
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
    padding-bottom: 15px;
}

.on-this-day-body {
    color: #FFFFFF;
    font-size: 16px;
    line-height: 1.8;
    font-family: 'Inter', sans-serif;
}

.fact-item {
    margin-bottom: 15px;
}

.fact-date {
    font-weight: 600;
    color: var(--championship-gold);
    margin-bottom: 8px;
    font-size: 14px;
}

.fact-text {
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.7;
}

/* ==========================================================================
   CONSOLIDATED RESPONSIVE BREAKPOINTS
   ==========================================================================
   
   Breakpoint Strategy:
   - Desktop (min-width: 1201px): Full layout with sidebar
   - Tablet (max-width: 1200px): No sidebar, stacked layout
   - Mobile (max-width: 900px): Optimized for phones
   - Mobile Landscape (max-width: 900px + landscape): Compact horizontal layout
   - Small phones (max-width: 480px): Extra compact
   
   ========================================================================== */

/* ----- DESKTOP: min-width 1201px ----- */
@media (min-width: 1201px) {
    /* Hide mobile-specific elements */
    .mobile-game-buttons {
        display: none;
    }
    
    .mobile-timer-wrapper {
        display: none;
    }
    
    .mobile-podcasts-container {
        display: none;
    }
    
    .mobile-secondary-links {
        display: none;
    }
    
    /* Show sidebar */
    .ad-space-right {
        display: block;
        width: 300px;
        position: sticky;
        top: 20px;
    }
    
    /* Lock game wrapper width so child content (e.g. long fact text) can't expand it */
    .game-wrapper {
        width: calc(100% - 310px); /* 300px sidebar + 10px gap */
        flex: 0 0 auto;
    }
    
    /* Auth container in sidebar - left align */
    .ad-space-right .auth-container {
        justify-content: flex-start;
    }
    
    .ad-space-right .auth-buttons-row {
        width: 300px;
        max-width: 300px;
    }
    
    .ad-space-right .ad-container {
        width: 300px;
        padding: 5px;
        margin-top: 10px;
    }
    
    /* Sidebar game buttons */
    .sidebar-game-buttons {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 0;
        width: 300px;
    }
    
    .sidebar-game-buttons .new-game-mode-btn {
        width: 100%;
    }
    
    /* Sidebar timer */
    .sidebar-timer-container {
        display: flex;
        margin-top: 10px;
        width: 300px;
    }
    
    .sidebar-timer-container .timer-container {
        width: 100%;
        flex-direction: column;
        height: auto;
        padding: 12px;
    }
    
    .sidebar-timer-container .timer-info {
        width: 100%;
    }
    
    .sidebar-timer-container .timer-controls {
        width: 100%;
    }
    
    /* Sidebar podcasts */
    .sidebar-podcasts-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        margin-top: 10px;
        width: 300px;
    }
    
    .podcasts-label {
        font-family: 'Courier New', monospace;
        font-size: 18px;
        font-weight: 600;
        color: var(--championship-gold);
        letter-spacing: 2px;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
        text-align: center;
    }
    
    .podcasts-link {
        width: 100%;
        text-decoration: none;
    }
    
    .podcasts-link .new-game-mode-btn {
        width: 100%;
    }
}

/* === DEFAULT: Hide hamburger UI elements (shown via media queries below) === */
.hamburger-btn {
    display: none;
}

.compact-bottom-controls {
    display: none;
}

.hamburger-menu-overlay {
    display: none;
}

.hamburger-menu {
    display: none;
}

/* ----- TABLET: max-width 1200px ----- */
@media (max-width: 1200px) {
    /* Show bottom banner ad */
    .bottom-banner-ad {
        display: block;
        text-align: center;
        margin: 10px auto;
        max-width: 970px;
        padding: 0 10px;
    }
    
    /* Help button - fixed to viewport for tablets too */
    .help-button-container {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1000;
    }
    
    /* === HAMBURGER MENU UI FOR ALL NON-DESKTOP === */
    
    /* Game container flex layout */
    #game-container {
        display: flex;
        flex-direction: column;
        min-height: calc(100vh - 150px);
        min-height: calc(100dvh - 150px);
    }
    
    .card-play-area {
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    
    .tableau {
        flex: 1;
    }
    
    .bottom-controls {
        margin-top: auto;
        margin-bottom: 0;
        padding: 0;
    }
    
    /* Title/Scoreboard with hamburger */
    #score {
        padding: 15px 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }
    
    #scoreText {
        text-align: center;
    }
    
    /* Hide trophy icons at all non-desktop breakpoints */
    #score::before,
    #score::after {
        display: none;
    }
    
    /* Show hamburger button */
    .hamburger-btn {
        display: flex !important;
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        flex-direction: column;
        justify-content: space-between;
        width: 26px;
        height: 20px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 10;
    }
    
    .hamburger-btn span {
        display: block;
        height: 3px;
        width: 100%;
        background: var(--championship-gold);
        border-radius: 2px;
        transition: all 0.3s ease;
    }
    
    /* Hide standard mobile UI elements - replaced by hamburger */
    .mobile-game-buttons {
        display: none !important;
    }
    
    .mobile-timer-wrapper {
        display: none !important;
    }
    
    .on-this-day-section {
        display: none !important;
    }
    
    .mobile-secondary-links {
        display: none !important;
    }
    
    /* Show compact bottom controls */
    .compact-bottom-controls {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 0 10px;
        margin-top: 12px;
        background: transparent;
        gap: 12px;
    }
    
    .compact-score {
        background: var(--championship-gold);
        color: var(--wimbledon-purple);
        padding: 10px 16px;
        border-radius: 6px;
        font-family: 'League Spartan', sans-serif;
        font-size: 16px;
        font-weight: 700;
        min-width: 60px;
        text-align: center;
        cursor: pointer;
    }
    
    .compact-new-game-btn {
        background: var(--wimbledon-purple);
        color: var(--baseline-white);
        border: 1px solid var(--championship-gold);
        padding: 10px 24px;
        border-radius: 6px;
        font-family: 'League Spartan', sans-serif;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        white-space: nowrap;
    }
    
    .compact-new-game-btn:active {
        background: var(--championship-gold);
        color: var(--wimbledon-purple);
    }
    
    .compact-timer {
        background: rgba(0, 0, 0, 0.4);
        color: var(--championship-gold);
        padding: 10px 14px;
        border-radius: 6px;
        font-family: 'Courier New', monospace;
        font-size: 16px;
        font-weight: bold;
        min-width: 65px;
        text-align: center;
    }
    
    /* === HAMBURGER MENU === */
    .hamburger-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: 9998;
    }
    
    .hamburger-menu-overlay.active {
        display: block;
    }
    
    .hamburger-menu {
        display: block;
        position: fixed;
        top: 0;
        left: -320px;
        width: 300px;
        height: 100%;
        background: linear-gradient(180deg, var(--wimbledon-purple) 0%, #2a1f40 100%);
        z-index: 9999;
        transition: left 0.3s ease;
        overflow-y: auto;
        padding: 24px 20px;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }
    
    .hamburger-menu.active {
        left: 0;
    }
    
    .hamburger-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 24px;
        padding-bottom: 16px;
        border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    }
    
    .hamburger-menu-title {
        color: var(--championship-gold);
        font-family: 'League Spartan', sans-serif;
        font-size: 22px;
        font-weight: 700;
    }
    
    .hamburger-menu-close {
        background: none;
        border: none;
        color: var(--championship-gold);
        font-size: 32px;
        cursor: pointer;
        padding: 0;
        line-height: 1;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .hamburger-menu-section {
        margin-bottom: 20px;
    }
    
    .hamburger-menu-section-title {
        color: var(--championship-gold);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        margin-bottom: 12px;
        font-weight: 600;
    }
    
    .hamburger-menu-btn {
        display: block;
        width: 100%;
        padding: 14px 16px;
        margin-bottom: 10px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(212, 175, 55, 0.3);
        border-radius: 8px;
        color: var(--baseline-white);
        font-size: 16px;
        font-family: 'Inter', sans-serif;
        text-align: left;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .hamburger-menu-btn:active {
        background: rgba(255, 255, 255, 0.2);
        border-color: var(--championship-gold);
    }
    
    .hamburger-menu-btn.active-mode {
        background: var(--wimbledon-green);
        border-color: var(--championship-gold);
    }
    
    .hamburger-menu-btn.gold-btn {
        background: var(--championship-gold);
        color: var(--wimbledon-purple);
        font-weight: 600;
    }
    
    .hamburger-menu-btn.gold-btn:active {
        background: #c9a432;
    }
    
    .hamburger-menu-divider {
        height: 1px;
        background: rgba(212, 175, 55, 0.3);
        margin: 18px 0;
    }
    
    .hamburger-settings-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        margin-bottom: 10px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(212, 175, 55, 0.3);
        border-radius: 8px;
        color: var(--baseline-white);
        font-size: 16px;
    }
    
    .hamburger-settings-row .setting-label {
        flex: 1;
    }
    
    .hamburger-toggle-btn {
        background: rgba(0, 0, 0, 0.3);
        border: 1px solid rgba(212, 175, 55, 0.5);
        color: var(--baseline-white);
        padding: 8px 14px;
        border-radius: 4px;
        font-size: 14px;
        cursor: pointer;
        min-width: 55px;
        text-align: center;
    }
    
    .hamburger-toggle-btn.active {
        background: var(--wimbledon-green);
        border-color: var(--championship-gold);
    }
    
    .hamburger-toggle-group {
        display: flex;
        gap: 6px;
    }
    
    .hamburger-toggle-group .hamburger-toggle-btn {
        min-width: auto;
        padding: 8px 12px;
    }
    
    .hamburger-menu-fact {
        background: rgba(0, 135, 90, 0.25);
        border: 1px solid rgba(212, 175, 55, 0.3);
        border-radius: 8px;
        padding: 14px;
        margin-bottom: 18px;
    }
    
    .hamburger-menu-fact-title {
        color: var(--championship-gold);
        font-size: 11px;
        font-weight: 600;
        margin-bottom: 10px;
        text-transform: uppercase;
        letter-spacing: 1px;
    }
    
    .hamburger-menu-fact-text {
        color: var(--line-cream);
        font-size: 14px;
        line-height: 1.5;
    }
    
    .hamburger-menu-link {
        display: block;
        width: 100%;
        padding: 14px 16px;
        margin-bottom: 10px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(212, 175, 55, 0.3);
        border-radius: 8px;
        color: var(--baseline-white);
        font-size: 16px;
        font-family: 'Inter', sans-serif;
        text-align: left;
        text-decoration: none;
        transition: all 0.2s ease;
    }
    
    .hamburger-menu-link:active {
        background: rgba(255, 255, 255, 0.2);
        border-color: var(--championship-gold);
    }
}

/* ----- MOBILE: max-width 900px ----- */
@media (max-width: 900px) {
    /* Body adjustments */
    body {
        padding: 5px;
    }
    
    /* Content wrapper - block layout */
    .content-wrapper {
        display: block;
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    
    .content-wrapper > div,
    .game-wrapper {
        width: 100% !important;
        flex: none;
    }
    
    /* Game container full width */
    #game-container {
        width: 100%;
        max-width: 100%; /* Allow full width on mobile */
        padding: 8px 8px 12px 8px; /* Extra bottom padding for controls */
        border-radius: 10px;
        margin: 0 auto 5px;
        max-height: none; /* Remove height constraint to allow natural height */
    }
    
    /* Card sizing for mobile */
    :root {
        --card-width: min(calc((100% - 24px) / 7), 120px); /* Max 120px on mobile */
    }
    
    /* Header adjustments */
    .game-header {
        margin-bottom: 8px;
        flex-shrink: 0;
    }
    
    #score {
        padding: 10px 40px;
        font-size: 13px;
    }
    
    #score::before,
    #score::after {
        font-size: 14px;
    }
    
    /* Card areas */
    .tableau {
        gap: 4px;
        min-height: 200px;
        flex: 0 1 auto;
    }
    
    .top-row {
        gap: 4px;
        flex-shrink: 0;
    }
    
    /* Bottom controls - stack vertically, centered */
    .bottom-controls {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px; /* Reduced gap */
        margin-top: 8px; /* Reduced margin */
        margin-bottom: 8px;
        padding: 0 10px;
        width: 100%;
        flex-shrink: 0;
    }
    
    /* Mobile game buttons - centered with consistent width */
    .mobile-game-buttons {
        width: 100%;
        max-width: 300px;
        gap: 8px; /* Reduced gap */
        align-items: center;
    }
    
    .mobile-game-buttons .new-game-mode-btn {
        width: 100%;
        max-width: 300px;
        padding: 12px 16px; /* Reduced padding */
        font-size: 13px;
        min-height: 44px; /* Consistent touch target */
    }
    
    /* Timer container - match height of stacked buttons */
    .mobile-timer-wrapper {
        width: 100%;
        max-width: 300px;
        display: flex;
        justify-content: center;
        flex-shrink: 0;
    }
    
    .timer-container {
        width: 100%;
        max-width: 100%;
        padding: 8px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        gap: 8px; /* Gap between display and controls */
    }
    
    .timer-info {
        display: flex;
        flex-direction: column;
        gap: 4px;
        width: 100%;
    }
    
    .timer-display {
        font-size: 18px;
        line-height: 1;
    }
    
    .timer-controls {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .timer-btn {
        flex: 1 1 calc(50% - 2px);
        min-width: 0;
        padding: 12px 8px; /* Match button padding */
        font-size: 11px;
        min-height: 44px; /* MATCH new-game-mode-btn height exactly */
    }
    
    .timer-btn.serve-clock-btn {
        flex: 1 1 100%;
        min-height: 44px; /* MATCH new-game-mode-btn height exactly */
    }
    
    /* Secondary links section */
    .mobile-secondary-links {
        max-width: 300px;
        margin: 15px auto 0;
    }
    
    .mobile-podcasts-container {
        width: 100%;
    }
    
    .mobile-podcasts-container .new-game-mode-btn {
        width: 100%;
        max-width: 300px;
        padding: 12px 16px;
        font-size: 12px;
    }
    
    /* Touch targets - minimum 44px */
    .new-game-mode-btn,
    .timer-btn,
    .on-this-day-btn {
        min-height: 44px;
    }
    
    /* Help button - fixed to viewport */
    .help-button-container {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1000;
    }
    
    .help-button {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    /* Toast notifications */
    .toast-container {
        max-width: 95%;
        padding: 10px;
    }
    
    /* Help modal */
    .help-modal {
        width: 95%;
        max-width: 95%;
        padding: 20px;
    }
    
    /* On This Day modal */
    .on-this-day-content {
        padding: 20px;
        max-width: 95%;
    }
    
    .on-this-day-title {
        font-size: 20px;
    }
    
    .on-this-day-body {
        font-size: 14px;
    }
    
    /* Ads */
    .top-banner-ad {
        margin: 3px auto !important;
        padding: 5px !important;
    }
    
    .top-banner-ad ins.adsbygoogle:empty {
        display: none !important;
    }
}

/* ----- MOBILE PORTRAIT: max-width 900px + portrait - Reduced button heights ----- */
@media (max-width: 900px) and (orientation: portrait) {
    /* Reduce all button heights by 30% in portrait mode */
    .mobile-game-buttons .new-game-mode-btn {
        min-height: 31px; /* 30% reduction from 44px */
        padding: 8px 16px;
    }
    
    .timer-btn {
        min-height: 31px; /* 30% reduction from 44px */
        padding: 8px 8px;
    }
    
    .timer-btn.serve-clock-btn {
        min-height: 31px;
    }
    
    /* Touch targets in portrait */
    .new-game-mode-btn,
    .timer-btn,
    .on-this-day-btn {
        min-height: 31px;
    }
    
    .mobile-podcasts-container .new-game-mode-btn {
        padding: 8px 16px;
    }
    
    /* Auth buttons in portrait */
    .auth-buttons-row {
        width: 100%;
        max-width: 300px;
    }
    
    .sign-in-btn,
    .save-score-btn {
        min-height: 31px;
        padding: 6px 8px;
    }
    
    /* Score counter in portrait */
    .score-counter {
        min-height: 31px;
        padding: 6px 6px;
    }
    
    /* Deal mode toggle in portrait */
    .deal-mode-option {
        min-height: 31px;
        padding: 6px 12px;
    }
    
    /* === COMPACT CONTROLS FOR PORTRAIT === */
    /* Push compact controls to bottom of game container */
    .bottom-controls {
        margin-top: auto;
    }
    
    .compact-bottom-controls {
        margin-top: 15px; /* Buffer between tableau and controls */
        padding-bottom: 5px;
    }
    
    /* Extend tableau pile heights for consistent appearance */
    .tableau {
        min-height: 50vh;
        margin-bottom: 0; /* Remove bottom margin, use compact-controls margin instead */
    }
    
    .tableau-pile {
        min-height: 45vh;
    }
}

/* ----- MOBILE LANDSCAPE: max-width 900px + landscape ----- */
@media (max-width: 900px) and (orientation: landscape) {
    /* Card sizing for landscape - smaller to allow room for stacks */
    :root {
        --card-width: min(calc((100% - 18px) / 7), 70px); /* Constrained max width for landscape */
    }
    
    /* Tighter body padding */
    body {
        padding: 2px;
    }
    
    /* Compact game container */
    #game-container {
        padding: 5px;
        border-radius: 8px;
        max-height: none;
        min-height: 0;
        display: flex;
        flex-direction: column;
        position: relative;
    }
    
    /* Card play area */
    .card-play-area {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    /* Header spans full width */
    .game-header {
        margin-bottom: 3px;
        flex-shrink: 0;
        position: relative;
    }
    
    #score {
        padding: 6px 40px; /* Symmetrical padding for centered title */
        font-size: 10px;
        border-radius: 6px;
        min-height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    #scoreText {
        text-align: center;
    }
    
    .hamburger-btn {
        width: 20px;
        height: 14px;
        left: 10px;
    }
    
    .hamburger-btn span {
        height: 2px;
    }
    
    /* Position bottom-controls in header area - vertically centered in header */
    .bottom-controls {
        position: absolute !important;
        top: 19px; /* Center of header: 5px padding + 14px (half of 28px header) */
        transform: translateY(-50%);
        right: 12px; /* Small gap from right edge */
        width: auto;
        margin: 0;
        padding: 0;
        z-index: 15;
    }
    
    /* === COMPACT CONTROLS IN HEADER - RIGHT SIDE === */
    .compact-bottom-controls {
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-end;
        align-items: center;
        gap: 5px;
        padding: 0;
        margin: 0;
        width: auto;
        background: transparent;
        border-radius: 0;
    }
    
    .compact-score {
        padding: 4px 8px;
        font-size: 10px;
        min-width: 30px;
        width: auto;
    }
    
    .compact-new-game-btn {
        padding: 4px 8px;
        font-size: 8px;
        width: auto;
        text-align: center;
        white-space: nowrap;
    }
    
    .compact-timer {
        padding: 4px 6px;
        font-size: 9px;
        min-width: 40px;
        width: auto;
    }
    
    /* Compact card areas */
    .top-row {
        margin-bottom: 2px;
        gap: 3px;
        flex-shrink: 0;
    }
    
    .tableau {
        min-height: 140px;
        gap: 3px;
        flex: 0 0 auto;
        overflow: visible;
        margin-bottom: 5px;
    }
    
    /* Old mobile buttons are hidden - hamburger menu used instead */
    
    /* Help button - adjusted positioning */
    .help-button-container {
        position: fixed;
        bottom: 8px;
        right: 8px;
        z-index: 1000;
    }
    
    .help-button {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* ----- SMALL PHONES: max-width 480px ----- */

/* === EXTRA SMALL SCREENS (480px) - Additional adjustments === */
@media (max-width: 480px) {
    /* Tighter game container */
    #game-container {
        padding: 8px;
        min-height: calc(100vh - 120px);
        min-height: calc(100dvh - 120px);
    }
    
    .game-header {
        margin-bottom: 0.5vh;
    }
    
    /* Larger title font, taller area */
    #score {
        padding: 18px 45px;
        font-size: 13px;
        min-height: 54px;
    }
    
    /* Smaller hamburger button */
    .hamburger-btn {
        width: 22px;
        height: 16px;
    }
    
    .hamburger-btn span {
        height: 2px;
    }
    
    /* Cards 5% larger at smallest breakpoint */
    .tableau-pile,
    .foundation-pile,
    .stock-container,
    .waste-container {
        width: calc(var(--card-width) * 1.05) !important;
    }
    
    .card {
        min-height: 50px;
    }
    
    /* Smaller compact controls */
    .compact-bottom-controls {
        padding: 0 4px;
        margin-top: 8px;
        gap: 8px;
    }
    
    .compact-score {
        padding: 8px 12px;
        font-size: 14px;
        min-width: 50px;
    }
    
    .compact-new-game-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .compact-timer {
        padding: 8px 10px;
        font-size: 14px;
        min-width: 52px;
    }
    
    /* Smaller hamburger menu panel */
    .hamburger-menu {
        width: 280px;
        left: -300px;
        padding: 20px 16px;
    }
    
    .hamburger-menu-title {
        font-size: 18px;
    }
    
    .hamburger-menu-close {
        font-size: 28px;
        width: 32px;
        height: 32px;
    }
    
    .hamburger-menu-section-title {
        font-size: 10px;
    }
    
    .hamburger-menu-btn {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .hamburger-settings-row {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .hamburger-toggle-btn {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 50px;
    }
    
    .hamburger-toggle-group .hamburger-toggle-btn {
        padding: 6px 10px;
    }
    
    .hamburger-menu-fact {
        padding: 12px;
    }
    
    .hamburger-menu-fact-title {
        font-size: 10px;
    }
    
    .hamburger-menu-fact-text {
        font-size: 12px;
    }
    
    .hamburger-menu-link {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    /* Help modal */
    .help-modal-title {
        font-size: 18px;
    }
    
    .help-section-title {
        font-size: 14px;
    }
    
    .help-content {
        font-size: 13px;
    }
    
    /* Footer */
    .game-footer {
        font-size: 11px;
        padding: 15px;
    }
    
    .footer-links a {
        display: block;
        margin: 8px 0;
    }
    
    .footer-separator {
        display: none;
    }
}

.footer-copyright a,
.footer-copyright a:visited,
.footer-copyright a:hover,
.footer-copyright a:active {
    color: inherit;
    text-decoration: none;
}

.footer-copyright a:hover {
    text-decoration: underline;
}


/* ===== SEO: visually hidden page heading =====
   Keeps the page's <h1> readable by search engines and screen readers
   without changing the game layout. */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ==================== PAUSE BUTTON ==================== */
/* Shown while the serve clock (tennis) or timer (classic) is in use.
   Desktop: next to Serve Clock / Timer in the sidebar. Tablet/mobile: beside the compact timer. */
.pause-btn[hidden],
.compact-pause-btn[hidden] {
    display: none !important;
}

.timer-btn.pause-btn {
    flex: 0 0 auto;
    min-width: 76px;
}

.timer-btn.pause-btn.paused {
    background: linear-gradient(180deg, var(--championship-gold), #b8942c);
    color: var(--wimbledon-purple);
    border-color: var(--championship-gold);
}

.compact-timer-group {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.compact-pause-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    padding: 0;
    background: var(--wimbledon-purple);
    color: var(--championship-gold);
    border: 1px solid var(--championship-gold);
    border-radius: 6px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.compact-pause-btn svg {
    width: 16px;
    height: 16px;
}

.compact-pause-btn.paused {
    background: var(--championship-gold);
    color: var(--wimbledon-purple);
}

/* Timer readouts pulse while paused */
.timer-paused {
    animation: timer-paused-pulse 1.2s ease-in-out infinite;
}

@keyframes timer-paused-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

@media (max-width: 900px) and (orientation: landscape) {
    .compact-timer-group {
        gap: 5px;
    }

    .compact-pause-btn {
        width: 24px;
        border-radius: 4px;
    }

    .compact-pause-btn svg {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 480px) {
    .compact-pause-btn {
        width: 36px;
    }

    .compact-pause-btn svg {
        width: 14px;
        height: 14px;
    }
}
