/* ============================================================
   WorldDashboard — World-building orchestrator page
   "Ancient atlas / cartographer's table" identity
   ============================================================ */

.rw-world {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

/* ── Loom layout — dashboard + always-present capture rail ──
   Two-column grid: main dashboard content on the left, the Loom rail on the
   right. The rail is sticky inside its own column (see WorldLoomRail.razor.css).
   When the viewport narrows below the threshold the rail wraps below — the
   rail still renders, but no longer steals width from the dashboard. */

.rw-world-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.25rem;
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

.rw-world-layout > .rw-world {
    /* The layout wrapper owns max-width + padding now; the inner .rw-world keeps
       its chrome rules but stops double-constraining the column. */
    max-width: none;
    margin: 0;
    padding: 0;
}

@media (max-width: 1100px) {
    .rw-world-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .rw-room-focus {
        grid-template-columns: 1fr;
        grid-template-areas:
            "copy"
            "actions"
            "stats";
    }

    .rw-room-focus__stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ── Header panel ── */
.rw-world__header {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-bottom: 1.25rem;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(61, 138, 85, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(196, 160, 64, 0.05) 0%, transparent 50%),
        var(--rw-bg-panel);
    border: 1px solid var(--rw-border-narrative);
    border-radius: var(--rw-radius-lg);
    position: relative;
    min-height: 130px;
}

.rw-world__header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('/img/world-header-texture.webp') center/cover no-repeat;
    border-radius: inherit;
    opacity: 0.07;
    pointer-events: none;
}

/* ── Left: world identity ── */
.rw-world__identity {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.5rem 2rem;
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.rw-world__title {
    font-family: var(--rw-font-display);
    font-size: 1.8rem;
    color: var(--rw-gold-light);
    text-shadow: 0 0 30px rgba(196, 160, 64, 0.15);
    margin: 0 0 0.15rem 0;
    letter-spacing: 0.02em;
    line-height: 1.15;
}

.rw-world__subtitle {
    font-family: var(--rw-font-sc);
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--rw-gold);
    margin: 0 0 0.85rem 0;
}

/* ── Secondary action buttons ── */
.rw-world__secondary-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.rw-world__secondary-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    font-family: var(--rw-font-ui);
    font-size: 0.72rem;
    color: var(--rw-text-faint);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--rw-border);
    border-radius: var(--rw-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.rw-world__secondary-btn:hover {
    color: var(--rw-text);
    border-color: rgba(196, 160, 64, 0.25);
    background: rgba(196, 160, 64, 0.05);
}

.rw-world__secondary-btn--primary {
    border-color: rgba(196, 160, 64, 0.32);
    color: var(--rw-gold-light);
    background: rgba(196, 160, 64, 0.1);
}

.rw-world__secondary-btn--primary:hover {
    border-color: rgba(196, 160, 64, 0.48);
    background: rgba(196, 160, 64, 0.16);
}

/* ── Dropdown caret ── */
.rw-world__caret {
    transition: transform 0.2s ease;
    margin-left: 0.1rem;
}

.rw-world__caret--open {
    transform: rotate(180deg);
}

/* ── Create menu dropdown ── */
.rw-world__create-menu {
    position: relative;
}

.rw-world__create-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 180px;
    background: var(--rw-bg-panel);
    border: 1px solid var(--rw-border);
    border-radius: var(--rw-radius-md);
    box-shadow: var(--rw-shadow-deep);
    z-index: 100;
    padding: 0.3rem;
    animation: rw-world-menu-drop 0.15s ease;
}

@keyframes rw-world-menu-drop {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.rw-world__create-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: none;
    border-radius: var(--rw-radius-sm);
    background: transparent;
    color: var(--rw-text);
    font-family: var(--rw-font-body);
    font-size: 0.88rem;
    cursor: pointer;
    text-align: left;
    transition: all var(--rw-transition);
}

.rw-world__create-option:hover {
    background: rgba(61, 138, 85, 0.1);
    color: var(--rw-text-bright);
}

/* Hairline divider that separates the original Atlas/Pantheon/Library/Almanac
   create options from the Chronicle-room kinds added in Phase 2. */
.rw-world__create-divider {
    height: 1px;
    margin: 0.35rem 0.5rem;
    background: linear-gradient(90deg,
        transparent,
        rgba(196, 160, 64, 0.22) 30%,
        rgba(196, 160, 64, 0.22) 70%,
        transparent);
}

.rw-world__create-overlay {
    position: fixed;
    inset: 0;
    z-index: 99;
}

/* ── Right: storyboard gateway ── */
.rw-world__storyboard-cta {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    min-width: 280px;
    max-width: 340px;
    text-decoration: none;
    color: var(--rw-text);
    border-left: 1px solid rgba(61, 138, 85, 0.15);
    background:
        radial-gradient(ellipse at 70% 50%, rgba(61, 138, 85, 0.1) 0%, transparent 70%),
        radial-gradient(ellipse at 30% 80%, rgba(196, 160, 64, 0.04) 0%, transparent 60%);
    transition: all 0.3s ease;
    overflow: hidden;
    z-index: 1;
}

.rw-world__storyboard-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(61, 138, 85, 0.06) 0%, rgba(196, 160, 64, 0.04) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rw-world__storyboard-cta:hover::before {
    opacity: 1;
}

.rw-world__storyboard-cta:hover {
    border-left-color: rgba(61, 138, 85, 0.35);
}

.rw-world__storyboard-canvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.rw-world__storyboard-lines {
    width: 100%;
    height: 100%;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.rw-world__storyboard-cta:hover .rw-world__storyboard-lines {
    opacity: 1;
}

.rw-world__storyboard-lines circle {
    animation: rw-world-node-pulse 3s ease-in-out infinite;
}

.rw-world__storyboard-lines circle:nth-child(2) { animation-delay: 0.6s; }
.rw-world__storyboard-lines circle:nth-child(3) { animation-delay: 1.2s; }
.rw-world__storyboard-lines circle:nth-child(4) { animation-delay: 1.8s; }
.rw-world__storyboard-lines circle:nth-child(5) { animation-delay: 2.4s; }

@keyframes rw-world-node-pulse {
    0%, 100% { r: 4; opacity: 1; }
    50% { r: 5.5; opacity: 0.7; }
}

.rw-world__storyboard-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    position: relative;
    z-index: 1;
}

.rw-world__storyboard-label {
    font-family: var(--rw-font-display);
    font-size: 1.2rem;
    color: var(--rw-gold-light);
    letter-spacing: 0.02em;
    line-height: 1.15;
    text-shadow: 0 0 20px rgba(196, 160, 64, 0.15);
}

.rw-world__storyboard-desc {
    font-family: var(--rw-font-ui);
    font-size: 0.68rem;
    color: var(--rw-text-faint);
    letter-spacing: 0.04em;
}

.rw-world__storyboard-arrow {
    position: relative;
    z-index: 1;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(61, 138, 85, 0.1);
    border: 1px solid rgba(61, 138, 85, 0.25);
    color: var(--rw-verdant-bright);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.rw-world__storyboard-cta:hover .rw-world__storyboard-arrow {
    background: rgba(61, 138, 85, 0.18);
    border-color: rgba(61, 138, 85, 0.4);
    transform: translateX(3px);
}

/* ── Search & sort toolbar ── */
.rw-world__toolbar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: center;
}

.rw-world__search {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.rw-world__search-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--rw-text-faint);
    font-size: 0.95rem;
    pointer-events: none;
    opacity: 0.6;
}

.rw-world__search-input {
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 2.1rem;
    background: var(--rw-bg-bark);
    border: 1px solid var(--rw-border);
    border-radius: var(--rw-radius-md);
    color: var(--rw-text);
    font-family: var(--rw-font-body);
    font-size: 0.82rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.rw-world__search-input:focus {
    border-color: rgba(61, 138, 85, 0.35);
    box-shadow: 0 0 0 2px rgba(61, 138, 85, 0.08);
}

.rw-world__search-input::placeholder {
    color: var(--rw-text-faint);
    opacity: 0.7;
}

.rw-world__search-clear {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--rw-text-faint);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.15rem 0.3rem;
    line-height: 1;
    border-radius: var(--rw-radius-sm);
    transition: all 0.15s ease;
}

.rw-world__search-clear:hover {
    color: var(--rw-text);
    background: rgba(255, 255, 255, 0.05);
}

.rw-world__sort-select {
    padding: 0.5rem 0.7rem;
    background: var(--rw-bg-bark);
    border: 1px solid var(--rw-border);
    border-radius: var(--rw-radius-md);
    color: var(--rw-text);
    font-family: var(--rw-font-ui);
    font-size: 0.78rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
    min-width: 130px;
}

.rw-world__sort-select:focus {
    border-color: rgba(61, 138, 85, 0.35);
}

.rw-world__sort-select option {
    background: var(--rw-bg-panel);
    color: var(--rw-text);
}

/* ── Empty room placeholder — shown for rooms with no wired entity surfaces yet
      (Chronicle in Phase 1; fills in Phase 2). Quiet, codex-flavored copy with a
      large sigil so the GM doesn't read it as a 404. ── */
.rw-room-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 60px 32px;
    margin: 16px 0;
    background:
        linear-gradient(180deg, rgba(30, 60, 66, 0.32) 0%, rgba(11, 24, 32, 0.92) 100%),
        var(--rw-bg-panel);
    border: 1px dashed rgba(196, 160, 64, 0.28);
    border-radius: 5px;
    text-align: center;
}

.rw-room-empty__sigil {
    font-size: 48px;
    line-height: 1;
    color: var(--rw-gold);
    filter: drop-shadow(0 0 12px rgba(236, 208, 106, 0.35));
}

.rw-room-empty__title {
    margin: 0;
    font-family: var(--rw-font-display);
    font-size: 22px;
    color: var(--rw-sage-cream);
    letter-spacing: 0.02em;
}

.rw-room-empty__blurb {
    margin: 0;
    max-width: 540px;
    font-family: var(--rw-font-body);
    font-style: italic;
    color: var(--rw-sage-muted);
    line-height: 1.55;
    font-size: 13.5px;
}

/* ── Room focus band — one clear room-level next action before the grid ── */
.rw-room-focus {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "copy stats"
        "actions stats";
    gap: 0.85rem 1rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid rgba(196, 160, 64, 0.2);
    border-left: 3px solid var(--rw-gold);
    border-radius: var(--rw-radius-md);
    background:
        radial-gradient(ellipse at 12% 0%, rgba(196, 160, 64, 0.08), transparent 55%),
        linear-gradient(135deg, rgba(30, 60, 66, 0.2), rgba(11, 24, 32, 0.84)),
        var(--rw-bg-panel);
}

.rw-room-focus--pantheon {
    border-left-color: var(--rw-gold-light);
}

.rw-room-focus--chronicle {
    border-left-color: var(--rw-arcane-cyan);
}

.rw-room-focus__copy {
    grid-area: copy;
    min-width: 0;
}

.rw-room-focus__eyebrow {
    display: block;
    margin-bottom: 0.2rem;
    font-family: var(--rw-font-sc);
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--rw-gold);
}

.rw-room-focus__title {
    margin: 0;
    font-family: var(--rw-font-display);
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--rw-text-bright);
    line-height: 1.2;
}

.rw-room-focus__detail {
    margin: 0.25rem 0 0;
    color: var(--rw-text);
    font-size: 0.86rem;
    line-height: 1.4;
}

.rw-room-focus__actions {
    grid-area: actions;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.rw-room-focus__action,
.rw-artifact-grid__empty-actions .rw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0.42rem 0.72rem;
    border: 1px solid rgba(196, 160, 64, 0.24);
    border-radius: var(--rw-radius-sm);
    background: rgba(0, 0, 0, 0.16);
    color: var(--rw-text);
    font-family: var(--rw-font-sc);
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.rw-room-focus__action:hover,
.rw-artifact-grid__empty-actions .rw-btn:hover {
    border-color: rgba(196, 160, 64, 0.5);
    background: rgba(196, 160, 64, 0.08);
    color: var(--rw-text-bright);
}

.rw-room-focus__action--primary {
    border-color: rgba(196, 160, 64, 0.55);
    background: rgba(196, 160, 64, 0.12);
    color: var(--rw-gold-light);
}

.rw-room-focus__stats {
    grid-area: stats;
    display: grid;
    grid-template-columns: repeat(3, minmax(58px, 1fr));
    gap: 0.5rem;
    margin: 0;
}

.rw-room-focus__stats div {
    min-width: 0;
    padding: 0.55rem 0.65rem;
    border: 1px solid rgba(196, 160, 64, 0.12);
    border-radius: var(--rw-radius-sm);
    background: rgba(0, 0, 0, 0.18);
    text-align: center;
}

.rw-room-focus__stats dt {
    margin: 0 0 0.12rem;
    font-family: var(--rw-font-sc);
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--rw-text-faint);
}

.rw-room-focus__stats dd {
    margin: 0;
    font-family: var(--rw-font-display);
    font-size: 1.15rem;
    color: var(--rw-gold-light);
    line-height: 1;
}

.rw-artifact-grid__empty-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* ── Filter tab bar (inlined here; shared pattern lives in ArtifactFilterBar scoped CSS) ── */
.rw-filter-bar {
    margin-bottom: 1.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.rw-filter-bar::-webkit-scrollbar { display: none; }

.rw-filter-bar__tabs {
    display: flex;
    gap: 2px;
    padding: 3px;
    background: var(--rw-bg-bark);
    border: 1px solid var(--rw-border);
    border-radius: var(--rw-radius-md);
}

.rw-filter-bar__tab {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border: none;
    border-radius: var(--rw-radius-sm);
    background: transparent;
    color: var(--rw-text-faint);
    font-family: var(--rw-font-sc);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--rw-transition);
    position: relative;
}

.rw-filter-bar__tab:hover {
    color: var(--rw-text-dim);
    background: rgba(255, 255, 255, 0.03);
}

.rw-filter-bar__tab--active {
    color: var(--rw-gold-light);
    background: var(--rw-bg-panel);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.rw-filter-bar__tab--active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: var(--rw-gold);
    border-radius: 1px 1px 0 0;
}

.rw-filter-bar__tab-icon {
    font-size: 0.85rem;
    line-height: 1;
}

.rw-filter-bar__tab-label {
    line-height: 1;
}

.rw-filter-bar__tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 0.62rem;
    font-family: var(--rw-font-ui);
    letter-spacing: 0;
    text-transform: none;
    border-radius: var(--rw-radius-pill);
    background: rgba(196, 160, 64, 0.1);
    color: var(--rw-gold);
}

.rw-filter-bar__tab--active .rw-filter-bar__tab-count {
    background: rgba(196, 160, 64, 0.18);
    color: var(--rw-gold-light);
}

/* World-content tab accents */
.rw-filter-bar__tab--active[data-filter="locations"]::after { background: var(--rw-verdant); }
.rw-filter-bar__tab--active[data-filter="npcs"]::after { background: var(--rw-gold-light); }
.rw-filter-bar__tab--active[data-filter="factions"]::after { background: var(--rw-blood-bright); }
.rw-filter-bar__tab--active[data-filter="lore"]::after { background: var(--rw-arcane-blue); }
.rw-filter-bar__tab--active[data-filter="deities"]::after { background: var(--rw-gold); }
.rw-filter-bar__tab--active[data-filter="calendars"]::after { background: var(--rw-verdant-bright); }

/* ── Artifact grid ── */
.rw-artifact-grid {
    margin-bottom: 1.5rem;
}

.rw-artifact-grid__cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.rw-artifact-grid__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    border: 1px dashed var(--rw-border);
    border-radius: var(--rw-radius-lg);
    background: rgba(0, 0, 0, 0.08);
}

.rw-artifact-grid__empty-icon {
    font-size: 2rem;
    color: var(--rw-text-faint);
    opacity: 0.4;
    margin-bottom: 0.5rem;
}

.rw-artifact-grid__empty-text {
    font-family: var(--rw-font-display);
    font-size: 1.1rem;
    color: var(--rw-text-dim);
    margin: 0 0 0.25rem 0;
}

.rw-artifact-grid__empty-hint {
    font-family: var(--rw-font-ui);
    font-size: 0.82rem;
    color: var(--rw-text-faint);
    margin: 0;
}

/* ── Section dividers (between type groups in "All" view) ── */
.rw-section-divider {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0 0.25rem;
    margin-top: 0.35rem;
}

.rw-section-divider:first-child {
    margin-top: 0;
    padding-top: 0;
}

.rw-section-divider__icon {
    font-size: 0.8rem;
    opacity: 0.5;
    line-height: 1;
    color: var(--rw-gold);
}

.rw-section-divider__label {
    font-family: var(--rw-font-sc);
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--rw-text-dim);
}

.rw-section-divider__count {
    font-family: var(--rw-font-ui);
    font-size: 0.62rem;
    color: var(--rw-text-faint);
    opacity: 0.6;
    padding: 0 0.35rem;
    border-radius: var(--rw-radius-pill);
    background: rgba(196, 160, 64, 0.06);
}

.rw-section-divider__line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--rw-border) 0%, transparent 100%);
    opacity: 0.7;
}

/* ── Artifact cards ── */
.rw-artifact-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.85rem 1rem;
    background: var(--rw-bg-panel);
    border: 1px solid var(--rw-border);
    border-radius: var(--rw-radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.rw-artifact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 3px;
    transition: opacity var(--rw-transition);
}

/* Type-tinted left accent + background whisper */
.rw-artifact-card--location::before { background: var(--rw-verdant); }
.rw-artifact-card--npc::before      { background: var(--rw-gold-light); }
.rw-artifact-card--faction::before  { background: var(--rw-blood-bright); }
.rw-artifact-card--lore::before     { background: var(--rw-arcane-blue); }
.rw-artifact-card--deity::before    { background: var(--rw-gold); }
.rw-artifact-card--calendar::before   { background: var(--rw-verdant-bright); }
/* ── Chronicle room (Phase 2) ── */
.rw-artifact-card--adventure::before  { background: var(--rw-arcane-purple); }
.rw-artifact-card--plotthread::before { background: var(--rw-arcane-cyan); }
.rw-artifact-card--rumor::before      { background: var(--rw-sage-tan); }
/* ── Atlas / Pantheon / Library additions (Phase 3) ── */
.rw-artifact-card--region::before     { background: var(--rw-verdant); }
.rw-artifact-card--settlement::before { background: var(--rw-gold); }
.rw-artifact-card--plane::before      { background: var(--rw-arcane-purple); }
.rw-artifact-card--religion::before   { background: var(--rw-blood-bright); }
.rw-artifact-card--handout::before    { background: var(--rw-sage-tan); }
.rw-artifact-card--language::before   { background: var(--rw-arcane-cyan); }
.rw-artifact-card--curse::before      { background: var(--rw-blood-bright); }

.rw-artifact-card--location {
    background: linear-gradient(135deg, var(--rw-bg-panel) 80%, rgba(61, 138, 85, 0.04));
}
.rw-artifact-card--npc {
    background: linear-gradient(135deg, var(--rw-bg-panel) 80%, rgba(218, 184, 85, 0.04));
}
.rw-artifact-card--faction {
    background: linear-gradient(135deg, var(--rw-bg-panel) 80%, rgba(184, 58, 26, 0.04));
}
.rw-artifact-card--lore {
    background: linear-gradient(135deg, var(--rw-bg-panel) 80%, rgba(58, 128, 168, 0.04));
}
.rw-artifact-card--deity {
    background: linear-gradient(135deg, var(--rw-bg-panel) 80%, rgba(196, 160, 64, 0.04));
}
.rw-artifact-card--calendar {
    background: linear-gradient(135deg, var(--rw-bg-panel) 80%, rgba(61, 138, 85, 0.04));
}
.rw-artifact-card--adventure {
    background: linear-gradient(135deg, var(--rw-bg-panel) 80%, rgba(132, 98, 168, 0.05));
}
.rw-artifact-card--plotthread {
    background: linear-gradient(135deg, var(--rw-bg-panel) 80%, rgba(98, 168, 188, 0.05));
}
.rw-artifact-card--rumor {
    background: linear-gradient(135deg, var(--rw-bg-panel) 80%, rgba(192, 168, 128, 0.04));
}
.rw-artifact-card--region {
    background: linear-gradient(135deg, var(--rw-bg-panel) 80%, rgba(61, 138, 85, 0.04));
}
.rw-artifact-card--settlement {
    background: linear-gradient(135deg, var(--rw-bg-panel) 80%, rgba(196, 160, 64, 0.04));
}
.rw-artifact-card--plane {
    background: linear-gradient(135deg, var(--rw-bg-panel) 80%, rgba(132, 98, 168, 0.05));
}
.rw-artifact-card--religion {
    background: linear-gradient(135deg, var(--rw-bg-panel) 80%, rgba(184, 58, 26, 0.04));
}
.rw-artifact-card--handout {
    background: linear-gradient(135deg, var(--rw-bg-panel) 80%, rgba(192, 168, 128, 0.04));
}
.rw-artifact-card--language {
    background: linear-gradient(135deg, var(--rw-bg-panel) 80%, rgba(98, 168, 188, 0.05));
}
.rw-artifact-card--curse {
    background: linear-gradient(135deg, var(--rw-bg-panel) 80%, rgba(184, 58, 26, 0.05));
}

.rw-artifact-card:hover {
    border-color: rgba(196, 160, 64, 0.2);
    transform: translateY(-2px);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(196, 160, 64, 0.04);
}

.rw-artifact-card--location:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 25px rgba(61, 138, 85, 0.1);
    border-color: rgba(61, 138, 85, 0.2);
}
.rw-artifact-card--npc:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 25px rgba(218, 184, 85, 0.08);
}
.rw-artifact-card--faction:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 25px rgba(184, 58, 26, 0.1);
    border-color: rgba(184, 58, 26, 0.2);
}
.rw-artifact-card--lore:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 25px rgba(58, 128, 168, 0.1);
    border-color: rgba(58, 128, 168, 0.2);
}
.rw-artifact-card--deity:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 25px rgba(196, 160, 64, 0.1);
}
.rw-artifact-card--calendar:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 25px rgba(61, 138, 85, 0.1);
    border-color: rgba(61, 138, 85, 0.2);
}
.rw-artifact-card--adventure:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 25px rgba(132, 98, 168, 0.12);
    border-color: rgba(132, 98, 168, 0.22);
}
.rw-artifact-card--plotthread:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 25px rgba(98, 168, 188, 0.12);
    border-color: rgba(98, 168, 188, 0.22);
}
.rw-artifact-card--rumor:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 25px rgba(192, 168, 128, 0.1);
    border-color: rgba(192, 168, 128, 0.2);
}
.rw-artifact-card--region:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 25px rgba(61, 138, 85, 0.1);
    border-color: rgba(61, 138, 85, 0.2);
}
.rw-artifact-card--settlement:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 25px rgba(196, 160, 64, 0.12);
    border-color: rgba(196, 160, 64, 0.22);
}
.rw-artifact-card--plane:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 25px rgba(132, 98, 168, 0.12);
    border-color: rgba(132, 98, 168, 0.22);
}
.rw-artifact-card--religion:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 25px rgba(184, 58, 26, 0.1);
    border-color: rgba(184, 58, 26, 0.2);
}
.rw-artifact-card--handout:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 25px rgba(192, 168, 128, 0.1);
    border-color: rgba(192, 168, 128, 0.2);
}
.rw-artifact-card--language:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 25px rgba(98, 168, 188, 0.12);
    border-color: rgba(98, 168, 188, 0.22);
}
.rw-artifact-card--curse:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 25px rgba(184, 58, 26, 0.12);
    border-color: rgba(184, 58, 26, 0.22);
}

.rw-artifact-card__header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.rw-artifact-card__type-icon {
    font-size: 0.9rem;
    line-height: 1;
}

.rw-artifact-card__type-label {
    font-family: var(--rw-font-sc);
    font-size: 0.62rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--rw-text-faint);
    flex: 1;
}

.rw-artifact-card__title {
    font-family: var(--rw-font-display);
    font-size: 1rem;
    font-weight: 400;
    color: var(--rw-text-bright);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rw-artifact-card__subtitle {
    font-family: var(--rw-font-body);
    font-size: 0.82rem;
    color: var(--rw-text-dim);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rw-artifact-card__details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.15rem;
}

.rw-artifact-card__detail {
    font-family: var(--rw-font-ui);
    font-size: 0.7rem;
    color: var(--rw-text-faint);
    padding: 0.1rem 0.4rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--rw-radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.rw-artifact-card__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 0.25rem;
}

.rw-artifact-card__date {
    font-family: var(--rw-font-ui);
    font-size: 0.68rem;
    color: var(--rw-text-faint);
}

/* Image-forward variant — horizontal layout with the image occupying the left
   ~22% of the card and the details filling the rest. Only applied when an image
   is actually present; image-less cards fall back to the normal full-width layout. */
.rw-artifact-card--visual {
    padding: 0;
    overflow: hidden;
    gap: 0;
    flex-direction: row;
    align-items: stretch;
}

.rw-artifact-card--visual .rw-artifact-card__media {
    position: relative;
    flex: 0 0 22%;
    min-width: 110px;
    max-width: 160px;
    background: var(--rw-bg-bark);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rw-artifact-card--visual .rw-artifact-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.rw-artifact-card--visual:hover .rw-artifact-card__media img {
    transform: scale(1.04);
}

.rw-artifact-card__portrait-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90px;
}

.rw-artifact-card__portrait-initial {
    font-size: 2rem;
    font-weight: 700;
    color: rgba(232, 217, 176, 0.55);
    font-family: var(--rw-font-display, serif);
    user-select: none;
    line-height: 1;
}

.rw-artifact-card--visual .rw-artifact-card__body {
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}

/* When no image is present, the card doesn't carry the --visual class and keeps the
   standard vertical layout — but it still has a __body wrapper, which we just let
   span the full card with no extra padding of its own. */
.rw-artifact-card:not(.rw-artifact-card--visual) .rw-artifact-card__body {
    display: contents;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .rw-world__storyboard-cta {
        min-width: 220px;
        max-width: 260px;
        padding: 1rem 1.25rem;
    }

    .rw-world__storyboard-label {
        font-size: 1rem;
    }
}

@media (max-width: 640px) {
    .rw-world__header {
        flex-direction: column;
        gap: 0;
    }

    .rw-world__identity {
        padding: 1.25rem 1.25rem 0.75rem;
    }

    .rw-world__title {
        font-size: 1.4rem;
    }

    .rw-world__storyboard-cta {
        min-width: unset;
        max-width: unset;
        border-left: none;
        border-top: 1px solid rgba(61, 138, 85, 0.15);
        padding: 1rem 1.25rem;
    }

    .rw-world__toolbar {
        flex-direction: column;
        gap: 0.5rem;
    }

    .rw-world__sort-select {
        width: 100%;
    }

    .rw-filter-bar__tab {
        padding: 0.4rem 0.6rem;
    }

    .rw-filter-bar__tab-label {
        display: none;
    }

    .rw-filter-bar__tab-icon {
        font-size: 1rem;
    }

    .rw-artifact-grid__cards {
        grid-template-columns: 1fr;
    }
}

