:root {
    --bg-color: #0d1117;
    --panel-bg: #161b22;
    --border-color: #30363d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;

    --pitch-bg: #112a14;
    --pitch-lines: rgba(255, 255, 255, 0.4);

    --danger-zone: rgba(234, 74, 90, 0.2);
    --shadow-color: rgba(0, 0, 0, 0.5);

    --gk-color: #ea4a5a;
    --shooter-color: #3fb950;
    --receiver-color: #2f81f7;
    --ball-color: #ffffff;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1,
h2,
h3 {
    font-family: var(--font-heading);
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--panel-bg);
    border-bottom: 1px solid var(--border-color);
}

.controls {
    display: flex;
    gap: 2rem;
    align-items: center;
}

/* Toggle Switch */
.mode-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mode-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.mode-label.active {
    color: var(--text-primary);
    font-weight: 600;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gk-color);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--receiver-color);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

select {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: 4px;
    font-family: var(--font-body);
}

.btn {
    background: var(--border-color);
    color: var(--text-primary);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background 0.2s;
}

.btn:hover {
    background: #4a535e;
}

.btn-primary {
    background: var(--shooter-color);
    color: #000;
    font-weight: 600;
}

.btn-primary:hover {
    background: #2ea043;
}

/* Main Layout */
.lab-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
}

.panel-header {
    background: var(--panel-bg);
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.canvas-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: grab;
}

canvas:active {
    cursor: grabbing;
}

.scene-wrapper {
    flex: 1;
    background: #000;
    position: relative;
    display: flex;
}

/* HUD System */
.hud {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(22, 27, 34, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.stat-box {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-value.highlight {
    color: var(--shooter-color);
}

#stat-passing-status {
    color: var(--gk-color);
}

.hidden {
    display: none !important;
}

.scenario-hud {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(46, 160, 67, 0.9);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 0 40px rgba(46, 160, 67, 0.4);
    color: #fff;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.scenario-hud h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.scenario-hud p {
    margin-bottom: 1.5rem;
}

@keyframes popIn {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Bottom HUD for POV Panel */
.bottom-hud {
    top: auto;
    bottom: 20px;
    right: 50%;
    transform: translateX(50%);
    flex-direction: row;
    gap: 2rem;
}