:root {
    --bg-night: #090b11;
    --bg-ash: #12151f;
    --panel: rgba(17, 21, 32, 0.9);
    --panel-strong: rgba(11, 14, 22, 0.96);
    --line: rgba(126, 139, 170, 0.24);
    --accent: #3f74db;
    --accent-2: #2c4f96;
    --accent-soft: rgba(63, 116, 219, 0.18);
    --gold: #cfb275;
    --cinder: #f0f3ff;
    --mist: #9ba9c3;
    --danger: #ef4444;
    --success: #22c55e;
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
    --radius: 18px;
    --scroll-glow: 0;
}

:root {
    --bg-night: #090b11;
    --bg-ash: #12151f;
    --panel: rgba(17, 21, 32, 0.9);
    --panel-strong: rgba(11, 14, 22, 0.96);
    --line: rgba(126, 139, 170, 0.24);
    --accent: #3f74db;
    --accent-2: #2c4f96;
    --accent-soft: rgba(63, 116, 219, 0.18);
    --gold: #cfb275;
    --cinder: #f0f3ff;
    --mist: #9ba9c3;
    --danger: #ef4444;
    --success: #22c55e;
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
    --radius: 18px;
    --scroll-glow: 0;
    --arcane-gold: #d8b26e;
    --arcane-blue: #6fa9ff;
}

/* ── Global Arcane Background ───────────────────────────────── */
.arcane-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 20%, #1a2e54 0%, transparent 32%),
        radial-gradient(circle at 80% 0%, #2f1f45 0%, transparent 28%),
        linear-gradient(180deg, #06090f 0%, #090f1e 45%, #080d18 100%);
    transform: translateY(calc(var(--space-shift, 0px) * -0.35));
    transition: transform 0.18s linear;
}

.arcane-bg::after {
    content: '';
    position: absolute;
    inset: -30% -20%;
    background:
        radial-gradient(circle at 50% 52%, rgba(127, 185, 255, calc(0.08 + var(--scroll-glow, 0) * 0.12)) 0%, transparent 50%),
        radial-gradient(circle at 28% 68%, rgba(255, 220, 134, calc(0.05 + var(--scroll-glow, 0) * 0.12)) 0%, transparent 52%);
    filter: blur(10px);
    pointer-events: none;
}

#arcane-starfield {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.mist {
    position: absolute;
    width: 65vw;
    height: 45vh;
    filter: blur(30px);
    opacity: 0.17;
    border-radius: 50%;
    animation: mistDrift 28s linear infinite;
}
.mist-1 { top: 4%; left: -16%; background: rgba(98,126,218,0.45); }
.mist-2 { top: 38%; right: -20%; background: rgba(222,170,84,0.35); animation-duration: 34s; }
.mist-3 { bottom: -6%; left: -8%; background: rgba(89,144,253,0.3); animation-duration: 40s; }
.mist-4 { top: 55%; right: 30%; background: rgba(160,80,240,0.22); animation-duration: 46s; width: 45vw; height: 35vh; }

.rune-circle {
    position: absolute;
    border: 1px solid rgba(216,178,110,0.22);
    border-radius: 50%;
    box-shadow: inset 0 0 22px rgba(121,166,255,0.1);
}
.rune-1 { width: 240px; height: 240px; right: 10%; top: 12%; animation: spinRune 20s linear infinite; }
.rune-2 { width: 320px; height: 320px; left: 6%; bottom: 8%; animation: spinRuneReverse 36s linear infinite; }

.light-vein {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(111,169,255,0.35) 15%,
        rgba(216,178,110,0.45) 50%,
        rgba(111,169,255,0.35) 85%,
        transparent 100%);
    animation: veinPulse 6s ease-in-out infinite;
}
.vein-left  { left: 8px; }
.vein-right { right: 8px; }

@keyframes mistDrift {
    0%   { transform: translateX(0) translateY(0); }
    50%  { transform: translateX(28px) translateY(12px); }
    100% { transform: translateX(0) translateY(0); }
}
@keyframes spinRune {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes spinRuneReverse {
    from { transform: rotate(360deg); }
    to   { transform: rotate(0deg); }
}
@keyframes veinPulse {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 1; }
}
@keyframes orbPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.12); }
}

*  {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    color: var(--cinder);
    min-height: 100%;
    font-family: 'Manrope', sans-serif;
    background:
        radial-gradient(circle at 15% calc(10% + (var(--scroll-glow) * 50%)), rgba(212, 178, 117, 0.12), transparent 35%),
        radial-gradient(circle at 80% calc(100% - (var(--scroll-glow) * 45%)), rgba(63, 116, 219, 0.18), transparent 30%),
        linear-gradient(160deg, #06080e 0%, var(--bg-night) 42%, var(--bg-ash) 100%);
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
}

.theme-body {
    min-height: 100vh;
}

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    gap: 14px;
    background: radial-gradient(circle at 50% 40%, rgba(32, 62, 120, 0.26), rgba(3, 8, 18, 0.98));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.page-loader.is-visible {
    opacity: 1;
    pointer-events: all;
}

.page-loader-core {
    position: relative;
    width: 86px;
    height: 86px;
}

.page-loader-orbit {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(126, 175, 255, 0.45);
    border-top-color: rgba(248, 211, 133, 0.9);
    animation: loaderSpin 1.05s linear infinite;
}

.page-loader-orbit.orbit-reverse {
    inset: 11px;
    border-color: rgba(248, 211, 133, 0.42);
    border-top-color: rgba(126, 175, 255, 0.88);
    animation-direction: reverse;
    animation-duration: 0.85s;
}

.page-loader-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 12px;
    margin-left: -6px;
    margin-top: -6px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f4cc80, #8ec5ff);
    box-shadow: 0 0 16px rgba(151, 197, 255, 0.68);
}

.page-loader-text {
    margin: 0;
    color: #e6efff;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.side-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(5, 10, 20, 0.62);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

@keyframes loaderSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.theme-body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 34px 34px;
    opacity: 0.24;
    z-index: 0;
}

.theme-guest {
    display: block;
    min-height: 100vh;
}

.compact-shell {
    max-width: 860px;
    margin: 34px auto 50px;
}

.fantasy-panel {
    background: linear-gradient(180deg, rgba(19, 24, 36, 0.94), rgba(9, 12, 19, 0.93));
    border: 1px solid rgba(117, 135, 173, 0.28);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.fantasy-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(207, 178, 117, 0.55), transparent, rgba(63, 116, 219, 0.45));
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    pointer-events: none;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.73rem;
    color: var(--gold);
    margin: 0 0 0.8rem;
}

h1,
h2,
h3,
.logo-mark {
    margin: 0 0 0.7rem;
    font-family: 'Cinzel', serif;
}

.muted {
    color: var(--mist);
}

.hero-shell,
.page-shell {
    width: min(1220px, calc(100% - 24px));
    margin: 0 auto;
    padding: 22px 0 34px;
    position: relative;
    z-index: 1;
}

.compact-shell {
    max-width: 760px;
}

.hero-grid,
.auth-grid,
.dashboard-grid,
.card-grid,
.metrics-grid,
.dual-grid,
.combat-layout,
.gallery-grid,
.plans-grid {
    display: grid;
    gap: 16px;
}

.hero-grid {
    grid-template-columns: 1fr;
}

.hero-card,
.stat-card,
.content-card,
.metric-card,
.feed-card,
.image-card,
.plan-card,
.combat-card,
.grid-card,
.legend-box {
    padding: 18px;
}

.arcane-hero-card {
    animation: arcanePulse 8s ease-in-out infinite;
}

.hero-copy {
    color: var(--mist);
    line-height: 1.72;
    margin-bottom: 1.2rem;
}

.hero-actions,
.button-row,
.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.button,
.button-outline,
.button-danger,
.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 999px;
    padding: 0 14px;
    border: 1px solid transparent;
    transition: transform 0.2s ease, background 0.2s ease;
    cursor: pointer;
}

.button {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
}

.button-outline {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--cinder);
}

.button-danger {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ffd4d4;
}

.button:hover,
.button-outline:hover,
.button-danger:hover {
    transform: translateY(-2px);
}

.button-block {
    width: 100%;
}

.flash {
    width: min(1080px, calc(100% - 24px));
    margin: 12px auto;
    padding: 12px 16px;
    border-radius: 14px;
    position: relative;
    z-index: 2;
}

.flash-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.24);
}

.flash-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.24);
}

.app-shell {
    min-height: calc(100vh - 94px);
}

.app-shell-horizontal {
    display: block;
}

.topbar {
    position: sticky;
    top: 10px;
    z-index: 100;
    margin: 10px 12px 0;
    padding: 8px 12px;
    display: grid;
    gap: 8px;
    overflow: visible;
}

.topbar-brand {
    display: grid;
    align-content: center;
    gap: 1px;
}

.topbar-brand .eyebrow {
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    margin: 0;
    color: #93acd4;
}

.topbar-brand .logo-mark {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1;
}

.topbar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.menu-group {
    position: relative;
}

.menu-trigger {
    min-height: 34px;
    border-radius: 999px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: var(--cinder);
    cursor: pointer;
    font-size: 0.84rem;
}

.menu-trigger:hover,
.menu-trigger:focus-visible {
    transform: none;
}

.submenu-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 210px;
    display: none;
    background: var(--panel-strong);
    border-radius: 14px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    overflow: hidden;
    z-index: 80;
}

.menu-group.is-open .submenu-panel,
.menu-group:hover .submenu-panel {
    display: grid;
}

.submenu-panel a {
    display: block;
    padding: 10px 12px;
    color: var(--cinder);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.submenu-panel a:last-child {
    border-bottom: none;
}

.submenu-panel a:hover {
    background: rgba(63, 116, 219, 0.15);
}

.topbar-user {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    position: relative;
    padding-right: 6px;
    align-self: start;
}

.topbar-user-stack {
    display: grid;
    gap: 4px;
    justify-items: end;
}

.plain-icon {
    border: none;
    background: transparent;
    box-shadow: none;
    width: auto;
    height: auto;
    padding: 0;
    margin-right: 2px;
}

.topbar-notification.plain-icon {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.topbar-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--cinder);
    min-height: 48px;
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    margin-right: 0;
}

.topbar-avatar-shell {
    position: relative;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
}

.topbar-profile-link:hover,
.topbar-profile-link:focus-visible {
    transform: none !important;
    box-shadow: none !important;
}

.topbar-mini-avatar {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.topbar-mini-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.topbar-mini-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
}

.mobile-menu-handle {
    position: fixed;
    left: 10px;
    top: 70px;
    z-index: 140;
    width: 34px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(153, 190, 255, 0.4);
    background: rgba(10, 19, 37, 0.86);
    color: #dce9ff;
    display: none;
}

.section-head-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.add-slot-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 136px;
    border: 2px dashed rgba(140, 179, 245, 0.42);
    border-radius: 14px;
    color: #d4e6ff;
    background: rgba(16, 34, 65, 0.26);
    font-weight: 700;
}

.profile-side-menu .action-btn {
    display: block;
    margin-bottom: 8px;
}

.profile-side-menu .action-btn.active {
    background: rgba(63, 116, 219, 0.3);
}

.profile-follow-btn {
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.82rem;
}

.dashboard-community-strip {
    overflow: hidden;
}

.dashboard-strip-track {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}

.dashboard-strip-item {
    border: 1px solid rgba(121, 151, 203, 0.24);
    border-radius: 10px;
    background: rgba(10, 16, 28, 0.75);
    padding: 10px;
    display: grid;
    gap: 6px;
}

.dashboard-strip-item small {
    color: #a6badc;
    font-size: 0.78rem;
}

.profile-banner-media {
    width: 100%;
    height: clamp(180px, 28vw, 320px);
    object-fit: fill;
    background: rgba(6, 10, 20, 0.92);
}

.profile-banner-fallback {
    object-fit: unset;
}

.profile-page-shell .profile-header-card {
    padding: 0;
    margin: -24px -24px 24px;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.profile-private-head {
    padding: 24px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
    position: relative;
    z-index: 1;
}

.profile-private-avatar-shell {
    position: relative;
    width: 140px;
    height: 140px;
    flex: 0 0 140px;
}

.profile-private-avatar {
    width: 140px;
    height: 140px;
    border-radius: 8px;
    border: 4px solid #111318;
    object-fit: cover;
}

.profile-private-avatar-fallback {
    background: linear-gradient(135deg, #3f74db 0%, #6a5acd 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
}

.profile-private-copy {
    padding-top: 6px;
}

.profile-private-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-account-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.main-content {
    padding: 8px 12px 30px;
    position: relative;
    z-index: 1;
}

.page-header {
    margin-bottom: 16px;
}

.page-header p {
    max-width: 760px;
    color: var(--mist);
}

.metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.metric-value {
    font-size: 1.8rem;
    font-family: 'Cinzel', serif;
}

.metric-label {
    color: var(--mist);
}

.card-grid,
.gallery-grid,
.plans-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.content-card,
.stat-card,
.metric-card,
.feed-card,
.image-card,
.plan-card,
.combat-card,
.grid-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.form-grid {
    display: grid;
    gap: 12px;
}

.dual-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.field-group {
    display: grid;
    gap: 7px;
}

.field-group label {
    color: #cad4ea;
    font-size: 0.92rem;
}

.field-group input,
.field-group select,
.field-group textarea {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: var(--cinder);
    border-radius: 12px;
    padding: 10px 12px;
    min-height: 42px;
}

.field-group textarea {
    min-height: 100px;
    resize: vertical;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge,
.tiny-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    border: 1px solid rgba(63, 116, 219, 0.34);
    background: rgba(63, 116, 219, 0.16);
    color: #dbe7ff;
}

.badge {
    font-size: 0.86rem;
    padding: 5px 10px;
}

.tiny-badge {
    font-size: 0.74rem;
    padding: 4px 8px;
}

.list-stack,
.timeline-stack,
.log-stack,
.sheet-meta,
.tag-row {
    display: grid;
    gap: 9px;
}

.list-item,
.timeline-item,
.log-entry,
.sheet-card {
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.empty-state {
    padding: 16px;
    border-radius: 14px;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    color: var(--mist);
}

.repeater-list {
    display: grid;
    gap: 10px;
}

.repeater-item {
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.table-wrap {
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th,
td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    vertical-align: top;
}

.gallery-thumb {
    aspect-ratio: 4 / 3;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.04);
}

.campaign-cover {
    width: 100%;
    aspect-ratio: 16 / 6;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.campaign-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.progress-shell {
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--accent));
}

.plan-card.featured {
    border-color: rgba(207, 178, 117, 0.45);
}

.price-line {
    font-size: 1.9rem;
    font-family: 'Cinzel', serif;
}

.feed-card h3,
.sheet-card h3,
.content-card h2,
.metric-card h3,
.plan-card h3,
.image-card h3,
.combat-card h3,
.grid-card h3 {
    margin-bottom: 0.45rem;
}

.sheet-card .tag-row,
.image-card .tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.combat-layout {
    grid-template-columns: 1fr;
}

.combat-page-shell .page-header {
    margin-bottom: 10px;
}

.combat-vtt-tabs {
    display: flex;
    gap: 8px;
    margin: 0 auto 12px;
    width: min(1220px, calc(100% - 24px));
}

.combat-vtt-tab {
    padding: 8px 12px;
    border-radius: 10px 10px 0 0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #bfc8db;
    font-size: 0.84rem;
}

.combat-vtt-tab.active {
    color: #ffffff;
    border-bottom-color: transparent;
    background: linear-gradient(180deg, rgba(35, 42, 62, 0.95), rgba(14, 18, 28, 0.94));
}

.combat-card {
    background: linear-gradient(180deg, rgba(19, 24, 36, 0.96), rgba(10, 14, 24, 0.97));
    max-height: 82vh;
    overflow: auto;
}

.grid-card {
    background: linear-gradient(180deg, rgba(23, 27, 36, 0.97), rgba(12, 16, 24, 0.97));
}

.map-manager-box {
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.grid-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.grid-stage {
    position: relative;
    background: linear-gradient(180deg, rgba(6, 8, 13, 0.98), rgba(12, 16, 24, 0.96));
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    min-height: 480px;
    overflow: auto;
}

.grid-stage-inner {
    position: relative;
    min-width: 100%;
    min-height: 480px;
}

.map-template-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.42;
    pointer-events: none;
}

.grid-cells {
    display: grid;
    position: relative;
}

.grid-cell {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 48px;
    min-height: 48px;
    background: transparent;
}

.grid-overlay,
.token-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.grid-token {
    position: absolute;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.44);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    pointer-events: auto;
    cursor: pointer;
    box-shadow: 0 7px 16px rgba(0, 0, 0, 0.42);
}

.grid-token.active {
    outline: 3px solid rgba(207, 178, 117, 0.55);
}

.legend-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.direction-pad {
    display: grid;
    grid-template-columns: repeat(3, 42px);
    gap: 8px;
}

.direction-pad button {
    min-height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    background: rgba(255, 255, 255, 0.05);
    color: var(--cinder);
}

.direction-pad button.is-selected {
    background: var(--accent-soft);
    border-color: rgba(63, 116, 219, 0.5);
}

.token-table input,
.token-table select {
    min-width: 70px;
}

.helper-text {
    color: var(--mist);
    font-size: 0.85rem;
}

.reveal-up {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

body.mobile-no-ui-motion .reveal-up {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

body.mobile-no-ui-motion .topbar-nav .nav-pill,
body.mobile-no-ui-motion .topbar,
body.mobile-no-ui-motion .page-loader,
body.mobile-no-ui-motion .side-nav-backdrop {
    transition: none !important;
}

.reveal-delay-2 {
    transition-delay: 0.16s;
}

@keyframes arcanePulse {
    0% {
        box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4), 0 0 0 rgba(63, 116, 219, 0);
    }

    50% {
        box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), 0 0 24px rgba(63, 116, 219, 0.2);
    }

    100% {
        box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4), 0 0 0 rgba(63, 116, 219, 0);
    }
}

@media (min-width: 900px) {
    .topbar {
        grid-template-columns: 260px 1fr auto;
        align-items: center;
    }

    .dashboard-grid {
        grid-template-columns: 1.1fr 0.9fr;
    }

    .combat-layout {
        grid-template-columns: 460px 1fr;
        align-items: start;
    }

    .hero-grid {
        grid-template-columns: 1.2fr 0.8fr;
        align-items: center;
    }

    .auth-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Topbar compact redesign + role tags --- */
.topbar {
    border-radius: 18px;
    border: 1px solid rgba(88, 121, 196, 0.35);
    background: linear-gradient(120deg, rgba(6, 16, 36, 0.92), rgba(9, 21, 48, 0.82));
}

.topbar-nav-compact {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.nav-pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.05);
    color: var(--cinder);
    font-weight: 600;
    font-size: 0.82rem;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.nav-pill:hover {
    transform: translateY(-1px);
    background: rgba(63, 116, 219, 0.2);
    border-color: rgba(141, 184, 255, 0.45);
}

.nav-pill-admin {
    border-color: rgba(220, 180, 90, 0.52);
    background: rgba(220, 180, 90, 0.13);
}

.topbar-user-info {
    display: grid;
    gap: 2px;
    text-align: left;
    min-width: 0;
}

.topbar-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: center;
}

.topbar-tags .tiny-badge {
    font-size: 0.56rem;
    padding: 2px 8px;
    gap: 2px;
    line-height: 1.2;
    white-space: nowrap;
    border-radius: 10px;
}

.topbar-logout {
    min-height: 30px;
    padding: 0 12px;
}

.tiny-badge-owner {
    color: #f6d691;
    border-color: rgba(246, 214, 145, 0.55);
    background: rgba(246, 214, 145, 0.14);
}

.tiny-badge-admin {
    color: #f2c976;
    border-color: rgba(242, 201, 118, 0.45);
    background: rgba(242, 201, 118, 0.12);
}

.tiny-badge-role {
    color: #8fc5ff;
    border-color: rgba(143, 197, 255, 0.48);
    background: rgba(68, 128, 217, 0.2);
}

.tiny-badge-plan {
    color: #b0f0bf;
    border-color: rgba(176, 240, 191, 0.45);
    background: rgba(41, 164, 95, 0.15);
}

.tiny-badge-gold {
    color: #f7d989;
    border-color: rgba(240, 190, 78, 0.58);
    background: rgba(155, 105, 16, 0.28);
}

@media (max-width: 760px) {
    .topbar-user-info {
        gap: 6px;
    }

    .topbar-tags {
        gap: 4px;
    }

    .topbar-tags .tiny-badge {
        font-size: 0.6rem;
        padding: 2px 8px;
        min-height: 18px;
        border-radius: 10px;
    }
}

.topbar-notification {
    position: absolute;
    right: 0;
    top: -16px;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--cinder);
    margin-right: 0;
}

.topbar-notification .bell-icon {
    font-size: 1rem;
    line-height: 1;
}

.notification-count {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(4, 10, 23, 1);
    font-weight: 700;
}

.offline-banner {
    position: sticky;
    top: 0;
    z-index: 120;
    margin: 0 12px;
    border-radius: 0 0 12px 12px;
    border: 1px solid rgba(244, 114, 182, 0.45);
    background: rgba(95, 16, 44, 0.93);
    color: #fff2f7;
    padding: 10px 14px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.offline-banner[hidden] {
    display: none !important;
}

/* Time-of-day theme shifts */
body[data-time-theme="morning"] .arcane-bg {
    background:
        radial-gradient(circle at 15% 20%, rgba(134, 182, 255, 0.32) 0%, transparent 34%),
        radial-gradient(circle at 85% 15%, rgba(250, 194, 134, 0.18) 0%, transparent 30%),
        linear-gradient(180deg, #0b1830 0%, #102443 45%, #132e52 100%);
}

body[data-time-theme="afternoon"] .arcane-bg {
    background:
        radial-gradient(circle at 20% 20%, rgba(116, 164, 255, 0.26) 0%, transparent 32%),
        radial-gradient(circle at 80% 0%, rgba(236, 180, 109, 0.2) 0%, transparent 28%),
        linear-gradient(180deg, #061328 0%, #0d1f3f 45%, #10254a 100%);
}

body[data-time-theme="night"] .arcane-bg {
    background:
        radial-gradient(circle at 20% 20%, #1a2e54 0%, transparent 32%),
        radial-gradient(circle at 80% 0%, #2f1f45 0%, transparent 28%),
        linear-gradient(180deg, #06090f 0%, #090f1e 45%, #080d18 100%);
}

.role-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.role-choice-card {
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.04);
    display: grid;
    gap: 4px;
}

.role-choice-card input {
    margin: 0;
}

.role-choice-card.is-disabled {
    opacity: 0.55;
}

.register-modal-card {
    max-width: 760px;
    padding: 20px;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(7, 14, 30, 0.92), rgba(9, 18, 37, 0.88));
    box-shadow: 0 20px 46px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(120, 166, 247, 0.2) inset;
}

.auth-arcane-shell {
    max-width: 900px;
}

.auth-arcane-card {
    border: 1px solid rgba(216, 178, 110, 0.46);
    background:
        radial-gradient(circle at 50% 52%, rgba(216, 178, 110, 0.18), transparent 36%),
        radial-gradient(circle at 82% 12%, rgba(121, 151, 222, 0.24), transparent 34%),
        linear-gradient(152deg, rgba(9, 14, 28, 0.93), rgba(9, 16, 34, 0.9));
    position: relative;
}

.auth-arcane-card::before {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 14px;
    border: 1px solid rgba(216, 178, 110, 0.22);
    pointer-events: none;
}

.auth-arcane-title {
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    margin-bottom: 0.25rem;
    color: #efd7a2;
}

.auth-arcane-subtitle {
    color: #c3cde0;
    margin-bottom: 0.65rem;
}

.auth-arcane-form {
    gap: 10px;
}

.auth-arcane-form .field-group label {
    color: #d9c49a;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
}

.auth-arcane-input,
.auth-arcane-form input,
.auth-arcane-form select {
    border-radius: 999px !important;
    border: 1px solid rgba(199, 168, 111, 0.7) !important;
    background: linear-gradient(180deg, rgba(12, 20, 43, 0.94), rgba(8, 14, 33, 0.95)) !important;
    color: #eef4ff !important;
    box-shadow: inset 0 0 0 1px rgba(84, 114, 183, 0.25);
}

.auth-arcane-input:focus,
.auth-arcane-form input:focus,
.auth-arcane-form select:focus {
    outline: none;
    border-color: rgba(245, 213, 149, 0.95) !important;
    box-shadow: 0 0 0 2px rgba(216, 178, 110, 0.24), inset 0 0 0 1px rgba(84, 114, 183, 0.35);
}

.auth-role-choice-grid .role-choice-card {
    border-radius: 12px;
    border: 1px solid rgba(137, 166, 227, 0.38);
    background: linear-gradient(160deg, rgba(40, 57, 95, 0.42), rgba(16, 26, 49, 0.72));
    min-height: 116px;
    overflow: hidden;
}

.auth-role-choice-grid .role-choice-card:has(input:checked) {
    border-color: rgba(245, 213, 149, 0.78);
    box-shadow: 0 0 0 1px rgba(245, 213, 149, 0.35), 0 10px 18px rgba(15, 22, 42, 0.5);
    background: linear-gradient(160deg, rgba(74, 88, 140, 0.55), rgba(27, 32, 68, 0.82));
}

.auth-role-card {
    position: relative;
    display: grid;
    gap: 6px;
}

.auth-role-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auth-role-card::before {
    content: '';
    position: absolute;
    inset: -30%;
    opacity: 0;
    background: conic-gradient(from 0deg, rgba(245, 213, 149, 0.0), rgba(245, 213, 149, 0.72), rgba(103, 158, 255, 0.65), rgba(245, 213, 149, 0.0));
    animation: roleGlowSpin 3s linear infinite;
}

.auth-role-card:has(input:checked)::before {
    opacity: 1;
}

.auth-role-card::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 10px;
    background: linear-gradient(160deg, rgba(40, 57, 95, 0.64), rgba(16, 26, 49, 0.86));
}

.auth-role-card > * {
    position: relative;
    z-index: 1;
}

.auth-role-art {
    display: block;
    width: 100%;
    height: 48px;
    border-radius: 8px;
    border: 1px solid rgba(145, 177, 236, 0.28);
    background-size: cover;
    background-position: center;
    margin-bottom: 2px;
}

.auth-role-card-player .auth-role-art {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 420 120'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23375ea8'/%3E%3Cstop offset='1' stop-color='%231c2f61'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='420' height='120' rx='12' fill='url(%23g)'/%3E%3Cg stroke='%23d8e7ff' stroke-opacity='.9' fill='none' stroke-width='4'%3E%3Ccircle cx='210' cy='62' r='18'/%3E%3Cpath d='M170 106c8-28 24-42 40-42s32 14 40 42'/%3E%3C/g%3E%3C/svg%3E");
}

.auth-role-card-master .auth-role-art {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 420 120'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23495f9b'/%3E%3Cstop offset='1' stop-color='%23203059'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='420' height='120' rx='12' fill='url(%23g)'/%3E%3Cg fill='none' stroke='%23f3dca8' stroke-width='4' stroke-linejoin='round'%3E%3Cpath d='M210 24l26 14v18c0 20-12 34-26 40-14-6-26-20-26-40V38z'/%3E%3Cpath d='M210 45l7 13 14 2-10 10 3 14-14-7-14 7 3-14-10-10 14-2z'/%3E%3C/g%3E%3C/svg%3E");
}

.auth-role-card-both .auth-role-art {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 420 120'%3E%3Cdefs%3E%3CradialGradient id='g' cx='.5' cy='.5' r='.7'%3E%3Cstop offset='0' stop-color='%235a4fb5'/%3E%3Cstop offset='1' stop-color='%231b224f'/%3E%3C/radialGradient%3E%3C/defs%3E%3Crect width='420' height='120' rx='12' fill='url(%23g)'/%3E%3Cg stroke='%23cddcff' stroke-opacity='.85' stroke-width='2'%3E%3Cpath d='M76 84l54-26 62 18 52-31 82 19'/%3E%3C/g%3E%3Cg fill='%23ffffff'%3E%3Ccircle cx='76' cy='84' r='3'/%3E%3Ccircle cx='130' cy='58' r='3'/%3E%3Ccircle cx='192' cy='76' r='3'/%3E%3Ccircle cx='244' cy='45' r='3'/%3E%3Ccircle cx='326' cy='64' r='3'/%3E%3Ccircle cx='360' cy='52' r='2.5'/%3E%3C/g%3E%3C/svg%3E");
}

.auth-role-card strong,
.auth-role-card small {
    padding-left: 2px;
}

.sheet-style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.sheet-style-card {
    border: 1px solid rgba(129, 160, 224, 0.45);
    border-radius: 10px;
    background: rgba(16, 27, 51, 0.78);
    color: #dfe9ff;
    display: grid;
    gap: 6px;
    padding: 8px;
    text-align: left;
    min-height: 74px;
}

.sheet-style-card.is-selected {
    border-color: rgba(245, 213, 149, 0.9);
    box-shadow: 0 0 0 1px rgba(245, 213, 149, 0.35), 0 8px 16px rgba(8, 17, 39, 0.55);
}

.sheet-style-art {
    display: block;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(152, 181, 238, 0.3);
    background-size: cover;
    background-position: center;
}

.sheet-style-name {
    font-size: 0.74rem;
    font-weight: 700;
}

.sheet-style-d20 .sheet-style-art {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 70'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%233f74db'/%3E%3Cstop offset='1' stop-color='%231f3d7c'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='220' height='70' rx='10' fill='url(%23g)'/%3E%3Cpolygon points='110,10 145,30 132,58 88,58 75,30' fill='none' stroke='%23f8ddad' stroke-width='3'/%3E%3Ctext x='109' y='42' font-size='16' text-anchor='middle' fill='%23f8ddad' font-family='Cinzel, serif'%3ED20%3C/text%3E%3C/svg%3E");
}

.sheet-style-pathfinder .sheet-style-art {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 70'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%238f2c23'/%3E%3Cstop offset='1' stop-color='%23481b18'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='220' height='70' rx='10' fill='url(%23g)'/%3E%3Cpath d='M52 49h22V22h26v9H84v8h15v10H52z' fill='%23f3d9a5'/%3E%3Ctext x='156' y='43' font-size='14' text-anchor='middle' fill='%23f3d9a5' font-family='Cinzel, serif'%3EPF2%3C/text%3E%3C/svg%3E");
}

.sheet-style-other .sheet-style-art {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 70'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23466aa7'/%3E%3Cstop offset='1' stop-color='%23212942'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='220' height='70' rx='10' fill='url(%23g)'/%3E%3Ccircle cx='74' cy='35' r='14' fill='none' stroke='%23d9e6ff' stroke-width='3'/%3E%3Ccircle cx='74' cy='35' r='4' fill='%23d9e6ff'/%3E%3Cpath d='M120 23h46M120 35h46M120 47h46' stroke='%23d9e6ff' stroke-width='3'/%3E%3C/svg%3E");
}

@keyframes roleGlowSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.auth-arcane-submit {
    border-radius: 0;
    clip-path: polygon(14px 0%, calc(100% - 14px) 0%, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0% calc(100% - 14px), 0% 14px);
    border: none;
    background: linear-gradient(160deg, #4a6fd4 0%, #2a459e 55%, #1e2f6b 100%);
    box-shadow: 0 0 0 1px rgba(180,210,255,0.30) inset, 0 8px 22px rgba(16,33,88,0.55);
    font-size: 1.18rem;
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    position: relative;
    overflow: visible;
}

.auth-arcane-submit::before {
    content: '';
    position: absolute;
    inset: 2px;
    clip-path: polygon(12px 0%, calc(100% - 12px) 0%, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0% calc(100% - 12px), 0% 12px);
    background: linear-gradient(160deg, rgba(130,175,255,0.14) 0%, transparent 60%);
    pointer-events: none;
}

.auth-arcane-submit:hover {
    background: linear-gradient(160deg, #5c82e0 0%, #3456b8 55%, #2a3d82 100%);
    box-shadow: 0 0 0 1px rgba(200,225,255,0.40) inset, 0 12px 32px rgba(30,60,160,0.65), 0 0 24px rgba(80,140,255,0.35);
}

/* ── MMORPG chamfered corners — landing hero & login page ──── */
.hero-actions .button,
.hero-actions .button-outline,
.auth-login-card .button,
.auth-login-card .button-outline,
.auth-login-card .button-block {
    border-radius: 0;
    clip-path: polygon(12px 0%, calc(100% - 12px) 0%, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0% calc(100% - 12px), 0% 12px);
    border: none;
    min-height: 46px;
    padding: 0 28px;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    position: relative;
}

.hero-actions .button {
    background: linear-gradient(155deg, #4d73d8 0%, #2a459e 60%, #1c2d73 100%);
    box-shadow: 0 0 0 1px rgba(160,200,255,0.28) inset, 0 8px 20px rgba(20,40,120,0.55), 0 0 18px rgba(70,120,255,0.25);
}

.hero-actions .button:hover {
    background: linear-gradient(155deg, #5c82e6 0%, #3355b8 60%, #2238a0 100%);
    box-shadow: 0 0 0 1px rgba(200,225,255,0.38) inset, 0 12px 28px rgba(30,60,160,0.65), 0 0 28px rgba(90,150,255,0.42);
    transform: translateY(-3px);
}

.hero-actions .button-outline {
    background: rgba(255,255,255,0.04);
    box-shadow: 0 0 0 1px rgba(180,200,255,0.32) inset;
    color: #d8e8ff;
}

.hero-actions .button-outline:hover {
    background: rgba(80,130,255,0.14);
    box-shadow: 0 0 0 1px rgba(200,225,255,0.48) inset, 0 0 18px rgba(80,140,255,0.28);
    transform: translateY(-3px);
}

.auth-login-card {
    max-width: 700px;
    margin: 0 auto;
}

@media (max-width: 760px) {
    .auth-arcane-card {
        padding: 16px;
    }
}

.role-choice-card-numbered {
    position: relative;
    padding-left: 42px;
}

.role-choice-index {
    position: absolute;
    left: 10px;
    top: 10px;
    min-width: 24px;
    height: 18px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    color: #dfeaff;
    border: 1px solid rgba(138, 184, 255, 0.45);
    background: rgba(35, 68, 126, 0.62);
}

.vip-store-shell .page-header p {
    max-width: 72ch;
}

.store-coupon-bar {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: center;
    border-radius: 14px;
    border: 1px solid rgba(129, 173, 246, 0.28);
    background: linear-gradient(90deg, rgba(20, 26, 39, 0.84), rgba(8, 12, 18, 0.9));
    padding: 14px;
    margin-bottom: 14px;
}

.coupon-copy {
    display: grid;
    gap: 2px;
}

.coupon-copy strong {
    font-size: 0.92rem;
    letter-spacing: 0.03em;
}

.coupon-copy span {
    font-size: 0.78rem;
    color: #98a8c0;
}

.coupon-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.store-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.store-chip {
    border: 1px solid rgba(126, 163, 230, 0.3);
    background: rgba(14, 24, 44, 0.6);
    color: #dce8ff;
    border-radius: 10px;
    padding: 8px 14px;
    min-height: 38px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.store-chip.is-active {
    background: rgba(231, 235, 243, 0.9);
    color: #0a1226;
}

.store-plans-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.store-plan-card.master {
    border-color: rgba(245, 196, 100, 0.45);
}

.vip-market-shell {
    padding-top: 24px;
}

.vip-market-head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: center;
    margin-bottom: 14px;
}

.coupon-inline {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    min-width: 320px;
}

.market-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.market-tab {
    border: 1px solid rgba(104, 147, 224, 0.3);
    background: rgba(12, 20, 36, 0.7);
    color: #dbe8ff;
    border-radius: 10px;
    padding: 8px 13px;
    min-height: 36px;
    font-weight: 700;
}

.market-tab.is-active {
    background: #f2f4fb;
    color: #111a2c;
}

.store-block {
    margin-bottom: 16px;
    border: 1px solid rgba(95, 135, 210, 0.28);
    background: linear-gradient(160deg, rgba(8, 13, 27, 0.8), rgba(10, 17, 34, 0.85));
    border-radius: 14px;
    padding: 12px;
}

.store-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.store-title-row h2 {
    margin: 0;
    padding: 0;
    border: 0;
}

.store-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.store-per-page {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #c8d9f8;
    font-size: 0.78rem;
}

.store-per-page select {
    min-height: 34px;
    min-width: 86px;
}

.store-pagination {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.store-pagination .button-outline {
    min-height: 32px;
    padding: 0 12px;
}

.store-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 10px 20px rgba(3, 10, 22, 0.35);
}

.store-icon svg {
    width: 28px;
    height: 28px;
}

.store-icon-vip {
    color: #ffe2a3;
    background: radial-gradient(circle at 30% 30%, rgba(255, 241, 194, 0.55), rgba(194, 136, 49, 0.22));
}

.store-icon-gold {
    color: #f8e39b;
    background: radial-gradient(circle at 30% 30%, rgba(255, 229, 145, 0.62), rgba(183, 116, 11, 0.25));
}

.store-icon-frame {
    color: #b7d9ff;
    background: radial-gradient(circle at 30% 30%, rgba(172, 210, 255, 0.5), rgba(61, 105, 179, 0.2));
}

.store-icon-banner {
    color: #d9c4ff;
    background: radial-gradient(circle at 30% 30%, rgba(223, 194, 255, 0.5), rgba(110, 74, 164, 0.2));
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
}

.shop-card[hidden],
.asset-picker-card[hidden] {
    display: none !important;
}

.shop-card {
    border-radius: 12px;
    border: 1px solid rgba(88, 126, 199, 0.35);
    background: rgba(13, 21, 38, 0.9);
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    will-change: transform;
    cursor: default;
}

.shop-card:hover {
    border-color: rgba(176, 205, 255, 0.62);
    box-shadow: 0 14px 28px rgba(4, 12, 25, 0.48);
}

.shop-card-media {
    height: 132px;
    background: linear-gradient(180deg, rgba(28, 44, 76, 0.65), rgba(16, 26, 48, 0.8));
    display: grid;
    place-items: center;
    color: #9eb7e0;
    font-weight: 700;
}

.shop-card-media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.shop-card-media.is-placeholder {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
}

.shop-card-body {
    padding: 8px;
    display: grid;
    gap: 6px;
}

.shop-card-body h3 {
    margin: 0;
    font-size: 0.84rem;
}

.shop-card-body p {
    margin: 0;
    font-weight: 700;
    color: #e5efff;
}

.shop-card-body small {
    color: #9eb0cc;
    font-size: 0.72rem;
}

.shop-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.asset-picker-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.asset-picker-card {
    display: block;
    cursor: pointer;
}

.asset-picker-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.asset-picker-card-shell {
    display: grid;
    min-height: 100%;
    border-radius: 12px;
    border: 1px solid rgba(88, 126, 199, 0.35);
    background: rgba(13, 21, 38, 0.9);
    overflow: hidden;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.asset-picker-card:hover .asset-picker-card-shell {
    border-color: rgba(176, 205, 255, 0.62);
    box-shadow: 0 14px 28px rgba(4, 12, 25, 0.48);
}

.asset-picker-card input:checked + .asset-picker-card-shell {
    border-color: rgba(243, 210, 138, 0.82);
    box-shadow: 0 0 0 2px rgba(243, 210, 138, 0.2), 0 16px 30px rgba(4, 12, 25, 0.5);
    transform: translateY(-2px);
}

.asset-picker-card-shell .shop-card-body {
    min-height: 90px;
}

.admin-user-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(4, 10, 19, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.admin-user-modal[hidden] {
    display: none !important;
}

.admin-user-modal-card {
    width: min(760px, 96vw);
    background: rgba(10, 16, 28, 0.95);
    border: 1px solid rgba(118, 156, 230, 0.4);
    border-radius: 14px;
    box-shadow: 0 24px 42px rgba(0, 0, 0, 0.45);
    padding: 14px;
}

.admin-user-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.admin-user-row-link {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.plan-card-lite .button,
.plan-card-lite .button-outline {
    min-height: 32px;
    padding: 0 12px;
    font-size: 0.68rem;
}

.plan-card-master {
    border-color: rgba(228, 183, 107, 0.48);
}

.comment-item-vip-animated,
.reply-item.comment-item-vip-animated {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.comment-item-vip-animated::before,
.reply-item.comment-item-vip-animated::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(120deg, rgba(7, 13, 24, 0.76), rgba(5, 10, 20, 0.84)), var(--vip-comment-bg);
    background-size: 100% 100%;
    background-position: center;
    filter: saturate(1.1);
    z-index: 0;
}

.comment-item-vip-animated > *,
.reply-item.comment-item-vip-animated > * {
    position: relative;
    z-index: 1;
}

@media (max-width: 1024px) {
    .topbar {
        top: 6px;
        margin: 6px 8px 0;
        padding: 6px 10px 8px;
        grid-template-columns: 1fr auto;
        align-items: start;
    }

    .topbar-brand {
        text-align: left;
    }

    .topbar-user {
        justify-content: flex-end;
        align-items: center;
        gap: 8px;
        margin-top: -2px;
    }

    .topbar-profile-link {
        min-height: 44px;
        margin-right: 0;
        padding: 6px 8px;
    }

    .topbar-user-stack {
        gap: 4px;
        justify-items: end;
    }

    .topbar-user-info {
        gap: 2px;
    }

    .topbar-user-info .topbar-tags .tiny-badge {
        font-size: 0.42rem;
        padding: 1px 4px;
    }

    .topbar-logout {
        min-height: 30px;
        padding: 0 10px;
    }

    .topbar-avatar-shell {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .topbar-mini-avatar {
        width: 38px;
        height: 38px;
    }

    .topbar-notification {
        position: static !important;
        width: 44px;
        height: 44px;
        order: -1;
        flex-shrink: 0;
        margin-right: 0;
    }

    .mobile-menu-handle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .topbar-nav {
        position: fixed;
        left: -286px;
        top: 0;
        bottom: 0;
        width: 270px;
        padding: 78px 12px 18px;
        background: rgba(6, 14, 29, 0.97);
        border-right: 1px solid rgba(130, 170, 240, 0.32);
        z-index: 130;
        display: grid;
        align-content: start;
        gap: 8px;
        transition: left 0.2s ease;
        overflow-y: auto;
    }

    .topbar-nav .nav-pill {
        opacity: 0;
        transform: translateX(-10px);
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    body.side-nav-open .topbar-nav {
        left: 0;
    }

    body.side-nav-open .topbar-nav .nav-pill {
        opacity: 1;
        transform: translateX(0);
    }

    body.side-nav-open .topbar-nav .nav-pill:nth-child(1) { transition-delay: 0.02s; }
    body.side-nav-open .topbar-nav .nav-pill:nth-child(2) { transition-delay: 0.05s; }
    body.side-nav-open .topbar-nav .nav-pill:nth-child(3) { transition-delay: 0.08s; }
    body.side-nav-open .topbar-nav .nav-pill:nth-child(4) { transition-delay: 0.11s; }
    body.side-nav-open .topbar-nav .nav-pill:nth-child(5) { transition-delay: 0.14s; }
    body.side-nav-open .topbar-nav .nav-pill:nth-child(6) { transition-delay: 0.17s; }
    body.side-nav-open .topbar-nav .nav-pill:nth-child(7) { transition-delay: 0.2s; }
    body.side-nav-open .topbar-nav .nav-pill:nth-child(8) { transition-delay: 0.23s; }

    body.side-nav-open .mobile-menu-handle {
        left: 276px;
    }

    body.side-nav-open .side-nav-backdrop {
        opacity: 1;
        pointer-events: all;
    }

    .nav-pill {
        width: 100%;
        justify-content: flex-start;
    }

    .profile-public-layout {
        grid-template-columns: 1fr !important;
    }

    .profile-public-head {
        flex-wrap: wrap;
    }

    .profile-public-head form {
        width: auto;
        margin-left: auto;
    }

    .profile-follow-btn {
        min-height: 30px;
        padding: 0 10px;
        font-size: 0.74rem;
    }

    .profile-banner-media {
        height: clamp(140px, 44vw, 220px);
    }

    .store-coupon-bar {
        grid-template-columns: 1fr;
    }

    .store-toolbar {
        align-items: stretch;
    }

    .store-pagination {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 760px) {
    .topbar {
        grid-template-columns: 1fr auto;
        padding: 6px 8px 8px;
        gap: 8px;
    }

    .topbar-brand .eyebrow {
        margin-bottom: 2px;
        font-size: 0.62rem;
    }

    .topbar-brand .logo-mark {
        font-size: 1.22rem;
        line-height: 1;
    }

    .topbar-user {
        gap: 6px;
        align-items: flex-start;
    }

    .topbar-profile-link {
        min-height: 44px;
        gap: 8px;
        padding: 6px 8px;
    }

    .topbar-avatar-shell,
    .topbar-mini-avatar {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .topbar-username {
        font-size: 0.95rem;
        line-height: 1;
    }

    .topbar-user-info .topbar-tags-meta {
        display: none;
    }

    .topbar-notification {
        width: 34px !important;
        height: 34px !important;
    }

    .topbar-user-stack {
        min-width: 0;
        justify-items: stretch;
    }

    .topbar-logout {
        width: 100%;
        justify-content: center;
    }

    .profile-page-shell .profile-header-card {
        margin: -16px -8px 16px;
        border-radius: 0;
    }

    .profile-private-head {
        padding: 14px;
        gap: 12px;
        flex-wrap: wrap;
    }

    .profile-private-avatar-shell,
    .profile-private-avatar {
        width: 92px;
        height: 92px;
        flex-basis: 92px;
    }

    .profile-private-avatar {
        border-width: 3px;
    }

    .profile-private-avatar-fallback {
        font-size: 36px;
    }

    .profile-private-copy {
        min-width: 0;
        flex: 1;
        padding-top: 0;
    }

    .profile-private-copy h1 {
        font-size: 1.05rem;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    .profile-private-actions {
        margin-left: 0;
        width: 100%;
    }

    .profile-private-actions .button-outline {
        width: 100%;
        justify-content: center;
    }

    .dashboard-strip-track {
        display: flex;
        gap: 8px;
        width: max-content;
        animation: mobileStripSlide 16s linear infinite;
    }

    .dashboard-strip-item {
        min-width: 250px;
        max-width: 250px;
    }

    .shop-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shop-card-media {
        height: 92px;
    }

    .shop-card.shop-card-banner .shop-card-media {
        height: 82px;
    }

    .asset-picker-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }


@keyframes mobileStripSlide {
    0% { transform: translateX(0); }
    100% { transform: translateX(-35%); }
}
    .profile-account-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 16px;
    }

    .section-head-inline {
        align-items: stretch;
        flex-direction: column;
    }

    .section-head-inline .button {
        width: 100%;
        justify-content: center;
    }
}
