body[data-screen=realm] main {
    max-width: none;
    padding: 0;
    margin-left: 220px
}

body[data-screen=realm] .top,body[data-screen=realm] .intro,body[data-screen=realm] main>footer {
    display: none
}

#financepanels[hidden] {
    display: none!important
}

.realm-shell {
    position: relative;
    height: 100dvh;
    min-height: 700px;
    overflow: hidden;
    background: #101820
}

.realm-canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
    outline-offset: -5px!important
}

.world-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(#07121ee8,transparent 25%,transparent 55%,#07111bf2),linear-gradient(90deg,#08131a88,transparent 40%)
}

.realm-heading {
    position: absolute;
    top: 30px;
    left: 35px;
    pointer-events: none
}

.realm-heading .eyebrow {
    color: #dec28f;
    letter-spacing: 3px
}

.realm-heading h1 {
    font: 600 40px 'Cormorant Garamond',serif;
    margin: 7px 0;
    color: #fff0d5;
    text-shadow: 0 2px 20px #000
}

.realm-heading p {
    color: #c5cdd0;
    font-size: 11px;
    margin: 0
}

.world-toolbar {
    position: absolute;
    right: 26px;
    top: 30px;
    display: flex;
    gap: 8px
}

.world-chip {
    background: #111e29e8;
    border: 1px solid #d0ad6855;
    color: #e3cfaa;
    padding: 10px 13px;
    border-radius: 6px;
    font-size: 11px
}

.world-chip:hover {
    background: #324349
}

.journey {
    position: absolute;
    left: 30px;
    bottom: 28px;
    max-width: 400px;
    width: calc(100% - 60px);
    background: linear-gradient(130deg,#15232af5,#101c25ed);
    backdrop-filter: blur(10px);
    border: 1px solid #d1b27a61;
    border-radius: 9px;
    padding: 20px;
    box-shadow: 0 12px 50px #0005
}

.journey h2 {
    font: 600 25px 'Cormorant Garamond';
    margin: 8px 0;
    color: #f2dfbb
}

.journey p {
    font-size: 12px;
    color: #c0c8c9;
    line-height: 1.65;
    margin: 8px 0 15px
}

.journey .btn {
    width: 100%
}

.journeysteps {
    display: flex;
    gap: 7px;
    margin-bottom: 17px
}

.journeysteps i {
    height: 3px;
    flex: 1;
    background: #4d595a
}

.journeysteps i.done {
    background: #d4b577
}

.world-controls {
    position: absolute;
    right: 26px;
    bottom: 30px;
    display: grid;
    justify-items: end;
    gap: 12px
}

.world-controls p {
    font-size: 10px;
    color: #d0d9dc;
    text-shadow: 0 1px 6px #000;
    margin: 0
}

.place-shortcuts {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: end
}

.place-shortcuts button {
    background: #111d27ed;
    color: #e6d5b1;
    border: 1px solid #6d756b;
    padding: 10px 12px;
    border-radius: 5px;
    font-size: 11px
}

.place-shortcuts button:hover {
    background: #3c4a46
}

.move-pad {
    display: grid;
    grid-template-columns: repeat(3,33px);
    gap: 3px
}

.move-pad button {
    height: 29px;
    background: #0c1923bf;
    border: 1px solid #9da38566;
    color: #d6dbca;
    border-radius: 4px
}

.move-pad button:first-child {
    grid-column: 2
}

.move-pad button:nth-child(2) {
    grid-column: 1;
    grid-row: 2
}

.move-pad button:nth-child(3) {
    grid-column: 2;
    grid-row: 2
}

.move-pad button:nth-child(4) {
    grid-column: 3;
    grid-row: 2
}

.realm-hint {
    position: absolute;
    top: 135px;
    left: 35px;
    max-width: 310px;
    background: #10202bcf;
    border-left: 2px solid #d8af6d;
    padding: 10px 13px;
    color: #d4dce0;
    font-size: 11px;
    line-height: 1.6;
    pointer-events: none
}

.world-modal {
    width: min(580px,94vw);
    max-height: 92dvh;
    overflow: auto;
    padding: 30px;
    background: radial-gradient(ellipse at top,#2c3e44,#14202a 70%);
    border: 1px solid #b99c6766
}

.world-modal h2 {
    font: 600 33px 'Cormorant Garamond';
    margin: 8px 0 14px
}

.world-modal p {
    font-size: 13px;
    color: #bac6c8
}

.world-modal .modal-close {
    float: right;
    background: transparent;
    color: #bfc8c8;
    padding: 5px;
    font-size: 20px
}

.world-modal .notice {
    display: block
}

.location-icon {
    font-size: 36px;
    color: #dbbb81
}

.mission-reward {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    color: #e1c68f;
    font-size: 11px
}

.game-note {
    font-size: 10px!important;
    color: #99aaae!important
}

.recap-list {
    display: grid;
    gap: 10px;
    margin: 20px 0
}

.recap-list div {
    background: #ffffff07;
    padding: 15px;
    border: 1px solid #788e7955;
    border-radius: 6px;
    font-size: 12px
}

.build-options {
    display: grid;
    gap: 12px;
    margin: 20px 0
}

.build-option {
    border: 1px solid #61726866;
    background: #182c32;
    border-radius: 7px;
    padding: 17px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px
}

.build-option h3 {
    font: 600 21px 'Cormorant Garamond';
    color: #ecdbb7
}

.build-option p {
    font-size: 11px;
    margin: 5px 0
}

.build-option button {
    white-space: nowrap;
    font-size: 11px
}

.hero-badge {
    position: absolute;
    left: 35px;
    top: 215px;
    background: #111f29d9;
    border: 1px solid #c4aa6866;
    border-radius: 6px;
    padding: 10px 13px;
    display: flex;
    gap: 12px;
    align-items: center
}

.hero-badge svg {
    width: 34px;
    height: 43px
}

.hero-badge b {
    font: 600 18px 'Cormorant Garamond';
    color: #efdcbb
}

.hero-badge small {
    display: block;
    color: #adbdbd;
    font-size: 10px;
    margin-top: 3px
}

#encounter {
    width: min(850px,96vw);
    padding: 0;
    background: #101a22;
    overflow: auto
}

.battle-top {
    padding: 20px 24px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center
}

.battle-top h2 {
    margin: 4px 0;
    font-size: 28px
}

.battle-stage {
    position: relative;
    height: 280px;
    overflow: hidden;
    background: radial-gradient(ellipse at 65% 45%,#6d50352b,transparent 55%),linear-gradient(#172533,#101922);
    border-block:1px solid #40505a}

.battle-stage:before {
    content: '';
    position: absolute;
    left: -10%;
    right: -10%;
    height: 150px;
    bottom: -60px;
    border-radius: 50%;
    background: radial-gradient(ellipse,#435044,#1a2d30 65%);
    border: 1px solid #65725b55
}

.fighter {
    position: absolute;
    bottom: 40px;
    width: 140px;
    height: 160px;
    display: flex;
    align-items: end;
    justify-content: center
}

.fighter.player {
    left: 13%
}

.fighter.enemy {
    right: 12%;
    width: 190px;
    height: 190px
}

.fighter svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 15px 10px #0009)
}

.fighter.player svg {
    height: 135px
}

.fighter.hit {
    animation: battlehit .4s
}

.fighter.swing {
    animation: swing .4s
}

.fighter.guard:after {
    content: '';
    position: absolute;
    inset: 0;
    border: 3px solid #a7d1cc99;
    border-radius: 50%;
    box-shadow: 0 0 30px #a1ded544
}

.fighter-caption {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    font-size: 11px;
    color: #d0c9b8
}

.battle-hud {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    padding: 15px 24px
}

.battle-hud .bar {
    margin-top: 8px
}

.battle-hud .enemyhealth i {
    background: linear-gradient(90deg,#8c5349,#d6a06f)
}

.battle-intent {
    font-size: 11px;
    color: #e4cfa2;
    text-align: center;
    background: #29322b;
    padding: 11px
}

.battle-actions {
    padding: 18px 24px;
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 10px
}

.battle-actions button {
    border: 1px solid #67715e;
    background: linear-gradient(#354438,#22302d);
    border-radius: 7px;
    color: #f1dfb9;
    padding: 14px 10px;
    text-align: left
}

.battle-actions button:hover {
    border-color: #e5c58b;
    background: #3a4c40
}

.battle-actions button:disabled {
    opacity: .4;
    cursor: not-allowed
}

.battle-actions strong {
    display: block;
    font-size: 12px
}

.battle-actions small {
    display: block;
    font-size: 10px;
    color: #b6c0b8;
    margin-top: 6px
}

.battle-log {
    min-height: 48px;
    font-size: 12px!important;
    padding: 0 24px;
    margin: 0 0 16px!important;
    color: #bcc9c9!important
}

.battle-result {
    padding: 30px;
    text-align: center
}

.battle-result .sigil {
    font-size: 50px;
    color: #dbbb7f;
    margin-bottom: 12px
}

.battle-result h2 {
    font-size: 36px
}

.battle-result p {
    line-height: 1.7
}

.battle-result .btn {
    margin-top: 10px
}

.damage-number {
    position: absolute;
    left: 40%;
    top: 10%;
    font: bold 35px 'Cormorant Garamond';
    color: #ffe0ac;
    animation: damage 1s forwards;
    z-index: 4
}

.demo-strip {
    font-size: 9px;
    letter-spacing: 1.5px;
    color: #91a2a9;
    position: absolute;
    right: 26px;
    top: 82px
}

.motion-toggle {
    background: transparent;
    color: #bac5c5;
    border: 1px solid #516068;
    border-radius: 4px;
    padding: 7px;
    font-size: 10px
}

.mini-amount {
    font: 600 30px 'Cormorant Garamond';
    color: #e4c48b
}

.stage-pill {
    font-size: 9px;
    padding: 6px 9px;
    border: 1px solid #6b745c;
    color: #d7c38e;
    border-radius: 20px
}

.choice-inline {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 17px
}

.travel-status {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 7px 14px;
    background: #14232bc9;
    color: #d1dcdb;
    border: 1px solid #6d7c6b77;
    border-radius: 30px;
    font-size: 11px;
    pointer-events: none;
    display: none
}

@keyframes swing {
    50% {
        transform: translateX(30px) rotate(-8deg)
    }
}

@keyframes battlehit {
    25% {
        transform: translateX(12px);
        filter: brightness(2)
    }

    75% {
        transform: translateX(-6px)
    }
}

@media(max-width: 1100px) {
    .realm-heading,.realm-hint,.hero-badge {
        left:24px
    }

    .journey {
        max-width: 330px;
        left: 24px
    }

    .world-controls {
        right: 20px
    }

    .place-shortcuts {
        max-width: 220px
    }

    .realm-heading h1 {
        font-size: 33px
    }
}

@media(max-width: 750px) {
    body[data-screen=realm] main {
        margin:0
    }

    body[data-screen=realm] aside {
        padding: 12px 15px
    }

    body[data-screen=realm] aside nav {
        margin-top: 10px;
        gap: 2px
    }

    body[data-screen=realm] aside .brand {
        font-size: 20px
    }

    .realm-shell {
        height: calc(100dvh - 111px);
        min-height: 690px
    }

    .realm-heading {
        top: 20px;
        left: 18px
    }

    .realm-heading h1 {
        font-size: 30px
    }

    .realm-heading p {
        max-width: 180px;
        font-size: 10px
    }

    .realm-heading .eyebrow {
        font-size: 8px
    }

    .world-toolbar {
        top: 20px;
        right: 12px;
        flex-direction: column;
        gap: 6px
    }

    .world-chip {
        padding: 8px;
        font-size: 10px
    }

    .demo-strip {
        right: 12px;
        top: 99px;
        font-size: 8px
    }

    .realm-hint {
        top: 125px;
        left: 18px;
        max-width: 230px;
        font-size: 10px;
        padding: 8px 10px
    }

    .hero-badge {
        top: 202px;
        left: 18px;
        padding: 8px
    }

    .hero-badge b {
        font-size: 16px
    }

    .hero-badge svg {
        width: 25px;
        height: 35px
    }

    .journey {
        left: 12px;
        bottom: 66px;
        max-width: none;
        width: calc(100% - 24px);
        padding: 15px
    }

    .journey h2 {
        font-size: 23px;
        margin: 5px 0
    }

    .journey p {
        font-size: 11px;
        line-height: 1.5;
        margin: 6px 0 11px
    }

    .journeysteps {
        margin-bottom: 10px
    }

    .world-controls {
        left: 12px;
        right: 12px;
        bottom: 14px;
        display: block
    }

    .world-controls>p,.move-pad {
        display: none
    }

    .place-shortcuts {
        max-width: none;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 5px
    }

    .place-shortcuts button {
        padding: 9px 8px;
        flex: 1;
        font-size: 10px
    }

    .battle-stage {
        height: 220px
    }

    .battle-actions {
        padding: 14px;
        gap: 6px
    }

    .battle-actions button {
        padding: 12px 8px
    }

    .battle-actions small {
        font-size: 9px;
        line-height: 1.5
    }

    .battle-top {
        padding: 14px
    }

    .battle-top h2 {
        font-size: 24px
    }

    .fighter.player {
        left: 5%;
        width: 110px
    }

    .fighter.enemy {
        right: 5%;
        width: 150px;
        height: 160px
    }

    .battle-hud {
        padding: 14px;
        gap: 15px
    }

    .battle-log {
        padding: 0 14px;
        font-size: 11px!important
    }

    .build-option {
        padding: 13px
    }

    .world-modal {
        padding: 22px
    }

    .travel-status {
        top: 280px;
        width: max-content;
        max-width: 80%;
        font-size: 10px
    }
}

.foldmission {
    position: absolute;
    right: 10px;
    top: 7px;
    background: transparent;
    color: #d9c08b;
    font-size: 22px;
    padding: 5px 9px
}

.journey.folded {
    max-width: 240px;
    padding: 13px 18px
}

.journey.folded .journeysteps,.journey.folded p,.journey.folded .btn,.journey.folded .eyebrow {
    display: none
}

.journey.folded h2 {
    font-size: 18px;
    margin: 0;
    padding-right: 24px
}

.hero-badge {
    top: 205px
}

.realm-hint {
    max-width: 280px
}

.world-vignette {
    background: linear-gradient(#07121ec9,transparent 26%,transparent 76%,#07111b99);
    pointer-events: none
}

.world-controls .motion-toggle {
    padding: 6px 10px
}

@media(max-width: 750px) {
    .world-toolbar {
        display:grid;
        grid-template-columns: 1fr 1fr;
        gap: 5px
    }

    .world-toolbar #worldcoins,.world-toolbar #worldtreasury {
        grid-column: 1/3
    }

    .demo-strip {
        top: 149px
    }

    .hero-badge {
        top: 190px
    }

    .realm-hint {
        top: 110px;
        max-width: 200px
    }

    .realm-shell {
        min-height: 690px
    }

    .journey.folded {
        width: calc(100% - 24px);
        max-width: none
    }

    .hero-badge {
        pointer-events: none
    }
}

/* Town-overview presentation: direct building selection, no character navigation. */
.realm-canvas {
    cursor: grab
}

.realm-canvas:active {
    cursor: grabbing
}

.move-pad,.hero-badge {
    display: none
}

.realm-hint {
    top: 133px;
    max-width: 240px;
    border: 0;
    background: none;
    padding: 0;
    color: #9cabb2
}

.realm-heading h1 {
    font-size: 43px;
    letter-spacing: .5px
}

.world-controls {
    bottom: 28px
}

.journey {
    max-width: 310px;
    background: #12212ce8;
    border-color: #8c794b55;
    padding: 17px
}

.journey h2 {
    font-size: 23px
}

.journey p {
    font-size: 11px
}

.journey .eyebrow {
    font-size: 8px
}

.journeysteps {
    margin-bottom: 10px
}

.world-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 350px
}

.realm-shell {
    background: #101e29
}

.world-vignette {
    background: linear-gradient(#091621c9,transparent 25%,transparent 75%,#09162199)
}

.demo-strip {
    top: 84px
}

.place-shortcuts button {
    backdrop-filter: blur(10px);
    background: #14232ddb;
    border-color: #7f795e66
}

.world-controls p {
    color: #9faeb4
}

.realm-heading p {
    font-size: 11px;
    color: #b6c3c9
}

.world-chip {
    border-color: #8d7c5444
}

.realm-hint {
    pointer-events: none
}

@media(max-width: 750px) {
    .realm-heading h1 {
        font-size:31px
    }

    .realm-heading {
        left: 18px
    }

    .realm-heading p {
        max-width: 190px
    }

    .world-toolbar {
        display: grid;
        grid-template-columns: repeat(3,30px);
        max-width: 110px
    }

    .world-toolbar #worldcoins,.world-toolbar #worldtreasury {
        grid-column: 1/4
    }

    .world-toolbar .world-chip {
        padding: 7px 4px
    }

    .demo-strip {
        top: 143px;
        font-size: 7px
    }

    .realm-hint {
        top: 112px;
        max-width: 195px;
        font-size: 9px
    }

    .journey {
        bottom: 62px;
        max-width: none;
        left: 12px
    }

    .journey h2 {
        font-size: 22px
    }

    .journey p {
        max-height: 34px;
        overflow: hidden
    }

    .world-controls {
        bottom: 13px
    }

    .realm-shell {
        min-height: 650px
    }
}
