/* Core site bundle: base layout, typography, shared components, and broad game/profile polish. */
/* Generated from app/variables_and_base.css + app/game_layout.css. */

:root {
    --bg: #11110b;
    --bg-soft: #16160e;
    --panel: rgba(45, 44, 24, 0.92);
    --panel-strong: rgba(59, 57, 31, 0.98);
    --border: rgba(255, 244, 166, 0.14);
    --text: #f3efca;
    --muted: #cfc791;
    --accent: #f2df6f;
    --accent-strong: #fff1a4;
    --danger: #ff9b8c;
    --success: #a8efac;
    --warning: #ffd88a;
    --radius: 22px;
    --radius-sm: 16px;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top, rgba(242, 223, 111, 0.08), transparent 28%),
        linear-gradient(180deg, rgba(245, 224, 129, 0.04), transparent 24%),
        linear-gradient(180deg, #14140d 0%, #0c0c08 100%);
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.1;
    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: 4px 4px, 4px 4px;
    mix-blend-mode: soft-light;
}

.container {
    width: min(1520px, calc(100% - 40px));
    margin: 0 auto;
}

.topbar-wrap {
    padding: 18px 0 0;
}

.topbar {
    position: relative;
    z-index: 20;
    padding: 18px 22px;
    border-radius: 30px;
    border: 1px solid rgba(255, 244, 166, 0.12);
    background:
        radial-gradient(circle at top left, rgba(242, 223, 111, 0.12), transparent 30%),
        linear-gradient(180deg, rgba(36, 35, 20, 0.96), rgba(14, 14, 9, 0.98));
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.28);
}

.topbar-main,
.topbar-lower {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar-main {
    gap: 18px;
    flex-wrap: wrap;
}

.topbar-lower {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-wrap: wrap;
    gap: 14px 18px;
}

.navlinks,
.topbar-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.navlinks a,
.top-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: var(--text);
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, color 0.18s ease;
}
.navlinks a:hover,
.top-link:hover {
    text-decoration: none;
    background: rgba(255,255,255,0.08);
    border-color: rgba(255, 239, 153, 0.18);
}
.navlinks a.active,
.top-link.active {
    color: #14140d;
    background: linear-gradient(180deg, rgba(255, 239, 153, 0.96), rgba(214, 187, 78, 0.94));
    border-color: rgba(255, 239, 153, 0.3);
    box-shadow: 0 10px 24px rgba(242, 223, 111, 0.16);
}

.nav-toggle {
    display: none;
    margin-left: auto;
    color: var(--text);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
}

.topbar-user-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: var(--text);
    min-width: min(320px, 100%);
    margin-left: auto;
    text-decoration: none;
}
.topbar-user-chip:hover {
    text-decoration: none;
    border-color: rgba(255, 239, 153, 0.22);
    background: rgba(255, 239, 153, 0.06);
}
.topbar-user-name { display: block; font-weight: 800; }
.topbar-user-meta { display: block; color: var(--muted); font-size: 0.92rem; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--text);
    text-decoration: none;
    min-width: 0;
    flex: 1 1 auto;
}
.brand strong { display: block; font-size: 1rem; }
.brand small { display: block; color: var(--muted); }
.brand-badge {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1px solid rgba(255, 239, 153, 0.28);
    background-color: #16150f;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    box-shadow: 0 0 24px rgba(242, 223, 111, 0.42);
}

.page-shell { padding: 28px 0 64px; }
.page-grid {
    display: grid;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: 24px;
}
.stack,
.feed-column,
.grid-form,
.survivor-grid,
.moderation-grid,
.discover-grid,
.stack-tight,
.messages-layout {
    display: grid;
    gap: 18px;
}
.stack-tight { gap: 12px; }
.feed-column { min-width: 0; }
.survivor-grid {
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}
.moderation-grid,
.discover-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.messages-layout {
    grid-template-columns: 320px minmax(0, 1fr);
}

.card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(68, 67, 38, 0.88), rgba(35, 35, 20, 0.96));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent 35%);
    pointer-events: none;
}

.sidebar,
.hero-card,
.page-banner,
.auth-card,
.profile-hero,
.composer-card,
.post-card,
.user-card,
.survivor-card,
.empty-state,
.install-card,
.compact-card,
.notification-card,
.admin-card,
.expedition-card,
.messages-sidebar,
.messages-main {
    padding: 24px;
}
.side-sticky { position: sticky; top: 96px; align-self: start; }

.eyebrow,
.hero-badge {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    width: fit-content;
    max-width: 100%;
    gap: 8px;
    color: #4f3f00;
    background: linear-gradient(180deg, #ffef99, #d7be59);
    padding: 7px 11px;
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.74rem;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.05; }
h2 { margin-bottom: 8px; font-size: clamp(1.2rem, 2.2vw, 1.6rem); }
h3 { margin-bottom: 8px; font-size: 1.15rem; }
.muted, small, label, .timestamp, .handle, .form-foot, .comment-item span, .empty-mini { color: var(--muted); }
.handle { margin-top: 6px; }
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}
.section-head h2, .section-head h3 { margin-bottom: 0; }

.info-list {
    display: grid;
    gap: 12px;
}
.info-list > div,
.mini-stats,
.compact-link-card,
.mini-panel {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.16);
    border: 1px solid rgba(255,255,255,0.05);
}
.info-list > div,
.mini-stats {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.compact-list { gap: 10px; }
.inline-panel { margin-top: 14px; }
.compact-link-card { display: block; color: var(--text); }
.compact-link-card small { display: block; margin-top: 6px; }
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-top: 18px;
}
.overview-grid .mini-panel strong { display: block; font-size: 1.6rem; }
.overview-grid .mini-panel span { color: var(--muted); }

.overview-grid + .chip-row,
.overview-grid + .button-row,
.profile-highlights + .profile-action-stack,
.survivor-hud + .profile-action-stack,
.mini-panel + .profile-action-stack {
    margin-top: 18px;
}

.mini-panel p:last-child,
.action-card p:last-child {
    margin-bottom: 0;
}
.mini-panel,
.compact-link-card,
.inventory-detail-card,
.location-result-card {
    overflow-wrap: anywhere;
    word-break: normal;
}

.section-copy {
    display: grid;
    gap: 10px;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-grid;
    place-items: center;
    background: linear-gradient(180deg, #fff0a9, #ceb84d);
    color: #13130d;
    font-weight: 900;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 0 30px rgba(242, 223, 111, 0.2);
}
.avatar.large { width: 62px; height: 62px; font-size: 1.5rem; border-radius: 18px; }
.avatar.huge { width: 86px; height: 86px; font-size: 2rem; border-radius: 24px; }
.avatar.tiny { width: 30px; height: 30px; border-radius: 10px; font-size: 0.9rem; }
.avatar-image { object-fit: cover; }

.btn,
button,
input,
textarea,
select {
    font: inherit;
}

.btn,
button[type="submit"] {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 11px 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}
.btn:hover,
button[type="submit"]:hover { transform: translateY(-1px); }
.btn[disabled],
button[disabled],
[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.58;
    box-shadow: none;
    transform: none;
}
.btn[disabled]:hover,
button[disabled]:hover,
[aria-disabled="true"]:hover {
    transform: none;
    text-decoration: none;
}
.btn-primary {
    color: #14140d;
    background: linear-gradient(180deg, #fff0a6, #d6bb4e);
    box-shadow: 0 12px 24px rgba(242, 223, 111, 0.18);
}
.btn-secondary {
    color: var(--text);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid rgba(255, 239, 153, 0.75);
    outline-offset: 2px;
}

.grid,
.grid-form,
.signal-resource-grid {
    display: grid;
    gap: 16px;
}
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.signal-resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.align-end { display: grid; align-items: end; }
.micro-grid { align-items: center; }

input,
textarea,
select {
    width: 100%;
    padding: 14px 15px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(7, 7, 4, 0.34);
    color: var(--text);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

/* Keep native dropdown menus readable on Windows/Chromium.
   Without explicit option colours, some browsers render light text on a light popup. */
select {
    color-scheme: dark;
}

select option,
select optgroup {
    background: #17150f;
    color: #f3ebc7;
}

select option:disabled {
    color: rgba(243, 235, 199, 0.55);
}
input:focus,
textarea:focus,
select:focus {
    border-color: rgba(255, 239, 153, 0.38);
    box-shadow: 0 0 0 4px rgba(255, 239, 153, 0.08);
}
textarea { resize: vertical; min-height: 110px; }
label { display: block; margin-bottom: 8px; }
.toggle-row {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 0;
    line-height: 1.45;
}
.toggle-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    flex: 0 0 auto;
    accent-color: #c9a64f;
}
.remember-row {
    color: var(--muted);
}
input[type="checkbox"] { width: auto; }

.checkline {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.035);
}

.checkline input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.community-portal {
    width: 100%;
}

.portal-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.8fr);
    gap: 24px;
    align-items: stretch;
}

.portal-hero-copy {
    display: grid;
    align-content: center;
    gap: 14px;
}

.portal-hero h1 {
    max-width: 920px;
}

.portal-status-panel {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 20px;
    background: rgba(6, 6, 3, 0.28);
    display: grid;
    align-content: center;
    gap: 10px;
}

.portal-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.portal-stat-card {
    display: grid;
    gap: 8px;
    text-decoration: none;
}

.portal-stat-card strong {
    font-size: clamp(2rem, 4vw, 4.2rem);
    line-height: 0.95;
    letter-spacing: 0;
}

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

.compact-card-list {
    display: grid;
    gap: 12px;
}

.inset-empty {
    padding: 18px;
}

.server-browser-row,
.clan-card {
    overflow: hidden;
}

.server-filter-card {
    position: sticky;
    top: 10px;
    z-index: 2;
}

.alert {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.alert-success {
    background: rgba(86, 154, 90, 0.18);
    border-color: rgba(168, 239, 172, 0.26);
    color: var(--success);
}
.alert-error {
    background: rgba(148, 74, 68, 0.22);
    border-color: rgba(255, 155, 140, 0.26);
    color: #ffd3cb;
}

.file-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.06);
    cursor: pointer;
}
.file-button input { display: none; }
.upload-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.feed-tabs { margin-top: 2px; }
.post-head,
.user-card-head,
.comment-head,
.comment-author,
.notification-main,
.messages-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}
.profile-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
    gap: 24px;
    align-items: start;
}
.profile-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.profile-main-copy {
    display: grid;
    gap: 14px;
}
.profile-highlights,
.profile-facts-grid {
    display: grid;
    gap: 12px;
}
.profile-highlights {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.profile-facts-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.profile-side {
    display: grid;
    gap: 20px;
    align-content: start;
}
.profile-action-stack {
    display: grid;
    gap: 14px;
}
.user-pill, .comment-author, .notification-main { justify-content: flex-start; }

.signal-title { margin-bottom: 10px; font-size: 1.35rem; }
.post-body {
    margin: 16px 0;
    font-size: 1.02rem;
    line-height: 1.72;
    word-wrap: break-word;
}
.inline-tag { font-weight: 700; }
.post-image-wrap {
    display: block;
    border-radius: 18px;
    overflow: hidden;
    margin-top: 12px;
}
.post-image {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    border-radius: 18px;
}

.comments-block { display: grid; gap: 12px; margin-top: 18px; }
.comment-item {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255,255,255,0.05);
}
.comment-item p { margin: 8px 0 0; }
.comment-form {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}
.comment-form input[type="text"] { flex: 1; }

.pill,
.chip,
.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.92rem;
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.08);
}
.chip.active,
.tag-pill.active { background: rgba(255, 239, 153, 0.16); border-color: rgba(255, 239, 153, 0.22); }
.chip.ghost { opacity: 0.82; }
.chip.danger, .status-danger, .badge-danger { color: #ffd7cf; background: rgba(189, 67, 54, 0.24); border-color: rgba(255, 155, 140, 0.28); }
.status-safe { color: #d8ffd7; background: rgba(86, 154, 90, 0.22); border-color: rgba(168, 239, 172, 0.22); }
.status-warning { color: #ffe4b8; background: rgba(173, 117, 28, 0.22); border-color: rgba(255, 216, 138, 0.22); }
.status-caution { color: #fff1bf; background: rgba(132, 111, 36, 0.24); border-color: rgba(242, 223, 111, 0.24); }
.badge-accent { color: #fff3c2; background: rgba(189, 167, 48, 0.24); border-color: rgba(255, 239, 153, 0.24); }
.badge-muted { color: var(--muted); }
.tag-pill span, .nav-badge {
    background: rgba(0,0,0,0.24);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.82rem;
}
.nav-badge { color: var(--text); }
.navlinks a.active .nav-badge,
.top-link.active .nav-badge {
    color: #14140d;
    background: rgba(0,0,0,0.12);
}

.feed-tabs,
.tag-cloud,
.composer-actions,
.post-actions,
.meta-row,
.profile-status-row,
.hero-actions,
.user-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: var(--text);
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.tab:hover {
    text-decoration: none;
    background: rgba(255,255,255,0.08);
    border-color: rgba(255, 239, 153, 0.18);
}
.tab.active {
    color: #14140d;
    background: linear-gradient(180deg, rgba(255, 239, 153, 0.96), rgba(214, 187, 78, 0.94));
    border-color: rgba(255, 239, 153, 0.3);
}
.topbar-actions .btn,
.hero-actions .btn,
.user-card-actions .btn,
.post-actions .btn,
.composer-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.notification-card,
.conversation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.conversation-item {
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05);
    background: rgba(0, 0, 0, 0.12);
    color: var(--text);
}
.conversation-item.active { background: rgba(255,255,255,0.08); }
.conversation-copy { flex: 1; min-width: 0; }
.conversation-copy p, .conversation-copy small { margin: 4px 0 0; }

.thread-list {
    display: grid;
    gap: 12px;
    padding: 18px 0;
    max-height: 560px;
    overflow: auto;
}
.message-bubble {
    max-width: min(720px, 86%);
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.05);
}
.message-bubble.mine {
    margin-left: auto;
    background: rgba(255, 239, 153, 0.1);
}
.message-bubble p { margin: 8px 0; }
.message-form { display: grid; gap: 14px; }
.messages-main, .messages-sidebar { min-height: 520px; }
.full-height { min-height: 420px; display: grid; place-items: center; text-align: center; }

.auth-shell,
.install-shell {
    display: grid;
    place-items: center;
    min-height: 70vh;
}
.auth-card { width: min(620px, 100%); }
.auth-card.wide { width: min(840px, 100%); }
.install-body { min-height: 100vh; }
.install-shell { padding: 32px 16px; }
.install-card { width: min(840px, 100%); margin: 0 auto; }

.divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 6px 0;
}
.search-row input { flex: 1; }
.linked-expedition { margin-top: 12px; color: var(--muted); }
.report-reason { margin-top: 10px; }

[data-type-target] { display: block; }
[data-type-target].is-hidden { display: none; }

.survivor-settings-head {
    margin-bottom: 0;
}

.stat-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}
.stat-pair span {
    color: var(--muted);
    font-weight: 700;
}

.survivor-hud {
    display: grid;
    gap: 14px;
    padding: 16px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255,255,255,0.06);
}
.survivor-hud.compact {
    padding: 14px;
}
.survivor-hud-top,
.survivor-meter-head,
.skill-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.survivor-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: linear-gradient(180deg, #fff0a6, #d6bb4e);
    color: #14140d;
    font-weight: 900;
}
.survivor-hud-summary {
    text-align: right;
}
.survivor-hud-summary strong,
.survivor-hud-summary span { display: block; }
.survivor-hud-summary span { color: var(--muted); font-size: 0.92rem; }

.survivor-meters,
.skill-grid {
    display: grid;
    gap: 12px;
}
.skill-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.survivor-meter,
.skill-card {
    display: grid;
    gap: 8px;
}
.survivor-meter-track,
.skill-track {
    position: relative;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255,255,255,0.07);
}
.survivor-meter-track span,
.skill-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(255, 239, 153, 0.65), rgba(255, 239, 153, 0.98));
}
.meter-hp .survivor-meter-track span { background: linear-gradient(90deg, rgba(168, 239, 172, 0.55), rgba(168, 239, 172, 0.98)); }
.meter-stamina .survivor-meter-track span { background: linear-gradient(90deg, rgba(255, 216, 138, 0.55), rgba(255, 216, 138, 0.98)); }
.meter-stress .survivor-meter-track span { background: linear-gradient(90deg, rgba(255, 155, 140, 0.35), rgba(255, 155, 140, 0.95)); }
.meter-contamination .survivor-meter-track span { background: linear-gradient(90deg, rgba(208, 167, 255, 0.35), rgba(208, 167, 255, 0.95)); }

@media (max-width: 1060px) {
    .page-grid,
    .messages-layout,
    .profile-hero,
    .game-page-grid {
        grid-template-columns: 1fr;
    }
    .profile-main {
        grid-template-columns: 1fr;
    }
    .topbar-main {
        flex-wrap: wrap;
    }
    .topbar-user-chip {
        flex: 1 1 100%;
        min-width: 0;
    }
    .topbar-lower {
        flex-direction: column;
        align-items: stretch;
    }
    .navlinks,
    .topbar-actions { justify-content: flex-start; }
    .side-sticky { position: static; }
}

@media (max-width: 720px) {
    .container { width: min(100% - 20px, 100%); }
    .page-shell { padding-top: 18px; }
    .sidebar,
    .hero-card,
    .page-banner,
    .auth-card,
    .profile-hero,
    .composer-card,
    .post-card,
    .user-card,
    .survivor-card,
    .empty-state,
    .install-card,
    .compact-card,
    .notification-card,
    .admin-card,
    .expedition-card,
    .messages-sidebar,
    .messages-main {
        padding: 18px;
    }
    .grid.two,
    .grid.three,
    .signal-resource-grid,
    .comment-form {
        grid-template-columns: 1fr;
        display: grid;
    }
    .comment-form { gap: 10px; }
    .signal-title { font-size: 1.2rem; }
    .brand strong { font-size: 0.95rem; }
    .topbar-wrap { padding-top: 12px; }
    .topbar { padding: 16px; border-radius: 24px; }
    .topbar-main { align-items: flex-start; }
    .nav-toggle { display: inline-flex; }
    .topbar-lower { display: none; margin-top: 14px; padding-top: 14px; }
    .topbar-lower.is-open { display: flex; }
    .navlinks, .topbar-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    .navlinks a, .top-link, .topbar-actions form, .topbar-actions .btn { width: 100%; }
    .topbar-user-chip { width: 100%; margin-left: 0; }
    .skill-grid { grid-template-columns: 1fr; }
    .stat-pair { grid-template-columns: 1fr; }
    .stat-pair span { display: none; }
}


body { overflow-x: hidden; }

button,
.btn,
.tab,
.top-link,
.navlinks a,
.pill,
.chip,
.tag-pill,
.compact-link-card,
.post-body,
.signal-title,
.comment-item p,
.mini-panel p,
.info-list strong,
.info-list span,
.user-pill,
.user-pill strong,
.user-pill small,
.user-card-head h3,
.user-card-head p,
.conversation-copy p,
.conversation-copy strong,
.messages-head h2,
.section-head small,
.empty-state p,
.auth-card p,
.admin-row p,
.admin-row strong,
.notification-main p,
.notification-main strong,
.linked-expedition,
.message-bubble p,
.message-bubble strong {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.topbar-actions form,
.post-actions form,
.post-meta-actions form,
.admin-row form,
.user-card-actions form,
.composer-actions form,
.meta-row form {
    margin: 0;
}

.user-pill,
.post-meta-actions,
.side-section,
.conversation-list,
.admin-list,
.admin-row,
.admin-row-stacked,
.signal-composer,
.search-row {
    min-width: 0;
}

.user-pill {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.user-pill > div,
.post-meta-actions > *,
.admin-row > div,
.admin-row-stacked > div,
.messages-head > div,
.notification-main > div,
.profile-main > div,
.user-card-head > div,
.conversation-copy,
.compact-link-card,
.side-section,
.stack > *,
.stack-tight > *,
.grid > *,
.grid-form > * {
    min-width: 0;
}

.post-meta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}
.timestamp-link {
    display: inline-flex;
    align-items: center;
    color: var(--muted);
}
.timestamp-link:hover { color: var(--text); text-decoration: none; }

.side-section {
    display: grid;
    gap: 10px;
}
.side-section + .side-section {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 12px;
}

.conversation-list,
.admin-list {
    display: grid;
    gap: 12px;
}
.admin-row,
.admin-row-stacked {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 0;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.admin-list > :first-child {
    border-top: 0;
    padding-top: 0;
}
.admin-row > div,
.admin-row-stacked > div { flex: 1; }
.admin-row-stacked { flex-direction: column; }

.search-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.search-row input {
    flex: 1 1 280px;
    min-width: 0;
}
.search-row select {
    flex: 0 1 220px;
}

.signal-composer [data-type-target] {
    min-width: 0;
}

.slim-card {
    padding: 18px;
}

.feed-tabs,
.tag-cloud,
.topbar-actions,
.navlinks,
.composer-actions,
.post-actions,
.meta-row,
.profile-status-row,
.hero-actions,
.user-card-actions {
    row-gap: 8px;
}

.message-bubble,
.compact-link-card,
.mini-panel,
.info-list > div,
.pill,
.chip,
.tag-pill {
    min-width: 0;
}

@media (max-width: 720px) {
    .feed-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .post-head,
    .user-card-head,
    .comment-head,
    .notification-main,
    .messages-head,
    .admin-row {
        grid-template-columns: 1fr;
        display: grid;
    }
    .post-meta-actions {
        justify-content: flex-start;
    }
    .search-row > * {
        width: 100%;
        flex-basis: 100%;
    }
    .conversation-item {
        align-items: flex-start;
    }
}

.meter-exp .survivor-meter-track span { background: linear-gradient(90deg, rgba(255, 239, 153, 0.55), rgba(255, 239, 153, 0.98)); }
.meter-hunger .survivor-meter-track span { background: linear-gradient(90deg, rgba(255, 194, 120, 0.45), rgba(255, 194, 120, 0.98)); }
.meter-thirst .survivor-meter-track span { background: linear-gradient(90deg, rgba(132, 205, 255, 0.45), rgba(132, 205, 255, 0.98)); }

.hud-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mini-stat-chip,
.survivor-passive-note {
    display: inline-flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    padding: 8px 10px;
    border-radius: 999px;
    box-sizing: border-box;
    white-space: normal;
    overflow-wrap: anywhere;
    text-wrap: pretty;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text);
    font-size: 0.92rem;
}

.survivor-passive-note {
    justify-content: center;
}

.mini-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}


/* --- BEGIN public/assets/css/app/game_layout.css --- */
.game-page-grid {
    align-items: start;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
}

.game-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.action-card {
    display: grid;
    gap: 16px;
    align-content: start;
    min-height: 100%;
    padding: 20px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(0, 0, 0, 0.18);
}
.action-card .section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 0;
}
.action-card .section-head > :first-child {
    min-width: 0;
    flex: 0 1 auto;
}
.action-card .section-head small {
    flex: 0 1 auto;
    text-align: left;
}
.action-card h3 {
    line-height: 1.2;
    overflow-wrap: anywhere;
    text-wrap: pretty;
}
.action-card,
.action-card > *,
.action-card-copy,
.action-cost-row,
.action-cost-row > * {
    min-width: 0;
    max-width: 100%;
}
.action-card-copy {
    display: grid;
    gap: 10px;
}
.action-cost-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
}
.action-cost-chip {
    justify-content: flex-start;
    align-items: flex-start;
    min-width: 0;
    max-width: 100%;
    font-size: 0.86rem;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
    text-wrap: pretty;
    background: rgba(255,255,255,0.04);
}
.action-card .btn {
    width: 100%;
    max-width: 100%;
    margin-top: auto;
}


.encounter-card {
    display: grid;
    gap: 16px;
}

.encounter-hero,
.cooldown-notice,
.battle-log-line {
    background: rgba(255,255,255,0.04);
}

.scene-actions-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.scene-action-card {
    min-height: 0;
}

.encounter-good {
    border-color: rgba(127, 222, 160, 0.25);
}

.encounter-neutral {
    border-color: rgba(255, 255, 255, 0.1);
}

.encounter-bad,
.battle-card {
    border-color: rgba(255, 138, 138, 0.24);
}

.battle-overview-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.battle-log-stack {
    gap: 10px;
}

@media (max-width: 720px) {
    .scene-actions-grid,
    .battle-actions-grid {
        grid-template-columns: 1fr;
    }
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.inventory-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.profile-facts-grid .mini-panel,
.profile-highlights .mini-panel {
    display: grid;
    gap: 6px;
}
.profile-facts-grid strong,
.profile-highlights strong {
    font-size: 1rem;
}
.action-log-card {
    display: grid;
    gap: 8px;
}
.action-log-summary {
    line-height: 1.6;
}

.rarity-common { border-color: rgba(255,255,255,0.06); }
.rarity-uncommon { border-color: rgba(255, 239, 153, 0.22); }
.rarity-rare { border-color: rgba(132, 205, 255, 0.28); }
.rarity-elite { border-color: rgba(202, 150, 255, 0.32); box-shadow: inset 0 0 0 1px rgba(202, 150, 255, 0.12); }
.rarity-legendary { border-color: rgba(255, 180, 79, 0.38); box-shadow: inset 0 0 0 1px rgba(255, 180, 79, 0.16); }

.action-log-card p:last-child {
    margin-bottom: 0;
}

.passive-picker-card,
.passive-readonly-card {
    background: rgba(0, 0, 0, 0.16);
}

.passive-option-row {
    display: grid;
    gap: 6px;
}

.passive-option-row p,
.passive-readonly-card p {
    margin-bottom: 0;
}

@media (max-width: 720px) {
    .game-actions-grid,
    .inventory-grid {
        grid-template-columns: 1fr;
    }
}


/* --- Premium visual polish pass --- */
:root {
    --bg: #0e0e09;
    --bg-soft: #17160f;
    --panel: rgba(32, 31, 19, 0.92);
    --panel-strong: rgba(45, 43, 27, 0.98);
    --border: rgba(255, 240, 163, 0.13);
    --border-strong: rgba(255, 240, 163, 0.2);
    --text: #f7f2d2;
    --muted: #c7bf8f;
    --muted-strong: #ddd4a7;
    --accent: #edd66f;
    --accent-strong: #fff2ab;
    --shadow: 0 28px 64px rgba(0, 0, 0, 0.42);
    --shadow-soft: 0 18px 34px rgba(0, 0, 0, 0.22);
}

body {
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    background:
        radial-gradient(circle at top center, rgba(242, 223, 111, 0.10), transparent 0 34%),
        radial-gradient(circle at 20% 12%, rgba(242, 223, 111, 0.08), transparent 0 22%),
        linear-gradient(180deg, #17150e 0%, #0b0b07 100%);
}

.container {
    width: min(1680px, calc(100% - 52px));
}

p {
    margin-bottom: 0;
    line-height: 1.72;
}

h1, h2, h3 {
    font-weight: 800;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

h1 {
    margin-bottom: 14px;
    font-size: clamp(2.1rem, 4vw, 3.4rem);
}

h2 {
    margin-bottom: 10px;
    font-size: clamp(1.35rem, 2.4vw, 1.85rem);
}

h3 {
    margin-bottom: 8px;
    font-size: 1.15rem;
}

small,
.muted,
.handle,
.timestamp,
.form-foot,
.empty-mini,
.section-head small {
    color: var(--muted);
    line-height: 1.55;
}

.topbar-wrap {
    padding: 22px 0 0;
}

.topbar {
    padding: 20px 22px;
    border-radius: 30px;
    border-color: rgba(255, 244, 166, 0.1);
    background:
        radial-gradient(circle at top left, rgba(242, 223, 111, 0.14), transparent 30%),
        linear-gradient(180deg, rgba(30, 29, 18, 0.96), rgba(13, 13, 9, 0.985));
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(10px);
}

.topbar-main {
    gap: 20px;
    align-items: center;
}

.topbar-lower {
    margin-top: 18px;
    padding-top: 18px;
    gap: 16px;
}

.brand {
    gap: 16px;
}

.brand strong {
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.brand small {
    margin-top: 3px;
    font-size: 0.92rem;
}

.brand-badge {
    width: 18px;
    height: 18px;
    border-radius: 5px;
}

.navlinks,
.topbar-actions {
    gap: 10px;
}

.navlinks {
    flex: 1 1 auto;
    min-width: 0;
}

.topbar-actions {
    justify-content: flex-end;
    margin-left: auto;
}

.topbar-actions form {
    display: flex;
}

.navlinks a,
.top-link,
.tab {
    min-height: 44px;
    padding: 10px 16px;
    font-weight: 650;
    border: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.035);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.navlinks a:hover,
.top-link:hover,
.tab:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,0.08);
    border-color: rgba(255, 239, 153, 0.18);
}

.navlinks a.active,
.top-link.active,
.tab.active {
    box-shadow: 0 10px 24px rgba(242, 223, 111, 0.14), inset 0 1px 0 rgba(255,255,255,0.22);
}

.topbar-user-chip {
    gap: 5px;
    padding: 13px 15px;
    border-radius: 18px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.topbar-user-name {
    font-size: 0.94rem;
}

.page-shell {
    padding: 32px 0 78px;
}

.stack,
.feed-column,
.grid-form,
.survivor-grid,
.moderation-grid,
.discover-grid,
.stack-tight,
.messages-layout {
    gap: 20px;
}

.page-grid {
    grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
    gap: 28px;
}

.messages-layout {
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 24px;
}

.card {
    border-color: var(--border);
    background:
        radial-gradient(circle at top center, rgba(255, 239, 153, 0.08), transparent 0 34%),
        linear-gradient(180deg, rgba(47, 45, 27, 0.92), rgba(24, 24, 16, 0.98));
    box-shadow: var(--shadow);
}

.card::before {
    background: linear-gradient(180deg, rgba(255,255,255,0.05), transparent 38%);
}

.sidebar,
.hero-card,
.page-banner,
.auth-card,
.profile-hero,
.composer-card,
.post-card,
.user-card,
.survivor-card,
.empty-state,
.install-card,
.compact-card,
.notification-card,
.admin-card,
.expedition-card,
.messages-sidebar,
.messages-main {
    padding: 26px;
}

.page-banner,
.hero-card,
.profile-hero,
.auth-card {
    background:
        radial-gradient(circle at 20% 0%, rgba(255, 239, 153, 0.14), transparent 0 46%),
        linear-gradient(180deg, rgba(56, 53, 31, 0.92), rgba(26, 25, 17, 0.98));
}

.section-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px 18px;
    margin-bottom: 16px;
}
.section-head > :first-child {
    min-width: 0;
    flex: 1 1 220px;
}
.section-head h2,
.section-head h3,
.section-head strong {
    overflow-wrap: anywhere;
    text-wrap: pretty;
}
.section-head small {
    display: block;
    flex: 0 1 340px;
    max-width: 100%;
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
    text-wrap: pretty;
}

.compact-card .section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    align-items: start;
}

.compact-card .section-head > :first-child {
    flex: 0 1 auto;
}

.compact-card .section-head small {
    flex: 0 1 auto;
    text-align: left;
}

.location-sidebar-card .section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
}
.location-sidebar-card .section-head > :first-child {
    flex: 0 1 auto;
}
.location-sidebar-card .section-head small {
    flex: 0 1 auto;
    text-align: left;
}

.info-list,
.profile-highlights,
.profile-facts-grid,
.overview-grid,
.inventory-grid,
.skill-grid,
.survivor-meters,
.game-actions-grid {
    gap: 14px;
}

.info-list > div,
.mini-stats,
.compact-link-card,
.mini-panel,
.action-card,
.conversation-item,
.message-bubble,
.comment-item,
.survivor-hud,
.inventory-card {
    background: rgba(0, 0, 0, 0.17);
    border-color: rgba(255,255,255,0.055);
    box-shadow: var(--shadow-soft);
}

.info-list > div,
.mini-panel,
.compact-link-card,
.action-card,
.comment-item,
.conversation-item,
.message-bubble {
    backdrop-filter: blur(6px);
}

.info-list > div {
    align-items: center;
}

.overview-grid {
    margin-top: 20px;
}

.overview-grid + .chip-row,
.overview-grid + .button-row,
.profile-highlights + .profile-action-stack,
.survivor-hud + .profile-action-stack,
.mini-panel + .profile-action-stack {
    margin-top: 18px;
}

.overview-grid .mini-panel,
.profile-highlights .mini-panel,
.profile-facts-grid .mini-panel,
.inventory-card {
    padding: 14px 15px;
}

.overview-grid .mini-panel strong {
    font-size: clamp(1.4rem, 2vw, 1.8rem);
    line-height: 1.1;
}

.post-head,
.user-card-head,
.comment-head,
.comment-author,
.notification-main,
.messages-head,
.survivor-hud-top,
.survivor-meter-head,
.skill-card-head {
    gap: 14px;
}

.user-card-head h3,
.post-head h3,
.messages-head h2 {
    margin-bottom: 4px;
}

.user-card,
.survivor-card,
.post-card,
.expedition-card,
.notification-card {
    display: grid;
    gap: 16px;
}

.user-card-actions,
.post-actions,
.hero-actions,
.profile-action-stack,
.composer-actions {
    gap: 14px;
}

.user-card-actions,
.profile-action-stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    align-items: stretch;
}

.profile-action-stack > *,
.user-card-actions > *,
.user-card-actions form,
.profile-action-stack form {
    min-width: 0;
}

.user-card-actions .btn,
.profile-action-stack .btn,
.user-card-actions form .btn,
.profile-action-stack form .btn,
.btn-block {
    display: flex;
    width: 100%;
}

.btn,
button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 11px 18px;
    font-weight: 750;
    letter-spacing: -0.01em;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.btn:hover,
button[type="submit"]:hover {
    transform: translateY(-2px);
}

.btn-primary {
    box-shadow: 0 14px 28px rgba(242, 223, 111, 0.14);
}

.btn-secondary,
.file-button {
    background: rgba(255,255,255,0.055);
    border: 1px solid rgba(255,255,255,0.08);
}

.tiny-btn {
    min-height: 40px;
    padding: 9px 14px;
}

input,
textarea,
select {
    padding: 15px 16px;
    border-radius: 16px;
    background: rgba(6, 6, 4, 0.3);
}

label {
    margin-bottom: 10px;
    font-size: 0.94rem;
    font-weight: 650;
}

.toggle-row {
    gap: 12px;
}

.alert {
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}

.post-body {
    margin: 18px 0;
    font-size: 1.03rem;
    line-height: 1.8;
}

.profile-hero {
    grid-template-columns: minmax(0, 1.16fr) minmax(360px, 420px);
    gap: 28px;
}

.profile-main {
    gap: 20px;
}

.profile-main-copy {
    gap: 16px;
}

.profile-status-row,
.meta-row,
.tag-cloud,
.feed-tabs,
.hud-chip-row {
    gap: 10px;
}

.pill,
.chip,
.tag-pill,
.mini-stat-chip,
.survivor-passive-note,
.survivor-rank-badge {
    min-height: 38px;
    padding: 8px 13px;
    font-weight: 650;
}

.survivor-rank-badge {
    min-height: 0;
}

.survivor-hud {
    gap: 16px;
    padding: 18px;
    border-radius: 22px;
}

.survivor-hud.compact {
    padding: 16px;
}

.survivor-meter-head span,
.skill-card-head span,
.info-list span,
.mini-panel span {
    color: var(--muted);
    font-size: 0.92rem;
}

.survivor-meter-track,
.skill-track {
    height: 11px;
}

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

.game-page-grid {
    grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
}

.game-actions-grid {
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}

.action-card {
    gap: 18px;
    padding: 22px;
    align-content: start;
}

.action-card-copy {
    gap: 12px;
}

.action-cost-chip {
    font-weight: 600;
    color: var(--muted-strong);
    background: rgba(255,255,255,0.045);
}

.action-log-card {
    gap: 10px;
}

.thread-list {
    gap: 14px;
    padding: 20px 0;
}

.message-bubble {
    max-width: min(760px, 86%);
    padding: 16px 18px;
    border-radius: 18px;
}

.message-bubble.mine {
    background: rgba(255, 239, 153, 0.11);
}

.comment-item {
    padding: 14px 16px;
}

.compact-link-card {
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.compact-link-card:hover,
.conversation-item:hover {
    text-decoration: none;
    transform: translateY(-1px);
    border-color: rgba(255, 239, 153, 0.16);
    background: rgba(255,255,255,0.06);
}

.form-foot {
    margin-top: 18px;
}

.passive-picker-card,
.passive-readonly-card {
    background: rgba(0, 0, 0, 0.18);
    border-color: rgba(255,255,255,0.06);
}

.passive-option-row {
    padding: 14px 15px;
}

@media (max-width: 1180px) {
    .container {
        width: min(100% - 32px, 100%);
    }

    .profile-hero,
    .page-grid,
    .game-page-grid,
    .messages-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .section-head {
        gap: 8px;
    }

    .section-head small {
        flex-basis: 100%;
        text-align: left;
    }
}

@media (max-width: 720px) {
    .container {
        width: min(100% - 18px, 100%);
    }

    .topbar {
        padding: 16px;
        border-radius: 24px;
    }

    .topbar-actions,
    .navlinks,
    .user-card-actions,
    .profile-action-stack {
        grid-template-columns: 1fr;
    }

    .sidebar,
    .hero-card,
    .page-banner,
    .auth-card,
    .profile-hero,
    .composer-card,
    .post-card,
    .user-card,
    .survivor-card,
    .empty-state,
    .install-card,
    .compact-card,
    .notification-card,
    .admin-card,
    .expedition-card,
    .messages-sidebar,
    .messages-main {
        padding: 18px;
    }

    .feed-tabs,
    .tag-cloud,
    .meta-row,
    .profile-status-row,
    .composer-actions,
    .post-actions {
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
}

.area-board-card {
    margin-top: 4px;
}

.area-board-grid {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.area-board-panel {
    display: grid;
    gap: 12px;
}

.area-note-card,
.area-drop-card {
    display: grid;
    gap: 12px;
}

.area-note-card.is-pinned {
    border: 1px solid rgba(242, 223, 111, 0.28);
    background: linear-gradient(180deg, rgba(242, 223, 111, 0.08), rgba(255,255,255,0.03));
}

.area-note-card.is-recent {
    border: 1px solid rgba(255,255,255,0.08);
}

.area-note-copy {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.area-note-footer,
.area-drop-take-form,
.area-note-vote-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.area-drop-take-form {
    justify-content: flex-end;
}

.area-drop-take-form input[type="number"] {
    width: 76px;
}

.btn.is-selected {
    border-color: rgba(242, 223, 111, 0.48);
    box-shadow: 0 0 0 1px rgba(242, 223, 111, 0.2) inset;
    background: rgba(242, 223, 111, 0.14);
}

@media (max-width: 980px) {
    .area-board-grid {
        grid-template-columns: 1fr;
    }
}


/* --- 2026-04-13: global visual polish + mobile tab/button fixes --- */
html {
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
}

body {
    line-height: 1.55;
}

.card,
.compact-link-card,
.mini-panel,
.info-list > div,
.mini-stats,
.inventory-management-card,
.inventory-detail-card,
.class-option-row,
.notification-card,
.admin-card,
.expedition-card,
.user-card,
.survivor-card,
.post-card,
.composer-card,
.messages-sidebar,
.messages-main,
.empty-state {
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.btn,
button[type="submit"],
.navlinks a,
.top-link,
.tab,
.pill,
.chip,
.tag-pill,
.mini-stat-chip {
    white-space: nowrap;
}

.btn,
button[type="submit"] {
    gap: 8px;
    border: 1px solid transparent;
}

.btn-primary,
button[type="submit"].btn-primary {
    border-color: rgba(255, 240, 166, 0.35);
}

.btn-secondary,
.file-button {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.btn:active,
button[type="submit"]:active,
.navlinks a:active,
.top-link:active,
.tab:active {
    transform: translateY(0);
}

.navlinks a,
.top-link,
.tab,
.pill,
.chip,
.tag-pill,
.mini-stat-chip {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

input,
textarea,
select {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 10px 24px rgba(0, 0, 0, 0.12);
}

input::placeholder,
textarea::placeholder {
    color: rgba(243, 239, 202, 0.58);
}

.hero-actions,
.feed-tabs,
.tag-cloud,
.meta-row,
.profile-status-row,
.composer-actions,
.post-actions,
.hud-chip-row,
.chip-row,
.user-card-actions {
    min-width: 0;
}

.feed-tabs,
.tag-cloud,
.meta-row,
.profile-status-row,
.composer-actions,
.post-actions,
.hud-chip-row,
.chip-row {
    scrollbar-color: rgba(255, 239, 153, 0.25) transparent;
}

.feed-tabs::-webkit-scrollbar,
.tag-cloud::-webkit-scrollbar,
.meta-row::-webkit-scrollbar,
.profile-status-row::-webkit-scrollbar,
.composer-actions::-webkit-scrollbar,
.post-actions::-webkit-scrollbar,
.hud-chip-row::-webkit-scrollbar,
.chip-row::-webkit-scrollbar {
    height: 8px;
}

.feed-tabs::-webkit-scrollbar-thumb,
.tag-cloud::-webkit-scrollbar-thumb,
.meta-row::-webkit-scrollbar-thumb,
.profile-status-row::-webkit-scrollbar-thumb,
.composer-actions::-webkit-scrollbar-thumb,
.post-actions::-webkit-scrollbar-thumb,
.hud-chip-row::-webkit-scrollbar-thumb,
.chip-row::-webkit-scrollbar-thumb {
    background: rgba(255, 239, 153, 0.22);
    border-radius: 999px;
}

@media (max-width: 900px) {
    .hero-actions {
        flex-wrap: wrap;
    }

    .hero-actions .btn {
        flex: 1 1 220px;
    }
}

@media (max-width: 720px) {
    .feed-tabs,
    .tag-cloud,
    .meta-row,
    .profile-status-row,
    .composer-actions,
    .post-actions,
    .hud-chip-row,
    .chip-row {
        display: flex;
        flex-wrap: nowrap;
        align-items: stretch;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 6px;
        gap: 10px;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
    }

    .feed-tabs > *,
    .tag-cloud > *,
    .meta-row > *,
    .profile-status-row > *,
    .composer-actions > *,
    .post-actions > *,
    .hud-chip-row > *,
    .chip-row > * {
        flex: 0 0 auto;
        max-width: none;
        scroll-snap-align: start;
    }

    .tab,
    .pill,
    .chip,
    .tag-pill,
    .btn,
    button[type="submit"] {
        white-space: nowrap;
        word-break: keep-all;
        overflow-wrap: normal;
    }

    .tab,
    .pill,
    .chip,
    .tag-pill {
        min-width: max-content;
    }

    .mini-stat-chip {
        min-width: 0;
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .hero-actions,
    .user-card-actions,
    .topbar-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .hero-actions .btn,
    .user-card-actions .btn,
    .topbar-actions .btn,
    .topbar-actions .top-link,
    .topbar-actions form,
    .topbar-actions form .btn {
        width: 100%;
    }

    .search-row {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 520px) {
    .container {
        width: min(100% - 14px, 100%);
    }

    .topbar {
        padding: 14px;
        border-radius: 22px;
    }

    .sidebar,
    .hero-card,
    .page-banner,
    .auth-card,
    .profile-hero,
    .composer-card,
    .post-card,
    .user-card,
    .survivor-card,
    .empty-state,
    .install-card,
    .compact-card,
    .notification-card,
    .admin-card,
    .expedition-card,
    .messages-sidebar,
    .messages-main {
        padding: 16px;
        border-radius: 20px;
    }

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

    .brand {
        gap: 10px;
    }

    h1 {
        font-size: clamp(1.65rem, 8vw, 2.25rem);
        line-height: 1.08;
    }
}


/* --- Visual polish pass: desktop + mobile refinement --- */
:root {
    --shell-max-width: 1520px;
    --surface-1: rgba(255, 255, 255, 0.03);
    --surface-2: rgba(255, 255, 255, 0.055);
    --surface-3: rgba(255, 239, 153, 0.08);
    --ring: rgba(255, 239, 153, 0.28);
}

html,
body {
    max-width: 100%;
    overflow-x: clip;
}

body.app-shell {
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}

body.app-shell.nav-open {
    overflow: hidden;
}

.container {
    width: min(var(--shell-max-width), calc(100% - 40px));
}

.brand-badge {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background-image: url('/favicon-32x32.png');
    background-size: cover;
    background-position: center;
    box-shadow: 0 0 0 1px rgba(255, 239, 153, 0.12), 0 0 28px rgba(242, 223, 111, 0.32);
}

.topbar,
.card,
.mini-panel,
.compact-link-card,
.conversation-item,
.inventory-detail-card,
.location-result-card,
.party-member-card,
.party-nearby-card,
.party-signal-card,
.contract-card,
.service-card,
.crafting-card,
.action-card,
.outpost-zone-card,
.market-panel {
    backdrop-filter: blur(8px);
}

.card,
.mini-panel,
.compact-link-card,
.conversation-item,
.inventory-detail-card,
.location-result-card,
.party-member-card,
.party-nearby-card,
.party-signal-card,
.contract-card,
.service-card,
.crafting-card,
.action-card {
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.card:hover,
.compact-link-card:hover,
.conversation-item:hover,
.inventory-detail-card:hover,
.location-result-card:hover,
.party-member-card:hover,
.party-nearby-card:hover,
.party-signal-card:hover,
.contract-card:hover,
.service-card:hover,
.crafting-card:hover,
.action-card:hover {
    border-color: rgba(255, 239, 153, 0.18);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.3);
}

.btn,
.navlinks a,
.top-link,
.tab,
input,
textarea,
select {
    border-radius: 16px;
}

.btn {
    min-height: 46px;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.btn:hover,
.navlinks a:hover,
.top-link:hover,
.tab:hover {
    transform: translateY(-1px);
}

.btn:active,
.navlinks a:active,
.top-link:active,
.tab:active {
    transform: translateY(0);
}

input,
textarea,
select {
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,0.1);
    background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.03));
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

textarea {
    min-height: 120px;
    line-height: 1.55;
}

input::placeholder,
textarea::placeholder {
    color: rgba(207, 199, 145, 0.72);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.btn:focus-visible,
.nav-toggle:focus-visible,
.top-link:focus-visible,
.navlinks a:focus-visible,
.tab:focus-visible {
    outline: none;
    border-color: rgba(255, 239, 153, 0.35);
    box-shadow: 0 0 0 3px rgba(255, 239, 153, 0.12);
}

.section-head,
.location-result-head,
.inventory-detail-head,
.party-member-head,
.messages-head,
.post-head {
    gap: 14px;
}

.feed-tabs,
.chip-row,
.meta-row,
.profile-status-row,
.composer-actions,
.post-actions,
.user-card-actions,
.profile-action-stack,
.location-chip-row,
.inventory-filter-row {
    gap: 10px;
}

.info-list div,
.stat-pair,
.overview-grid .mini-panel,
.location-meta-chip,
.mini-stat-chip,
.tag-pill,
.user-pill {
    border-radius: 16px;
}

.page-banner h1,
.hero-card h1 {
    text-wrap: balance;
}

.page-banner p,
.hero-card p,
.muted,
.location-state-line,
.location-excerpt,
.section-copy p,
.inventory-copy,
.post-body {
    line-height: 1.6;
}

img,
.item-icon,
.post-image img {
    border-radius: 16px;
}

.post-card,
.inventory-detail-card,
.location-result-card,
.party-member-card,
.notification-card,
.admin-card,
.messages-main,
.messages-sidebar {
    overflow: clip;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 239, 153, 0.18);
    border-radius: 999px;
    border: 2px solid rgba(12, 12, 8, 0.25);
}

::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.03);
}

@media (max-width: 1180px) {
    .container {
        width: min(100% - 28px, var(--shell-max-width));
    }

    .page-grid,
    .messages-layout,
    .game-page-grid,
    .area-board-grid,
    .location-page-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .topbar-user-meta {
        font-size: 0.86rem;
    }

    .section-head,
    .location-result-head,
    .inventory-detail-head,
    .messages-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .overview-grid,
    .profile-facts-grid,
    .location-summary-grid,
    .market-overview-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    html {
        font-size: 15px;
    }

    .container {
        width: min(100% - 16px, 100%);
    }

    body.app-shell {
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    }

    .topbar-wrap {
        padding-top: 8px;
    }

    .topbar {
        padding: 14px;
        border-radius: 22px;
    }

    .brand {
        min-width: 0;
        gap: 12px;
    }

    .brand strong,
    .brand small,
    .topbar-user-name,
    .topbar-user-meta {
        overflow-wrap: anywhere;
    }

    .topbar-user-chip {
        padding: 12px;
        border-radius: 16px;
    }

    .nav-toggle {
        width: 100%;
        justify-content: center;
        min-height: 44px;
        border-radius: 16px;
    }

    .topbar-lower {
        margin-top: 12px;
        padding-top: 12px;
    }

    .navlinks,
    .topbar-actions,
    .hero-actions,
    .composer-actions,
    .post-actions,
    .inventory-actions,
    .location-action-row,
    .action-row,
    .form-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .navlinks a,
    .top-link,
    .btn,
    .tab,
    .topbar-actions form,
    .topbar-actions .btn {
        width: 100%;
    }

    .feed-tabs,
    .chip-row,
    .meta-row,
    .profile-status-row,
    .composer-actions,
    .post-actions,
    .location-chip-row,
    .party-banner-meta,
    .party-round-summary-chips,
    .party-member-chip-stack .chip-row,
    .party-card-meta .chip-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 6px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .feed-tabs > *,
    .chip-row > *,
    .meta-row > *,
    .profile-status-row > *,
    .composer-actions > *,
    .post-actions > *,
    .location-chip-row > *,
    .party-banner-meta > *,
    .party-round-summary-chips > *,
    .party-member-chip-stack .chip-row > *,
    .party-card-meta .chip-row > * {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

    .sidebar,
    .hero-card,
    .page-banner,
    .auth-card,
    .profile-hero,
    .composer-card,
    .post-card,
    .user-card,
    .survivor-card,
    .empty-state,
    .install-card,
    .compact-card,
    .notification-card,
    .admin-card,
    .expedition-card,
    .messages-sidebar,
    .messages-main,
    .party-member-card,
    .party-nearby-card,
    .party-signal-card {
        padding: 16px;
        border-radius: 20px;
    }

    .mini-panel,
    .compact-link-card,
    .conversation-item,
    .inventory-detail-card,
    .location-result-card,
    .service-card,
    .contract-card,
    .crafting-card {
        border-radius: 18px;
    }

    .grid.two,
    .grid.three,
    .grid-four,
    .stat-pair,
    .party-trade-grid,
    .inventory-grid,
    .inventory-summary-grid,
    .service-grid,
    .location-meta-grid,
    .market-grid {
        grid-template-columns: 1fr;
    }

    .item-card-head,
    .location-result-head,
    .party-member-head,
    .messages-head,
    .post-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .item-icon {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
    }
}

@media (max-width: 520px) {
    .page-banner h1,
    .hero-card h1 {
        font-size: 1.7rem;
        line-height: 1.1;
    }

    .section-head h2,
    .section-head h3 {
        font-size: 1.08rem;
    }

    .brand-badge {
        width: 22px;
        height: 22px;
    }
}


/* --- full visual polish sweep additions --- */
:root {
    --surface-1: rgba(255, 255, 255, 0.03);
    --surface-2: rgba(255, 255, 255, 0.05);
    --surface-3: rgba(255, 239, 153, 0.08);
    --ring: 0 0 0 3px rgba(255, 239, 153, 0.18);
    --text-soft: rgba(243, 239, 202, 0.86);
    --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.24);
}

html { -webkit-text-size-adjust: 100%; }
body { line-height: 1.5; }

.skip-link {
    position: fixed;
    left: 16px;
    top: 12px;
    z-index: 120;
    transform: translateY(-180%);
    padding: 12px 16px;
    border-radius: 999px;
    background: linear-gradient(180deg, #fff1a4, #d6bb4e);
    color: #14140d;
    font-weight: 900;
    box-shadow: 0 12px 28px rgba(0,0,0,0.28);
}
.skip-link:focus {
    transform: translateY(0);
    text-decoration: none;
    outline: none;
}

main,
section,
aside,
article { min-width: 0; }

p,
li,
label,
small,
.muted,
.form-foot,
.section-head small,
.location-excerpt,
.location-state-line { color: var(--text-soft); }

h1, h2, h3, h4 {
    line-height: 1.14;
    letter-spacing: -0.02em;
    text-wrap: balance;
}
p { text-wrap: pretty; }

.card,
.mini-panel,
.compact-link-card,
.conversation-item,
.inventory-detail-card,
.location-result-card,
.service-card,
.contract-card,
.crafting-card {
    backdrop-filter: blur(10px);
}

.card:hover,
.compact-link-card:hover,
.conversation-item:hover,
.location-result-card:hover,
.inventory-detail-card:hover,
.service-card:hover,
.contract-card:hover {
    border-color: rgba(255, 239, 153, 0.18);
    box-shadow: 0 22px 52px rgba(0, 0, 0, 0.30);
}

.page-shell > .alert {
    margin-bottom: 16px;
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}

.topbar {
    overflow: clip;
}
.topbar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255, 239, 153, 0.08), transparent 26%);
    pointer-events: none;
}
.brand {
    gap: 16px;
}
.brand strong {
    font-size: 1.08rem;
    letter-spacing: -0.02em;
}
.brand small {
    margin-top: 2px;
    font-size: 0.88rem;
}
.brand-badge {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    box-shadow: 0 0 0 1px rgba(255, 239, 153, 0.18), 0 0 28px rgba(242, 223, 111, 0.32);
}
.topbar-user-chip {
    gap: 6px;
    padding: 14px 16px;
    border-radius: 20px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.topbar-user-name {
    font-size: 0.98rem;
    letter-spacing: -0.01em;
}
.topbar-user-meta {
    line-height: 1.35;
}
.navlinks a,
.top-link,
.btn,
.tab,
.tag-pill,
.pill,
.chip {
    font-weight: 700;
}
.navlinks a,
.top-link {
    backdrop-filter: blur(8px);
}
.navlinks a:focus-visible,
.top-link:focus-visible,
.btn:focus-visible,
.tab:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    min-height: 20px;
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(20,20,13,0.92);
    color: var(--accent-strong);
    font-size: 0.75rem;
    font-weight: 900;
    line-height: 1;
}

.page-banner,
.hero-card,
.auth-card,
.profile-hero {
    background:
        radial-gradient(circle at top left, rgba(255, 239, 153, 0.08), transparent 30%),
        linear-gradient(180deg, rgba(73, 71, 40, 0.92), rgba(35, 35, 20, 0.97));
}

.section-head {
    gap: 10px;
    margin-bottom: 14px;
}
.section-head h2,
.section-head h3 {
    letter-spacing: -0.02em;
}

.info-list > div,
.stat-pair > div,
.overview-grid > div,
.profile-stats > div {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

input,
select,
textarea {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(8, 8, 6, 0.28);
    color: var(--text);
    padding: 12px 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
textarea {
    min-height: 120px;
    resize: vertical;
}
input::placeholder,
textarea::placeholder {
    color: rgba(243, 239, 202, 0.46);
}
label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}
label > span {
    color: var(--text);
}

.btn {
    min-height: 46px;
    padding: 11px 16px;
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 10px 24px rgba(0,0,0,0.18);
}
.btn:hover,
.btn:focus-visible {
    transform: translateY(-1px);
    text-decoration: none;
}
.btn.btn-block {
    justify-content: center;
}
.btn-secondary,
.btn.tiny-btn:not(.btn-primary),
.topbar-actions .btn:not(.btn-primary) {
    background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
}

.feed-tabs,
.chip-row,
.meta-row,
.location-chip-row,
.party-banner-meta,
.party-round-summary-chips,
.party-card-meta .chip-row {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 239, 153, 0.28) transparent;
}
.feed-tabs::-webkit-scrollbar,
.chip-row::-webkit-scrollbar,
.meta-row::-webkit-scrollbar {
    height: 8px;
}
.feed-tabs::-webkit-scrollbar-thumb,
.chip-row::-webkit-scrollbar-thumb,
.meta-row::-webkit-scrollbar-thumb {
    background: rgba(255, 239, 153, 0.22);
    border-radius: 999px;
}

.post-card,
.notification-card,
.user-card,
.survivor-card,
.messages-main,
.messages-sidebar,
.admin-card,
.expedition-card {
    box-shadow: 0 18px 42px rgba(0,0,0,0.24);
}

.post-head,
.item-card-head,
.location-result-head,
.party-member-head,
.messages-head,
.conversation-head,
.user-card-head {
    gap: 14px;
}

.post-actions,
.composer-actions,
.hero-actions,
.auth-actions,
.inline-form-row,
.form-actions {
    gap: 10px;
}

.tag-pill span,
.mini-stat-chip,
.location-meta-chip,
.chip,
.pill {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.auth-shell {
    min-height: calc(100vh - 180px);
    display: grid;
    place-items: center;
}
.auth-card.wide {
    width: min(1080px, 100%);
}
.auth-card form {
    gap: 16px;
}

.messages-layout,
.page-grid,
.game-page-grid,
.inventory-page-grid {
    align-items: start;
}

.path-game .page-banner,
.path-game-market .page-banner,
.path-game-party .page-banner,
.path-game-location .page-banner,
.path-game-outpost .page-banner,
.path-game-inventory .page-banner {
    position: relative;
    overflow: hidden;
}
.path-game .page-banner::after,
.path-game-market .page-banner::after,
.path-game-party .page-banner::after,
.path-game-location .page-banner::after,
.path-game-outpost .page-banner::after,
.path-game-inventory .page-banner::after {
    content: "";
    position: absolute;
    inset: auto -12% -35% auto;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 239, 153, 0.12), transparent 68%);
    pointer-events: none;
}

@media (max-width: 860px) {
    .topbar {
        border-radius: 26px;
    }
    .topbar-user-chip {
        order: 3;
        width: 100%;
    }
    .page-grid,
    .game-page-grid,
    .inventory-page-grid,
    .messages-layout {
        gap: 18px;
    }
    .side-sticky {
        top: 0;
    }
}

@media (max-width: 720px) {
    body {
        line-height: 1.45;
    }
    .skip-link {
        left: 10px;
        right: 10px;
        width: auto;
        text-align: center;
    }
    .brand {
        flex: 1 1 auto;
        align-items: flex-start;
    }
    .brand-badge {
        width: 24px;
        height: 24px;
        margin-top: 2px;
    }
    .brand strong {
        font-size: 1rem;
    }
    .brand small {
        font-size: 0.82rem;
        line-height: 1.3;
    }
    .nav-toggle {
        min-height: 42px;
        padding-inline: 14px;
        border-radius: 999px;
    }
    .topbar-lower {
        gap: 12px;
    }
    .navlinks a,
    .top-link,
    .topbar-actions form,
    .topbar-actions .btn {
        min-height: 46px;
    }
    .page-shell {
        padding-bottom: max(38px, env(safe-area-inset-bottom));
    }
    .page-banner h1,
    .hero-card h1,
    .auth-card h1,
    .profile-hero h1 {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }
    .overview-grid,
    .info-list,
    .profile-stats {
        gap: 10px;
    }
    .mini-panel,
    .compact-link-card,
    .conversation-item {
        padding: 14px;
    }
    input,
    select,
    textarea,
    .btn {
        font-size: 16px;
    }
}

@media (max-width: 520px) {
    .container {
        width: min(100% - 16px, 100%);
    }
    .topbar {
        padding: 14px;
        border-radius: 22px;
    }
    .sidebar,
    .hero-card,
    .page-banner,
    .auth-card,
    .profile-hero,
    .composer-card,
    .post-card,
    .user-card,
    .survivor-card,
    .empty-state,
    .install-card,
    .compact-card,
    .notification-card,
    .admin-card,
    .expedition-card,
    .messages-sidebar,
    .messages-main,
    .party-member-card,
    .party-nearby-card,
    .party-signal-card {
        padding: 14px;
        border-radius: 18px;
    }
    .eyebrow,
    .hero-badge {
        font-size: 0.7rem;
        letter-spacing: 0.1em;
    }
}

/* --- 2026-04-13: button contrast normalisation --- */
.btn,
button[type="submit"],
button[type="button"],
button[type="reset"],
input[type="submit"],
input[type="button"],
input[type="reset"] {
    color: var(--text);
}

.btn-primary,
button[type="submit"].btn-primary,
button[type="button"].btn-primary,
button[type="reset"].btn-primary,
input[type="submit"].btn-primary,
input[type="button"].btn-primary,
input[type="reset"].btn-primary {
    color: #14140d;
    background: linear-gradient(180deg, #fff0a6, #d6bb4e);
    border-color: rgba(255, 240, 166, 0.35);
}

.btn-secondary,
button[type="submit"].btn-secondary,
button[type="button"].btn-secondary,
button[type="reset"].btn-secondary,
input[type="submit"].btn-secondary,
input[type="button"].btn-secondary,
input[type="reset"].btn-secondary,
.btn.tiny-btn:not(.btn-primary),
button[type="submit"].tiny-btn:not(.btn-primary),
button[type="button"].tiny-btn:not(.btn-primary),
button[type="reset"].tiny-btn:not(.btn-primary),
input[type="submit"].tiny-btn:not(.btn-primary),
input[type="button"].tiny-btn:not(.btn-primary),
input[type="reset"].tiny-btn:not(.btn-primary) {
    color: var(--text);
    background: linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.04));
    border: 1px solid rgba(255,255,255,0.10);
}

.btn[disabled]:not(.btn-primary),
button[disabled]:not(.btn-primary),
input[disabled]:not(.btn-primary),
[aria-disabled="true"]:not(.btn-primary) {
    color: rgba(243, 239, 202, 0.78);
}


/* --- 2026-04-14: prevent long scene/action button labels from clipping --- */
.action-card,
.scene-action-card {
    grid-template-rows: auto auto 1fr auto;
}

.action-card .btn,
.action-card button[type="submit"],
.scene-action-card .btn,
.scene-action-card button[type="submit"] {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    text-wrap: balance;
    text-align: center;
    line-height: 1.25;
    min-height: 52px;
    padding-top: 12px;
    padding-bottom: 12px;
}

@media (max-width: 900px) {
    .portal-hero,
    .portal-columns {
        grid-template-columns: 1fr;
    }

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

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

    .portal-status-panel {
        padding: 16px;
    }
}
