/* =========================
   PIGSKIN PAPER FOOTBALL
   assets/css/style.css
========================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    color: #f7ead2;
    background: radial-gradient(circle at top, rgba(255, 210, 120, 0.12), transparent 36%), linear-gradient(180deg, #24160d 0%, #130d09 100%);
}

/* =========================
   MAIN SHELL
========================= */

.game-shell {
    width: min(1100px, 100%);
    margin: 0 auto;
    padding: 18px;
}

/* =========================
   HEADER
========================= */

.game-header {
    margin-bottom: 14px;
}

.brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    text-align: left;
}

.brand-logo {
    width: 110px;
    max-width: 32vw;
    height: auto;
    display: block;
}

.title-block {
    max-width: 720px;
}

.eyebrow {
    margin: 0 0 4px;
    color: #f5c45b;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 800;
}

h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    color: #ffffff;
    font-size: clamp(2rem, 5vw, 4.25rem);
    line-height: 0.95;
    text-transform: uppercase;
    text-shadow: 0 4px 0 rgba(0, 0, 0, 0.38);
}

.tagline {
    margin: 8px 0 0;
    color: #f7ead2;
    font-weight: 700;
}

/* =========================
   SCOREBOARD
========================= */

.scoreboard {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
    margin: 14px auto;
    max-width: 920px;
}

.score-card {
    min-height: 78px;
    padding: 12px 14px;
    border: 3px solid #4d2d15;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(38, 24, 14, 0.98), rgba(16, 12, 8, 0.98));
    box-shadow: inset 0 0 0 2px rgba(255, 216, 133, 0.12), 0 6px 14px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.center-card {
    border-color: #b88b3c;
}

.score-label {
    display: block;
    margin-bottom: 4px;
    color: #f5c45b;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 900;
}

.score-value {
    display: block;
    font-size: 2.15rem;
    color: #ffffff;
    font-weight: 900;
    line-height: 1;
}

.small-score {
    font-size: 1.35rem;
    padding-top: 8px;
}

.clock-warning {
    color: #ff4d4d;
    animation: clockPulse 0.45s infinite alternate;
}

@keyframes clockPulse {
    from {
        transform: scale(1);
        text-shadow: 0 0 4px rgba(255, 77, 77, 0.4);
    }

    to {
        transform: scale(1.08);
        text-shadow: 0 0 14px rgba(255, 77, 77, 0.95);
    }
}

/* =========================
   STATUS
========================= */

.status-panel {
    max-width: 820px;
    margin: 0 auto 14px;
    padding: 10px 14px;
    border: 2px solid rgba(245, 196, 91, 0.42);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.28);
    text-align: center;
}

    .status-panel p {
        margin: 0;
        font-weight: 800;
        color: #fff6e7;
    }

/* =========================
   GAME BOARD
========================= */

.game-board {
    position: relative;
    width: min(920px, 100%);
    height: min(66vh, 560px);
    min-height: 440px;
    margin: 0 auto;
    overflow: hidden;
    border: 10px solid #3b2414;
    border-radius: 18px;
    background: linear-gradient(rgba(255, 245, 216, 0.08), rgba(255, 245, 216, 0.08)), url("../images/desk-texture.jpg"), linear-gradient(135deg, #7d4a25, #4f2b14);
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.42), 0 16px 35px rgba(0, 0, 0, 0.38);
    touch-action: none;
    user-select: none;
    cursor: crosshair;
}

    .game-board::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px), linear-gradient(0deg, rgba(255,255,255,0.045) 1px, transparent 1px);
        background-size: 42px 42px;
        pointer-events: none;
        opacity: 0.55;
    }

.center-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 3px;
    transform: translateY(-50%);
    background: repeating-linear-gradient( 90deg, rgba(255, 255, 255, 0.5) 0 28px, transparent 28px 46px );
    opacity: 0.75;
    z-index: 1;
}

.end-zone {
    position: absolute;
    left: 0;
    right: 0;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 900;
    background: rgba(0, 0, 0, 0.18);
    z-index: 1;
    pointer-events: none;
}

.top-zone {
    top: 0;
    border-bottom: 2px dashed rgba(255, 255, 255, 0.28);
}

.bottom-zone {
    bottom: 0;
    border-top: 2px dashed rgba(255, 255, 255, 0.28);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 6px;
}

/* =========================
   FOOTBALL
========================= */

.football {
    position: absolute;
    width: 120px;
    height: 69px;
    padding: 0;
    border: 0;
    background: url("../images/paper-football.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: grab;
    z-index: 10;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
    touch-action: none;
    transform-origin: center center;
    appearance: none;
    -webkit-appearance: none;
    pointer-events: none;
}

    .football:active {
        cursor: grabbing;
    }

    .football:focus-visible {
        outline: 4px solid #f5c45b;
        outline-offset: 5px;
    }

    .football.disabled {
        pointer-events: none;
        opacity: 0.72;
    }

    .football::before,
    .football::after {
        display: none;
    }

/* =========================
   AIM ARROW
========================= */

.aim-arrow {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    height: 110px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(0deg) scaleY(0);
    opacity: 0;
    z-index: 6;
    pointer-events: none;
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.45);
}

    .aim-arrow::before {
        content: "";
        position: absolute;
        left: 50%;
        top: -15px;
        transform: translateX(-50%);
        width: 0;
        height: 0;
        border-left: 13px solid transparent;
        border-right: 13px solid transparent;
        border-bottom: 21px solid rgba(255, 255, 255, 0.88);
    }

    .aim-arrow.active {
        opacity: 1;
    }

    .aim-arrow.field-goal-swing {
        opacity: 1;
        height: 135px;
        background: rgba(255, 226, 138, 0.95);
        box-shadow: 0 0 12px rgba(255, 226, 138, 0.85), 0 0 24px rgba(255, 226, 138, 0.45);
    }

        .aim-arrow.field-goal-swing::before {
            border-bottom-color: rgba(255, 226, 138, 0.95);
        }

/* =========================
   POWER METER
========================= */

.power-wrap {
    position: absolute;
    left: 18px;
    bottom: 18px;
    width: min(230px, calc(100% - 36px));
    z-index: 12;
    pointer-events: none;
}

.power-label {
    display: block;
    margin-bottom: 5px;
    color: #ffffff;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 900;
    text-shadow: 0 2px 3px rgba(0,0,0,0.8);
}

.power-meter {
    position: relative;
    width: 100%;
    height: 18px;
    padding: 2px;
    border: 2px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.48);
    overflow: hidden;
}

.power-fill {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #f4df74, #f2992e, #d63838);
    transition: width 0.04s linear;
}

.power-bullseye {
    position: absolute;
    top: -5px;
    bottom: -5px;
    left: 75%;
    width: 4px;
    background: #ffffff;
    border-radius: 999px;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.95), 0 0 14px rgba(255, 226, 138, 0.85);
    z-index: 5;
    display: none;
}

.power-meter.field-goal-power .power-bullseye {
    display: block;
}

.power-meter.field-goal-power {
    border-color: #ffe28a;
    box-shadow: 0 0 10px rgba(255, 226, 138, 0.7), inset 0 0 8px rgba(255, 226, 138, 0.35);
}

/* =========================
   FIELD GOAL TARGET
========================= */

.field-goal-target {
    position: absolute;
    left: 50%;
    top: 18px;
    width: 180px;
    height: 110px;
    transform: translateX(-50%);
    z-index: 5;
    pointer-events: none;
    opacity: 0.95;
}

    .field-goal-target .upright {
        position: absolute;
        top: 0;
        width: 9px;
        height: 105px;
        border-radius: 999px;
        background: linear-gradient(180deg, #ffe28a, #c98d23);
        box-shadow: 0 0 10px rgba(255, 226, 138, 0.5), 0 3px 8px rgba(0, 0, 0, 0.35);
    }

.left-upright {
    left: 18px;
}

.right-upright {
    right: 18px;
}

.crossbar {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 24px;
    height: 9px;
    border-radius: 999px;
    background: linear-gradient(90deg, #c98d23, #ffe28a, #c98d23);
    box-shadow: 0 0 10px rgba(255, 226, 138, 0.5), 0 3px 8px rgba(0, 0, 0, 0.35);
}

.field-goal-target.computer-kick {
    top: auto;
    bottom: 18px;
    transform: translateX(-50%) rotate(180deg);
}

.field-goal-target.hidden {
    display: none;
}

.field-goal-mode {
    outline: 4px solid rgba(255, 226, 138, 0.55);
}

    .field-goal-mode::after {
        content: "EXTRA POINT";
        position: absolute;
        left: 50%;
        top: 138px;
        transform: translateX(-50%);
        color: #ffe28a;
        font-size: 0.8rem;
        font-weight: 900;
        letter-spacing: 0.22em;
        text-shadow: 0 3px 5px rgba(0,0,0,0.8);
        z-index: 6;
        pointer-events: none;
    }

/* =========================
   CONTROLS
========================= */

.controls-panel {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px auto 0;
}

.control-btn {
    min-width: 130px;
    padding: 11px 16px;
    border: 0;
    border-radius: 999px;
    color: #1f1309;
    background: linear-gradient(180deg, #ffe28a, #c98d23);
    box-shadow: 0 5px 0 #6d4512;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
}

    .control-btn:active {
        transform: translateY(3px);
        box-shadow: 0 2px 0 #6d4512;
    }

    .control-btn.secondary {
        color: #fff7e9;
        background: linear-gradient(180deg, #53331c, #2b1b10);
        box-shadow: 0 5px 0 #120a06;
        border: 1px solid rgba(245, 196, 91, 0.45);
    }

/* =========================
   HELP PANEL
========================= */

.help-panel {
    max-width: 820px;
    margin: 16px auto 0;
    padding: 16px;
    border: 2px solid rgba(245, 196, 91, 0.45);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.36);
}

    .help-panel h2 {
        margin: 0 0 8px;
        color: #f5c45b;
        font-family: Georgia, "Times New Roman", serif;
        text-transform: uppercase;
    }

    .help-panel p {
        margin: 8px 0;
        line-height: 1.5;
    }

.hidden {
    display: none;
}

/* =========================
   RESULT STATES
========================= */

.game-board.player-turn {
    outline: 4px solid rgba(245, 196, 91, 0.35);
}

.game-board.computer-turn {
    outline: 4px solid rgba(145, 202, 255, 0.35);
}

.game-board.touchdown-flash {
    animation: touchdownFlash 0.8s ease-in-out 3;
}

@keyframes touchdownFlash {
    0% {
        box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.42), 0 16px 35px rgba(0, 0, 0, 0.38);
    }

    50% {
        box-shadow: inset 0 0 60px rgba(255, 210, 80, 0.58), 0 0 40px rgba(255, 210, 80, 0.5);
    }

    100% {
        box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.42), 0 16px 35px rgba(0, 0, 0, 0.38);
    }
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 720px) {
    .game-shell {
        padding: 12px;
    }

    .brand-row {
        text-align: center;
        gap: 10px;
    }

    .brand-logo {
        width: 88px;
    }

    .scoreboard {
        grid-template-columns: 1fr 1fr;
        gap: 7px;
    }

    .score-card {
        min-height: 68px;
        padding: 10px 8px;
    }

    .score-label {
        font-size: 0.62rem;
        letter-spacing: 0.1em;
    }

    .score-value {
        font-size: 1.75rem;
    }

    .small-score {
        font-size: 1rem;
        padding-top: 7px;
    }

    .game-board {
        height: 62vh;
        min-height: 430px;
        border-width: 6px;
        border-radius: 14px;
    }

    .football {
        width: 120px;
        height: 69px;
    }

    .aim-arrow {
        height: 95px;
    }

    .end-zone {
        height: 50px;
        font-size: 0.62rem;
    }

    .power-wrap {
        left: 12px;
        bottom: 12px;
    }

    .control-btn {
        width: 100%;
        max-width: 280px;
    }

    .field-goal-target {
        width: 145px;
        height: 92px;
    }

        .field-goal-target .upright {
            height: 88px;
            width: 7px;
        }

    .crossbar {
        height: 7px;
        bottom: 20px;
    }

    .field-goal-mode::after {
        top: 116px;
        font-size: 0.68rem;
    }
}

@media (max-width: 430px) {
    h1 {
        font-size: 2rem;
    }

    .tagline {
        font-size: 0.9rem;
    }

    .scoreboard {
        margin-top: 10px;
    }

    .game-board {
        min-height: 400px;
    }

    .status-panel p {
        font-size: 0.9rem;
    }
}
