/**
 * game.css
 * Mars Retro Sci-Fi Styling for Name Screen, Loading Screen, and Game Viewport.
 */

/* Viewport and Canvas Container */
.game-viewport {
    width: 100vw;
    height: 100vh;
    background-color: var(--space-black, #05050b);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

#game-canvas {
    background-color: #05050b;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: -moz-crisp-edges;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.95);
    max-width: 100vw;
    max-height: 100vh;
}

/* Background Grid Overlay */
.mars-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(216, 90, 34, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(216, 90, 34, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* Name Screen Wrapper */
.name-screen-wrapper,
.loading-screen-wrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #1b0a0e 0%, #05050b 80%);
    font-family: var(--font-pixel, 'Press Start 2P', monospace);
    color: var(--text-cream, #f6c885);
    user-select: none;
    overflow: hidden;
}

/* Modal Panel */
.name-modal-panel {
    position: relative;
    width: 90%;
    max-width: 640px;
    background-color: #1a0b0d;
    border: 3px solid #e07228;
    box-shadow: 0 0 30px rgba(224, 114, 40, 0.25), inset 0 0 20px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.name-panel-header {
    background-color: #2e100f;
    border-bottom: 2px solid #e07228;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.name-panel-header .panel-title {
    font-size: 13px;
    color: #f6c885;
    letter-spacing: 1px;
    text-align: center;
    margin: 0;
}

.name-panel-header .panel-icon {
    color: #e07228;
    font-size: 10px;
}

.name-panel-body {
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mission-briefing {
    font-size: 10px;
    line-height: 1.8;
    color: #f6c885;
    text-align: justify;
}

.input-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-label {
    font-size: 9px;
    color: #ed8733;
    letter-spacing: 1px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background-color: #0c0507;
    border: 2px solid #8f3419;
    padding: 8px 14px;
    gap: 10px;
}

.input-wrapper:focus-within {
    border-color: #e07228;
    box-shadow: 0 0 10px rgba(224, 114, 40, 0.4);
}

.input-prefix {
    color: #e07228;
    font-size: 14px;
    font-weight: bold;
}

.retro-text-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    color: #f6c885;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.name-panel-actions {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 8px;
}

/* Retro Buttons */
.btn-retro {
    font-family: inherit;
    font-size: 10px;
    padding: 14px 20px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background-color: #d85a22;
    color: #fff;
    border-color: #f6c885;
    box-shadow: 0 4px 0 #8f3419;
}

.btn-primary:hover {
    background-color: #ed8733;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #8f3419;
}

.btn-primary:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #8f3419;
}

.btn-secondary {
    background-color: #381512;
    color: #c5975b;
    border-color: #582114;
    box-shadow: 0 4px 0 #1c080b;
}

.btn-secondary:hover {
    background-color: #582114;
    color: #f6c885;
    border-color: #8f3419;
}

.btn-secondary:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #1c080b;
}

.name-panel-footer {
    background-color: #0d0507;
    border-top: 1px solid #4d1d15;
    padding: 10px 16px;
    font-size: 8px;
    color: #8f3419;
    text-align: center;
}

/* Character Select Panel */
.char-select-panel {
    max-width: 880px;
}

.char-select-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
}

.char-card {
    flex: 1 1 220px;
    max-width: 250px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 12px;
    background-color: #0c0507;
    border: 2px solid #582114;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.05s ease;
}

/* Reuses the global mars grid pattern inside every character card.
   Kept at the same opacity as the screen-wide overlay so it stays subtle;
   content is lifted above it to preserve readability. */
.char-card .mars-grid-overlay {
    z-index: 0;
}

.char-card__preview,
.char-card__name,
.char-card__tagline,
.char-card__desc {
    position: relative;
    z-index: 1;
}

.char-card__preview {
    width: 100%;
    height: 132px;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    background: radial-gradient(circle at center, rgba(224, 114, 40, 0.10), rgba(8, 4, 6, 0.40) 72%);
}

.char-card__name {
    font-size: 10px;
    color: #f6c885;
    letter-spacing: 1px;
}

.char-card__tagline {
    font-size: 8px;
    color: #ed8733;
    letter-spacing: 0.5px;
    text-align: center;
}

.char-card__desc {
    font-size: 7px;
    line-height: 1.7;
    color: #c5975b;
    text-align: center;
}

.char-card.is-hover {
    border-color: #8f3419;
}

.char-card.is-selected {
    border-color: #e07228;
    box-shadow: 0 0 14px rgba(224, 114, 40, 0.45);
}

.char-card.is-selected .char-card__name {
    color: #ed8733;
}

.char-card:active {
    transform: translateY(2px);
}

@media (max-width: 600px) and (orientation: portrait) {
    .char-select-grid {
        flex-direction: column;
        align-items: center;
    }

    .char-card {
        flex: none;
        width: 90%;
        max-width: 260px;
    }
}

/* Loading Screen Panel */
.loading-panel {
    width: 90%;
    max-width: 580px;
    background-color: #1a0b0d;
    border: 3px solid #e07228;
    box-shadow: 0 0 35px rgba(224, 114, 40, 0.3);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    z-index: 10;
}

.loading-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pulse-beacon {
    width: 12px;
    height: 12px;
    background-color: #e07228;
    border-radius: 50%;
    animation: beacon-blink 1s infinite alternate;
}

@keyframes beacon-blink {
    0% { opacity: 0.3; transform: scale(0.85); }
    100% { opacity: 1; transform: scale(1.15); box-shadow: 0 0 10px #e07228; }
}

.loading-title {
    font-size: 12px;
    color: #f6c885;
    margin: 0;
    letter-spacing: 1px;
}

.loading-status-text {
    font-size: 9px;
    color: #ed8733;
    line-height: 1.6;
    min-height: 28px;
}

.loading-bar-container {
    width: 100%;
    height: 20px;
    background-color: #0a0405;
    border: 2px solid #8f3419;
    padding: 2px;
    box-sizing: border-box;
}

.loading-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #d85a22, #ed8733);
    box-shadow: 0 0 8px rgba(237, 135, 51, 0.6);
    transition: width 0.15s ease-out;
}

.loading-footer {
    display: flex;
    justify-content: space-between;
    font-size: 8px;
    color: #c5975b;
}

/* ─── Pause Menu Overlay ─────────────────────────────────── */
.pause-overlay {
    position: absolute;
    inset: 0;
    z-index: 300;
    background: rgba(5, 5, 11, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: pauseOverlayIn 0.2s ease forwards;
}

.pause-overlay[hidden] {
    display: none;
}

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

.pause-panel {
    position: relative;
    width: 520px;
    max-width: calc(100vw - 32px);
    background: #12030a;
    border: 2px solid #e07228;
    box-shadow:
        0 0 0 1px #6b2c10,
        0 0 30px rgba(224, 114, 40, 0.35),
        0 0 60px rgba(224, 114, 40, 0.12),
        inset 0 0 0 1px rgba(224, 114, 40, 0.08);
    animation: pauseSlideIn 0.25s cubic-bezier(0.22, 0.9, 0.4, 1) forwards;
    clip-path: polygon(
        0px 0px,
        calc(100% - 16px) 0px,
        100% 16px,
        100% 100%,
        0px 100%
    );
    user-select: none;
}

@keyframes pauseSlideIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)     scale(1); }
}

.pause-panel::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #e07228 50%, transparent 100%);
    opacity: 0.4;
}

/* Header */
.pause-panel__header {
    background: linear-gradient(180deg, #8c2e0e 0%, #5c1c09 100%);
    padding: 10px 20px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e07228;
    position: relative;
}

.pause-panel__header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 16px;
    height: 1px;
    background: #e07228;
    opacity: 0.7;
}

.pause-panel__icon {
    font-family: var(--font-pixel, 'Press Start 2P', monospace);
    font-size: 12px;
    color: #e07228;
    letter-spacing: 4px;
}

.pause-panel__title {
    font-family: var(--font-pixel, 'Press Start 2P', monospace);
    font-size: 11px;
    color: #f6c885;
    letter-spacing: 2px;
    text-shadow: 2px 2px 0 #1a0507;
    margin: 0;
}

/* Body / Buttons */
.pause-panel__stage {
    position: relative;
}

.pause-panel__body {
    padding: 30px 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Camada de opções sobreposta aos botões do menu */
.pause-panel--options-open .pause-panel__stage {
    min-height: min(500px, 74vh);
}

.pause-panel__options-layer {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: rgba(10, 4, 8, 0.96);
    border-bottom: 1px solid rgba(224, 114, 40, 0.15);
    overflow-y: auto;
    animation: pauseOverlayIn 0.15s ease forwards;
    padding: 18px 10px 12px;
}

.pause-panel--options-open [data-pause-view="main"] {
    opacity: 0.25;
    filter: saturate(0.4);
    transition: opacity 0.15s ease;
}

.pause-panel__options-title {
    font-family: var(--font-pixel, 'Press Start 2P', monospace);
    font-size: 11px;
    letter-spacing: 4px;
    color: var(--mars-light, #ed8733);
    text-shadow: 2px 2px 0 #1a0507;
    margin: 0 0 14px;
    text-align: center;
}

/* Botões no mesmo estilo da tela inicial (carcaça transparente, borda laranja) */
.pause-panel__btn {
    position: relative;
    width: 100%;
    height: 54px;
    background: transparent;
    border: 2px solid #A6511F;
    font-family: var(--font-pixel, 'Press Start 2P', monospace);
    font-size: 12px;
    letter-spacing: 2px;
    color: #A6511F;
    cursor: pointer;
    outline: none;
    text-align: left;
    padding-left: 22px;
    text-shadow: 2px 2px 0 #1a0507;
    transition: color 0.1s ease, border-color 0.1s ease, box-shadow 0.1s ease, transform 0.05s ease;
    clip-path: polygon(
        0px 0px,
        calc(100% - 8px) 0px,
        100% 8px,
        100% 100%,
        0px 100%
    );
}

/* Detalhe de linha de brilho no topo do botão */
.pause-panel__btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 8px;
    height: 2px;
    background: #c95c2e;
    pointer-events: none;
}

.pause-panel__btn:hover,
.pause-panel__btn:focus-visible {
    background: transparent;
    color: var(--mars-light, #ed8733);
    border-color: var(--mars-light, #ed8733);
    text-shadow: 2px 2px 0 #1a0507, 0 0 4px rgba(237, 135, 51, 0.6);
    box-shadow: 0 0 10px rgba(216, 90, 34, 0.4);
}

.pause-panel__btn:hover::before,
.pause-panel__btn:focus-visible::before {
    background: #ed8733;
}

.pause-panel__btn:active {
    transform: translateY(2px);
    background: transparent;
    box-shadow: 0 1px 0 #150507;
}

.pause-panel__btn:focus-visible {
    outline: 2px dashed var(--mars-light, #ed8733);
    outline-offset: 3px;
}

/* Warning state for armed "voltar ao menu" */
.pause-panel__btn--warning,
.pause-panel__btn--warning:hover,
.pause-panel__btn--warning:focus-visible {
    color: #ff5a4d;
    border-color: #e62424;
    background: transparent;
    text-shadow: 2px 2px 0 #1a0507, 0 0 6px rgba(230, 36, 36, 0.6);
    box-shadow: 0 0 12px rgba(230, 36, 36, 0.4);
}

.pause-panel__btn--warning::before {
    background: #e62424;
}

/* ─── Options view ───────────────────────────────────────── */
.pause-panel__options {
    border-top: 1px solid rgba(224, 114, 40, 0.15);
    max-height: 58vh;
    overflow-y: auto;
}

.opt-item {
    margin-bottom: 16px;
}

.opt-item__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.opt-item__label {
    font-family: var(--font-pixel, 'Press Start 2P', monospace);
    font-size: 9px;
    letter-spacing: 1.5px;
    color: var(--text-cream, #f6c885);
    text-shadow: 2px 2px 0 #1a0507;
}

.opt-item__value {
    font-family: var(--font-pixel, 'Press Start 2P', monospace);
    font-size: 9px;
    letter-spacing: 1px;
    color: var(--mars-light, #ed8733);
    min-width: 44px;
    text-align: right;
}

.opt-item__slider {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    height: 34px;
    box-sizing: border-box;
    background:
        linear-gradient(180deg, #c75624 0%, #ed8733 100%) 0 0 / calc(var(--val, 70) * 1%) 100% no-repeat,
        rgba(90, 30, 18, 0.4);
    border: 2px solid #A6511F;
    cursor: pointer;
    outline: none;
    clip-path: polygon(
        0px 0px,
        calc(100% - 8px) 0px,
        100% 8px,
        100% 100%,
        0px 100%
    );
    transition: border-color 0.1s ease, box-shadow 0.1s ease;
}

.opt-item__slider:hover,
.opt-item__slider:focus-visible {
    border-color: var(--mars-light, #ed8733);
    box-shadow: 0 0 10px rgba(216, 90, 34, 0.35);
}

.opt-item__slider:focus-visible {
    outline: 2px dashed var(--mars-light, #ed8733);
    outline-offset: 3px;
}

.opt-item__slider::-webkit-slider-runnable-track {
    background: transparent;
    border: 0;
}

.opt-item__slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 30px;
    margin-top: -1px;
    background: linear-gradient(180deg, #ed8733 0%, #a83d18 100%);
    border: 2px solid #1a0507;
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.25), 0 0 8px rgba(216, 90, 34, 0.45);
}

.opt-item__slider::-moz-range-track {
    height: 100%;
    background: transparent;
    border: 0;
}

.opt-item__slider::-moz-range-thumb {
    width: 18px;
    height: 28px;
    background: linear-gradient(180deg, #ed8733 0%, #a83d18 100%);
    border: 2px solid #1a0507;
    border-radius: 0;
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.25), 0 0 8px rgba(216, 90, 34, 0.45);
}

/* ─── Credits Screen (tela inicial) ──────────────────────── */
.credits-overlay {
    position: absolute;
    inset: 0;
    z-index: 320;
    background: rgba(5, 5, 11, 0.93);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    overflow: hidden;
    user-select: none;
}

.credits-scroller {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    animation: creditsRise 10s linear forwards;
    will-change: transform;
}

@keyframes creditsRise {
    from { transform: translateY(0); }
    to   { transform: translateY(calc(-1 * var(--rise, 50vh))); }
}

.credits-track {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 24px;
    transform: translateX(4px);
}

.credits-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 52px;
}

.credits-kicker {
    font-family: var(--font-pixel, 'Press Start 2P', monospace);
    font-size: 12px;
    letter-spacing: 6px;
    color: var(--mars-light, #ed8733);
    text-shadow: 2px 2px 0 #1a0507;
    margin: 0;
}

.credits-title {
    font-family: var(--font-pixel, 'Press Start 2P', monospace);
    font-size: 26px;
    letter-spacing: 4px;
    color: var(--text-cream, #f6c885);
    text-shadow: 3px 3px 0 #1a0507, 0 0 18px rgba(237, 135, 51, 0.45);
    margin: 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--panel-brown, #4d1d15);
}

.credits-role {
    font-family: var(--font-pixel, 'Press Start 2P', monospace);
    font-size: 10px;
    letter-spacing: 4px;
    color: var(--mars-orange, #d85a22);
    text-shadow: 2px 2px 0 #1a0507;
    margin: 0 0 6px;
}

.credits-name {
    font-family: var(--font-pixel, 'Press Start 2P', monospace);
    font-size: 16px;
    letter-spacing: 3px;
    color: var(--text-cream, #f6c885);
    text-shadow: 2px 2px 0 #1a0507, 0 0 8px rgba(224, 114, 40, 0.25);
    margin: 0;
}

.credits-name--sm {
    font-size: 12px;
    color: var(--mars-light, #ed8733);
}

.credits-class {
    font-family: var(--font-pixel, 'Press Start 2P', monospace);
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--logo-gold, #e39a3e);
    text-shadow: 2px 2px 0 #1a0507;
    margin: 0;
}

.credits-class--light {
    color: var(--mars-light, #ed8733);
}

.credits-skip {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(calc(-50% + 4px));
    z-index: 2;
    height: 46px;
    padding: 0 22px;
    background: transparent;
    border: 2px solid #A6511F;
    color: #A6511F;
    font-family: var(--font-pixel, 'Press Start 2P', monospace);
    font-size: 11px;
    letter-spacing: 2px;
    cursor: pointer;
    text-shadow: 2px 2px 0 #1a0507;
    clip-path: polygon(
        0px 0px,
        calc(100% - 8px) 0px,
        100% 8px,
        100% 100%,
        0px 100%
    );
    transition: color 0.1s ease, border-color 0.1s ease, box-shadow 0.1s ease;
}

.credits-skip:hover,
.credits-skip:focus-visible {
    color: var(--mars-light, #ed8733);
    border-color: var(--mars-light, #ed8733);
    text-shadow: 2px 2px 0 #1a0507, 0 0 4px rgba(237, 135, 51, 0.6);
    box-shadow: 0 0 10px rgba(216, 90, 34, 0.4);
    outline: none;
}

@media (max-width: 600px) {
    .credits-title { font-size: 18px; }
    .credits-name  { font-size: 12px; }
    .credits-class { font-size: 10px; }
}

/* Footer */
.pause-panel__footer {
    background-color: #0d0507;
    border-top: 1px solid #4d1d15;
    padding: 10px 16px;
    font-size: 7px;
    color: #8f3419;
    text-align: center;
    letter-spacing: 0.5px;
}

/* ─── Responsive: Pause Menu ─────────────────────────────── */
@media (max-width: 600px) {
    .pause-panel {
        width: 94%;
    }
    .pause-panel__title {
        font-size: 9px;
    }
    .pause-panel__btn {
        font-size: 10px;
        height: 48px;
        letter-spacing: 1px;
        padding-left: 14px;
    }
    .pause-panel__body {
        gap: 12px;
    }
}

/* ─── Responsive: Game Viewport ──────────────────────────── */
/* Base: Desktop (≥1101px) — game viewport fills viewport, canvas scales via JS */

/* Tablet: narrower viewports (601–1100px) */
@media (min-width: 601px) and (max-width: 1100px) {
    .game-viewport {
        width: 100vw;
        height: 100vh;
    }
}

/* Mobile: small viewports (≤600px) */
@media (max-width: 600px) {
    .game-viewport {
        width: 100vw;
        height: 100vh;
    }
}

/* ─── Cave Choice Overlay ────────────────────────────────── */
/* Tela de escolha de caminho da caverna (aberta pelo [E] na entrada).
   Fundo: cavern_choice.jpeg (cover); fallback retângulo sólido enquanto a
   arte não existir. Hotspots posicionados sobre os buracos da imagem
   (coordenadas em JS, ui/caveChoiceScreen.js -> HOTSPOTS). */
.cave-choice-overlay {
    position: absolute;
    inset: 0;
    z-index: 260;
    background: rgba(5, 5, 11, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: caveChoiceIn 0.2s ease forwards;
    user-select: none;
}

.cave-choice-overlay[hidden] {
    display: none;
}

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

/* Camada do fundo (imagem ou placeholder) preenchendo o overlay */
.cave-choice-bg {
    position: absolute;
    inset: 0;
    /* Fallback sólido (placeholder) enquanto cavern_choice.jpeg não existe.
       A classe .has-bg (aplicada por JS via loadCavernChoiceBackground)
       mantém o background-image definido inline; o fundo escuro abaixo só
       aparece quando a imagem não está disponível. */
    background-color: #14060d;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    box-shadow: inset 0 0 80px rgba(226, 114, 40, 0.18);
}

/* Título no topo */
.cave-choice-header {
    position: absolute;
    top: 28px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    text-align: center;
    padding: 0 24px;
}

.cave-choice-title {
    font-family: var(--font-pixel);
    font-size: 20px;
    color: #f6c885;
    letter-spacing: 3px;
    /* Mesma cor/sombra dos botões (labels) */
    text-shadow: 2px 2px 0 #1c080b, 0 0 10px rgba(224, 114, 40, 0.8);
}

.cave-choice-sub {
    font-family: var(--font-pixel);
    font-size: 10px;
    color: #f6c885;
    letter-spacing: 1.5px;
    /* Mesma cor/sombra dos botões (labels) */
    text-shadow: 2px 2px 0 #1c080b, 0 0 10px rgba(224, 114, 40, 0.8);
}

/* Hotspots clicáveis/selecionáveis sobre os buracos da imagem.
   O botão encolhe ao tamanho do texto (shrink-to-fit) e é centralizado no
   ponto (cx, cy) definido em JS via transform translate(-50%,-50%) — a área
   de clique fica apenas onde está o texto, sem retângulo grande. */
.cave-choice-hotspot {
    position: absolute;
    width: auto;
    height: auto;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    outline: none;
    transform: translate(-50%, -50%);
}

.cave-choice-hotspot:active {
    transform: translate(-50%, calc(-50% + 2px));
}

/* Efeito de hover/foco aplicado só ao botão pequeno (label).
   O destaque vem de :hover (enquanto o mouse está em cima) ou da classe
   .is-selected gerenciada por JS (navegação por teclado) — sem
   :focus-visible para o destaque não "grudar" após interação com o mouse. */
.cave-choice-hotspot:hover .cave-choice-hotspot__label,
.cave-choice-hotspot.is-selected .cave-choice-hotspot__label {
    background: rgba(224, 114, 40, 0.35);
    border-color: #f6c885;
    box-shadow: 0 0 14px rgba(224, 114, 40, 0.5);
}

.cave-choice-hotspot__label {
    font-family: var(--font-pixel);
    font-size: 10px;
    color: #f6c885;
    letter-spacing: 1.5px;
    text-shadow: 2px 2px 0 #1c080b, 0 0 10px rgba(224, 114, 40, 0.8);
    padding: 6px 10px;
    background: rgba(5, 5, 11, 0.45);
    border: 1px solid rgba(224, 114, 40, 0.4);
    line-height: 1.4;
    text-align: center;
}

/* Rodapé com dicas de controle */
.cave-choice-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 38px;
    background: rgba(5, 5, 11, 0.85);
    border-top: 1px solid #4d1d15;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.cave-choice-footer span {
    font-family: var(--font-pixel);
    font-size: 8px;
    color: #f6c885;
    letter-spacing: 1px;
}

@media (max-width: 600px) {
    .cave-choice-title {
        font-size: 14px;
    }
    .cave-choice-sub {
        font-size: 8px;
    }
    .cave-choice-hotspot__label {
        font-size: 7px;
    }
    .cave-choice-footer span {
        font-size: 6px;
    }
}

/* ─── Modal de Loja do Aliado ─── */
.shop-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 11, 0.88);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 150;
    user-select: none;
    animation: shopFadeIn 0.2s ease-out;
}

@keyframes shopFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.shop-panel {
    background-color: #14090b;
    border: 3px solid #e07228;
    box-shadow: 0 0 35px rgba(224, 114, 40, 0.35), inset 0 0 20px rgba(0, 0, 0, 0.9);
    width: 92%;
    max-width: 780px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-family: var(--font-pixel, 'Press Start 2P', monospace);
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e07228;
    padding-bottom: 14px;
    flex-wrap: wrap;
    gap: 12px;
}

.shop-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shop-header-icon {
    color: #e07228;
    font-size: 12px;
}

.shop-title {
    font-size: 14px;
    color: #f6c885;
    letter-spacing: 2px;
    margin: 0;
}

.shop-wallet {
    background: #230d10;
    border: 1px solid #ffd440;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.shop-wallet-label {
    font-size: 8px;
    color: #c5975b;
}

.shop-wallet-amount {
    font-size: 11px;
    color: #ffd440;
    font-weight: bold;
}

.shop-message-bar {
    padding: 8px 12px;
    font-size: 9px;
    text-align: center;
    letter-spacing: 1px;
}

.shop-message-bar.msg-success {
    background: rgba(40, 160, 60, 0.25);
    border: 1px solid #4ade80;
    color: #86efac;
}

.shop-message-bar.msg-warning,
.shop-message-bar.msg-error {
    background: rgba(180, 40, 40, 0.25);
    border: 1px solid #f87171;
    color: #fca5a5;
}

.shop-items-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.shop-card {
    background: #190a0d;
    border: 2px solid #6b261a;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.15s, transform 0.1s;
}

.shop-card:hover {
    border-color: #e07228;
    background: #220d11;
}

.shop-card.shop-card-special {
    border-color: #a855f7;
    background: radial-gradient(circle at top, #260d2e 0%, #15081c 100%);
    box-shadow: inset 0 0 12px rgba(168, 85, 247, 0.2);
}

.shop-card.shop-card-special:hover {
    border-color: #c084fc;
    box-shadow: inset 0 0 16px rgba(168, 85, 247, 0.35);
}

.shop-card.is-bought {
    border-color: #444;
    opacity: 0.75;
}

.shop-card-badge {
    font-size: 7px;
    color: #8a5a40;
    letter-spacing: 1px;
}

/* ─── Espaço reservado para o sprite asset do item ─── */
.shop-card-sprite {
    width: 54px;
    height: 54px;
    background: #0e0709;
    border: 2px dashed #4d1d15;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    line-height: 1;
    color: #8a5a40;
    margin-bottom: 2px;
    transition: border-color 0.15s;
}

.shop-card-sprite[data-item-id="cura_alienigena"] {
    border-color: #22c55e;
    color: #86efac;
}

.shop-card-sprite[data-item-id="energia_duna"] {
    border-color: #38bdf8;
    color: #7dd3fc;
}

.shop-card-sprite[data-item-id="item_slot_3"] {
    border-color: #6b7280;
    color: #9ca3af;
}

.shop-card-sprite[data-item-id="necro_ally_help"] {
    border-color: #c084fc;
    color: #f3e8ff;
}



.shop-card.shop-card-special .shop-card-badge {
    color: #c084fc;
}

.shop-card-name {
    font-size: 9px;
    color: #f6c885;
    line-height: 1.4;
    min-height: 24px;
}

.shop-card.shop-card-special .shop-card-name {
    color: #f3e8ff;
}

.shop-card-desc {
    font-size: 7px;
    color: #b08a6e;
    line-height: 1.4;
    min-height: 32px;
    flex-grow: 1;
}

.shop-card-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed #4d1d15;
    padding-top: 6px;
    margin-top: 4px;
}

.price-tag {
    font-size: 7px;
    color: #8a5a40;
}

.price-val {
    font-size: 9px;
    color: #ffd440;
}

.shop-buy-btn {
    font-family: var(--font-pixel, 'Press Start 2P', monospace);
    font-size: 8px;
    padding: 8px 10px;
    background: #8f3419;
    border: 1px solid #e07228;
    color: #fffae6;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
}

.shop-buy-btn:hover:not(:disabled) {
    background: #b84622;
    border-color: #f6c885;
}

.shop-buy-btn.bought,
.shop-buy-btn:disabled {
    background: #2b2b2b;
    border-color: #555;
    color: #888;
    cursor: default;
}

.shop-footer {
    display: flex;
    justify-content: center;
    margin-top: 6px;
}

.shop-close-btn {
    font-family: var(--font-pixel, 'Press Start 2P', monospace);
    font-size: 9px;
    padding: 10px 24px;
    background: transparent;
    border: 2px solid #e07228;
    color: #f6c885;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.15s;
}

.shop-close-btn:hover {
    background: rgba(224, 114, 40, 0.25);
    border-color: #f6c885;
}

@media (max-width: 680px) {
    .shop-items-grid {
        grid-template-columns: 1fr;
    }
}
