/* EVOLUTION PROJECT — shared visual system, loaded after page styles.
   Existing grids, component radii, behavior and seasonal garland are retained. */

:root {
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --section-gap: var(--space-5);
    --section-heading-gap: 14px;
    --panel-padding: var(--space-5);
    --section-title-size: 19px;
    --surface-panel: linear-gradient(140deg, #1a2326d9, #141d21d1);
    --surface-soft: linear-gradient(140deg, #1d292fc4, #121d25b8);
    --surface-strong: linear-gradient(140deg, #1a2326f5, #141d21f7);
    --surface-inset: #101b2252;
    --surface-field: #0c151bb8;
    --surface-chrome: #10191ec7;
}

/* One continuous scene; surfaces control transparency without dimming content. */
body { background: #10171c; isolation: isolate; }
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    background:
        linear-gradient(90deg, #0d171d35, #101a2073 28%, #101a2099 65%, #0d171d50),
        linear-gradient(0deg, #0e171dc9, #0e171d20 75%),
        url('/images/site-backdrop-v1.webp') center top / cover no-repeat;
}
.sidebar { background: #10191e9e; }
.utility-bar { background: var(--surface-chrome); }
.winter-season .sidebar-top { border-top: 0; border-bottom: 0; }

/* Shared section component: heading and actions above a rounded content panel. */
.content-section { min-width: 0; margin-bottom: var(--section-gap); }
.content-section > .section-heading {
    min-height: 28px;
    gap: var(--space-4);
    margin-bottom: var(--section-heading-gap);
}
.content-section > .section-heading > :is(h2, h3),
.forum-list-heading > h2 {
    margin: 0;
    padding-left: var(--space-3);
    border-left: 2px solid var(--accent);
    font-size: var(--section-title-size);
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: -.4px;
}
.panel { background: var(--surface-panel); padding: var(--panel-padding); }
.panel.panel-flush { padding: 0; }
.panel.topic-post { background: var(--topic-post-bg); }
:is(.forum-topic-panel, .invitation-card, .overview-metric, .metrics > article) { background: var(--surface-panel); }
.surface-soft { --surface-panel: var(--surface-soft); }
.surface-strong,
:is(.settings-panel, .admin-actions-panel, .staff-editor, .editor-panel, .wallet-ledger, .receipt) {
    --surface-panel: var(--surface-strong);
}
.content-section > .section-body { margin: 0; }
.section-body > :last-child { margin-bottom: 0; }
.section-body > .empty-state { padding-block: var(--space-5); }
:is(.two-columns, .staff-workspace, .ticket-workspace, .admin-player-workspace) > .content-section,
:is(.profile-main, .profile-side, .home-grid) > .content-section { margin-bottom: 0; }
:is(.two-columns, .staff-workspace, .ticket-workspace, .admin-player-workspace) > * { min-width: 0; }
.section-body.forum-links { padding-block: 8px; }
.section-body.forum-links > a:last-child { padding-bottom: 9px; }
.section-body.danger-zone { border-color: #ff95952b; }
.section-heading > .text-link { font-size: 12px; }
.page-heading > h1 { font-weight: 700; }
.clan-hero.clan-cover-hero { border-radius: 16px; overflow: hidden; }

/* Existing controls share their surface and focus treatment across all pages. */
:is(input, select, textarea):not([type=checkbox], [type=radio], [type=range], [type=hidden], [type=file]) {
    background-color: var(--surface-field);
    border-color: var(--line-strong);
}
:is(input, select, textarea):focus-visible {
    border-color: #bbf36b70;
    box-shadow: 0 0 0 3px #bbf36b0d;
}
.outline-button { background-color: #172229b8; }
.outline-button:hover { background-color: #25332dbd; border-color: #bbf36b50; }

/* Two-line wordmark and slim lime rule from the selected concept. */
.brand {
    display: inline-flex;
    flex-direction: column;
    gap: 7px;
    padding: 1px 0 1px 13px;
    border-left: 2px solid var(--accent);
    line-height: 1;
}
.brand .brand-name { color: var(--text); font-size: 24px; font-weight: 850; letter-spacing: -1px; }
.brand .brand-project { color: #b5c4bf; font-size: 9px; letter-spacing: 6.4px; font-weight: 600; padding-left: 1px; }
.sidebar-top { padding-bottom: 26px; }

/* Distinct subjects make sections recognizable without changing their positions. */
.server-scene, .server-card-detail .server-scene {
    background-image: url('/images/server-escape-v1.webp');
    background-position: 72% center;
}
.server-card:before, .server-card.state-offline:before {
    background: linear-gradient(90deg, #0c171be8 0%, #0c171b99 48%, #0c171b1a),
                linear-gradient(0deg, #0b151bed, transparent 75%);
}
.server-card.state-offline { border-color: #bc77772b; }
.server-card.state-offline .server-scene { filter: saturate(.85); opacity: 1; }
.winter-season .server-scene:after { opacity: .22; }
.server-description { color: #c5cfd1; }
.server-copy { color: #c5cfd1; background: #0c1519a6; }
.unavailable-button { color: #b9c2c6; background: #2830349c; }
.server-card .presence { backdrop-filter: blur(8px); }
.server-card.state-offline .presence { background: #311c20cc; }
.home-server .server-description { font-size: 13px; line-height: 1.6; }

.featured-news-content .eyebrow { color: #dae2cd; }
.featured-news-content h3 { font-weight: 750; }
.featured-news-visual>img { transition: transform .5s var(--ease); }
.featured-news:hover .featured-news-visual>img { transform: scale(1.025); }
.news-placeholder {
    background: linear-gradient(90deg, #10161888, transparent), url('/images/mirage.png') center/cover;
}
.news-placeholder .icon { display: none; }

/* Every homepage title sits above its rounded content surface. */
.home-section-body.panel {
    background: var(--surface-panel);
    padding: 5px 22px;
    margin: 0;
}
.home-section-body .topic-row, .home-section-body .ranking-row { padding-block: 16px; }
.home-section-body .recent-visitor { padding-block: 16px; }
.home-grid .topic-row strong { font-size: 15px; }
.home-grid .topic-row small { line-height: 1.6; }
.home-visitors .recent-visitor>small { font-size: 11px; }
.home-visitors .section-heading>.text-link { font-size: 12px; white-space: nowrap; }
.home-topics .section-heading>.text-link { font-size: 12px; }

/* Forum: warm communications desk, not the server's industrial environment. */
.forum-hero {
    background: linear-gradient(90deg, #151e20f5 0%, #151e20d9 40%, #151e201a 85%),
                url('/images/forum-comms-v1.webp') 70% 51%/cover;
}
.forum-hero .eyebrow { color: #d3d0bc; font-size: 9px; letter-spacing: 1.8px; }
.forum-hero h1 { font-weight: 750; }
.forum-hero p { color: #cbd2cd; }
.forum-category { background: var(--surface-panel); }
.forum-category:hover { border-color: #bbf36b40; background: #bbf36b06; }
.forum-category[aria-current=page] { box-shadow: inset 0 -2px #bbf36b88; }
.forum-side-panel { background: var(--surface-panel); }

/* Keep the rounded roster panel, reduce only its empty interior. */
.server-roster-empty { min-height: 180px; }

/* Profile identity and reusable gameplay metrics. No outer panel around cards. */
.public-profile-hero, .account-heading {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: radial-gradient(ellipse at 85% 0, #bbf36b08, transparent 60%), var(--surface-panel);
}
.profile-hero-mark {
    position: absolute;
    right: 38px;
    bottom: -28px;
    width: 166px;
    height: 187px;
    color: var(--accent);
    opacity: .08;
    pointer-events: none;
    z-index: -1;
}
.account-heading .profile-hero-mark { right: 22%; }
.public-stats .stat-card {
    --stat-accent: #bbd99c;
    --stat-wash: #bbf36b0b;
    padding: 20px;
    min-height: 154px;
    background: var(--surface-soft);
    border-color: #ffffff14;
    box-shadow: inset 0 1px #ffffff03;
}
.public-stats .stat-tone-blue { --stat-accent: #a7c8d6; --stat-wash: #a7c8d60c; }
.public-stats .stat-tone-sand { --stat-accent: #d2c39e; --stat-wash: #d2c39e0c; }
.stat-card-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.metrics .stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: none;
    border: 1px solid #ffffff0e;
    border-radius: 11px;
    background: var(--stat-wash);
    color: var(--stat-accent);
}
.stat-icon .icon { width: 21px; height: 21px; }
.stat-strip-icon { margin-right: 7px; color: #b4c69e; vertical-align: -3px; }
.public-stats .stat-card-heading > span:last-child { font-size: 12px; color: #b2bec4; }
.public-stats .stat-value { margin: 16px 0 5px; font-size: 29px; font-weight: 650; font-variant-numeric: tabular-nums; }
.public-stats .stat-detail { color: #9cabb2; }
.public-stats .stat-card:last-child { background: radial-gradient(ellipse at 100% 0, #bbf36b0a, transparent 70%), var(--surface-soft); }
.public-stats .stat-card:last-child .stat-value { color: #d4e9bd; }
.social-surface.panel { padding-block: 8px; }
.social-surface .social-links { display: grid; gap: 0; }
.profile-social-link { display: flex; align-items: center; gap: 12px; min-height: 50px; font-size: 13px; border-bottom: 1px solid var(--line); }
.profile-social-link:last-child { border: 0; }
.profile-social-link > .icon:first-child { color: var(--muted); width: 20px; height: 20px; }
.profile-social-link > .small-icon { margin-left: auto; color: var(--subtle); width: 15px; height: 15px; }
.profile-social-link:hover > .icon { color: var(--accent); }

/* Rank is data, with a restrained laurel treatment for the first three places. */
.page-title-icon { width: 28px; height: 28px; color: #c4d5ad; margin-right: 14px; vertical-align: -2px; }
.ranking-row { transition: background-color .16s, color .16s; }
.ranking-row:hover { background-color: #bbf36b04; }
.rank-medal { position: relative; display: inline-flex; align-items: center; justify-content: center; height: 36px; font-weight: 750; }
.rank-place-1 { color: #dcc387; }
.rank-place-2 { color: #b5c7d2; }
.rank-place-3 { color: #c5a58c; }
.rank-medal > span { position: relative; padding-bottom: 3px; }
.rank-wreath { position: absolute; inset: 0; width: 100%; height: 36px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; opacity: .65; }
.rank-xp { font-variant-numeric: tabular-nums; }
.ranking-row .row-arrow { opacity: 0; color: var(--accent); transition: opacity .16s; }
.ranking-row:hover .row-arrow, .ranking-row:focus-visible .row-arrow { opacity: 1; }
.ranking-panel { padding-block: 6px; }

/* Store imagery floats on the same soft surface as community cards. */
.offer-card { background: var(--surface-soft); border-color: #ffffff14; }
.offer-card.unavailable { opacity: 1; }
.offer-card.unavailable .offer-art img { filter: saturate(.45); opacity: .65; }
.offer-art { background: radial-gradient(ellipse at 50% 90%, #aec78816, transparent 66%); border-bottom-color: #ffffff09; }
.offer-art::after { content: ""; position: absolute; bottom: 0; left: 20%; right: 20%; height: 1px; background: linear-gradient(90deg, transparent, #bbf36b35, transparent); pointer-events: none; }
.offer-content > .button { background: #bbf36b12; color: var(--accent); border: 1px solid #bbf36b35; box-shadow: none; }
.offer-content > .button:hover { background: #bbf36b22; border-color: #bbf36b70; }
.offer-content .price { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-variant-numeric: tabular-nums; }
.offer-content .price > .icon { width: 18px; height: 18px; color: #b6cb9a; }
.offer-content .price > small { margin-left: auto; font-weight: 400; color: var(--muted); }
.store-navigation { margin-bottom: 24px; }
.store-mode-label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.store-modes { display: flex; flex-wrap: wrap; gap: 10px; }
.store-mode { display: inline-flex; align-items: center; gap: 12px; min-height: 48px; padding: 12px 18px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-soft); font-size: 14px; font-weight: 650; }
.store-mode > .icon { width: 20px; height: 20px; color: var(--muted); }
.store-mode[aria-current=page] { border-color: #bbf36b42; background: #bbf36b0b; }
.store-mode[aria-current=page] > .icon { color: var(--accent); }
.store-categories { display: flex; gap: 28px; margin-top: 20px; border-bottom: 1px solid var(--line); }
.store-categories > a { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 12px 2px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 14px; }
.store-categories > a[aria-current=page] { color: var(--accent); border-bottom-color: var(--accent); }
.store-category-count { padding: 1px 6px; border-radius: 6px; background: #ffffff05; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.store-categories > a[aria-current=page] .store-category-count { color: #d3e9bc; background: #bbf36b0d; }
.store-empty { grid-column: 1 / -1; min-height: 250px; }
.forum-category > .icon:first-child { width: 36px; height: 36px; padding: 8px; border-radius: 11px; border: 1px solid #ffffff10; background: #bbf36b05; color: #c2cec6; }
.empty-symbol { background: radial-gradient(circle at 30% 0, #bbf36b0e, #ffffff02); border-color: #ffffff13; color: #a8b7bc; }
.inventory-empty { padding-block: 32px; }
.inventory-empty .outline-button { margin-top: 8px; }
.rules-nav a { background: var(--surface-inset); }
.markdown-body :is(p, ul, ol, blockquote), .rule-row p { max-width: 82ch; }
.section-body > p.user-text { max-width: 82ch; line-height: 1.75; }

/* Attachments are bounded previews; the existing viewer opens the full image. */
.photo-gallery, .topic-post-body .photo-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 720px);
    max-width: 720px;
    gap: 8px;
}
.photo-gallery[data-count="1"], .topic-post-body .photo-gallery[data-count="1"] {
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, 480px);
    max-width: 480px;
}
.photo-tile > a { aspect-ratio: 3 / 2; border: 1px solid #ffffff12; }
.photo-tile img { height: 100%; aspect-ratio: auto; object-fit: cover; }

@media (max-width: 760px) {
    :root { --panel-padding: 20px; --section-gap: 20px; --section-title-size: 19px; }
    .sidebar { background: #10191eea; }
    .content-section > .section-heading { flex-wrap: wrap; gap: var(--space-3); }
    .home-visitors .section-heading>.text-link, .home-topics .section-heading>.text-link { font-size: 11px; }
    .public-stats .stat-card { padding: 16px; min-height: 148px; }
    .public-stats .stat-value { font-size: 25px; }
    .stat-card-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
    .public-stats .stat-value { margin-top: 12px; }
    .ranking-row .row-arrow { display: none; }
    .profile-hero-mark { right: -18px; opacity: .045; }
}
@media (max-width: 480px) {
    .forum-hero .eyebrow { font-size: 8px; letter-spacing: 1.2px; }
    .home-topics .section-heading { align-items: center; gap: 10px; }
    .home-section>.section-heading h2 { font-size: 18px; }
    .home-visitors .section-heading { gap: 10px; }
    .home-topics .section-heading>.text-link { max-width: 94px; text-align: right; }
    .home-section-body.panel { padding: 4px 16px; }
    .page-title-icon { width: 24px; height: 24px; margin-right: 10px; }
    .public-stats .stat-value { font-size: 23px; }
    .rank-medal { width: 24px; }
    .store-categories { gap: 10px; }
    .store-categories > a { flex: 1; gap: 6px; font-size: 12px; }
    .store-categories > a > .icon { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .featured-news-visual>img { transition: none; }
    .featured-news:hover .featured-news-visual>img { transform: none; }
    .offer-art img, .offer-card, .ranking-row, .ranking-row .row-arrow { transition: none; }
    .offer-card:hover, .offer-card:hover .offer-art img { transform: none; }
}

