:root {
    /* ===== Accents ===== */
    --secondary1: #38bdf8; /* light blue */
    --secondary2: #ef4444; /* red */
    --secondary3: #84cc16; /* lime */

    /* ===== Surfaces ===== */
    --bg-main: #020617;        /* darkest */
    --bg-chrome: #0b1220;      /* header + footer */
    --bg-button-1: #0f172a;
    --bg-button-2: #111827;
    --bg-button-3: #0b132a;
    --card-bg: #0f172a;

    /* ===== Text ===== */
    --text-main: #e5e7eb;
    --text-muted: #94a3b8;
    --text-light: #ffffff;

    /* ===== UI ===== */
    --border-light: #1e293b;
}

/* Extra Boxes */
.extra-box {
    background: inherit;        /* matches section card */
    border: none;
    box-shadow: none;
    width: 180px;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* Boxes with border, no rounding, 1/3 width */
.extra-box-border {
    background: inherit;            /* match section */
    border: 1px solid rgba(255,255,255,0.2);  /* visible border */
    border-radius: 0;               /* remove rounding */
    width: calc(33.33% - 16px);     /* 3 boxes + gap */
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    padding-top: 12px;              /* leave space for ribbon */
}

/* Ribbon on top of boxes */
.ribbon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
}
.ribbon-secondary1 { background-color: var(--secondary1); }
.ribbon-secondary2 { background-color: var(--secondary2); }
.ribbon-secondary3 { background-color: var(--secondary3); }

/* Rotate icon around its center */
.rotate-icon {
    transform: rotate(90deg);
    transform-origin: center center;
}

/* Titles matching ribbon color */
.ribbon-title {
    margin: 0.5rem 0 0.25rem 0; /* optional spacing */
    font-weight: 600;
}
.ribbon-secondary1.ribbon-title { color: var(--secondary1); }
.ribbon-secondary2.ribbon-title { color: var(--secondary2); }
.ribbon-secondary3.ribbon-title { color: var(--secondary3); }


/* Responsive: stack on mobile */
@media (max-width: 768px) {
    .extra-box-border {
        width: 100%;
    }
}

/* ===== Base ===== */
body {
    padding-top: 100px;
    background-color: var(--bg-main);
    color: var(--text-main);
}

/* ===== Header & Footer ===== */
header,
footer {
    background-color: var(--bg-chrome);
    border-color: var(--border-light);
}

footer a:hover {
    text-decoration: underline;
}

header {
    border-bottom: 1px solid var(--border-light);
}

footer {
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    padding: 20px 0;
    margin-top: 50px;
}

/* ===== Header buttons ===== */
.header-buttons .btn {
    width: 33.33%;
    border-radius: 0;
    border: none;
    background-color: var(--bg-button-1);
    font-weight: 600;
    transition: transform 0.15s ease, filter 0.15s ease;
}

/* Per-button background shades */
.header-buttons .btn:nth-child(1) {
    background-color: var(--bg-button-1);
    color: var(--secondary2);
}

.header-buttons .btn:nth-child(2) {
    background-color: var(--bg-button-1);
    color: var(--secondary3);
}

.header-buttons .btn:nth-child(3) {
    background-color: var(--bg-button-1);
    color: var(--secondary1);
}

/* Hover */
.header-buttons .btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* ===== Cards ===== */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-light);
    color: var(--text-main);
}


/* ===== Links ===== */
a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    opacity: 0.9;
}

/* Ensure muted text is still readable on dark cards */
.text-muted {
    color: var(--text-muted) !important; /* light grey */
}

/* Dark input for search bar */
.input-group .form-control {
    background-color: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--border-light);
}

.input-group-text {
    background-color: var(--card-bg);
    border: 1px solid var(--border-light);
    color: var(--text-main);
}

.input-group .form-control::placeholder {
    color: var(--text-muted); /* placeholder readable but subtle */
}

#sortMenu {
    position: absolute;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    max-width: 260px;
    background-color: var(--card-bg);
    /* optional: add a shadow for contrast */
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#sortMenu.show {
    opacity: 1;
    pointer-events: auto;
}


/* Ensure the menu doesn’t overflow the viewport horizontally */
#sortMenu::after {
    content: "";
    display: block;
}

.mutation-box {
    border-bottom: 1px solid var(--border-light);
    background-color: var(--bg-button-2);
}

.traits-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

#itemCard {
    position: relative;
}

/* Everything inside the card ABOVE the effects layer */
#itemCard > :not(#cardEffects) {
    position: relative;
    z-index: 10;
}

.traits-card {
    background-color: var(--bg-button-3);
}

.stroke-text {
    text-shadow:
        0 1px 0 #000,
        1px 0 0 #000,
        0 -1px 0 #000,
        -1px 0 0 #000,
        1px 1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        -1px -1px 0 #000;
}

.action-icon {
    cursor: pointer;
    transition: transform 0.15s ease;
}

.icon-box {
    width: 40px;
    height: 40px;
    background-color: var(--icon-color);   /* the color you want */
    -webkit-mask: url('/static/images/icon.png') no-repeat center;
    -webkit-mask-size: contain;
    mask: url('/static/images/icon.png') no-repeat center;
    mask-size: contain;
}

.action-icon:hover {
    transform: scale(1.15);
}

#editSearchInput {
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
#editSearchInput:focus {
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
    border-color: #80bdff;
}

.mutation-text {
    color: var(--text-light);          /* white text */
    -webkit-text-stroke: 1px black;    /* black outline */
    -moz-text-stroke: 1px black;       /* Firefox (partial support) */
    font-weight: bold;
    font-size: 0.9rem;
}
