    /**
     * var() - CSS custom property (CSS variable) function
     * 
     * Retrieves the value of a custom CSS property defined elsewhere in your stylesheet.
     * In this case, it references a custom property named '--accent'
     * 
     * Custom properties allow you to store reusable values (colors, sizes, etc.)
     * and use them throughout your CSS, making it easier to maintain consistent styling.
     * 
     * Example definition:
     * :root {
     *   --accent: #007bff;
     * }
     * 
     * Usage:
     * border-color: var(--accent); // Will use the value of --accent
     */
/* ===== GLOBAL ===== */
:root {
    --bg: #000;
    --fg: #fff;
    --muted: #bdbdbd;
    --panel: #0a0a0a;
    --accent: #7cff00;
    --danger: #ff2d2d;
    --card-bg: #070707;

    --border: 2px;
    --shadow-offset: 4px;
    --radius: 3px;

    --font-body: "VT323";
    --font-display: "Press Start 2P";
}

@font-face {
    font-family: "Press Start 2P";
    src: url("assets/fonts/PressStart2P.woff2") format("woff2");
    font-display: swap;
}

@font-face {
    font-family: "VT323";
    src: url("assets/fonts/VT323.woff2") format("woff2");
    font-display: swap;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-body), ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    line-height: 1.35;
    letter-spacing: 0.02em;
}

body.arcade-scanlines::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.03),
        rgba(255, 255, 255, 0.03) 1px,
        rgba(0, 0, 0, 0) 3px,
        rgba(0, 0, 0, 0) 6px
    );
    mix-blend-mode: screen;
    opacity: 0.35;
    z-index: 0;
}

a {
    color: var(--fg);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--accent);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

canvas#arcade-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0ms !important;
        animation-duration: 0ms !important;
        animation-iteration-count: 1 !important;
    }
}

.configurator-container {
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr minmax(260px, 340px);
    align-items: flex-start;
    gap: 32px;
    width: 100%;
}
.welcome-outer-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    position: relative;
    z-index: 1;
}
.welcome-container {
    position: relative;
    z-index: 1;
    background: color-mix(in srgb, var(--panel) 92%, transparent);
    border-radius: var(--radius);
    border: var(--border) solid var(--fg);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 rgba(124, 255, 0, 0.35);
    padding: 48px 36px 40px 36px;
    max-width: 400px;
    width: 100%;
    text-align: center;
}
.welcome-title {
    font-family: var(--font-display), var(--font-body), monospace;
    color: var(--accent);
    font-size: 2rem;
    margin-bottom: 18px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-shadow: 0 0 0 transparent;
}
.welcome-text {
    color: var(--muted);
    font-size: 1.4rem;
    margin-bottom: 32px;
}


/* ===== LOGIN ===== */
.login-container {
    width: 350px;
    margin: 80px auto;
    padding: 32px;
    background: var(--panel);
    background: color-mix(in srgb, var(--panel) 92%, transparent);
    border-radius: var(--radius);
    border: var(--border) solid var(--fg);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 1;
}

.login-container h2 {
    margin-bottom: 24px;
    text-align: center;
    font-family: var(--font-display), var(--font-body), monospace;
    color: var(--accent);
    font-size: 1.1rem;
    line-height: 1.5;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 1.2rem;
}

.form-group input {
    width: 100%;
    padding: 10px 8px;
    border: var(--border) solid var(--fg);
    background: var(--bg);
    color: var(--fg);
    border-radius: var(--radius);
    font-size: 1.2rem;
    caret-color: var(--accent);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.form-group select {
    width: 100%;
    padding: 10px 8px;
    border: var(--border) solid var(--fg);
    background: var(--bg);
    color: var(--fg);
    border-radius: var(--radius);
    font-size: 1.2rem;
    caret-color: var(--accent);
}

.form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}


/* ===== BUTTONS ===== */
.login-btn,
.primary-btn,
.btn {
    font-family: var(--font-display), var(--font-body), monospace;
    background: var(--bg);
    color: var(--fg);
    border: var(--border) solid var(--fg);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 0.9rem;
    line-height: 1.4;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.08s ease, color 0.08s ease, border-color 0.08s ease;
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 rgba(255, 255, 255, 0.10);
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-btn:hover,
.primary-btn:hover,
.btn:hover {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--accent);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 rgba(124, 255, 0, 0.35);
    transform: translate(-1px, -1px);
}

.login-btn:active,
.primary-btn:active,
.btn:active {
    transform: translate(2px, 2px);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

.btn--accent {
    border-color: var(--accent);
    color: var(--accent);
}

.btn--accent:hover {
    background: var(--accent);
    color: var(--bg);
}

.btn--danger {
    border-color: var(--danger);
    color: var(--danger);
}

.btn--danger:hover {
    background: var(--danger);
    color: var(--bg);
    border-color: var(--danger);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 rgba(255, 45, 45, 0.35);
}

.btn--ghost {
    background: transparent;
    box-shadow: none;
}

.btn--block {
    width: 100%;
    justify-content: center;
    text-align: center;
}

.btn.remove {
    margin-left: 10px;
    background: var(--bg);
}

.btn.remove:hover {
    background: var(--danger);
    color: var(--bg);
    border-color: var(--danger);
}


/* ===== HEADER ===== */
.main-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(6px);
    color: var(--fg);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    box-shadow: 0 0 0 transparent;
    border-bottom: var(--border) solid var(--fg);
}

.logo {
    font-family: var(--font-display), var(--font-body), monospace;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--accent);
}

nav .nav-btn {
    color: var(--fg);
    background: transparent;
    border: var(--border) solid transparent;
    font-size: 1.1rem;
    margin-left: 12px;
    padding: 8px 12px;
    border-radius: var(--radius);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

nav .nav-btn:hover {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--accent);
}

nav .logout-btn {
    background: transparent;
    color: var(--accent);
    border: var(--border) solid var(--accent);
    margin-left: 16px;
}

nav .logout-btn:hover {
    background: var(--accent);
    color: var(--bg);
}


/* ===== CONTENT ===== */
.main-content {
    width: min(1100px, calc(100% - 48px));
    margin: 40px auto 0 auto;
    padding: 0 24px;
}
.categorie {
    font-family: var(--font-display), var(--font-body), monospace;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--accent);
    margin: 28px 8px 10px 8px;
    letter-spacing: 0.04em;
}
.builds-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.builds-header h1 {
    font-family: var(--font-display), var(--font-body), monospace;
    font-size: 1.1rem;
    color: var(--fg);
    letter-spacing: 0.04em;
}
.builds-header--orders {
    margin-top: 40px;
}

/* ===== CARD STYLES ===== */
.build-tile {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    border: var(--border) solid var(--fg);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 rgba(255, 255, 255, 0.08);
    box-sizing: border-box;
    width: auto;
    min-width: 0;
    flex-shrink: 0;
    align-self: flex-start;
    display: block;
    text-decoration: none;
    transform: translate(-2px, -2px); /* normally set on hover, but because of the way the animation is implemented, it's set here as well */
    transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
}

.build-tile:hover,
.part-tile:hover {
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 rgba(124, 255, 0, 0.25);
    transform: translate(-2px, -2px);
    border-color: var(--accent);
}

.build-tile .build-card-content {
    cursor: pointer;
}

.build-tile .build-card-title {
    font-family: var(--font-display), var(--font-body), monospace;
    color: var(--accent);
    font-size: 0.95rem;
    margin-bottom: 8px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.build-tile .build-card-date {
    color: var(--muted);
    font-size: 1.1rem;
}

.build-tile .build-card-summary {
    color: var(--fg);
    margin-top: 20px;
    font-size: 1.2rem;
}

.build-tile .build-card-details {
    display: none;
    margin-top: 16px;
    padding-top: 16px;
    border-top: var(--border) dashed rgba(255, 255, 255, 0.35);
}

.build-tile .build-card-details.open {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tile,
.aside {
    background: var(--panel);
    border-radius: var(--radius);
    padding: 20px;
    align-items: center;
    border: var(--border) solid var(--fg);
    transform: translate(-2px, -2px); /* normally set on hover, but because of the way the animation is implemented, it's set here as well */
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 rgba(255, 255, 255, 0.08);
}


/* ===== PARTS LIST (build card expanded) ===== */
.parts-list {
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--fg);
    font-size: 1.15rem;
}

.parts-list li {
    padding: 4px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.25);
}

.parts-list li:last-child {
    border-bottom: none;
}

.card-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 8px;
    flex-wrap: wrap;
}


/* ===== BUILD LIST ===== */
.build-name-input {
    width: 100%;
    padding: 10px 10px;
    border: var(--border) solid var(--fg);
    background: var(--bg);
    color: var(--fg);
    border-radius: var(--radius);
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.build-name-input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-color: var(--accent);
}

.build-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.build-list li {
    padding: 6px;
    display: flex;
    cursor: pointer;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.30);
    color: var(--fg);
    font-size: 1.2rem;
    transition: background 0.15s;
}

.build-list li .title {
    color: var(--accent);
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.build-list li .item-quantity {
    font-weight: bold;
    color: var(--accent);
    margin-right: 8px;
}

.build-list li .description {
    color: var(--muted);
    font-size: 1.05rem;
}

.build-list li .price {
    font-size: 1.2rem;
    color: var(--fg);
    min-width: 90px;
    text-align: right;
}

.build-list li:last-child {
    border-bottom: none;
}

.build-list li:hover {
    background: rgba(124, 255, 0, 0.08);
}

/* ===== ICONS ===== */
.icon {
    width: 1.1em;
    height: 1.1em;
    fill: currentColor;
    flex: 0 0 auto;
}

/* ===== ALERTS / MODALS ===== */
.alert {
    border: var(--border) solid var(--fg);
    border-radius: var(--radius);
    background: var(--panel);
    padding: 12px 14px;
    color: var(--fg);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 rgba(255, 255, 255, 0.08);
}

.alert--danger {
    border-color: var(--danger);
    color: var(--danger);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 rgba(255, 45, 45, 0.25);
}

.alert--center {
    text-align: center;
}

.alert + form,
.alert {
    margin-bottom: 18px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 24px;
}

.modal {
    width: min(520px, 100%);
    background: var(--panel);
    border: var(--border) solid var(--fg);
    border-radius: var(--radius);
    box-shadow: calc(var(--shadow-offset) * 2) calc(var(--shadow-offset) * 2) 0 rgba(124, 255, 0, 0.22);
    padding: 18px;
}

.modal__title {
    font-family: var(--font-display), var(--font-body), monospace;
    color: var(--accent);
    font-size: 1rem;
    margin: 0 0 10px 0;
}

.modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

/* ===== BASKET ===== */
.basket-empty {
    text-align: center;
    padding: 24px;
}

.basket-summary {
    border-top: var(--border) dashed rgba(255, 255, 255, 0.35);
    margin: 40px 0 0 0;
    padding-top: 24px;
    max-width: 500px;
}

.basket-summary__row {
    display: flex;
    justify-content: space-between;
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.basket-summary__row--muted {
    color: var(--muted);
    font-size: 1.2rem;
    margin-bottom: 18px;
}

.build-tile-details-legacy {
    margin-top: 30px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    color: var(--muted);
    font-size: 1.2rem;
}


/* ===== TILES GRID ===== */
.build-tiles-grid,
.order-tiles-grid,
.part-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    width: 100%;
    gap: 24px;
    margin-left: auto;
    margin-right: auto;
    align-items: start;
}

.build-tiles-grid--landing {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.part-tile img {
    background: var(--bg);
    border: var(--border) solid var(--fg);
    border-radius: var(--radius);
    width: 100%;
    height: auto;
}

.part-tile strong {
    font-family: var(--font-display), var(--font-body), monospace;
    color: var(--accent);
    font-size: 1.2rem;
    margin-bottom: 8px;
    text-align: center;
}

.part-tile {
    background: var(--panel);
    min-height: 160px;
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    border: var(--border) solid var(--fg);
    transform: translate(-2px, -2px); /* normally set on hover, but because of the way the animation is implemented, it's set here as well */
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 rgba(255, 255, 255, 0.08);
    gap: 10px;
}


/* ===== FOOTER LINKS ===== */
.login-footer a {
    color: var(--accent);
    text-decoration: underline;
}

.login-footer {
    padding-top: 20px;
}

.login-footer a:hover {
    color: var(--fg);
}


/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .configurator-container {
        display: block;
        padding: 16px;
        gap: 0;
    }
    .main, .aside {
        float: none;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    .aside {
        margin-top: 32px;
    }
    .build-tiles-grid--landing {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .build-tiles-grid,
    .order-tiles-grid,
    .part-tiles-grid {
        margin-left: 16px;
        margin-right: 16px;
        gap: 16px;
        grid-template-columns: 1fr;
    }
}

/* ===== CHECKOUT ===== */
.checkout-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 24px;
    align-items: start;
}

.checkout-panel {
    background: var(--panel);
    border-radius: var(--radius);
    border: var(--border) solid var(--fg);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 rgba(255, 255, 255, 0.08);
    transform: translate(-2px, -2px); /* normally set on hover, but because of the way the animation is implemented, it's set here as well */
    padding: 20px;
}

.checkout-title {
    margin: 0 0 14px 0;
    font-family: var(--font-display), var(--font-body), monospace;
    color: var(--accent);
    font-size: 1rem;
    letter-spacing: 0.04em;
}

.checkout-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.checkout-columns--address {
    grid-template-columns: 0.7fr 0.8fr 1.2fr;
}

.checkout-columns--card {
    grid-template-columns: 1fr 1fr;
}

.checkout-fieldset {
    border: var(--border) dashed rgba(255, 255, 255, 0.35);
    border-radius: var(--radius);
    padding: 12px;
    margin: 0 0 18px 0;
}

.checkout-legend {
    color: var(--muted);
    font-size: 1.1rem;
    padding: 0 6px;
}

.checkout-option {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--fg);
    margin: 8px 0;
    cursor: pointer;
}

.checkout-option input {
    accent-color: var(--accent);
}

.checkout-agb {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 10px 0 16px 0;
    color: var(--muted);
    font-size: 1.1rem;
}

.checkout-agb input {
    margin-top: 3px;
    accent-color: var(--accent);
}

.checkout-link {
    color: var(--accent);
    text-decoration: underline;
}

.checkout-link:hover {
    color: var(--fg);
}

.checkout-note {
    margin-top: 10px;
    color: var(--muted);
    font-size: 1.05rem;
}

.checkout-summary-list li {
    cursor: default;
}

.checkout-summary-list li:hover {
    background: transparent;
}

@media (max-width: 900px) {
    .checkout-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .checkout-columns,
    .checkout-columns--address {
        grid-template-columns: 1fr;
    }
}

/* ===== CONGRATS ===== */
.congrats-card {
    position: relative;
    overflow: hidden;
    width: min(760px, 100%);
    margin: 24px auto 0 auto;
    padding: 28px 22px;
    background: color-mix(in srgb, var(--panel) 92%, transparent);
    border-radius: var(--radius);
    border: var(--border) solid var(--fg);
    box-shadow: calc(var(--shadow-offset) * 2) calc(var(--shadow-offset) * 2) 0 rgba(124, 255, 0, 0.18);
    text-align: center;
}

.congrats-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.confetti-piece {
    position: absolute;
    top: -12px;
    left: calc((var(--i) * 2.8%) + 2%);
    width: 10px;
    height: 6px;
    border-radius: 2px;
    background: hsl(calc(var(--i) * 17deg), 90%, 60%);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
    opacity: 0.9;
    animation: confetti-fall 1.7s linear infinite;
    animation-delay: calc(var(--i) * -0.08s);
    transform: translateY(-20px) rotate(0deg);
}

.confetti-piece:nth-child(3n) {
    width: 7px;
    height: 7px;
    border-radius: 999px;
}

.confetti-piece:nth-child(4n) {
    width: 12px;
    height: 4px;
}

.confetti-piece:nth-child(6n) {
    opacity: 0.65;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-20px) rotate(0deg);
    }
    100% {
        transform: translateY(520px) rotate(540deg);
    }
}

.congrats-badge {
    width: 96px;
    height: 96px;
    margin: 6px auto 12px auto;
    display: grid;
    place-items: center;
    animation: badge-pop 420ms ease-out both;
}

@keyframes badge-pop {
    0% { transform: scale(0.7); filter: blur(1px); opacity: 0.0; }
    100% { transform: scale(1); filter: blur(0); opacity: 1; }
}

.congrats-check {
    width: 96px;
    height: 96px;
}

.congrats-check__circle {
    fill: rgba(124, 255, 0, 0.07);
    stroke: var(--accent);
    stroke-width: 3;
    stroke-dasharray: 160;
    stroke-dashoffset: 160;
    animation: circle-draw 600ms ease-out 80ms forwards;
}

.congrats-check__tick {
    fill: none;
    stroke: var(--accent);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: tick-draw 420ms ease-out 480ms forwards;
}

@keyframes circle-draw {
    to { stroke-dashoffset: 0; }
}

@keyframes tick-draw {
    to { stroke-dashoffset: 0; }
}

.congrats-title {
    margin: 0;
    font-family: var(--font-display), var(--font-body), monospace;
    color: var(--accent);
    font-size: 1.5rem;
    letter-spacing: 0.05em;
    text-shadow: 0 0 0 transparent;
    animation: title-glow 1.2s ease-in-out infinite alternate;
}

@keyframes title-glow {
    from { text-shadow: 0 0 8px rgba(124, 255, 0, 0.18); }
    to { text-shadow: 0 0 16px rgba(124, 255, 0, 0.35); }
}

.congrats-text {
    margin: 10px 0 0 0;
    color: var(--fg);
    font-size: 1.2rem;
}

.congrats-order {
    margin: 10px 0 0 0;
    color: var(--muted);
    font-size: 1.15rem;
}

.congrats-actions {
    margin-top: 18px;
}

.congrats-subtext {
    margin-top: 12px;
    color: var(--muted);
    font-size: 1.05rem;
}
