body {
    font-family: 'Inter', sans-serif;
    background-color: #0c0d0f;
    color: #e8e5df;
}
.game-shell {
    background-image: radial-gradient(circle at top, #171920 0%, #0c0d0f 45%);
}
h1, h2, h3, .font-title {
    font-family: 'Cinzel', serif;
}
#quick-attack-button.fury-ready {
    background-color: #b45309;
    border-color: #f59e0b;
    color: #fff;
}
#quick-attack-button.fury-ready:hover {
    background-color: #d97706;
}
.skill-upgrade-button {
    width: 20px;
    height: 20px;
    border: 1px solid #8a6d37;
    border-radius: 50%;
    background: #27251f;
    color: #fbbf24;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}
.skill-upgrade-button:hover:not(:disabled) {
    background: #51401d;
}
.skill-upgrade-button:disabled {
    cursor: not-allowed;
    opacity: 0.35;
}
.skill-upgrade-button:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}
.upgrade-dialog {
    width: min(420px, calc(100% - 28px));
    max-width: none;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    padding: 0;
    border: 1px solid #655633;
    border-radius: 16px;
    background: linear-gradient(155deg, #22231f, #121416 72%);
    color: #e8e5df;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
}
.upgrade-dialog::backdrop {
    background: rgba(5, 7, 8, 0.78);
    backdrop-filter: blur(4px);
}
.upgrade-dialog-content {
    position: relative;
    padding: 28px;
    text-align: center;
}
.upgrade-dialog-mark {
    display: grid;
    width: 42px;
    height: 42px;
    margin: 0 auto 12px;
    place-items: center;
    border: 1px solid #806a39;
    border-radius: 50%;
    background: #30291b;
    color: #fbbf24;
    font-size: 21px;
}
.upgrade-dialog-title {
    margin: 0 0 5px;
    color: #d0bb83;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.upgrade-dialog-skill {
    margin: 0;
    color: #fff1c2;
    font-size: 1.5rem;
    line-height: 1.2;
}
.upgrade-dialog-question {
    margin: 10px 0 14px;
    color: #c3c4bf;
    font-size: 0.9rem;
}
.upgrade-dialog-effect {
    margin: 0;
    padding: 12px;
    border: 1px solid rgba(142, 116, 61, 0.5);
    border-radius: 10px;
    background: rgba(90, 70, 28, 0.2);
    color: #f5d580;
    font-size: 1rem;
    font-weight: 700;
}
.upgrade-dialog-details {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    color: #aeb2af;
    font-size: 0.8rem;
}
.upgrade-dialog-details p {
    margin: 0;
}
.upgrade-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 22px;
}
.upgrade-dialog-actions button {
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
}
.upgrade-dialog-cancel {
    border-color: #454943 !important;
    background: #242723;
    color: #d4d6d0;
}
.upgrade-dialog-confirm {
    background: #a77719;
    color: #11120f;
}
.upgrade-dialog-actions button:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}
.upgrade-dialog-confirm:hover {
    background: #c48e25;
}
.rpg-scroll::-webkit-scrollbar {
    width: 6px;
}
.rpg-scroll::-webkit-scrollbar-track {
    background: #121419;
    border-radius: 4px;
}
.rpg-scroll::-webkit-scrollbar-thumb {
    background: #383a41;
    border-radius: 4px;
}
.game-language {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid #383a41;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.35);
}
.game-language button {
    min-width: 38px;
    min-height: 34px;
    border: 0;
    background: transparent;
    color: #aaa8a3;
    cursor: pointer;
    font: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    transition: background-color 0.18s ease, color 0.18s ease;
}
.game-language button[aria-pressed="true"] {
    background: #292b31;
    color: #d2c29c;
}
.game-language button:focus-visible {
    outline: 2px solid #d2c29c;
    outline-offset: -2px;
}
@media (min-width: 641px) {
    .hero-attributes > summary {
        display: none;
    }
}
@media (max-width: 899px) {
    body.game-shell {
        justify-content: flex-start;
        gap: 8px;
        padding: 10px;
    }
    header {
        margin-bottom: 8px !important;
    }
    #game-nav {
        gap: 8px;
        margin-bottom: 14px !important;
    }
    header h1 {
        font-size: 1.75rem !important;
        line-height: 1.12;
        letter-spacing: 0;
    }
    header > p {
        max-width: 34ch;
        margin-inline: auto;
        line-height: 1.4;
    }
    #game-main {
        display: flex !important;
        flex-direction: column;
        gap: 10px !important;
        margin-bottom: 10px !important;
    }
    #game-panel {
        order: 1;
        min-height: 0 !important;
        padding: 12px !important;
    }
    #hero-panel {
        order: 2;
        padding: 12px !important;
    }
    #region-progress {
        gap: 5px !important;
    }
    #region-progress li {
        min-width: 0;
        justify-content: center;
        gap: 4px;
        padding: 7px 4px;
        font-size: 0.68rem;
        text-align: center;
    }
    .region-stop-marker {
        flex: 0 0 auto;
    }
    .region-stop-name {
        min-width: 0;
        overflow-wrap: anywhere;
        line-height: 1.25;
    }
    #hero-panel .space-y-3 > :not([hidden]) ~ :not([hidden]) {
        margin-top: 0.55rem !important;
    }
    #hero-panel .grid.grid-cols-2 > div {
        padding: 0.5rem !important;
    }
    .skill-upgrade-button {
        width: 28px;
        height: 28px;
    }
    #encounter-card,
    #exploration-banner {
        padding: 11px !important;
        margin-bottom: 10px !important;
    }
    #rpg-log {
        height: 126px !important;
        margin-bottom: 10px !important;
        padding: 10px !important;
    }
    #controls-explore button {
        min-height: 48px;
        padding: 10px !important;
        font-size: 0.82rem !important;
    }
    #controls-combat button {
        min-height: 62px;
        padding: 8px 6px !important;
        font-size: 0.7rem !important;
    }
    .upgrade-dialog-content {
        padding: 22px 18px;
    }
    .upgrade-dialog-details {
        flex-direction: column;
        gap: 5px;
        align-items: center;
    }
}
@media (max-width: 640px) {
    body.game-shell {
        gap: 6px;
        padding: 8px 10px calc(250px + env(safe-area-inset-bottom));
    }
    header {
        margin-bottom: 2px !important;
    }
    #game-nav {
        margin-bottom: 0 !important;
    }
    header h1,
    header > p {
        display: none;
    }
    #game-main {
        gap: 8px !important;
        margin-bottom: 0 !important;
    }
    #hero-panel {
        position: sticky;
        top: 0;
        z-index: 20;
        order: 0;
        flex: none;
        padding: 10px !important;
        border-radius: 14px;
        background: rgba(23, 25, 31, 0.97);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(12px);
    }
    #hero-panel > div:first-child > div:first-child {
        margin-bottom: 8px !important;
        padding-bottom: 7px !important;
    }
    #hero-panel .space-y-3 {
        margin-bottom: 8px !important;
    }
    #hero-panel .space-y-3 > :not([hidden]) ~ :not([hidden]) {
        margin-top: 0.4rem !important;
    }
    #hero-panel .space-y-3 > div > .w-full {
        height: 8px;
    }
    #hero-panel .space-y-3 > div:first-child > .w-full {
        height: 10px;
    }
    .hero-attributes {
        padding-top: 5px;
        border-top: 1px solid rgba(41, 43, 49, 0.7);
    }
    .hero-attributes summary {
        min-height: 32px;
        display: flex;
        align-items: center;
        color: #a8a29e;
        cursor: pointer;
        font-size: 0.72rem;
        font-weight: 600;
        list-style: none;
    }
    .hero-attributes summary::-webkit-details-marker {
        display: none;
    }
    .hero-attributes summary::after {
        content: "+";
        margin-left: auto;
        color: #d2c29c;
        font-size: 1rem;
    }
    .hero-attributes[open] summary::after {
        content: "−";
    }
    #hero-panel > div:last-child {
        padding: 7px 9px !important;
    }
    #hero-panel > div:last-child > div > span:first-child {
        font-size: 1.25rem;
    }
    #potion-button {
        min-height: 38px;
        padding-inline: 14px !important;
    }
    #game-panel {
        order: 1;
        min-height: 0 !important;
        padding: 10px !important;
        border-radius: 14px;
        backdrop-filter: none;
    }
    #game-main > nav[aria-label="Jornada"] {
        order: 2;
        padding-bottom: 8px;
    }
    #region-progress li {
        justify-content: flex-start;
        text-align: left;
    }
    #rpg-log {
        height: 22vh !important;
        min-height: 100px;
        max-height: 170px;
    }
    #action-controls {
        position: fixed;
        z-index: 30;
        right: 0;
        bottom: 0;
        left: 0;
        padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
        border-top: 1px solid rgba(92, 81, 55, 0.7);
        background: rgba(12, 13, 15, 0.94);
        box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(14px);
    }
    #action-controls:has(#controls-explore.hidden):has(#controls-combat.hidden) {
        display: none;
    }
    #controls-explore {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    #controls-explore button {
        min-height: 48px;
        padding: 8px !important;
        font-size: 0.72rem !important;
    }
    #controls-explore button:first-child,
    #controls-explore button:last-child {
        grid-column: 1 / -1;
    }
    #controls-combat {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    #controls-combat button {
        min-height: 58px;
        padding: 7px 5px !important;
        font-size: 0.68rem !important;
    }
    #controls-combat button:last-child {
        grid-column: 1 / -1;
        min-height: 44px;
    }
    #controls-combat button span:last-child:not(:first-child) {
        font-size: 0.58rem;
    }
    footer {
        padding-bottom: 4px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .upgrade-dialog[open] {
        animation: none;
    }
}
