:root {
    /* Light Mode Default Palette */
    --bg-main: #dfe4e8;
    /* User requested specific light bg */
    --text-main: #1e293b;
    /* Dark Slate Blue/Grey for text */
    --primary: #FFD700;
    /* Gold remains for High Vis accents, or maybe darker gold/orange? let's stick to Gold for brand */
    --primary-text: #000000;
    --accent: #FF4500;
    --success: #32CD32;
    --danger: #DC143C;

    --nav-bg: #ffffff;
    --nav-text: #334155;
    --nav-active: #0056b3;

    /* Component Backgrounds */
    --card-bg: #ffffff;
    --panel-bg: #ffffff;
    --element-bg: #f1f5f9;
    --border-color: #cbd5e1;

    --font-xl: 3rem;

    /* Auth Colors */
    --auth-bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.18);
    --text-muted: #64748b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Verdana', 'Arial', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    font-size: 16px;
}

/* Typography */
h1,
h2,
h3 {
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    color: #0f172a;
}

h1 {
    font-size: 2.5rem;
}

/* Buttons */
button,
.btn {
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.1s, box-shadow 0.1s;
}

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

.btn-primary {
    background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(0, 86, 179, 0.3);
}

.btn-primary:active {
    box-shadow: 0 2px 3px rgba(0, 86, 179, 0.3);
}

/* Blue for primary actions in light mode often looks better than yellow text */
.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

/* Layouts */
.container {
    max-width: 98%;
    margin: 0 auto;
    padding: 0.5rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--panel-bg);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
}

/* Game Layout */
/* Game Layout - Responsive */
.game-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: auto;
    min-height: calc(100vh - 80px);
}

@media (min-width: 1024px) {
    .game-layout {
        display: grid;
        grid-template-columns: 1fr 380px;
        gap: 1.5rem;
        height: calc(100vh - 100px);
    }
}

/* Board Styling */
.board-container {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.master-board {
    display: grid;
    grid-template-columns: 55px 1fr;
    gap: 6px;
    margin-bottom: 6px;
}

.row-letter {
    font-size: 2.8rem;
    font-weight: 900;
    color: #0056b3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f9ff;
    border-radius: 8px;
}

.row-numbers {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    gap: 4px;
}

@media (max-width: 768px) {
    .row-numbers {
        gap: 2px;
    }
}

.board-num {
    aspect-ratio: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--element-bg);
    color: #64748b;
    font-weight: bold;
    font-size: 1.5rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.board-num.active {
    background: #FFD700;
    /* Gold */
    color: black;
    border-color: #eab308;
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.4);
    transform: scale(1.05);
    z-index: 10;
}

.board-num.current {
    background: #FF4500;
    /* OrangeRed */
    color: white;
    border-color: #FF0000;
    box-shadow: 0 0 15px rgba(255, 69, 0, 0.6);
    transform: scale(1.08);
    z-index: 20;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1.08);
    }

    50% {
        transform: scale(1.12);
    }

    100% {
        transform: scale(1.08);
    }
}

.board-num span {
    font-size: 1.7rem;
}

/* Caller Right Panel */
.caller-panel {
    background: var(--panel-bg);
    padding: 1.5rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.5);
    order: -1;
    /* Show on top on mobile */
}

@media (min-width: 1024px) {
    .caller-panel {
        order: 0;
        /* Return to normal order (right side) on desktop */
        height: 100%;
    }
}

.current-ball {
    width: 250px;
    height: 250px;
    font-size: 8rem;
    font-weight: 900;
    margin: 1rem 0;
    border: 10px solid #0056b3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: #0f172a;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@media (max-width: 768px) {
    .current-ball {
        width: 150px;
        height: 150px;
        font-size: 5rem;
        margin: 0.5rem 0;
        border-width: 6px;
    }
}

.last-balls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 1rem 0;
    min-height: 60px;
}

.mini-ball {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid #cbd5e1;
}

.stats {
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 1rem;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal.open {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-height: 90vh;
    overflow-y: auto;
}

.pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    /* Light overlay */
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(5px);
    border-radius: 12px;
}

.pause-overlay h2 {
    color: #dc2626;
    text-shadow: none;
}

/* Grid for Player Selection in Modal */
.player-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.report-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
    .report-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .report-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }
}

.player-btn {
    background: white;
    border: 1px solid #cbd5e1;
    color: #334155;
    cursor: pointer;
    font-weight: 600;
}

.player-btn:hover {
    background: #e2e8f0;
}

.player-btn.selected {
    background: #0056b3;
    color: white;
    border-color: #0056b3;
    box-shadow: 0 2px 4px rgba(0, 86, 179, 0.3);
}

input,
select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #333;
}

/* Navigation System */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--nav-bg);
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--nav-active);
    text-transform: uppercase;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .main-nav {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    .nav-links {
        width: 100%;
        justify-content: space-between;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .nav-links a {
        flex: 1;
        text-align: center;
        padding: 0.8rem 0.5rem;
        font-size: 0.9rem;
    }

    .nav-links li {
        flex: 1;
        display: flex;
    }

    .nav-links li a {
        width: 100%;
    }
}

.nav-links a.active {
    background: var(--nav-active);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-links a {
    text-decoration: none;
    color: var(--nav-text);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-links a:hover {
    background: #f1f5f9;
    color: var(--nav-active);
}

.btn-logout {
    background: #fee2e2;
    color: #dc2626 !important;
}

.btn-logout:hover {
    background: #fecaca !important;
}

/* New Control Button Styles */
.btn-orange {
    background-color: #ff9800;
    /* Orange */
    color: white;
}

.btn-orange:hover {
    background-color: #f57c00;
}

.btn-cyan {
    background-color: #00bcd4;
    /* Cyan */
    color: white;
}

.btn-cyan:hover {
    background-color: #00acc1;
}

.btn:disabled {
    background-color: #e0e0e0;
    color: #9e9e9e;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Authentication Page Styles */
.auth-body {
    background: var(--auth-bg-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
}

.auth-container {
    width: 90%;
    max-width: 440px;
    padding: 2.5rem;
    margin: 1rem auto;
    text-align: center;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.auth-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 0.5rem;
    background: -webkit-linear-gradient(#4f46e5, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Enhanced Form Elements */
form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-top: 1.5rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"] {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #f8fafc;
    color: #334155;
    outline: none;
}

input:focus {
    border-color: #6366f1;
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.auth-container .btn-primary {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 12px;
    margin-top: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.auth-container .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

.auth-container a {
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-container a:hover {
    text-decoration: underline;
}