/* =============================================================================
   Jumpstart Archive — arcane design system
   Dark, mystical Magic-inspired UI for the private dashboard & builder.
   Public deck pages have their own parchment styling in deck-public.css.
   ========================================================================== */

:root {
    /* Night / surfaces */
    --night-950: #120a1b;
    --night-900: #170d20;
    --night-800: #1f142b;
    --night-700: #281a36;
    --ink: #ece7f2;
    --muted: #a99fb6;
    --muted-2: #7c7089;

    /* Accents */
    --gold: #d8ab52;
    --gold-soft: #f0cf82;
    --flame: #e55f4d;
    --flame-deep: #bb3f32;
    --mint: #6fbf9a;
    --amethyst: #9b6dd6;

    /* Mana colours (WUBRG + C) */
    --mana-w: #f6f0d4;
    --mana-u: #3a86c8;
    --mana-b: #3a3542;
    --mana-r: #d3552f;
    --mana-g: #3f9b5c;
    --mana-c: #b9b0a4;

    /* Lines & glass */
    --line: rgba(255, 255, 255, .09);
    --line-strong: rgba(255, 255, 255, .16);
    --glass: rgba(255, 255, 255, .035);
    --glass-2: rgba(255, 255, 255, .06);

    --radius: 18px;
    --radius-lg: 26px;
    --radius-sm: 12px;
    --shadow: 0 24px 60px rgba(10, 5, 18, .5);
    --shadow-soft: 0 12px 32px rgba(10, 5, 18, .34);

    --font-display: "Cinzel", Georgia, serif;
    --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-serif: "EB Garamond", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

/* overflow-x: clip prevents horizontal overflow WITHOUT creating a scroll
   container (so the sticky navbar keeps working). */
html { scroll-behavior: smooth; overflow-x: clip; }

body.app-body {
    min-height: 100vh;
    max-width: 100%;
    margin: 0;
    color: var(--ink);
    font-family: var(--font-body);
    background: var(--night-900);
    display: flex;
    flex-direction: column;
    overflow-x: clip;
}

:focus-visible { outline: 3px solid rgba(240, 207, 130, .72); outline-offset: 3px; }

/* Media never forces the page wider than the viewport. */
img, svg, video, canvas { max-width: 100%; }

.arcane-backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 88% -4%, rgba(229, 95, 77, .20), transparent 32%),
        radial-gradient(circle at 4% 8%, rgba(155, 109, 214, .16), transparent 34%),
        radial-gradient(circle at 50% 120%, rgba(216, 171, 82, .12), transparent 46%),
        linear-gradient(180deg, var(--night-950), var(--night-900) 40%, var(--night-950));
}

a { color: var(--gold-soft); text-decoration: none; }
a:hover { color: var(--gold); }

::selection { background: rgba(229, 95, 77, .35); }

/* ---------- Navigation ---------------------------------------------------- */

.app-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(18, 10, 27, .78);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.app-nav__inner {
    position: relative;
    width: min(100%, 1180px);
    margin: 0 auto;
    padding: .7rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Region that holds the links + actions. Inline on desktop, a drawer on mobile. */
.nav-collapse {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.nav-toggle { display: none; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.18rem;
    letter-spacing: .01em;
    color: var(--ink);
}
.brand:hover { color: var(--ink); }

.brand__orb {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}
.brand__orb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand__accent { color: var(--gold); }

.app-nav__links {
    display: flex;
    gap: .35rem;
    min-width: 0;
}

.nav-link-item {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .5rem .85rem;
    border-radius: 11px;
    color: var(--muted);
    font-weight: 600;
    font-size: .92rem;
    transition: background .18s, color .18s;
}
.nav-link-item:hover { color: var(--ink); background: var(--glass); }
.nav-link-item.is-active { color: var(--gold-soft); background: rgba(216, 171, 82, .12); }

.app-nav__actions { display: flex; align-items: center; gap: .6rem; margin-left: auto; }

.user-chip__btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .28rem .5rem .28rem .3rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--glass);
    color: var(--muted);
    cursor: pointer;
}
.user-chip__btn:hover { border-color: var(--line-strong); color: var(--ink); }
.user-chip__avatar {
    width: 30px; height: 30px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--amethyst), var(--flame));
    color: #fff; font-weight: 800; font-size: .85rem;
}

.lang-switch__btn {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .32rem .6rem;
    border: 1px solid var(--line); border-radius: 999px;
    background: var(--glass); color: var(--muted);
    font-weight: 700; font-size: .8rem; cursor: pointer;
}
.lang-switch__btn:hover { color: var(--ink); border-color: var(--line-strong); }
.arcane-menu form { margin: 0; }
.arcane-menu form .dropdown-item { width: 100%; text-align: left; background: none; border: 0; cursor: pointer; }
.arcane-menu .dropdown-item.active { color: var(--gold-soft); background: rgba(216,171,82,.12); }

.arcane-menu {
    background: var(--night-800);
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
}
.arcane-menu .dropdown-item { color: var(--muted); border-radius: 9px; }
.arcane-menu .dropdown-item:hover { background: var(--glass-2); color: var(--ink); }

/* ---------- Buttons ------------------------------------------------------- */

.btn { font-weight: 700; border-radius: 12px; transition: transform .1s, box-shadow .2s, background .2s; }
.btn:active { transform: translateY(1px); }

.btn-flame {
    color: #2a1410;
    background: linear-gradient(135deg, var(--gold-soft), var(--flame));
    border: 0;
    box-shadow: 0 10px 26px rgba(229, 95, 77, .28);
}
.btn-flame:hover { color: #2a1410; box-shadow: 0 14px 32px rgba(229, 95, 77, .42); }

.btn-gold {
    color: #241a08;
    background: linear-gradient(135deg, #f2d68e, var(--gold));
    border: 0;
}
.btn-gold:hover { color: #241a08; }

.btn-ghost {
    color: var(--ink);
    background: var(--glass);
    border: 1px solid var(--line-strong);
}
.btn-ghost:hover { color: var(--ink); background: var(--glass-2); border-color: var(--gold); }

.btn-outline-arcane {
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line-strong);
}
.btn-outline-arcane:hover { color: var(--ink); border-color: var(--gold); background: var(--glass); }

.btn-danger-soft {
    color: #ffb9ae;
    background: rgba(229, 95, 77, .12);
    border: 1px solid rgba(229, 95, 77, .35);
}
.btn-danger-soft:hover { color: #fff; background: rgba(229, 95, 77, .8); border-color: transparent; }

/* ---------- Layout & panels ---------------------------------------------- */

.app-main {
    flex: 1;
    width: min(100%, 1180px);
    margin: 0 auto;
    padding: 2.2rem 1.2rem 3.5rem;
}

.panel {
    background: var(--glass);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.6rem;
}
.page-head--hero {
    position: relative; overflow: hidden; padding: clamp(1.4rem, 4vw, 2.4rem);
    border-radius: var(--radius-lg);
    background: radial-gradient(circle at 92% 10%, rgba(229,95,77,.18), transparent 32%), radial-gradient(circle at 8% 100%, rgba(155,109,214,.16), transparent 38%), var(--glass);
    box-shadow: var(--shadow-soft);
}
.page-head--hero::after { content: "✦"; position: absolute; right: 5%; top: 50%; transform: translateY(-50%); color: rgba(240,207,130,.12); font-size: clamp(5rem, 14vw, 10rem); pointer-events: none; }
.page-head h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.6rem, 3.6vw, 2.3rem);
    margin: 0;
    letter-spacing: .01em;
}
.page-head .eyebrow {
    display: inline-block;
    color: var(--gold);
    font-weight: 700;
    font-size: .75rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    margin-bottom: .3rem;
}
.page-head p { color: var(--muted); margin: .35rem 0 0; }

.section-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* ---------- Flash messages ------------------------------------------------ */

.flash-stack {
    position: fixed;
    z-index: 80;
    top: 5rem;
    right: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    width: min(92vw, 380px);
}
.flash {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .85rem 1rem;
    border-radius: 14px;
    background: var(--night-800);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-soft);
    animation: flash-in .35s cubic-bezier(.2, .9, .3, 1.2);
}
.flash i:first-child { font-size: 1.15rem; }
.flash span { flex: 1; font-size: .92rem; }
.flash--success { border-left: 3px solid var(--mint); }
.flash--success i:first-child { color: var(--mint); }
.flash--error { border-left: 3px solid var(--flame); }
.flash--error i:first-child { color: var(--flame); }
.flash--warning { border-left: 3px solid var(--gold); }
.flash--warning i:first-child { color: var(--gold); }
.flash--info i:first-child { color: var(--amethyst); }
.flash__close { background: none; border: 0; color: var(--muted-2); cursor: pointer; padding: 0; }
.flash__close:hover { color: var(--ink); }
@keyframes flash-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* ---------- Mana pips ----------------------------------------------------- */

.mana-row { display: inline-flex; gap: .28rem; align-items: center; }
.mana-pip {
    width: 22px; height: 22px;
    display: grid; place-items: center;
    border-radius: 50%;
    font-weight: 800; font-size: .7rem;
    color: #1a1420;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.3);
}
.mana-pip[data-c="W"] { background: var(--mana-w); }
.mana-pip[data-c="U"] { background: var(--mana-u); color: #fff; }
.mana-pip[data-c="B"] { background: var(--mana-b); color: #e9e4f0; }
.mana-pip[data-c="R"] { background: var(--mana-r); color: #fff; }
.mana-pip[data-c="G"] { background: var(--mana-g); color: #fff; }
.mana-pip[data-c="C"] { background: var(--mana-c); }

/* ---------- Badges -------------------------------------------------------- */

.tag {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .24rem .6rem;
    border-radius: 999px;
    font-size: .72rem; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase;
    border: 1px solid var(--line-strong);
    color: var(--muted);
}
.tag--draft { color: var(--gold-soft); border-color: rgba(216,171,82,.4); background: rgba(216,171,82,.1); }
.tag--published { color: var(--mint); border-color: rgba(111,191,154,.4); background: rgba(111,191,154,.1); }
.tag--archived { color: var(--muted-2); }

.code-chip {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .22rem .55rem;
    border-radius: 8px;
    font-family: var(--font-body); font-weight: 700; font-size: .74rem; letter-spacing: .08em;
    background: rgba(255,255,255,.05); border: 1px solid var(--line);
    color: var(--muted);
}

/* ---------- Landing ------------------------------------------------------- */

.landing { width: min(100%, 1180px); margin: 0 auto; padding: 2.4rem 1.2rem 3.5rem; }

.hero__eyebrow {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .4rem .9rem; margin-bottom: 1.3rem;
    border: 1px solid var(--line-strong); border-radius: 999px;
    color: var(--gold-soft); font-weight: 600; font-size: .8rem; letter-spacing: .06em;
    background: var(--glass);
}
.hero__lead { color: var(--muted); font-size: clamp(1rem, 2.2vw, 1.2rem); line-height: 1.6; margin: 0 0 1.6rem; max-width: 46ch; }
.hero__cta { display: flex; gap: .7rem; flex-wrap: wrap; }
.hero__cta .btn { padding: .7rem 1.4rem; font-size: 1rem; }

/* Hero: text + floating card stage */
.hero2 {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 2rem;
    align-items: center;
    padding: clamp(1.4rem, 4vw, 3.4rem); margin-bottom: 2.6rem;
    border-radius: 32px; overflow: hidden;
    background: radial-gradient(circle at 80% 15%, rgba(229,95,77,.14), transparent 30%), radial-gradient(circle at 15% 90%, rgba(155,109,214,.11), transparent 36%), rgba(255,255,255,.018);
    box-shadow: var(--shadow-soft);
}
.hero2__text h1 {
    font-family: var(--font-display);
    font-size: clamp(2.3rem, 5.5vw, 4rem);
    line-height: 1.03;
    font-weight: 700;
    margin: 0 0 1rem;
    max-width: 16ch;
    background: linear-gradient(180deg, #fff 25%, var(--gold-soft));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero__chips { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.6rem; }
.hero__proof { display: flex; gap: .75rem 1.25rem; flex-wrap: wrap; margin-top: 1.15rem; color: var(--muted-2); font-size: .75rem; }
.hero__proof span { display: inline-flex; align-items: center; gap: .35rem; }
.hero__proof b, .hero__proof i { color: var(--gold-soft); }
.hero-chip {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .45rem .85rem; border-radius: 999px;
    border: 1px solid var(--line); background: var(--glass);
    color: var(--muted); font-weight: 600; font-size: .84rem; transition: all .15s;
}
.hero-chip:hover { color: var(--ink); border-color: var(--gold); transform: translateY(-2px); }

.hero2__stage { position: relative; min-height: 340px; }
.float-card {
    position: absolute;
    width: 190px; aspect-ratio: 63/88;
    border-radius: 14px;
    background: var(--night-700) center/cover no-repeat;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,.1);
    transform: translate(var(--px, 0), var(--py, 0)) rotate(var(--rot, 0deg));
    transition: transform .25s ease;
    animation: floaty 6s ease-in-out infinite;
}
.float-card--1 { --rot: -9deg; left: 6%;  top: 12%;  z-index: 1; animation-delay: 0s; }
.float-card--2 { --rot: 4deg;  left: 34%; top: 0;    z-index: 3; width: 210px; animation-delay: .8s; }
.float-card--3 { --rot: 12deg; right: 4%; top: 20%;  z-index: 2; animation-delay: 1.6s; }
.float-card.is-placeholder { background: linear-gradient(150deg, var(--night-700), var(--night-950)); }
.float-card.is-placeholder[data-c="R"] { box-shadow: 0 24px 60px rgba(211,85,47,.35); }
.float-card.is-placeholder[data-c="U"] { box-shadow: 0 24px 60px rgba(58,134,200,.35); }
.float-card.is-placeholder[data-c="G"] { box-shadow: 0 24px 60px rgba(63,155,92,.35); }
@keyframes floaty { 0%,100% { margin-top: 0; } 50% { margin-top: -12px; } }
@media (prefers-reduced-motion: reduce) { .float-card { animation: none; } }

/* Home sections */
.home-section { margin-top: 1rem; }
.home-section--featured { padding: clamp(1rem, 2vw, 1.4rem); border-radius: var(--radius-lg); background: linear-gradient(180deg, rgba(255,255,255,.025), transparent); }
.home-section__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.home-section__head .section-title { margin: 0; }

.home-tools { margin-top: 2.4rem; }
.tool-cta {
    display: flex; align-items: center; gap: 1.1rem;
    padding: 1.3rem 1.5rem; border-radius: var(--radius);
    background: radial-gradient(circle at 0 0, rgba(216,171,82,.14), transparent 60%), var(--glass);
    border: 1px solid var(--line); flex-wrap: wrap;
}
.tool-cta { transition: border-color .2s, transform .2s, box-shadow .2s; }
.tool-cta:hover { border-color: rgba(216,171,82,.35); transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.tool-cta__icon {
    width: 52px; height: 52px; flex: none; display: grid; place-items: center;
    border-radius: 15px; font-size: 1.5rem; color: var(--flame);
    background: rgba(229,95,77,.14); border: 1px solid rgba(229,95,77,.28);
}
.tool-cta__body { flex: 1; min-width: 180px; }
.tool-cta__body h3 { font-family: var(--font-display); margin: 0 0 .2rem; }
.tool-cta__body p { color: var(--muted); margin: 0; font-size: .9rem; }
.home-steps { margin-top: 3.5rem; }
.home-steps .eyebrow { color: var(--gold); font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.step-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.step-card { position: relative; min-height: 180px; padding: 1.35rem; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); }
.step-card > span { position: absolute; right: 1rem; top: .6rem; color: rgba(255,255,255,.05); font-family: var(--font-display); font-size: 3.2rem; font-weight: 700; }
.step-card > i { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 1rem; border-radius: 13px; color: var(--gold-soft); background: rgba(216,171,82,.11); border: 1px solid rgba(216,171,82,.22); }
.step-card h3 { margin: 0 0 .4rem; font-family: var(--font-display); font-size: 1rem; }
.step-card p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.55; }

@media (max-width: 820px) {
    .hero2 { grid-template-columns: 1fr; gap: 1rem; padding-bottom: 1.5rem; }
    .hero2__stage { min-height: 260px; order: 2; margin-top: 1rem; }
    .float-card { width: 150px; }
    .float-card--2 { width: 165px; }
    .step-grid { grid-template-columns: 1fr; }
    .step-card { min-height: 0; }
}
@media (max-width: 420px) {
    .hero2__stage { min-height: 220px; }
    .float-card { width: 120px; }
    .float-card--2 { width: 132px; }
}

/* ---------- Dashboard stats ---------------------------------------------- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2.4rem;
}
.stat {
    padding: 1.3rem 1.4rem;
    border-radius: var(--radius);
    background: var(--glass);
    border: 1px solid var(--line);
    position: relative;
    overflow: hidden;
}
.stat::after {
    content: ""; position: absolute; right: -20px; top: -20px;
    width: 90px; height: 90px; border-radius: 50%;
    background: radial-gradient(circle, rgba(216,171,82,.16), transparent 70%);
}
.stat__value { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; line-height: 1; }
.stat__label { color: var(--muted); font-size: .82rem; margin-top: .4rem; text-transform: uppercase; letter-spacing: .1em; }
.stat--flame .stat__value { color: var(--flame); }
.stat--gold .stat__value { color: var(--gold-soft); }
.stat--mint .stat__value { color: var(--mint); }

/* ---------- Deck cards (grid) -------------------------------------------- */

.deck-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.3rem;
}
.deck-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--glass);
    border: 1px solid var(--line);
    transition: transform .2s, border-color .2s, box-shadow .2s;
}
.deck-card:hover { transform: translateY(-5px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.deck-card__art {
    position: relative;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, var(--night-700), var(--night-900));
    overflow: hidden;
}
.deck-card__art img { width: 100%; height: 100%; object-fit: cover; }
.deck-card__art--empty { display: grid; place-items: center; color: var(--muted-2); font-size: 2.4rem; }
.deck-card__art::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(18,10,27,.82));
}
.deck-card__status { position: absolute; top: .8rem; left: .8rem; z-index: 2; }
.deck-card__overtitle { position: absolute; z-index: 2; left: 1rem; right: 1rem; bottom: .85rem; }
.deck-card__overtitle h3 { font-family: var(--font-display); font-size: 1.25rem; margin: 0; line-height: 1.1; }
.deck-card__overtitle .theme { color: var(--muted); font-size: .82rem; }
.deck-card__body { padding: 1rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: .85rem; flex: 1; }
.deck-card__meta { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.deck-card__count { font-size: .85rem; color: var(--muted); }
.deck-card__count b { color: var(--ink); font-family: var(--font-display); }
.deck-card__actions { display: flex; gap: .4rem; margin-top: auto; flex-wrap: wrap; }
.deck-card__actions .btn { font-size: .8rem; padding: .4rem .7rem; }

.count-meter { height: 6px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.count-meter__fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold-soft), var(--flame)); transition: width .3s; }
.count-meter__fill.is-complete { background: linear-gradient(90deg, var(--mint), #4f9e78); }

/* ---------- Star rating --------------------------------------------------- */

.stars { display: inline-flex; align-items: center; gap: .12rem; color: var(--gold-soft); font-size: .9rem; }
.stars .bi-star { color: var(--muted-2); }
.stars__count { color: var(--muted); font-size: .78rem; font-weight: 700; margin-left: .4rem; }

/* Interactive rating widget (public deck page) */
.rate-widget { display: inline-flex; gap: .15rem; }
.rate-widget button {
    background: none; border: 0; padding: 0 .05rem; cursor: pointer;
    color: var(--muted-2); font-size: 1.5rem; line-height: 1; transition: color .12s, transform .12s;
}
.rate-widget button:hover { transform: scale(1.15); }
.rate-widget button.on { color: var(--gold-soft); }
.rate-widget.readonly button { cursor: default; }

/* ---------- Public gallery cards ------------------------------------------ */

.deck-grid--pub { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.pub-card {
    position: relative; display: flex; flex-direction: column;
    border-radius: var(--radius); overflow: hidden;
    background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025)); border: 1px solid var(--line);
    color: var(--ink); transition: transform .2s, border-color .2s, box-shadow .2s;
}
.pub-card:hover { transform: translateY(-5px); border-color: var(--line-strong); box-shadow: var(--shadow); color: var(--ink); }
.pub-card__rank {
    position: absolute; z-index: 3; top: .6rem; left: .6rem;
    width: 30px; height: 30px; display: grid; place-items: center;
    border-radius: 50%; font-family: var(--font-display); font-weight: 700; font-size: .95rem;
    color: #241a08; background: linear-gradient(135deg, #f2d68e, var(--gold));
    box-shadow: 0 6px 16px rgba(0,0,0,.4);
}
.pub-card__art { position: relative; aspect-ratio: 16/11; background: linear-gradient(135deg, var(--night-700), var(--night-900)); overflow: hidden; }
.pub-card__art img { width: 100%; height: 100%; object-fit: cover; }
.pub-card:hover .pub-card__art img { transform: scale(1.035); }
.pub-card__art img { transition: transform .35s ease; }
.pub-card__art--empty { display: grid; place-items: center; color: var(--muted-2); font-size: 2rem; }
.pub-card__art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(18,10,27,.6)); }
.pub-card__mana { position: absolute; z-index: 2; bottom: .55rem; right: .55rem; }
.pub-card__body { padding: .8rem .9rem 1rem; display: flex; flex-direction: column; gap: .3rem; }
.pub-card__name { font-family: var(--font-display); font-size: 1.05rem; margin: 0; line-height: 1.15; }
.pub-card__by { color: var(--muted); font-size: .8rem; }
.pub-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: .3rem; }
.pub-card__views { color: var(--muted-2); font-size: .78rem; }
.gallery-page { display: flex; flex-direction: column; gap: 2.4rem; }
.gallery-page .page-head { margin-bottom: 0; }
.gallery-section { min-width: 0; }
.gallery-section .section-title { padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.gallery-section--ranked { padding: 1.1rem; margin: 0 -.1rem; border-radius: var(--radius-lg); background: radial-gradient(circle at 100% 0, rgba(216,171,82,.08), transparent 35%), var(--glass); }

/* ---------- Filters ------------------------------------------------------- */

.filter-bar { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.filter-pill {
    padding: .45rem .95rem; border-radius: 999px;
    border: 1px solid var(--line-strong); color: var(--muted);
    font-weight: 600; font-size: .88rem; background: transparent;
    transition: all .15s;
}
.filter-pill:hover { color: var(--ink); background: var(--glass); }
.filter-pill.is-active { color: #241a08; background: linear-gradient(135deg, #f2d68e, var(--gold)); border-color: transparent; }

/* ---------- Forms --------------------------------------------------------- */

.form-panel { max-width: 640px; margin: 0 auto; padding: 2rem; }
.form-label { color: var(--muted); font-weight: 600; font-size: .85rem; margin-bottom: .4rem; }
.form-control, .form-select {
    background: var(--night-900); border: 1px solid var(--line-strong); color: var(--ink);
    border-radius: 11px; padding: .6rem .85rem;
}
.form-control:focus, .form-select:focus {
    background: var(--night-900); color: var(--ink);
    border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216,171,82,.18);
}
.form-control::placeholder { color: var(--muted-2); }
.form-text { color: var(--muted-2); }

.color-choice { display: flex; gap: .55rem; flex-wrap: wrap; }
.color-choice input { position: absolute; opacity: 0; pointer-events: none; }
.color-swatch {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .45rem .8rem; border-radius: 999px;
    border: 1px solid var(--line-strong); cursor: pointer;
    color: var(--muted); font-weight: 600; font-size: .86rem;
    transition: all .15s; user-select: none;
}
.color-swatch:hover { border-color: var(--line-strong); color: var(--ink); }
.color-choice input:checked + .color-swatch { color: var(--ink); border-color: var(--gold); background: var(--glass-2); }
.color-swatch .dot { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.color-swatch .dot[data-c="W"] { background: var(--mana-w); }
.color-swatch .dot[data-c="U"] { background: var(--mana-u); }
.color-swatch .dot[data-c="B"] { background: var(--mana-b); }
.color-swatch .dot[data-c="R"] { background: var(--mana-r); }
.color-swatch .dot[data-c="G"] { background: var(--mana-g); }
.color-swatch .dot[data-c="C"] { background: var(--mana-c); }

/* ---------- Deck creation wizard ----------------------------------------- */
.create-deck { width: min(100%, 900px); margin: 0 auto; }
.create-deck__intro { position: relative; margin: .5rem 0 2rem; text-align: center; }
.create-deck__intro .eyebrow { color: var(--gold); font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.create-deck__intro h1 { margin: .4rem 0; font-family: var(--font-display); font-size: clamp(1.8rem,4vw,2.8rem); }
.create-deck__intro p { margin: 0; color: var(--muted); }
.create-deck__back { position: absolute; left: 0; top: .2rem; display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .82rem; }
.deck-wizard { overflow: hidden; border-radius: 26px; background: linear-gradient(145deg,rgba(255,255,255,.045),rgba(255,255,255,.018)); box-shadow: var(--shadow-soft); }
.wizard-tabs { display: grid; grid-template-columns: repeat(3,1fr); padding: .55rem; background: rgba(8,4,13,.28); }
.wizard-tab { position: relative; display: flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; border: 0; border-radius: 14px; background: transparent; color: var(--muted-2); cursor: pointer; }
.wizard-tab > span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--glass-2); font-size: .7rem; font-weight: 800; }
.wizard-tab > i { display: none; }
.wizard-tab b { font-size: .82rem; }
.wizard-tab.is-active { color: var(--ink); background: var(--glass-2); }
.wizard-tab.is-active > span { color: #241a08; background: var(--gold-soft); }
.wizard-tab.is-done > span { font-size: 0; background: rgba(111,191,154,.2); }
.wizard-tab.is-done > span::after { content: "✓"; color: var(--mint); font-size: .8rem; }
.wizard-stage { min-height: 400px; }
.wizard-pane { grid-template-columns: minmax(210px,.7fr) minmax(0,1.3fr); gap: clamp(1.5rem,5vw,4rem); padding: clamp(1.5rem,5vw,3.6rem); animation: wizard-in .22s ease; }
.wizard-pane.is-active { display: grid; }
@keyframes wizard-in { from { opacity: 0; transform: translateX(8px); } }
.wizard-copy > span { color: rgba(216,171,82,.28); font-family: var(--font-display); font-size: 3.5rem; font-weight: 700; line-height: 1; }
.wizard-copy h2 { margin: .4rem 0 .6rem; font-family: var(--font-display); font-size: 1.3rem; }
.wizard-copy p { margin: 0; color: var(--muted); font-size: .87rem; line-height: 1.6; }
.wizard-fields { min-width: 0; }
.wizard-fields .form-control { min-height: 48px; border-width: 0 0 1px; border-radius: 0; background: rgba(255,255,255,.025); }
.wizard-fields textarea.form-control { min-height: 100px; }
.wizard-fields .form-label span { color: var(--muted-2); font-weight: 400; }
.color-choice--large { gap: .65rem; }
.color-choice--large .color-swatch { flex: 1; min-width: 94px; min-height: 52px; justify-content: center; border: 0; background: var(--glass); }
.color-choice--large .dot { width: 22px; height: 22px; }
.deck-preview { position: relative; overflow: hidden; min-height: 210px; padding: 1.4rem; border-radius: 20px; background: radial-gradient(circle at 100% 0,rgba(229,95,77,.25),transparent 45%),radial-gradient(circle at 0 100%,rgba(155,109,214,.24),transparent 48%),var(--night-800); box-shadow: var(--shadow-soft); }
.deck-preview__mana { display: flex; min-height: 24px; gap: .25rem; justify-content: flex-end; }
.deck-preview__label { color: var(--gold); font-size: .66rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.deck-preview h3 { margin: 1.1rem 0 .3rem; font-family: var(--font-display); font-size: 1.45rem; }
.deck-preview p { color: var(--muted); font-size: .84rem; }
.deck-preview__count { position: absolute; left: 1.4rem; bottom: 1.2rem; color: var(--muted); font-size: .75rem; }
.deck-preview__count b { color: var(--ink); }
.advanced-field { margin-top: 1rem; padding: .8rem 1rem; border-radius: 14px; background: var(--glass); }
.advanced-field summary { color: var(--muted); font-size: .82rem; font-weight: 700; cursor: pointer; }
.deck-code-note { margin: 1rem 0 0; padding: .75rem .9rem; border-radius: 12px; color: var(--muted); background: var(--glass); font-size: .78rem; }
.deck-code-note i,.deck-code-note b { color: var(--gold-soft); }
.wizard-actions { display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; background: rgba(8,4,13,.25); }
.wizard-actions__spacer { flex: 1; }
.wizard-actions .btn { min-height: 44px; }
@media (max-width: 680px) {
 .create-deck__intro { padding-top: 2rem; } .create-deck__back { top: 0; }
 .wizard-tab b { display: none; } .wizard-tab > i { display: inline; }
 .wizard-pane.is-active { grid-template-columns: 1fr; gap: 1.2rem; }
 .wizard-copy > span { font-size: 2.4rem; } .wizard-copy p { max-width: 44ch; }
 .wizard-stage { min-height: 500px; }
 .color-choice--large .color-swatch { min-width: calc(50% - .4rem); }
 .wizard-actions .btn { flex: 1; }
}

.field-error { color: #ffb1a5; font-size: .82rem; margin-top: .35rem; }
.form-row { margin-bottom: 1.3rem; }

/* ---------- Empty state --------------------------------------------------- */

.empty-state {
    text-align: center; padding: 4rem 1.5rem;
    border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
    background: var(--glass);
}
.empty-state__glyph { font-size: 3rem; color: var(--muted-2); margin-bottom: 1rem; }
.empty-state h3 { font-family: var(--font-display); }
.empty-state p { color: var(--muted); max-width: 40ch; margin: .5rem auto 1.5rem; }

/* ---------- Deck builder -------------------------------------------------- */

/* ---------- Profile ------------------------------------------------------- */
.profile-page { width: min(100%,1000px); margin: 0 auto; }
.profile-hero { display: flex; align-items: center; gap: 1.2rem; padding: clamp(1.2rem,4vw,2rem); border-radius: 28px; background: radial-gradient(circle at 90% 0,rgba(229,95,77,.2),transparent 38%),radial-gradient(circle at 0 100%,rgba(155,109,214,.2),transparent 42%),var(--night-800); box-shadow: var(--shadow-soft); }
.profile-avatar,.profile-photo-field__preview { flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 50%; color: #241a08; background: linear-gradient(135deg,var(--gold-soft),var(--flame)); font-family: var(--font-display); font-weight: 800; }
.profile-avatar { width: 88px; height: 88px; font-size: 2rem; box-shadow: 0 10px 28px rgba(229,95,77,.24); }
.profile-avatar img,.profile-photo-field__preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-hero__copy { flex: 1; min-width: 0; }
.profile-hero .eyebrow,.profile-form .eyebrow { color: var(--gold); font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.profile-hero h1 { margin: .25rem 0; font-family: var(--font-display); font-size: clamp(1.5rem,4vw,2.2rem); }
.profile-hero p { margin: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.profile-layout { display: grid; grid-template-columns: 260px minmax(0,1fr); gap: 1.2rem; margin-top: 1.2rem; align-items: start; }
.profile-side { display: grid; gap: 1rem; }
.profile-stats { display: grid; grid-template-columns: repeat(3,1fr); padding: .8rem; border-radius: 18px; background: var(--glass); }
.profile-stats a { display: grid; gap: .2rem; color: var(--muted); text-align: center; }
.profile-stats a + a { border-left: 1px solid var(--line); }
.profile-stats b { color: var(--ink); font: 700 1.3rem var(--font-display); }
.profile-stats span { font-size: .63rem; }
.profile-links { display: grid; overflow: hidden; border-radius: 18px; background: var(--glass); }
.profile-links a { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: .55rem; padding: .85rem 1rem; color: var(--muted); font-size: .82rem; }
.profile-links a + a { border-top: 1px solid var(--line); }
.profile-links a:hover { color: var(--ink); background: var(--glass-2); }
.profile-form { padding: clamp(1.2rem,4vw,2rem); border-radius: 24px; background: var(--glass); }
.profile-form__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.8rem; }
.profile-form h2 { margin: .2rem 0 0; font-family: var(--font-display); font-size: 1.35rem; }
.profile-photo-field { display: grid; grid-template-columns: 74px minmax(0,1fr); gap: 1rem; align-items: center; margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.profile-photo-field__preview { width: 74px; height: 74px; font-size: 1.5rem; }
.profile-form textarea { min-height: 130px; }
.profile-form__foot { display: none; margin-top: 1.4rem; }
@media (max-width:760px) { .profile-layout { grid-template-columns: 1fr; } .profile-side { order: 2; } }
@media (max-width:560px) { .profile-hero { align-items: flex-start; flex-wrap: wrap; } .profile-avatar { width: 64px; height: 64px; } .profile-hero .btn { width: 100%; } .profile-form__head .btn { display: none; } .profile-form__foot { display: block; } .profile-form__foot .btn { width: 100%; } }

.builder { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; align-items: start; }
.builder__side { position: sticky; top: 5rem; display: flex; flex-direction: column; gap: 1.2rem; }

.builder-block { padding: 1.3rem; }
.builder-block h2 { font-family: var(--font-display); font-size: 1.05rem; margin: 0 0 1rem; display: flex; align-items: center; gap: .5rem; }

/* Search */
.search-field { position: relative; }
.search-field i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.search-field input { padding-left: 2.5rem; padding-right: 3.4rem; height: 48px; }
.search-kbd {
    position: absolute; right: .7rem; top: 50%; transform: translateY(-50%);
    font-size: .68rem; color: var(--muted-2); background: var(--glass-2);
    border: 1px solid var(--line); border-radius: 6px; padding: .1rem .4rem; letter-spacing: .1em;
}
.search-status { color: var(--muted); font-size: .85rem; margin: .6rem .1rem 0; min-height: 1.2em; }
.search-status.is-loading { color: var(--gold-soft); }
.search-spinner { display: inline-block; width: 14px; height: 14px; margin-right: .35rem; vertical-align: -.15rem; border: 2px solid rgba(216,171,82,.25); border-top-color: var(--gold-soft); border-radius: 50%; animation: search-spin .65s linear infinite; }
.search-status button { margin-left: .35rem; padding: 0; border: 0; background: transparent; color: var(--gold-soft); font-weight: 800; text-decoration: underline; cursor: pointer; }
.search-status .bi-check-circle-fill { color: var(--mint); }
@keyframes search-spin { to { transform: rotate(360deg); } }

/* Search filters */
.search-filters { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .8rem; }
.filter-colors { display: inline-flex; gap: .25rem; }
.color-toggle {
    padding: .1rem; border: 1px solid transparent; border-radius: 50%;
    background: none; cursor: pointer; opacity: .45; transition: opacity .15s, border-color .15s, transform .12s;
}
.color-toggle:hover { opacity: .8; transform: translateY(-1px); }
.color-toggle.active { opacity: 1; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(216,171,82,.28); }
.search-select { width: auto; min-width: 120px; background: var(--night-900); border-color: var(--line-strong); color: var(--ink); }

/* Result cards: mana, rarity, keyboard highlight */
.result-card__mana { display: flex; gap: .12rem; flex-wrap: wrap; margin: .2rem 0; }
.mini-pip {
    width: 15px; height: 15px; display: grid; place-items: center; border-radius: 50%;
    font-size: .55rem; font-weight: 800; color: #1a1420; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2);
}
.mini-pip[data-c="W"] { background: var(--mana-w); }
.mini-pip[data-c="U"] { background: var(--mana-u); color: #fff; }
.mini-pip[data-c="B"] { background: var(--mana-b); color: #e9e4f0; }
.mini-pip[data-c="R"] { background: var(--mana-r); color: #fff; }
.mini-pip[data-c="G"] { background: var(--mana-g); color: #fff; }
.mini-pip[data-c="C"], .mini-pip--gen { background: var(--mana-c); }

.result-card__rarity {
    position: absolute; z-index: 2; top: .45rem; right: .45rem;
    width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.4);
}
.rarity--common { background: #3a3542; }
.rarity--uncommon { background: #9aa9b3; }
.rarity--rare { background: #d8ab52; }
.rarity--mythic { background: linear-gradient(135deg, #f0863a, #d3552f); }

.result-card.is-highlighted { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(216,171,82,.4); transform: translateY(-3px); }

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: .8rem;
    margin-top: 1rem;
}
.result-card {
    border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
    background: var(--night-900); cursor: pointer; text-align: left;
    padding: 0; transition: transform .12s, border-color .18s, box-shadow .18s;
    display: flex; flex-direction: column;
}
.result-card:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: var(--shadow-soft); }
.result-card:disabled { opacity: .55; cursor: progress; }
.result-card__img { width: 100%; aspect-ratio: 63/88; object-fit: cover; background: var(--night-700); display: block; }
.result-card__info { padding: .5rem .55rem .6rem; }
.result-card__name { font-family: var(--font-serif); font-weight: 600; font-size: .9rem; line-height: 1.15; margin: 0; }
.result-card__set { color: var(--muted-2); font-size: .7rem; margin-top: .2rem; text-transform: uppercase; letter-spacing: .04em; }
.result-card__add {
    position: absolute; inset: 0; display: grid; place-items: center; opacity: 0;
    background: rgba(216,171,82,.24); color: #fff; font-size: 1.6rem; transition: opacity .15s;
}
.result-card__add b { display: none; font-size: .72rem; }
.result-card.is-adding .result-card__add { opacity: 1; background: rgba(18,10,27,.7); }
.result-card.is-adding .result-card__add i { animation: search-spin .65s linear infinite; }
.result-card.is-added { border-color: rgba(111,191,154,.58); box-shadow: inset 0 0 0 1px rgba(111,191,154,.2); }
.result-card.is-added .result-card__add { opacity: 1; inset: auto .45rem .45rem auto; width: auto; padding: .3rem .5rem; border-radius: 999px; color: #eafff2; background: rgba(33,105,72,.92); gap: .25rem; }
.result-card.is-added .result-card__add i { font-size: .8rem; }
.result-card.is-added .result-card__add b { display: inline; }
.result-card { position: relative; }
.result-card:hover .result-card__add { opacity: 1; }

/* Current cards */
.deck-cards { display: flex; flex-direction: column; gap: .55rem; margin-top: .4rem; }
.deck-entry {
    display: grid; grid-template-columns: 46px 1fr auto; gap: .8rem; align-items: center;
    padding: .5rem .6rem; border-radius: 13px;
    border: 1px solid var(--line); background: var(--glass);
    transition: border-color .15s, background .15s;
}
.deck-entry:hover { border-color: var(--line-strong); background: var(--glass-2); }
.deck-entry.is-cover { border-color: rgba(216,171,82,.5); box-shadow: inset 0 0 0 1px rgba(216,171,82,.2); }
.deck-entry > div { min-width: 0; }
.deck-entry__thumb { width: 46px; height: 64px; border-radius: 7px; object-fit: cover; background: var(--night-700); }
.deck-entry__name { font-family: var(--font-serif); font-weight: 600; font-size: 1rem; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-entry__meta { color: var(--muted-2); font-size: .74rem; margin-top: .15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-entry__cover-flag { color: var(--gold-soft); font-size: .7rem; font-weight: 700; }
.deck-entry__controls { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.qty-btn {
    width: 30px; height: 30px; display: grid; place-items: center; padding: 0;
    border-radius: 8px; border: 1px solid var(--line-strong); background: var(--glass);
    color: var(--ink); cursor: pointer; transition: all .12s;
}
.qty-btn:hover { border-color: var(--gold); background: var(--glass-2); }
.qty-value { min-width: 26px; text-align: center; font-weight: 800; font-family: var(--font-display); }
.entry-menu-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted-2); cursor: pointer; }
.entry-menu-btn:hover { color: var(--ink); background: var(--glass); }

/* Progress panel */
.progress-panel { padding: 1.4rem; text-align: center; background: radial-gradient(circle at 100% 0, rgba(216,171,82,.12), transparent 55%), var(--glass); }
.progress-ring-wrap { position: relative; width: 128px; height: 128px; margin: 0 auto .8rem; }
.progress-ring { transform: rotate(-90deg); }
.progress-ring__bg { fill: none; stroke: rgba(255,255,255,.08); stroke-width: 10; }
.progress-ring__fg { fill: none; stroke: url(#ringGrad); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .4s ease; }
.progress-ring__label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.progress-ring__count { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; line-height: 1; }
.progress-ring__count small { color: var(--muted); font-size: .9rem; }
.progress-hint { color: var(--muted); font-size: .85rem; }

.publish-problems { text-align: left; margin: 1rem 0 0; padding: .8rem 1rem; border-radius: 12px; background: rgba(216,171,82,.08); border: 1px solid rgba(216,171,82,.22); }
.publish-problems li { color: var(--gold-soft); font-size: .82rem; margin: 0; }

.danger-zone { border-color: rgba(229,95,77,.25); }
.danger-zone h2 { color: #ffb1a5; }

@media (max-width: 900px) {
    .builder { grid-template-columns: 1fr; }
    .builder__side { position: static; }
}

/* ---------- Deck studio --------------------------------------------------- */
.deck-studio { width: min(100%,1050px); margin: 0 auto; }
.studio-head { display: grid; grid-template-columns: 44px minmax(0,1fr) 170px auto; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.studio-head__back { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--muted); background: var(--glass); }
.studio-head__identity { min-width: 0; }
.studio-head__identity h1 { overflow: hidden; margin: .2rem 0 0; font-family: var(--font-display); font-size: clamp(1.3rem,3vw,1.9rem); white-space: nowrap; text-overflow: ellipsis; }
.studio-head__identity p { margin: .15rem 0 0; color: var(--muted); font-size: .8rem; }
.studio-head__meta { display: flex; align-items: center; gap: .5rem; color: var(--muted-2); font-size: .68rem; }
.studio-head__progress { display: flex; align-items: center; gap: .65rem; }
.studio-head__progress > span { color: var(--muted); font: 700 .78rem var(--font-display); }
.studio-head__progress > span b { color: var(--ink); }
.studio-head__progress > div { flex: 1; height: 6px; overflow: hidden; border-radius: 999px; background: var(--glass-2); }
.studio-head__progress i { display: block; height: 100%; max-width: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--gold-soft),var(--flame)); transition: width .25s; }
.studio-tabs { position: sticky; z-index: 20; top: 68px; display: grid; grid-template-columns: repeat(4,1fr); gap: .3rem; padding: .4rem; border-radius: 17px; background: rgba(23,13,32,.9); backdrop-filter: blur(16px); box-shadow: var(--shadow-soft); }
.studio-tab { display: flex; align-items: center; justify-content: center; gap: .45rem; min-height: 45px; border: 0; border-radius: 12px; color: var(--muted); background: transparent; font-weight: 700; font-size: .8rem; cursor: pointer; }
.studio-tab:hover { color: var(--ink); background: var(--glass); }
.studio-tab.is-active { color: #241a08; background: linear-gradient(135deg,var(--gold-soft),var(--gold)); }
.studio-tab b { min-width: 20px; padding: .1rem .35rem; border-radius: 999px; background: rgba(0,0,0,.18); font-size: .65rem; }
.studio-body { margin-top: 1rem; min-height: 560px; }
.studio-pane { padding: clamp(1.2rem,4vw,2.5rem); border-radius: 24px; background: linear-gradient(145deg,rgba(255,255,255,.04),rgba(255,255,255,.015)); animation: studio-in .2s ease; }
@keyframes studio-in { from { opacity: 0; transform: translateY(5px); } }
.studio-section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.studio-section-head > div > span { color: var(--gold); font: 700 .65rem var(--font-display); }
.studio-section-head h2 { margin: .2rem 0; font-family: var(--font-display); font-size: 1.25rem; }
.studio-section-head p { margin: 0; color: var(--muted); font-size: .82rem; }
.studio-search input { height: 58px; border: 0; border-radius: 16px; background: rgba(255,255,255,.055); font-size: 1rem; }
.studio-card-list { max-width: 780px; }
.studio-empty { padding: 4rem 1rem; color: var(--muted); text-align: center; }
.studio-empty > i { color: var(--muted-2); font-size: 3rem; }
.studio-empty h3 { margin: .8rem 0 .3rem; color: var(--ink); font-family: var(--font-display); }
.studio-details-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; max-width: 760px; }
.studio-details-form__wide { grid-column: 1/-1; }
.studio-details-form textarea { min-height: 110px; }
.studio-danger { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid rgba(229,95,77,.2); }
.studio-danger h3 { margin: 0; color: #ffb1a5; font-size: .9rem; }
.studio-danger p { margin: .2rem 0 0; color: var(--muted); font-size: .75rem; }
.studio-danger > div:last-child { display: flex; gap: .5rem; }
.publish-studio { width: min(100%,580px); margin: 1.5rem auto; text-align: center; }
.publish-studio h2 { margin: .4rem 0; font-family: var(--font-display); font-size: 1.5rem; }
.publish-studio .eyebrow { color: var(--gold); font-size: .7rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.publish-studio #publishForm { margin-top: 1.2rem; }
.publish-studio #publishBtn { min-width: 210px; min-height: 48px; }
.publish-downloads { display: grid; grid-template-columns: repeat(3,1fr); gap: .6rem; margin-top: 2rem; }
.publish-downloads a { display: grid; gap: .5rem; place-items: center; padding: 1rem .5rem; border-radius: 15px; color: var(--muted); background: var(--glass); font-size: .72rem; }
.publish-downloads i { color: var(--gold-soft); font-size: 1.3rem; }
.publish-downloads a:hover { color: var(--ink); background: var(--glass-2); }
@media (max-width:700px) {
 .studio-head { grid-template-columns: 42px minmax(0,1fr) auto; } .studio-head__progress { grid-column: 2/-1; } .studio-public-link span { display: none; }
 .studio-tabs { top: 62px; } .studio-tab span { display: none; } .studio-tab { font-size: 1rem; }
 .studio-details-form { grid-template-columns: 1fr; } .studio-details-form__wide { grid-column: auto; }
 .studio-danger { align-items: stretch; flex-direction: column; } .studio-danger > div:last-child > * { flex: 1; }
 .studio-section-head { align-items: flex-start; flex-direction: column; } .studio-section-head .btn { width: 100%; }
}

@media (max-width:600px) {
 .studio-card-list .deck-entry { grid-template-columns: 58px minmax(0,1fr); grid-template-rows: auto auto; gap: .65rem .8rem; padding: .7rem; }
 .studio-card-list .deck-entry__thumb { grid-column: 1; grid-row: 1; width: 58px; height: 81px; }
 .studio-card-list .deck-entry > div:nth-child(2) { grid-column: 2; grid-row: 1; align-self: center; }
 .studio-card-list .deck-entry__name { white-space: normal; font-size: 1.05rem; line-height: 1.2; }
 .studio-card-list .deck-entry__meta { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
 .studio-card-list .deck-entry__controls { grid-column: 1/-1; grid-row: 2; justify-content: flex-end; padding-top: .55rem; border-top: 1px solid var(--line); }
 .studio-card-list .qty-btn,.studio-card-list .entry-menu-btn { width: 38px; height: 38px; }
 .studio-card-list .qty-value { min-width: 34px; }
}

/* Language selector: explicit affordance instead of an ambiguous code chip. */
.lang-switch__btn { min-height:38px; padding:.4rem .55rem .4rem .7rem; gap:.45rem; border:0; border-radius:3px 13px 3px 13px; background:#111718; }
.lang-switch__btn .bi-globe2 { color:var(--gold-soft); font-size:1rem; }
.lang-switch__current { color:var(--ink); font-size:.76rem; font-weight:700; }
.lang-switch__code { padding:.12rem .3rem; color:var(--muted); background:rgba(255,255,255,.05); font-size:.58rem; letter-spacing:.08em; }
.lang-switch__chevron { color:var(--muted-2); font-size:.62rem; transition:transform .18s; }
.lang-switch__btn[aria-expanded="true"] { background:rgba(217,255,114,.08); box-shadow:inset 0 -2px var(--gold-soft); }
.lang-switch__btn[aria-expanded="true"] .lang-switch__chevron { transform:rotate(180deg); }
.lang-switch .dropdown-item { display:flex; align-items:center; gap:.6rem; min-width:160px; }

/* Staff control room ------------------------------------------------------- */
.control-room { width:min(100%,1180px); margin:0 auto; }
.control-head { display:flex; align-items:end; justify-content:space-between; gap:1rem; margin-bottom:1.4rem; }
.control-head .eyebrow,.control-module header span { color:var(--gold-soft); font-size:.64rem; font-weight:800; letter-spacing:.16em; text-transform:uppercase; }
.control-head h1 { margin:.2rem 0; font:700 clamp(2rem,5vw,3.2rem)/1 var(--font-display); letter-spacing:-.06em; }
.control-head p { margin:0; color:var(--muted); }
.control-head__status { display:flex; align-items:center; gap:.5rem; padding:.5rem .7rem; color:var(--muted); background:var(--glass); font-size:.7rem; }
.control-head__status i { width:7px; height:7px; border-radius:50%; background:var(--mint); box-shadow:0 0 12px var(--mint); }
.control-metrics { display:grid; grid-template-columns:repeat(4,1fr); gap:.6rem; margin-bottom:.8rem; }
.control-metrics article { position:relative; display:grid; min-height:145px; padding:1rem; overflow:hidden; background:#101516; }
.control-metrics article::after { content:""; position:absolute; right:-24px; bottom:-30px; width:100px; height:100px; border-radius:50%; background:rgba(217,255,114,.04); }
.control-metrics article > i { color:var(--gold-soft); }
.control-metrics article > span { margin-top:.65rem; color:var(--muted); font-size:.7rem; text-transform:uppercase; }
.control-metrics b { font:700 2rem var(--font-display); }
.control-metrics small { color:var(--mint); font-size:.65rem; }
.control-grid { display:grid; grid-template-columns:1.55fr .75fr; gap:.8rem; margin-bottom:.8rem; }
.control-grid--bottom { grid-template-columns:1fr 1fr; }
.control-module { padding:1.1rem; background:rgba(16,21,22,.82); }
.control-module header { display:flex; align-items:start; justify-content:space-between; gap:1rem; margin-bottom:1rem; }
.control-module h2 { margin:.2rem 0 0; font:700 1.05rem var(--font-display); }
.control-module header p { max-width:38ch; margin:0; color:var(--muted); font-size:.72rem; }
.control-legend { display:flex; gap:.7rem; color:var(--muted); font-size:.62rem; }
.control-legend span { display:flex; align-items:center; gap:.3rem; color:var(--muted); letter-spacing:0; text-transform:none; }
.control-legend i { width:7px; height:7px; }
.is-user { background:var(--mint); }.is-deck { background:var(--gold-soft); }
.activity-chart { height:190px; display:flex; align-items:end; gap:clamp(.5rem,3vw,1.4rem); padding-top:1rem; }
.activity-day { flex:1; height:100%; display:grid; grid-template-rows:1fr auto auto; gap:.25rem; text-align:center; }
.activity-bar { width:min(100%,32px); min-height:4px; margin:auto auto 0; display:flex; flex-direction:column; background:var(--glass); }
.activity-bar span { min-height:2px; }
.activity-day b { color:var(--muted); font-size:.62rem; text-transform:uppercase; }.activity-day small { color:var(--muted-2); font-size:.58rem; }
.status-orbit { width:130px; height:130px; margin:.5rem auto 1rem; display:grid; place-items:center; border-radius:50%; background:radial-gradient(circle at center,#101516 52%,transparent 54%),conic-gradient(var(--gold-soft) 0 55%,var(--mint) 55% 75%,#303a3c 75%); }
.status-orbit div { text-align:center; }.status-orbit b { display:block; font:700 1.7rem var(--font-display); }.status-orbit span { color:var(--muted); font-size:.6rem; text-transform:uppercase; }
.control-breakdown dl { margin:0; }.control-breakdown dl div { display:flex; justify-content:space-between; padding:.45rem 0; border-top:1px solid var(--line); }.control-breakdown dt { color:var(--muted); font-size:.72rem; }.control-breakdown dd { margin:0; font-weight:800; }
.control-table { margin-bottom:.8rem; }
.control-rows { display:grid; }.control-rows article { display:grid; grid-template-columns:42px minmax(150px,1fr) 90px 100px 38px; align-items:center; gap:.7rem; min-height:60px; padding:.45rem 0; border-top:1px solid var(--line); }
.control-deck-art { width:42px; height:42px; display:grid; place-items:center; overflow:hidden; background:var(--night-700); }.control-deck-art img { width:100%; height:100%; object-fit:cover; }
.control-rows article > div:nth-child(2) { min-width:0; }.control-rows article > div:nth-child(2) a { display:block; overflow:hidden; color:var(--ink); font-weight:700; font-size:.8rem; white-space:nowrap; text-overflow:ellipsis; }.control-rows small { display:block; color:var(--muted-2); font-size:.62rem; }
.control-row-stats { display:flex; gap:.7rem; color:var(--muted); font-size:.68rem; }.control-row-stats span { display:flex; gap:.25rem; }
.control-action { width:34px; height:34px; display:grid; place-items:center; border:0; color:var(--muted); background:var(--glass-2); cursor:pointer; }.control-action:hover { color:var(--gold-soft); }
.control-ranking { margin:0; padding:0; list-style:none; }.control-ranking li { display:grid; grid-template-columns:30px 1fr auto; gap:.6rem; padding:.65rem 0; border-top:1px solid var(--line); font-size:.75rem; }.control-ranking li > b { color:var(--gold-soft); }.control-ranking li > a { color:var(--ink); }.control-ranking li > span { color:var(--muted); }
.control-users { display:grid; }.control-users a { display:grid; grid-template-columns:34px 1fr auto; align-items:center; gap:.65rem; padding:.55rem 0; border-top:1px solid var(--line); color:var(--ink); }.control-users a > span { width:34px; height:34px; display:grid; place-items:center; color:#080b0c; background:var(--gold-soft); font-weight:900; }.control-users b,.control-users small { display:block; }.control-users b { font-size:.75rem; }.control-users small { color:var(--muted-2); font-size:.62rem; }
@media(max-width:850px) { .control-metrics { grid-template-columns:1fr 1fr; }.control-grid,.control-grid--bottom { grid-template-columns:1fr; } }
@media(max-width:600px) { .lang-switch__current { display:inline; }.control-head { align-items:start; flex-direction:column; }.control-rows article { grid-template-columns:42px 1fr auto; }.control-rows .tag,.control-row-stats { display:none; }.control-metrics article { min-height:120px; }.control-module { padding:.85rem; } }

/* ---------- Footer -------------------------------------------------------- */

.app-footer {
    border-top: 1px solid var(--line);
    padding: 1.6rem 1.2rem;
    text-align: center;
    color: var(--muted-2);
    font-size: .8rem;
    display: flex; flex-direction: column; gap: .25rem;
}
.app-footer__fine { font-size: .72rem; opacity: .8; }

/* ---------- Responsive nav ------------------------------------------------ */

@media (max-width: 991px) {
    .brand__text { font-size: 1rem; }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        width: 42px;
        height: 42px;
        padding: 0;
        border: 1px solid var(--line-strong);
        border-radius: 11px;
        background: var(--glass);
        color: var(--ink);
        font-size: 1.3rem;
        cursor: pointer;
    }
    .nav-toggle:hover { border-color: var(--gold); }

    .nav-collapse {
        position: absolute;
        top: calc(100% + 1px);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: .8rem;
        padding: 1rem 1.2rem 1.3rem;
        background: rgba(23, 13, 32, .98);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow);
        backdrop-filter: blur(16px);
        max-height: calc(100vh - 62px);
        overflow-y: auto;
        display: none;
    }
    .nav-collapse.is-open { display: flex; }

    .app-nav__links { flex-direction: column; gap: .25rem; }
    .nav-link-item { padding: .7rem .85rem; font-size: 1rem; }

    .app-nav__actions {
        flex-direction: column;
        align-items: stretch;
        gap: .6rem;
        margin-left: 0;
        padding-top: .8rem;
        border-top: 1px solid var(--line);
    }
    .app-nav__actions .btn { width: 100%; justify-content: center; }
    .user-chip, .lang-switch { align-self: flex-start; }
}

/* =============================================================================
   ARCANE TERMINAL — visual direction 2026
   Carbon table surfaces, spectral ink and card-inspired asymmetric geometry.
   ============================================================================= */
:root {
    --night-950: #050707; --night-900: #080b0c; --night-800: #101516; --night-700: #182022;
    --ink: #f1f0e8; --muted: #9da5a1; --muted-2: #626b68;
    --gold: #bce84a; --gold-soft: #d9ff72; --flame: #ff6b57; --flame-deep: #d94b3d;
    --mint: #63e6c4; --amethyst: #9b87f5;
    --line: rgba(217,255,114,.08); --line-strong: rgba(217,255,114,.18);
    --glass: rgba(235,255,246,.035); --glass-2: rgba(235,255,246,.075);
    --radius: 5px 22px 5px 22px; --radius-lg: 8px 32px 8px 32px; --radius-sm: 4px 14px 4px 14px;
    --shadow: 0 28px 70px rgba(0,0,0,.52); --shadow-soft: 0 16px 38px rgba(0,0,0,.34);
    --font-display: "Space Grotesk", sans-serif; --font-body: "Manrope", sans-serif; --font-serif: "Instrument Serif", Georgia, serif;
}
body.app-body { background: #080b0c; letter-spacing: -.01em; }
.arcane-backdrop { background: radial-gradient(ellipse at 82% -10%,rgba(188,232,74,.11),transparent 34%),radial-gradient(ellipse at -8% 32%,rgba(99,230,196,.07),transparent 32%),linear-gradient(155deg,#050707,#0b1011 54%,#070909); }
.arcane-backdrop::after { content:""; position:absolute; inset:0; opacity:.17; pointer-events:none; background-image: linear-gradient(rgba(255,255,255,.025) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.018) 1px,transparent 1px); background-size: 48px 48px; mask-image:linear-gradient(to bottom,#000,transparent 82%); }
::selection { color:#080b0c; background:var(--gold-soft); }

/* Navigation becomes a compact instrument rail. */
.app-nav { background:rgba(5,7,7,.86); border:0; box-shadow:0 1px 0 rgba(217,255,114,.1); }
.app-nav__inner { min-height:68px; }
.brand { text-transform:uppercase; letter-spacing:-.045em; }
.brand__orb { width:34px; height:34px; filter:drop-shadow(0 0 10px rgba(217,255,114,.14)); }
.brand__accent { color:var(--ink); font-weight:500; opacity:.48; }
.nav-link-item { position:relative; border-radius:3px; text-transform:uppercase; letter-spacing:.07em; font-size:.72rem; }
.nav-link-item.is-active { color:var(--gold-soft); background:transparent; }
.nav-link-item.is-active::after { content:""; position:absolute; left:.85rem; right:.85rem; bottom:.1rem; height:2px; background:var(--gold-soft); box-shadow:0 0 12px var(--gold); }
.user-chip__btn,.lang-switch__btn { border-radius:4px 12px 4px 12px; }

/* Controls use clipped card corners rather than friendly SaaS pills. */
.btn { border-radius:3px 13px 3px 13px; letter-spacing:.025em; }
.btn-flame { color:#0b0e0e; background:var(--gold-soft); box-shadow:5px 5px 0 rgba(188,232,74,.12); }
.btn-flame:hover { color:#0b0e0e; background:#e4ff94; box-shadow:2px 2px 0 rgba(188,232,74,.2); transform:translate(2px,2px); }
.btn-gold { color:#0b0e0e; background:linear-gradient(105deg,var(--mint),var(--gold-soft)); }
.btn-ghost,.btn-outline-arcane { border-color:rgba(241,240,232,.13); background:rgba(241,240,232,.035); }
.btn-ghost:hover,.btn-outline-arcane:hover { border-color:var(--gold); background:rgba(188,232,74,.07); }
.form-control,.form-select { border-color:rgba(241,240,232,.1); border-radius:4px 14px 4px 14px; background:#101516; }
.form-control:focus,.form-select:focus { border-color:var(--gold); box-shadow:0 0 0 3px rgba(188,232,74,.09); background:#121819; }

/* Editorial headers: oversized, tight and marked with spectral coordinates. */
.page-head h1,.hero2__text h1 { letter-spacing:-.065em; text-wrap:balance; }
.page-head .eyebrow,.hero__eyebrow,.create-deck__intro .eyebrow,.profile-hero .eyebrow,.profile-form .eyebrow { color:var(--gold-soft); letter-spacing:.18em; }
.page-head--hero { background:linear-gradient(105deg,rgba(188,232,74,.07),transparent 54%); box-shadow:none; border-radius:0 42px 0 42px; }
.page-head--hero::after { color:rgba(217,255,114,.1); }

/* Landing: open composition, stage line and kinetic card fan. */
.hero2 { position:relative; border-radius:0 48px 0 48px; background:linear-gradient(112deg,rgba(217,255,114,.065),transparent 42%),rgba(235,255,246,.018); box-shadow:none; }
.hero2::after { content:"ARCHIVE / BUILD / PLAY"; position:absolute; right:1.4rem; bottom:.8rem; color:rgba(217,255,114,.24); font-size:.58rem; font-weight:800; letter-spacing:.22em; }
.hero2__text h1 { color:var(--ink); background:none; -webkit-text-fill-color:currentColor; }
.hero2__text h1::first-line { color:var(--gold-soft); }
.hero__eyebrow,.hero-chip { border:0; border-radius:2px 10px 2px 10px; background:rgba(217,255,114,.06); }
.float-card { border:0; border-radius:7px 18px 7px 18px; box-shadow:18px 24px 55px rgba(0,0,0,.48); }
.home-section--featured,.gallery-section--ranked { background:linear-gradient(180deg,rgba(217,255,114,.025),transparent); }
.step-card { border:0; border-radius:2px 24px 2px 24px; background:linear-gradient(145deg,rgba(241,240,232,.055),rgba(241,240,232,.018)); }
.step-card > i { border:0; border-radius:2px 12px 2px 12px; color:#080b0c; background:var(--gold-soft); }
.tool-cta { border:0; border-radius:3px 28px 3px 28px; background:linear-gradient(105deg,rgba(99,230,196,.1),rgba(241,240,232,.025)); }

/* Decks read like physical objects laid on a carbon table. */
.deck-card,.pub-card { border:0; border-radius:5px 26px 5px 26px; background:#101516; box-shadow:0 12px 30px rgba(0,0,0,.22); }
.deck-card::before,.pub-card::before { content:""; position:absolute; z-index:4; left:0; top:0; width:3px; height:42%; background:var(--gold-soft); opacity:.7; }
.deck-card { position:relative; }
.deck-card:hover,.pub-card:hover { transform:translateY(-7px) rotate(-.25deg); box-shadow:0 26px 55px rgba(0,0,0,.44); }
.deck-card__art,.pub-card__art { filter:saturate(.86) contrast(1.06); }
.deck-card__overtitle h3,.pub-card__name { letter-spacing:-.035em; }
.pub-card__rank { border-radius:2px 10px 2px 10px; background:var(--gold-soft); }
.mana-pip { box-shadow:0 0 0 2px #101516,0 3px 10px rgba(0,0,0,.35); }
.count-meter,.studio-head__progress > div { height:3px; border-radius:0; }
.count-meter__fill,.studio-head__progress i { border-radius:0; background:var(--gold-soft); box-shadow:0 0 10px rgba(217,255,114,.35); }

/* Workspace surfaces: flat layers with strong active signals. */
.deck-wizard,.studio-pane,.profile-form { border-radius:4px 30px 4px 30px; background:rgba(16,21,22,.78); box-shadow:0 22px 55px rgba(0,0,0,.25); }
.wizard-tabs,.wizard-actions { background:#0b0f10; }
.wizard-tab { border-radius:2px 12px 2px 12px; }
.wizard-tab.is-active { color:var(--gold-soft); background:rgba(217,255,114,.07); }
.wizard-tab.is-active > span { background:var(--gold-soft); }
.deck-preview { border-radius:4px 24px 4px 24px; background:linear-gradient(130deg,rgba(99,230,196,.15),transparent 42%),#101516; }
.studio-tabs { border-radius:3px 18px 3px 18px; background:rgba(8,11,12,.94); box-shadow:0 14px 36px rgba(0,0,0,.32); }
.studio-tab { border-radius:2px 11px 2px 11px; }
.studio-tab.is-active { color:#080b0c; background:var(--gold-soft); }
.studio-search input { border-radius:3px 18px 3px 18px; }
.deck-entry { border:0; border-radius:2px 16px 2px 16px; background:#101617; }
.deck-entry:hover { background:#151d1e; }
.deck-entry.is-cover { box-shadow:inset 3px 0 var(--gold-soft); }
.result-card { border-color:transparent; border-radius:3px 16px 3px 16px; background:#0d1213; }

/* Profile becomes a player ID rather than an account settings card. */
.profile-hero { border-radius:4px 36px 4px 36px; background:linear-gradient(115deg,rgba(217,255,114,.11),transparent 48%),#101516; box-shadow:none; }
.profile-avatar,.profile-photo-field__preview { border-radius:4px 22px 4px 22px; background:var(--gold-soft); }
.profile-stats,.profile-links { border-radius:3px 18px 3px 18px; background:#101516; }
.profile-stats b { color:var(--gold-soft); }

.empty-state { border:0; border-radius:3px 28px 3px 28px; background:linear-gradient(135deg,rgba(217,255,114,.04),rgba(241,240,232,.018)); }
.app-footer { border-top-color:rgba(217,255,114,.08); }

@media (max-width:600px) {
    .app-main,.landing { padding-inline:.7rem; }
    .hero2 { border-radius:0 30px 0 30px; }
    .deck-card,.pub-card { border-radius:3px 20px 3px 20px; }
    .studio-pane { border-radius:3px 20px 3px 20px; }
}

@media (max-width: 600px) {
    .app-main, .landing { padding: 1.25rem .85rem 2.5rem; }
    .page-head:not(.page-head--hero) { padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
    .hero2 { border-radius: 24px; margin-inline: -.15rem; }
    .home-section--featured { margin-inline: -.15rem; }
    .deck-grid, .deck-grid--pub { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
    .pub-card { display: grid; grid-template-columns: 42% 1fr; min-height: 145px; }
    .pub-card__art { aspect-ratio: auto; min-height: 145px; }
    .pub-card__body { justify-content: center; min-width: 0; }
    .pub-card__name { overflow-wrap: anywhere; }
    .gallery-section--ranked { padding: .8rem; }
}

/* Keep the new asymmetric silhouette after legacy mobile layout rules. */
@media (max-width:600px) {
    .hero2 { border-radius:0 30px 0 30px; }
    .deck-card,.pub-card { border-radius:3px 20px 3px 20px; }
    .page-head:not(.page-head--hero) { border-bottom-color:rgba(217,255,114,.08); }
}

/* Search and editorial journal. */
.deck-search { display:flex; align-items:center; gap:.7rem; width:min(100%,620px); margin:0 0 1.35rem; padding:.72rem 1rem; background:#0d1213; border-bottom:2px solid rgba(217,255,114,.34); border-radius:3px 16px 3px 16px; }
.deck-search:focus-within { border-color:var(--gold-soft); box-shadow:0 12px 30px rgba(0,0,0,.25); }
.deck-search input { flex:1; min-width:0; border:0; outline:0; color:var(--ink); background:transparent; }
.deck-search > i,.deck-search a { color:var(--gold-soft); }
.deck-search--gallery { margin-inline:auto; }
.journal,.post-studio,.article { width:min(1180px,100%); margin:0 auto; }
.journal-head,.post-studio > header { display:flex; align-items:end; justify-content:space-between; gap:1rem; margin-bottom:2.2rem; }
.journal-head h1,.post-studio h1,.article h1 { margin:.25rem 0; letter-spacing:-.055em; }
.journal-head h1,.post-studio h1 { font-size:clamp(2.5rem,7vw,5.6rem); }
.journal-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; }
.post-card { display:grid; grid-template-columns:42% 1fr; min-height:270px; overflow:hidden; color:inherit; background:#101516; border-radius:4px 26px 4px 26px; text-decoration:none; transition:.22s ease; }
.post-card:hover { color:inherit; transform:translateY(-5px); box-shadow:0 25px 55px rgba(0,0,0,.38); }
.post-card--lead { grid-column:1/-1; grid-template-columns:58% 1fr; min-height:430px; }
.post-card__art { display:grid; place-items:center; min-height:220px; overflow:hidden; color:var(--gold-soft); background:radial-gradient(circle at 30% 30%,rgba(217,255,114,.12),transparent 45%),#080b0c; font-size:3rem; }
.post-card__art img { width:100%; height:100%; object-fit:cover; }
.post-card__copy { display:flex; flex-direction:column; justify-content:center; padding:clamp(1.1rem,3vw,2.3rem); }
.post-card__copy span,.post-preview > span { color:var(--gold-soft); font-size:.72rem; font-weight:800; letter-spacing:.14em; text-transform:uppercase; }
.post-card__copy h2 { margin:.55rem 0; font-size:clamp(1.35rem,3vw,2.5rem); letter-spacing:-.04em; }
.post-card__copy b { margin-top:auto; color:var(--gold-soft); }
.article-hero { position:relative; min-height:560px; display:flex; align-items:end; overflow:hidden; border-radius:4px 40px 4px 40px; background:#0c1011; }
.article-hero > img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:.48; }
.article-hero::after { content:""; position:absolute; inset:0; background:linear-gradient(0deg,#080b0c 2%,transparent 80%); }
.article-hero > div { position:relative; z-index:1; width:min(800px,100%); padding:clamp(1.4rem,6vw,4.5rem); }
.article-hero h1 { font-size:clamp(2.6rem,8vw,6.5rem); }
.article-hero span { display:block; margin:.8rem 0; color:var(--gold-soft); }
.article-body { width:min(760px,100%); margin:0 auto; padding:clamp(2rem,6vw,5rem) 1rem; font-size:1.08rem; line-height:1.85; }
.article-body figure { margin:2.5rem -8vw 0; }
.article-body img { width:100%; border-radius:3px 24px 3px 24px; }
.markdown-content > :first-child { margin-top:0; }
.markdown-content > :last-child { margin-bottom:0; }
.markdown-content h1,.markdown-content h2,.markdown-content h3,.markdown-content h4,.markdown-content h5,.markdown-content h6 { margin:2.2em 0 .65em; color:var(--ink); line-height:1.14; letter-spacing:-.035em; text-wrap:balance; }
.markdown-content h1 { font-size:clamp(2.2rem,6vw,4rem); }
.markdown-content h2 { padding-bottom:.35rem; font-size:clamp(1.8rem,4.5vw,2.9rem); border-bottom:1px solid rgba(217,255,114,.14); }
.markdown-content h3 { font-size:clamp(1.45rem,3.4vw,2.1rem); }
.markdown-content h4 { font-size:1.25rem; }
.markdown-content p,.markdown-content ul,.markdown-content ol,.markdown-content dl,.markdown-content blockquote,.markdown-content pre,.markdown-content .markdown-table,.markdown-content figure,.markdown-content details { margin-block:1.25rem; }
.markdown-content ul,.markdown-content ol { padding-left:1.5rem; }
.markdown-content li { padding-left:.25rem; margin:.34rem 0; }
.markdown-content li::marker { color:var(--gold-soft); font-weight:800; }
.markdown-content a { color:var(--gold-soft); text-decoration:underline; text-decoration-color:rgba(217,255,114,.38); text-underline-offset:.2em; }
.markdown-content a:hover { color:#e8ff9d; text-decoration-color:currentColor; }
.markdown-content blockquote { position:relative; padding:1.1rem 1.3rem 1.1rem 1.5rem; color:#c5cbc5; border-left:3px solid var(--gold-soft); background:linear-gradient(90deg,rgba(217,255,114,.075),transparent); }
.markdown-content blockquote > :first-child { margin-top:0; }
.markdown-content blockquote > :last-child { margin-bottom:0; }
.markdown-content hr { height:1px; margin:2.8rem 0; border:0; background:linear-gradient(90deg,transparent,rgba(217,255,114,.4),transparent); }
.markdown-content code,.markdown-content kbd { font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace; font-size:.88em; }
.markdown-content :not(pre) > code,.markdown-content kbd { padding:.18em .42em; color:#e7ff9a; border:1px solid rgba(217,255,114,.13); border-radius:4px; background:#101718; }
.markdown-content pre { max-width:100%; overflow:auto; padding:1.2rem 1.3rem; color:#dfe8e1; border:1px solid rgba(99,230,196,.14); border-radius:4px 18px 4px 18px; background:#060909; box-shadow:inset 3px 0 0 rgba(99,230,196,.52); line-height:1.58; tab-size:4; }
.markdown-content pre code { color:inherit; font-size:.86rem; white-space:pre; }
.markdown-table { max-width:calc(100vw - 2rem); overflow-x:auto; border:1px solid rgba(217,255,114,.13); border-radius:4px 16px 4px 16px; background:#0b1011; }
.markdown-content table { width:100%; min-width:560px; border-collapse:collapse; font-size:.91rem; line-height:1.5; }
.markdown-content th,.markdown-content td { padding:.75rem .9rem; text-align:left; border-right:1px solid rgba(255,255,255,.055); border-bottom:1px solid rgba(255,255,255,.065); }
.markdown-content th { color:#e7ff9a; background:rgba(217,255,114,.065); font-family:var(--font-label); font-size:.72rem; letter-spacing:.06em; text-transform:uppercase; }
.markdown-content tr:last-child td { border-bottom:0; }
.markdown-content th:last-child,.markdown-content td:last-child { border-right:0; }
.markdown-content tbody tr:hover { background:rgba(255,255,255,.025); }
.markdown-content img { display:block; height:auto; margin:2rem auto; box-shadow:0 24px 60px rgba(0,0,0,.32); }
.markdown-content figcaption { margin-top:.6rem; color:var(--muted); font-size:.82rem; text-align:center; }
.markdown-content details { padding:1rem 1.15rem; border:1px solid rgba(217,255,114,.13); border-radius:4px 16px 4px 16px; background:#0d1213; }
.markdown-content summary { color:var(--gold-soft); font-weight:800; cursor:pointer; }
.markdown-content mark { padding:.08em .2em; color:#080b0c; background:var(--gold-soft); }
.markdown-content sup,.markdown-content sub { line-height:0; }
.markdown-help { display:block; color:var(--muted); font-size:.76rem; font-weight:500; line-height:1.5; }
.post-studio__layout { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(280px,.6fr); gap:1rem; align-items:start; }
.post-editor,.post-preview { padding:clamp(1rem,3vw,2rem); background:#101516; border-radius:4px 28px 4px 28px; }
.post-editor { display:grid; gap:1rem; }
.post-editor label { display:grid; gap:.45rem; font-weight:700; }
.post-editor .form-control { color:var(--ink); background:#080b0c; border-color:rgba(217,255,114,.12); }
.post-image-fields { display:grid; grid-template-columns:1fr 1fr; gap:.75rem; }
.post-image-fields label { padding:1rem; background:rgba(217,255,114,.04); border-radius:3px 16px 3px 16px; }
.post-image-fields label span { color:var(--gold-soft); }
.post-image-fields i { margin-right:.5rem; }
.post-preview { position:sticky; top:6rem; }
.post-preview__image { aspect-ratio:16/9; margin:.7rem 0 1rem; overflow:hidden; background:linear-gradient(135deg,rgba(217,255,114,.15),#080b0c); border-radius:3px 20px 3px 20px; }
.post-preview__image img { width:100%; height:100%; object-fit:cover; }
.studio-posts { display:grid; gap:.3rem; margin-top:2rem; }
.studio-posts > b { margin-bottom:.4rem; }
.studio-posts a { display:flex; justify-content:space-between; gap:.5rem; padding:.65rem 0; color:var(--ink); border-bottom:1px solid rgba(255,255,255,.06); text-decoration:none; }
.studio-posts span { color:var(--gold-soft); font-size:.72rem; }
.home-journal { margin-top:clamp(3rem,8vw,7rem); }
.home-posts { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:.7rem; }
.home-posts a { min-width:0; padding:.8rem; color:inherit; background:#101516; border-radius:3px 18px 3px 18px; text-decoration:none; }
.home-posts img { width:100%; aspect-ratio:1.5; object-fit:cover; border-radius:2px 12px 2px 12px; }
.home-posts span { display:block; margin-top:.7rem; color:var(--gold-soft); font-size:.7rem; }
.home-posts h3 { margin:.3rem 0; font-size:1rem; }
.home-posts p { display:-webkit-box; overflow:hidden; -webkit-line-clamp:2; -webkit-box-orient:vertical; margin:0; font-size:.8rem; color:var(--muted); }
.home-discover { display:grid; grid-template-columns:minmax(220px,.7fr) minmax(320px,1.3fr); align-items:end; gap:clamp(1.3rem,5vw,5rem); margin:clamp(2.5rem,7vw,6rem) 0; padding:clamp(1.2rem,4vw,2.7rem); background:linear-gradient(110deg,rgba(217,255,114,.075),transparent 62%),#101516; border-radius:4px 34px 4px 34px; }
.home-discover h2 { margin:.25rem 0; font-size:clamp(2rem,5vw,4rem); letter-spacing:-.055em; }
.home-discover p { max-width:520px; margin:0; color:var(--muted); }
.home-search { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:.75rem; padding:.55rem .55rem .55rem 1rem; background:#080b0c; border-bottom:2px solid rgba(217,255,114,.45); border-radius:3px 18px 3px 18px; }
.home-search > i { color:var(--gold-soft); }
.home-search input { min-width:0; padding:.65rem 0; color:var(--ink); border:0; outline:0; background:transparent; }
.home-search button { display:flex; align-items:center; gap:.5rem; padding:.75rem 1rem; color:#080b0c; border:0; border-radius:2px 12px 2px 12px; background:var(--gold-soft); font-weight:800; }
.home-capabilities { margin-top:clamp(3.5rem,8vw,7rem); }
.capability-grid { display:grid; grid-template-columns:1.2fr .8fr .8fr; gap:.8rem; }
.capability { position:relative; display:flex; min-height:310px; flex-direction:column; justify-content:end; overflow:hidden; padding:clamp(1.1rem,3vw,2rem); color:var(--ink); background:#101516; border-radius:3px 26px 3px 26px; text-decoration:none; transition:.2s ease; }
.capability:hover { color:var(--ink); transform:translateY(-5px); }
.capability::before { content:""; position:absolute; inset:0; opacity:.75; background:radial-gradient(circle at 75% 18%,rgba(217,255,114,.17),transparent 29%); }
.capability--library::before { background:radial-gradient(circle at 75% 18%,rgba(99,230,196,.16),transparent 30%); }
.capability--journal::before { background:radial-gradient(circle at 75% 18%,rgba(174,126,255,.16),transparent 30%); }
.capability > * { position:relative; z-index:1; }
.capability > span { margin-bottom:auto; color:var(--gold-soft); font-size:.63rem; font-weight:800; letter-spacing:.15em; text-transform:uppercase; }
.capability > i { align-self:end; margin-bottom:auto; color:rgba(217,255,114,.48); font-size:clamp(3rem,7vw,6.5rem); }
.capability h3 { margin:.4rem 0; font-size:clamp(1.35rem,3vw,2.2rem); letter-spacing:-.045em; }
.capability p { margin:0; color:var(--muted); }
.home-posts__placeholder { display:grid !important; place-items:center; aspect-ratio:1.5; margin:0 !important; color:var(--gold-soft) !important; background:radial-gradient(circle,rgba(217,255,114,.12),transparent 60%),#080b0c; border-radius:2px 12px 2px 12px; font-size:2rem !important; }
.home-journal__empty { display:flex; align-items:center; gap:1rem; padding:clamp(1rem,4vw,2rem); background:#101516; border-radius:3px 24px 3px 24px; }
.home-journal__empty > i { display:grid; place-items:center; width:60px; height:60px; flex:0 0 60px; color:#080b0c; background:var(--gold-soft); border-radius:2px 16px 2px 16px; font-size:1.5rem; }
.home-journal__empty div { flex:1; }
.home-journal__empty h3,.home-journal__empty p { margin:.15rem 0; }
.home-journal__empty p { color:var(--muted); }

@media (max-width:760px) {
    .journal-head,.post-studio > header { align-items:start; flex-direction:column; }
    .journal-grid,.post-studio__layout { grid-template-columns:1fr; }
    .post-card,.post-card--lead { grid-column:auto; grid-template-columns:1fr; min-height:0; }
    .post-card__art { aspect-ratio:16/9; min-height:0; }
    .post-preview { position:static; }
    .post-image-fields { grid-template-columns:1fr; }
    .article-hero { min-height:72vh; margin-inline:-.7rem; border-radius:0 28px 0 28px; }
    .article-body figure { margin-inline:-.7rem; }
    .home-posts { display:flex; overflow-x:auto; scroll-snap-type:x mandatory; padding-bottom:.65rem; }
    .home-posts a { flex:0 0 78%; scroll-snap-align:start; }
    .home-discover { grid-template-columns:1fr; margin-inline:-.15rem; }
    .home-search button span { display:none; }
    .capability-grid { display:flex; overflow-x:auto; scroll-snap-type:x mandatory; padding-bottom:.7rem; }
    .capability { flex:0 0 86%; min-height:300px; scroll-snap-align:start; }
    .home-journal__empty { align-items:flex-start; flex-wrap:wrap; }
    .home-journal__empty .btn { width:100%; }
}
