/* ============================================================================
   KerN Online — Dark Fantasy Portal  ·  Design System
   ========================================================================= */

:root {
    --bg-0:        #0a0810;
    --bg-1:        #100c18;
    --bg-2:        #161020;
    --panel:       #1a1424;
    --panel-2:     #211a2e;
    --panel-glass: rgba(28, 21, 40, 0.72);
    --line:        #322641;
    --line-soft:   #2a2036;
    --link:        #f4cf86;
    --header-bg:   linear-gradient(180deg, rgba(10,8,16,.96), rgba(10,8,16,.78));

    --ink:         #ece3d6;
    --ink-strong:  #fbf4e7;
    --muted:       #a99c8c;
    --muted-2:     #7d7363;

    --gold:        #e8b765;
    --gold-2:      #f4cf86;
    --gold-deep:   #b8893f;
    --ember:       #d2543e;
    --ember-2:     #f06a4f;
    --blood:       #8e2b22;
    --arcane:      #8c6cff;
    --teal:        #3fb8a3;

    --rar-common:    #9aa4b2;
    --rar-uncommon:  #4ec06a;
    --rar-rare:      #4d8cf5;
    --rar-epic:      #b15cff;
    --rar-legendary: #ff9d2e;
    --rar-premium:   #ffd35e;

    --radius:   14px;
    --radius-s: 9px;
    --shadow:   0 18px 50px -20px rgba(0,0,0,.85);
    --glow-gold: 0 0 0 1px rgba(232,183,101,.25), 0 0 28px -6px rgba(232,183,101,.45);

    --font-display: "Cinzel", "Trajan Pro", Georgia, serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --maxw: 1200px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    line-height: 1.6;
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(140,108,255,.10), transparent 60%),
        radial-gradient(900px 500px at 90% 0%, rgba(210,84,62,.10), transparent 55%),
        linear-gradient(180deg, var(--bg-1), var(--bg-0) 70%);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

body::before {
    /* faint texture / grain */
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: .04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--link); text-decoration: none; transition: color .15s; }
a:hover { color: var(--gold); }

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink-strong); line-height: 1.15; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
img { max-width: 100%; display: block; }

.wrap { width: min(var(--maxw), calc(100% - 40px)); margin-inline: auto; position: relative; z-index: 1; }
.section { padding: 64px 0; position: relative; z-index: 1; }
.section.tight { padding: 40px 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
.eyebrow {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: .28em;
    font-size: .72rem;
    color: var(--gold);
    margin: 0 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.eyebrow::before, .eyebrow.flank::after { content: ""; width: 28px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-deep)); }

/* ----------------------------------------------------------------- header */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 700; color: var(--ink-strong); white-space: nowrap; }
.brand .sigil {
    width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px;
    background: radial-gradient(circle at 30% 25%, #3a2c12, #1a1206);
    border: 1px solid var(--gold-deep); box-shadow: var(--glow-gold); color: var(--gold-2);
}
.brand b { font-size: 1.15rem; letter-spacing: .04em; }
.brand span { color: var(--gold); }

.main-nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.main-nav a {
    color: var(--muted); font-size: .9rem; font-weight: 600; padding: 8px 12px; border-radius: 8px;
    display: inline-flex; align-items: center; gap: 7px; transition: background .15s, color .15s;
}
.main-nav a svg { width: 15px; height: 15px; opacity: .7; }
.main-nav a:hover { color: var(--ink-strong); background: rgba(232,183,101,.08); }
.main-nav a.active { color: var(--gold-2); background: rgba(232,183,101,.12); }

.brand-logo { max-height: 40px; width: auto; display: block; }

/* dropdown navigation */
.nav-dd { position: relative; display: inline-flex; }
.nav-dd-toggle { color: var(--muted); font-size: .9rem; font-weight: 600; padding: 8px 12px; border-radius: 8px; display: inline-flex; align-items: center; gap: 5px; }
.nav-dd-toggle:hover, .nav-dd:hover .nav-dd-toggle { color: var(--ink-strong); background: rgba(232,183,101,.08); }
.nav-dd .caret { font-size: .7rem; opacity: .7; }
.nav-dd-menu {
    position: absolute; top: 100%; left: 0; min-width: 200px; padding: 8px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
    box-shadow: var(--shadow); display: none; flex-direction: column; gap: 2px; z-index: 60;
}
.nav-dd:hover .nav-dd-menu, .nav-dd:focus-within .nav-dd-menu { display: flex; }
.nav-dd-menu a { color: var(--muted); font-size: .88rem; font-weight: 600; padding: 9px 12px; border-radius: 7px; }
.nav-dd-menu a:hover { color: var(--gold-2); background: rgba(232,183,101,.1); }

/* CMS block body + static pages */
.block-body { color: var(--ink); }
.block-body h2, .block-body h3 { color: var(--ink-strong); }
.block-body a { color: var(--gold-2); }
.block-body ul, .block-body ol { padding-left: 1.4em; }
.block-body img { border-radius: var(--radius-s); margin: 12px 0; }
.page-body { font-size: 1.05rem; line-height: 1.8; }
.page-body h2 { margin-top: 1.4em; }
.page-body img { border-radius: var(--radius-s); margin: 16px 0; }

/* layout builder with live preview */
.builder { display: block; }
.builder-preview { margin-top: 18px; }
/* 2D drag list: cards sized by width so they wrap side by side */
.builder-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.builder-list .module-item { flex: 0 0 auto; width: 100%; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; cursor: grab; }
.builder-list .module-item[data-width="half"] { width: calc(50% - 5px); }
.builder-list .module-item[data-width="third"] { width: calc(33.333% - 7px); }
.builder-list .module-item[data-width="quarter"] { width: calc(25% - 8px); }
.builder-list .module-item.dragging { opacity: .35; }
.builder-list .mi-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.builder-list .mi-grip { color: var(--muted); flex: none; }
.builder-list .mi-name { font-size: .84rem; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.builder-list .mi-ctrls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.builder-list .mi-ctrls .module-width { max-width: 64px; padding: 4px 6px; font-size: .78rem; }
.builder-list .mi-edit { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 2px; }
.builder-list .mi-edit:hover { color: var(--gold-2); }
.builder-list .mi-vis { display: flex; align-items: center; gap: 4px; font-size: .72rem; color: var(--muted); cursor: pointer; }
@media (max-width: 760px) { .builder-list .module-item { width: 100% !important; } }
.builder-preview { position: sticky; top: 16px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-0); }
.builder-preview .pv-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
.builder-preview iframe { width: 100%; height: 70vh; border: 0; display: block; background: var(--bg-0); }
.module-item.dragging { opacity: .4; }

/* inline WYSIWYG module builder */
.builder2-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 0 14px; }
.builder2-frame { width: 100%; height: 78vh; min-height: 460px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-0); display: block; }
.builder-mode .site-header, .builder-mode .site-footer, .builder-mode .demo-banner { pointer-events: none; }
.builder-mode .mod-grid { min-height: 180px; }
.builder-mode .home-mod { position: relative; outline: 1px dashed rgba(232,183,101,.3); outline-offset: -3px; min-height: 64px; cursor: grab; transition: outline-color .12s; }
.builder-mode .home-mod:hover { outline: 2px solid var(--gold); }
.builder-mode .home-mod.dragging { opacity: .4; cursor: grabbing; }
.builder-mode .home-mod.mod-disabled { opacity: .4; filter: grayscale(.7); }
/* route clicks/drags to the module, not its inner content */
.builder-mode .home-mod * { pointer-events: none; }
.builder-mode .home-mod .mod-toolbar, .builder-mode .home-mod .mod-toolbar * { pointer-events: auto; }
.mod-badge { position: absolute; top: 8px; left: 8px; z-index: 40; background: rgba(10,8,16,.9); border: 1px solid var(--line); border-radius: 6px; padding: 2px 9px; font-size: .72rem; color: var(--gold-2); opacity: 0; transition: opacity .12s; }
.builder-mode .home-mod:hover .mod-badge { opacity: 1; }
.mod-toolbar { position: absolute; top: 8px; right: 8px; z-index: 41; display: flex; align-items: center; gap: 2px; background: rgba(10,8,16,.95); border: 1px solid var(--gold-deep); border-radius: 9px; padding: 3px; box-shadow: 0 8px 20px -8px #000; opacity: 0; transition: opacity .12s; }
.builder-mode .home-mod:hover .mod-toolbar { opacity: 1; }
.mod-toolbar .mod-grab { padding: 2px 6px; color: var(--muted); cursor: grab; font-size: .9rem; }
.mod-tb-btn { background: none; border: 0; color: var(--ink); cursor: pointer; padding: 3px 7px; border-radius: 6px; font-size: .82rem; line-height: 1; }
.mod-tb-btn:hover { background: rgba(232,183,101,.18); color: var(--gold-2); }
.mod-tb-btn.active { background: var(--gold); color: #1c1304; }

/* WYSIWYG editor */
.wysiwyg { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--bg-2); }
.wz-tb { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.wz-btn { background: transparent; border: 1px solid transparent; color: var(--ink); border-radius: 6px; min-width: 30px; height: 30px; padding: 0 8px; cursor: pointer; font-size: .9rem; line-height: 1; }
.wz-btn:hover { background: rgba(232,183,101,.12); border-color: var(--line); color: var(--gold-2); }
.wz-btn.active { background: rgba(232,183,101,.18); color: var(--gold-2); }
.wz-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.wz-area { min-height: 160px; max-height: 460px; overflow-y: auto; padding: 12px 14px; color: var(--ink); line-height: 1.7; outline: none; }
.wz-area:focus { box-shadow: inset 0 0 0 2px rgba(232,183,101,.25); }
.wz-area h2 { font-size: 1.4rem; } .wz-area h3 { font-size: 1.15rem; }
.wz-area a { color: var(--gold-2); }
.wz-area img { max-width: 100%; border-radius: 8px; margin: 8px 0; }
.wz-area blockquote { border-left: 3px solid var(--gold-deep); margin: 10px 0; padding-left: 14px; color: var(--muted); }
.wz-area ul, .wz-area ol { padding-left: 1.4em; }

/* menu drag & drop list */
#menuList { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; cursor: grab; }
.menu-item.is-child { margin-left: 28px; background: var(--bg-1); }
.menu-item.dragging { opacity: .4; }
.menu-item .mi-grip { color: var(--muted); }
.menu-item .mi-label { font-weight: 700; flex: 1; }
.menu-item .mi-target { color: var(--muted-2); font-size: .8rem; }
.menu-item select.input { max-width: 170px; padding: 6px 8px; font-size: .82rem; }

/* admin modal (popup editors) */
.modal { position: fixed; inset: 0; z-index: 300; display: none; align-items: flex-start; justify-content: center; padding: 5vh 16px; background: rgba(5,3,9,.7); backdrop-filter: blur(4px); overflow-y: auto; }
.modal.open { display: flex; }
.modal-card { background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--gold-deep); border-radius: var(--radius); box-shadow: var(--shadow), var(--glow-gold); width: min(560px, 100%); max-height: 90vh; overflow-y: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); }
.modal-head h3 { margin: 0; font-size: 1.15rem; }
.modal-body { padding: 18px 20px; }
.modal-close { background: none; border: 1px solid var(--line); color: var(--ink); width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 1.1rem; }
.modal-close:hover { border-color: var(--gold); color: var(--gold-2); }

/* colour swatch grid */
.color-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 14px; }
.color-field { display: flex; align-items: center; gap: 10px; }
.color-field input[type=color] { width: 44px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); cursor: pointer; padding: 2px; }
.color-field .cf-label { flex: 1; } .color-field .cf-label b { display: block; font-size: .9rem; }
.color-field .cf-label span { font-size: .76rem; color: var(--muted-2); }
.color-field input[type=text] { width: 96px; }
.module-item .mi-edit { color: var(--muted); }
.module-item .mi-edit:hover { color: var(--gold-2); }
@media (max-width: 900px) { .builder { grid-template-columns: 1fr; } .builder-preview { position: static; } }

.header-cta { display: flex; align-items: center; gap: 8px; }
.lang-switch { display: inline-flex; gap: 1px; align-items: center; font-size: .74rem; font-weight: 700; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang-switch a { color: var(--muted); padding: 5px 8px; }
.lang-switch a:hover { color: var(--gold-2); background: rgba(232,183,101,.08); }
.lang-switch a.active { color: #1c1304; background: var(--gold); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 8px; padding: 8px 10px; cursor: pointer; }

/* ------------------------------------------------------------------ buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--font-body); font-weight: 700; font-size: .92rem;
    padding: 11px 20px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
    transition: transform .12s, box-shadow .2s, background .2s, border-color .2s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-gold {
    color: #1c1304;
    background: linear-gradient(180deg, var(--gold-2), var(--gold-deep));
    box-shadow: 0 8px 22px -10px rgba(232,183,101,.7), inset 0 1px 0 rgba(255,255,255,.4);
}
.btn-gold:hover { color: #1c1304; box-shadow: 0 10px 30px -8px rgba(232,183,101,.9); }
.btn-ghost { color: var(--ink); background: rgba(255,255,255,.03); border-color: var(--line); }
.btn-ghost:hover { color: var(--ink-strong); border-color: var(--gold-deep); background: rgba(232,183,101,.07); }
.btn-ember { color: #fff; background: linear-gradient(180deg, var(--ember-2), var(--blood)); box-shadow: 0 8px 22px -12px rgba(210,84,62,.8); }
.btn-ember:hover { color: #fff; }
.btn-sm { padding: 8px 14px; font-size: .84rem; }
.btn-block { width: 100%; }

/* -------------------------------------------------------------------- panels */
.panel {
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.panel.pad { padding: 24px; }
.card {
    background: linear-gradient(180deg, var(--panel), var(--bg-2));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .18s, border-color .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-4px); border-color: var(--gold-deep); box-shadow: var(--shadow), var(--glow-gold); }

.grid { display: grid; gap: 20px; }
.grid.cols-1 { grid-template-columns: 1fr; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.grid.cols-6 { grid-template-columns: repeat(6, 1fr); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head p { margin: 6px 0 0; max-width: 56ch; }

/* --------------------------------------------------------------------- hero */
.hero { position: relative; padding: 96px 0 84px; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-bg { position: absolute; inset: 0; z-index: 0; opacity: .9; }
/* ----------------------------------------------------- module grid system */
.mod-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px 28px; width: min(1240px, 100% - 36px); margin-inline: auto; }
.mod-grid > .home-mod { grid-column: span var(--span, 12); min-width: 0; }
/* let module content fill its column instead of its own 1200px wrap */
.mod-grid > .home-mod > .section, .mod-grid > .home-mod > section { padding-left: 0; padding-right: 0; }
.mod-grid > .home-mod .wrap { width: 100%; max-width: none; padding-left: 0; padding-right: 0; }
/* hero/full-bleed breakout (progressive — needs :has support) */
.mod-grid > .home-mod:has(> .hero) { grid-column: 1 / -1; width: 100vw; margin-left: calc(50% - 50vw); }
.mod-grid > .home-mod:has(> .hero) .wrap { width: min(1200px, 100% - 40px); margin-inline: auto; }
/* responsive: collapse on tablets, single column on phones */
@media (min-width: 861px) and (max-width: 1150px) {
    .mod-grid > .home-mod[data-width="quarter"], .mod-grid > .home-mod[data-width="third"] { grid-column: span 6; }
}
@media (max-width: 860px) {
    .mod-grid { gap: 0; width: 100%; }
    .mod-grid > .home-mod { grid-column: 1 / -1 !important; }
    .mod-grid > .home-mod .wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
}

/* per-page content background */
.page-bg.has-bg { padding: 36px 0; }
.page-bg.has-bg .mod-grid > .home-mod .page-body,
.page-bg.has-bg .mod-grid > .home-mod .panel { background: var(--panel-glass); backdrop-filter: blur(2px); }

/* procedural screenshot SVGs fill their container */
.hero-bg > svg, .news-img > svg, .news-card .news-img > svg, .lightbox .frame svg, .lightbox .frame > div { width: 100%; height: 100%; display: block; }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,8,16,.2), var(--bg-0) 92%); }
.hero .wrap { position: relative; z-index: 2; max-width: 880px; }
.hero h1 { margin-bottom: 18px; text-shadow: 0 4px 30px rgba(0,0,0,.6); }
.hero h1 .accent { background: linear-gradient(90deg, var(--gold-2), var(--ember-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: clamp(1.05rem, 1.6vw, 1.28rem); color: var(--ink); max-width: 58ch; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.stat-bar { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 44px; }
.stat-bar .stat {
    flex: 1 1 150px; background: var(--panel-glass); border: 1px solid var(--line);
    border-radius: var(--radius-s); padding: 16px 18px; backdrop-filter: blur(6px);
}
.stat .v { font-family: var(--font-display); font-size: 1.7rem; color: var(--gold-2); line-height: 1; }
.stat .k { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-top: 6px; }
.stat .v .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px var(--teal); margin-right: 6px; vertical-align: middle; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ------------------------------------------------------------------ badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .06em; border: 1px solid currentColor; }
.tag { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 6px; background: rgba(255,255,255,.05); color: var(--muted); }

.rar-common    { color: var(--rar-common); }
.rar-uncommon  { color: var(--rar-uncommon); }
.rar-rare      { color: var(--rar-rare); }
.rar-epic      { color: var(--rar-epic); }
.rar-legendary { color: var(--rar-legendary); }
.rar-premium   { color: var(--rar-premium); }
.ring-common    { box-shadow: inset 0 0 0 1px var(--rar-common); }
.ring-uncommon  { box-shadow: inset 0 0 0 1px var(--rar-uncommon), 0 0 18px -8px var(--rar-uncommon); }
.ring-rare      { box-shadow: inset 0 0 0 1px var(--rar-rare), 0 0 18px -7px var(--rar-rare); }
.ring-epic      { box-shadow: inset 0 0 0 1px var(--rar-epic), 0 0 20px -6px var(--rar-epic); }
.ring-legendary { box-shadow: inset 0 0 0 1px var(--rar-legendary), 0 0 24px -5px var(--rar-legendary); }
.ring-premium   { box-shadow: inset 0 0 0 1px var(--rar-premium), 0 0 26px -5px var(--rar-premium); }

/* -------------------------------------------------------------- item cards */
.item-card { padding: 16px; text-align: center; }
.item-art { width: 100%; aspect-ratio: 1; border-radius: var(--radius-s); display: grid; place-items: center; margin-bottom: 12px; background: radial-gradient(circle at 50% 35%, #2a2236, #120d1a); position: relative; }
.item-art svg { width: 56%; height: 56%; }
.item-card h4 { margin: 0 0 2px; font-size: 1rem; }
.item-card .price { font-family: var(--font-display); color: var(--gold-2); font-size: 1.1rem; margin-top: 8px; }
.item-card .stat-line { font-size: .8rem; color: var(--muted); }

/* --------------------------------------------------------------- ranking table */
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table th, .lb-table td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.lb-table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted-2); font-weight: 700; }
.lb-table tbody tr { transition: background .15s; }
.lb-table tbody tr:hover { background: rgba(232,183,101,.05); }
.lb-rank { font-family: var(--font-display); font-size: 1.1rem; color: var(--muted); width: 60px; }
.lb-rank.top1 { color: var(--gold-2); } .lb-rank.top2 { color: #cdd3dc; } .lb-rank.top3 { color: #d98a4e; }
.lb-name { font-weight: 700; color: var(--ink-strong); }
.lb-class { color: var(--muted); font-size: .85rem; }
.player-avatar { width: 36px; height: 36px; border-radius: 8px; background: linear-gradient(135deg,#2c2238,#171019); display: inline-grid; place-items: center; font-family: var(--font-display); color: var(--gold-2); border: 1px solid var(--line); vertical-align: middle; margin-right: 10px; }

/* --------------------------------------------------------------- kill feed */
.kill-feed { display: grid; gap: 10px; }
.kill-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--line-soft); border-radius: var(--radius-s); background: linear-gradient(90deg, rgba(142,43,34,.10), transparent 60%); }
.kill-icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 8px; background: rgba(210,84,62,.12); color: var(--ember-2); }
.kill-text b { color: var(--ink-strong); }
.kill-text .vs { color: var(--ember-2); font-weight: 700; }
.kill-meta { margin-left: auto; text-align: right; color: var(--muted); font-size: .82rem; white-space: nowrap; }

/* ------------------------------------------------------------------ news */
.news-card .news-img { aspect-ratio: 16/9; background: linear-gradient(135deg,#241b30,#130e1b); position: relative; }
.news-card .news-body { padding: 18px 20px 22px; }
.news-card .news-cat { position: absolute; top: 12px; left: 12px; }
.news-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.news-card time { color: var(--muted-2); font-size: .8rem; }

/* --------------------------------------------------------------- gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.gallery .shot { position: relative; aspect-ratio: 16/10; border-radius: var(--radius-s); overflow: hidden; cursor: pointer; border: 1px solid var(--line); }
.gallery .shot img, .gallery .shot svg { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery .shot:hover img, .gallery .shot:hover svg { transform: scale(1.07); }
.gallery .shot .cap { position: absolute; inset: auto 0 0 0; padding: 22px 12px 10px; background: linear-gradient(transparent, rgba(0,0,0,.8)); font-size: .82rem; color: var(--ink); opacity: 0; transition: opacity .2s; }
.gallery .shot:hover .cap { opacity: 1; }

.lightbox { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; background: rgba(5,3,9,.92); backdrop-filter: blur(6px); padding: 30px; }
.lightbox.open { display: flex; }
.lightbox figure { margin: 0; max-width: 1000px; width: 100%; }
.lightbox .frame { border: 1px solid var(--gold-deep); border-radius: var(--radius); overflow: hidden; box-shadow: var(--glow-gold); background: var(--bg-2); }
.lightbox figcaption { text-align: center; color: var(--ink); margin-top: 14px; font-family: var(--font-display); }
.lightbox .lb-close, .lightbox .lb-nav { position: absolute; background: rgba(26,20,36,.8); border: 1px solid var(--line); color: var(--ink); width: 46px; height: 46px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; font-size: 1.3rem; }
.lightbox .lb-close { top: 22px; right: 22px; }
.lightbox .lb-nav.prev { left: 22px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-nav.next { right: 22px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-nav:hover, .lightbox .lb-close:hover { border-color: var(--gold); color: var(--gold-2); }
.lb-loader { padding: 80px; text-align: center; color: var(--muted); }

/* ------------------------------------------------------------- premium tiers */
.tier { padding: 28px 24px; display: flex; flex-direction: column; position: relative; }
.tier.featured { border-color: var(--gold-deep); box-shadow: var(--glow-gold); }
.tier .ribbon { position: absolute; top: 16px; right: -2px; background: linear-gradient(180deg,var(--gold-2),var(--gold-deep)); color: #1c1304; font-weight: 800; font-size: .68rem; letter-spacing: .1em; padding: 5px 14px; border-radius: 6px 0 0 6px; }
.tier h3 { font-size: 1.5rem; margin-bottom: 4px; }
.tier .tier-price { font-family: var(--font-display); font-size: 2.4rem; color: var(--gold-2); margin: 8px 0; }
.tier .tier-price small { font-size: .9rem; color: var(--muted); font-family: var(--font-body); }
.tier ul { list-style: none; padding: 0; margin: 16px 0 24px; display: grid; gap: 10px; }
.tier ul li { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; }
.tier ul li svg { width: 18px; height: 18px; color: var(--teal); flex: none; margin-top: 3px; }
.tier .btn { margin-top: auto; }

/* --------------------------------------------------------------- downloads */
.dl-row { display: flex; align-items: center; gap: 18px; padding: 20px 22px; }
.dl-row .dl-os { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 12px; background: rgba(232,183,101,.08); color: var(--gold-2); border: 1px solid var(--line); }
.dl-row .dl-meta { margin-left: auto; text-align: right; color: var(--muted); font-size: .85rem; }

/* ----------------------------------------------------------------- forms */
.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; }
.input, .textarea, select.input {
    width: 100%; background: var(--bg-2); border: 1px solid var(--line); color: var(--ink);
    border-radius: 9px; padding: 11px 14px; font: inherit; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, select.input:focus { outline: none; border-color: var(--gold-deep); box-shadow: 0 0 0 3px rgba(232,183,101,.15); }
.textarea { min-height: 120px; resize: vertical; }
.auth-card { max-width: 440px; margin: 60px auto; }
.alert { padding: 12px 16px; border-radius: 9px; margin-bottom: 16px; border: 1px solid; font-size: .9rem; }
.alert-error { background: rgba(210,84,62,.12); border-color: var(--ember); color: var(--ember-2); }
.alert-success { background: rgba(63,184,163,.12); border-color: var(--teal); color: var(--teal); }
.alert-info { background: rgba(140,108,255,.1); border-color: var(--arcane); color: #b8a6ff; }

/* --------------------------------------------------------------- community */
.post { display: flex; gap: 14px; padding: 18px 20px; }
.post .post-av { width: 44px; height: 44px; flex: none; border-radius: 10px; display: grid; place-items: center; font-family: var(--font-display); background: linear-gradient(135deg,#2c2238,#171019); color: var(--gold-2); border: 1px solid var(--line); }
.post .post-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.post .post-head b { color: var(--ink-strong); }
.post .post-head .when { color: var(--muted-2); font-size: .8rem; }
.post .post-body { color: var(--ink); margin: 4px 0 0; }
.post .post-tag { font-size: .72rem; color: var(--arcane); }

/* --------------------------------------------------------------- account */
.account-grid { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.side-nav { display: grid; gap: 4px; }
.side-nav a { padding: 11px 14px; border-radius: 9px; color: var(--muted); font-weight: 600; display: flex; gap: 10px; align-items: center; }
.side-nav a:hover, .side-nav a.active { background: rgba(232,183,101,.1); color: var(--gold-2); }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; color: var(--ink-strong); }

/* --------------------------------------------------------------- admin */
.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.admin-side { background: var(--bg-1); border-right: 1px solid var(--line); padding: 22px 16px; }
.admin-side .brand { margin-bottom: 24px; }
.admin-main { padding: 28px 32px; }
.admin-side a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: .92rem; }
.admin-side a:hover, .admin-side a.active { background: rgba(232,183,101,.1); color: var(--gold-2); }
.admin-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted-2); margin: 16px 0 4px; padding: 0 12px; font-weight: 700; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 16px; margin-bottom: 28px; }
.stat-tile { padding: 18px 20px; }
.stat-tile .v { font-family: var(--font-display); font-size: 1.9rem; color: var(--gold-2); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.admin-table th { color: var(--muted-2); text-transform: uppercase; font-size: .72rem; letter-spacing: .1em; }

/* ------------------------------------------------------------------ footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-1); margin-top: 40px; padding: 48px 0 28px; position: relative; z-index: 1; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 30px; }
.footer-grid h4 { font-family: var(--font-body); font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted-2); }
.footer-grid a { display: block; color: var(--muted); padding: 4px 0; font-size: .9rem; }
.footer-grid a:hover { color: var(--gold-2); }
.footer-legal { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-legal a { color: var(--muted); font-size: .85rem; }
.footer-legal a:hover { color: var(--gold-2); }
.footer-bottom { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted-2); font-size: .82rem; }
.footer-note { max-width: 38ch; color: var(--muted); font-size: .9rem; margin-top: 10px; }

.demo-banner { background: linear-gradient(90deg, rgba(140,108,255,.18), rgba(210,84,62,.12)); border-bottom: 1px solid var(--line); text-align: center; padding: 7px 12px; font-size: .82rem; color: var(--ink); }
.demo-banner b { color: var(--gold-2); }

/* ----------------------------------------------------------------- utils */
.flex { display: flex; } .between { justify-content: space-between; } .items-center { align-items: center; } .gap-10 { gap: 10px; } .gap-16 { gap: 16px; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-24 { margin-top: 24px; } .mb-0 { margin-bottom: 0; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); margin: 28px 0; border: 0; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* --------------------------------------------------------------- responsive */
@media (max-width: 980px) {
    .grid.cols-4, .grid.cols-5, .grid.cols-6 { grid-template-columns: repeat(2, 1fr); }
    .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .account-grid { grid-template-columns: 1fr; }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-side { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 760px) {
    .main-nav { position: fixed; inset: 68px 0 auto 0; flex-direction: column; background: var(--bg-1); border-bottom: 1px solid var(--line); padding: 12px; gap: 4px; display: none; }
    .main-nav.open { display: flex; }
    .main-nav a { padding: 12px 14px; }
    .nav-toggle { display: inline-flex; margin-left: auto; }
    .header-cta .btn-label { display: none; }
    .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.cols-5, .grid.cols-6 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .stat-bar .stat { flex-basis: 45%; }
    .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dt { margin-top: 8px; }
}
