/* =========================================================
   CARD COMMISSARY — Collector's Co-op
   Socialist / USSR-inspired dark theme. Deep crimson, blood,
   black, and a touch of gold. Mobile-first, fluid, TV-ready.
   ========================================================= */

:root {
    /* Backgrounds: black with a smoky burgundy core */
    --bg-0: #0a0405;
    --bg-1: #110608;
    --bg-2: #18090c;
    --bg-3: #220c10;
    --line: rgba(255, 80, 80, 0.10);
    --line-strong: rgba(255, 80, 80, 0.22);

    --text:        #f3e9e7;
    --text-muted:  #b9a8a4;
    --text-dim:    #8c7a76;

    /* The "cyan" slot is now Soviet red. Variable name kept on purpose
       so we don't churn every view — the role is "primary accent". */
    --cyan:        #e23b3b;
    --cyan-soft:   #e23b3b33;
    /* The "gold" slot stays gold (hammer-and-sickle, star). */
    --gold:        #f4c451;
    --gold-soft:   #f4c45133;
    --rose:        #ff7a8c;
    --green:       #6cbf6a;
    --red:         #ff5a5a;

    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 16px;

    --shadow-1: 0 1px 2px rgba(0,0,0,.6), 0 8px 24px rgba(140,12,12,.20);
    --shadow-2: 0 1px 2px rgba(0,0,0,.6), 0 24px 60px rgba(160,20,20,.30);

    --gradient-brand: linear-gradient(135deg, #ff4747 0%, #c10b0b 50%, #f4c451 100%);
    --gradient-soft:  linear-gradient(135deg, rgba(226,59,59,.18), rgba(244,196,81,.10));
    --gradient-card:  linear-gradient(160deg, rgba(255,80,80,.05), rgba(255,255,255,.01));

    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

/* Fluid type scale: clamp keeps everything tasteful at any viewport */
html {
    font-size: clamp(14px, 0.85vw + 12px, 18px);
}

html, body {
    background: var(--bg-0);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(1100px 700px at 90% -10%, rgba(193,11,11,.22), transparent 60%),
        radial-gradient(900px 600px at -10% 10%, rgba(226,59,59,.16), transparent 55%),
        radial-gradient(700px 500px at 50% 110%, rgba(244,196,81,.06), transparent 60%),
        var(--bg-0);
    background-attachment: fixed;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; }

a { color: var(--cyan); text-decoration: none; transition: color .2s ease; }
a:hover { color: #ff6b6b; }

h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); letter-spacing: -.01em; color: var(--text); }
h1 { font-weight: 700; line-height: 1.05; }

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: .78rem;
    color: var(--cyan);
    font-weight: 600;
}

/* Cap content width on big monitors / TVs so lines don't get unreadable */
.container, .container-xxl, .container-xl, .container-lg {
    max-width: min(100%, 1480px);
}
@media (min-width: 1600px) {
    .container, .container-xxl { max-width: 1560px; }
}
@media (min-width: 1920px) {
    .container, .container-xxl { max-width: 1680px; }
}

/* ---------- Utilities ---------- */
.text-muted-2 { color: var(--text-muted) !important; }
.text-dim     { color: var(--text-dim) !important; }
.gradient-text {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.section { padding: clamp(48px, 9vw, 120px) 0; position: relative; }
.section--tight { padding: clamp(32px, 6vw, 80px) 0; }
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
    border: none;
}
.min-width-0 { min-width: 0; }

/* ============== Navbar ============== */
.app-nav {
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(7, 9, 15, 0.55);
    border-bottom: 1px solid var(--line);
    transition: background .3s ease, border-color .3s ease;
    padding-top: .35rem;
    padding-bottom: .35rem;
}
.app-nav.is-scrolled {
    background: rgba(10, 4, 5, 0.94);
    border-bottom-color: var(--line-strong);
}
.app-nav .navbar-brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin-right: 0;
    white-space: nowrap;
}
.brand-name {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #000 url("/img/brand/commissary-logo.png") center/contain no-repeat;
    color: transparent;          /* hide the letter inside, image takes over */
    font-size: 0;                /* keep layout but hide character */
    font-weight: 800;
    font-family: var(--font-display);
    box-shadow: 0 6px 22px rgba(193,11,11,.45), inset 0 0 0 1px rgba(244,196,81,.35);
    flex: none;
    position: relative;
    overflow: hidden;
}
/* Larger brand mark used on auth/hero cards */
.brand-mark.brand-mark--lg {
    width: 64px;
    height: 64px;
    border-radius: 12px;
}
/* Soviet star fallback if the image fails to load.
   The element's text content gets hidden either way; if the bg image is missing
   the solid black + star looks intentional, not broken. */
.brand-mark::after {
    content: "★";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f4c451;
    font-size: 18px;
    line-height: 1;
    text-shadow: 0 1px 0 rgba(0,0,0,.6);
    pointer-events: none;
    opacity: 0;          /* image covers it; visible only if image fails */
}
.brand-mark:not([style*="background-image"]):empty::after { opacity: .92; }

.app-nav .nav-link {
    color: var(--text-muted);
    font-weight: 500;
    padding: .55rem .8rem;
    border-radius: 8px;
    position: relative;
    white-space: nowrap;
}
.app-nav .nav-link:hover,
.app-nav .nav-link.active { color: var(--text); background: rgba(255,255,255,.04); }

.app-nav .dropdown-menu {
    background: rgba(11,15,26,.97);
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    box-shadow: var(--shadow-2);
    padding: 6px 0;
    min-width: 220px;
}
.app-nav .dropdown-item {
    color: var(--text-muted);
    padding: .5rem .9rem;
    font-size: .92rem;
}
.app-nav .dropdown-item:hover,
.app-nav .dropdown-item:focus {
    background: rgba(255,255,255,.06);
    color: var(--text);
}
.app-nav .dropdown-divider { border-color: var(--line); margin: 6px 0; }

.navbar-toggler { padding: .35rem .55rem; }
.navbar-toggler:focus { box-shadow: 0 0 0 3px rgba(54,225,255,.25); }

.nav-actions { gap: .5rem; }

/* When the nav is collapsed (below xl), make the dropdown items inline-friendly */
@media (max-width: 1199.98px) {
    .app-nav .navbar-collapse {
        margin-top: .75rem;
        padding: 12px 4px 16px;
        border-top: 1px solid var(--line);
    }
    .app-nav .navbar-nav .nav-link {
        padding: .7rem .9rem;
    }
    .app-nav .dropdown-menu {
        background: transparent;
        border: none;
        box-shadow: none;
        padding-left: .6rem;
    }
    .app-nav .dropdown-item { padding: .55rem .9rem; }
    .nav-actions { width: 100%; padding-top: 8px; border-top: 1px solid var(--line); margin-top: 8px; }
}

/* ============== Buttons ============== */
.btn {
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: .01em;
    padding: .6rem 1.1rem;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
    border: 1px solid transparent;
    min-height: 40px; /* touch target */
}
.btn-sm { min-height: 34px; padding: .35rem .8rem; }
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--gradient-brand);
    color: #07090f;
    border: none;
    box-shadow: 0 8px 24px rgba(54,225,255,.25);
}
.btn-primary:hover { color: #07090f; transform: translateY(-1px); box-shadow: 0 14px 36px rgba(54,225,255,.35); }
.btn-primary:focus { color: #07090f; }

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line-strong);
}
.btn-ghost:hover { background: rgba(255,255,255,.05); color: var(--text); border-color: rgba(255,255,255,.28); }

.btn-soft {
    background: rgba(54,225,255,.10);
    color: var(--cyan);
    border: 1px solid rgba(54,225,255,.25);
}
.btn-soft:hover { background: rgba(54,225,255,.18); color: var(--cyan); }

.btn-icon { display: inline-flex; align-items: center; gap: .5rem; }

.btn--ripple { position: relative; overflow: hidden; }
.btn--ripple .ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple .6s linear;
    background: rgba(255,255,255,.4);
    pointer-events: none;
}
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ============== Forms ============== */
.form-control, .form-select {
    background: rgba(255,255,255,.04);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: .7rem .9rem;
    transition: border-color .2s, box-shadow .2s, background .2s;
    min-height: 42px; /* touch target */
}
.form-control:focus, .form-select:focus {
    background: rgba(255,255,255,.06);
    color: var(--text);
    border-color: rgba(54,225,255,.55);
    box-shadow: 0 0 0 4px rgba(54,225,255,.15);
}
.form-control::placeholder { color: var(--text-dim); }
.form-label { color: var(--text-muted); font-weight: 500; }
.form-check-input {
    background-color: rgba(255,255,255,.06);
    border-color: var(--line-strong);
    width: 1.2em; height: 1.2em;
}
.form-check-input:checked {
    background-color: var(--cyan);
    border-color: var(--cyan);
}
.form-check-label { color: var(--text-muted); }
.form-floating > label { color: var(--text-dim); }

/* ============== Surfaces / Cards ============== */
.surface {
    background: var(--gradient-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.surface-strong {
    background:
        linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.015)),
        rgba(11, 15, 26, .6);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
}

.feature-card {
    padding: 1.4rem;
    border-radius: var(--radius);
    background: var(--gradient-card);
    border: 1px solid var(--line);
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}
.feature-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(420px 220px at var(--mx,50%) var(--my,0%), rgba(54,225,255,.10), transparent 60%);
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
}
.feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(54,225,255,.35);
    box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.feature-card:hover::before { opacity: 1; }
.feature-card .icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--gradient-soft);
    border: 1px solid var(--line-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--cyan);
    margin-bottom: 1rem;
}
.feature-card h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.feature-card p  { color: var(--text-muted); margin: 0; font-size: .95rem; }

.stat {
    text-align: center;
    padding: 1rem .75rem;
    border-radius: var(--radius);
    background: rgba(255,255,255,.02);
    border: 1px solid var(--line);
}
.stat .num {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    font-weight: 700;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
}
.stat .label { color: var(--text-muted); font-size: .85rem; margin-top: .35rem; }

/* ============== Hero ============== */
.hero {
    position: relative;
    padding: clamp(48px, 10vw, 140px) 0 clamp(36px, 7vw, 96px);
    overflow: hidden;
}
.hero .badge-pill {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .75rem;
    border-radius: 999px;
    background: rgba(54,225,255,.10);
    border: 1px solid rgba(54,225,255,.25);
    color: var(--cyan);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .04em;
}
.hero h1 {
    font-size: clamp(2rem, 5.6vw, 4.4rem);
    margin: 1rem 0 1rem;
}
.hero p.lead {
    font-size: clamp(1rem, 1.3vw, 1.18rem);
    color: var(--text-muted);
    max-width: 60ch;
}
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .55;
    pointer-events: none;
    animation: float 12s ease-in-out infinite;
}
.hero-orb.a { width: 420px; height: 420px; background: #c10b0b; top: -120px; right: -100px; }
.hero-orb.b { width: 360px; height: 360px; background: #f4c451; bottom: -150px; left: -120px; animation-delay: -4s; }
.hero-orb.c { width: 280px; height: 280px; background: #ff4747; top: 30%;     right: 30%;   animation-delay: -8s; opacity: .35; }
@keyframes float {
    0%,100% { transform: translateY(0) translateX(0); }
    50%     { transform: translateY(-22px) translateX(12px); }
}

/* Hero floating cards mock */
.floating-stack {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 460px;
}
.floating-card {
    position: absolute;
    width: 220px;
    height: 300px;
    border-radius: 18px;
    padding: 14px;
    background:
        linear-gradient(160deg, rgba(255,255,255,.10), rgba(255,255,255,.03)),
        rgba(15, 20, 36, .9);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-2);
    transform: rotate(var(--r,0deg)) translateY(0);
    animation: hover-card 7s ease-in-out infinite;
}
.floating-card .photo {
    height: 60%;
    border-radius: 12px;
    background:
        radial-gradient(120% 80% at 30% 10%, rgba(54,225,255,.45), transparent 60%),
        radial-gradient(120% 80% at 80% 90%, rgba(246,195,74,.55), transparent 60%),
        #1a2238;
    border: 1px solid var(--line-strong);
}
.floating-card .meta { margin-top: 12px; }
.floating-card .meta .name { font-weight: 700; }
.floating-card .meta .num  { color: var(--text-dim); font-size: .85rem; }
.floating-card .chip {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    background: rgba(54,225,255,.18);
    color: var(--cyan);
    border: 1px solid rgba(54,225,255,.35);
    letter-spacing: .04em;
    text-transform: uppercase;
}
.floating-card.gold .chip { background: rgba(246,195,74,.18); color: var(--gold); border-color: rgba(246,195,74,.4); }
.floating-card.rose .chip { background: rgba(255,93,143,.18); color: var(--rose); border-color: rgba(255,93,143,.4); }

.floating-card.c1 { top:  20px;  left:  20px; --r: -8deg; animation-delay:  0s; }
.floating-card.c2 { top:  60px;  left: 200px; --r:  4deg; animation-delay: -2s; }
.floating-card.c3 { top: 200px;  left: 110px; --r: -3deg; animation-delay: -4s; }

@keyframes hover-card {
    0%,100% { transform: rotate(var(--r,0deg)) translateY(0); }
    50%     { transform: rotate(var(--r,0deg)) translateY(-14px); }
}

/* ============== Auth pages ============== */
.auth-shell {
    min-height: calc(100vh - 80px);
    display: grid;
    place-items: center;
    padding: 40px 16px;
}
.auth-card {
    width: 100%;
    max-width: 460px;
    padding: clamp(24px, 4vw, 36px) clamp(20px, 3vw, 32px);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(160deg, rgba(255,255,255,.05), rgba(255,255,255,.01)),
        rgba(11, 15, 26, .75);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-2);
    position: relative;
    overflow: hidden;
}
.auth-card::before {
    content: "";
    position: absolute; inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: var(--gradient-brand);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: .35;
    pointer-events: none;
}
.auth-card h1 { font-size: clamp(1.4rem, 3vw, 1.7rem); margin-bottom: .25rem; }
.auth-card .lead { color: var(--text-muted); margin-bottom: 1.4rem; }

/* ============== Footer ============== */
.app-footer {
    border-top: 1px solid var(--line);
    padding: clamp(32px, 5vw, 50px) 0 30px;
    color: var(--text-muted);
    background: rgba(0,0,0,.25);
}
.app-footer h6 { color: var(--text); letter-spacing: .04em; text-transform: uppercase; font-size: .8rem; }
.app-footer a { color: var(--text-muted); }
.app-footer a:hover { color: var(--text); }

/* ============== Scroll reveal ============== */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .8s ease, transform .8s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ============== Validation ============== */
.text-danger, .field-validation-error {
    color: var(--red) !important;
    font-size: .88rem;
}
.validation-summary-errors ul { padding-left: 1.1rem; }

/* ============== Toast ============== */
.toast-host {
    position: fixed;
    z-index: 1080;
    right: 16px;
    top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: calc(100vw - 32px);
}
.toast-msg {
    pointer-events: auto;
    background: rgba(11,15,26,.95);
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--text);
    box-shadow: var(--shadow-2);
    transform: translateY(-8px);
    opacity: 0;
    animation: toast-in .25s ease forwards;
    min-width: 240px;
    max-width: 100%;
}
.toast-msg.success { border-color: rgba(54,212,138,.45); }
.toast-msg.error   { border-color: rgba(255,90,106,.45); }
@keyframes toast-in { to { opacity: 1; transform: translateY(0); } }

/* ============== Page title ============== */
.page-title { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.page-title h1 { margin: 0; }
.page-title .lead { color: var(--text-muted); margin: .25rem 0 0; }
@media (max-width: 575.98px) {
    .page-title { align-items: stretch; }
    .page-title h1 { font-size: 1.5rem; }
}

/* ============== Set browse cards ============== */
.set-card {
    display: block;
    color: var(--text);
    text-decoration: none;
    overflow: hidden;
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
    border-radius: var(--radius);
}
.set-card:hover {
    transform: translateY(-3px);
    color: var(--text);
    border-color: rgba(54,225,255,.35);
    box-shadow: 0 18px 50px rgba(0,0,0,.45);
}
.set-card__image {
    position: relative;
    aspect-ratio: 4/3;
    background: var(--gradient-soft);
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}
.set-card__image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.set-card__placeholder {
    width: 100%; height: 100%;
    display: grid; place-items: center;
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    color: rgba(255,255,255,.45);
}
.set-card__body { padding: 14px 16px 16px; }
.set-card__body h3 { font-size: 1.05rem; margin: .35rem 0 .25rem; }

/* ============== Shared table + tag + empty-state ============== */
.table-card {
    background: var(--gradient-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
table.app-table { width: 100%; border-collapse: collapse; }
table.app-table th,
table.app-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}
table.app-table th {
    background: rgba(255,255,255,.02);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    font-weight: 600;
}
table.app-table tr:last-child td { border-bottom: none; }
table.app-table tbody tr { transition: background .12s ease; }
table.app-table tbody tr:hover { background: rgba(255,255,255,.025); }

/* Make tables horizontally scrollable on small screens */
.table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 767.98px) {
    table.app-table th, table.app-table td { padding: 10px; font-size: .9rem; }
    table.app-table { min-width: 640px; }
}

.empty-state { padding: clamp(36px, 6vw, 60px) 20px; text-align: center; color: var(--text-muted); }
.empty-state .icon-wrap {
    width: 64px; height: 64px; border-radius: 16px;
    margin: 0 auto 14px;
    background: var(--gradient-soft);
    display: grid; place-items: center;
    color: var(--cyan);
    border: 1px solid var(--line-strong);
}

.tag {
    display: inline-flex; align-items: center;
    padding: 3px 9px; border-radius: 999px;
    font-size: .75rem;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--line-strong);
    color: var(--text-muted);
}
.tag.success { color: var(--green); border-color: rgba(108,191,106,.4); background: rgba(108,191,106,.1); }
.tag.warn    { color: var(--gold);  border-color: rgba(244,196,81,.4); background: rgba(244,196,81,.1); }
.tag.cyan    { color: var(--cyan);  border-color: rgba(226,59,59,.45); background: rgba(226,59,59,.10); }
.tag.gold    { color: #f4c451;     border-color: rgba(244,196,81,.55); background: linear-gradient(135deg, rgba(244,196,81,.18), rgba(244,196,81,.06)); font-weight: 600; letter-spacing: .02em; }

/* KPI card */
.kpi {
    padding: clamp(12px, 2vw, 18px);
    border-radius: var(--radius);
    background: var(--gradient-card);
    border: 1px solid var(--line);
}
.kpi .label { color: var(--text-muted); font-size: .85rem; }
.kpi .value {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 2.4vw, 1.9rem);
    font-weight: 700;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-top: 4px;
    line-height: 1.1;
}

/* ============== Status pills (Need / Have / Extra) ============== */
.status-pills {
    display: inline-flex;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 2px;
    gap: 2px;
}
.status-pills .pill {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, transform .1s ease;
    min-height: 32px;
}
.status-pills .pill:hover { color: var(--text); }
.status-pills .pill.is-active.need  { background: rgba(255, 90, 106, .18); color: var(--red);   box-shadow: inset 0 0 0 1px rgba(255,90,106,.5); }
.status-pills .pill.is-active.have  { background: rgba(54, 212, 138, .18); color: var(--green); box-shadow: inset 0 0 0 1px rgba(54,212,138,.5); }
.status-pills .pill.is-active.extra { background: rgba(246, 195, 74, .18); color: var(--gold);  box-shadow: inset 0 0 0 1px rgba(246,195,74,.5); }
.status-pills .pill:active { transform: translateY(1px); }

@media (max-width: 575.98px) {
    .status-pills .pill { padding: 6px 10px; font-size: .75rem; }
}

/* tighter table for tracker */
table.app-table.tracker td { padding: 10px 14px; }
table.app-table.tracker tr[data-status="1"] td:nth-child(2) { color: var(--green); }
table.app-table.tracker tr[data-status="2"] td:nth-child(2) { color: var(--gold); }
table.app-table.tracker tr[data-status="0"] td:nth-child(2) { color: var(--text); }

/* ============== Accessibility ============== */
.skip-link {
    position: absolute;
    left: 8px;
    top: -40px;
    z-index: 1090;
    background: var(--cyan);
    color: #07090f;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    transition: top .15s ease;
}
.skip-link:focus { top: 8px; outline: 2px solid var(--gold); outline-offset: 2px; }

:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
    border-radius: 6px;
}

button:focus-visible,
.btn:focus-visible,
a:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

::selection { background: rgba(54,225,255,.30); color: #07090f; }

@media (prefers-reduced-motion: reduce) {
    .hero-orb, .floating-card { animation: none; }
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* =========================================================
   Responsive breakpoints
   ========================================================= */

/* Phones */
@media (max-width: 575.98px) {
    .hero { padding-top: 32px; padding-bottom: 24px; }
    .hero .row { row-gap: 0; }
    .hero h1 { font-size: 2rem; line-height: 1.1; }
    .floating-stack { display: none; } /* keep mobile hero clean */
    .stat .num { font-size: 1.5rem; }
    .stat .label { font-size: .75rem; }
    .feature-card { padding: 1.1rem; }
    .surface, .surface-strong { border-radius: var(--radius); }
    .auth-shell { padding: 24px 12px; min-height: calc(100vh - 64px); }
    .btn { padding: .55rem 1rem; }
}

/* Small tablets */
@media (max-width: 767.98px) {
    .floating-stack { min-height: 320px; }
    .floating-card  { width: 160px; height: 220px; }
    .floating-card.c2 { left: 150px; }
    .floating-card.c3 { left: 80px; top: 150px; }
    .toast-host { right: 12px; left: 12px; top: 12px; }
    .toast-msg { min-width: 0; width: 100%; }
}

/* Large tablets / small laptops */
@media (max-width: 991.98px) {
    .hero h1 { font-size: clamp(2rem, 5vw, 3rem); }
}

/* Cap visual sizes on big monitors */
@media (min-width: 1600px) {
    .hero { padding-top: 120px; padding-bottom: 80px; }
    .floating-card { width: 240px; height: 320px; }
}

/* TV / 4K — keep things readable, prevent stretching */
@media (min-width: 1920px) {
    body { background-attachment: scroll; }
    .hero h1 { font-size: clamp(3.6rem, 4.8vw, 5.4rem); }
    .feature-card { padding: 1.8rem; }
    .feature-card h3 { font-size: 1.25rem; }
}

/* Landscape phones */
@media (max-width: 991.98px) and (orientation: landscape) {
    .auth-shell { min-height: auto; padding: 30px 16px; }
}

/* Print: keep a sensible single-column read */
@media print {
    .app-nav, .app-footer, .toast-host, .skip-link { display: none !important; }
    body { background: #fff; color: #000; }
}


/* ============== Navbar toggler (hamburger) — visible on dark theme ============== */
.app-nav .navbar-toggler {
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    padding: 0;
    width: 44px;
    height: 40px;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, border-color .2s ease, transform .15s ease;
}
.app-nav .navbar-toggler:not([hidden]) { display: inline-flex; }

/* Hide the toggler at xl+ where the full nav fits. This restores Bootstrap's
   .navbar-expand-xl behavior that we accidentally overrode. */
@media (min-width: 1200px) {
    .app-nav .navbar-toggler { display: none !important; }
}
.app-nav .navbar-toggler:hover {
    background: rgba(54, 225, 255, 0.10);
    border-color: rgba(54, 225, 255, 0.45);
}
.app-nav .navbar-toggler:active { transform: scale(0.97); }
.app-nav .navbar-toggler:focus,
.app-nav .navbar-toggler:focus-visible {
    box-shadow: 0 0 0 3px rgba(54, 225, 255, 0.30);
    outline: none;
}

/* Replace Bootstrap's default toggler image (dark-on-dark) with three bright animated bars. */
.app-nav .navbar-toggler-icon {
    width: 22px;
    height: 16px;
    background-image: none;
    position: relative;
    display: inline-block;
}
.app-nav .navbar-toggler-icon::before,
.app-nav .navbar-toggler-icon::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: top .2s ease, bottom .2s ease, transform .25s ease, background .2s ease, opacity .2s ease;
}
.app-nav .navbar-toggler-icon::before { top: 2px; box-shadow: 0 5px 0 var(--text); }
.app-nav .navbar-toggler-icon::after  { bottom: 2px; }

.app-nav .navbar-toggler:hover .navbar-toggler-icon::before { background: var(--cyan); box-shadow: 0 5px 0 var(--cyan); }
.app-nav .navbar-toggler:hover .navbar-toggler-icon::after  { background: var(--cyan); }

/* Open state: morph into an X */
.app-nav .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::before {
    top: 7px;
    box-shadow: none;
    transform: rotate(45deg);
}
.app-nav .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::after {
    bottom: 7px;
    transform: rotate(-45deg);
}


/* Brand should never wrap; on tight screens shorten gracefully */
.app-nav .navbar-brand .brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60vw;
    display: inline-block;
    vertical-align: middle;
}
@media (max-width: 380px) {
    .app-nav .navbar-brand .brand-name { display: none; }
}

/* Floating hero cards: only show when the container is wide enough to give them room.
   At ≥1200 they appear (xl breakpoint), but cap their absolute size so they don't
   overflow the column at 1200–1366 widths. */
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .floating-card { width: 180px; height: 250px; }
    .floating-card.c2 { left: 170px; }
    .floating-card.c3 { left: 90px; top: 170px; }
    .floating-stack { min-height: 380px; }
}


/* ============== Native <select> dropdown options — readable on dark theme ============== */
/* Browsers render the option list using OS-level styling. We override what we can. */
.form-select option,
select option {
    background-color: #1a2238;
    color: var(--text);
    padding: 8px 12px;
}
.form-select option:checked,
select option:checked,
.form-select option:hover,
select option:hover {
    background: linear-gradient(0deg, rgba(54,225,255,.25), rgba(54,225,255,.25)), #1a2238;
    color: var(--text);
}
.form-select option:disabled,
select option:disabled {
    color: var(--text-dim);
}

/* Ensure the closed select itself uses the dark theme caret + colors */
.form-select {
    color-scheme: dark;
    /* override Bootstrap's default white caret to a brighter cyan one */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2336e1ff'%3E%3Cpath d='M8 12L1.5 5.5h13z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px 12px;
    padding-right: 36px;
}

/* Firefox-specific: it respects `color-scheme` natively which fixes the popup. */
@supports (-moz-appearance: none) {
    .form-select option { background-color: #0f1525; }
}

/* Date inputs — match the rest of the form styling and avoid blinding white pickers */
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"] {
    color-scheme: dark;
}


/* ============== SweetAlert2 — branded dark theme ============== */
.swal2-container.swal2-shown { background: rgba(0, 0, 0, .55); }
.scct-swal {
    border: 1px solid var(--line-strong) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-2) !important;
    background:
        linear-gradient(160deg, rgba(255,255,255,.05), rgba(255,255,255,.01)),
        rgba(11, 15, 26, .95) !important;
}
.scct-swal .swal2-title {
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 700;
}
.scct-swal .swal2-html-container { color: var(--text-muted); }
.scct-swal .swal2-icon { border-color: rgba(54,225,255,.5); color: var(--cyan); }
.scct-swal .swal2-icon.swal2-warning { border-color: rgba(246,195,74,.6); color: var(--gold); }
.scct-swal .swal2-icon.swal2-error { border-color: rgba(255,90,106,.6); color: var(--red); }
.scct-swal .swal2-icon.swal2-question { border-color: rgba(54,225,255,.6); color: var(--cyan); }
.scct-swal .swal2-icon.swal2-success { border-color: rgba(54,212,138,.6); color: var(--green); }
.scct-swal .swal2-icon.swal2-info { border-color: rgba(54,225,255,.6); color: var(--cyan); }
.scct-swal__actions { gap: 8px; }
.scct-swal .btn { min-width: 110px; }

/* ============== Form layout polish ============== */
/* Prevent labels from forcing rows to feel cramped on tablets/laptops by
   gracefully wrapping label text and growing form columns to fit. */
.surface .form-label,
.surface form label.form-label {
    line-height: 1.25;
    margin-bottom: 6px;
    display: block;
}

/* On rows of inputs, keep stacking from md down so each field gets full width */
@media (max-width: 767.98px) {
    .surface form .row.g-3 > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
}


/* ============== Password reset link card (admin) ============== */
.reset-link-card .reset-link-box {
    background: rgba(0, 0, 0, .35);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    word-break: break-all;
}
.reset-link-card .reset-link-box code {
    color: var(--cyan);
    background: transparent;
    font-size: .85rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-all;
}
.text-cyan { color: var(--cyan) !important; }

/* ============== Rookie card badge icon ============== */
.rookie-logo {
    height: 20px;
    width: auto;
    vertical-align: middle;
}

/* ============== Card thumbnail (5:7 trading-card ratio) ============== */
.card-thumb {
    width: 26px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--line-strong);
    aspect-ratio: 5 / 7;
}
