/*
 * style.css — WLD FoxWave ARDF (v2 — visual polish)
 * Aesthetic: military radio-room · Belgian park · retro-futuristic CRT
 * Fonts: Orbitron (display/HUD), Share Tech Mono (data readouts)
 */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Share+Tech+Mono&display=swap');

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:          #040c04;
    --panel-bg:    #080f08;
    --border:      #1a4a1a;
    --border-dim:  #0d2a0d;
    --gold:        #ffd700;
    --gold-dim:    #a07800;
    --green:       #4ade80;
    --green-dim:   #2a5a2a;
    --green-dark:  #0a1f0a;
    --text-main:   #c8e8c8;
    --text-dim:    #4a7a4a;
    --red:         #ff4444;
    --blue:        #44aaff;
}

html, body {
    width: 100%; height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text-main);
    font-family: 'Share Tech Mono', monospace;
    cursor: crosshair;
    user-select: none;
    -webkit-user-select: none;
}

/* ── Layout ────────────────────────────────────────────────────────────────── */
#game-wrapper {
    display: flex;
    width: 100vw;
    height: 100vh;
    position: relative;
}

#panel-main {
    flex: 0 0 70%;
    height: 100%;
    position: relative;
    border-right: 2px solid var(--border);
    background: #010801;
}

#canvas-main { display: block; width: 100%; height: 100%; }

#panel-right {
    flex: 0 0 30%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--panel-bg);
}

#panel-right-top {
    flex: 0 0 65%;
    position: relative;
    border-bottom: 2px solid var(--border);
    overflow: hidden;
}

/* Subtle inner glow on right panels */
#panel-right-top::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(74,222,128,0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

#canvas-right-top { display: block; width: 100%; height: 100%; }
#panel-right-bot  { flex: 1; position: relative; overflow: hidden; }
#canvas-right-bot { display: block; width: 100%; height: 100%; }

/* ── Scanlines + corner vignette on game ────────────────────────────────── */
#game-wrapper::after {
    content: '';
    position: fixed; inset: 0;
    background: repeating-linear-gradient(
        0deg, transparent, transparent 3px,
        rgba(0,0,0,0.04) 3px, rgba(0,0,0,0.04) 4px
    );
    pointer-events: none;
    z-index: 80;
}

/* ── Overlay base ──────────────────────────────────────────────────────────── */
.overlay {
    position: fixed; inset: 0;
    background: rgba(1,6,1,0.90);
    display: flex; align-items: center; justify-content: center;
    z-index: 100;
    backdrop-filter: blur(6px) saturate(0.6);
    -webkit-backdrop-filter: blur(6px) saturate(0.6);
    animation: overlayIn 0.25s ease both;
}

@keyframes overlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.overlay.hidden { display: none; }

/* ── Card ──────────────────────────────────────────────────────────────────── */
.card {
    background: linear-gradient(160deg, #0a1c0a, #060e06);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 38px 46px;
    max-width: 680px; width: 92%;
    box-shadow:
        0 0 0 1px #0d2a0d inset,
        0 0 40px rgba(74,222,128,0.07),
        0 24px 80px rgba(0,0,0,0.7);
    position: relative;
    overflow: hidden;
    animation: cardIn 0.3s cubic-bezier(.2,.8,.4,1) both;
}

@keyframes cardIn {
    from { transform: translateY(14px) scale(0.98); opacity: 0; }
    to   { transform: translateY(0) scale(1);       opacity: 1; }
}

/* Gold corner brackets */
.card::before, .card::after {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    border-color: var(--gold-dim);
    border-style: solid;
    opacity: 0.7;
}
.card::before { top: 10px; left: 10px; border-width: 2px 0 0 2px; }
.card::after  { bottom: 10px; right: 10px; border-width: 0 2px 2px 0; }

/* ── Splash ────────────────────────────────────────────────────────────────── */
#overlay-splash .card { text-align: center; max-width: 740px; }

.splash-logo-row {
    display: flex; align-items: center; justify-content: center;
    gap: 20px; margin-bottom: 22px;
}

.splash-logo-row img {
    height: 68px; object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(255,215,0,0.5));
    transition: filter 0.3s;
}
.splash-logo-row img:hover {
    filter: drop-shadow(0 0 18px rgba(255,215,0,0.85));
}

.splash-title {
    font-family: 'Orbitron', monospace;
    font-weight: 900; font-size: 2.5rem;
    color: var(--gold);
    letter-spacing: 0.03em; line-height: 1;
    margin-bottom: 5px;
    text-shadow: 0 0 30px rgba(255,215,0,0.4), 0 0 60px rgba(255,215,0,0.15);
}

.splash-subtitle {
    font-family: 'Orbitron', monospace;
    font-size: 0.82rem; color: var(--green);
    letter-spacing: 0.16em; margin-bottom: 24px;
}

.splash-banner {
    width: 100%; height: 155px; object-fit: cover;
    border-radius: 2px; border: 1px solid var(--border);
    margin-bottom: 24px;
    filter: brightness(0.82) saturate(1.15) contrast(1.05);
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

.splash-desc {
    font-size: 0.90rem; color: var(--text-dim);
    line-height: 1.7; margin-bottom: 26px;
}

/* ── Registration ──────────────────────────────────────────────────────────── */
#overlay-registration .card h2,
#overlay-briefing .card h2 {
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem; color: var(--gold);
    margin-bottom: 24px; letter-spacing: 0.07em;
}

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-family: 'Orbitron', monospace;
    font-size: 0.72rem; color: var(--text-dim);
    letter-spacing: 0.12em; margin-bottom: 6px;
    text-transform: uppercase;
}

.form-group input {
    width: 100%;
    background: #040c04; border: 1px solid var(--green-dim);
    border-radius: 2px; padding: 10px 14px;
    color: var(--green); font-family: 'Share Tech Mono', monospace;
    font-size: 1.05rem; outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
    caret-color: var(--gold);
}

.form-group input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(255,215,0,0.12), 0 0 12px rgba(255,215,0,0.05);
}

.form-group input::placeholder { color: #2a4a2a; }

/* ── Briefing ──────────────────────────────────────────────────────────────── */
.briefing-img {
    width: 100%; height: 120px; object-fit: cover;
    border: 1px solid var(--border); border-radius: 2px;
    margin-bottom: 16px; filter: brightness(0.78) saturate(0.9);
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.briefing-rules {
    list-style: none; margin-bottom: 18px;
    border: 1px solid var(--border-dim);
    border-radius: 2px; overflow: hidden;
}

.briefing-rules li {
    padding: 6px 10px; color: var(--text-main);
    font-size: 0.88rem; border-bottom: 1px solid var(--border-dim);
    transition: background 0.12s;
}
.briefing-rules li:last-child { border-bottom: none; }
.briefing-rules li:hover { background: rgba(74,222,128,0.04); }
.briefing-rules li::before { content: '▶  '; color: var(--gold); }

.freq-badge {
    display: inline-block;
    background: var(--green-dark); border: 1px solid var(--green-dim);
    border-radius: 2px; padding: 6px 18px;
    font-family: 'Share Tech Mono', monospace;
    color: var(--green); font-size: 0.95rem;
    margin: 8px 0 16px; letter-spacing: 0.1em;
    box-shadow: 0 0 8px rgba(74,222,128,0.1) inset;
}

/* ── Fox found flash ───────────────────────────────────────────────────────── */
#fox-found-flash {
    position: fixed; top: 58px; left: 50%;
    transform: translateX(-50%) translateY(-16px);
    z-index: 200; pointer-events: none;
    opacity: 0; transition: opacity 0.22s, transform 0.22s;
}

#fox-found-flash.show {
    opacity: 1; transform: translateX(-50%) translateY(0);
}

#fox-found-flash.hidden { display: none; }

.fox-found-inner {
    background: rgba(3,10,3,0.97);
    border: 2px solid var(--gold);
    border-radius: 3px; padding: 18px 38px;
    text-align: center;
    box-shadow: 0 0 0 1px rgba(255,215,0,0.1) inset,
                0 0 30px rgba(255,215,0,0.25),
                0 8px 32px rgba(0,0,0,0.5);
    min-width: 250px;
}

.fox-found-icon  { font-size: 2.4rem; margin-bottom: 4px; animation: bounceIn 0.3s both; }
.fox-found-code  {
    font-family: 'Orbitron', monospace;
    font-size: 1.65rem; font-weight: 700; letter-spacing: 0.15em;
}
.fox-found-morse {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.1rem; color: var(--green);
    margin: 4px 0; letter-spacing: 0.22em;
}
.fox-found-msg {
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem; color: var(--gold); letter-spacing: 0.22em; margin-top: 5px;
}

@keyframes bounceIn {
    0%   { transform: scale(0.4); }
    60%  { transform: scale(1.2); }
    100% { transform: scale(1);   }
}

/* ── Finished / all-found ─────────────────────────────────────────────────── */
#overlay-finished .card { text-align: center; }
#overlay-finished h2 {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem; color: var(--gold); margin-bottom: 12px;
}

/* ── Certificate overlay ───────────────────────────────────────────────────── */
#overlay-certificate {
    overflow-y: auto; align-items: flex-start; padding: 24px 0;
}

#overlay-certificate .card { max-width: 960px; padding: 22px; }

#cert-canvas {
    width: 100%; display: block;
    border: 1px solid var(--border); border-radius: 2px; margin-bottom: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.6);
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: 'Orbitron', monospace; font-weight: 700;
    font-size: 0.85rem; letter-spacing: 0.12em;
    padding: 11px 26px; border: 1.5px solid; border-radius: 2px;
    cursor: pointer; background: transparent; text-transform: uppercase;
    transition: background 0.14s, color 0.14s, box-shadow 0.14s, transform 0.1s;
    position: relative; overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 60%);
    pointer-events: none;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    border-color: var(--gold); color: var(--gold);
}
.btn-primary:hover {
    background: var(--gold); color: #040c04;
    box-shadow: 0 0 20px rgba(255,215,0,0.35), 0 0 40px rgba(255,215,0,0.1);
}

.btn-green {
    border-color: var(--green); color: var(--green);
}
.btn-green:hover {
    background: var(--green); color: #040c04;
    box-shadow: 0 0 20px rgba(74,222,128,0.3);
}

.btn-row {
    display: flex; gap: 12px; justify-content: center;
    flex-wrap: wrap; margin-top: 18px;
}

/* ── Utility ───────────────────────────────────────────────────────────────── */
.text-gold   { color: var(--gold);   }
.text-green  { color: var(--green);  }
.text-dim    { color: var(--text-dim); }
.mt-12 { margin-top: 12px; }
.mb-8  { margin-bottom: 8px; }
.center { text-align: center; }

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar        { width: 5px; }
::-webkit-scrollbar-track  { background: var(--bg); }
::-webkit-scrollbar-thumb  { background: var(--green-dim); border-radius: 3px; }

/* ── Mobile / small screens ────────────────────────────────────────────────── */
@media (max-width: 700px) {
    .card { padding: 24px 18px; }
    .splash-title { font-size: 1.6rem; }
    .splash-banner { height: 100px; }
}
