:root {
    --bg: #0a0e17;
    --bg-surface: #111827;
    --bg-sidebar: #0d1220;
    --bg-input: #1a2236;
    --bg-hover: #1e293b;
    --bg-accent: rgba(6, 182, 212, 0.12);
    --text-main: #e2e8f0;
    --text-muted: #64748b;
    --text-dim: #475569;
    --accent: #06b6d4;
    --accent-hover: #22d3ee;
    --primary: #06b6d4;
    --primary-color: #06b6d4;
    --primary-hover: #22d3ee;
    --primary-rgb: 6, 182, 212;
    --accent-rgb: 6, 182, 212;
    --border: #1e293b;
    --border-light: #2a3548;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #22c55e;
    --info: #3b82f6;
    --radius: 14px;
    --shadow-lg: 0 22px 40px rgba(1, 8, 20, 0.35);
    --shadow-sm: 0 10px 18px rgba(0, 0, 0, 0.18);
    --accent-cyan: #06b6d4;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    min-height: 100%;
}

body {
    background:
        radial-gradient(ellipse at 8% 0%, rgba(6, 182, 212, 0.14) 0%, transparent 52%),
        radial-gradient(ellipse at 95% 100%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
        var(--bg);
    color: var(--text-main);
    font-family: "Outfit", "DM Sans", sans-serif;
    line-height: 1.45;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-weight: 600;
    letter-spacing: 0.02em;
}

code,
.mono {
    font-family: "JetBrains Mono", "Fira Code", "SF Mono", monospace;
}

a {
    color: inherit;
}

.hidden {
    display: none !important;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 270px;
    background: linear-gradient(165deg, rgba(8, 14, 24, 0.95) 0%, rgba(11, 18, 34, 0.98) 100%);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-header {
    margin-bottom: 22px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(12, 19, 36, 0.85);
}

.logo-circle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--accent), #0891b2);
    box-shadow: 0 0 0 5px rgba(6, 182, 212, 0.15);
}

.brand h1 {
    font-size: 13px;
    font-family: "JetBrains Mono", monospace;
    text-transform: uppercase;
    color: #9ae5f3;
    letter-spacing: 0.08em;
}

nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-section + .nav-section {
    margin-top: 8px;
}

.nav-section-label {
    padding: 6px 12px 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6f88a8;
}

.nav-item {
    text-decoration: none;
    color: var(--text-muted);
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: rgba(30, 41, 59, 0.6);
    color: #bed5ec;
}

.nav-item.active {
    background: var(--bg-accent);
    border-color: rgba(6, 182, 212, 0.35);
    color: var(--accent-hover);
}

.sidebar-footer {
    margin-top: 14px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.content {
    flex: 1;
    padding: 28px 28px 34px;
}

.stats-header {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card {
    background: linear-gradient(165deg, rgba(16, 24, 39, 0.86) 0%, rgba(13, 20, 36, 0.95) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 18px 16px;
    box-shadow: var(--shadow-sm);
    min-height: 96px;
}

.stat-card .label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-card h2 {
    font-family: "JetBrains Mono", monospace;
    font-size: 27px;
    line-height: 1.1;
}

.stat-sub {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.sub-label {
    font-size: 12px;
    color: var(--text-muted);
}

.glass-card {
    background: linear-gradient(170deg, rgba(16, 24, 39, 0.9) 0%, rgba(13, 20, 34, 0.95) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 22px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

h3 {
    font-size: 16px;
    margin-bottom: 14px;
}

.analytics-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.chart-container {
    height: 320px;
    min-height: 320px;
    max-height: 320px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    min-height: 0;
    flex: 1 1 auto;
}

.activity-card {
    display: flex;
    flex-direction: column;
}

.activity-log {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(11, 18, 32, 0.6);
}

.activity-entry {
    padding: 9px 2px;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.activity-entry:last-child {
    border-bottom: 0;
}

.activity-entry .user-name {
    color: #b5f4ff;
    font-size: 13px;
}

.activity-entry .time-stamp {
    color: var(--text-muted);
    font-size: 11px;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px;
}

.status-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    background: rgba(11, 18, 32, 0.55);
}

.status-item .label {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.status-item .value {
    font-family: "JetBrains Mono", monospace;
}

.status-item.highlight {
    border-color: rgba(6, 182, 212, 0.45);
    box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.14);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

th {
    text-align: left;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
}

td {
    padding: 12px;
    border-bottom: 1px solid rgba(30, 41, 59, 0.65);
    font-size: 13px;
}

tr:hover td {
    background: rgba(30, 41, 59, 0.3);
}

label {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 6px;
}

input,
select,
textarea {
    width: 100%;
    color: var(--text-main);
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: 9px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 13px;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(6, 182, 212, 0.7);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
    outline: none;
}

button {
    border: 1px solid transparent;
    border-radius: 9px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 14px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.primary-btn {
    color: #062832;
    background: linear-gradient(180deg, #3ed8ee 0%, #06b6d4 100%);
}

.primary-btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.secondary-btn {
    color: #c8deef;
    background: rgba(30, 41, 59, 0.88);
    border-color: rgba(100, 116, 139, 0.4);
}

.secondary-btn:hover {
    background: rgba(51, 65, 85, 0.9);
}

.text-btn {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border);
}

.text-btn:hover {
    color: var(--accent-hover);
    border-color: rgba(6, 182, 212, 0.35);
}

.action-btn {
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 12px;
    margin-right: 4px;
}

.spy-btn {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.35);
    color: #9fc5ff;
}

.warp-btn {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #ffd186;
}

.dm-btn {
    background: rgba(34, 197, 94, 0.13);
    border-color: rgba(34, 197, 94, 0.35);
    color: #9ef4bf;
}

.kick-btn,
.danger-btn {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.42);
    color: #ff9f9f;
}

.glass-overlay,
.overlay,
.modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 8, 17, 0.7);
    backdrop-filter: blur(9px);
    z-index: 1000;
}

.glass-overlay {
    z-index: 1200;
}

.modal-overlay {
    display: none;
    z-index: 2100;
}

.modal-overlay.active {
    display: flex;
}

.login-card,
.modal-card {
    width: min(94vw, 440px);
    max-height: min(90vh, 980px);
    background: linear-gradient(170deg, #111827 0%, #0f172a 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.login-card {
    text-align: center;
}

.login-card h2 {
    margin-bottom: 8px;
    color: #9ae5f3;
    font-size: 24px;
}

.login-card p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.login-card .primary-btn {
    width: 100%;
    margin-top: 12px;
}

#modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.modal-actions,
.modal-footer {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group.inline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    align-items: end;
}

.form-grid,
.bank-grid,
.chat-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tab-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 12px;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #d8f3f9;
    background: rgba(30, 41, 59, 0.45);
}

.tab-btn.active {
    background: var(--bg-accent);
    border-color: rgba(6, 182, 212, 0.38);
    color: var(--accent-hover);
}

.monitor-card {
    display: flex;
    flex-direction: column;
    min-height: 550px;
}

.monitor-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.text-dim,
.hint,
.empty-text,
.loading-text,
.error-text {
    color: var(--text-muted);
    font-size: 12px;
}

.monitor-log {
    min-height: 280px;
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(10, 17, 32, 0.65);
    padding: 10px 12px;
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
}

.monitor-log div {
    border-bottom: 1px solid rgba(71, 85, 105, 0.25);
    padding: 4px 0;
}

.monitor-reply-area {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.monitor-reply-area input {
    flex: 1;
}

.search-box {
    max-width: 760px;
    margin: 0 auto;
}

.search-container {
    margin-bottom: 14px;
}

.filter-bar {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    background: rgba(10, 17, 30, 0.56);
}

.table-filter {
    max-width: 440px;
}

.gamedata-card .table-container {
    overflow: auto;
    max-height: 500px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-top: 12px;
}

.gamedata-card th {
    position: sticky;
    top: 0;
    background: #0d1527;
    z-index: 1;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(6, 182, 212, 0.35);
    background: rgba(6, 182, 212, 0.12);
    color: #a3f3ff;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 500;
}

.guild-manager-layout {
    display: grid;
    grid-template-columns: minmax(250px, 300px) 1fr;
    gap: 14px;
    height: 620px;
    margin-top: 12px;
}

.guild-list-sidebar,
.guild-detail-panel,
.guild-empty-state {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(10, 17, 32, 0.48);
}

.guild-list-sidebar {
    overflow-y: auto;
}

.guild-item {
    padding: 12px;
    border-bottom: 1px solid rgba(30, 41, 59, 0.75);
    cursor: pointer;
}

.guild-item:hover {
    background: rgba(30, 41, 59, 0.35);
}

.guild-item.active {
    border-left: 3px solid var(--accent);
    background: rgba(var(--accent-rgb), 0.14);
}

.guild-item h4 {
    margin-bottom: 4px;
}

.guild-item .member-count {
    font-size: 12px;
    color: var(--text-muted);
}

.guild-detail-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.detail-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.guild-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.crest-preview {
    width: 56px;
    height: 56px;
    image-rendering: pixelated;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: #070c18;
}

.guild-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.danger-zone {
    margin-top: 24px;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.45);
    background: rgba(127, 29, 29, 0.2);
}

.danger-zone h4 {
    color: #ffadad;
    margin-bottom: 8px;
}

.guild-header-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.guild-tab-pane {
    overflow-y: auto;
}

.guild-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.guild-stat-card,
.guild-panel-block {
    border: 1px solid rgba(51, 65, 85, 0.7);
    border-radius: 12px;
    background: rgba(7, 16, 34, 0.72);
}

.guild-stat-card {
    padding: 14px;
}

.guild-stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 24px;
    color: #f8fbff;
}

.guild-stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.guild-panel-block {
    padding: 14px;
}

.guild-panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.guild-panel-heading h4 {
    margin-bottom: 4px;
}

.guild-panel-heading p {
    color: var(--text-muted);
    font-size: 13px;
}

.guild-inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(180px, 220px) auto;
    gap: 12px;
    align-items: end;
}

.guild-inline-form-compact {
    grid-template-columns: minmax(180px, 260px) auto;
}


.guild-reputation-actions {
    grid-template-columns: minmax(180px, 260px) auto auto auto;
}

#guild-rep-points:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}
.guild-table-wrap {
    margin-top: 14px;
}

.guild-split-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.4fr);
    gap: 14px;
}

.guild-fort-list,
.guild-fort-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.guild-fort-item,
.guild-history-item {
    border: 1px solid rgba(51, 65, 85, 0.72);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.58);
    padding: 12px;
}

.guild-fort-item-header,
.guild-history-header,
.guild-history-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.guild-history-header {
    margin-bottom: 8px;
}

.guild-fort-item p,
.guild-history-item p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 6px;
}

.guild-history-result {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.08em;
}

.guild-history-result.won {
    color: #4ade80;
}

.guild-history-result.lost {
    color: #f87171;
}

.guild-empty-block {
    border: 1px dashed rgba(71, 85, 105, 0.9);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-muted);
    background: rgba(15, 23, 42, 0.38);
}

.guild-mini-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #dbeafe;
}

.guild-mini-badge.won {
    border-color: rgba(74, 222, 128, 0.45);
    color: #86efac;
}

.guild-mini-badge.lost {
    border-color: rgba(248, 113, 113, 0.45);
    color: #fca5a5;
}
.inventory-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.inventory-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.inventory-summary-pending {
    color: #fbbf24;
    font-weight: 600;
}

.inventory-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.player-quests-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quests-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.quests-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.quest-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(10, 17, 32, 0.62);
}

.quest-row.valid {
    border-color: rgba(34, 197, 94, 0.28);
}

.quest-row.invalid {
    border-color: rgba(245, 158, 11, 0.34);
}

.player-quests-list.pending .quest-row {
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.18);
}

.inventory-empty-state {
    border: 1px dashed rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    padding: 22px 18px;
    text-align: center;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.03);
}

.inventory-empty-state p {
    margin: 8px 0 0;
}

.inventory-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(10, 17, 32, 0.62);
}

.inventory-row.valid {
    border-color: rgba(34, 197, 94, 0.28);
}

.inventory-row.invalid {
    border-color: rgba(239, 68, 68, 0.34);
}

.inventory-list.pending .inventory-row {
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.18);
}

.inventory-row-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inventory-row-title,
.inventory-row-meta,
.inventory-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.inventory-row-meta {
    color: var(--text-dim);
    font-size: 12px;
}

.inventory-row-actions {
    flex-shrink: 0;
}

@media (max-width: 760px) {
    .inventory-row {
        flex-direction: column;
    }

    .inventory-row-actions {
        width: 100%;
    }
}

.orb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(10, 17, 32, 0.52);
    max-height: 300px;
    overflow-y: auto;
}

.orb-slot {
    aspect-ratio: 1;
    border: 1px solid var(--border-light);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.8);
}

.orb-slot.active {
    color: #062832;
    background: linear-gradient(180deg, #66e3f3 0%, #06b6d4 100%);
    border-color: transparent;
}

.friends-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.hirelings-editor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.hireling-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    background: rgba(10, 17, 32, 0.58);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hireling-card.empty {
    opacity: 0.78;
    background: rgba(10, 17, 32, 0.32);
    border-style: dashed;
}

.hireling-empty-copy {
    color: var(--text-muted);
    font-size: 13px;
}

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

.hireling-card-header strong {
    font-size: 14px;
}

.hireling-card .form-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.hireling-card textarea {
    min-height: 86px;
    font-family: monospace;
    resize: vertical;
}

.hireling-card .form-group.invalid input {
    border-color: rgba(239, 68, 68, 0.45);
}

.form-group.valid input,
.form-group.valid textarea,
.form-group.valid select {
    border-color: rgba(74, 222, 128, 0.45);
}

.form-group.invalid input,
.form-group.invalid textarea,
.form-group.invalid select {
    border-color: rgba(248, 113, 113, 0.45);
}

.hireling-item-status {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.hireling-item-status.valid {
    color: #4ade80;
}

.hireling-item-status.invalid {
    color: #f87171;
}

.world-ref-status {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.world-ref-status.valid {
    color: #4ade80;
}

.world-ref-status.invalid {
    color: #f87171;
}

.friend-item {
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 10px;
    text-align: center;
    background: rgba(10, 17, 32, 0.45);
    cursor: pointer;
}

.friend-item:hover {
    border-color: rgba(6, 182, 212, 0.45);
    background: rgba(var(--accent-rgb), 0.13);
}

.profile-guild-link {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(6, 182, 212, 0.35);
    background: rgba(var(--accent-rgb), 0.13);
    border-radius: 999px;
    padding: 6px 12px;
}

#toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background: rgba(10, 17, 30, 0.95);
    color: #d7e8f7;
    padding: 10px 12px;
    min-width: 240px;
    box-shadow: var(--shadow-sm);
    animation: toast-in 0.25s ease;
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--danger);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1200px) {
    .content {
        padding: 18px;
    }

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

    .stats-header {
        grid-template-columns: 1fr;
    }

    .guild-manager-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

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

    .guild-split-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 920px) {
    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        padding: 14px;
    }

    nav {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .nav-section {
        gap: 6px;
    }

    .guild-stat-grid {
        grid-template-columns: 1fr;
    }

    .guild-inline-form,
    .guild-inline-form-compact {
        grid-template-columns: 1fr;
    }
}



.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    position: relative;
}

.topbar-title .eyebrow {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.topbar-title h2 {
    font-size: 20px;
    font-family: "JetBrains Mono", monospace;
    color: #a8f1ff;
}

.topbar-actions {
    position: relative;
}

.notif-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: rgba(11, 18, 32, 0.8);
    color: var(--accent-hover);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.notif-btn:hover {
    background: rgba(6, 182, 212, 0.15);
}

.notif-icon {
    font-family: "JetBrains Mono", monospace;
    font-weight: 700;
}

.notif-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 2px solid var(--bg);
}

.notif-menu {
    position: absolute;
    right: 0;
    top: 52px;
    width: min(420px, 92vw);
    background: linear-gradient(170deg, rgba(16, 24, 39, 0.98) 0%, rgba(13, 20, 34, 0.98) 100%);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 1500;
    overflow: hidden;
}

.notif-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.notif-menu-header h4 {
    font-size: 14px;
}

.notif-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 9px;
}

.notif-item.unread {
    background: rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.25);
}

.notif-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    margin-top: 5px;
    background: var(--info);
    flex-shrink: 0;
}

.notif-dot.success {
    background: var(--success);
}

.notif-dot.warning {
    background: var(--warning);
}

.notif-dot.error {
    background: var(--danger);
}

.notif-copy p {
    font-size: 13px;
    margin-bottom: 2px;
}

.notif-copy span {
    font-size: 11px;
    color: var(--text-muted);
}

.chart-header {
    margin-bottom: 10px;
}

.traffic-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(90px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.traffic-metric {
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 8px 10px;
    background: rgba(10, 17, 30, 0.6);
}

.traffic-metric .label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.traffic-metric strong {
    font-family: "JetBrains Mono", monospace;
    font-size: 16px;
    color: #9ae5f3;
}

/* Moderation Status Badges */
.badge.danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ff9f9f;
}

.badge.warning {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
    color: #ffd186;
}

.badge.success {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.4);
    color: #9ef4bf;
}

/* Actions Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg-surface);
    min-width: 130px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: var(--text-main);
    padding: 10px 14px;
    text-decoration: none;
    display: block;
    font-size: 12px;
    transition: background 0.2s;
}

.dropdown-content a:hover {
    background: var(--bg-hover);
    color: var(--accent-hover);
}

/* Audit Logs Premium Styling */
tr.log-row td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 13px;
    vertical-align: middle;
}

tr.log-row:hover td {
    background: rgba(var(--accent-rgb), 0.03);
}

.log-id {
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 11px;
    width: 70px;
}

.log-timestamp {
    color: var(--text-muted);
    font-size: 11px;
    width: 150px;
}

.user-pill {
    display: inline-block;
    padding: 2px 10px;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 20px;
    color: var(--accent-hover);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-pill:hover {
    background: rgba(6, 182, 212, 0.2);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.cat-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cat-icon {
    font-size: 14px;
    opacity: 0.8;
}

.log-message {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mini-badge {
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    min-width: 50px;
    text-align: center;
}

.detail-text {
    flex: 1;
    color: var(--text-main);
}

.log-quote {
    color: #ffd186;
    font-style: italic;
    font-weight: 400;
}

.log-highlight {
    color: var(--accent-hover);
    font-weight: 600;
}

/* Category Row Accents */
.cat-moderation {
    border-left: 3px solid var(--danger);
}

.cat-chat {
    border-left: 3px solid var(--info);
}

.cat-auth {
    border-left: 3px solid var(--success);
}

.cat-economy {
    border-left: 3px solid var(--warning);
}

.cat-inventory,
.cat-item {
    border-left: 3px solid var(--accent);
}

.action-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reverted-row {
    opacity: 0.65;
    background: rgba(255, 255, 255, 0.02);
}

.reverted-row .detail-text {
    text-decoration: line-through;
    color: var(--text-dim);
}

.reverted-badge {
    font-size: 9px;
    padding: 1px 6px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
    border-radius: 4px;
    font-weight: 700;
    margin-left: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

.btn.danger,
.action-btn.danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.btn.danger:hover,
.action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.action-btn.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.action-btn.warning:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
}

.mini-btn {
    padding: 4px 10px;
    font-size: 11px;
}
.shop-editor-note {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.16);
    color: var(--text-dim);
    font-size: 12px;
}

.shop-message-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.shop-entry-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.shop-entry-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 4px;
}

.shop-entry-card {
    padding: 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.shop-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

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

.shop-entry-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
    font-size: 12px;
    align-self: end;
    padding-bottom: 6px;
}

.shop-empty-state {
    padding: 18px;
    text-align: center;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.03);
}

.table-filter-select {
    min-width: 180px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.88);
    color: var(--text-main);
}

.config-filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1.7fr) minmax(180px, 1fr) minmax(180px, 1fr);
    gap: 12px;
}

.modal-card.shop-modal {
    width: min(92vw, 1180px);
}

.shop-editor-shell {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
    min-height: 560px;
}

.shop-editor-shell.collapsed {
    grid-template-columns: 140px minmax(0, 1fr);
}

.shop-sidebar {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.shop-sidebar.collapsed {
    padding: 12px;
    gap: 10px;
}

.shop-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.shop-sidebar.collapsed .shop-sidebar-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.shop-sidebar.collapsed .shop-sidebar-header .action-btn {
    width: 100%;
    text-align: center;
}

.shop-sidebar-header h4,
.shop-workspace-header h4,
.shop-mode-header h4 {
    margin: 0;
}

.shop-sidebar-header p,
.shop-workspace-header p,
.shop-mode-header p {
    margin: 4px 0 0;
    color: var(--text-dim);
    font-size: 12px;
}

.shop-sidebar.collapsed p {
    margin: 0;
    line-height: 1.35;
}

.shop-sidebar-collapsed,
.shop-section-collapsed {
    color: var(--text-dim);
    font-size: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    padding: 14px 12px;
    text-align: center;
}

.shop-sidebar.collapsed .shop-sidebar-collapsed {
    padding: 12px 10px;
    font-size: 11px;
}

.shop-workspace {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.shop-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    min-height: 0;
}

.shop-mode-column {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.shop-mode-column.sell {
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.08);
}

.shop-mode-column.buy {
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.08);
}

.shop-mode-header,
.shop-mode-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.shop-mode-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 4px;
}

.shop-entry-card {
    padding: 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.shop-entry-card.valid {
    border-color: rgba(34, 197, 94, 0.28);
}

.shop-entry-card.invalid {
    border-color: rgba(239, 68, 68, 0.34);
}

.shop-entry-card.empty {
    border-color: rgba(255, 255, 255, 0.12);
}

.shop-entry-status {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-dim);
}

.shop-entry-status.valid {
    color: #4ade80;
}

.shop-entry-status.invalid {
    color: #f87171;
}

.shop-entry-status.empty {
    color: var(--text-dim);
}

.shop-entry-span-2 {
    grid-column: span 2;
}

.shop-message-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 0;
}

@media (max-width: 980px) {
    .config-filter-bar {
        grid-template-columns: 1fr;
    }

    .modal-card.shop-modal {
        width: min(96vw, 1180px);
        max-height: 92vh;
        overflow-y: auto;
    }

    .shop-editor-shell,
    .shop-editor-shell.collapsed,
    .shop-columns {
        grid-template-columns: 1fr;
    }

    .shop-sidebar.collapsed {
        padding: 16px;
    }

    .shop-entry-span-2 {
        grid-column: span 1;
    }
}

.inv-slot.valid {
    border-color: rgba(34, 197, 94, 0.28);
}

.inv-slot.invalid {
    border-color: rgba(239, 68, 68, 0.34);
}

.inv-item-status {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-dim);
}

.inv-item-status.valid {
    color: #4ade80;
}

.inv-item-status.invalid {
    color: #f87171;
}

.inv-item-status.empty {
    color: var(--text-dim);
}




.world-authoring-layout {
    grid-template-columns: minmax(250px, 300px) 1fr;
    height: auto;
    min-height: 720px;
    align-items: start;
}

.world-authoring-sidebar {
    min-width: 280px;
    max-width: 320px;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
}

.world-authoring-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    max-height: calc(100vh - 220px);
    padding-bottom: 16px;
}

.world-structured-editor {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.world-stage-card,
.world-reward-row,
.world-objective-row {
    overflow: visible;
}

.world-script-action-row.selected {
    border: 1px solid rgba(61, 220, 151, 0.55);
    box-shadow: 0 0 0 1px rgba(61, 220, 151, 0.15), 0 14px 28px rgba(0, 0, 0, 0.22);
}

.script-flow-board {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
}

.script-flow-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.script-flow-lane {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 4px 4px;
}

.script-flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.script-flow-node,
.script-flow-start,
.script-flow-end {
    width: min(520px, 100%);
    text-align: left;
    border-radius: 14px;
    border: 1px solid rgba(82, 162, 255, 0.28);
    background: linear-gradient(180deg, rgba(7, 20, 47, 0.95), rgba(10, 28, 56, 0.88));
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
    padding: 14px 16px;
}

.script-flow-node {
    cursor: pointer;
    transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.script-flow-node:hover,
.script-flow-node.selected {
    transform: translateY(-1px);
    border-color: rgba(61, 220, 151, 0.55);
    box-shadow: 0 0 0 1px rgba(61, 220, 151, 0.12), 0 16px 34px rgba(0, 0, 0, 0.28);
}

.script-flow-start,
.script-flow-end {
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--accent-cyan);
}

.script-flow-node-type {
    display: block;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-cyan);
    margin-bottom: 6px;
}

.script-flow-node-label {
    display: block;
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.45;
}

.script-flow-connector {
    width: 2px;
    height: 24px;
    background: linear-gradient(180deg, rgba(82, 162, 255, 0.55), rgba(61, 220, 151, 0.4));
    border-radius: 999px;
}

.script-flow-group {
    width: min(760px, 100%);
    border-radius: 18px;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    background: rgba(7, 16, 34, 0.38);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.script-flow-group.parallel {
    border-color: rgba(255, 196, 86, 0.28);
    background: rgba(34, 24, 7, 0.22);
}

.script-flow-group-head {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.script-flow-group-body {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.script-flow-group-body.parallel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    align-items: start;
}

.world-help-badge {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid rgba(82, 162, 255, 0.32);
    background: rgba(9, 24, 51, 0.9);
    color: var(--accent-cyan);
    font-weight: 700;
    cursor: help;
}

.world-validation-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(82, 162, 255, 0.18);
    background: rgba(7, 16, 34, 0.42);
}

.world-validation-summary.ok {
    border-color: rgba(61, 220, 151, 0.28);
}

.world-validation-summary.warning {
    border-color: rgba(255, 196, 86, 0.34);
}

.world-validation-summary.error {
    border-color: rgba(255, 104, 104, 0.36);
}

.world-validation-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.world-validation-item {
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-main);
}

.world-validation-item.error {
    color: #ff9f9f;
}

.world-validation-item.warning {
    color: #ffd588;
}




.modal-card.drop-modal {
    width: min(92vw, 980px);
}

.drop-editor-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 480px;
}

.drop-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.drop-editor-header p {
    margin: 4px 0 0;
    color: var(--text-dim);
}

.drop-entry-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
}

.drop-entry-card {
    padding: 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.drop-entry-card.valid {
    border-color: rgba(16, 185, 129, 0.35);
}

.drop-entry-card.invalid {
    border-color: rgba(239, 68, 68, 0.35);
}

.drop-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

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

.drop-entry-span-2 {
    grid-column: span 2;
}

@media (max-width: 960px) {
    .modal-card.drop-modal {
        width: min(96vw, 980px);
    }

    .drop-entry-grid {
        grid-template-columns: 1fr;
    }

    .drop-entry-span-2 {
        grid-column: auto;
    }
}

.modal-card.item-modal {
    width: min(96vw, 980px);
}
.item-editor-modal {
    width: 100%;
    min-width: 0;
}
.item-class-picker {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}
.item-class-picker select {
    flex: 1;
}
.item-class-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.item-class-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(61, 220, 151, 0.24);
    background: rgba(61, 220, 151, 0.08);
    color: var(--text-main);
}
.item-class-tag span {
    color: var(--text-dim);
    font-size: 12px;
}

.item-raw-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.item-raw-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.item-raw-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(240px, 2fr) auto;
    gap: 10px;
    align-items: center;
}
.item-raw-key,
.item-raw-value {
    width: 100%;
}

.modal-card.entity-modal {
    width: min(96vw, 1120px);
}
.entity-editor-modal {
    width: 100%;
    min-width: 0;
}

.entity-editor-sections {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.entity-editor-section {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
}

.entity-editor-section h4 {
    margin: 0 0 12px;
}

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

.entity-editor-collapsible {
    padding: 0;
    overflow: hidden;
}

.entity-editor-collapsible summary {
    list-style: none;
    cursor: pointer;
    padding: 14px;
    font-weight: 600;
    user-select: none;
}

.entity-editor-collapsible summary::-webkit-details-marker {
    display: none;
}

.entity-editor-collapsible summary::after {
    content: '+';
    float: right;
    color: var(--text-muted);
}

.entity-editor-collapsible[open] summary::after {
    content: '-';
}

.entity-editor-collapsible-content {
    padding: 0 14px 14px;
    max-height: min(42vh, 420px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 960px) {
    .modal-card.item-modal,
    .modal-card.entity-modal {
        width: min(96vw, 760px);
    }

    .entity-editor-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .item-raw-row {
        grid-template-columns: 1fr;
    }
}
.arena-editor-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
}

.arena-config-sidebar,
.arena-editor-main {
    min-width: 0;
}

.arena-config-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 720px;
    overflow: auto;
}

.arena-config-item {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(10, 20, 42, 0.7);
    padding: 12px 14px;
    cursor: pointer;
}

.arena-config-item.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px rgba(43, 214, 255, 0.25) inset;
}

.arena-config-item strong,
.arena-config-item span {
    display: block;
}

.arena-config-item span {
    color: var(--text-dim);
    font-size: 12px;
    margin-top: 4px;
}

.arena-editor-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) 140px auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 14px;
}

.arena-toolbar-actions,
.arena-editor-toolbar-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.arena-rounds-editor {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.arena-round-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    background: rgba(9, 18, 36, 0.82);
}

.arena-round-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

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

.arena-round-card textarea {
    min-height: 84px;
    resize: vertical;
}

@media (max-width: 1100px) {
    .arena-editor-layout {
        grid-template-columns: 1fr;
    }

    .arena-editor-toolbar {
        grid-template-columns: 1fr;
    }
}

.arena-selector-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.arena-selector-card select {
    width: 100%;
    min-height: 46px;
}

.arena-selector-card .secondary-btn {
    align-self: flex-start;
}

.profile-subsection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.profile-subsection-header h4 {
    margin: 0;
}

.profile-inline-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}


.teleport-profile-editor {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 8px;
}

.teleport-profile-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 160px auto;
    gap: 10px;
    align-items: center;
}

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

.teleport-profile-column {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(10, 17, 32, 0.62);
    padding: 12px;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.teleport-profile-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.teleport-profile-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.teleport-profile-entry {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.78);
}

.teleport-profile-entry strong {
    display: block;
    margin-bottom: 2px;
}

.teleport-profile-entry .hint {
    display: block;
}

.teleport-profile-empty {
    min-height: 120px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    color: var(--text-dim);
    text-align: center;
}

@media (max-width: 960px) {
    .teleport-profile-toolbar {
        grid-template-columns: 1fr;
    }

    .teleport-profile-columns {
        grid-template-columns: 1fr;
    }
}

.profile-kill-abilities-grid input:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

/* ── Builder: Readability ────────────────────────────────────────── */

/* Brighter, heavier labels across all world builder forms */
.world-structured-editor label,
.world-script-action-row label,
.world-stage-card label,
.world-objective-row label,
.world-nested-action-row label {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Card header row — subtle separator between header and form body */
.builder-row-header {
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 4px;
}

/* Script action rows: dynamic left border (color set via --action-color) */
.world-script-action-row {
    border-left: 3px solid var(--action-color, var(--accent));
}

/* Stage cards: warm amber left accent */
.world-stage-card {
    border-left: 3px solid var(--warning);
}

/* Objective rows: green left accent + darker background for contrast */
.world-objective-row {
    border-left: 3px solid rgba(34, 197, 94, 0.55);
    background: linear-gradient(170deg, rgba(12, 20, 36, 0.92), rgba(9, 16, 30, 0.96));
}

/* Action type pill badge */
.action-type-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 9px;
    border-radius: 5px;
    background: rgba(var(--action-color-rgb, 6, 182, 212), 0.14);
    color: var(--action-color, var(--accent));
    border: 1px solid rgba(var(--action-color-rgb, 6, 182, 212), 0.3);
    flex-shrink: 0;
    white-space: nowrap;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sub-section separator headings (Objectives, Steps, Rewards…) */
.builder-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Nested action list area (SEQUENCE / PARALLEL / TEMP_SCENE_SCOPE steps) */
[data-nested-actions-list] {
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 8px;
}

/* Nested action rows: deeper background than card */
.world-nested-action-row {
    background: rgba(8, 14, 26, 0.85);
    border-color: rgba(255, 255, 255, 0.07);
}

/* Inputs inside builder cards: slightly brighter border for visibility */
.world-script-action-row input,
.world-script-action-row select,
.world-script-action-row textarea,
.world-stage-card input,
.world-stage-card select,
.world-stage-card textarea {
    border-color: rgba(50, 65, 90, 0.9);
    background: rgba(14, 20, 34, 0.85);
}

.world-script-action-row input:focus,
.world-script-action-row select:focus,
.world-script-action-row textarea:focus,
.world-stage-card input:focus,
.world-stage-card select:focus,
.world-stage-card textarea:focus {
    border-color: rgba(6, 182, 212, 0.6);
}

/* ── Builder: Drag & Drop ─────────────────────────────────────── */
.drag-handle {
    cursor: grab;
    user-select: none;
    color: var(--text-muted, #64748b);
    font-size: 14px;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
}
.drag-handle:active { cursor: grabbing; }

.dnd-dragging { opacity: 0.35; }

.dnd-over-top    { box-shadow: 0 -2px 0 0 var(--accent, #06b6d4) !important; }
.dnd-over-bottom { box-shadow: 0 2px 0 0 var(--accent, #06b6d4) !important; }

/* ── Builder: Nested action (inside SEQUENCE/PARALLEL) ─────────── */
.world-nested-action-row {
    background: var(--bg-input, #1a2236);
    border: 1px solid var(--border, #1e293b);
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.world-nested-action-row.dnd-dragging { opacity: 0.3; }

/* ── Builder: Collapsed rows ──────────────────────────────────────  */
.world-script-action-row[data-collapsed="true"] [data-action-body],
.world-stage-card[data-collapsed="true"] [data-stage-body] {
    display: none;
}
.world-script-action-row[data-collapsed="true"],
.world-stage-card[data-collapsed="true"] {
    padding-bottom: 12px;
}


