.rpgvm-wrap,
.rpgvm-wrap * {
    box-sizing: border-box;
}

.rpgvm-wrap {
    position: relative;
    width: 100%;
    min-height: 640px;
    height: min(760px, 100vh);
    overflow: hidden;
    background: #101914;
    border: 2px solid rgba(255,255,255,0.18);
    border-radius: 14px;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    touch-action: none;
    user-select: none;
}

.rpgvm-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: #182418;
}

.rpgvm-topbar {
    position: absolute;
    z-index: 5;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(0,0,0,0.58);
    border: 1px solid rgba(255,255,255,0.18);
    pointer-events: none;
}

.rpgvm-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-weight: 800;
    font-size: 16px;
    white-space: normal;
    line-height: 1.05;
    min-width: 190px;
}

.rpgvm-title-main {
    font-weight: 1000;
    font-size: clamp(12px, 1.55vw, 16px);
}

.rpgvm-title-copy {
    color: #ffd36b;
    font-weight: 900;
    font-size: 11px;
    letter-spacing: 0.3px;
}

.rpgvm-titlebar-spell-slot {
    flex: 1 1 auto;
    min-width: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

.rpgvm-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 12px;
    font-size: 13px;
}

/* v1.7.132: Title bar layout locked: title left, spell toolbar centered, stats right. */
.rpgvm-topbar {
    display: grid;
    grid-template-columns: minmax(180px, 0.9fr) minmax(250px, 1.1fr) minmax(260px, 1.4fr);
}
.rpgvm-stats {
    justify-content: flex-end;
    align-items: center;
    text-align: right;
}

.rpgvm-message {
    position: absolute;
    z-index: 5;
    left: 10px;
    right: 10px;
    bottom: 92px;
    max-width: 760px;
    margin: 0 auto;
    padding: 9px 12px;
    border-radius: 12px;
    background: rgba(0,0,0,0.58);
    border: 1px solid rgba(255,255,255,0.16);
    color: #fff;
    font-size: 14px;
    line-height: 1.35;
    text-align: center;
    pointer-events: none;
}

.rpgvm-level-popup {
    position: absolute;
    z-index: 20;
    left: 50%;
    top: 96px;
    transform: translate(-50%, 0) scale(0.88);
    min-width: min(520px, calc(100% - 32px));
    padding: 14px 20px;
    border-radius: 18px;
    background: rgba(0,0,0,0.34);
    border: 3px solid rgba(255,255,255,0.48);
    box-shadow: 0 14px 38px rgba(0,0,0,0.38);
    backdrop-filter: blur(2px);
    color: #ff2020;
    font-size: clamp(28px, 6vw, 54px);
    font-weight: 1000;
    line-height: 1.05;
    text-align: center;
    text-shadow: 0 3px 0 #000, 0 0 16px rgba(255,0,0,0.8);
    pointer-events: none;
    opacity: 0;
    transition: opacity 180ms ease, transform 180ms ease;
}

.rpgvm-level-popup.is-visible {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.rpgvm-minimap {
    position: absolute;
    z-index: 6;
    right: 12px;
    top: 72px;
    width: 132px;
    height: 132px;
    padding: 5px;
    border-radius: 12px;
    background: rgba(0,0,0,0.62);
    border: 1px solid rgba(255,255,255,0.22);
}

.rpgvm-minimap canvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 8px;
    background: #172416;
}

.rpgvm-controls {
    position: absolute;
    z-index: 7;
    left: 12px;
    right: 12px;
    bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: end;
    pointer-events: none;
}

.rpgvm-dpad {
    position: relative;
    width: 138px;
    height: 92px;
    pointer-events: auto;
}

.rpgvm-btn,
.rpgvm-action {
    border: 1px solid rgba(255,255,255,0.28);
    background: rgba(0,0,0,0.66);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 6px 14px rgba(0,0,0,0.35);
    touch-action: none;
}

.rpgvm-btn {
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 18px;
}

.rpgvm-btn.rpgvm-up { left: 47px; top: 0; }
.rpgvm-btn.rpgvm-left { left: 0; top: 46px; }
.rpgvm-btn.rpgvm-right { left: 94px; top: 46px; }
.rpgvm-btn.rpgvm-down { left: 47px; top: 46px; }

.rpgvm-action {
    min-width: 112px;
    height: 58px;
    border-radius: 18px;
    font-size: 16px;
    pointer-events: auto;
}

.rpgvm-btn:active,
.rpgvm-btn.isDown,
.rpgvm-action:active,
.rpgvm-action.isDown {
    transform: translateY(2px) scale(0.98);
    background: rgba(255,255,255,0.18);
}

@media (max-width: 700px) {
    .rpgvm-wrap {
        width: 100vw;
        height: 100vh;
        min-height: 100vh;
        margin-left: calc(50% - 50vw);
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    .rpgvm-topbar {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "title stats"
            "toolbar toolbar";
        align-items: center;
        gap: 4px 6px;
        padding: 6px 7px;
    }

    .rpgvm-title {
        grid-area: title;
        min-width: 0;
    }

    .rpgvm-titlebar-spell-slot {
        grid-area: toolbar;
        justify-content: center;
        min-width: 0;
        width: 100%;
    }

    .rpgvm-stats {
        grid-area: stats;
        justify-content: flex-end;
        text-align: right;
        font-size: 11px;
        gap: 3px 6px;
    }

    .rpgvm-minimap {
        top: 112px;
        width: 104px;
        height: 104px;
    }

    .rpgvm-message {
        bottom: 106px;
        font-size: 13px;
    }

    .rpgvm-dpad {
        width: 154px;
        height: 104px;
    }

    .rpgvm-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .rpgvm-btn.rpgvm-up { left: 52px; top: 0; }
    .rpgvm-btn.rpgvm-left { left: 0; top: 52px; }
    .rpgvm-btn.rpgvm-right { left: 104px; top: 52px; }
    .rpgvm-btn.rpgvm-down { left: 52px; top: 52px; }

    .rpgvm-action {
        min-width: 116px;
        height: 64px;
    }
}

/* v1.7.30 inventory food row and drawer fix: keep food rows from inheriting theme button styles. */
.rpgvm-inventory-panel .rpgvm-inventory-use,
.rpgvm-inventory-panel .rpgvm-food-use {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 4px 0;
    padding: 6px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.22);
    background: rgba(45,25,11,0.82);
    color: #fff7c8;
    font: 900 12px Arial, sans-serif;
    text-shadow: 0 1px 0 #000;
    cursor: pointer;
}

.rpgvm-inventory-panel .rpgvm-inventory-food-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 170px;
    overflow-y: auto;
    padding-right: 6px;
}

.rpgvm-inventory-panel .rpgvm-food-use {
    margin: 0;
    min-height: 30px;
    gap: 8px;
}

.rpgvm-inventory-panel .rpgvm-food-use-name {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rpgvm-inventory-panel .rpgvm-food-use-count {
    margin-left: auto;
    min-width: 26px;
    text-align: right;
    font: 1000 12px Arial, sans-serif;
}

/* v1.7.30 inventory drawer: closable, and zero-count inventory rows stay hidden. */
.rpgvm-inventory-panel[hidden],
.rpgvm-inventory-panel [hidden] {
    display: none !important;
}

.rpgvm-inventory-panel .rpgvm-inventory-drawer-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 6px;
    border: 0;
    background: transparent;
    color: #ffe08a;
    font: 1000 13px Arial, sans-serif;
    text-shadow: 0 2px 0 #000;
    cursor: pointer;
}

.rpgvm-inventory-panel .rpgvm-inventory-drawer-toggle strong {
    margin-left: auto;
    min-width: 22px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.16);
    color: #fff7c8;
    text-align: center;
    font: 1000 12px Arial, sans-serif;
}

.rpgvm-inventory-panel .rpgvm-inventory-drawer-toggle em {
    font-style: normal;
    line-height: 1;
}

.rpgvm-inventory-panel.is-closed .rpgvm-inventory-body {
    display: none !important;
}


/* v1.7.50 quest log drawer */
.rpgvm-quest-panel,
.rpgvm-quest-panel * {
    box-sizing: border-box;
}

.rpgvm-quest-panel[hidden],
.rpgvm-quest-panel [hidden] {
    display: none !important;
}

.rpgvm-quest-panel .rpgvm-quest-drawer-toggle,
.rpgvm-quest-panel .rpgvm-quest-section-head {
    font-family: Arial, Helvetica, sans-serif;
}

.rpgvm-quest-panel.is-closed .rpgvm-quest-body {
    display: none !important;
}

.rpgvm-quest-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rpgvm-quest-item {
    padding: 7px 8px;
    border-radius: 10px;
    background: rgba(10,15,10,0.70);
    border: 1px solid rgba(255,255,255,0.14);
}

.rpgvm-quest-item-title {
    font: 1000 12px Arial, sans-serif;
    color: #fff7c8;
    text-shadow: 0 1px 0 #000;
}

.rpgvm-quest-item-detail {
    margin-top: 2px;
    font: 800 11px Arial, sans-serif;
    color: rgba(255,255,255,0.86);
    line-height: 1.25;
}

.rpgvm-quest-progress {
    margin-top: 4px;
    font: 1000 11px Arial, sans-serif;
    color: #a8ffbc;
}

.rpgvm-quest-empty {
    padding: 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    font: 900 11px Arial, sans-serif;
    color: rgba(255,255,255,0.82);
}

@media (max-width: 700px) {
    .rpgvm-quest-panel {
        top: 222px !important;
        width: 220px !important;
        max-width: calc(100vw - 24px) !important;
        max-height: calc(100% - 330px) !important;
    }

    .rpgvm-quest-panel.is-closed {
        width: 126px !important;
    }
}

/* v1.7.61 splash first gate: shortcode shows only splash, then starts game. */
.rpgvm-shortcode-shell,
.rpgvm-shortcode-shell * {
    box-sizing: border-box;
}

.rpgvm-shortcode-shell {
    position: relative;
    width: 100%;
    min-height: 640px;
    height: min(760px, 100vh);
    overflow: hidden;
    background: #030607;
    border: 2px solid rgba(255,255,255,0.18);
    border-radius: 14px;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
}

.rpgvm-shortcode-shell > .rpgvm-wrap {
    width: 100%;
    height: 100%;
    min-height: 100%;
    border: 0;
    border-radius: 0;
}

.rpgvm-shortcode-shell > .rpgvm-wrap[hidden],
.rpgvm-wrap[data-rpgvm-defer-init="1"] {
    display: none !important;
}

.rpgvm-splash-gate {
    position: absolute;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background:
        radial-gradient(circle at 50% 38%, rgba(150, 0, 0, 0.45), rgba(0,0,0,0.92) 58%, rgba(0,0,0,1) 100%),
        #050505;
}

.rpgvm-splash-card {
    width: min(980px, 96%);
    max-height: calc(100% - 24px);
    padding: 16px;
    border-radius: 20px;
    background: rgba(0,0,0,0.78);
    border: 2px solid rgba(255,255,255,0.24);
    box-shadow: 0 20px 60px rgba(0,0,0,0.65), 0 0 36px rgba(255, 0, 0, 0.18);
    text-align: center;
}

.rpgvm-splash-title {
    margin: 0 0 12px;
    color: #ffe08a;
    font: 1000 clamp(24px, 5vw, 46px) Arial, Helvetica, sans-serif;
    text-shadow: 0 3px 0 #000, 0 0 18px rgba(255,0,0,0.55);
}

.rpgvm-splash-video {
    display: block;
    width: 100%;
    max-height: min(560px, 68vh);
    margin: 0 auto;
    border-radius: 14px;
    background: #000;
    border: 1px solid rgba(255,255,255,0.18);
    object-fit: contain;
}

.rpgvm-splash-placeholder {
    min-height: min(420px, 58vh);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    border-radius: 14px;
    background: rgba(35, 0, 0, 0.62);
    border: 1px solid rgba(255,255,255,0.14);
}

.rpgvm-splash-placeholder strong {
    color: #fff7c8;
    font: 1000 28px Arial, Helvetica, sans-serif;
    text-shadow: 0 2px 0 #000;
}

.rpgvm-splash-placeholder span {
    color: rgba(255,255,255,0.86);
    font: 900 15px Arial, Helvetica, sans-serif;
}

.rpgvm-splash-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 14px;
    flex-wrap: wrap;
}

.rpgvm-splash-actions button {
    min-width: 132px;
    min-height: 48px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.32);
    background: linear-gradient(#b86b1f, #6d2809);
    color: #fff;
    font: 1000 18px Arial, Helvetica, sans-serif;
    text-shadow: 0 2px 0 #000;
    box-shadow: 0 8px 18px rgba(0,0,0,0.38);
    cursor: pointer;
}

.rpgvm-splash-actions button:active {
    transform: translateY(2px) scale(0.98);
}

@media (max-width: 700px) {
    .rpgvm-shortcode-shell {
        width: 100vw;
        height: 100vh;
        min-height: 100vh;
        margin-left: calc(50% - 50vw);
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    .rpgvm-splash-card {
        width: 100%;
        padding: 12px;
    }

    .rpgvm-splash-actions button {
        min-width: 110px;
        min-height: 46px;
        font-size: 16px;
    }
}


/* v1.7.64 splash fit controls: buttons pinned visible. */
.rpgvm-shortcode-shell {
    min-height: 0 !important;
    height: min(680px, calc(100vh - 120px)) !important;
    overflow: hidden !important;
}
.rpgvm-splash-gate {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px !important;
    overflow: hidden !important;
}
.rpgvm-splash-card {
    width: min(1220px, calc(100% - 32px)) !important;
    max-width: 1220px !important;
    max-height: calc(100% - 24px) !important;
    margin: auto !important;
    padding: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}
.rpgvm-splash-title {
    flex: 0 0 auto !important;
    margin: 0 0 8px !important;
    font-size: clamp(18px, 3vw, 32px) !important;
    line-height: 1.05 !important;
}
.rpgvm-splash-video {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: 1220px !important;
    height: auto !important;
    max-height: min(660px, calc(100vh - 190px), calc(100% - 90px)) !important;
    object-fit: contain !important;
    object-position: center center !important;
    margin: 0 auto !important;
}
.rpgvm-splash-placeholder {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: 1220px !important;
    min-height: 260px !important;
    max-height: min(660px, calc(100vh - 190px), calc(100% - 90px)) !important;
}
.rpgvm-splash-actions {
    flex: 0 0 auto !important;
    display: flex !important;
    gap: 12px !important;
    justify-content: center !important;
    align-items: center !important;
    margin-top: 10px !important;
    flex-wrap: wrap !important;
}
.rpgvm-splash-actions button {
    min-width: 130px !important;
    min-height: 44px !important;
}
@media (max-width: 700px) {
    .rpgvm-shortcode-shell {
        height: 100svh !important;
        min-height: 0 !important;
    }
    .rpgvm-splash-gate { padding: 8px !important; }
    .rpgvm-splash-card {
        width: calc(100% - 12px) !important;
        max-height: calc(100% - 12px) !important;
        padding: 10px !important;
    }
    .rpgvm-splash-video,
    .rpgvm-splash-placeholder {
        max-height: calc(100svh - 160px) !important;
    }
}


/* v1.7.64 final splash control fix: Play/Skip stay visible inside popup. */
.rpgvm-splash-card {
    position: relative !important;
    width: min(1220px, calc(100% - 32px)) !important;
    max-width: 1220px !important;
    height: min(760px, calc(100vh - 110px), calc(100% - 20px)) !important;
    max-height: calc(100% - 20px) !important;
    padding: 10px 10px 74px !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    overflow: hidden !important;
}
.rpgvm-splash-video,
.rpgvm-splash-placeholder {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
}
.rpgvm-splash-actions {
    position: absolute !important;
    left: 50% !important;
    bottom: 12px !important;
    z-index: 5 !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    gap: 12px !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    flex-wrap: nowrap !important;
    border-radius: 16px !important;
    background: rgba(0,0,0,0.70) !important;
    border: 1px solid rgba(255,255,255,0.20) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.45) !important;
}
@media (max-width: 700px) {
    .rpgvm-splash-card {
        height: calc(100% - 12px) !important;
        padding: 8px 8px 68px !important;
    }
}

/* v1.7.66 game title copyright and first shard quest. */
.rpgvm-splash-title small {
    display: block !important;
    margin-top: 4px !important;
    color: #ffd36b !important;
    font: 900 clamp(11px, 1.5vw, 14px)/1 Arial, Helvetica, sans-serif !important;
    letter-spacing: 0.4px !important;
}


/* v1.7.79 bottom panels visible fix: keep Inventory and Quest Log at the bottom of the game shell. */
.rpgvm-shortcode-shell > .rpgvm-wrap:not([hidden]) {
    display: block !important;
}

.rpgvm-wrap {
    position: relative !important;
    display: block !important;
    padding: 0 !important;
    overflow: hidden !important;
    min-height: 0 !important;
}

.rpgvm-canvas {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 156px !important;
    width: 100% !important;
    height: calc(100% - 156px) !important;
    min-width: 0 !important;
    min-height: 260px !important;
    display: block !important;
}

.rpgvm-inventory-panel,
.rpgvm-quest-panel {
    display: block !important;
    position: absolute !important;
    top: auto !important;
    bottom: 8px !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    max-height: 140px !important;
    min-height: 40px !important;
    z-index: 30 !important;
    overflow: hidden !important;
    margin: 0 !important;
    pointer-events: auto !important;
}

.rpgvm-inventory-panel {
    left: 8px !important;
    right: calc(50% + 4px) !important;
}

.rpgvm-quest-panel {
    left: calc(50% + 4px) !important;
    right: 8px !important;
}

.rpgvm-inventory-panel.is-open,
.rpgvm-quest-panel.is-open {
    max-height: 140px !important;
}

.rpgvm-inventory-panel.is-closed,
.rpgvm-quest-panel.is-closed {
    max-height: 40px !important;
}

.rpgvm-inventory-panel .rpgvm-inventory-body,
.rpgvm-quest-panel .rpgvm-quest-body {
    max-height: 86px !important;
    overflow-y: auto !important;
}

.rpgvm-inventory-panel[hidden],
.rpgvm-quest-panel[hidden] {
    display: block !important;
}

.rpgvm-controls {
    bottom: 164px !important;
}

.rpgvm-message {
    bottom: 236px !important;
}

@media (max-width: 700px) {
    .rpgvm-canvas {
        bottom: 126px !important;
        height: calc(100% - 126px) !important;
        min-height: 220px !important;
    }

    .rpgvm-inventory-panel,
    .rpgvm-quest-panel {
        bottom: 5px !important;
        max-height: 116px !important;
        min-height: 38px !important;
    }

    .rpgvm-inventory-panel {
        left: 5px !important;
        right: calc(50% + 3px) !important;
    }

    .rpgvm-quest-panel {
        left: calc(50% + 3px) !important;
        right: 5px !important;
    }

    .rpgvm-inventory-panel.is-open,
    .rpgvm-quest-panel.is-open {
        max-height: 116px !important;
    }

    .rpgvm-inventory-panel.is-closed,
    .rpgvm-quest-panel.is-closed {
        max-height: 38px !important;
    }

    .rpgvm-inventory-panel .rpgvm-inventory-body,
    .rpgvm-quest-panel .rpgvm-quest-body {
        max-height: 64px !important;
    }

    .rpgvm-controls {
        bottom: 132px !important;
    }

    .rpgvm-message {
        bottom: 200px !important;
        font-size: 12px !important;
    }
}


/* v1.7.80 final bottom panels visibility fix. */
.rpgvm-shortcode-shell > .rpgvm-wrap:not([hidden]) {
    position: relative !important;
    display: block !important;
    overflow: hidden !important;
    padding: 0 !important;
    background: #02050b !important;
}
.rpgvm-shortcode-shell .rpgvm-canvas {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 164px !important;
    width: 100% !important;
    height: calc(100% - 164px) !important;
    min-width: 0 !important;
    min-height: 260px !important;
    display: block !important;
}
.rpgvm-shortcode-shell .rpgvm-inventory-panel,
.rpgvm-shortcode-shell .rpgvm-quest-panel {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute !important;
    top: auto !important;
    bottom: 8px !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    max-height: 148px !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 9px !important;
    overflow: hidden !important;
    transform: none !important;
    clip: auto !important;
    clip-path: none !important;
    z-index: 9999 !important;
    background: rgba(0,0,0,0.78) !important;
    border: 1px solid rgba(255,255,255,0.24) !important;
    border-radius: 14px !important;
    box-shadow: 0 10px 26px rgba(0,0,0,0.45) !important;
    color: #fff !important;
    pointer-events: auto !important;
}
.rpgvm-shortcode-shell .rpgvm-inventory-panel {
    left: 8px !important;
    right: calc(50% + 4px) !important;
}
.rpgvm-shortcode-shell .rpgvm-quest-panel {
    left: calc(50% + 4px) !important;
    right: 8px !important;
}
.rpgvm-shortcode-shell .rpgvm-inventory-panel[hidden],
.rpgvm-shortcode-shell .rpgvm-quest-panel[hidden] {
    display: block !important;
    visibility: visible !important;
}
.rpgvm-shortcode-shell .rpgvm-inventory-panel.is-closed,
.rpgvm-shortcode-shell .rpgvm-quest-panel.is-closed {
    max-height: 42px !important;
    padding: 0 !important;
}
.rpgvm-shortcode-shell .rpgvm-inventory-panel .rpgvm-inventory-body,
.rpgvm-shortcode-shell .rpgvm-quest-panel .rpgvm-quest-body {
    max-height: 94px !important;
    overflow-y: auto !important;
}
.rpgvm-shortcode-shell .rpgvm-controls {
    bottom: 172px !important;
}
.rpgvm-shortcode-shell .rpgvm-message {
    bottom: 244px !important;
}
@media (max-width: 700px) {
    .rpgvm-shortcode-shell .rpgvm-canvas {
        bottom: 128px !important;
        height: calc(100% - 128px) !important;
        min-height: 220px !important;
    }
    .rpgvm-shortcode-shell .rpgvm-inventory-panel,
    .rpgvm-shortcode-shell .rpgvm-quest-panel {
        bottom: 5px !important;
        max-height: 116px !important;
        min-height: 38px !important;
        padding: 7px !important;
    }
    .rpgvm-shortcode-shell .rpgvm-inventory-panel {
        left: 5px !important;
        right: calc(50% + 3px) !important;
    }
    .rpgvm-shortcode-shell .rpgvm-quest-panel {
        left: calc(50% + 3px) !important;
        right: 5px !important;
    }
    .rpgvm-shortcode-shell .rpgvm-inventory-panel.is-closed,
    .rpgvm-shortcode-shell .rpgvm-quest-panel.is-closed {
        max-height: 38px !important;
        padding: 0 !important;
    }
    .rpgvm-shortcode-shell .rpgvm-inventory-panel .rpgvm-inventory-body,
    .rpgvm-shortcode-shell .rpgvm-quest-panel .rpgvm-quest-body {
        max-height: 64px !important;
    }
    .rpgvm-shortcode-shell .rpgvm-controls {
        bottom: 136px !important;
    }
    .rpgvm-shortcode-shell .rpgvm-message {
        bottom: 202px !important;
        font-size: 12px !important;
    }
}


/* v1.7.82 CSS-only compact bottom panel fix: no empty dark space below Inventory / Quest Log. */
.rpgvm-shortcode-shell {
    height: calc(100vh - 92px) !important;
    max-height: none !important;
    min-height: 560px !important;
    overflow: hidden !important;
}
@supports (height: 100svh) {
    .rpgvm-shortcode-shell {
        height: calc(100svh - 92px) !important;
    }
}
.rpgvm-shortcode-shell > .rpgvm-wrap:not([hidden]) {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    background: #02050b !important;
}
.rpgvm-shortcode-shell .rpgvm-canvas {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 126px !important;
    width: 100% !important;
    height: calc(100% - 126px) !important;
    min-height: 0 !important;
    display: block !important;
}
.rpgvm-shortcode-shell .rpgvm-inventory-panel,
.rpgvm-shortcode-shell .rpgvm-quest-panel {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute !important;
    top: auto !important;
    bottom: 6px !important;
    width: auto !important;
    height: auto !important;
    max-height: 112px !important;
    min-height: 34px !important;
    margin: 0 !important;
    padding: 6px !important;
    overflow: hidden !important;
    transform: none !important;
    clip: auto !important;
    clip-path: none !important;
    z-index: 9999 !important;
    background: rgba(0,0,0,0.82) !important;
    border: 1px solid rgba(255,255,255,0.24) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 18px rgba(0,0,0,0.40) !important;
    color: #fff !important;
    pointer-events: auto !important;
}
.rpgvm-shortcode-shell .rpgvm-inventory-panel {
    left: 6px !important;
    right: calc(50% + 4px) !important;
}
.rpgvm-shortcode-shell .rpgvm-quest-panel {
    left: calc(50% + 4px) !important;
    right: 6px !important;
}
.rpgvm-shortcode-shell .rpgvm-inventory-panel[hidden],
.rpgvm-shortcode-shell .rpgvm-quest-panel[hidden] {
    display: block !important;
    visibility: visible !important;
}
.rpgvm-shortcode-shell .rpgvm-inventory-panel.is-closed,
.rpgvm-shortcode-shell .rpgvm-quest-panel.is-closed {
    max-height: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
}
.rpgvm-shortcode-shell .rpgvm-inventory-panel .rpgvm-inventory-drawer-toggle,
.rpgvm-shortcode-shell .rpgvm-quest-panel .rpgvm-quest-drawer-toggle {
    min-height: 28px !important;
    padding: 4px 8px !important;
}
.rpgvm-shortcode-shell .rpgvm-inventory-panel .rpgvm-inventory-body,
.rpgvm-shortcode-shell .rpgvm-quest-panel .rpgvm-quest-body {
    max-height: 70px !important;
    overflow-y: auto !important;
}
.rpgvm-shortcode-shell .rpgvm-controls {
    bottom: 134px !important;
}
.rpgvm-shortcode-shell .rpgvm-message {
    bottom: 205px !important;
}
@media (max-width: 700px) {
    .rpgvm-shortcode-shell {
        height: 100svh !important;
        min-height: 100svh !important;
        margin-left: calc(50% - 50vw) !important;
    }
    .rpgvm-shortcode-shell .rpgvm-canvas {
        bottom: 166px !important;
        height: calc(100% - 166px) !important;
        min-height: 0 !important;
    }
    .rpgvm-shortcode-shell .rpgvm-inventory-panel,
    .rpgvm-shortcode-shell .rpgvm-quest-panel {
        left: 5px !important;
        right: 5px !important;
        max-height: 76px !important;
        min-height: 32px !important;
        padding: 5px !important;
    }
    .rpgvm-shortcode-shell .rpgvm-inventory-panel {
        bottom: 84px !important;
    }
    .rpgvm-shortcode-shell .rpgvm-quest-panel {
        bottom: 5px !important;
    }
    .rpgvm-shortcode-shell .rpgvm-inventory-panel.is-closed,
    .rpgvm-shortcode-shell .rpgvm-quest-panel.is-closed {
        max-height: 32px !important;
        min-height: 32px !important;
        padding: 0 !important;
    }
    .rpgvm-shortcode-shell .rpgvm-inventory-panel .rpgvm-inventory-body,
    .rpgvm-shortcode-shell .rpgvm-quest-panel .rpgvm-quest-body {
        max-height: 39px !important;
        overflow-y: auto !important;
    }
    .rpgvm-shortcode-shell .rpgvm-controls {
        bottom: 174px !important;
    }
    .rpgvm-shortcode-shell .rpgvm-message {
        bottom: 238px !important;
        font-size: 12px !important;
    }
}


/* v1.7.82 CSS-only game hub iframe height fix: do not subtract parent toolbar height inside iframe. */
.rpgvm-shortcode-shell {
    height: 100vh !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: hidden !important;
}
@supports (height: 100svh) {
    .rpgvm-shortcode-shell {
        height: 100svh !important;
    }
}
.rpgvm-shortcode-shell > .rpgvm-wrap:not([hidden]) {
    height: 100% !important;
    overflow: hidden !important;
}
.rpgvm-shortcode-shell .rpgvm-canvas {
    bottom: 126px !important;
    height: calc(100% - 126px) !important;
}
.rpgvm-shortcode-shell .rpgvm-inventory-panel,
.rpgvm-shortcode-shell .rpgvm-quest-panel {
    bottom: 6px !important;
}
@media (max-width: 700px) {
    .rpgvm-shortcode-shell {
        height: 100svh !important;
        min-height: 0 !important;
    }
}

/* v1.7.84: hide the default center help overlay when there is no active message. */
.rpgvm-message:empty {
    display: none !important;
}


/* v1.7.85: fully hide the center message box unless showMessage() adds .is-visible. */
.rpgvm-message:not(.is-visible),
.rpgvm-shortcode-shell .rpgvm-message:not(.is-visible) {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}
.rpgvm-message.is-visible,
.rpgvm-shortcode-shell .rpgvm-message.is-visible {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}


/* v1.7.170 right-side bandage quick toolbar */
.rpgvm-bandage-toolbar {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10020;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: auto;
}
.rpgvm-bandage-toolbar-btn {
    width: 86px;
    min-height: 58px;
    border: 2px solid rgba(255,255,255,0.35);
    border-radius: 14px;
    background: rgba(61,26,12,0.88);
    color: #fff7c8;
    box-shadow: 0 8px 18px rgba(0,0,0,0.45);
    text-shadow: 0 2px 0 #000;
    font-family: Arial, sans-serif;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    touch-action: manipulation;
}
.rpgvm-bandage-toolbar-btn:hover,
.rpgvm-bandage-toolbar-btn:focus {
    background: rgba(94,45,18,0.95);
    outline: none;
}
.rpgvm-bandage-toolbar-btn.is-empty {
    opacity: 0.46;
    filter: grayscale(0.85);
}
.rpgvm-bandage-toolbar-key {
    font-size: 12px;
    color: #ffd86c;
}
.rpgvm-bandage-toolbar-name {
    font-size: 13px;
    line-height: 1.05;
}
.rpgvm-bandage-toolbar-btn strong {
    min-width: 26px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255,255,255,0.16);
    color: #fff;
    font-size: 13px;
}
@media (max-width: 700px) {
    .rpgvm-bandage-toolbar {
        right: 5px;
        top: 45%;
        gap: 6px;
    }
    .rpgvm-bandage-toolbar-btn {
        width: 68px;
        min-height: 50px;
        border-radius: 12px;
    }
    .rpgvm-bandage-toolbar-key { font-size: 11px; }
    .rpgvm-bandage-toolbar-name { font-size: 11px; }
    .rpgvm-bandage-toolbar-btn strong { font-size: 12px; }
}


/* v1.7.175 mobile movement controls: stop arrow text selection/callout while pressing. */
.rpgvm-wrap,
.rpgvm-wrap *,
.rpgvm-shortcode-shell,
.rpgvm-shortcode-shell *,
.rpgvm-controls,
.rpgvm-controls *,
.rpgvm-dpad,
.rpgvm-dpad *,
.rpgvm-btn,
.rpgvm-action,
.rpgvm-bandage-toolbar,
.rpgvm-bandage-toolbar * {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-tap-highlight-color: transparent !important;
}
.rpgvm-controls,
.rpgvm-dpad,
.rpgvm-btn,
.rpgvm-action {
    touch-action: none !important;
    -webkit-user-drag: none !important;
    overscroll-behavior: none !important;
}
.rpgvm-btn::selection,
.rpgvm-action::selection,
.rpgvm-bandage-toolbar-btn::selection {
    background: transparent !important;
    color: inherit !important;
}

/* v1.7.369: top sound options button/panel. */
.rpgvm-topbar {
    grid-template-columns: minmax(180px, 0.9fr) minmax(250px, 1.1fr) auto minmax(260px, 1.4fr);
}
.rpgvm-options-toggle {
    pointer-events: auto;
    justify-self: center;
    align-self: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 225, 120, 0.85);
    background: rgba(15, 12, 4, 0.92);
    color: #ffd76a;
    font-size: 18px;
    font-weight: 1000;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(255, 203, 70, 0.25);
}
.rpgvm-options-toggle[aria-expanded="true"] {
    background: rgba(70, 45, 6, 0.96);
    box-shadow: 0 0 18px rgba(255, 203, 70, 0.55);
}
.rpgvm-options-panel {
    position: absolute;
    z-index: 80;
    top: calc(100% + 8px);
    right: 8px;
    width: min(240px, calc(100vw - 28px));
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 225, 120, 0.88);
    background: rgba(5, 8, 18, 0.96);
    color: #fff7cf;
    pointer-events: auto;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.72), 0 0 20px rgba(255, 203, 70, 0.22);
}
.rpgvm-options-panel strong {
    display: block;
    margin: 0 0 8px;
    color: #ffd76a;
    font-size: 14px;
}
.rpgvm-options-panel label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}
.rpgvm-options-panel input {
    width: 16px;
    height: 16px;
    accent-color: #ffd76a;
}
@media (max-width: 700px) {
    .rpgvm-topbar {
        grid-template-columns: 1fr auto auto;
        grid-template-areas:
            "title options stats"
            "toolbar toolbar toolbar";
    }
    .rpgvm-options-toggle {
        grid-area: options;
        width: 30px;
        height: 30px;
        font-size: 17px;
    }
    .rpgvm-options-panel {
        top: 44px;
        right: 6px;
    }
}
