/* =========================================================
   VIKING RISE SINGULARITY
   MOUNT SKILL MARCH BUILDER
   VRS RED / BLACK THEME
   ========================================================= */

:root {
    --ink: #f1f1f1;
    --ground: #070707;
    --panel: #111111;
    --panel-2: #161616;
    --panel-3: #1c1c1c;

    --red: #b51217;
    --red-bright: #e01b22;
    --red-dark: #7f0d11;
    --red-soft: rgba(181, 18, 23, 0.14);

    --bronze: #a87845;
    --gold: #c59a52;

    --line: #292929;
    --line-bright: #3a3a3a;

    --muted: #8b8b8b;
    --muted-bright: #bcbcbc;

    --danger: #d34b4b;

    --accent: var(--red);
    --accent-soft: var(--red-soft);
    --accent-2: var(--bronze);
    --accent-2-soft: rgba(168, 120, 69, 0.14);
    --accent-contrast: #ffffff;

    --mount-accent: var(--red);
    --mount-soft: var(--red-soft);
    --mount-ink: #eeeeee;

    --shadow:
        0 14px 35px rgba(0, 0, 0, 0.55),
        0 3px 10px rgba(0, 0, 0, 0.35);

    --font-head: "Space Grotesk", sans-serif;
    --font-body: "Inter", sans-serif;
    --font-mono: "JetBrains Mono", monospace;
}


/* =========================================================
   BASE
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
}

body {
    background:
        radial-gradient(
            circle at 50% -15%,
            rgba(181, 18, 23, 0.09),
            transparent 42%
        ),
        var(--ground);

    color: var(--ink);
    font-family: var(--font-body);
    padding: 18px 12px 50px;
}

.app {
    max-width: 1180px;
    margin: 0 auto;
}


/* =========================================================
   HEADER
   ========================================================= */

.header {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    justify-content: space-between;
    margin: 0 0 18px;
    flex-wrap: wrap;
}

h1 {
    font-family: var(--font-head);
    font-size: 30px;
    line-height: 1.05;
    margin: 0;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.badge {
    font-family: var(--font-mono);
    background: var(--panel);
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
}


/* =========================================================
   TABS / BUTTONS
   ========================================================= */

.main-tabs,
button,
.tab,
.btn,
input,
select,
textarea {
    font: inherit;
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

button {
    user-select: none;
    -webkit-user-select: none;
}

.tab,
.btn {
    border: 1px solid var(--line-bright);
    border-radius: 9px;
    padding: 9px 12px;

    background: var(--panel);
    color: var(--muted-bright);

    font-family: var(--font-head);
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
}

.tab:hover,
.btn:hover {
    border-color: var(--red);
    color: #ffffff;
}

.tab:active,
.btn:active {
    transform: translateY(1px);
}

.tab.active,
.btn.primary,
.main-tabs .tab.active {
    background: var(--red);
    border-color: var(--red);
    color: #ffffff;

    box-shadow:
        0 0 18px rgba(181, 18, 23, 0.25);
}

.btn {
    font-size: 14px;
}

.btn.secondary {
    background: var(--panel);
    color: #e5e5e5;
    border-color: var(--line-bright);
}

.btn.danger {
    background: transparent;
    color: #e17b7b;
    border-color: var(--danger);
}

.btn.small {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 12px;
}

.view.hidden {
    display: none !important;
}


/* =========================================================
   LAYOUT
   ========================================================= */

.grid {
    display: grid;
    grid-template-columns:
        minmax(330px, 0.92fr)
        minmax(0, 1.08fr);

    gap: 14px;
    align-items: start;
}

.saved-grid,
.rec-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(340px, 0.72fr);

    gap: 14px;
    align-items: start;
}

.sticky {
    position: sticky;
    top: 12px;
}


/* =========================================================
   CARDS
   ========================================================= */

.card,
.export-card {
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.025),
            transparent 50%
        ),
        var(--panel);

    border: 1px solid var(--line);
    border-radius: 14px;

    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;
    padding: 14px 16px;

    border-top: 3px solid var(--red);
    border-bottom: 1px solid var(--line);

    background:
        linear-gradient(
            90deg,
            rgba(181, 18, 23, 0.10),
            transparent 70%
        );
}

.builder .card-head {
    background:
        linear-gradient(
            90deg,
            rgba(181, 18, 23, 0.10),
            transparent 70%
        );

    color: var(--ink);
    border-top: 3px solid var(--red);
}

.builder .card-head .count {
    color: var(--muted);
}

.card-title {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.01em;
}

.count,
.tag,
.stamp {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
}

.body {
    padding: 14px 16px;
}

.export-card {
    max-width: 760px;
    padding: 14px;
    color: var(--ink);
}


/* =========================================================
   HERO / MARCH
   ========================================================= */

.hero {
    border: 1px solid var(--line);
    border-left: 4px solid var(--red);

    background:
        linear-gradient(
            90deg,
            rgba(181, 18, 23, 0.07),
            transparent 55%
        );

    border-radius: 12px;
    padding: 10px;
    margin-bottom: 10px;
}

.hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    gap: 10px;
    margin-bottom: 9px;
}

.hero-name {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 16px;
    color: #ffffff;
}

.hero-name-input {
    width: 100%;
    min-height: 40px;

    background: var(--panel-2);

    border: 1px solid var(--line);
    border-radius: 9px;

    color: var(--ink);

    font-family: var(--font-head);
    font-weight: 700;
    font-size: 16px;

    padding: 8px 10px;
}

.hero-name-input:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px var(--red-soft);
}

.hero-top .count {
    padding-top: 11px;
}


/* =========================================================
   MOUNT THEMING
   Neutralized so mount colors don't take over VRS UI.
   ========================================================= */

.mount-themed {
    border-color: var(--red) !important;

    background:
        linear-gradient(
            90deg,
            rgba(181, 18, 23, 0.06),
            transparent 55%
        );
}

.hero.mount-themed {
    box-shadow: inset 4px 0 0 var(--red);
}

.slot.mount-themed {
    border-style: solid;
    box-shadow: inset 4px 0 0 var(--red);
}

.skill.mount-themed,
.effect.mount-themed {
    box-shadow: inset 4px 0 0 var(--red);
}

.skill.mount-themed.selected {
    box-shadow:
        inset 4px 0 0 var(--red),
        0 0 0 2px rgba(181, 18, 23, 0.35);
}

.slot.mount-themed .slot-name,
.skill.mount-themed .skill-name,
.effect.mount-themed .effect-name {
    color: var(--ink);
}

.skill.mount-themed .tag.slot1,
.skill.mount-themed .tag.slot2 {
    border-color: var(--line);
    color: var(--muted-bright);
    background: var(--panel);
}

.effect.mount-themed .value-mini {
    color: #efefef;
}


/* =========================================================
   SLOTS
   ========================================================= */

.slots {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.slot {
    min-height: 104px;

    border: 1px dashed var(--line-bright);

    background: var(--panel-2);

    border-radius: 10px;
    padding: 10px;

    cursor: pointer;
    position: relative;

    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}

.slot:hover {
    border-color: var(--red);
}

.slot.active {
    outline: 3px solid var(--red-soft);
    border-color: var(--red);
}

.slot.filled {
    border-style: solid;
    background: var(--panel-2);
}

.slot-label {
    font-family: var(--font-mono);
    font-size: 11px;

    color: var(--muted);

    text-transform: uppercase;
    letter-spacing: 0.04em;

    margin-bottom: 7px;
}

.slot-empty {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

.slot-content {
    display: flex;
    gap: 9px;
    align-items: center;
}

.slot-img,
.skill-img {
    width: 48px;
    height: 48px;

    border-radius: 10px;

    background-size: cover;
    background-position: center;

    border: 1px solid var(--line);

    flex: 0 0 auto;
}

.slot-name,
.skill-name {
    font-family: var(--font-head);
    font-weight: 700;
    line-height: 1.1;
    color: #eeeeee;
}

.remove {
    position: absolute;

    top: 8px;
    right: 8px;

    min-height: 26px;
    width: 26px;

    border: 1px solid var(--line);
    border-radius: 9px;

    background: var(--panel);
    color: var(--muted);

    cursor: pointer;
}

.remove:hover {
    color: #ffffff;
    border-color: var(--danger);
}


/* =========================================================
   SUMMARY
   ========================================================= */

.summary {
    padding: 14px 16px;

    border-top: 1px solid var(--line);

    background: var(--panel-2);
}

.summary-title,
.section-title {
    font-family: var(--font-head);
    font-size: 14px;

    color: #e5e5e5;

    text-transform: uppercase;
    letter-spacing: 0.06em;

    margin: 0 0 9px;

    border-bottom: 1px solid var(--line);
    padding-bottom: 6px;
}

.group {
    margin: 12px 0 0;
}

.group-title {
    font-family: var(--font-head);
    font-weight: 700;

    color: #dddddd;

    font-size: 14px;
    margin-bottom: 6px;
}

.effect,
.saved-item,
.rec-line {
    background: var(--panel-2);

    border: 1px solid var(--line);

    border-left: 4px solid var(--red);

    border-radius: 9px;

    padding: 8px 10px;
    margin-bottom: 7px;
}

.effect-name {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 14px;
}

.effect-desc {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
    margin-top: 3px;
}

.effect.compact {
    display: block;
}

.value-mini {
    font-family: var(--font-mono);
    font-size: 11px;

    color: #d5d5d5;

    line-height: 1.35;
    margin-top: 3px;
}

.selected-skill-full {
    border-left-color: var(--red);
}

.selected-skill-full .effect-name {
    color: var(--ink);
}


/* =========================================================
   SKILLS
   ========================================================= */

.skills {
    display: grid;
    gap: 8px;

    padding: 12px 16px;

    max-height: 72vh;
    overflow: auto;
}

.skill {
    display: grid;
    grid-template-columns: auto 1fr;

    gap: 10px;
    align-items: start;

    border: 1px solid var(--line);

    border-left: 4px solid var(--red);

    background: var(--panel-2);

    border-radius: 10px;
    padding: 10px;

    cursor: pointer;
    text-align: left;

    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}

.skill:hover {
    border-color: var(--red);
}

.skill.selected {
    outline: 3px solid var(--red-soft);
    border-color: var(--red);
    background: var(--panel-3);
}

.skill.disabled {
    opacity: 0.46;
}

.skill-desc {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}


/* =========================================================
   TAGS
   ========================================================= */

.tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin: 5px 0;
}

.tag {
    display: inline-flex;
    align-items: center;

    border: 1px solid var(--line);

    border-radius: 999px;

    padding: 3px 7px;

    background: var(--panel);

    color: var(--muted);

    font-family: var(--font-mono);
    font-size: 11px;
}

.tag.slot1 {
    color: #d7d7d7;
}

.tag.slot2 {
    color: #bcbcbc;
}


/* =========================================================
   INPUTS
   ========================================================= */

input,
select,
textarea {
    width: 100%;

    background: var(--panel-2);

    border: 1px solid var(--line);

    border-radius: 9px;

    color: var(--ink);

    font-family: var(--font-body);
    font-size: 14px;

    padding: 10px;

    outline: none;
}

textarea {
    min-height: 92px;
    resize: vertical;
    line-height: 1.35;
}

input::placeholder,
textarea::placeholder {
    color: #686868;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px var(--red-soft);
}

select option {
    background: var(--panel-2);
    color: var(--ink);
}

label {
    display: block;

    font-family: var(--font-head);
    font-size: 12px;

    text-transform: uppercase;
    letter-spacing: 0.05em;

    color: var(--muted);

    margin: 0 0 6px;
}

.field {
    margin-bottom: 10px;
}

.mount-type-select {
    min-width: 150px;
    min-height: 40px;

    font-family: var(--font-head);
    font-weight: 700;

    color: #dddddd;

    border-color: var(--line-bright);

    background: var(--panel-2);
}


/* =========================================================
   FILTER BAR
   ========================================================= */

.filterbar {
    padding: 12px 16px;

    border-bottom: 1px solid var(--line);

    display: grid;

    grid-template-columns:
        1fr auto auto;

    gap: 8px;
    align-items: center;
}

.active-filter {
    border: 1px solid var(--line);

    background: var(--panel-2);

    border-radius: 999px;

    padding: 7px 9px;

    font-family: var(--font-mono);
    font-size: 12px;

    color: #d0d0d0;

    white-space: nowrap;
}


/* =========================================================
   CONTROLS
   ========================================================= */

.hero-controls {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        160px
        auto;

    gap: 8px;

    align-items: end;

    width: 100%;
}

.hero-controls.clean {
    grid-template-columns:
        minmax(0, 1fr)
        150px;

    align-items: center;
}

.hero-controls.clean input,
.hero-controls.clean select {
    margin: 0;
}

.mount-pill {
    font-family: var(--font-mono);
    font-size: 11px;

    color: #d2d2d2;

    background: var(--panel-2);

    border: 1px solid var(--line);

    border-radius: 999px;

    padding: 4px 7px;

    display: inline-flex;

    margin-top: 5px;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}


/* =========================================================
   SAVED BUILDS
   ========================================================= */

.build-name-row {
    display: grid;

    grid-template-columns:
        1fr auto;

    gap: 8px;

    margin-bottom: 12px;
}

.saved-list {
    display: grid;
    gap: 9px;
}

.saved-top {
    display: flex;

    justify-content: space-between;

    gap: 10px;

    align-items: start;
}

.saved-name {
    font-family: var(--font-head);
    font-weight: 700;
}

.saved-actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 9px;
}

.preview-panel {
    background: var(--panel-2);

    border: 1px solid var(--line);

    border-radius: 9px;

    padding: 10px;
    margin-top: 10px;
}

.empty-list,
.empty {
    color: var(--muted);
    font-style: italic;
    font-size: 13px;
    padding: 8px 0;
}


/* =========================================================
   RECOMMENDATIONS
   ========================================================= */

.rec-slot-grid {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 8px;
}

.rec-add-grid {
    display: grid;

    grid-template-columns:
        1fr 1fr auto;

    gap: 8px;

    align-items: end;

    margin-bottom: 8px;
}

.rec-title {
    font-family: var(--font-head);
    font-weight: 700;
}

.rec-note {
    white-space: pre-wrap;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.4;
}


/* =========================================================
   WARNING
   ========================================================= */

.warn {
    margin-top: 12px;

    background: rgba(181, 18, 23, 0.08);

    border: 1px solid rgba(181, 18, 23, 0.35);

    border-radius: 9px;

    padding: 9px 10px;

    color: #d8aaaa;

    font-size: 13px;

    line-height: 1.35;
}


/* =========================================================
   TOAST
   ========================================================= */

.toast {
    position: fixed;

    bottom: 14px;
    left: 50%;

    transform: translateX(-50%);

    background: #080808;
    color: #ffffff;

    border: 1px solid var(--line-bright);

    padding: 9px 12px;

    border-radius: 999px;

    font-size: 13px;

    opacity: 0;

    pointer-events: none;

    transition: 0.2s;

    z-index: 99;

    box-shadow: var(--shadow);
}

.toast.show {
    opacity: 1;
}


/* =========================================================
   EXPORT
   ========================================================= */

.exporting {
    background: var(--panel) !important;
    box-shadow: none !important;
}


/* =========================================================
   SCROLLBARS
   ========================================================= */

* {
    scrollbar-width: thin;
    scrollbar-color: #3a3a3a transparent;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 10px;
}

*::-webkit-scrollbar-thumb:hover {
    background: #555555;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 860px) {

    body {
        padding: 10px 8px 36px;
    }

    h1 {
        font-size: 25px;
    }

    .grid,
    .saved-grid,
    .rec-grid {
        grid-template-columns: 1fr;
    }

    .sticky {
        position: static;
    }

    .filterbar {
        grid-template-columns: 1fr;
    }

    .skills {
        max-height: none;
    }

    .build-name-row,
    .rec-add-grid {
        grid-template-columns: 1fr;
    }

    .slots,
    .rec-slot-grid {
        grid-template-columns: 1fr;
    }

    .slot {
        min-height: 92px;
    }

    .header {
        align-items: flex-start;
    }

    select,
    input,
    textarea {
        font-size: 16px;
    }

    .body {
        padding: 12px;
    }
}


@media (max-width: 640px) {

    .hero-controls {
        grid-template-columns: 1fr;
    }

    .mount-type-select {
        min-width: 0;
    }

    .hero-top .count {
        padding-top: 0;
    }

    .card-head {
        padding: 12px;
    }

    .card-title {
        font-size: 18px;
    }
}

/* =========================================================
   VRS GLOBAL SHELL
   ========================================================= */

body {
    padding: 0;
    background: #080808;
}

.app {
    max-width: 1180px;
    margin: 28px auto 50px;
    padding: 0 12px;
}

/* =========================================================
   VRS LANGUAGE MENU
   ========================================================= */

.language-selector {
    position: relative;
}

.language-menu {
    display: none;

    position: absolute;
    top: calc(100% + 8px);
    right: 0;

    min-width: 150px;

    flex-direction: column;

    padding: 6px;

    background: #111111;

    border: 1px solid #292929;
    border-radius: 8px;

    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.55);

    z-index: 1000;
}

.language-selector:hover .language-menu,
.language-selector:focus-within .language-menu {
    display: flex;
}

.language-menu button {
    width: 100%;

    min-height: 38px;

    padding: 8px 12px;

    border: 0;
    border-radius: 5px;

    background: transparent;

    color: #bcbcbc;

    font-family: var(--font-body);
    font-size: 13px;

    text-align: left;

    cursor: pointer;
}

.language-menu button:hover {
    background: rgba(181, 18, 23, 0.14);
    color: #ffffff;
}

/* =========================================================
   RECOMMENDATION CARDS
   ========================================================= */

.rec-slot-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.rec-line {
    position: relative;
    padding: 14px;
    overflow: hidden;
}

.rec-line .hero-controls,
.rec-line .hero-controls.clean {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 10px;
    align-items: end;
}

.rec-line label {
    margin-bottom: 6px;
}

.rec-line select {
    width: 100%;
}

.rec-line .mount-pill {
    margin-top: 6px;
}

/* Recommendation skill selectors */

.rec-line .rec-slot-grid {
    margin-top: 12px;
}

.rec-line .rec-slot-grid > div {
    min-width: 0;
}

.rec-line .rec-slot-grid label {
    display: block;
    margin-bottom: 6px;
}

.rec-line .rec-slot-grid select {
    min-width: 0;
}

/* Recommendation headings */

.rec-title {
    margin-bottom: 10px;
    color: #ffffff;
}

.rec-note {
    margin-top: 8px;
}

/* Prevent labels from visually colliding */

.rec-line label {
    line-height: 1.25;
    white-space: normal;
}

/* Better spacing between recommendation blocks */

.rec-grid {
    gap: 16px;
}

.rec-grid > * {
    min-width: 0;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 860px) {

    .rec-slot-grid {
        grid-template-columns: 1fr;
    }

    .rec-line .hero-controls,
    .rec-line .hero-controls.clean {
        grid-template-columns: 1fr;
    }
}   

/* =========================================================
   RECOMMENDATIONS — HERO CARDS
   ========================================================= */

#recCore .hero {
    padding: 14px;
    margin-bottom: 12px;
}

#recCore .hero-top {
    margin-bottom: 12px;
}

#recCore .hero-controls {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        150px;

    gap: 10px;

    align-items: end;
}

/* Hero name */

#recCore .hero-name-input {
    min-width: 0;
}

/* Mount type */

#recCore .mount-type-select {
    width: 100%;
    min-width: 0;
}

/* Hide the unnecessary "Recommendation" label/count
   that is currently occupying the third column. */

#recCore .hero-controls > .count {
    display: none;
}


/* =========================================================
   RECOMMENDATION SKILL SLOTS
   ========================================================= */

#recCore .rec-slot-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

    gap: 10px;

    margin-top: 4px;
}

#recCore .rec-slot-grid .field {
    min-width: 0;
    margin: 0;
}

#recCore .rec-slot-grid label {
    display: block;

    min-height: 30px;

    margin-bottom: 6px;

    line-height: 1.25;
}

#recCore .rec-slot-grid select {
    width: 100%;
    min-width: 0;
}


/* =========================================================
   RECOMMENDATION CARD LABELS
   ========================================================= */

#recCore .hero label {
    margin-bottom: 6px;
}

#recCore .hero .hero-controls > div {
    min-width: 0;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 640px) {

    #recCore .hero-controls {
        grid-template-columns: 1fr;
    }

    #recCore .rec-slot-grid {
        grid-template-columns: 1fr;
    }

}