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

:root {
    /* Light mode (default) */
    --bg-gradient-1: #667eea;
    --bg-gradient-2: #764ba2;
    --container-bg: #ffffff;
    --text-color: #333333;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --info-bg: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-light: rgba(0, 0, 0, 0.1);
}

body.dark-mode {
    /* Dark mode */
    --bg-gradient-1: #1a1a2e;
    --bg-gradient-2: #16213e;
    --container-bg: #0f1419;
    --text-color: #e4e6eb;
    --text-secondary: #b0b3b8;
    --text-tertiary: #8a8d91;
    --info-bg: #1c1e26;
    --border-color: #2d2f36;
    --shadow: rgba(0, 0, 0, 0.6);
    --shadow-light: rgba(0, 0, 0, 0.3);
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 100%);
    min-height: 100vh;
    padding: 0; /* removed global padding so flex centering is precise */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    overscroll-behavior: none;
    transition: background 0.3s ease;
}

.container {
    max-width: 500px;
    width: 100%;
    background: var(--container-bg);
    border-radius: 20px;
    box-shadow: 0 20px 60px var(--shadow);
    padding: 30px;
    max-height: 95vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: background 0.3s ease, box-shadow 0.3s ease, border 0.3s ease;
    margin: 20px; /* keep breathing room while remaining centered */
    border: 2px solid var(--border-color);
}

/* Remove border on mobile and tablet - full screen up to 768px */
@media (max-width: 768px) {
    .container {
        border: none;
        border-radius: 0;
        box-shadow: none;
        margin: 0;
        max-height: 100vh;
        min-height: 100vh;
        padding: 20px 15px;
        width: 100vw;
        max-width: 100vw;
    }
}

/* Header */
.game-title {
    text-align: center;
    color: var(--text-color);
    margin: 0;
    font-size: clamp(20px, 6vw, 28px); /* Responsive size */
    font-weight: 700;
    transition: color 0.3s ease;
    flex: 1;
    padding: 0 60px; /* Space for buttons on sides */
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 10px;
    gap: 10px;
}

.header-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s, transform 0.2s;
    -webkit-tap-highlight-color: transparent;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.icon-btn:hover {
    background: var(--info-bg);
    transform: scale(1.05);
}

.icon-btn:active {
    transform: scale(0.95);
}

.instructions {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
    transition: color 0.3s ease;
}

/* Game Info */
.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--info-bg);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.info-item {
    text-align: center;
}

.info-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.info-value {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    margin-top: 5px;
}

.timer {
    font-family: 'Courier New', monospace;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px var(--shadow-light);
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Styles - up to 768px for full screen */
@media (max-width: 768px) {
    body {
        padding: 0;
        align-items: flex-start;
    }
}

/* Extra small mobile adjustments */
@media (max-width: 480px) {
    .container {
        padding: 15px 12px;
    }

    .game-title {
        font-size: clamp(18px, 5vw, 22px);
        padding: 0 50px;
    }

    .header-buttons {
        gap: 5px;
    }

    .icon-btn {
        font-size: 18px;
        width: 32px;
        height: 32px;
        padding: 6px;
    }

    .info-value {
        font-size: 20px;
    }

    .game-info {
        padding: 10px;
    }

    .instructions {
        font-size: 13px;
    }
}

@media (max-width: 340px) {
    .pool-container {
        max-width: 180px;
        margin: 0 auto;
    }

    .game-title {
        padding: 0 45px;
    }
}