:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --background-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --orange-ball: #f97316;
    --purple-ball: #a855f7;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-main);
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    margin-bottom: 2rem;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    font-weight: 800;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.card-header i {
    color: var(--primary-color);
}

/* Ball Randomizer Styling */
.box-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: #f1f5f9;
    border-radius: 8px;
}

.box-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.box {
    aspect-ratio: 1;
    background: #ffffff;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.ball {
    width: 70%;
    height: 70%;
    border-radius: 50%;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.ball.orange { background-color: var(--orange-ball); }
.ball.purple { background-color: var(--purple-ball); }

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Timer Styling */
.timer-display {
    font-size: 4rem; /* Maximized font size */
    font-weight: 800;
    text-align: center;
    padding: 2rem;
    background: #f1f5f9;
    border-radius: 12px;
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.timer-row {
    width: 100%;
}

.countdown-overlay {
    font-size: 8rem;
    font-weight: 900;
    color: var(--danger-color);
    text-align: center;
    margin-top: -1rem;
    margin-bottom: 1rem;
    animation: pulse 1s infinite;
}

.countdown-overlay.hidden {
    display: none;
}

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

.timer-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Fixture Styling */
.upload-section {
    text-align: center;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.bottom-controls {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.upload-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #f1f5f9;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-label:hover {
    background: #e2e8f0;
    border-color: var(--primary-color);
}

.fixture-content {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.fixture-content p.placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.match-info {
    animation: fadeIn 0.3s ease;
}

.match-number {
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.5rem; /* Increased match number size */
}

.teams {
    font-size: 2.5rem; /* Maximized team names size */
    font-weight: 800;
    line-height: 1.1;
}

.teams.stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Reduced gap to accommodate vs */
}

.teams.stack .team {
    width: 100%;
    padding: 0.25rem 0;
}

.vs-divider {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: lowercase;
    margin: -0.5rem 0;
}

.vs {
    display: none; /* Keep original vs hidden */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.navigation-controls {
    display: flex;
    gap: 1rem;
}

/* Button Styling */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 1rem;
    flex: 1;
}

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

.btn.primary { background: var(--primary-color); color: white; }
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); }

.btn.secondary { background: var(--secondary-color); color: white; }
.btn.secondary:hover:not(:disabled) { opacity: 0.9; }

.btn.success { background: var(--success-color); color: white; }
.btn.success:hover:not(:disabled) { opacity: 0.9; }

.btn.danger { background: var(--danger-color); color: white; }
.btn.danger:hover:not(:disabled) { opacity: 0.9; }

.btn.outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}
.btn.outline:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: var(--primary-color);
}

.btn.text-link {
    background: transparent;
    color: var(--primary-color);
    font-size: 0.875rem;
    padding: 0.25rem;
    text-decoration: underline;
    flex: none;
}

.btn.text-link:hover {
    color: var(--primary-hover);
}

@media (max-width: 600px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}
