:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --panel-bg: #1e293b;
    --accent-color: #38bdf8;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', system-ui, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

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

h1 {
    font-weight: 700;
    font-size: 2.5rem;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

p {
    color: #94a3b8;
    margin: 0;
    font-size: 1.1rem;
}

.pitch-container {
    background-color: var(--panel-bg);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5);
    width: 90vw;
    max-width: 1050px;
    margin-bottom: 3rem;
    transition: transform 0.3s ease;
}

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

canvas {
    width: 100%;
    aspect-ratio: 105 / 68;
    display: block;
    background-color: #22c55e;
    /* Fallback green */
    border-radius: 8px;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.3);
    cursor: default;
    /* Will change to pointer via JS if needed */
}

.controls-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.control-btn {
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 9999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
    transition: all 0.2s ease;
    font-family: inherit;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
    filter: brightness(1.1);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn.paused {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    /* Dark blur overlay */
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--panel-bg);
    border: 1px solid #334155;
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    transform: translateY(0);
    transition: transform 0.3s ease;
    min-width: 350px;
}

.modal.hidden .modal-content {
    transform: translateY(20px);
}

.modal h2 {
    margin-top: 0;
    color: var(--accent-color);
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.score-display {
    font-size: 4rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #4ade80, #3b82f6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.score-total {
    font-size: 1.5rem;
    color: #64748b;
    -webkit-text-fill-color: initial;
}

.stats-row {
    display: flex;
    justify-content: space-around;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat .label {
    color: #94a3b8;
    font-size: 0.9rem;
}

.stat .highlight {
    font-size: 1.5rem;
    font-weight: 600;
    color: #f8fafc;
}

.score-desc {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 2rem;
}

.modal-btn {
    width: 100%;
    justify-content: center;
    padding: 1rem;
}

.result-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.modal-btn.secondary {
    background: transparent;
    border: 1px solid #475569;
}

.modal-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #64748b;
}

/* Session Info */
.session-info {
    margin-top: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-color);
    background: rgba(56, 189, 248, 0.1);
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    display: inline-block;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

/* Dashboard UI */
.dashboard-content {
    min-width: 500px;
}

.dashboard-stats {
    display: flex;
    justify-content: space-around;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.dashboard-stat {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dashboard-stat .label {
    color: #94a3b8;
    font-size: 1rem;
}

.dashboard-stat .highlight {
    font-size: 2.2rem;
    font-weight: 700;
    color: #f8fafc;
}

.report-text {
    text-align: left;
    background: rgba(56, 189, 248, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--accent-color);
}

.report-text h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #f8fafc;
    font-size: 1.2rem;
}

.report-text p {
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 0;
}