* {
    box-sizing: border-box;
}

:root {
    --ember-primary: #ff6a00;
    --ember-accent: #ffae00;
    --ember-heading-font: "Bebas Neue";
    --ember-body-font: "Inter";
    --ember-background-image: none;
    --player-fill: 0%;
    --page-width: 1180px;
    --forge-line: rgba(255, 106, 0, 0.28);
    --text: #fff4e5;
    --muted: #e6c4a7;
}

html {
    min-height: 100%;
    background: #120804;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text);
    background: #120804;
    font-family: var(--ember-body-font), "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
a {
    font: inherit;
}

button:disabled {
    cursor: default;
}

.forge-background,
.furnace-glow,
#embers {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.forge-background {
    z-index: 0;
    background-image:
        linear-gradient(rgba(20, 7, 1, 0.18), rgba(10, 3, 0, 0.52)),
        var(--ember-background-image),
        radial-gradient(circle at 50% 25%, #4f1d08 0%, #1e0d05 47%, #080302 100%);
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
    filter: brightness(0.48) saturate(1.18);
    transform: scale(1.01);
}

.furnace-glow {
    z-index: 1;
    background:
        radial-gradient(
            circle at 50% 63%,
            rgba(255, 240, 180, 0.28) 0%,
            rgba(255, 180, 80, 0.38) 10%,
            rgba(255, 110, 20, 0.42) 20%,
            rgba(200, 50, 0, 0.32) 31%,
            rgba(60, 15, 0, 0.22) 43%,
            rgba(0, 0, 0, 0.88) 100%
        );
    background-size: 78% 84%;
    background-repeat: no-repeat;
    background-position: center 70%;
    mix-blend-mode: screen;
    opacity: 0.55;
    filter: brightness(1.08);
    animation: furnaceFlicker 6s infinite ease-in-out;
}

#embers {
    z-index: 2;
    width: 100%;
    height: 100%;
}

.page-shell {
    position: relative;
    z-index: 3;
    width: min(var(--page-width), calc(100% - 32px));
    margin: 0 auto;
    padding-bottom: 50px;
}

.forge-card {
    border: 1px solid var(--forge-line);
    background: linear-gradient(145deg, rgba(51, 29, 17, 0.9), rgba(28, 15, 9, 0.88));
    box-shadow:
        0 22px 70px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 228, 196, 0.035);
    backdrop-filter: blur(11px);
    -webkit-backdrop-filter: blur(11px);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 24px;
    border-top: 0;
    border-radius: 0 0 18px 18px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    color: var(--text);
    text-decoration: none;
}

.brand-logo {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    object-fit: contain;
    filter: drop-shadow(0 0 13px rgba(255, 106, 0, 0.48));
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 135, 35, 0.36);
    border-radius: 50%;
    color: #ffd9af;
    background: radial-gradient(circle, rgba(255, 126, 20, 0.16), rgba(70, 20, 0, 0.24));
    font-size: 22px;
    box-shadow: 0 0 18px rgba(255, 106, 0, 0.17);
}

.brand-title {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: var(--ember-heading-font), "Bebas Neue", Impact, sans-serif;
    font-size: clamp(21px, 2.5vw, 29px);
    font-weight: 700;
    line-height: 0.98;
    letter-spacing: 0.025em;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(255, 106, 0, 0.55);
}

.brand-title em {
    margin-top: 4px;
    color: #f0c8a4;
    font-family: var(--ember-body-font), sans-serif;
    font-size: 0.52em;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.discord-button,
.btn-ember {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 11px;
    padding: 10px 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease, background 0.2s ease;
}

.discord-button {
    border: 1px solid rgba(255, 144, 45, 0.23);
    color: #fff0dd;
    background: rgba(16, 7, 3, 0.75);
    text-decoration: none;
}

.btn-ember {
    border: 1px solid rgba(255, 187, 54, 0.28);
    color: #1b0800;
    background: linear-gradient(100deg, var(--ember-primary), #ff8c14 55%, var(--ember-accent));
    box-shadow: 0 0 15px rgba(255, 106, 0, 0.36);
    font-weight: 900;
    text-decoration: none;
}

.discord-button:hover,
.btn-ember:not(:disabled):hover {
    transform: translateY(-1px);
}

.discord-button:hover {
    background: rgba(35, 15, 7, 0.88);
}

.btn-ember:not(:disabled):hover {
    filter: brightness(1.12);
    box-shadow: 0 0 25px rgba(255, 123, 15, 0.62);
}

.notice-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: 14px;
    color: var(--muted);
}

.notice-banner strong {
    color: var(--ember-accent);
}

.sale-banner strong {
    color: #ffd58e;
}

.hero {
    margin: 36px 14px 28px;
    padding: clamp(30px, 5vw, 54px) 28px;
    border-radius: 22px;
    text-align: center;
}

.hero-eyebrow,
.server-kicker {
    display: block;
    margin-bottom: 8px;
    color: var(--ember-accent);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 0;
    font-family: var(--ember-heading-font), "Bebas Neue", Impact, sans-serif;
    font-size: clamp(38px, 6vw, 64px);
    line-height: 0.95;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.hero p {
    max-width: 820px;
    margin: 15px auto 0;
    color: #edcfb1;
    font-size: clamp(14px, 2vw, 17px);
    line-height: 1.68;
}

.text-glow {
    text-shadow:
        0 0 8px rgba(255, 106, 0, 0.58),
        0 0 28px rgba(255, 100, 0, 0.22);
}

.server-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
    gap: 24px;
    margin: 0 14px 34px;
    padding: 24px;
    border-radius: 20px;
}

.server-main {
    min-width: 0;
}

.server-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.server-heading-row h2 {
    margin: 0;
    font-family: var(--ember-heading-font), "Bebas Neue", Impact, sans-serif;
    font-size: clamp(29px, 4vw, 40px);
    line-height: 1;
    letter-spacing: 0.025em;
}

.server-heading-row p {
    margin: 7px 0 0;
    color: var(--muted);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    padding: 7px 11px;
    border: 1px solid rgba(255, 143, 40, 0.33);
    border-radius: 999px;
    color: #ffd9af;
    background: rgba(255, 106, 0, 0.09);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.status-pill::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff7c12;
    box-shadow: 0 0 11px rgba(255, 106, 0, 0.9);
}

.status-pill.offline {
    border-color: rgba(255, 95, 95, 0.28);
    color: #ffd0d0;
    background: rgba(255, 60, 60, 0.08);
}

.status-pill.offline::before {
    background: #ff6868;
    box-shadow: 0 0 10px rgba(255, 75, 75, 0.72);
}

.player-summary {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-top: 28px;
}

.player-count {
    display: flex;
    align-items: baseline;
    gap: 7px;
}

.player-count strong {
    color: #fff;
    font-size: 38px;
    line-height: 1;
}

.player-count span,
.heartbeat {
    color: var(--muted);
    font-size: 13px;
}

.capacity-track {
    height: 9px;
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.38);
}

.capacity-track span {
    display: block;
    width: var(--player-fill);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff4d00, var(--ember-primary), var(--ember-accent));
    box-shadow: 0 0 18px rgba(255, 106, 0, 0.55);
}

.server-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.server-stat {
    min-width: 0;
    padding: 12px 13px;
    border: 1px solid rgba(255, 126, 25, 0.14);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
}

.server-stat span {
    display: block;
    margin-bottom: 5px;
    color: #d89c6b;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.server-stat strong {
    display: block;
    overflow: hidden;
    color: #fff0dd;
    font-size: 14px;
    text-overflow: ellipsis;
}

.ember-section {
    margin: 0 14px 38px;
}

.section-title {
    margin: 0 0 17px;
    font-family: var(--ember-heading-font), "Bebas Neue", Impact, sans-serif;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1;
    letter-spacing: 0.025em;
    text-align: center;
    text-transform: uppercase;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.ember-item {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 100%;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 106, 0, 0.48);
    border-radius: 16px;
    background: linear-gradient(155deg, rgba(38, 19, 10, 0.9), rgba(13, 6, 3, 0.86));
    box-shadow: 0 0 18px rgba(255, 89, 0, 0.13);
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.ember-item::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 0 28px rgba(255, 106, 0, 0.055);
}

.ember-item::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(120deg, rgba(255, 69, 0, 0.055), transparent 40%, rgba(255, 174, 0, 0.04));
}

.ember-item:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 139, 38, 0.9);
    box-shadow:
        0 0 29px rgba(255, 93, 0, 0.27),
        0 24px 60px rgba(0, 0, 0, 0.36);
}

.ember-item.is-featured {
    border-color: rgba(255, 174, 0, 0.92);
    box-shadow:
        0 0 0 1px rgba(255, 174, 0, 0.1),
        0 0 31px rgba(255, 106, 0, 0.24);
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 4;
    padding: 5px 8px;
    border: 1px solid rgba(255, 226, 170, 0.34);
    border-radius: 999px;
    color: #2b0e00;
    background: linear-gradient(90deg, #ff8d19, #ffc257);
    box-shadow: 0 0 13px rgba(255, 120, 10, 0.32);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.product-image-wrap {
    position: relative;
    z-index: 1;
    height: 190px;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 106, 0, 0.18);
    background: radial-gradient(circle at center, rgba(137, 43, 0, 0.16), rgba(0, 0, 0, 0.27));
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    filter: drop-shadow(0 14px 17px rgba(0, 0, 0, 0.46));
    transition: transform 0.28s ease;
}

.ember-item:hover .product-image {
    transform: scale(1.035);
}

.product-copy {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    padding: 18px 18px 8px;
    text-align: center;
}

.product-copy h3 {
    margin: 0 0 7px;
    color: #fff5e8;
    font-family: var(--ember-heading-font), "Bebas Neue", Impact, sans-serif;
    font-size: 25px;
    line-height: 1;
    letter-spacing: 0.02em;
}

.product-copy p {
    margin: 0;
    color: #ddbea4;
    font-size: 13px;
    line-height: 1.55;
}

.product-contents {
    position: relative;
    z-index: 1;
    margin: 6px 18px 2px;
    padding: 9px 11px;
    border: 1px solid rgba(255, 122, 18, 0.14);
    border-radius: 10px;
    color: #eac8aa;
    background: rgba(0, 0, 0, 0.18);
    font-size: 12px;
}

.product-contents summary {
    cursor: pointer;
    color: #ffbd76;
    font-weight: 800;
}

.product-contents ul {
    margin: 9px 0 0;
    padding-left: 18px;
}

.product-price {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;
    min-height: 31px;
    padding: 6px 18px;
    text-align: center;
}

.product-price del {
    color: #a17f67;
    font-size: 12px;
}

.product-price strong {
    color: #fff4e7;
    font-size: 18px;
}

.ember-item > form {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: auto;
    padding: 8px 18px 18px;
}

.purchase-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: auto;
    min-width: 122px;
    margin: 0;
    text-align: center;
    cursor: pointer;
}

.purchase-button:disabled,
.cart-button:disabled,
.discord-button:disabled {
    opacity: 0.72;
}

.empty-shop {
    margin: 0 14px 36px;
    padding: 46px 24px;
    border-radius: 20px;
    text-align: center;
}

.empty-shop > span {
    font-size: 44px;
}

.empty-shop h2 {
    margin: 12px 0 7px;
    font-family: var(--ember-heading-font), "Bebas Neue", Impact, sans-serif;
    font-size: 34px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.empty-shop p {
    margin: 0;
    color: var(--muted);
}

footer {
    display: flex;
    justify-content: center;
    gap: 9px;
    padding: 24px 12px 8px;
    color: rgba(241, 205, 171, 0.8);
    font-size: 12px;
}

footer a {
    color: inherit;
}

.footer-dot {
    opacity: 0.5;
}

@keyframes furnaceFlicker {
    0%   { opacity: 0.45; filter: brightness(1) hue-rotate(0deg); }
    8%   { opacity: 0.6; filter: brightness(1.3) hue-rotate(10deg); }
    17%  { opacity: 0.4; filter: brightness(0.9) hue-rotate(-5deg); }
    32%  { opacity: 0.65; filter: brightness(1.4) hue-rotate(15deg); }
    50%  { opacity: 0.5; filter: brightness(1.1) hue-rotate(-5deg); }
    67%  { opacity: 0.7; filter: brightness(1.5) hue-rotate(5deg); }
    83%  { opacity: 0.35; filter: brightness(0.8) hue-rotate(-10deg); }
    100% { opacity: 0.55; filter: brightness(1.2) hue-rotate(0deg); }
}

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

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .page-shell {
        width: min(var(--page-width), calc(100% - 18px));
    }

    .topbar {
        position: relative;
        align-items: flex-start;
        flex-direction: column;
        padding: 15px;
    }

    .brand {
        width: 100%;
    }

    .brand-title {
        white-space: normal;
    }

    .top-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .top-actions > * {
        flex: 1 1 180px;
        text-align: center;
    }

    .hero,
    .server-panel,
    .ember-section,
    .empty-shop {
        margin-left: 0;
        margin-right: 0;
    }

    .server-heading-row,
    .player-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .server-stat-grid {
        grid-template-columns: 1fr 1fr;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .product-image-wrap {
        height: 215px;
    }

    .ember-item > form {
        padding: 8px 16px 18px;
    }

    .purchase-button {
        min-width: 132px;
    }
}

@media (max-width: 420px) {
    .server-stat-grid {
        grid-template-columns: 1fr;
    }

    footer {
        align-items: center;
        flex-direction: column;
        gap: 4px;
    }

    .footer-dot {
        display: none;
    }
}

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

    .furnace-glow {
        animation: none;
    }
}
