/* world.css — split from main.css by scripts/split-main-css.js.
   Hunter world map, side panel, world team editor and world battle modal. Loaded by world.html only.
   Edit these files directly; main.css no longer exists. */

body.has-nav-xp-progress:not(.dungeon-page):not(.world-page) {
    padding-bottom: var(--nav-xp-progress-height);
}

/* Hunter world prototype */
body.world-page {
    --world-panel-bg: rgba(5,13,16,0.78);
    --world-panel-border: rgba(161,212,201,0.2);
    display: block;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 8%, rgba(111,214,189,0.12), transparent 24rem),
        radial-gradient(circle at 86% 12%, rgba(156,122,200,0.1), transparent 22rem),
        linear-gradient(rgba(4,9,12,0.68), rgba(4,9,12,0.86)),
        url("/app/images/assets/background/amongdemons_dungeon.png") center / cover no-repeat,
        var(--ad-bg, #071013);
    color: var(--ad-text, #eef8f5);
    overscroll-behavior: none;
}

body.world-page > .game-shell-nav {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 30;
    background:
        linear-gradient(180deg, rgba(4,10,13,0.92), rgba(4,10,13,0.62)),
        rgba(4,10,13,0.62) !important;
    backdrop-filter: blur(12px);
}

.world-shell {
    position: fixed;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-width: 0;
    min-height: 0;
    padding: 0;
}

.world-map-panel,
.world-side-panel {
    position: relative;
    min-width: 0;
    min-height: 0;
    border: 1px solid var(--world-panel-border);
    background:
        linear-gradient(180deg, rgba(111,214,189,0.045), transparent 28%),
        radial-gradient(circle at 50% 0%, rgba(232,199,106,0.06), transparent 42%),
        rgba(4,10,13,0.72);
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.025),
        0 24px 62px rgba(0,0,0,0.42);
}

.world-map-panel {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    border: 0;
    background:
        radial-gradient(circle at 50% 50%, rgba(111,214,189,0.05), transparent 34rem),
        linear-gradient(135deg, rgba(3,8,11,0.92), rgba(8,15,18,0.86));
    box-shadow: none;
}

.world-side-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border: 1px solid rgba(232,199,106,0.08);
    pointer-events: none;
}

.world-canvas-host {
    position: absolute;
    inset: 0;
    outline: 0;
    touch-action: none;
    cursor: grab;
}

.world-canvas-host:active {
    cursor: grabbing;
}

.world-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.world-hover-coordinates {
    position: absolute;
    z-index: 4;
    display: grid;
    grid-template-columns: 3ch 1.2ch 3ch;
    align-items: center;
    width: max-content;
    color: rgba(185, 215, 239, 0.78);
    padding: 0.08rem 0.12rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.62rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    transform: translate(-50%, -100%) translateY(0.08rem);
    pointer-events: none;
    user-select: none;
}

.world-hover-coordinate {
    white-space: nowrap;
}

.world-hover-coordinate-x {
    text-align: right;
}

.world-hover-coordinate-y {
    text-align: left;
}

.world-hover-coordinate-dot {
    color: rgba(111, 143, 170, 0.9);
    text-align: center;
}

.world-hover-coordinates.is-below {
    transform: translate(-50%, 0) translateY(-0.08rem);
}

.world-map-status {
    position: absolute;
    left: 0.85rem;
    bottom: calc(0.75rem + var(--nav-xp-progress-height, 0rem));
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    max-width: calc(100% - 1.5rem);
}

.world-map-status > span {
    display: inline-flex;
    align-items: center;
    gap: 0.36rem;
    min-height: 2rem;
    border: 1px solid rgba(161,212,201,0.2);
    border-radius: 6px;
    background:
        linear-gradient(180deg, rgba(111,214,189,0.08), rgba(255,255,255,0.015)),
        rgba(3,8,11,0.76);
    color: rgba(220,232,229,0.86);
    padding: 0.32rem 0.58rem;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 10px 24px rgba(0,0,0,0.34);
}

.world-map-controls {
    position: absolute;
    top: calc(var(--game-nav-height, 3.6rem) + 0.85rem);
    right: calc(min(23rem, calc(100vw - 1.7rem)) + 1.3rem);
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.45rem;
    pointer-events: none;
}

body.is-world-side-collapsed .world-map-controls {
    right: calc(min(14.5rem, calc(100vw - 1.7rem)) + 1.3rem);
}

.world-position-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    min-width: 3rem;
    min-height: 3rem;
    border: 1px solid rgba(161,212,201,0.16);
    border-radius: 7px;
    background:
        linear-gradient(180deg, rgba(111,214,189,0.1), rgba(255,255,255,0.02)),
        rgba(3,8,11,0.9);
    color: rgba(143,239,225,0.9);
    padding: 0;
    font: inherit;
    line-height: 1;
    box-shadow:
        0 14px 30px rgba(0,0,0,0.42),
        inset 0 0 0 1px rgba(255,255,255,0.045);
    cursor: pointer;
    pointer-events: auto;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
}

.world-position-button:hover,
.world-position-button:focus-visible {
    border-color: rgba(111,214,189,0.52);
    background:
        linear-gradient(180deg, rgba(111,214,189,0.14), rgba(255,255,255,0.035)),
        rgba(3,8,11,0.94);
    color: #effffc;
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.05),
        0 0 16px rgba(111,214,189,0.16),
        0 14px 30px rgba(0,0,0,0.42);
    outline: 0;
}

.world-map-status .ad-icon,
.world-position-button .ad-icon {
    width: 0.92rem;
    height: 0.92rem;
    margin: 0;
    color: var(--ad-gold, #e8c76a);
}

.world-position-button .ad-icon {
    width: 1.05rem;
    height: 1.05rem;
    color: currentColor;
}

.world-target-tooltip {
    position: absolute;
    z-index: 4;
    width: max-content;
    min-width: 9rem;
    max-width: min(22rem, calc(100vw - 1.5rem));
    border: 1px solid rgba(177,132,63,0.56);
    border-radius: 7px;
    background:
        linear-gradient(180deg, rgba(232,199,106,0.07), rgba(0,0,0,0.04)),
        rgba(4,8,8,0.94);
    color: #f5e7c5;
    padding: 0.58rem 0.72rem 0.62rem;
    box-shadow: 0 14px 30px rgba(0,0,0,0.52);
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    text-transform: none;
    display: grid;
    gap: 0.2rem;
    transform: translate(-50%, -100%) translateY(-0.48rem);
    pointer-events: none;
}

.world-target-tooltip.has-actions {
    pointer-events: auto;
}

.world-encounter-tooltip {
    position: absolute;
    z-index: 5;
    width: max-content;
    min-width: 12rem;
    max-width: min(23rem, calc(100vw - 1.5rem));
    border: 1px solid rgba(177,132,63,0.58);
    border-radius: 7px;
    background:
        linear-gradient(180deg, rgba(232,199,106,0.07), rgba(0,0,0,0.05)),
        rgba(4,8,8,0.95);
    color: #f5e7c5;
    padding: 0.64rem 0.78rem 0.72rem;
    box-shadow: 0 16px 34px rgba(0,0,0,0.56);
    transform: translate(-50%, -100%) translateY(-0.55rem);
    pointer-events: none;
    text-align: left;
    display: grid;
    justify-items: center;
    gap: 0.38rem;
}

.world-target-tooltip::after,
.world-encounter-tooltip::after,
.world-hunt-tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -5px;
    width: 10px;
    height: 10px;
    border-right: 1px solid rgba(177,132,63,0.56);
    border-bottom: 1px solid rgba(177,132,63,0.56);
    background: rgba(4,8,8,0.95);
    transform: translateX(-50%) rotate(45deg);
    pointer-events: none;
}

.world-hunt-tooltip {
    position: absolute;
    z-index: 5;
    width: max-content;
    min-width: 8.5rem;
    border: 1px solid rgba(232,199,106,0.48);
    border-radius: 7px;
    background:
        linear-gradient(180deg, rgba(232,199,106,0.08), rgba(0,0,0,0.05)),
        rgba(4,8,8,0.95);
    color: #f5e7c5;
    padding: 0.52rem 0.7rem 0.6rem;
    box-shadow: 0 14px 30px rgba(0,0,0,0.54);
    transform: translate(-50%, -100%) translateY(-0.55rem);
    pointer-events: none;
    text-align: center;
    display: grid;
    justify-items: center;
    gap: 0.14rem;
}

.world-hunt-tooltip::after {
    border-right-color: rgba(232,199,106,0.48);
    border-bottom-color: rgba(232,199,106,0.48);
}

.world-hunt-timer {
    color: #fff;
    font-family: "Courier New", monospace;
    font-size: 1.18rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.04em;
    text-shadow: 0 0 12px rgba(232,199,106,0.36);
}

.world-hunt-next {
    color: rgba(232,199,106,0.84);
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.world-hunt-rewards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    margin-top: 0.42rem;
}

.world-hunt-stat {
    display: grid;
    align-content: start;
    gap: 0.08rem;
    border: 1px solid rgba(161,212,201,0.14);
    border-radius: 6px;
    background: rgba(0,0,0,0.18);
    padding: 0.38rem 0.45rem;
}

.world-hunt-stat.is-accrued {
    border-color: rgba(141,231,255,0.32);
    background:
        linear-gradient(180deg, rgba(141,231,255,0.08), rgba(0,0,0,0.04)),
        rgba(0,0,0,0.2);
}

.world-hunt-stat-label {
    color: rgba(226,207,164,0.72);
    font-size: 0.54rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.world-hunt-stat-value {
    color: #fff3bd;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1.15;
}

.world-hunt-stat.is-accrued .world-hunt-stat-value {
    color: #cdf3ff;
}

.world-hunt-stat-note {
    color: rgba(220,232,229,0.56);
    font-size: 0.57rem;
    font-weight: 700;
    line-height: 1.2;
}

.world-tooltip-title {
    color: #fff0b8;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.92rem;
    font-weight: 900;
    line-height: 1.05;
}

.world-tooltip-title.world-encounter-title {
    justify-content: center;
    max-width: 100%;
}

.world-tooltip-meta {
    color: rgba(226,207,164,0.74);
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
}

.world-tooltip-hint {
    justify-self: center;
    margin-top: 0.12rem;
    padding-top: 0.32rem;
    width: 100%;
    border-top: 1px solid rgba(177,132,63,0.2);
    color: rgba(226,207,164,0.54);
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    letter-spacing: 0.02em;
}

.world-target-coords {
    color: rgba(226,207,164,0.74);
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1.15;
}

.world-target-event-type {
    color: var(--ad-gold, #e8c76a);
    font-size: 0.62rem;
    font-weight: 900;
    line-height: 1;
    margin-top: 0.22rem;
    padding-top: 0.38rem;
    border-top: 1px solid rgba(177,132,63,0.22);
    text-transform: uppercase;
}

.world-target-event-title {
    color: #f5e7c5;
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1.1;
}

.world-target-event-copy {
    max-width: 15rem;
    color: rgba(220,232,229,0.66);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.35;
}

.world-target-summon-cost {
    margin-top: 0.28rem;
    color: rgba(232,199,106,0.86);
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1;
}

.world-target-summon-button {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.32rem;
    margin-top: 0.12rem;
    pointer-events: auto;
}

.world-target-summon-button .ad-icon {
    width: 0.86rem;
    height: 0.86rem;
    margin: 0;
}

.world-enc-demons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.34rem;
    margin-top: 0.08rem;
}

.world-team-demons.world-enc-demons,
.world-enemy-demons.world-enc-demons,
.world-hunt-assigned-demons.world-enc-demons,
.world-hunt-target-demons.world-enc-demons {
    justify-content: flex-start;
    margin-top: 0;
}

.world-enc-demon {
    display: inline-flex;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    padding: 2px;
    background: rgba(255,255,255,0.04);
    border: 2px solid var(--rarity-color, #D1D5D8);
    box-shadow: 0 0 8px color-mix(in srgb, var(--rarity-color, #D1D5D8) 40%, transparent);
}

.world-enc-demon img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.world-enc-demon-overflow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(232,199,106,0.34);
    border-radius: 50%;
    background: rgba(0,0,0,0.26);
    color: #fff3bd;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
}

.world-enc-difficulty {
    --difficulty-color: #e8c76a;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    margin-top: 0.1rem;
    color: rgba(226,207,164,0.78);
    font-size: 0.66rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.world-enc-difficulty-label {
    color: #f0c96d;
}

.world-enc-meter {
    display: inline-flex;
    gap: 2px;
}

.world-enc-difficulty.is-easy {
    --difficulty-color: #41A85F;
}

.world-enc-difficulty.is-medium {
    --difficulty-color: #e8c76a;
}

.world-enc-difficulty.is-hard {
    --difficulty-color: #E25041;
}

.world-enc-pip {
    width: 6px;
    height: 11px;
    border-radius: 2px;
    background: rgba(255,255,255,0.12);
}

.world-enc-pip.is-on {
    background: linear-gradient(180deg, color-mix(in srgb, var(--difficulty-color) 72%, #ffffff), var(--difficulty-color));
    box-shadow: 0 0 6px color-mix(in srgb, var(--difficulty-color) 48%, transparent);
}

.world-loading {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    place-items: center;
    background: rgba(3,8,11,0.88);
    color: rgba(220,232,229,0.74);
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.world-side-panel {
    position: fixed;
    top: calc(var(--game-nav-height, 3.6rem) + 0.85rem);
    right: 0.85rem;
    bottom: auto;
    z-index: 10;
    display: flex;
    flex-direction: column;
    width: min(23rem, calc(100vw - 1.7rem));
    max-height: calc(100dvh - var(--game-nav-height, 3.6rem) - 1.7rem - var(--nav-xp-progress-height, 0rem));
    overflow: hidden;
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(111,214,189,0.06), transparent 32%),
        rgba(3,8,11,0.72);
    padding: 0;
    backdrop-filter: blur(14px);
}

.world-side-toggle {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    width: 100%;
    min-height: 3rem;
    border: 0;
    border-bottom: 1px solid rgba(161,212,201,0.16);
    background:
        linear-gradient(180deg, rgba(111,214,189,0.1), rgba(255,255,255,0.02)),
        rgba(3,8,11,0.9);
    color: rgba(143,239,225,0.86);
    padding: 0.72rem 0.95rem;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.world-side-toggle:hover,
.world-side-toggle:focus-visible {
    color: #effffc;
    outline: 0;
}

.world-side-status-copy {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-align: left;
}

.world-side-status-copy > span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.world-side-status-copy > small {
    display: none;
    color: rgba(220,232,229,0.62);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}

.world-side-status-copy > span,
.world-side-status-copy > small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.world-side-toggle .ad-icon {
    flex: 0 0 auto;
    width: 0.92rem;
    height: 0.92rem;
    margin: 0;
    transition: transform 180ms ease;
}

.world-side-content {
    display: flex;
    flex-direction: column;
    gap: 0.66rem;
    min-width: 0;
    min-height: 0;
    max-height: calc(100% - 3rem);
    overflow: hidden auto;
    padding: 0.7rem;
}

.world-side-panel.is-collapsed {
    top: calc(var(--game-nav-height, 3.6rem) + 0.85rem);
    right: 0.85rem;
    bottom: auto;
    left: auto;
    width: min(14.5rem, calc(100vw - 1.7rem));
    max-height: calc(3rem + env(safe-area-inset-bottom, 0px));
}

.world-side-panel.is-collapsed .world-side-toggle {
    border-bottom: 0;
    border-radius: 8px;
}

.world-side-panel.is-collapsed .world-side-content {
    display: none;
}

.world-side-panel:not(.is-collapsed) .world-side-toggle .ad-icon {
    transform: rotate(180deg);
}

@media (min-width: 900px) {
.world-side-panel.is-collapsed .world-side-toggle .ad-icon {
        transform: rotate(180deg);
    }

.world-side-panel:not(.is-collapsed) .world-side-toggle .ad-icon {
        transform: none;
    }
}

.world-side-content > section {
    display: grid;
    gap: 0.44rem;
    min-width: 0;
}

.world-side-content > section + section {
    border-top: 1px solid rgba(161,212,201,0.08);
    padding-top: 0.64rem;
}

.world-side-content > section[aria-labelledby="worldTeamHeading"] {
    margin-top: 1rem;
}

.world-block-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
}

.world-block-heading h2 {
    margin: 0;
    color: rgba(220,232,229,0.92);
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.world-icon-button {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(161,212,201,0.2);
    border-radius: 6px;
    background: rgba(5,13,16,0.7);
    color: rgba(220,232,229,0.78);
}

.world-icon-button:hover,
.world-icon-button:focus-visible {
    border-color: rgba(111,214,189,0.48);
    background: rgba(111,214,189,0.1);
    color: #effffc;
    outline: 0;
}

.world-icon-button .ad-icon {
    width: 0.95rem;
    height: 0.95rem;
    margin: 0;
}

.world-panel-link {
    color: var(--ad-teal, #6fd6bd);
    font-size: 0.68rem;
    font-weight: 900;
    text-decoration: none;
    text-transform: uppercase;
}

.world-panel-link:hover,
.world-panel-link:focus-visible {
    color: #a5ead9;
    text-decoration: none;
}

.world-panel-link-button {
    border: 0;
    background: transparent;
    padding: 0;
    line-height: 1;
    cursor: pointer;
}

.world-side-panel .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.34rem;
    min-height: 2rem;
    border-radius: 5px;
    font-size: 0.66rem;
    font-weight: 900;
    line-height: 1;
}

.world-side-panel .btn .ad-icon {
    width: 0.82rem;
    height: 0.82rem;
    margin: 0;
}

.world-side-panel[data-world-status="hunting"] #worldTeamHeading {
    color: rgba(220,232,229,0.72);
}

.world-side-panel[data-world-status="hunting"] .world-team-summary {
    opacity: 0.74;
}

.world-team-modal {
    overflow: hidden;
}

.world-team-modal .modal-dialog,
.world-team-modal .modal-content,
.world-team-modal .modal-body {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    background: transparent;
    overflow: hidden;
}

.world-team-modal .modal-dialog {
    max-width: 100%;
    margin: 0;
}

.world-travel-team-modal .modal-dialog {
    width: min(25.25rem, calc(100vw - 1.5rem));
    max-width: calc(100vw - 1.5rem);
    margin-right: auto;
    margin-left: auto;
}

.world-travel-team-modal .modal-content {
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    background: #14181c;
    box-shadow: 0 18px 48px rgba(0,0,0,0.26);
}

.world-travel-team-modal .modal-content::before {
    display: block;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, rgba(255,255,255,0.14), rgba(255,255,255,0.05), transparent);
    content: "";
}

.world-travel-team-prompt {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.82rem;
    padding: 1rem;
}

.world-travel-team-mark {
    display: inline-grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border: 1px solid rgba(232,176,74,0.45);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(40,52,55,0.9), rgba(18,28,31,0.95));
    color: #e8b04a;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.06),
        0 0 10px rgba(232,176,74,0.12);
}

.world-travel-team-mark .ad-icon {
    width: 1.15rem;
    height: 1.15rem;
}

.world-travel-team-copy {
    display: grid;
    justify-items: start;
    gap: 0.32rem;
    min-width: 0;
}

.world-travel-team-title {
    color: #f8fbf9;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
}

.world-travel-team-copy small {
    color: var(--ad-muted);
    font-size: 0.78rem;
    line-height: 1.25;
}

.world-travel-team-copy .btn {
    margin-top: 0.3rem;
    padding: 0.42rem 0.78rem;
    font-size: 0.82rem;
    line-height: 1.1;
}

.world-team-editor-shell {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    color: rgba(220,232,229,0.9);
    background:
        radial-gradient(circle at 28% 18%, rgba(111,214,189,0.09), transparent 34rem),
        linear-gradient(135deg, rgba(4,10,13,0.98), rgba(8,15,18,0.96));
}

.world-team-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
    border-bottom: 1px solid rgba(161,212,201,0.16);
    background:
        linear-gradient(180deg, rgba(111,214,189,0.08), rgba(255,255,255,0.015)),
        rgba(3,8,11,0.82);
    padding: calc(0.78rem + env(safe-area-inset-top, 0px)) 1rem 0.78rem;
}

.world-team-editor-title {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
}

.world-team-editor-title span {
    color: rgba(232,199,106,0.82);
    font-size: 0.66rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.world-team-editor-title h2 {
    margin: 0;
    overflow: hidden;
    color: #f8fbf9;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.22rem, 2.4vw, 2rem);
    font-weight: 900;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.world-team-editor-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.world-team-editor-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.36rem;
    min-width: 6.6rem;
    min-height: 2rem;
    padding: 0.38rem 0.78rem;
    line-height: 1;
}

.world-team-editor-save .ad-icon {
    width: 0.9rem;
    height: 0.9rem;
    margin: 0;
}

.world-team-editor-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.6rem;
    min-height: 1.8rem;
    border: 1px solid rgba(232,199,106,0.26);
    border-radius: 6px;
    background: rgba(0,0,0,0.2);
    color: #fff3bd;
    padding: 0.22rem 0.48rem;
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1;
}

.world-team-editor-close {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(161,212,201,0.18);
    border-radius: 6px;
    background: rgba(5,13,16,0.72);
    color: rgba(220,232,229,0.82);
}

.world-team-editor-close:hover,
.world-team-editor-close:focus-visible {
    border-color: rgba(111,214,189,0.48);
    background: rgba(111,214,189,0.1);
    color: #effffc;
    outline: 0;
}

.world-team-editor-close .ad-icon {
    width: 1rem;
    height: 1rem;
    margin: 0;
}

.world-team-editor-status {
    grid-row: 2;
    margin: 0.68rem 0.85rem 0;
    border: 1px solid rgba(141,231,255,0.28);
    border-radius: 6px;
    background: rgba(0,0,0,0.22);
    color: rgba(220,232,229,0.84);
    padding: 0.5rem 0.64rem;
    font-size: 0.76rem;
    font-weight: 800;
}

.world-team-editor-status.is-danger {
    border-color: rgba(226,80,65,0.42);
    color: #ffc9c5;
}

.world-team-editor-layout {
    grid-row: 3;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    box-sizing: border-box;
    gap: 0.85rem;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    padding: 0.85rem;
}

.world-team-editor-board {
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 0.12rem;
}

.world-team-editor-board .battle-side-heading {
    min-height: 1.42rem;
}

.world-team-editor-grid-host {
    display: grid;
    align-items: center;
    justify-items: center;
    align-content: center;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

.world-team-editor-board .battle-formation-grid {
    --dungeon-demon-card-width: clamp(5.2rem, min(12vw, 20vh), 12.8rem);
    border-color: rgba(111,214,189,0.32);
}

.world-team-editor-collection {
    position: relative;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
    border-left: 1px solid rgba(161,212,201,0.12);
    padding-left: 0.85rem;
}

.world-team-editor-scroll {
    position: absolute;
    top: 50%;
    z-index: 4;
    display: none;
    place-items: center;
    width: 2.1rem;
    height: 3.6rem;
    padding: 0;
    transform: translateY(-50%);
    border: 1px solid rgba(161,212,201,0.3);
    border-radius: 8px;
    background: rgba(4,10,13,0.86);
    color: rgba(220,232,229,0.92);
    box-shadow: 0 10px 22px rgba(0,0,0,0.42);
}

.world-team-editor-scroll:disabled {
    opacity: 0.32;
    pointer-events: none;
}

.world-team-editor-scroll:not(:disabled):hover,
.world-team-editor-scroll:not(:disabled):focus-visible {
    border-color: rgba(111,214,189,0.56);
    background:
        linear-gradient(180deg, rgba(111,214,189,0.16), rgba(3,9,11,0.18)),
        rgba(4,16,17,0.92);
    color: #effffc;
    box-shadow:
        0 10px 22px rgba(0,0,0,0.42),
        0 0 14px rgba(111,214,189,0.14);
    outline: 0;
}

.world-team-editor-scroll .ad-icon {
    width: 1.15rem;
    height: 1.15rem;
    margin: 0;
}

.world-team-editor-scroll-prev {
    left: 0.18rem;
}

.world-team-editor-scroll-next {
    right: 0.18rem;
}

.world-team-editor-collection.is-scrollable .world-team-editor-scroll {
    display: grid;
}

.world-team-editor-collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7.1rem, 1fr));
    align-content: start;
    gap: 0.55rem;
    min-width: 0;
    min-height: 0;
    overflow: hidden auto;
    border: 1px solid rgba(161,212,201,0.08);
    border-radius: 8px;
    background: rgba(0,0,0,0.16);
    padding: 0.5rem;
}

.world-team-editor-collection-grid .world-empty-text {
    grid-column: 1 / -1;
    align-self: start;
}

.world-team-editor-card {
    position: relative;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.world-team-editor-card:active {
    cursor: grabbing;
}

.world-team-editor-card.is-dragging {
    opacity: 0.42;
}

.world-team-editor-collection-card.is-in-team {
    outline: 1px solid rgba(232,199,106,0.62);
    box-shadow:
        0 0 0 2px rgba(232,199,106,0.12),
        0 14px 28px rgba(0,0,0,0.32),
        0 0 18px color-mix(in srgb, var(--rarity-color, #D1D5D8) 16%, transparent);
}

.world-team-editor-in-team-mark {
    position: absolute;
    top: 0.42rem;
    right: 0.42rem;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    border: 1px solid rgba(232,199,106,0.7);
    border-radius: 50%;
    background: rgba(4,10,13,0.9);
    color: #fff3bd;
    box-shadow: 0 0 12px rgba(232,199,106,0.28);
}

.world-team-editor-in-team-mark .ad-icon {
    width: 0.78rem;
    height: 0.78rem;
    margin: 0;
}

.world-team-drop-target.is-drag-over {
    outline: 2px solid rgba(232,199,106,0.86);
    outline-offset: 2px;
    box-shadow: 0 0 24px rgba(232,199,106,0.22);
}

.world-team-editor-collection-grid.is-drag-over {
    border-color: rgba(232,199,106,0.45);
    background:
        linear-gradient(180deg, rgba(232,199,106,0.08), rgba(0,0,0,0.04)),
        rgba(0,0,0,0.2);
}

/* Shortcut card at the end of the team-editor collection, matched to a demon
   card's square footprint, with a subtle pulsating blue glow. */
.world-team-extract-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    aspect-ratio: 1 / 1;
    min-width: 0;
    padding: 0.5rem;
    border: 2px solid rgba(96,165,250,0.5);
    border-radius: 6px;
    background:
        radial-gradient(circle at 50% 35%, rgba(96,165,250,0.16), rgba(8,16,30,0.5) 70%),
        rgba(8,16,30,0.5);
    color: #d6e6ff;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    animation: worldTeamExtractPulse 2.6s ease-in-out infinite;
}

.world-team-extract-card:hover,
.world-team-extract-card:focus-visible {
    border-color: rgba(147,197,253,0.85);
    color: #ffffff;
    outline: none;
}

.world-team-extract-icon {
    display: grid;
    place-items: center;
    color: #93c5fd;
}

.world-team-extract-icon .ad-icon {
    width: 1.5rem;
    height: 1.5rem;
}

.world-team-extract-label {
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0.01em;
}

@keyframes worldTeamExtractPulse {
    0%, 100% {
        border-color: rgba(96,165,250,0.42);
        box-shadow:
            0 0 0 1px rgba(96,165,250,0.2),
            0 0 10px rgba(80,150,255,0.22);
    }
    50% {
        border-color: rgba(147,197,253,0.8);
        box-shadow:
            0 0 0 1px rgba(147,197,253,0.4),
            0 0 20px rgba(96,165,250,0.5);
    }
}

@media (prefers-reduced-motion: reduce) {
    .world-team-extract-card {
        animation: none;
    }
}

.world-team-drag-ghost {
    z-index: 3200;
    width: clamp(5.4rem, 9vw, 7.2rem);
    transform: translate(-50%, -50%) scale(0.96);
}

.world-team-drag-ghost .dungeon-demon-card {
    width: 100%;
    aspect-ratio: 1 / 1;
}

.world-coordinate-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0;
}

.world-coordinate-grid div {
    display: grid;
    gap: 0.12rem;
    border: 1px solid rgba(161,212,201,0.11);
    border-radius: 6px;
    background: rgba(0,0,0,0.16);
    padding: 0.52rem;
}

.world-coordinate-grid dt {
    color: rgba(220,232,229,0.52);
    font-size: 0.62rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.world-coordinate-grid dd {
    margin: 0;
    color: var(--ad-gold, #e8c76a);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.28rem;
    font-weight: 900;
    line-height: 1;
}

.world-empty-text {
    margin: 0;
    color: rgba(220,232,229,0.56);
    font-size: 0.76rem;
    font-weight: 700;
}

.world-encounter-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    min-width: 0;
}

.world-encounter-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.32rem;
    min-width: 0;
    min-height: 1.85rem;
    border: 1px solid rgba(161,212,201,0.16);
    border-radius: 5px;
    background: rgba(0,0,0,0.16);
    color: rgba(220,232,229,0.68);
    padding: 0.28rem 0.48rem;
    font-size: 0.66rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.world-encounter-tab strong {
    display: inline-grid;
    place-items: center;
    min-width: 1.1rem;
    height: 1.1rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: rgba(245,231,197,0.9);
    font-size: 0.58rem;
    line-height: 1;
}

.world-encounter-tab:hover,
.world-encounter-tab:focus-visible,
.world-encounter-tab.is-active {
    border-color: rgba(111,214,189,0.46);
    background:
        linear-gradient(180deg, rgba(111,214,189,0.12), rgba(0,0,0,0.08)),
        rgba(0,0,0,0.2);
    color: #effffc;
    box-shadow: 0 0 12px rgba(111,214,189,0.12);
    outline: 0;
}

.world-encounter-tab-panel {
    display: grid;
    gap: 0.42rem;
    min-width: 0;
}

.world-sidebar-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.42rem 0.56rem;
    min-width: 0;
    border: 1px solid rgba(161,212,201,0.08);
    border-radius: 6px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.025), rgba(0,0,0,0.045)),
        rgba(0,0,0,0.14);
    padding: 0.54rem;
}

.world-sidebar-card.world-active-hunt-card,
.world-sidebar-card.world-travel-card {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
}

.world-sidebar-card.world-active-hunt-card {
    border-color: rgba(161,212,201,0.11);
    background:
        linear-gradient(180deg, rgba(232,199,106,0.035), rgba(255,255,255,0.012)),
        rgba(0,0,0,0.16);
}

.world-sidebar-card.world-boss-card {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
    border-color: rgba(242,195,94,0.22);
    background:
        linear-gradient(180deg, rgba(242,195,94,0.08), rgba(223,119,121,0.035)),
        rgba(0,0,0,0.18);
}

.world-sidebar-card.world-sign-card {
    grid-template-columns: minmax(0, 1fr);
    border-color: rgba(180,122,63,0.28);
    background:
        linear-gradient(135deg, rgba(180,122,63,0.1), rgba(71,41,19,0.035)),
        rgba(0,0,0,0.18);
}

.world-sign-card .world-card-kicker {
    color: rgba(229,201,138,0.72);
}

.world-sign-card .world-sign-message {
    overflow: visible;
    color: rgba(239,226,196,0.74);
    font-family: "Lora", serif;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.45;
    text-overflow: clip;
    white-space: normal;
}

.world-side-panel .world-card-action.is-busy {
    cursor: wait;
    opacity: 0.68;
}

.world-card-kicker {
    color: rgba(220,232,229,0.62);
    font-size: 0.58rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.world-card-copy {
    display: grid;
    gap: 0.14rem;
    min-width: 0;
}

.world-card-title,
.world-card-copy .world-encounter-title {
    overflow: hidden;
    color: #f8fbf9;
    font-size: 0.8rem;
    font-weight: 900;
    line-height: 1.12;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.world-card-copy .world-encounter-title-link {
    text-decoration: none;
    transition: color 160ms ease, text-shadow 160ms ease;
}

.world-hunter-profile-link {
    display: block;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 160ms ease;
}

.world-card-copy .world-encounter-title-link:hover,
.world-card-copy .world-encounter-title-link:focus-visible,
.world-hunter-profile-link:hover,
.world-hunter-profile-link:focus-visible {
    color: #fff3bd;
    text-decoration: none;
}

.world-card-copy .world-encounter-title-link:focus-visible,
.world-hunter-profile-link:focus-visible {
    outline: 1px solid rgba(232,199,106,0.58);
    outline-offset: 2px;
}

.world-card-meta {
    overflow: hidden;
    color: rgba(220,232,229,0.58);
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.world-card-meta-inline {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.22rem;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.world-meta-item {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.world-meta-separator {
    color: rgba(220,232,229,0.36);
}

.world-terror-meta-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.18rem;
    max-width: none;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: rgba(255,180,150,0.86);
    font: inherit;
    line-height: inherit;
    padding: 0;
}

.world-terror-meta-chip strong {
    color: rgba(255,211,178,0.95);
    font: inherit;
    font-weight: 900;
}

.world-terror-meta-chip::after {
    top: calc(100% + 0.38rem);
    left: 0;
    width: max-content;
    max-width: min(17rem, calc(100vw - 2rem));
    transform: translate(0, -0.16rem);
}

.world-terror-meta-chip:hover::after,
.world-terror-meta-chip:focus::after,
.world-terror-meta-chip:focus-visible::after {
    transform: translate(0, 0);
}

.world-terror-line {
    display: flex;
    align-items: center;
    min-width: 0;
}

.world-terror-line .enemy-pressure-chip {
    max-width: 100%;
}

.world-card-action {
    justify-self: end;
    min-width: 4.5rem;
}

.world-boss-card .world-card-action {
    align-self: center;
    justify-self: center;
    width: auto;
    min-width: 6.25rem;
    margin-top: 0.16rem;
}

.world-boss-title .world-encounter-rarity {
    color: #f2c35e;
}

.world-boss-demons {
    margin-top: 0.08rem;
}

.world-boss-demons .world-enc-demon,
.world-boss-demons .world-enc-demon-overflow {
    width: 50px;
    height: 50px;
}

.world-boss-demons .world-enc-demon img {
    width: 100%;
    height: 100%;
}

.world-boss-formation {
    display: grid;
    place-items: center;
    gap: 0.5rem;
    width: 100%;
    margin: 0.1rem 0;
    padding-block: 0.12rem;
}

.world-boss-formation::before,
.world-boss-formation::after {
    content: "";
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(232,199,106,0.18) 18%, rgba(232,199,106,0.18) 82%, transparent);
}

.world-boss-formation-grid {
    display: grid;
    grid-template-columns: repeat(3, 48px);
    grid-template-rows: repeat(3, 48px);
}

.world-boss-formation-cell {
    display: grid;
    place-items: center;
    border-right: 1px solid rgba(220,232,229,0.13);
    border-bottom: 1px solid rgba(220,232,229,0.13);
}

.world-boss-formation-cell:nth-child(3n) {
    border-right: 0;
}

.world-boss-formation-cell:nth-child(n + 7) {
    border-bottom: 0;
}

.world-boss-formation-cell .world-enc-demon {
    width: 42px;
    height: 42px;
    border-width: 1px;
    padding: 1px;
    box-shadow: 0 0 6px color-mix(in srgb, var(--rarity-color, #D1D5D8) 28%, transparent);
}

.world-boss-buffs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
    min-width: 0;
}

.world-boss-buffs.is-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
}

.world-boss-buff {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    max-width: 100%;
    border: 1px solid rgba(242,195,94,0.16);
    border-radius: 999px;
    background: rgba(0,0,0,0.2);
    color: rgba(255,236,186,0.82);
    font-size: 0.62rem;
    font-weight: 900;
    line-height: 1.1;
    padding: 0.18rem 0.42rem;
}

.world-boss-buff[data-tooltip] {
    cursor: help;
}

.world-boss-buff[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    z-index: 40;
    top: calc(100% + 0.42rem);
    left: 0;
    width: max-content;
    max-width: min(18rem, 70vw);
    border: 1px solid rgba(242,195,94,0.32);
    border-radius: 8px;
    background: rgba(3,9,11,0.96);
    color: #f4f8f7;
    box-shadow: 0 16px 34px rgba(0,0,0,0.42);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.28;
    padding: 0.55rem 0.65rem;
    pointer-events: none;
    text-align: left;
    text-transform: none;
    white-space: pre-line;
    opacity: 0;
    transform: translateY(-0.16rem);
    transition: opacity 140ms ease, transform 140ms ease;
}

.world-boss-buff[data-tooltip]:hover::after,
.world-boss-buff[data-tooltip]:focus::after,
.world-boss-buff[data-tooltip]:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

.world-boss-buff:focus-visible {
    outline: 1px solid rgba(242,195,94,0.62);
    outline-offset: 2px;
}

.world-boss-buffs.is-inline .world-boss-buff {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: rgba(255,236,186,0.86);
    font-size: inherit;
    line-height: inherit;
    padding: 0;
}

.world-boss-buff .ad-icon {
    width: 0.72rem;
    height: 0.72rem;
    flex: 0 0 auto;
}

.world-boss-buff span:last-child {
    overflow: hidden;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.world-boss-reward {
    display: grid;
    gap: 0.08rem;
    min-width: 0;
    border-left: 2px solid rgba(242,195,94,0.72);
    color: rgba(220,232,229,0.68);
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1.2;
    padding-left: 0.48rem;
}

.world-encounter-tooltip .world-boss-reward {
    justify-self: stretch;
    width: 100%;
    border-left: 0;
    padding-inline: 0;
}

.world-boss-reward > span {
    color: rgba(242,195,94,0.82);
    font-size: 0.56rem;
    font-weight: 900;
    text-transform: uppercase;
}

.world-boss-reward strong {
    overflow: hidden;
    color: #fff3bd;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.world-boss-reward small {
    overflow: hidden;
    color: rgba(220,232,229,0.62);
    font-size: 0.62rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.world-pvp-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.34rem;
}

.world-scout-action {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    min-width: 2rem;
    height: 1.95rem;
    padding: 0;
}

.world-scout-action .ad-icon {
    width: 0.92rem;
    height: 0.92rem;
}

.world-active-hunt-card .world-card-action,
.world-travel-card .world-card-action {
    justify-self: stretch;
}

.world-hunt-reward-lines {
    display: grid;
    gap: 0.16rem;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1.2;
}

.world-hunt-reward-row {
    display: grid;
    grid-template-columns: 4.25rem 4.25rem minmax(7rem, 1fr);
    align-items: baseline;
    column-gap: 0.72rem;
    min-width: 0;
}

.world-hunt-reward-label {
    color: rgba(220,232,229,0.56);
    font-size: 0.66rem;
    text-transform: uppercase;
}

.world-hunt-reward-value {
    color: rgba(232,199,106,0.9);
    justify-self: start;
    text-align: left;
    white-space: nowrap;
}

.world-hunt-souls-value {
    min-width: 0;
}

.world-hunt-reward-row.is-earned {
    margin-top: 0.12rem;
}

.world-hunt-reward-row.is-earned .world-hunt-reward-value {
    color: rgba(220,232,229,0.72);
}

.world-hunt-earned-souls {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.32rem;
    white-space: nowrap;
}

.world-hunt-reward-row.is-earned .world-hunt-earned-souls.is-vessel-full,
.world-hunt-reward-row.is-earned .world-hunt-earned-souls.is-vessel-full .world-hunt-vessel-amount {
    color: #ff8f8f;
    text-shadow: 0 0 10px rgba(223,119,121,0.28);
}

.world-hunt-vessel-amount {
    color: inherit;
}

.world-hunt-vessel-upgrade-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.26rem;
    min-width: 1.26rem;
    height: 1.26rem;
    padding: 0;
    border: 1px solid rgba(143,167,255,0.42);
    border-radius: 999px;
    background: rgba(143,167,255,0.1);
    color: #d9e1ff;
    font-size: 0.86rem;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
}

.world-hunt-vessel-upgrade-btn:hover,
.world-hunt-vessel-upgrade-btn:focus-visible {
    border-color: rgba(143,167,255,0.72);
    background: rgba(143,167,255,0.2);
    color: #fff;
    outline: 0;
}

.world-hunt-progress {
    display: block;
    height: 0.42rem;
    overflow: hidden;
    border: 1px solid rgba(232,199,106,0.16);
    border-radius: 999px;
    background: rgba(0,0,0,0.34);
}

.world-hunt-progress-fill {
    display: block;
    width: var(--hunt-progress, 0%);
    height: 100%;
    border-radius: inherit;
    background:
        linear-gradient(90deg, rgba(191,143,71,0.78), rgba(255,239,177,0.94));
    box-shadow: 0 0 10px rgba(232,199,106,0.26);
    transition: width 240ms linear;
}

.world-shrine-panel {
    display: grid;
    gap: 0.5rem;
    min-width: 0;
}

.world-shrine-status {
    display: grid;
    align-items: center;
    gap: 0.48rem;
    min-width: 0;
    padding: 0.5rem 0.5rem 0.5rem 0;
}

.world-shrine-status {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.world-shrine-mark {
    display: block;
    width: 2.1rem;
    height: 3.15rem;
    flex: 0 0 auto;
}

.world-shrine-copy {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
    padding-bottom: 0.4rem;
}

.world-shrine-copy strong {
    overflow: hidden;
    color: var(--ad-gold, #e8c76a);
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.world-shrine-label {
    overflow: hidden;
    color: rgba(220,232,229,0.92);
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1.1;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.world-shrine-area {
    color: rgba(220,232,229,0.38);
    font-size: 0.8rem;
    font-weight: 900;
    line-height: 1;
    padding-bottom: 0.4rem;
    text-align: right;
    white-space: nowrap;
}

.world-team-summary,
.world-encounter-list {
    display: grid;
    gap: 0.5rem;
    min-width: 0;
}

.world-team-count {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    color: rgba(220,232,229,0.7);
    font-size: 0.7rem;
    font-weight: 800;
}

.world-team-count strong {
    color: var(--ad-soul, #55ffff);
    font-size: 1.15rem;
    line-height: 1;
}

.world-team-list {
    display: grid;
    gap: 0.38rem;
}

.world-team-demons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.38rem;
    align-items: center;
}

.world-team-member,
.world-encounter-player {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.48rem;
    min-width: 0;
    border: 1px solid rgba(161,212,201,0.1);
    border-radius: 6px;
    background: rgba(0,0,0,0.16);
    padding: 0.46rem;
}

.world-team-member {
    grid-template-columns: auto minmax(0, 1fr);
}

.world-encounter-player.is-demon-spot {
    grid-template-columns: minmax(0, 1fr) auto;
}

.world-team-rarity,
.world-encounter-mark {
    display: block;
    width: 0.8rem;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--ad-teal, #6fd6bd);
    box-shadow: 0 0 13px rgba(111,214,189,0.22);
}

.world-rarity-uncommon {
    background: var(--ad-green, #80d697);
}

.world-rarity-rare {
    background: #2c82c9;
}

.world-rarity-epic {
    background: var(--ad-violet, #9c7ac8);
}

.world-rarity-legendary,
.world-rarity-mythic {
    background: var(--ad-gold, #e8c76a);
}

.world-team-member span:last-child,
.world-encounter-copy {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
}

.world-team-member strong,
.world-encounter-copy strong {
    overflow: hidden;
    color: #f8fbf9;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.world-team-member small,
.world-encounter-copy small {
    overflow: hidden;
    color: rgba(220,232,229,0.54);
    font-size: 0.64rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.world-encounter-title {
    display: flex;
    align-items: baseline;
    gap: 0.24rem;
    min-width: 0;
}

.world-encounter-title .world-encounter-rarity {
    flex: 0 0 auto;
    color: var(--rarity-color, #D1D5D8);
    text-shadow: 0 0 8px color-mix(in srgb, var(--rarity-color, #D1D5D8) 36%, transparent);
}

.world-encounter-title .world-encounter-name {
    min-width: 0;
    overflow: hidden;
    color: inherit;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.world-encounter-copy .world-enc-demons {
    justify-content: flex-start;
}

.world-encounter-player .btn {
    min-height: 2rem;
    padding: 0.26rem 0.5rem;
    font-size: 0.66rem;
}

.world-travel-panel {
    display: grid;
    gap: 0.5rem;
}

.world-travel-log {
    display: grid;
    gap: 0.35rem;
}

.world-travel-log-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid rgba(161,212,201,0.1);
    border-radius: 6px;
    background: rgba(0,0,0,0.14);
    padding: 0.42rem;
}

.world-travel-log-mark {
    width: 0.56rem;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--ad-teal, #6fd6bd);
    opacity: 0.8;
}

.world-travel-log-item.is-ambush > .world-travel-log-mark {
    background: var(--ad-danger, #e4685e);
    box-shadow: 0 0 12px rgba(228,104,94,0.28);
}

.world-travel-log-copy {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.world-travel-log-copy strong {
    overflow: hidden;
    color: rgba(220,232,229,0.86);
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.world-travel-log-copy small {
    overflow: hidden;
    color: rgba(220,232,229,0.5);
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.world-travel-replay-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.22rem;
    min-width: 0;
    min-height: 1.85rem;
    padding: 0.22rem 0.38rem;
    font-size: 0.62rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.world-travel-replay-btn .ad-icon {
    width: 0.78rem;
    height: 0.78rem;
}

.world-battle-modal .modal-dialog,
.world-battle-modal .modal-content,
.world-battle-modal .modal-body {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    background: transparent;
}

.world-battle-modal .modal-body {
    position: relative;
    display: block;
    overflow: hidden;
    padding: 0;
}

.world-battle-modal .dungeon-layout {
    height: 100%;
}

.world-battle-modal .dungeon-battle-body {
    position: relative;
}

.world-battle-modal .dungeon-reward-strip,
.world-battle-modal .dungeon-replaylog-box,
.world-battle-modal .dungeon-reward-box,
.world-battle-modal .dungeon-mobile-fight-box,
.world-battle-modal .dungeon-floor-marker {
    display: none !important;
}

.world-battle-modal .dungeon-bottom-panel {
    grid-template-columns: minmax(0, 1fr) !important;
}

.world-battle-modal.is-world-battle-result-mode .dungeon-bottom-panel {
    visibility: hidden;
    pointer-events: none;
}

.world-battle-modal.is-world-battle-result-animating .dungeon-bottom-panel,
.world-battle-modal.is-world-battle-result-animating .world-dungeon-result-layer,
.world-battle-modal.is-world-battle-result-animating .world-battle-close {
    opacity: 0;
    pointer-events: none;
}

body.is-world-battle-instant-close .world-battle-modal,
body.is-world-battle-instant-close .world-battle-modal .modal-dialog,
body.is-world-battle-instant-close .modal-backdrop {
    transition: none !important;
}

.world-ambush-defeat-fade {
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: #000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--world-ambush-defeat-fade-ms, 900ms) ease-in-out;
}

body.is-world-ambush-defeat-transition .world-ambush-defeat-fade {
    pointer-events: auto;
}

body.is-world-ambush-defeat-blackout .world-ambush-defeat-fade {
    opacity: 1;
}

.world-battle-modal #dungeonHandBar {
    grid-column: 1 / -1;
}

.world-battle-modal #dungeonHandBar.is-world-battle-result-mode .dungeon-hand-tabs,
.world-battle-modal #dungeonHandBar.is-world-battle-result-mode #dungeonBottomControls {
    display: none !important;
}

.world-battle-modal #dungeonHandBar.is-world-battle-result-mode {
    grid-template-columns: minmax(0, 1fr);
}

.world-battle-modal #dungeonHandBar.is-world-battle-result-mode .dungeon-hand-grid {
    display: block !important;
    grid-column: 1 / -1 !important;
    justify-self: stretch;
    width: 100%;
    overflow: visible;
}

.world-battle-modal .dungeon-hand-cards.is-world-battle-result {
    display: grid;
    place-items: center;
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 0;
}

.world-dungeon-result-layer {
    position: absolute;
    top: var(--world-dungeon-result-top, 70%);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2604;
    display: grid;
    place-items: center;
    width: 100%;
    min-width: 0;
    padding: 1rem;
    pointer-events: none;
}

.world-dungeon-result {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    justify-content: center;
    justify-items: center;
    gap: 0.48rem;
    width: min(34rem, 100%);
    min-width: 0;
    text-align: center;
    pointer-events: auto;
}

.world-dungeon-result strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.1rem, 2.6vw, 1.8rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.08em;
    text-shadow: 0 2px 12px rgba(0,0,0,0.82);
}

.world-dungeon-result.is-victory strong {
    color: #86e8b2;
    text-shadow: 0 0 18px rgba(134,232,178,0.42), 0 2px 12px rgba(0,0,0,0.82);
}

.world-dungeon-result.is-defeat strong {
    color: #ff7770;
    text-shadow: 0 0 18px rgba(255,119,112,0.42), 0 2px 12px rgba(0,0,0,0.82);
}

.world-dungeon-winning-ambush-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    margin: 0;
    padding: 0.12rem 0;
    border: 0;
    background: transparent;
    color: rgba(226,242,236,0.82);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.15;
    cursor: pointer;
}

.world-dungeon-winning-ambush-toggle:hover {
    color: #f0fff8;
}

.world-dungeon-winning-ambush-toggle input {
    width: 0.95rem;
    height: 0.95rem;
    margin: 0;
    accent-color: var(--ad-teal, #6fd6bd);
    cursor: pointer;
}

.world-dungeon-result-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.34rem;
    min-width: 0;
}

.world-dungeon-result-icon-btn {
    width: 2rem;
    min-width: 2rem;
    height: 2rem;
    padding: 0;
}

.world-dungeon-result-icon-btn .ad-icon {
    width: 0.9rem;
    height: 0.9rem;
}

.world-dungeon-result-continue {
    min-width: 8rem;
    min-height: 2rem;
    padding: 0.42rem 0.9rem;
    line-height: 1;
}

.world-battle-close {
    position: fixed;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 2605;
    width: 2.1rem;
    height: 2.1rem;
    border: 1px solid rgba(111,214,189,0.3);
    border-radius: 6px;
    background-color: rgba(7,18,20,0.74);
    box-shadow: 0 10px 24px rgba(0,0,0,0.32);
    filter: invert(1) grayscale(100%) brightness(1.35);
    opacity: 0.82;
}

.world-battle-close:hover,
.world-battle-close:focus-visible {
    border-color: rgba(111,214,189,0.58);
    opacity: 1;
}

.world-action-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.42rem;
    margin-top: auto;
}

.world-action-row .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.34rem;
    min-width: 0;
    min-height: 2.35rem;
    padding-inline: 0.45rem;
    font-size: 0.68rem;
}

.world-action-row .btn .ad-icon {
    width: 0.88rem;
    height: 0.88rem;
    margin: 0;
}

@media (max-width: 899.98px) and (orientation: portrait) {
.world-team-editor-head {
        padding: calc(0.66rem + env(safe-area-inset-top, 0px)) 0.7rem 0.66rem;
    }

.world-team-editor-layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        gap: 0.62rem;
        padding: 0.62rem;
    }

.world-team-editor-collection {
        order: 1;
        border-left: 0;
        border-bottom: 1px solid rgba(161,212,201,0.12);
        padding: 0 0 0.62rem;
    }

.world-team-editor-board,
    .world-team-editor-board.battle-side-player {
        order: 2;
        grid-template-rows: auto minmax(0, 1fr);
        gap: 0.28rem;
        padding: 0;
    }

.world-team-editor-grid-host,
    .world-team-editor-board.battle-side-player .world-team-editor-grid-host {
        order: initial;
    }

.world-team-editor-board .battle-formation-grid {
        --dungeon-demon-card-width: clamp(3.35rem, calc((100vw - 3.8rem) / 3), 6.15rem);
        --dungeon-formation-gap: 0.26rem;
    }

.world-team-editor-board .battle-formation-grid .formation-slot:nth-child(1) { order: 6; }

.world-team-editor-board .battle-formation-grid .formation-slot:nth-child(2) { order: 3; }

.world-team-editor-board .battle-formation-grid .formation-slot:nth-child(3) { order: 0; }

.world-team-editor-board .battle-formation-grid .formation-slot:nth-child(4) { order: 7; }

.world-team-editor-board .battle-formation-grid .formation-slot:nth-child(5) { order: 4; }

.world-team-editor-board .battle-formation-grid .formation-slot:nth-child(6) { order: 1; }

.world-team-editor-board .battle-formation-grid .formation-slot:nth-child(7) { order: 8; }

.world-team-editor-board .battle-formation-grid .formation-slot:nth-child(8) { order: 5; }

.world-team-editor-board .battle-formation-grid .formation-slot:nth-child(9) { order: 2; }

.world-team-editor-collection-grid {
        --world-team-collection-card: clamp(5rem, 16vh, 7.2rem);
        grid-auto-flow: column;
        grid-template-columns: none;
        grid-template-rows: repeat(2, var(--world-team-collection-card));
        grid-auto-columns: var(--world-team-collection-card);
        justify-content: start;
        gap: 0.42rem;
        overflow: auto hidden;
        overscroll-behavior-x: contain;
        padding: 0.42rem;
        scroll-padding-inline: 2.5rem;
    }

.world-team-editor-collection-grid .world-empty-text {
        grid-row: 1 / -1;
        align-self: center;
    }

.world-team-editor-collection-card {
        touch-action: pan-x;
    }
}

@media (max-width: 575.98px) {
.world-travel-replay-btn span {
        display: none;
    }
}

@media (max-width: 1199.98px) {
.world-side-panel {
        width: min(20rem, calc(100vw - 1.3rem));
    }

.world-map-controls {
        right: calc(min(20rem, calc(100vw - 1.3rem)) + 1.05rem);
    }

body.is-world-side-collapsed .world-map-controls {
        right: calc(min(14.5rem, calc(100vw - 1.3rem)) + 1.05rem);
    }

.world-side-content {
        gap: 0.62rem;
    }
}

@media (max-width: 899.98px) {
body.world-page {
        overflow: hidden;
    }

.world-side-panel {
        top: auto;
        right: 0.65rem;
        bottom: calc(0.65rem + var(--nav-xp-progress-height, 0rem));
        left: 0.65rem;
        width: auto;
        max-height: 38vh;
        overflow: hidden auto;
    }

.world-side-panel.is-collapsed {
        top: auto;
        right: 0.65rem;
        bottom: calc(0.65rem + var(--nav-xp-progress-height, 0rem));
        left: auto;
        width: min(14.5rem, calc(100vw - 1.3rem));
        max-height: calc(3rem + env(safe-area-inset-bottom, 0px));
        overflow: hidden;
    }

.world-map-status {
        top: calc(var(--game-nav-height, 3.6rem) + 0.65rem);
        bottom: auto;
    }

.world-map-controls {
        top: auto;
        right: 0.85rem;
        bottom: calc(4.35rem + var(--nav-xp-progress-height, 0rem) + env(safe-area-inset-bottom, 0px));
    }

body.is-world-side-collapsed .world-map-controls {
        right: calc(min(14.5rem, calc(100vw - 1.3rem)) + 1.05rem);
        bottom: calc(0.8rem + var(--nav-xp-progress-height, 0rem) + env(safe-area-inset-bottom, 0px));
    }

.world-position-button {
        width: 3rem;
        min-width: 3rem;
        min-height: 3rem;
        border-radius: 7px;
        padding: 0;
    }
}

@media (max-width: 899.98px) and (orientation: portrait) {
.world-side-panel {
        right: 0;
        bottom: 0;
        left: 0;
        width: auto;
        max-height: min(72vh, calc(100dvh - var(--game-nav-height, 3.6rem) - 0.85rem));
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 12px 12px 0 0;
        padding: 0;
        overflow: hidden;
    }

.world-side-toggle {
        position: relative;
        z-index: 3;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.85rem;
        width: 100%;
        min-height: 3rem;
        border: 0;
        border-bottom: 1px solid rgba(161,212,201,0.16);
        background:
            linear-gradient(180deg, rgba(111,214,189,0.1), rgba(255,255,255,0.02)),
            rgba(3,8,11,0.9);
        color: rgba(143,239,225,0.86);
        padding: 0.72rem 0.95rem;
        font-size: 0.72rem;
        font-weight: 900;
        line-height: 1;
        white-space: nowrap;
    }

.world-side-toggle:hover,
    .world-side-toggle:focus-visible {
        color: #effffc;
        outline: 0;
    }

.world-side-toggle .ad-icon {
        width: 0.92rem;
        height: 0.92rem;
        margin: 0;
        transition: transform 180ms ease;
    }

.world-side-content {
        max-height: calc(min(72vh, calc(100dvh - var(--game-nav-height, 3.6rem) - 0.85rem)) - 3rem);
        overflow: hidden auto;
        padding: 0.7rem 0.7rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
    }

.world-side-panel.is-collapsed {
        right: 0.65rem;
        bottom: 0.65rem;
        left: auto;
        width: min(14.5rem, calc(100vw - 1.3rem));
        max-height: calc(3rem + env(safe-area-inset-bottom, 0px));
        border-radius: 8px;
    }

.world-side-panel.is-collapsed .world-side-toggle {
        padding-bottom: calc(0.72rem + env(safe-area-inset-bottom, 0px));
    }

.world-side-panel.is-collapsed .world-side-content {
        display: none;
    }

.world-map-controls {
        right: 0.65rem;
        bottom: calc(var(--world-side-panel-height, 3rem) + 0.65rem);
    }

body.is-world-side-collapsed .world-map-controls {
        right: 0.65rem;
        bottom: calc(var(--world-side-panel-height, 3rem) + 1.15rem);
    }

.world-side-panel:not(.is-collapsed) .world-side-toggle .ad-icon {
        transform: rotate(180deg);
    }
}

@media (max-width: 575.98px) {
.world-map-status {
        left: 0.5rem;
        gap: 0.3rem;
    }

.world-map-status > span {
        min-height: 1.85rem;
        padding-inline: 0.46rem;
        font-size: 0.66rem;
    }

.world-map-controls {
        right: 0.5rem;
    }

.world-encounter-player {
        grid-template-columns: auto minmax(0, 1fr);
    }

.world-encounter-player.is-demon-spot {
        grid-template-columns: minmax(0, 1fr);
    }

.world-hunt-rewards {
        grid-template-columns: minmax(0, 1fr);
    }

.world-encounter-player .btn {
        grid-column: 1 / -1;
        justify-self: stretch;
    }

.world-sidebar-card {
        grid-template-columns: minmax(0, 1fr);
    }

.world-sidebar-card .world-card-action {
        justify-self: stretch;
        width: 100%;
    }

.world-pvp-actions {
        justify-content: stretch;
        width: 100%;
    }

.world-pvp-actions .world-card-action {
        flex: 1 1 auto;
    }

.world-scout-action {
        flex: 0 0 2.1rem;
    }

.world-team-editor-title h2 {
        font-size: 1.12rem;
    }

.world-team-editor-head-actions {
        gap: 0.38rem;
    }

.world-team-editor-count {
        min-width: 2.35rem;
        min-height: 1.68rem;
        font-size: 0.62rem;
    }

.world-team-editor-close {
        width: 1.85rem;
        height: 1.85rem;
    }

.world-team-editor-status {
        margin: 0.5rem 0.62rem 0;
        padding: 0.42rem 0.5rem;
        font-size: 0.7rem;
    }

}

@media (max-width: 575.98px) and (orientation: landscape) {
.world-team-editor-collection-grid {
        grid-template-columns: repeat(auto-fill, minmax(4.85rem, 1fr));
    }
}

/* World boss intro dialog — visual-novel style overlay shown on entering the
   world. Framed demon portrait on the left (the art has its own painted
   background, so it gets a gold-rimmed card instead of a cutout), teal glass
   panel and gold trim matching the site palette. */
.world-boss-dialog {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 22% 82%, rgba(111,214,189,0.1), transparent 28rem),
        radial-gradient(circle at 80% 10%, rgba(156,122,200,0.08), transparent 24rem),
        linear-gradient(rgba(3,8,10,0.6), rgba(3,8,10,0.82));
    animation: worldBossDialogFade 260ms ease-out both;
}

@keyframes worldBossDialogFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.world-boss-dialog-stage {
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
    width: min(56rem, 94vw);
    margin: 0 auto clamp(1.2rem, 6vh, 3.6rem);
}

.world-boss-dialog-portrait-frame {
    position: relative;
    flex: none;
    width: clamp(11rem, 22vw, 15rem);
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border: 2px solid rgba(232,199,106,0.62);
    border-radius: 0.9rem;
    background: var(--ad-bg-soft, #0d191d);
    box-shadow:
        inset 0 0 0 2px rgba(7,16,19,0.9),
        inset 0 0 2.4rem rgba(3,8,10,0.55),
        0 0 1.6rem rgba(232,199,106,0.22),
        0 1rem 2.4rem rgba(0,0,0,0.6);
    animation: worldBossPortraitRise 420ms cubic-bezier(0.18, 0.9, 0.32, 1.08) both;
}

/* Soft teal vignette so the painted art blends into the frame edges. */
.world-boss-dialog-portrait-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        linear-gradient(180deg, rgba(3,8,10,0.28), transparent 26%, transparent 72%, rgba(3,8,10,0.42)),
        radial-gradient(circle at 50% 42%, transparent 58%, rgba(7,16,19,0.4));
    pointer-events: none;
}

.world-boss-dialog-crest {
    position: absolute;
    z-index: 2;
    bottom: 0;
    left: 50%;
    width: 88%;
    height: 0.95rem;
    pointer-events: none;
    transform: translateX(-50%);
}

.world-boss-dialog-crest::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0.42rem;
    background:
        linear-gradient(90deg,
            transparent 0 4%,
            var(--rarity-color, #e25041) 16% 43%,
            transparent 43% 57%,
            var(--rarity-color, #e25041) 57% 84%,
            transparent 96% 100%);
    clip-path: polygon(0 100%, 8% 36%, 40% 36%, 44% 100%, 56% 100%, 60% 36%, 92% 36%, 100% 100%);
    filter: drop-shadow(0 0 0.3rem var(--rarity-color, #e25041));
    opacity: 0.95;
}

.world-boss-dialog-crest::after {
    content: "";
    position: absolute;
    bottom: 0.16rem;
    left: 50%;
    width: 0.66rem;
    height: 0.66rem;
    border: 1px solid rgba(255,255,255,0.76);
    background: var(--rarity-color, #e25041);
    box-shadow:
        0 0 0 2px rgba(4,10,12,0.78),
        0 0 0.7rem var(--rarity-color, #e25041);
    transform: translateX(-50%) rotate(45deg);
}

@keyframes worldBossPortraitRise {
    from { transform: translateY(9%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.world-boss-dialog-portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.world-boss-dialog-copy {
    position: relative;
    flex: 1;
    min-width: 0;
    animation: worldBossPanelRise 360ms 90ms cubic-bezier(0.2, 0.85, 0.3, 1.05) both;
}

@keyframes worldBossPanelRise {
    from { transform: translateY(1.4rem); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.world-boss-dialog-nameplate {
    position: relative;
    z-index: 2;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    min-width: 13rem;
    margin: 0 0 -1.1rem 1.6rem;
    padding: 0.5rem 2.3rem 0.55rem;
    border: 2px solid rgba(232,199,106,0.55);
    border-radius: 1.4rem;
    background: linear-gradient(180deg, rgba(38,72,80,0.97) 0%, rgba(22,46,52,0.97) 55%, rgba(12,27,31,0.97) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.1),
        0 0.35rem 0.9rem rgba(0,0,0,0.55);
    text-align: center;
}

.world-boss-dialog-name {
    color: var(--ad-text, #eef8f5);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

.world-boss-dialog-demon {
    color: var(--ad-muted, #9fb6b2);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.world-boss-dialog-rarity {
    font-weight: 700;
}

.world-boss-dialog-panel {
    position: relative;
    min-height: clamp(9rem, 22vh, 12.5rem);
    padding: 1.7rem 1.8rem 3.1rem;
    border: 2px solid rgba(232,199,106,0.55);
    border-radius: 1rem;
    background:
        radial-gradient(circle at 10% 0%, rgba(111,214,189,0.12), transparent 18rem),
        linear-gradient(180deg, rgba(17,34,39,0.96) 0%, rgba(10,21,25,0.97) 55%, rgba(6,13,16,0.98) 100%);
    box-shadow:
        inset 0 0 0 1px rgba(161,212,201,0.14),
        inset 0 0 2.6rem rgba(3,8,10,0.5),
        0 1.1rem 2.6rem rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
}

.world-boss-dialog-text {
    margin: 0;
    color: var(--ad-text, #eef8f5);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.05rem, 1.05rem + 0.4vw, 1.4rem);
    line-height: 1.55;
    text-shadow: 0 1px 2px rgba(0,0,0,0.55);
}

/* Blinking caret while the line types itself out. */
.world-boss-dialog.is-typing .world-boss-dialog-text::after {
    content: "";
    display: inline-block;
    width: 0.55em;
    height: 1em;
    margin-left: 0.18em;
    vertical-align: -0.14em;
    background: rgba(111,214,189,0.8);
    animation: worldBossCaretBlink 900ms steps(2, start) infinite;
}

@keyframes worldBossCaretBlink {
    to { visibility: hidden; }
}

.world-boss-dialog-mute {
    position: absolute;
    left: 1.5rem;
    bottom: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    padding: 0.25rem 0.2rem;
    color: var(--ad-muted, #9fb6b2);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.55);
    cursor: pointer;
    user-select: none;
}

.world-boss-dialog-mute:hover {
    color: var(--ad-text, #eef8f5);
}

.world-boss-dialog-mute input {
    width: 0.9rem;
    height: 0.9rem;
    margin: 0;
    accent-color: var(--ad-gold, #e8c76a);
    cursor: pointer;
}

.world-boss-dialog-continue {
    position: absolute;
    right: 1.5rem;
    bottom: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.4rem;
    border: 0;
    background: none;
    color: var(--ad-gold, #e8c76a);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.55);
    cursor: pointer;
    opacity: 0;
    /* Continue only becomes clickable once the line is fully typed. */
    pointer-events: none;
    transition: opacity 200ms ease;
}

.world-boss-dialog.is-ready .world-boss-dialog-continue {
    opacity: 1;
    pointer-events: auto;
}

.world-boss-dialog-continue:hover,
.world-boss-dialog-continue:focus-visible {
    color: var(--gold-rim, #f6dd9a);
}

.world-boss-dialog-gem {
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    border: 2px solid rgba(138,90,23,0.9);
    border-radius: 0.2rem;
    background: linear-gradient(135deg, var(--gold-top, #f3cf78) 0%, var(--gold-mid, #e3a838) 60%, var(--gold-bottom, #c8861f) 100%);
    box-shadow: 0 0 0.45rem var(--gold-glow, rgba(232,176,74,0.4));
    animation: worldBossGemPulse 1.4s ease-in-out infinite;
}

@keyframes worldBossGemPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0.35rem var(--gold-glow, rgba(232,176,74,0.4)); }
    50% { transform: scale(1.15); box-shadow: 0 0 0.75rem rgba(246,221,154,0.75); }
}

@media (prefers-reduced-motion: reduce) {
    .world-boss-dialog,
    .world-boss-dialog-portrait-frame,
    .world-boss-dialog-copy,
    .world-boss-dialog-gem {
        animation: none;
    }
}

@media (max-width: 767.98px) {
    .world-boss-dialog-stage {
        flex-direction: column;
        align-items: center;
        gap: 0;
        margin-bottom: 1rem;
    }

    .world-boss-dialog-portrait-frame {
        width: clamp(9rem, 42vw, 12rem);
        margin-bottom: -1.4rem;
    }

    /* The nameplate tucks over the portrait's bottom edge, not under it. */
    .world-boss-dialog-copy {
        width: 100%;
        z-index: 1;
    }

    .world-boss-dialog-nameplate {
        display: flex;
        min-width: 0;
        width: fit-content;
        max-width: 92%;
        margin: 0 auto -1.1rem;
        padding: 0.42rem 1.6rem 0.48rem;
    }

    .world-boss-dialog-name {
        font-size: 0.98rem;
    }

    .world-boss-dialog-panel {
        min-height: 8.5rem;
        padding: 1.5rem 1.15rem 2.7rem;
    }

    .world-boss-dialog-mute {
        left: 1.05rem;
        bottom: 0.7rem;
        font-size: 0.72rem;
    }

    .world-boss-dialog-continue {
        right: 1.05rem;
        bottom: 0.7rem;
        font-size: 1rem;
    }
}
