/* WURD R2 Discipline Practice v7 — LOS moved above offensive line */
* {
    box-sizing: border-box;
}

:root {
    --green: #22c55e;
    --green-soft: #86efac;
    --red: #ef4444;
    --yellow: #facc15;
    --blue: #38bdf8;
    --panel: #171717;
    --panel-2: #202020;
    --border: #363636;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #111;
    color: #eee;
    font-family: Arial, sans-serif;
}

.container {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 24px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    text-align: center;
    flex-wrap: wrap;
}

.page-header h1 {
    margin: 0 0 8px;
}

.home-btn,
button {
    border: 0;
    border-radius: 7px;
    background: var(--green);
    color: #050505;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
}

.home-btn {
    display: inline-block;
    padding: 10px 14px;
}

.home-btn:hover,
button:hover {
    opacity: 0.88;
}

.intro {
    max-width: 760px;
    margin: 0;
    color: #cfcfcf;
    line-height: 1.45;
}

.settings {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 24px 0 14px;
    flex-wrap: wrap;
}

.settings label {
    font-weight: bold;
}

select,
.settings button {
    min-height: 42px;
    padding: 9px 12px;
    border: 0;
    border-radius: 7px;
    font-size: 15px;
}

.settings button {
    padding-inline: 18px;
}

.status-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.status-pill {
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #1c1c1c;
    color: #ddd;
}

.status-pill.connected {
    border-color: var(--green);
    color: var(--green-soft);
}

.status-pill.active {
    border-color: var(--yellow);
    color: #fde68a;
}

.keyboard-help {
    max-width: 700px;
    margin: 0 auto 16px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #1b1b1b;
    text-align: center;
}

.hidden {
    display: none !important;
}

.game-area {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #050505;
}

.scoreboard {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.scoreboard span {
    min-width: 118px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--panel);
    text-align: center;
}

.drill-layout {
    display: grid;
    grid-template-columns: minmax(330px, 2fr) minmax(250px, 1fr);
    gap: 22px;
    align-items: stretch;
}

.football-field {
    position: relative;
    min-height: 520px;
    overflow: hidden;
    border: 5px solid #eee;
    border-radius: 9px;
    background-color: #126534;
    background-image:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent calc(10% - 2px),
            rgba(255, 255, 255, 0.72) calc(10% - 2px),
            rgba(255, 255, 255, 0.72) 10%
        ),
        repeating-linear-gradient(
            to right,
            rgba(255, 255, 255, 0.035) 0,
            rgba(255, 255, 255, 0.035) 7%,
            rgba(0, 0, 0, 0.035) 7%,
            rgba(0, 0, 0, 0.035) 14%
        );
}

.end-zone {
    position: absolute;
    left: 0;
    z-index: 1;
    width: 100%;
    height: 8%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.58);
    font-weight: bold;
    letter-spacing: 7px;
}

.end-zone-top { top: 0; }
.end-zone-bottom { bottom: 0; }

.hash {
    position: absolute;
    top: 9%;
    bottom: 9%;
    z-index: 1;
    width: 1px;
    background-image: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.75) 0,
        rgba(255, 255, 255, 0.75) 6px,
        transparent 6px,
        transparent 18px
    );
}

.hash-left { left: 39%; }
.hash-right { right: 39%; }

.lane {
    position: absolute;
    top: 18%;
    z-index: 2;
    width: 23%;
    height: 58%;
    border: 3px dashed transparent;
    border-radius: 12px;
    opacity: 0.18;
    transition: opacity 120ms ease, background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.lane span {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
}

.lane-left { left: 7%; }
.lane-middle { left: 38.5%; }
.lane-right { right: 7%; }

.lane.open {
    border-color: #bbf7d0;
    background: rgba(34, 197, 94, 0.34);
    box-shadow: 0 0 24px rgba(34, 197, 94, 0.82);
    opacity: 1;
    transform: scale(1.03);
}

.player {
    position: absolute;
    z-index: 5;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
    font-size: 12px;
    font-weight: bold;
    transform: translate(-50%, -50%);
    transition: left 190ms ease, top 190ms ease, opacity 150ms ease, transform 150ms ease;
}

.blocker {
    top: 47%;
    background: #0f172a;
}

.blocker-left { left: 28%; }
.blocker-middle { left: 50%; }
.blocker-right { left: 72%; }

.runner {
    left: 50%;
    top: 72%;
    background: #2563eb;
}

.defender {
    left: 50%;
    top: 68%;
    background: #7c3aed;
}

.ball-carrier {
    left: 50%;
    top: 34%;
    background: #dc2626;
}

.direction-arrow {
    position: absolute;
    left: 50%;
    top: 23%;
    z-index: 6;
    color: var(--yellow);
    font-size: 54px;
    opacity: 0;
    transform: translate(-50%, -50%);
    text-shadow: 0 0 8px #000;
    transition: left 180ms ease, opacity 120ms ease, transform 180ms ease;
}

.direction-arrow.visible {
    opacity: 1;
}

.countdown {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.54);
    color: white;
    font-size: clamp(88px, 16vw, 170px);
    font-weight: bold;
    text-shadow: 0 4px 16px #000;
}

.control-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    text-align: center;
}

.play-badge {
    margin-bottom: 10px;
    padding: 6px 10px;
    border: 1px solid #3f3f46;
    border-radius: 999px;
    background: #27272a;
    color: #ddd;
    font-weight: bold;
    letter-spacing: 1px;
}

.play-badge.offense {
    border-color: #2563eb;
    color: #93c5fd;
}

.play-badge.defense {
    border-color: #7c3aed;
    color: #c4b5fd;
}

.control-panel h2 {
    min-height: 58px;
    margin: 4px 0 8px;
}

#phaseInstruction {
    min-height: 50px;
    margin: 0 0 12px;
    color: #ccc;
    line-height: 1.4;
}

.cue-light {
    width: min(230px, 100%);
    min-height: 112px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid #555;
    border-radius: 14px;
    background: #2b2b2b;
    box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.55);
    font-size: 35px;
    font-weight: 900;
    letter-spacing: 3px;
    transition: all 120ms ease;
}

.cue-light.wait {
    border-color: #d97706;
    background: #713f12;
    color: #fde68a;
}

.cue-light.go {
    border-color: #bbf7d0;
    background: #15803d;
    color: white;
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.9), inset 0 0 25px rgba(255, 255, 255, 0.18);
    transform: scale(1.03);
}

.cue-light.bad {
    border-color: #fecaca;
    background: #991b1b;
    color: white;
}

.reaction-meter {
    width: 100%;
    height: 14px;
    margin-top: 17px;
    overflow: hidden;
    border: 1px solid #444;
    border-radius: 999px;
    background: #090909;
}

.reaction-meter-fill {
    width: 0;
    height: 100%;
    background: var(--green);
}

.reaction-meter-fill.running {
    animation-name: reactionDrain;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

@keyframes reactionDrain {
    from { width: 100%; }
    to { width: 0; }
}

.r2-button {
    width: 112px;
    height: 70px;
    margin-top: 16px;
    border: 3px solid #e5e7eb;
    border-radius: 15px 15px 28px 28px;
    background: #27272a;
    color: white;
    font-size: 28px;
    box-shadow: 0 5px 0 #09090b;
    user-select: none;
    touch-action: none;
}

.r2-button.pressed {
    transform: translateY(4px);
    box-shadow: 0 1px 0 #09090b;
    background: #52525b;
}

.small-text {
    color: #bcbcbc;
    font-size: 13px;
    line-height: 1.4;
}

.lesson-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.lesson-row > div {
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-2);
    line-height: 1.45;
}

.feedback {
    margin-top: 16px;
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 2px solid #3f3f46;
    border-radius: 9px;
    background: #18181b;
    font-size: clamp(22px, 3vw, 34px);
    font-weight: bold;
    text-align: center;
}

.feedback.perfect {
    border-color: var(--green);
    color: var(--green-soft);
}

.feedback.early,
.feedback.late,
.feedback.wrong-direction {
    border-color: var(--red);
    color: #fca5a5;
}

.feedback.neutral {
    color: #ddd;
}

@media (max-width: 820px) {
    .drill-layout {
        grid-template-columns: 1fr;
    }

    .football-field {
        min-height: 480px;
    }

    .lesson-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .container {
        padding: 14px;
    }

    .game-area {
        padding: 12px;
    }

    .football-field {
        min-height: 430px;
    }

    .player {
        width: 42px;
        height: 42px;
        font-size: 10px;
    }

    .scoreboard span {
        min-width: 104px;
    }
}

/* R2 Practice v4: steer first, then cross the burst point. */
.burst-line {
    position: absolute;
    left: 5%;
    right: 5%;
    top: 52%;
    z-index: 4;
    height: 0;
    border-top: 4px solid rgba(250, 204, 21, 0.95);
    opacity: 0;
    pointer-events: none;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.75));
    transition: top 180ms ease, opacity 140ms ease, border-color 120ms ease;
}

.burst-line.visible {
    opacity: 1;
}

.burst-line.ready {
    border-top-color: #86efac;
    box-shadow: 0 -2px 13px rgba(34, 197, 94, 0.9);
}

.burst-line span {
    position: absolute;
    left: 50%;
    top: -29px;
    transform: translateX(-50%);
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.76);
    color: #fde68a;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1px;
    white-space: nowrap;
}

.burst-line.ready span {
    color: #bbf7d0;
}

.cue-light.aim {
    border-color: #fde047;
    background: #854d0e;
    color: #fef9c3;
    box-shadow: 0 0 22px rgba(250, 204, 21, 0.55), inset 0 0 25px rgba(255, 255, 255, 0.1);
}

.play-badge.inside {
    border-color: #2563eb;
    color: #bfdbfe;
}

.play-badge.outside {
    border-color: #0ea5e9;
    color: #bae6fd;
}

.play-badge.outside-open {
    border-color: #22c55e;
    color: #bbf7d0;
}

.play-badge.outside-developing {
    border-color: #f59e0b;
    color: #fde68a;
}

@media (min-width: 821px) {
    .lesson-row {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* v6 LOS overlay */
.scrimmage-line {
    position: absolute;
    left: 6%;
    width: 88%;
    top: 44%;
    height: 0;
    border-top: 3px dashed rgba(56, 189, 248, 0.95);
    box-shadow: 0 0 0 2px rgba(5, 5, 5, 0.18);
    opacity: 0.96;
    z-index: 2;
    pointer-events: none;
}

.scrimmage-line span {
    position: absolute;
    left: 50%;
    top: -18px;
    transform: translateX(-50%);
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(6, 18, 26, 0.86);
    color: #bfe9ff;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
