/* Fonts live in the project: titles in Kurale (OFL), body text in the system sans-serif. */
@font-face {
    font-family: 'Kurale';
    src: url('assets/fonts/Kurale-Regular.ttf') format('truetype');
    font-display: swap;
}

:root {
    --gold: #d4a24c;
    --gold-light: #f0d080;
    --gold-dark: #7a5a1a;
    --bg-dark: #0a0d14;
    --bg-panel: rgba(10, 13, 20, 0.95);
    --bg-overlay: rgba(0, 0, 0, 0.75);
    --text: #e8edf2;
    --text-dim: rgba(232, 237, 242, 0.6);
    --border: rgba(212, 162, 76, 0.3);
    --border-bright: rgba(212, 162, 76, 0.7);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-dark);
    font-family: var(--font-body);
    color: var(--text);
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: none;
    overscroll-behavior: none;
}

/* ── Loading Screen ──────────────────────────────────────────────── */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    background: #0195d7;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

#loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 75px;
    height: 75px;
    margin: 0 auto 16px;
    border: 4px solid rgba(212, 175, 55, 0.2);
    border-top-color: #00ff1f;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#game-wrapper {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#game-board {
    position: absolute;
    width: 960px;
    height: 540px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    background: linear-gradient(135deg, #0e1a2b 0%, #1a2238 100%);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.hidden {
    display: none !important;
}

.scene.hidden {
    display: none;
}

#scene-game {
    pointer-events: none;
}

#scene-game>* {
    pointer-events: auto;
}

#scene-game #hud,
#scene-game #bottom-bar {
    pointer-events: auto;
}

/* ── MAIN MENU ─────────────────────────────────────────────────── */
#scene-menu {
    background:
        linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35)),
        var(--art-menu, url('assets/robinhood/ui/robin-splash-cartoon-v3.webp')) center / cover no-repeat;
}

.menu-title {
    font-family: var(--font-body);
    font-size: 40px;
    font-weight: 800;
    letter-spacing: 2px;
    text-align: center;
    line-height: 1.1;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.6);
}



/* ── BUTTONS ────────────────────────────────────────────────────── */
.btn {
    min-width: 200px;
    padding: 13px 28px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    border: 2px solid var(--border);
    color: var(--text);
    cursor: pointer;
    margin: 6px;
    transition: all 0.15s ease;
}

.btn-primary {
    background: linear-gradient(180deg, #4b1d75 0%, #280a42 100%);
    border-color: #8a4edb;
    box-shadow: 0 0 20px rgba(138, 78, 219, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #6c2b8c 0%, #3d105e 100%);
    box-shadow: 0 0 30px rgba(138, 78, 219, 0.6);
    transform: scale(1.04);
}

.btn-secondary {
    background: linear-gradient(180deg, rgba(16, 50, 75, 0.8) 0%, rgba(8, 26, 40, 0.9) 100%);
}

.btn-secondary:hover {
    background: linear-gradient(180deg, rgba(24, 70, 105, 0.9) 0%, rgba(12, 38, 55, 0.95) 100%);
    transform: scale(1.03);
}

.btn:active {
    transform: scale(0.97) !important;
}

.btn-small {
    padding: 8px 18px;
    font-size: 13px;
    min-width: unset;
}

.btn-back {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
    padding: 8px;
    border: 2px solid rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    background: linear-gradient(180deg, #1e3050 0%, #0e1a30 100%);
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.btn-back svg {
    width: 22px;
    height: 22px;
    color: #aac8f0;
}

.btn-back:hover {
    background: linear-gradient(180deg, #2a4570 0%, #162440 100%);
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(30, 80, 160, 0.4);
}

.btn-back:active {
    transform: scale(0.95) !important;
}

.scene-header {
    font-family: var(--font-body);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.6);
    margin-top: 30px;
    margin-bottom: 30px;
}

.menu-subtitle {
    font-family: var(--font-body);
    font-size: 40px;
    font-weight: 800;
    letter-spacing: 2px;
    text-align: center;
    line-height: 1.1;
    margin-bottom: 30px;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.6);
}

/* ── CAMPAIGN / LEVELS BACKGROUND ─────────────────────────────── */
#scene-campaigns,
#scene-levels {
    background:
        linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
        var(--art-levels, url('assets/robinhood/ui/bg-levels.webp')) center / cover no-repeat;
}

/* ── CAMPAIGN GRID ─────────────────────────────────────────────── */
#campaigns-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0 40px;
    max-width: 820px;
    width: 100%;
}

.campaign-card {
    position: relative;
    overflow: hidden;
    border: 1px solid #3a4a62;
    border-radius: 12px;
    padding: 20px 20px 16px 24px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 148px;
    transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.25s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Background image holder */
.campaign-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1), filter 0.5s ease;
}

/* Darkening gradient overlay */
.campaign-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(10, 15, 25, 0.45) 0%, rgba(8, 12, 20, 0.92) 100%);
    z-index: 1;
    transition: opacity 0.3s ease;
}

/* Hover effects */
.campaign-card:hover {
    transform: translateY(-4px);
}

.campaign-card:hover::before {
    transform: scale(1.08);
}

.campaign-card:hover::after {
    opacity: 0.8;
}

/* Locked campaign styling */
.campaign-card.locked {
    opacity: 0.55;
    cursor: default;
    border-color: #1a2233 !important;
}

.campaign-card.locked::before {
    filter: grayscale(100%) brightness(35%);
}

.campaign-card.locked::after {
    background: linear-gradient(180deg, rgba(10, 15, 25, 0.7) 0%, rgba(8, 12, 20, 0.95) 100%);
}

.campaign-card.locked:hover {
    transform: none;
    box-shadow: none !important;
}

.campaign-card.locked:hover::before {
    transform: none;
}

/* Left accent stripe */
.campaign-accent-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 12px 0 0 12px;
    z-index: 2;
}

.campaign-name {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1px;
    font-family: var(--font-body);
    position: relative;
    z-index: 2;
}

.campaign-desc {
    font-size: 12px;
    color: #ffffff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(0, 0, 0, 1);
    line-height: 1.5;
    flex: 1;
    position: relative;
    z-index: 2;
}

.campaign-footer {
    margin-top: 4px;
    position: relative;
    z-index: 2;
}

.campaign-lock {
    font-size: 14px;
    opacity: 0.6;
    position: relative;
    z-index: 2;
}

/* Per-campaign colours */
.campaign-c1 {
    border-color: rgba(34, 139, 34, 0.4);
}

.campaign-c1::before {
    background-image: url('assets/robinhood/ui/campaign-1.webp');
}

.campaign-c1:hover {
    border-color: #32cd32;
    box-shadow: 0 8px 32px rgba(50, 205, 50, 0.25);
}

.campaign-c1 .campaign-accent-bar {
    background: #32cd32;
}

.campaign-c1 .campaign-name {
    color: #adff2f;
}

.campaign-c2 {
    border-color: rgba(178, 34, 34, 0.4);
}

.campaign-c2::before {
    background-image: url('assets/robinhood/ui/campaign-2.webp');
}

.campaign-c2:hover {
    border-color: #ff3333;
    box-shadow: 0 8px 32px rgba(255, 51, 51, 0.25);
}

.campaign-c2 .campaign-accent-bar {
    background: #ff3333;
}

.campaign-c2 .campaign-name {
    color: #ff9999;
}

.campaign-c3 {
    border-color: rgba(139, 0, 0, 0.4);
}

.campaign-c3::before {
    background-image: url('assets/robinhood/ui/campaign-3.webp');
}

.campaign-c3:hover {
    border-color: #ff0000;
    box-shadow: 0 8px 32px rgba(255, 0, 0, 0.25);
}

.campaign-c3 .campaign-accent-bar {
    background: linear-gradient(180deg, #ff4d4d, #cc0000);
}

.campaign-c3 .campaign-name {
    color: #ff6666;
}

.campaign-c4 {
    border-color: rgba(0, 100, 0, 0.4);
}

.campaign-c4::before {
    background-image: url('assets/robinhood/ui/campaign-4.webp');
}

.campaign-c4:hover {
    border-color: #00ff00;
    box-shadow: 0 8px 32px rgba(0, 255, 0, 0.25);
}

.campaign-c4 .campaign-accent-bar {
    background: linear-gradient(180deg, #00ff44, #009922);
}

.campaign-c4 .campaign-name {
    color: #88ff88;
}

.campaign-c5 {
    border-color: rgba(178, 34, 68, 0.4);
}

.campaign-c5::before {
    background-image: url('assets/robinhood/ui/campaign-5.webp');
}

.campaign-c5:hover {
    border-color: #e0446a;
    box-shadow: 0 8px 32px rgba(224, 68, 106, 0.25);
}

.campaign-c5 .campaign-accent-bar {
    background: linear-gradient(180deg, #ff6688, #b0203c);
}

.campaign-c5 .campaign-name {
    color: #ff9db0;
}

.campaign-c6 {
    border-color: rgba(212, 175, 55, 0.4);
}

.campaign-c6::before {
    background-image: url('assets/robinhood/ui/campaign-6.webp');
}

.campaign-c6:hover {
    border-color: #ffcc33;
    box-shadow: 0 8px 32px rgba(255, 204, 51, 0.28);
}

.campaign-c6 .campaign-accent-bar {
    background: linear-gradient(180deg, #ffe066, #cc9a1a);
}

.campaign-c6 .campaign-name {
    color: #ffe08a;
}

/* ── LEVELS GRID ───────────────────────────────────────────────── */
#levels-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    padding: 0 80px;
    max-width: 800px;
}

.level-card {
    aspect-ratio: 1;
    border: 2px solid #228b22;
    background: rgba(20, 35, 20, 0.8);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 8px;
    text-align: center;
}

.level-card:hover {
    border-color: #32cd32;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(50, 205, 50, 0.4);
}

.level-card.locked {
    opacity: 0.35;
    cursor: default;
}

.level-card.locked:hover {
    border-color: #228b22;
    transform: none;
    box-shadow: none;
}

.level-card.boss {
    border-color: #ff0000;
    background: linear-gradient(135deg, rgba(80, 20, 20, 0.9), rgba(40, 10, 10, 0.9));
}

.level-card.boss:hover {
    border-color: #ff4d4d;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.4);
}

.level-num {
    font-size: 28px;
    color: #32cd32;
    font-weight: bold;
}

.level-card.boss .level-num {
    color: #ff3333;
}

.level-name {
    font-size: 11px;
    color: #ccffcc;
    line-height: 1.2;
    margin-top: 4px;
}

.level-card.boss .level-name {
    color: #ffcccc;
}

.level-stars {
    display: flex;
    gap: 2px;
    margin-top: 4px;
}

.level-stars .star {
    color: #32cd32;
    font-size: 12px;
}

.level-stars .star.empty {
    color: #2a3548;
}

/* ── HUD ───────────────────────────────────────────────────────── */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 38px;
    background: linear-gradient(180deg, rgba(10, 13, 20, 0.95), rgba(10, 13, 20, 0.85));
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 16px;
    border-bottom: 1px solid rgba(212, 162, 76, 0.3);
    z-index: 10;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    color: #e8edf2;
}

.hud-icon {
    color: #d4a24c;
    font-size: 18px;
}

.hud-item:nth-child(2) .hud-icon {
    color: #cc4444;
}

.hud-item:nth-child(3) .hud-icon {
    color: #8ec0e8;
}

#hud-level-name {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
    pointer-events: none;
    white-space: nowrap;
}

.hud-right {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.hud-btn {
    padding: 4px 10px;
    background: rgba(30, 42, 65, 0.7);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.hud-btn:hover {
    background: rgba(45, 62, 95, 0.8);
    border-color: var(--border-bright);
}

.hud-btn.active {
    background: rgba(140, 100, 20, 0.7);
    border-color: var(--gold);
}

/* Sound toggle button */
.hud-sound-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 7px;
}

.hud-sound-btn .sound-icon {
    width: 16px;
    height: 16px;
    display: block;
}

.hud-sound-btn .sound-icon.hidden {
    display: none;
}

.hud-sound-btn .sound-off {
    color: #cc5555;
}

/* ── BOTTOM BAR ────────────────────────────────────────────────── */
#bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: linear-gradient(0deg, rgba(10, 13, 20, 0.95), rgba(10, 13, 20, 0.85));
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-top: 1px solid rgba(212, 162, 76, 0.3);
    z-index: 10;
}

#skills-bar {
    display: flex;
    gap: 8px;
}

.skill-btn {
    width: 44px;
    height: 44px;
    background: rgba(212, 162, 76, 0.15);
    border: 1px solid #d4a24c;
    color: #f4d49c;
    font-size: 18px;
    cursor: pointer;
    position: relative;
}

.skill-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.skill-btn .cd-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    pointer-events: none;
}

/* ── Wave button ────────────────────────────────────────────────── */
#btn-start-wave {
    margin-left: auto;
    padding: 10px 24px;
    background: linear-gradient(180deg, #3a2a10 0%, #241808 100%);
    border: 2px solid var(--border-bright);
    border-radius: 10px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
    animation: pulse-wave 2s infinite ease-in-out;
    box-shadow: 0 0 20px rgba(212, 162, 76, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#btn-start-wave:hover {
    background: linear-gradient(180deg, #52390f 0%, #332208 100%);
    box-shadow: 0 0 30px rgba(212, 162, 76, 0.45);
    transform: scale(1.06);
}

#btn-start-wave:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    animation: none;
    transform: none;
}

@keyframes pulse-wave {

    0%,
    100% {
        box-shadow: 0 0 6px rgba(80, 180, 80, 0.2);
    }

    50% {
        box-shadow: 0 0 18px rgba(80, 180, 80, 0.55);
    }
}

/* ── TOWER MENU (build) ────────────────────────────────────────── */
#tower-menu {
    position: absolute;
    background: rgba(10, 13, 20, 0.95);
    border: 1px solid rgba(212, 162, 76, 0.4);
    border-radius: 10px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 20;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.tmenu-buttons-row {
    display: flex;
    gap: 4px;
    align-items: stretch;
}

.tmenu-buttons-row .tmenu-close-btn {
    margin: auto;
}

.tower-build-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 6px;
    min-width: 62px;
    border-radius: 8px;
    background: rgba(30, 44, 68, 0.8);
    border: 1px solid rgba(212, 162, 76, 0.3);
    color: #e8edf2;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    text-align: center;
    transition: all 0.15s ease;
}

.tower-build-btn:hover:not(.disabled):not(:disabled) {
    background: rgba(50, 70, 100, 0.9);
    border-color: #d4a24c;
}

.tower-build-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tower-build-btn .tb-name {
    font-size: 9px;
    color: #b0c0d4;
    line-height: 1.2;
}

.tower-build-btn .tb-cost {
    font-size: 10px;
    color: #d4a24c;
    font-weight: 700;
}

/* SVG UI icons */
.hud-svg {
    width: 22px;
    height: 22px;
    object-fit: contain;
    vertical-align: middle;
    filter: drop-shadow(0 0 4px rgba(212, 162, 76, 0.55));
}

.gold-icon-sm {
    width: 13px;
    height: 13px;
    object-fit: contain;
    vertical-align: middle;
    margin-left: 1px;
    filter: drop-shadow(0 0 2px rgba(212, 162, 76, 0.5));
}

/* icon circle */
.tb-icon-wrap {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #2e4a6a 0%, #111e30 100%);
    border: 2px solid rgba(212, 162, 76, 0.45);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.tb-icon-img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    image-rendering: auto;
}

.tb-icon-fallback {
    font-size: 22px;
    line-height: 1;
    align-items: center;
    justify-content: center;
}

.tmenu-close-btn {
    width: 32px;
    height: 32px;
    padding: 6px;
    border: 2px solid rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    background: linear-gradient(180deg, #8B2020 0%, #5A1010 100%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

.tmenu-close-btn svg {
    width: 16px;
    height: 16px;
    color: #FFCCCC;
}

.tmenu-close-btn:hover {
    background: linear-gradient(180deg, #AA3030 0%, #6E1818 100%);
    transform: scale(1.1);
}

.tmenu-close-btn:active {
    transform: scale(0.95) !important;
}

/* ── TOWER INFO PANEL ──────────────────────────────────────────── */
#tower-info {
    position: absolute;
    background: rgba(10, 13, 20, 0.95);
    border: 1px solid rgba(212, 162, 76, 0.4);
    border-radius: 10px;
    padding: 10px 14px;
    z-index: 20;
    min-width: 160px;
    color: #e8edf2;
    font-size: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.tinfo-name {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #d4a24c;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.tinfo-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.tinfo-stat {
    font-size: 11px;
    color: rgba(208, 220, 236, 0.7);
    margin-bottom: 2px;
}

.tinfo-buttons {
    display: flex;
    gap: 5px;
    margin-top: 8px;
}

.tinfo-btn {
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid rgba(212, 162, 76, 0.3);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    color: #e8edf2;
    background: rgba(30, 44, 68, 0.8);
    font-family: inherit;
}

.tinfo-btn:hover {
    transform: scale(1.05);
}

.tinfo-btn.upgrade {
    border-color: rgba(100, 200, 100, 0.5);
    color: #aaffaa;
}

.tinfo-btn.upgrade:hover {
    box-shadow: 0 0 10px rgba(100, 200, 100, 0.3);
}

.tinfo-btn.sell {
    border-color: rgba(212, 162, 76, 0.5);
    color: #f4d49c;
}

.tinfo-btn.close {
    border-color: rgba(200, 80, 80, 0.5);
    color: #ffaaaa;
}

.tinfo-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── BRIEFING OVERLAY ──────────────────────────────────────────── */
#scene-briefing {
    background: rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(1px);
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 56px;
    overflow: visible;
    z-index: 10;
}

/* Popup box */
.briefing-box {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 86%;
    max-width: 720px;
    background: linear-gradient(180deg, rgba(18, 24, 38, 0.97) 0%, rgba(8, 12, 20, 0.99) 100%);
    border: 2px solid var(--border-bright);
    border-radius: 12px;
    padding: 16px 24px 16px 132px;
    box-shadow: 0 -4px 30px rgba(212, 162, 76, 0.15), 0 8px 32px rgba(0, 0, 0, 0.8);
    animation: briefing-slide-up 0.22s ease-out;
    overflow: visible;
}

@keyframes briefing-slide-up {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Portrait — sticks out above the box */
.briefing-portrait-big {
    position: absolute;
    left: 12px;
    top: -42px;
    width: 108px;
    height: 108px;
    border-radius: 50%;
    border: 3px solid var(--gold);
    object-fit: cover;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7), 0 0 18px rgba(212, 162, 76, 0.25);
    background: #0a0d14;
}

.briefing-portrait-big[src=""] {
    display: none;
}

/* Level name (small label above speaker) */
.briefing-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.65;
    margin-bottom: 2px;
}

/* Speaker name */
.briefing-speaker-name {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--gold);
    margin-bottom: 6px;
}

.briefing-speaker-name.speaker-hildr {
    color: #88ccee;
}

.briefing-speaker-name.speaker-skadi {
    color: #cc99ff;
}

/* Dialogue text */
.briefing-text {
    font-size: 14px;
    line-height: 1.6;
    color: #d8e4f0;
    flex: 1;
    margin-bottom: 12px;
    min-height: 40px;
}

/* Buttons row — right-aligned */
.briefing-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.briefing-btn-next {
    min-width: 100px;
    font-size: 13px;
    padding: 8px 18px;
}

.briefing-btn-fight {
    min-width: 100px;
    font-size: 13px;
    padding: 8px 18px;
}

/* ── RESULT ────────────────────────────────────────────────────── */
#scene-result {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(2px);
}

#scene-result.victory-bg {
    background:
        linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)),
        var(--art-victory, url('assets/robinhood/ui/bg-victory.webp')) center / cover no-repeat !important;
    backdrop-filter: none !important;
}

#scene-result.defeat-bg {
    background:
        linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)),
        var(--art-defeat, url('assets/robinhood/ui/bg-defeat.webp')) center / cover no-repeat !important;
    backdrop-filter: none !important;
}

.result-title {
    font-family: var(--font-body);
    font-size: 52px;
    font-weight: 900;
    letter-spacing: 2px;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 1), 0 0 30px rgba(212, 162, 76, 0.5);
    margin-bottom: 16px;
}

.result-title.defeat {
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 1), 0 0 30px rgba(204, 68, 68, 0.6);
}

#result-stars {
    display: flex;
    gap: 12px;
    font-size: 48px;
    color: #d4a24c;
    margin-bottom: 16px;
}

#result-stars .empty {
    color: #2a3548;
}

#result-subtitle {
    font-size: 18px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 30px;
}

.result-buttons {
    display: flex;
    gap: 12px;
}

/* ── PAUSE ─────────────────────────────────────────────────────── */
#scene-pause {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(2px);
}

.pause-title {
    font-family: var(--font-body);
    font-size: 40px;
    font-weight: 900;
    letter-spacing: 2px;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.5);
    margin-bottom: 30px;
}

/* ── TOOLTIP ───────────────────────────────────────────────────── */
#game-tooltip {
    position: absolute;
    background: rgba(10, 13, 20, 0.95);
    border: 1px solid rgba(212, 162, 76, 0.5);
    border-radius: 8px;
    padding: 8px 12px;
    color: #e8edf2;
    font-size: 12px;
    pointer-events: none;
    z-index: 30;
    max-width: 200px;
    line-height: 1.4;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.tt-name {
    color: #d4a24c;
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 2px;
}

.tt-desc {
    color: #8da4c2;
    font-size: 10px;
    margin-bottom: 5px;
    font-style: italic;
}

.tt-stats {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.tt-stat {
    color: #b0c0d4;
    font-size: 11px;
}

.tt-stat span {
    color: #e8edf2;
    font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════════
   HERO PANEL (bottom bar)
══════════════════════════════════════════════════════════════════ */
#hero-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* Portrait */
.hero-portrait-wrap {
    position: relative;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border: 2px solid var(--border-bright);
    border-radius: 6px;
    background: rgba(212, 162, 76, 0.08);
    overflow: hidden;
}

.hero-portrait-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-respawn-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #FFD700;
}

/* Info column */
.hero-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 108px;
    max-width: 128px;
    flex-shrink: 0;
}

.hero-name-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.hero-name {
    font-size: 11px;
    font-weight: 800;
    color: #f0d080;
    letter-spacing: 0.5px;
}

.hero-level-badge {
    font-size: 10px;
    font-weight: 700;
    color: #d4a24c;
    background: rgba(212, 162, 76, 0.15);
    border: 1px solid rgba(212, 162, 76, 0.35);
    border-radius: 3px;
    padding: 0 4px;
}

.hero-bar-row {
    display: flex;
    align-items: center;
    gap: 3px;
}

.hero-bar-label {
    font-size: 9px;
    font-weight: 700;
    width: 14px;
    flex-shrink: 0;
    text-align: right;
}

.hp-label {
    color: #88cc44;
}

.xp-label {
    color: #6699ff;
}

.hero-bar-track {
    flex: 1;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    min-width: 40px;
}

.hero-hpbar {
    height: 100%;
    background: linear-gradient(90deg, #44aa22, #88cc44);
    border-radius: 3px;
    transition: width 0.15s;
}

.hero-xpbar {
    height: 100%;
    background: linear-gradient(90deg, #2244cc, #6699ff);
    border-radius: 3px;
    transition: width 0.15s;
}

.hero-bar-val {
    font-size: 8px;
    color: var(--text-dim);
    width: 36px;
    flex-shrink: 0;
    text-align: right;
    white-space: nowrap;
}

/* Ability buttons */
.hero-abilities {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.hero-ability-btn {
    position: relative;
    width: 50px;
    height: 50px;
    background: rgba(212, 162, 76, 0.10);
    border: 1.5px solid rgba(212, 162, 76, 0.40);
    border-radius: 6px;
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    transition: border-color 0.12s, background 0.12s;
    flex-shrink: 0;
}

.hero-ability-btn:hover:not(.ab-locked):not(.ab-cooldown) {
    background: rgba(212, 162, 76, 0.22);
    border-color: var(--gold);
}

.hero-ability-btn.ab-locked {
    opacity: 0.32;
    cursor: default;
}

.hero-ability-btn.ab-casting {
    border-color: #FFD700;
    animation: hero-cast-pulse 0.55s infinite alternate;
}

@keyframes hero-cast-pulse {
    from {
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
    }

    to {
        box-shadow: 0 0 14px rgba(255, 215, 0, 0.9);
    }
}

.hero-ability-btn.ab-silenced {
    border-color: #aaaaff;
    opacity: 0.55;
}

.hero-ab-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-ab-key {
    position: absolute;
    bottom: 1px;
    left: 3px;
    font-size: 9px;
    font-weight: 700;
    color: #f0d080;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 1);
    pointer-events: none;
    line-height: 1;
}

.hero-cd-overlay {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    text-shadow: 0 1px 3px #000;
    pointer-events: none;
    border-radius: 5px;
}

/* Upgrade button */
.hero-upg-btn {
    padding: 4px 8px;
    background: rgba(212, 162, 76, 0.10);
    border: 1.5px solid rgba(212, 162, 76, 0.38);
    border-radius: 6px;
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.45;
    cursor: pointer;
    text-align: center;
    transition: all 0.14s;
    flex-shrink: 0;
    white-space: nowrap;
}

.hero-upg-btn:hover {
    background: rgba(212, 162, 76, 0.22);
    border-color: var(--gold);
    color: var(--text);
}

.hero-upg-btn.has-sp {
    border-color: #FFD700;
    color: #FFD700;
    animation: sp-glow 1.4s infinite alternate;
}

@keyframes sp-glow {
    from {
        box-shadow: none;
    }

    to {
        box-shadow: 0 0 9px rgba(255, 215, 0, 0.55);
    }
}

#hero-sp-badge {
    color: #FFD700;
    font-size: 11px;
}

/* Sword move button */
.hero-move-btn {
    position: relative;
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(212, 162, 76, 0.10);
    border: 1.5px solid rgba(212, 162, 76, 0.40);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.13s, border-color 0.13s;
}

.hero-move-btn:hover:not(:disabled) {
    background: rgba(40, 100, 200, 0.32);
    border-color: #88bbff;
    color: #ccdeff;
}

.hero-move-btn.active {
    background: rgba(255, 200, 60, 0.22);
    border-color: #FFD700;
    color: #FFD700;
    animation: hero-cast-pulse 0.55s infinite alternate;
}

.hero-move-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

/* Place / Move button (legacy, kept for safety) */
.hero-place-btn {
    padding: 6px 10px;
    background: rgba(40, 100, 200, 0.18);
    border: 1.5px solid rgba(100, 160, 255, 0.45);
    border-radius: 6px;
    color: #88bbff;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.14s;
    white-space: nowrap;
}

.hero-place-btn:hover:not(:disabled) {
    background: rgba(40, 100, 200, 0.38);
    border-color: #88bbff;
    color: #bbddff;
}

.hero-place-btn:disabled {
    opacity: 0.38;
    cursor: default;
}

/* ══════════════════════════════════════════════════════════════════
   HERO UPGRADE MODAL
══════════════════════════════════════════════════════════════════ */
#hero-upgrade-modal {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.hupg-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    width: 100%;
}

.hupg-tab {
    flex: 1;
    min-height: 40px;
    padding: 7px 16px;
    background: linear-gradient(#365339, #1e3727);
    border: 2px solid #8baf70;
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-shadow: 0 2px 3px #0a160c, 0 0 5px #0a160c;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.hupg-tab:hover {
    background: linear-gradient(#567444, #34512c);
    border-color: #e5c77d;
    color: #fff;
    transform: translateY(-1px);
}

.hupg-tab.active {
    background: linear-gradient(#749453, #476b37);
    border-color: #f1d58b;
    color: #fff;
    box-shadow: 0 0 12px rgba(218, 185, 100, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.hupg-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.52);
}

.hupg-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 916px;
    height: 516px;
    background: radial-gradient(circle at 50% -20%, #35573a 0%, #182b20 46%, #0b1b16 100%);
    border: 3px solid #e5c680;
    border-radius: 16px;
    box-shadow: 0 12px 42px rgba(0, 0, 0, 0.8), inset 0 0 0 3px #4a683e, inset 0 0 35px rgba(0, 0, 0, 0.4);
    padding: 14px 18px;
    z-index: 1;
    overflow: hidden;
}

.hupg-header {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 68px;
    margin-bottom: 10px;
    padding: 0 4px 10px;
    border-bottom: 2px solid #8ca46c;
}

.hupg-portrait {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    border: 2px solid var(--border-bright);
    object-fit: cover;
    background: rgba(212, 162, 76, 0.1);
    flex-shrink: 0;
}

.hupg-header-info {
    flex: 1;
    min-width: 0;
}

.hupg-hero-name {
    font-size: 22px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 0 #15251b, 0 3px 6px #000;
}

.hupg-hero-lvl {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    margin-top: 2px;
    text-shadow: 0 2px 4px #07130b;
}

.hupg-close-btn {
    width: 36px;
    height: 36px;
    background: #712e28;
    border: 2px solid #efbd9e;
    border-radius: 6px;
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.14s;
    flex-shrink: 0;
}

.hupg-close-btn:hover {
    background: #a34535;
    color: #fff;
}

/* Ability rows */
#hero-upgrade-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr)) 29px;
    gap: 10px 12px;
    flex: 1;
    min-height: 0;
}

.hupg-row {
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0 12px;
    min-height: 0;
    padding: 10px 12px;
    background: linear-gradient(145deg, rgba(72, 105, 56, 0.82), rgba(24, 48, 35, 0.96));
    border: 2px solid #9fb47a;
    border-radius: 11px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 3px 10px rgba(0, 0, 0, 0.28);
}

.hupg-icon {
    width: 66px;
    height: 66px;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(212, 162, 76, 0.08);
}

.hupg-mid {
    flex: 1;
    min-width: 0;
}

.hupg-title {
    font-size: 19px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 5px;
    text-shadow: 0 2px 3px #07150d;
}

.hupg-title em {
    font-style: normal;
    font-size: 13px;
    font-weight: 900;
    color: #fff;
    margin-left: 6px;
    text-shadow: 0 2px 3px #07150d;
}

.hupg-dots {
    display: flex;
    gap: 6px;
    margin-bottom: 5px;
}

.hupg-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.22);
}

.hupg-dot.filled {
    background: #FFD700;
    border-color: #FFD700;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.65);
}

.hupg-stat {
    font-size: 15px;
    font-weight: 750;
    color: #fff;
    line-height: 1.2;
    text-shadow: 0 2px 3px #07150d;
}

.hupg-btn-area {
    flex-shrink: 0;
    text-align: center;
    min-width: 82px;
}

.hupg-spend-btn {
    grid-column: 2;
    justify-self: end;
    min-width: 135px;
    min-height: 30px;
    padding: 4px 10px;
    background: linear-gradient(#679347, #365d31);
    border: 2px solid #e7ca84;
    border-radius: 7px;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    text-shadow: 0 2px 3px #102012;
    cursor: pointer;
    transition: all 0.14s;
    white-space: nowrap;
}

.hupg-spend-btn:hover:not(:disabled) {
    background: linear-gradient(#85ad5a, #527c3e);
    border-color: #fff0bd;
}

.hupg-spend-btn.disabled {
    opacity: 0.32;
    cursor: default;
}

.hupg-sp-cost {
    color: #FFD700;
}

.hupg-max {
    font-size: 11px;
    font-weight: 800;
    color: #FFD700;
    letter-spacing: 0.5px;
}

.hupg-footer {
    grid-column: 1 / -1;
    align-self: center;
    padding-top: 5px;
    border-top: 2px solid #8ca46c;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    text-align: center;
    text-shadow: 0 2px 4px #07130b;
}

.hupg-footer b {
    color: #FFD700;
}

.hupg-reset-btn {
    display: block;
    margin: 10px auto 0;
    min-width: 140px;
    font-size: 12px;
    padding: 7px 16px;
}

/* Sherwood interface; no generated artwork. */
:root { --gold:#d7b974; --accent:#94b86b; }
.btn-primary { background:linear-gradient(#516e38,#304a29);border-color:#b99d5d; }
.hupg-spend-btn:disabled { opacity:1;background:#324839;border-color:#82987a;color:#fff;cursor:default; }
.level-hero { display:flex;align-items:center;justify-content:center;gap:6px;font-size:12px;color:#d8c58d;margin:8px 0; }
.level-hero img { width:30px;height:30px;object-fit:contain;border-radius:50%; }
/* Campaign and level selection fit entirely inside the 960 × 540 game board. */
#scene-campaigns .scene-header,
#scene-levels .scene-header {
    position: absolute;
    top: 16px;
    left: 70px;
    right: 70px;
    margin: 0;
    text-align: center;
    font-size: 30px;
    line-height: 42px;
}
#campaigns-grid {
    position: absolute;
    inset: 82px 28px 18px;
    width: auto;
    max-width: none;
    padding: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.campaign-card {
    min-width: 0;
    min-height: 0;
    gap: 7px;
    padding: 16px 15px 13px 18px;
    border: 2px solid #b9ad81;
    border-radius: 12px;
    background-color: #1a2d22;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
#campaigns-grid .campaign-card::before { background-image: none; }
.campaign-card::after {
    background: linear-gradient(180deg, rgba(7, 19, 15, 0.5), rgba(7, 17, 13, 0.92));
}
.campaign-card.locked {
    opacity: 1;
    border-color: #7d8d79 !important;
}
.campaign-card.locked::after {
    background: linear-gradient(180deg, rgba(12, 22, 21, 0.68), rgba(10, 18, 16, 0.94));
}
.campaign-name {
    color: #fff !important;
    font-size: 20px;
    line-height: 1.14;
    letter-spacing: 0;
    text-shadow: 0 2px 4px #000;
}
.campaign-desc {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.32;
    text-shadow: 0 2px 3px #000;
}
.campaign-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 7px;
    border-top: 1px solid rgba(255, 255, 255, 0.38);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    text-shadow: 0 2px 3px #000;
}
#levels-grid {
    position: absolute;
    inset: 137px 27px 87px;
    width: auto;
    max-width: none;
    padding: 0;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr);
    gap: 10px;
}
.level-card {
    min-width: 0;
    min-height: 0;
    width: 100%;
    aspect-ratio: auto;
    padding: 13px 10px 11px;
    justify-content: space-between;
    gap: 6px;
    border: 2px solid #8daa6c;
    border-radius: 12px;
    background: linear-gradient(150deg, rgba(44, 76, 47, 0.97), rgba(14, 34, 25, 0.97));
    box-shadow: 0 5px 17px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.level-card.locked {
    opacity: 1;
    border-color: #778776;
    background: linear-gradient(150deg, rgba(38, 53, 44, 0.96), rgba(17, 28, 23, 0.97));
    cursor: default;
}
.level-card.boss {
    border-color: #bb8463;
    background: linear-gradient(150deg, rgba(99, 55, 43, 0.97), rgba(41, 28, 25, 0.97));
}
.level-card.boss.locked { border-color: #887974; }
.level-num,
.level-card.boss .level-num {
    color: #fff;
    font-size: 34px;
    font-weight: 900;
    text-shadow: 0 2px 4px #07130b;
}
.level-name,
.level-card.boss .level-name {
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.15;
    min-height: 53px;
    margin-top: 0;
    text-shadow: 0 2px 3px #07130b;
}
.level-hero {
    flex-direction: column;
    gap: 5px;
    min-height: 74px;
    margin: 0;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.1;
    text-shadow: 0 2px 3px #07130b;
}
.level-hero img {
    width: 48px;
    height: 48px;
    border: 2px solid #d9bd80;
    background: #263b2b;
}
.level-stars { margin-top: 0; }
.level-stars .star { color: #f5d079; font-size: 17px; }
.level-stars .star.empty { color: #819486; }
.level-state {
    width: 100%;
    padding: 5px 3px;
    border: 1px solid #c5d4a1;
    border-radius: 6px;
    color: #fff;
    background: #486b3c;
    font-size: 13px;
    font-weight: 900;
    text-shadow: 0 2px 3px #132315;
}
.level-card.locked .level-state {
    border-color: #758d79;
    background: #354a3b;
}
.level-card.boss .level-state { background: #79483b; }
.level-card.boss.locked .level-state { background: #4d3d38; }
.hero-ability-btn:disabled { cursor:default; }
.hero-cd-overlay { display:flex;align-items:center;justify-content:center;z-index:4; }
#target-hint { position:absolute;top:49px;left:180px;right:180px;text-align:center;background:#152919e8;color:#f0deb3;border:1px solid #9cac71;border-radius:6px;padding:7px;font-size:12px;pointer-events:none;z-index:12; }
#target-hint[hidden] { display:none; }
.hero-move-btn { color:#e7d79e;font-size:30px; }

/* ══════════════════════════════════════════════════════════════════
   SHERWOOD THEME — wood, parchment and green baize instead of navy panels
══════════════════════════════════════════════════════════════════ */
:root {
    --font-title: 'Kurale', Georgia, 'Times New Roman', serif;
    --font-body: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --bg-dark: #16200f;
    --gold: #f0c25a;
    --brass: #f0c25a;
    --brass-dark: #a8772a;
    --ink: #3e2712;
    --ink-soft: #6e4b28;
    --wood-grain: repeating-linear-gradient(92deg, rgba(60, 30, 10, 0.16) 0 2px, rgba(0, 0, 0, 0) 2px 11px, rgba(255, 220, 160, 0.07) 11px 13px, rgba(0, 0, 0, 0) 13px 23px);
    --wood: linear-gradient(180deg, #b27a3e 0%, #8a5528 55%, #6e4220 100%);
    --parchment: radial-gradient(ellipse at 30% 18%, #fffaea 0%, #f8e9c4 45%, #ecd49c 100%);
    --cloth: radial-gradient(ellipse at 50% 20%, #5aae4c 0%, #3a8a39 45%, #226626 100%);
    --panel-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
}

html, body { background: radial-gradient(ellipse at center, #26361b 0%, #0f1609 100%); }
#game-board { background: #1d2a14; box-shadow: 0 0 60px rgba(0, 0, 0, 0.7); }
#loading-screen { background: radial-gradient(circle at center, #3f7a33 0%, #1b3a17 100%); }
.loading-spinner { border-color: rgba(240, 194, 90, 0.25); border-top-color: var(--brass); }

/* ── Titles ─────────────────────────────────────────────────────── */
.menu-title, .menu-subtitle, .scene-header, .result-title, .pause-title,
.campaign-name, .level-num, .hupg-hero-name, .hupg-tab, #hud-level-name,
.briefing-speaker-name, .tt-name, .tinfo-name, .btn {
    font-family: var(--font-title);
}
.menu-title, .menu-subtitle, .result-title {
    font-weight: 400;
    letter-spacing: 1px;
    background: linear-gradient(180deg, #fffbe6 0%, #ffe39a 45%, #f0b43c 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 3px 0 #4a2a0e) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.75));
}
.menu-title { font-size: 60px; line-height: 1.2; }
.menu-subtitle { font-size: 44px; margin-bottom: 26px; line-height: 1.2; }
.result-title { font-size: 66px; }
.result-title.defeat { background: linear-gradient(180deg, #fff1e6 0%, #ffb49a 50%, #d9543c 100%); -webkit-background-clip: text; background-clip: text; }
.scene-header, .pause-title {
    font-weight: 400;
    color: #fff3cf;
    letter-spacing: 1px;
    text-shadow: 0 3px 0 #3a2410, 0 6px 14px rgba(0, 0, 0, 0.7);
}
#scene-campaigns .scene-header, #scene-levels .scene-header { font-size: 36px; }
.pause-title { font-size: 48px; }
#scene-pause { background: rgba(22, 14, 6, 0.8); }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
    font-weight: 400;
    font-size: 19px;
    letter-spacing: 0.5px;
    border-radius: 11px;
    border: 2px solid #f3d27a;
    color: #fff8e6;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
    box-shadow: 0 4px 0 rgba(40, 20, 5, 0.6), 0 7px 14px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary {
    background: linear-gradient(180deg, #6ccd57 0%, #3f9a3a 48%, #2e8330 52%, #1f6424 100%);
    border-color: #f3d27a;
}
.btn-primary:hover {
    background: linear-gradient(180deg, #84e46c 0%, #4dae46 48%, #389139 52%, #257129 100%);
    box-shadow: 0 5px 0 rgba(40, 20, 5, 0.6), 0 0 24px rgba(170, 235, 100, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transform: translateY(-2px) scale(1.03);
}
.btn-secondary { background: var(--wood-grain), var(--wood); border-color: #e7bf6a; }
.btn-secondary:hover {
    background: var(--wood-grain), linear-gradient(180deg, #d0924c 0%, #a2672f 55%, #7d4b22 100%);
    box-shadow: 0 5px 0 rgba(40, 20, 5, 0.6), 0 0 20px rgba(255, 200, 110, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transform: translateY(-2px) scale(1.03);
}
.btn:active { transform: translateY(2px) scale(0.98) !important; box-shadow: 0 1px 0 rgba(40, 20, 5, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
#scene-menu .btn { min-width: 250px; margin: 5px; }
.menu-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 10px;
    background: rgba(30, 16, 4, 0.35);
    border: 1px solid rgba(255, 236, 190, 0.5);
    font: 700 12px var(--font-body);
    vertical-align: 2px;
}
.btn-back {
    background: var(--wood-grain), var(--wood);
    border: 2px solid #e7bf6a;
    box-shadow: 0 3px 0 rgba(40, 20, 5, 0.6), 0 5px 12px rgba(0, 0, 0, 0.45);
}
.btn-back svg { color: #fff3cf; }
.btn-back:hover { background: var(--wood-grain), linear-gradient(180deg, #d0924c, #8a5528); box-shadow: 0 0 16px rgba(255, 200, 110, 0.5); }

/* ── Campaigns: locked chapters are dimmed, grey and padlocked ──── */
.campaign-card { border: 3px solid #d9ad5c; box-shadow: 0 5px 16px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 240, 200, 0.25); }
.campaign-card:hover { border-color: #ffe08a; box-shadow: 0 8px 26px rgba(255, 210, 110, 0.35); }
.campaign-card::after { background: linear-gradient(180deg, rgba(20, 30, 10, 0.2) 0%, rgba(14, 22, 8, 0.85) 100%); }
.campaign-name { font-size: 24px; font-weight: 400; }
.campaign-card.locked { border-color: #5d4f3d !important; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6); }
.campaign-card.locked::after {
    background: rgba(8, 7, 4, 0.74);
    -webkit-backdrop-filter: grayscale(1) brightness(0.65);
    backdrop-filter: grayscale(1) brightness(0.65);
}
.campaign-card.locked .campaign-name,
.campaign-card.locked .campaign-desc,
.campaign-card.locked .campaign-footer { opacity: 0.5; }
.campaign-card.locked .campaign-accent-bar { background: #5d4f3d !important; }
.campaign-lock-badge {
    position: absolute;
    left: 50%;
    top: 54%;
    z-index: 3;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: #f3dca4;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    text-shadow: 0 2px 3px #000;
}
.campaign-lock-badge svg { width: 36px; height: 36px; fill: #e8c068; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.9)); }

/* ── Level cards: green baize with a brass frame ─────────────────── */
.level-card { background: var(--cloth); border: 3px solid #e2b862; box-shadow: 0 5px 16px rgba(0, 0, 0, 0.45), inset 0 0 18px rgba(0, 0, 0, 0.25); }
.level-card:hover { border-color: #ffe08a; box-shadow: 0 0 22px rgba(255, 210, 110, 0.5); }
.level-card.boss { background: radial-gradient(ellipse at 50% 20%, #c0553c 0%, #8a3325 50%, #5a1f17 100%); border-color: #f0c25a; }
.level-card.locked { background: radial-gradient(ellipse at 50% 20%, #3c4636 0%, #262d22 100%); border-color: #6d6552; filter: saturate(0.4); }
.level-card.boss.locked { background: radial-gradient(ellipse at 50% 20%, #4c3a33 0%, #2a211d 100%); }
.level-num, .level-card.boss .level-num { font-weight: 400; font-size: 38px; color: #fff3cf; text-shadow: 0 3px 0 #1c3812, 0 4px 8px rgba(0, 0, 0, 0.6); }
.level-state { background: linear-gradient(180deg, #ffe69a, #e2ac45); color: var(--ink); border-color: #fff3cf; text-shadow: none; }
.level-card.boss .level-state { background: linear-gradient(180deg, #ffe69a, #e2ac45); }
.level-card.locked .level-state, .level-card.boss.locked .level-state { background: #3a3a30; color: #b9b39c; border-color: #6d6552; }
.level-stars .star { color: #ffd23f; text-shadow: 0 0 6px rgba(255, 200, 60, 0.6); }
.level-stars .star.empty { color: rgba(20, 30, 12, 0.55); text-shadow: none; }

/* ── HUD and bottom bar: wooden planks with brass trim ──────────── */
#hud {
    background: var(--wood-grain), var(--wood);
    border-bottom: 3px solid var(--brass-dark);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45), inset 0 -1px 0 rgba(255, 215, 140, 0.35);
}
#bottom-bar {
    background: var(--wood-grain), linear-gradient(0deg, #6e4220 0%, #8a5528 45%, #b27a3e 100%);
    border-top: 3px solid var(--brass-dark);
    box-shadow: 0 -3px 8px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 215, 140, 0.35);
}
.hud-item {
    color: #fff6df;
    font-weight: 800;
    text-shadow: 0 1px 2px #2a1606;
    background: rgba(40, 22, 8, 0.38);
    padding: 1px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 220, 150, 0.3);
}
.hud-item:nth-child(3) .hud-icon { color: #ffe39a; }
#hud-level-name { font-size: 18px; font-weight: 400; color: #fff3cf; letter-spacing: 0.5px; text-shadow: 0 2px 0 #3a2410; }
.hud-btn { background: linear-gradient(180deg, #c68a47, #7b4b22); border: 1.5px solid #e7bf6a; color: #fff6df; border-radius: 7px; }
.hud-btn:hover { background: linear-gradient(180deg, #dca05a, #8d5a2b); border-color: #ffe08a; }
.hud-btn.active { background: linear-gradient(180deg, #6ccd57, #2e8330); border-color: #ffe08a; }
.hero-name { color: #fff1c4; text-shadow: 0 1px 2px #2a1606; }
.hero-level-badge { color: var(--ink); background: linear-gradient(180deg, #ffe69a, #e2ac45); border-color: #fff3cf; }
.hero-bar-val { color: #fbe9c4; }
.hero-bar-track { background: rgba(30, 16, 4, 0.5); }
.hero-portrait-wrap, .hero-ability-btn, .hero-move-btn { border: 2px solid #e7bf6a; background: rgba(40, 22, 8, 0.45); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); }
.hero-ability-btn:hover:not(.ab-locked):not(.ab-cooldown), .hero-move-btn:hover:not(:disabled) { border-color: #ffe08a; background: rgba(90, 50, 16, 0.6); box-shadow: 0 0 12px rgba(255, 210, 110, 0.55); color: #fff3cf; }
.hero-move-btn { color: #fff1c4; }
#btn-start-wave {
    background: linear-gradient(180deg, #6ccd57 0%, #3f9a3a 48%, #2e8330 52%, #1f6424 100%);
    border: 2px solid #f3d27a;
    color: #fff8e6;
    font-family: var(--font-title);
    font-weight: 400;
    font-size: 19px;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
    animation: pulse-sherwood 1.8s infinite ease-in-out;
}
#btn-start-wave:hover { background: linear-gradient(180deg, #84e46c 0%, #4dae46 48%, #389139 52%, #257129 100%); }
@keyframes pulse-sherwood {
    0%, 100% { box-shadow: 0 3px 0 rgba(40, 20, 5, 0.6), 0 0 6px rgba(255, 220, 110, 0.25); }
    50% { box-shadow: 0 3px 0 rgba(40, 20, 5, 0.6), 0 0 22px rgba(255, 220, 110, 0.75); }
}

/* ── Parchment panels: build menu, tower card, tooltip, briefing ── */
#tower-menu, #tower-info, #game-tooltip, .briefing-box, #target-hint {
    background: var(--parchment);
    border: 3px solid #7a4a22;
    color: var(--ink);
    box-shadow: var(--panel-shadow), inset 0 0 0 2px rgba(240, 194, 90, 0.55), inset 0 0 22px rgba(150, 100, 40, 0.25);
}
#tower-menu { border-radius: 14px; padding: 9px; }
.tower-build-btn {
    background: var(--cloth);
    border: 2px solid #e2b862;
    border-radius: 10px;
    color: #fff8e6;
    box-shadow: 0 3px 0 rgba(20, 50, 15, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.tower-build-btn:hover:not(.disabled):not(:disabled) { background: radial-gradient(ellipse at 50% 20%, #75c95f, #3f9a3a 60%, #2a7a2b); border-color: #ffe08a; box-shadow: 0 0 14px rgba(255, 220, 110, 0.55); }
.tower-build-btn.disabled, .tower-build-btn:disabled { filter: grayscale(0.85) brightness(0.8); opacity: 0.75; }
.tower-build-btn .tb-name { color: #fff8e6; font-size: 10px; font-weight: 800; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6); }
.tower-build-btn .tb-cost { color: #ffe28a; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6); }
.tb-icon-wrap { background: radial-gradient(circle at 40% 35%, #fffaea 0%, #ecd49c 100%); border: 2px solid #b5823a; }
.tinfo-name { color: var(--ink); font-weight: 400; font-size: 18px; letter-spacing: 0.3px; }
.tinfo-stat { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.tinfo-btn { font-family: var(--font-body); color: #fff8e6; border: 1.5px solid #e2b862; border-radius: 7px; background: var(--wood); text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5); }
.tinfo-btn.upgrade { background: linear-gradient(180deg, #6ccd57, #2e8330); color: #fff8e6; border-color: #f3d27a; }
.tinfo-btn.sell { color: #fff8e6; }
.tinfo-btn.close { background: linear-gradient(180deg, #d0533f, #8f2a1e); color: #fff8e6; border-color: #f0b09a; }
.tt-name { color: var(--ink); font-weight: 400; font-size: 16px; }
.tt-desc { color: var(--ink-soft); }
.tt-stat { color: var(--ink-soft); font-weight: 700; }
.tt-stat span { color: var(--ink); }
.briefing-box { border-width: 4px; border-radius: 14px; }
.briefing-title { color: var(--ink-soft); opacity: 1; }
.briefing-speaker-name { font-size: 20px; font-weight: 400; color: #2e7a2e; }
.briefing-text { color: var(--ink); font-weight: 600; font-size: 15px; }
.briefing-portrait-big { border-color: #e2b862; box-shadow: 0 0 0 3px #7a4a22, 0 6px 16px rgba(0, 0, 0, 0.6); }
#target-hint { color: var(--ink); font-weight: 700; }

/* ── Result, upgrade modal and shop ─────────────────────────────── */
#result-stars span { color: #ffd23f; text-shadow: 0 0 14px rgba(255, 200, 60, 0.8), 0 3px 0 #7a4a12; }
#result-stars .empty { color: rgba(40, 26, 12, 0.7); text-shadow: none; -webkit-text-stroke: 1.5px #e8c068; }
.hupg-panel { border: 4px solid #d9ad5c; box-shadow: 0 0 0 4px #6e4220, 0 14px 40px rgba(0, 0, 0, 0.8), inset 0 0 35px rgba(0, 0, 0, 0.35); }
.hupg-hero-name { font-weight: 400; font-size: 26px; }
.hupg-tab { font-weight: 400; font-size: 18px; }
.hupg-close-btn { background: linear-gradient(180deg, #d0533f, #8f2a1e); border-color: #f0b09a; }
.shop-card { background: var(--parchment); border: 3px solid #7a4a22; color: var(--ink); }
.shop-card-title { color: var(--ink); font-family: var(--font-title); font-size: 17px; font-weight: 400; }
.shop-card-desc { color: var(--ink-soft); text-shadow: none; }
.shop-status { color: #fff3cf; text-shadow: 0 2px 3px #000; }

/* ── New enemy card ─────────────────────────────────────────────── */
.enemy-intro {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(14, 10, 4, 0.55);
}
.ei-card {
    position: relative;
    width: 620px;
    padding: 24px 22px 14px;
    background: var(--parchment);
    border: 4px solid #7a4a22;
    border-radius: 16px;
    color: var(--ink);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7), inset 0 0 0 2px rgba(240, 194, 90, 0.6), inset 0 0 30px rgba(150, 100, 40, 0.3);
    animation: ei-pop 0.28s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes ei-pop { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ei-ribbon {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 30px 5px;
    background: linear-gradient(180deg, #6ccd57, #2e8330);
    border: 2px solid #f3d27a;
    border-radius: 9px;
    color: #fff8e6;
    font: 400 22px var(--font-title);
    white-space: nowrap;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}
.enemy-intro.boss .ei-ribbon { background: linear-gradient(180deg, #e0573f, #8f2a1e); }
.enemy-intro.boss .ei-card { border-color: #7a1f18; }
.ei-body { display: grid; grid-template-columns: 168px 1fr; gap: 16px; align-items: start; }
.ei-portrait, .bst-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cloth);
    border: 3px solid #e2b862;
    border-radius: 14px;
    box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.35);
}
.ei-portrait { width: 168px; height: 168px; }
.enemy-intro.boss .ei-portrait, .bst-hero.boss { background: radial-gradient(ellipse at 50% 30%, #c0553c 0%, #6e261b 100%); }
.ei-sprite, .bst-big-sprite, .bst-tile-sprite {
    background-size: 300% 300%;
    background-position: 0 0;
    background-repeat: no-repeat;
    filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.45));
}
.ei-sprite { width: 150px; height: 150px; }
.walk { animation: sprite-walk 0.66s steps(1) infinite; }
@keyframes sprite-walk {
    0% { background-position: 0% 0%; }
    33.33% { background-position: 50% 0%; }
    66.66% { background-position: 100% 0%; }
}
.ei-name { font: 400 32px/1.05 var(--font-title); color: var(--ink); margin-bottom: 4px; }
.ei-desc { font-size: 14px; font-weight: 600; line-height: 1.35; margin-bottom: 8px; }
.ei-traits, .bst-traits { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.ei-trait, .bst-trait { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-soft); line-height: 1.2; }
.ei-trait svg, .bst-trait svg { flex-shrink: 0; padding: 3px; border-radius: 50%; background: #3e2712; box-shadow: 0 0 0 1.5px #e2b862; }
.ei-counter, .bst-counter {
    padding: 8px 12px;
    border-radius: 9px;
    background: var(--cloth);
    border: 2px solid #e2b862;
    color: #fff8e6;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}
.ei-counter b, .bst-counter b { display: block; font: 400 16px var(--font-title); color: #ffe28a; }
.ei-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.ei-stats, .bst-stats { display: flex; flex-wrap: wrap; gap: 5px; }
.bst-stat { display: flex; flex-direction: column; align-items: center; padding: 3px 8px; border-radius: 8px; background: rgba(110, 75, 40, 0.12); border: 1px solid rgba(110, 75, 40, 0.35); }
.bst-stat em { font-style: normal; font-size: 9px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: var(--ink-soft); }
.bst-stat b { font-size: 15px; color: var(--ink); }
.ei-ok { min-width: 150px; margin: 0; }

/* ── Bestiary scene ─────────────────────────────────────────────── */
#scene-bestiary {
    display: block;
    background: linear-gradient(rgba(12, 20, 8, 0.5), rgba(12, 20, 8, 0.72)), var(--art-levels, url('assets/robinhood/ui/bg-levels.webp')) center / cover no-repeat;
}
#scene-bestiary.hidden { display: none !important; }
.bst-title { position: absolute; top: 8px; left: 0; right: 0; text-align: center; font: 400 38px var(--font-title); color: #fff3cf; text-shadow: 0 3px 0 #3a2410, 0 6px 14px rgba(0, 0, 0, 0.7); }
.bst-count { position: absolute; top: 55px; left: 0; right: 0; text-align: center; font-size: 13px; font-weight: 800; color: #ffe39a; text-shadow: 0 2px 3px #000; }
.bst-board {
    position: absolute;
    left: 18px;
    top: 82px;
    bottom: 14px;
    width: 526px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    background: var(--cloth);
    border: 4px solid #7a4a22;
    border-radius: 16px;
    box-shadow: var(--panel-shadow), inset 0 0 0 2px rgba(240, 194, 90, 0.6), inset 0 0 30px rgba(0, 0, 0, 0.35);
}
.bst-row { flex: 1; min-height: 0; display: grid; grid-template-columns: 24px repeat(5, minmax(0, 1fr)); gap: 6px; }
.bst-row-label {
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font: 400 13px var(--font-title);
    color: #ffe39a;
    background: rgba(10, 30, 8, 0.35);
    border-radius: 6px;
}
.bst-tile {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 2px 3px;
    background: var(--parchment);
    border: 2px solid #c9a15a;
    border-radius: 10px;
    color: var(--ink);
    font: 800 9.5px/1.1 var(--font-body);
    text-align: center;
    cursor: pointer;
    box-shadow: 0 3px 0 rgba(20, 45, 12, 0.6);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.bst-tile span { max-height: 2.2em; overflow: hidden; }
.bst-tile:hover:not(.unknown) { transform: translateY(-2px); border-color: #ffe08a; box-shadow: 0 5px 0 rgba(20, 45, 12, 0.6), 0 0 14px rgba(255, 220, 110, 0.6); }
.bst-tile.selected { border-color: #fff3cf; box-shadow: 0 0 0 3px #f0c25a, 0 0 18px rgba(255, 220, 110, 0.85); }
.bst-tile.boss { background: radial-gradient(ellipse at 30% 18%, #fff4e6 0%, #f3d4b8 55%, #e0a98a 100%); border-color: #b5563f; }
.bst-tile.unknown { background: rgba(18, 36, 14, 0.75); border: 2px dashed rgba(255, 240, 200, 0.3); color: #b7c9a4; cursor: default; box-shadow: none; }
.bst-tile.unknown .bst-tile-sprite { filter: brightness(0) opacity(0.45); }
.bst-tile-sprite { width: 46px; height: 46px; flex-shrink: 0; }
.bst-detail {
    position: absolute;
    right: 18px;
    top: 82px;
    bottom: 14px;
    width: 384px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px 14px;
    overflow: hidden;
    background: var(--parchment);
    border: 4px solid #7a4a22;
    border-radius: 16px;
    color: var(--ink);
    box-shadow: var(--panel-shadow), inset 0 0 0 2px rgba(240, 194, 90, 0.6), inset 0 0 30px rgba(150, 100, 40, 0.3);
}
.bst-hero { height: 88px; flex-shrink: 0; }
.bst-big-sprite { width: 84px; height: 84px; }
.bst-name { font: 400 25px/1 var(--font-title); }
.bst-role { font-size: 10.5px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; color: var(--ink-soft); }
.bst-desc { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.bst-traits { margin-bottom: 0; gap: 3px; }
.bst-trait { font-size: 11.5px; gap: 6px; }
.bst-trait svg { width: 16px; height: 16px; }
.bst-trait.plain { font-style: italic; font-weight: 600; }
.bst-counter { font-size: 12px; padding: 6px 10px; }
.bst-counter b { font-size: 15px; }
.bst-stats .bst-stat { padding: 2px 7px; }
.bst-stats .bst-stat b { font-size: 13px; }
.bst-stats { margin-top: auto; }
.bst-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; font-size: 15px; font-weight: 700; color: var(--ink-soft); }

/* ── Tutorial pointer ───────────────────────────────────────────── */
#tutorial-pointer { position: absolute; inset: 0; z-index: 35; pointer-events: none; }
.tut-arrow {
    position: absolute;
    width: 40px;
    height: 52px;
    fill: #ffd23f;
    stroke: #5a3518;
    stroke-width: 2.5;
    stroke-linejoin: round;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.6));
    animation: tut-bounce 0.9s ease-in-out infinite;
}
.tut-arrow.up { animation-name: tut-bounce-up; }
.tut-arrow.right { animation-name: tut-bounce-right; }
.tut-arrow.left { animation-name: tut-bounce-left; }
@keyframes tut-bounce-left { 0%, 100% { transform: rotate(90deg) translateY(-7px); } 50% { transform: rotate(90deg) translateY(1px); } }
/* The button a tutorial step asks for, inside the build menu or the tower panel. */
.tut-target { animation: tut-glow 0.8s ease-in-out infinite alternate; }
@keyframes tut-glow {
    from { box-shadow: 0 0 0 2px #ffd23f, 0 0 6px 2px rgba(255, 210, 63, 0.45); }
    to { box-shadow: 0 0 0 3px #ffd23f, 0 0 16px 6px rgba(255, 210, 63, 0.9); }
}
@keyframes tut-bounce { 0%, 100% { transform: translateY(-7px); } 50% { transform: translateY(1px); } }
@keyframes tut-bounce-up { 0%, 100% { transform: rotate(180deg) translateY(-7px); } 50% { transform: rotate(180deg) translateY(1px); } }
@keyframes tut-bounce-right { 0%, 100% { transform: rotate(-90deg) translateY(-7px); } 50% { transform: rotate(-90deg) translateY(1px); } }
.tut-bubble {
    position: absolute;
    max-width: 290px;
    padding: 9px 13px 6px;
    background: var(--parchment);
    border: 3px solid #7a4a22;
    border-radius: 12px;
    color: var(--ink);
    font: 700 14px/1.3 var(--font-body);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5), inset 0 0 0 1.5px rgba(240, 194, 90, 0.6);
    pointer-events: auto;
}
.tut-skip { display: block; margin: 4px 0 0 auto; padding: 0; background: none; border: none; color: var(--ink-soft); font: 600 10.5px var(--font-body); text-decoration: underline; cursor: pointer; }

/* ── Sound and music switches ───────────────────────────────────── */
.music-btn .music-slash { display: none; }
.music-btn.off .music-slash { display: inline; }
.music-btn.off { color: #f0a090; }
#btn-music svg { width: 16px; height: 16px; display: block; }
.menu-audio { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; }
.menu-audio-btn {
    width: 42px;
    height: 42px;
    padding: 9px;
    border: 2px solid #e7bf6a;
    border-radius: 10px;
    background: var(--wood-grain), var(--wood);
    color: #fff3cf;
    cursor: pointer;
    box-shadow: 0 3px 0 rgba(40, 20, 5, 0.6), 0 5px 12px rgba(0, 0, 0, 0.45);
}
.menu-audio-btn svg { width: 100%; height: 100%; display: block; }
.menu-audio-btn .sound-icon.hidden { display: none; }
.menu-audio-btn:hover { box-shadow: 0 0 16px rgba(255, 200, 110, 0.5); }
.menu-audio-btn .sound-off { color: #f0a090; }

/* Return to the portal without interrupting the game layout. */
.portal-home{position:fixed;top:max(8px,env(safe-area-inset-top));left:max(8px,env(safe-area-inset-left));z-index:1000;color:#f3edda;background:#132319d9;border:1px solid #ad956c;border-radius:20px;padding:7px 12px;font:13px/1.2 system-ui,sans-serif;text-decoration:none}.portal-home:focus-visible{outline:3px solid #efd57a;outline-offset:3px}

/* Keep the new splash hero visible beside the menu. */
#scene-menu{background-image:linear-gradient(90deg,rgba(0,0,0,.04) 40%,rgba(5,24,10,.55) 100%),var(--art-menu)}
.menu-content{display:flex;flex-direction:column;align-items:center;width:390px;margin-left:auto;margin-right:24px}
.menu-content .menu-title{font-size:54px}.menu-content .menu-subtitle{font-size:32px}
