/* ============================================================
   Scouting Post — visual system
   Following the shared pattern: cool slate panels, IBM Plex Sans
   body / Fraunces display / JetBrains Mono data-labels, a
   colorblind-safe blue/purple/orange/teal/red accent family, and
   a soft blurred backdrop behind everything.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=IBM+Plex+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700;800&display=swap');

:root{
    --bg: #0e1420;
    --panel: #1a2233;
    --panel-alt: #212a3f;
    --panel-raise: #283249;
    --input-bg: #2c3854;
    --border: #3a4863;
    --border-soft: #283349;
    --border-light: #56698c;
    --text: #f4f7fc;
    --text-dim: #b7c2d6;
    --text-faint: #7c88a3;

    --blue: #6ea8fe;
    --blue-soft: #223252;
    --purple: #b389f9;
    --purple-soft: #2c2650;
    --orange: #ff9f45;
    --orange-soft: #3a2a1a;
    --teal: #4fd1c0;
    --teal-soft: #163531;
    --red: #ff7a7a;
    --red-soft: #3a1f22;

    --radius: 14px;
    --radius-sm: 10px;
    --fs-base: 16px;

    --font-display: 'Fraunces', serif;
    --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

*{ box-sizing: border-box; }
html, body{ margin: 0; padding: 0; }
body{
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: 1.5;
    min-height: 100vh;
    position: relative;
}

/* Soft blurred backdrop, generated entirely in CSS. */
body::before{
    content: "";
    position: fixed;
    inset: -12%;
    z-index: -2;
    background:
        linear-gradient(135deg, rgba(120,50,28,0.4) 0%, transparent 42%, rgba(50,20,14,0.45) 100%),
        radial-gradient(ellipse 58% 48% at 10% 6%, rgba(158,74,42,0.58), transparent 62%),
        radial-gradient(ellipse 50% 42% at 90% 10%, rgba(120,42,32,0.52), transparent 60%),
        radial-gradient(ellipse 46% 40% at 78% 4%, rgba(168,128,60,0.16), transparent 55%),
        radial-gradient(ellipse 68% 58% at 50% 94%, rgba(78,28,20,0.6), transparent 65%),
        radial-gradient(ellipse 48% 48% at 94% 90%, rgba(96,28,38,0.46), transparent 60%),
        radial-gradient(ellipse 42% 42% at 4% 92%, rgba(86,44,22,0.4), transparent 60%),
        linear-gradient(150deg, #1c0f0a 0%, #170e0a 45%, #120c0b 100%);
    filter: blur(80px) saturate(122%);
}
body::after{
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.06;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
::selection{ background: var(--blue); color: #0e1420; }
a{ color: var(--blue); text-decoration: none; }
a:hover{ color: var(--teal); }
button{ font-family: inherit; }

.site-shell{ min-height: 100vh; display: flex; flex-direction: column; }

/* ---------------- Top banner ---------------- */
.site-banner{
    padding: 20px 20px 22px;
    text-align: center;
    border-bottom: 1px solid var(--border-soft);
}

/* Big, unmissable navigation row: Back to Main Page (left) + Back to
   Tools Overview (right). Present on every page via includes/header.php. */
.top-nav{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin: 0 0 22px;
    text-align: left;
}
.top-nav .nav-left, .top-nav .nav-right{ display: flex; align-items: center; }

.big-btn{
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: .01em;
    padding: 16px 26px;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    background: var(--panel-alt);
    color: var(--text);
    text-decoration: none;
    box-shadow: 0 10px 26px rgba(0,0,0,0.32);
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}
.big-btn:hover{ transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0,0,0,0.4); }
.big-btn .emoji{ font-size: 24px; line-height: 1; }
.big-btn-blue{ border-color: var(--blue); color: var(--blue); }
.big-btn-blue:hover{ background: var(--blue-soft); color: var(--blue); }
.big-btn-purple{ border-color: var(--purple); color: var(--purple); }
.big-btn-purple:hover{ background: var(--purple-soft); color: var(--purple); }
.big-btn-teal{ border-color: var(--teal); color: var(--teal); }
.big-btn-teal:hover{ background: var(--teal-soft); color: var(--teal); }

@media (max-width: 640px){
    .big-btn{ font-size: 14.5px; padding: 14px 18px; }
    .big-btn .emoji{ font-size: 20px; }
}

.site-banner .eyebrow{
    font-family: var(--font-mono);
    font-size: 12.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--blue);
    font-weight: 700;
    margin: 0 0 8px;
}
.site-banner h1{
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(26px, 4vw, 34px);
    margin: 0;
    color: var(--text);
}
.site-banner .crumb{ margin-top: 12px; }
.back-link{
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 13.5px;
    font-weight: 600;
    transition: color .15s ease;
}
.back-link:hover{ color: var(--blue); }

.site-main{
    flex: 1;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 36px 20px 60px;
}

.site-footer{
    text-align: center;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: .05em;
    color: var(--text-faint);
    padding: 18px;
    border-top: 1px solid var(--border-soft);
}

/* ---------------- Panels / cards ---------------- */
.panel{
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 28px rgba(0,0,0,0.35);
}
.panel-pad{ padding: 24px; }

.section-title{
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text);
    font-size: 22px;
    margin: 0 0 4px;
}
.section-sub{
    color: var(--text-dim);
    font-size: 14px;
    margin: 0 0 22px;
}

/* ---------------- Landing page ---------------- */
.landing-grid{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 10px 0 40px;
}
@media (max-width: 780px){ .landing-grid{ grid-template-columns: 1fr; } }

.plaque{
    display: block;
    position: relative;
    background: var(--panel);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 22px 24px;
    text-align: center;
    box-shadow: 0 8px 28px rgba(0,0,0,0.35);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.plaque:hover{
    transform: translateY(-3px);
    border-color: var(--blue);
    box-shadow: 0 16px 40px -10px rgba(0,0,0,0.55);
}
.plaque .glyph{
    width: 46px; height: 46px;
    margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--blue-soft);
    border: 1px solid var(--border);
    color: var(--blue);
}
.plaque .glyph svg{ width: 22px; height: 22px; }
.plaque h2{
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 19px;
    color: var(--text);
    margin: 0 0 8px;
}
.plaque p{ font-size: 13.5px; color: var(--text-dim); margin: 0; }
.plaque .eyebrow-num{
    position: absolute;
    top: 14px; right: 16px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-faint);
}

.admin-row{ text-align: center; }
.admin-link{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    letter-spacing: .05em;
    color: var(--text-dim);
    border: 1px solid var(--border);
    background: var(--panel-alt);
    padding: 9px 18px;
    border-radius: 100px;
    transition: all .15s ease;
}
.admin-link:hover{ color: var(--purple); border-color: var(--purple); }
.admin-link .dot{
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--purple);
    display: inline-block;
}

/* ---------------- Forms ---------------- */
.field{ margin-bottom: 20px; }
.field label{
    display: block;
    font-family: var(--font-mono);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-faint);
    font-weight: 700;
    margin-bottom: 7px;
}
.field .hint{ font-size: 12px; color: var(--text-faint); margin-top: 6px; }

input[type=text], input[type=password], input[type=search], select, textarea{
    width: 100%;
    font-family: var(--font-body);
    font-size: 15px;
    padding: 11px 13px;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
}
input::placeholder{ color: var(--text-faint); }
input:focus, select:focus, textarea:focus{
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 25%, transparent);
}
input[readonly]{ background: var(--panel-alt); color: var(--text-dim); }
.readout{
    padding: 11px 13px;
    border: 1.5px dashed var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--panel-alt);
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text-dim);
}

.field-row{ display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px){ .field-row{ grid-template-columns: 1fr; } }

.autocomplete{ position: relative; }
.autocomplete-results{
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: var(--panel-raise);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 16px 40px -10px rgba(0,0,0,0.55);
    max-height: 240px;
    overflow-y: auto;
    z-index: 30;
    display: none;
}
.autocomplete-results.open{ display: block; }
.autocomplete-results .opt{
    padding: 9px 13px;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-soft);
}
.autocomplete-results .opt:last-child{ border-bottom: none; }
.autocomplete-results .opt:hover,
.autocomplete-results .opt.active{ background: var(--blue-soft); }
.autocomplete-results .opt .muted{ color: var(--text-faint); font-size: 12px; }

.divider-name{
    margin: 30px 0 22px;
    padding-top: 20px;
    border-top: 1.5px dashed var(--border-light);
}
.divider-name .badge{
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    font-weight: 700;
    background: var(--purple-soft);
    color: var(--purple);
    padding: 4px 12px;
    border-radius: 100px;
    margin-bottom: 10px;
}

/* ---------------- Buttons ---------------- */
.btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 14.5px;
    letter-spacing: .01em;
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    text-decoration: none;
    transition: all .12s ease;
}
.btn-primary{ background: var(--blue); border-color: var(--blue); color: #0e1420; }
.btn-primary:hover{ filter: brightness(1.08); color: #0e1420; }
.btn-teal{ background: var(--teal); border-color: var(--teal); color: #0e1420; }
.btn-teal:hover{ filter: brightness(1.08); color: #0e1420; }
.btn-ghost{ background: var(--panel-alt); border-color: var(--border); color: var(--text-dim); }
.btn-ghost:hover{ border-color: var(--blue); color: var(--blue); }
.btn-danger{ background: var(--red); border-color: var(--red); color: #1a0f0c; }
.btn-danger:hover{ filter: brightness(1.08); }
.btn:disabled{ opacity: .5; cursor: not-allowed; filter: none; }
.btn-block{ width: 100%; }
.btn-lg{ padding: 16px 30px; font-size: 16px; border-radius: var(--radius); }

.icon-btn{
    width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: var(--panel-alt); color: var(--text-dim); cursor: pointer; font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center; transition: all .15s ease;
}
.icon-btn:hover{ border-color: var(--blue); color: var(--blue); }
.icon-btn.danger{ background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 45%, var(--border)); color: var(--red); }
.icon-btn.danger:hover{ background: var(--red); border-color: var(--red); color: #0e1420; }

/* Instant CSS tooltip */
.tt{ position: relative; }
.tt::after{
    content: attr(data-tip);
    position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%);
    background: var(--panel-raise); color: var(--text); font-family: var(--font-body);
    font-size: 12px; font-weight: 600; white-space: nowrap; padding: 5px 9px; border-radius: 7px;
    border: 1px solid var(--border); pointer-events: none; opacity: 0; visibility: hidden;
    transition: opacity .05s ease; z-index: 30;
}
.tt::before{
    content: ""; position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%);
    border: 5px solid transparent; border-top-color: var(--panel-raise);
    opacity: 0; visibility: hidden; transition: opacity .05s ease; z-index: 30;
}
.tt:hover::after, .tt:hover::before{ opacity: 1; visibility: visible; }

/* ---------------- Lists / request cards ---------------- */
.list-toolbar{
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 18px; flex-wrap: wrap; gap: 10px;
}
.count-pill{
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-dim);
    border: 1px solid var(--border);
    background: var(--panel-alt);
    padding: 4px 12px;
    border-radius: 100px;
}

.req-card{
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 14px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.3);
    position: relative;
}
.req-card.fulfilled{ opacity: .82; }
.req-card .top-row{
    display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap;
}
.req-card .village-link{
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--blue);
}
.req-card .village-link:hover{ color: var(--teal); }
.req-card .coords{
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-faint);
    margin-left: 8px;
}
.req-card .meta{
    display: flex; flex-wrap: wrap; gap: 14px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-dim);
}
.req-card .meta strong{ color: var(--text); }
.req-card .time-ago{
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-faint);
    white-space: nowrap;
}
.req-card .actions{ margin-top: 14px; }

.status-tag{
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 100px;
}
.status-open{ background: var(--blue-soft); color: var(--blue); }
.status-fulfilled{ background: var(--teal-soft); color: var(--teal); }

.empty-state{ text-align: center; padding: 60px 20px; color: var(--text-faint); }
.empty-state .glyph{ font-size: 34px; margin-bottom: 10px; }

/* ---------------- Scouted badge (signature element) ---------------- */
.scouted-badge{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    background: var(--teal-soft);
    color: var(--teal);
    border: 1px solid color-mix(in srgb, var(--teal) 45%, transparent);
    font-family: var(--font-mono);
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 9px 16px;
    border-radius: 100px;
}

/* Bigger, easier-to-scan layout for the "Finished intel" reports list:
   info on the left, one unmissable "View Report" button on the right. */
.report-card{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    flex-wrap: wrap;
}
.report-card-main{ flex: 1; min-width: 260px; }
.report-card-head{
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.village-link-lg{
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 24px;
    color: var(--blue);
}
.village-link-lg:hover{ color: var(--teal); }
.coords-lg{
    font-family: var(--font-mono);
    font-size: 15px;
    color: var(--text-faint);
}
.meta-lg{
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 15px;
    color: var(--text-dim);
    margin-bottom: 12px;
}
.meta-lg strong{ color: var(--text); font-size: 15.5px; }
.time-ago-lg{
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dim);
    background: var(--panel-alt);
    border: 1px solid var(--border);
    display: inline-block;
    padding: 6px 14px;
    border-radius: 100px;
}
.report-card-cta{ flex-shrink: 0; }

/* ---------------- Screenshot / paste zone ---------------- */
.paste-zone{
    border: 1.5px dashed var(--blue);
    border-radius: var(--radius);
    padding: 34px 20px;
    text-align: center;
    background: var(--blue-soft);
    color: var(--text-dim);
    cursor: text;
    transition: border-color .15s ease, background .15s ease;
}
.paste-zone:focus, .paste-zone.focused{
    outline: none;
    border-color: var(--teal);
    background: var(--teal-soft);
}
.paste-zone .glyph{ font-size: 26px; margin-bottom: 8px; display: block; }
.paste-zone .kbd{
    font-family: var(--font-mono);
    background: var(--panel);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 12px;
    color: var(--text);
}
.paste-preview{
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: none;
    background: var(--panel-alt);
}
.paste-preview img{ display: block; width: 100%; height: auto; }
.paste-preview.has-image{ display: block; }

.report-image-wrap{
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--panel-alt);
}
.report-image-wrap img{ display: block; width: 100%; height: auto; }

/* ---------------- Modal (confirmation) ---------------- */
.modal-backdrop{
    display: none;
    position: fixed; inset: 0;
    background: rgba(8, 10, 16, 0.65);
    align-items: center; justify-content: center;
    z-index: 100;
    padding: 20px;
}
.modal-backdrop.open{ display: flex; }
.modal{
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 440px;
    width: 100%;
    padding: 26px;
    box-shadow: 0 24px 70px rgba(0,0,0,0.55);
}
.modal h3{
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text);
    margin: 0 0 10px;
    font-size: 19px;
}
.modal p{ font-size: 13.5px; color: var(--text-dim); margin: 0 0 18px; }
.modal .modal-actions{ display: flex; gap: 10px; margin-top: 20px; }
.modal .modal-actions .btn{ flex: 1; }

.alert{
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}
.alert-error{ background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 40%, transparent); color: var(--red); }
.alert-success{ background: var(--teal-soft); border-color: color-mix(in srgb, var(--teal) 40%, transparent); color: var(--teal); }

/* ---------------- Admin ---------------- */
.admin-badge{
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--purple);
    background: var(--purple-soft);
    padding: 3px 10px;
    border-radius: 100px;
}
table.admin-table{ width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.admin-table th, table.admin-table td{
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-soft);
}
table.admin-table th{
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 700;
    color: var(--text-faint);
    border-bottom: 1px solid var(--border);
}
table.admin-table tr:hover td{ background: var(--panel-alt); }

.login-wrap{ max-width: 380px; margin: 40px auto; }

.small-print{ font-size: 12px; color: var(--text-faint); margin-top: 10px; }
