/*
 * PropFirm Compare skin. Loaded after styles.css and overrides its look:
 * flat brand surfaces (#0d0d0d / #0f0f0f / #141414), one green accent
 * (#07e88a), Instrument Sans, no gradients, glows or glass.
 */
:root {
    --bg: #0d0d0d;
    --surface: #141414;
    --surface-2: #1b1b1b;
    --card: #0f0f0f;
    --accent: #07e88a;
    --accent-strong: #2ff3a0;
    --primary: #07e88a;
    --primary-strong: #2ff3a0;
    --danger: #ff4d4d;
    --muted: rgba(255, 255, 255, 0.6);
    --text: #ffffff;
    --border: #262626;
    --font: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html,
body {
    background: var(--bg);
    font-family: var(--font);
}

#gameContainer {
    box-shadow: none;
    border-radius: 0;
}

canvas {
    border: 0;
    background: var(--bg);
}

:focus-visible,
.btn:focus-visible,
.icon-btn:focus-visible,
.upgrade-option:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    box-shadow: none;
}

/* HUD ---------------------------------------------------------------- */
.hud {
    text-shadow: none;
    font-size: 15px;
    line-height: 1.4;
}
.hud-label {
    color: var(--muted);
    font-size: 13px;
}
.hud-value {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}
.hud-sub {
    font-size: 13px;
}
#topLeft,
#topRight,
#bottomLeft {
    background: rgba(13, 13, 13, 0.82);
    padding: 12px 16px;
}
#topLeft {
    top: 14px;
    left: 14px;
}
#topRight {
    top: 14px;
    right: 14px;
}
#bottomLeft {
    bottom: 14px;
    left: 14px;
}
.hud-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.hud-brand img {
    width: 22px;
    height: auto;
}
.hud-brand span {
    font-weight: 700;
    font-size: 14px;
}
.hud-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
}
.bar-label {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
.hp-bar,
.exp-bar {
    width: 240px;
    height: 8px;
    margin-top: 4px;
    background: var(--surface-2);
    border: 0;
    border-radius: 0;
}
.hp-fill {
    background: var(--danger);
}
.exp-fill {
    background: var(--accent);
}

.chip,
.weapon-icons .chip {
    width: 44px;
    height: 36px;
    background: var(--surface);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}
.chip.active {
    border: 0;
    box-shadow: inset 0 -3px 0 var(--accent);
}
.chip.maxed,
.chip.evolved {
    background: var(--accent);
    color: #0d0d0d;
    box-shadow: none;
}
.chip-lvl {
    background: var(--text);
    color: #0d0d0d;
    border-radius: 0;
}

.icon-btn {
    background: var(--surface);
    border: 0;
    border-radius: 0;
    font-family: var(--font);
    font-weight: 700;
}
.icon-btn:hover {
    background: var(--surface-2);
}

/* Overlays ----------------------------------------------------------- */
.overlay {
    background: rgba(13, 13, 13, 0.9);
    backdrop-filter: none;
}
.overlay-card,
.settings-card {
    background: var(--card);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    text-align: left;
    padding: 32px 36px;
}
.overlay-card h1,
.overlay-card h2,
.settings-card h2 {
    color: var(--text);
    text-shadow: none;
    letter-spacing: -0.02em;
    line-height: 1;
}
.overlay-card h2 {
    font-size: 28px;
}

.btn {
    font-family: var(--font);
    border-radius: 999px;
    padding: 12px 24px;
    font-weight: 600;
}
.btn:hover {
    transform: none;
}
.btn.primary {
    background: var(--accent);
    color: #0d0d0d;
}
.btn.primary:hover {
    background: var(--accent-strong);
}
.btn.ghost {
    background: var(--surface);
    border: 0;
    color: var(--text);
}
.btn.ghost:hover {
    background: var(--surface-2);
}
.btn:active {
    transform: scale(0.97);
}

/* Title screen ------------------------------------------------------- */
#startScreen {
    align-items: stretch;
    justify-content: stretch;
}
.title-card {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 48px;
    padding: 56px 64px;
    overflow-y: auto;
    background: transparent;
}
.title-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
}
.title-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 18px;
    font-weight: 700;
}
.title-logo img {
    width: 44px;
    height: auto;
}
.title-card h1 {
    font-size: clamp(56px, 9vw, 112px);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 0.92;
    color: var(--text);
    margin: 0;
}
.title-card .subtitle {
    color: var(--text);
    font-size: 20px;
    line-height: 1.45;
    max-width: 30ch;
    margin: 0;
}
.title-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}
.title-actions .btn.primary {
    font-size: 18px;
    padding: 16px 32px;
}
.stage-chip {
    color: var(--accent);
    background: transparent;
    padding: 0;
    margin-left: 6px;
}
.title-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}
.code-panel {
    background: var(--accent);
    color: #0d0d0d;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.code-panel p {
    font-size: 17px;
    line-height: 1.4;
    margin: 0;
}
.code-panel .code {
    font-size: clamp(56px, 7vw, 88px);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 0.9;
}
.code-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.code-panel .btn {
    background: #0d0d0d;
    color: var(--text);
}
.code-panel .btn:hover {
    background: #1b1b1b;
}
.code-panel a.btn {
    text-decoration: none;
    display: inline-block;
}
.title-howto {
    background: var(--surface);
    padding: 22px 24px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
}
.title-howto strong {
    display: block;
    margin-bottom: 6px;
}
.title-howto ul {
    list-style: none;
}
.title-more {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.title-more .btn {
    padding: 9px 16px;
    font-size: 14px;
}
.credit {
    font-size: 12px;
    color: var(--muted);
}
.credit a {
    color: var(--muted);
}

/* Level-up: TP HIT --------------------------------------------------- */
.overlay-card.levelup {
    min-width: 520px;
    max-width: 640px;
}
#levelUpTitle {
    font-size: 64px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.04em;
    margin-bottom: 6px;
}
.levelup-sub {
    color: var(--text);
    font-size: 17px;
    margin-bottom: 18px;
}
.upgrade-option {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 16px;
    align-items: center;
    background: var(--surface);
    border: 0;
    border-radius: 0;
    padding: 14px;
    margin: 8px 0;
}
.upgrade-option:hover,
.upgrade-option:focus {
    background: var(--surface-2);
    border: 0;
    transform: none;
    box-shadow: inset 4px 0 0 var(--accent);
}
.up-code {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #0d0d0d;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.02em;
}
.up-meta {
    color: var(--muted);
    font-size: 13px;
}
.upgrade-option .name {
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.upgrade-option .desc {
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    line-height: 1.45;
}
.evolve-tag {
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    margin-top: 4px;
}
.upgrade-option.maxed {
    border-style: none;
}
.upgrade-option.maxed .up-code {
    background: var(--surface-2);
    color: var(--muted);
}

/* Game over: STOP LOSS HIT ------------------------------------------ */
.overlay-card.gameover {
    border: 0;
    min-width: 560px;
    max-width: 720px;
    box-shadow: inset 0 6px 0 var(--danger);
}
.overlay-card.gameover h1 {
    color: var(--danger);
    font-size: 64px;
    font-weight: 700;
    letter-spacing: -0.04em;
    text-shadow: none;
    margin-bottom: 18px;
}
.stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 24px;
    margin: 0 0 22px;
    line-height: 1.3;
}
.stat-label {
    color: var(--muted);
    font-size: 13px;
}
.stat-value {
    font-size: 26px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.gameover-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--accent);
    color: #0d0d0d;
    padding: 18px 20px;
    margin-bottom: 18px;
}
.gameover-cta p {
    font-size: 15px;
    line-height: 1.4;
}
.gameover-cta strong {
    font-size: 22px;
}
.gameover-cta .btn {
    background: #0d0d0d;
    color: var(--text);
    white-space: nowrap;
    text-decoration: none;
}
.hs-details summary {
    color: var(--muted);
    cursor: pointer;
}

/* Boss banner + toasts ---------------------------------------------- */
.boss-banner {
    color: var(--danger);
    font-weight: 700;
    letter-spacing: -0.02em;
    text-shadow: none;
}
.ach-toast {
    background: var(--surface) !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: inset 4px 0 0 var(--accent) !important;
}
.ach-card,
.stage-card {
    background: var(--surface);
    border: 0;
    border-radius: 0;
}
.ach-card.earned {
    background: var(--surface-2);
    box-shadow: inset 0 -3px 0 var(--accent);
}
.ach-card-icon,
.stage-icon {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}
.ach-card-name,
.stage-name {
    color: var(--text);
}

@media (max-width: 820px) {
    .title-card {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 28px 20px;
    }
    .title-card .subtitle {
        font-size: 17px;
    }
    .overlay-card.levelup,
    .overlay-card.gameover {
        min-width: 0;
        width: 100%;
    }
    #levelUpTitle,
    .overlay-card.gameover h1 {
        font-size: 44px;
    }
    .gameover-cta {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn,
    .upgrade-option {
        transition: none;
    }
}

/* Menus cover the whole viewport, not just the scaled canvas box, so
   they stay readable on phones and small windows. */
.overlay {
    position: fixed;
    overflow-y: auto;
}
#startScreen {
    background: var(--bg);
}
.stage-chip {
    border: 0;
    font-size: inherit;
    font-weight: 600;
    vertical-align: baseline;
}
.ach-toast .ach-title {
    text-transform: none;
    letter-spacing: 0;
    font-size: 13px;
    color: var(--accent);
}
.ach-toast .ach-icon {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
}
.overlay-card .btn-row {
    justify-content: flex-start;
}

/* Session picker + settings ------------------------------------------ */
.stage-card {
    border: 0;
    border-radius: 0;
    font-family: var(--font);
}
.stage-card:hover,
.stage-card:focus-visible {
    border: 0;
    transform: none;
    background: var(--surface-2);
}
.stage-card.active {
    border: 0;
    background: var(--surface-2);
    box-shadow: inset 0 -3px 0 var(--accent);
}
.settings-row {
    border-top: 0;
}
.settings-row + .settings-row {
    box-shadow: 0 -1px 0 var(--surface);
}
.settings-row select {
    background: var(--surface);
    border: 0;
    border-radius: 0;
    color: var(--text);
    font-family: var(--font);
}
.settings-row input[type='range'],
.settings-row input[type='checkbox'] {
    accent-color: var(--accent);
}
.settings-card button {
    font-family: var(--font);
    font-weight: 600;
    font-size: 14px;
    border: 0;
    border-radius: 999px;
    padding: 10px 18px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}
.settings-card button:hover {
    background: var(--surface-2);
}
.settings-card button[data-action='close'] {
    background: var(--accent);
    color: #0d0d0d;
}
.settings-card button.danger {
    background: transparent;
    color: var(--danger);
    padding-left: 0;
}

/* Firm logos ---------------------------------------------------------- */
.firm-wall {
    background: var(--surface);
    padding: 20px 24px;
}
.firm-wall p {
    font-size: 15px;
    margin-bottom: 14px;
}
.firm-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.firm-row a {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    transition: transform 0.15s ease;
}
.firm-row a:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 -3px 0 var(--accent);
}
.firm-row img {
    max-width: 40px;
    max-height: 40px;
}
.payout-firms {
    margin-bottom: 18px;
}
.payout-firms .stat-label {
    margin-bottom: 8px;
}
.payout-toast {
    position: absolute;
    left: 50%;
    top: 18%;
    transform: translate(-50%, -8px);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px 12px 12px;
    background: var(--surface);
    box-shadow: inset 4px 0 0 var(--accent);
    opacity: 0;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
    pointer-events: none;
    z-index: 6;
}
.payout-toast.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}
.payout-toast img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    background: var(--bg);
    padding: 4px;
}
.pt-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}
.pt-firm {
    font-size: 14px;
}
@media (prefers-reduced-motion: reduce) {
    .payout-toast,
    .firm-row a {
        transition: none;
    }
}

/* First-sighting card for a new red flag ------------------------------ */
.intro-card {
    position: absolute;
    left: 50%;
    bottom: 96px;
    transform: translate(-50%, 8px);
    display: flex;
    align-items: center;
    gap: 14px;
    width: min(440px, calc(100% - 32px));
    padding: 12px 18px 12px 12px;
    background: var(--surface);
    box-shadow: inset 4px 0 0 var(--danger);
    opacity: 0;
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
    pointer-events: none;
    z-index: 6;
}
.intro-card.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}
.intro-card canvas {
    flex: none;
    background: var(--bg);
}
.ic-kicker {
    color: var(--danger);
    font-size: 13px;
    font-weight: 600;
}
.ic-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.15;
}
.ic-text {
    font-size: 14px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.82);
}
@media (prefers-reduced-motion: reduce) {
    .intro-card {
        transition: none;
    }
}

/* Full-window play area (PokéSurvivor-style). */
#gameContainer {
    position: fixed;
    inset: 0;
    max-width: none;
    max-height: none;
}
canvas {
    image-rendering: pixelated;
}

/* PokéSurvivor-style HUD: status top-left, big timer top-centre, hotbar
   bottom-centre. Numbers use a pixel face to match the sprites. */
:root {
    --pixel: 'Tiny5', 'Instrument Sans', system-ui, sans-serif;
}
#topLeft,
#topRight,
#topCenter {
    background: transparent;
    padding: 0;
}
#topLeft {
    top: 14px;
    left: 16px;
    width: 250px;
}
#topLeft .hud-brand {
    margin-bottom: 6px;
}
.hud-tps {
    margin-left: auto;
    font-family: var(--pixel);
    font-weight: 700;
    color: var(--accent);
    font-size: 16px;
}
#topLeft .bar-label {
    margin-top: 6px;
    font-family: var(--pixel);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}
#topLeft .hp-bar,
#topLeft .exp-bar {
    width: 250px;
    height: 10px;
    background: rgba(0, 0, 0, 0.55);
    box-shadow: inset 0 0 0 2px #0d0d0d;
}
#topLeft .hud-sub {
    font-family: var(--pixel);
    font-size: 12px;
    margin-top: 4px;
}
#topCenter {
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}
.hud-timer {
    font-family: var(--pixel);
    font-weight: 700;
    font-size: 34px;
    line-height: 1;
    letter-spacing: 0.02em;
    text-shadow: 0 3px 0 #0d0d0d;
}
#topCenter .hud-sub {
    font-family: var(--pixel);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 2px;
}
#topRight {
    top: 14px;
    right: 16px;
}
#hotbar {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    display: flex;
    gap: 14px;
    align-items: flex-end;
    pointer-events: none;
    z-index: 5;
}
#hotbar .chip-row,
#hotbar .weapon-icons {
    position: static;
    margin: 0;
    max-width: none;
    flex-wrap: nowrap;
}
#hotbar .chip {
    width: 46px;
    height: 46px;
    font-family: var(--pixel);
    font-size: 13px;
    background: rgba(13, 13, 13, 0.82);
    box-shadow: inset 0 0 0 2px #262626;
}
#hotbar .chip.active {
    box-shadow:
        inset 0 0 0 2px #262626,
        inset 0 -4px 0 var(--accent);
}
#hotbar #passiveIcons .chip {
    width: 38px;
    height: 38px;
    font-size: 11px;
}
#hotbar .chip.maxed,
#hotbar .chip.evolved {
    background: var(--accent);
    color: #0d0d0d;
}
.boss-banner {
    font-family: var(--pixel);
    text-shadow: 0 4px 0 #0d0d0d;
}
@media (max-width: 700px) {
    #topLeft {
        width: 180px;
    }
    #topLeft .hp-bar,
    #topLeft .exp-bar {
        width: 180px;
    }
    .hud-timer {
        font-size: 26px;
    }
    #hotbar .chip {
        width: 36px;
        height: 36px;
        font-size: 11px;
    }
    #hotbar #passiveIcons .chip {
        width: 30px;
        height: 30px;
    }
}

/* Small screens: keep the middle of the playfield clear. */
@media (max-width: 600px) {
    #topCenter {
        left: auto;
        right: 58px;
        transform: none;
        text-align: right;
    }
    .hud-timer {
        font-size: 22px;
    }
    #topCenter .hud-sub {
        font-size: 11px;
    }
    #topLeft {
        width: 170px;
    }
    #topLeft .hp-bar,
    #topLeft .exp-bar {
        width: 170px;
    }
    #topLeft .bar-label {
        font-size: 11px;
    }
    #topLeft #waveLabel,
    #topLeft #highScore {
        display: none;
    }
}
@media (max-height: 500px) {
    #topLeft {
        width: 170px;
        top: 8px;
    }
    #topLeft .hp-bar,
    #topLeft .exp-bar {
        width: 170px;
        height: 7px;
    }
    #topLeft .bar-label {
        font-size: 11px;
        margin-top: 3px;
    }
    #topLeft #waveLabel,
    #topLeft #highScore {
        display: none;
    }
    .hud-timer {
        font-size: 22px;
    }
    #hotbar {
        bottom: 6px;
    }
    #hotbar .chip {
        width: 32px;
        height: 32px;
        font-size: 10px;
    }
    #hotbar #passiveIcons .chip {
        width: 26px;
        height: 26px;
        font-size: 9px;
    }
}
@media (max-height: 500px), (max-width: 600px) {
    .intro-card {
        top: 64px;
        bottom: auto;
        width: min(340px, calc(100% - 24px));
        padding: 8px 12px 8px 8px;
        gap: 10px;
    }
    .intro-card canvas {
        width: 40px !important;
        height: 40px !important;
    }
    .ic-name {
        font-size: 16px;
    }
    .ic-text {
        font-size: 12px;
    }
    .ach-toast-host {
        transform: scale(0.85);
        transform-origin: top center;
    }
}
@media (max-height: 500px) and (min-width: 601px) {
    .intro-card {
        top: auto;
        bottom: 48px;
        left: auto;
        right: 12px;
        transform: none;
    }
    .intro-card.visible {
        transform: none;
    }
}
@media (max-width: 600px) {
    .intro-card {
        top: auto;
        bottom: 66px;
    }
    .ach-toast-host {
        top: 112px !important;
        right: 8px !important;
        left: auto !important;
    }
}

/* ======================================================================
   Pixel UI (matches the pixel-art game). Panels get a stepped two-tone
   frame, buttons press down, headings use the pixel face with a hard
   drop shadow. The menu floats over the live trading floor.
   ====================================================================== */
:root {
    --px-frame: #2b302d;
    --px-frame-dark: #070807;
    --px-panel: rgba(16, 19, 17, 0.92);
    --px-green-dark: #04804b;
    --px-red-dark: #8c1f1f;
}
.overlay {
    background: rgba(7, 8, 7, 0.55);
}
#startScreen {
    background: rgba(7, 8, 7, 0.45);
}
.px-panel,
.overlay-card,
.settings-card {
    background: var(--px-panel);
    box-shadow:
        0 0 0 3px var(--px-frame-dark),
        0 0 0 6px var(--px-frame),
        0 0 0 9px var(--px-frame-dark),
        0 10px 0 9px rgba(0, 0, 0, 0.45);
}
.overlay-card h1,
.overlay-card h2,
.settings-card h2 {
    font-family: var(--pixel);
    font-weight: 700;
    letter-spacing: 0.01em;
    text-shadow: 0 4px 0 var(--px-frame-dark);
}

/* Buttons: chunky, square, press down on click. */
.btn,
.settings-card button {
    font-family: var(--pixel);
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: 0;
    box-shadow:
        0 0 0 3px var(--px-frame-dark),
        inset 0 -5px 0 rgba(0, 0, 0, 0.35),
        inset 0 3px 0 rgba(255, 255, 255, 0.08);
    transition:
        transform 0.08s ease,
        filter 0.12s ease;
}
.btn:hover,
.settings-card button:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}
.btn:active,
.settings-card button:active {
    transform: translateY(2px);
    box-shadow:
        0 0 0 3px var(--px-frame-dark),
        inset 0 -2px 0 rgba(0, 0, 0, 0.35);
}
.btn.primary {
    background: var(--accent);
    color: #062014;
    box-shadow:
        0 0 0 3px var(--px-frame-dark),
        inset 0 -5px 0 var(--px-green-dark),
        inset 0 3px 0 rgba(255, 255, 255, 0.35);
}
.btn.ghost {
    background: #1c201d;
}
.settings-card button.danger {
    box-shadow: none;
}

/* Title screen ------------------------------------------------------- */
.title-card {
    align-items: center;
    gap: 56px;
}
.title-main {
    gap: 18px;
}
.title-logo {
    font-family: var(--pixel);
    font-weight: 500;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.85);
    gap: 12px;
}
.title-logo canvas {
    width: 54px;
    height: 51px;
    image-rendering: pixelated;
}
.px-title {
    display: flex;
    flex-direction: column;
    font-family: var(--pixel);
    font-weight: 700;
    line-height: 0.88;
    letter-spacing: 0.01em;
    margin: 0;
}
.px-title-top {
    font-size: clamp(30px, 4.2vw, 54px);
    color: var(--accent);
    text-shadow:
        0 4px 0 var(--px-green-dark),
        0 8px 0 var(--px-frame-dark);
}
.px-title-bottom {
    font-size: clamp(54px, 8.6vw, 116px);
    color: #ffffff;
    text-shadow:
        0 6px 0 #9aa39d,
        0 12px 0 var(--px-frame-dark);
}
.title-card .subtitle {
    max-width: 34ch;
    font-size: 18px;
    text-shadow: 0 2px 0 var(--px-frame-dark);
}
.px-start {
    align-self: flex-start;
    font-size: 24px;
    padding: 18px 34px 22px;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    animation: px-pulse 1.6s ease-in-out infinite;
}
.px-play {
    width: 0;
    height: 0;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 14px solid #062014;
}
@keyframes px-pulse {
    0%,
    100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.15);
    }
}
.title-actions .btn,
.title-more .btn {
    font-size: 15px;
}
.stage-chip {
    font-family: var(--pixel);
}
.title-side {
    gap: 22px;
}
.code-panel.px-panel {
    background: var(--accent);
    color: #062014;
    box-shadow:
        0 0 0 3px var(--px-frame-dark),
        0 0 0 6px var(--px-green-dark),
        0 0 0 9px var(--px-frame-dark),
        0 10px 0 9px rgba(0, 0, 0, 0.45);
}
.code-panel .code {
    font-family: var(--pixel);
    font-size: clamp(60px, 7vw, 96px);
    letter-spacing: 0.04em;
    text-shadow: 0 6px 0 var(--px-green-dark);
}
.code-panel p {
    font-weight: 600;
}
.code-panel .btn {
    background: #0d0d0d;
    color: #ffffff;
}
.firm-wall.px-panel,
.title-howto.px-panel {
    background: var(--px-panel);
}
.firm-wall p,
.title-howto strong {
    font-family: var(--pixel);
    font-weight: 600;
}
.firm-row a {
    background: #0b0d0c;
    box-shadow:
        0 0 0 2px var(--px-frame-dark),
        0 0 0 4px var(--px-frame);
}
.title-howto li {
    padding-left: 16px;
    position: relative;
}
.title-howto li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 6px;
    height: 6px;
    background: var(--accent);
}
.credit {
    font-family: var(--pixel);
    font-size: 12px;
}

/* TP HIT and STOP LOSS HIT --------------------------------------------- */
#levelUpTitle {
    font-family: var(--pixel);
    font-size: 72px;
    text-shadow:
        0 5px 0 var(--px-green-dark),
        0 10px 0 var(--px-frame-dark);
    animation: px-pop 0.35s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.overlay-card.gameover {
    box-shadow:
        0 0 0 3px var(--px-frame-dark),
        0 0 0 6px var(--px-red-dark),
        0 0 0 9px var(--px-frame-dark),
        0 10px 0 9px rgba(0, 0, 0, 0.45);
}
.overlay-card.gameover h1 {
    font-family: var(--pixel);
    font-size: 70px;
    text-shadow:
        0 5px 0 var(--px-red-dark),
        0 10px 0 var(--px-frame-dark);
    animation: px-pop 0.35s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
@keyframes px-pop {
    from {
        transform: scale(0.6);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
.upgrade-option {
    box-shadow:
        0 0 0 3px var(--px-frame-dark),
        0 0 0 5px var(--px-frame);
    margin: 12px 0;
}
.upgrade-option:hover,
.upgrade-option:focus {
    box-shadow:
        0 0 0 3px var(--px-frame-dark),
        0 0 0 5px var(--accent);
    transform: translateY(-2px);
}
.up-code {
    font-family: var(--pixel);
    box-shadow:
        inset 0 -4px 0 var(--px-green-dark),
        inset 0 3px 0 rgba(255, 255, 255, 0.3);
}
.upgrade-option .name,
.stat-value,
.ic-name {
    font-family: var(--pixel);
}
.stat-value {
    font-size: 30px;
}
.gameover-cta {
    box-shadow:
        0 0 0 3px var(--px-frame-dark),
        inset 0 -5px 0 var(--px-green-dark);
}
.gameover-cta strong {
    font-family: var(--pixel);
}
.stage-card,
.ach-card {
    box-shadow:
        0 0 0 3px var(--px-frame-dark),
        0 0 0 5px var(--px-frame);
}
.stage-card.active {
    box-shadow:
        0 0 0 3px var(--px-frame-dark),
        0 0 0 5px var(--accent);
}
.stage-name,
.ach-card-name,
.stage-icon,
.ach-card-icon {
    font-family: var(--pixel);
}
.intro-card,
.payout-toast,
.ach-toast {
    box-shadow:
        0 0 0 3px var(--px-frame-dark),
        0 0 0 5px var(--px-frame) !important;
}
.intro-card {
    border-left: 5px solid var(--danger);
}
.payout-toast {
    border-left: 5px solid var(--accent);
}
@media (prefers-reduced-motion: reduce) {
    .px-start,
    #levelUpTitle,
    .overlay-card.gameover h1 {
        animation: none;
    }
}
@media (max-width: 820px) {
    .title-card {
        gap: 28px;
        align-items: stretch;
    }
    .px-start {
        align-self: stretch;
        justify-content: center;
    }
}

/* The in-game HUD stays hidden while the title screen is up. */
body.in-menu #ui,
body.in-menu #joystickBase,
body.in-menu #specialSkillBtn {
    visibility: hidden;
}

/* Font legibility: Tiny5 for the pixel UI, Press Start 2P for the code. */
.code-panel .code,
.gameover-cta strong {
    font-family: 'Press Start 2P', var(--pixel);
    font-weight: 400;
    letter-spacing: 0.06em;
}
.code-panel .code {
    font-size: clamp(48px, 5.6vw, 76px);
    line-height: 1.1;
}
.gameover-cta strong {
    font-size: 18px;
}

.px-title-top {
    text-shadow: 0 3px 0 var(--px-frame-dark);
}

/* Boss health bar under the timer. */
.boss-bar {
    position: absolute;
    top: 74px;
    left: 50%;
    transform: translateX(-50%);
    width: min(560px, 70vw);
    pointer-events: none;
    z-index: 5;
}
.boss-bar[hidden] {
    display: none;
}
.boss-bar-name {
    display: flex;
    justify-content: space-between;
    font-family: var(--pixel);
    font-size: 18px;
    text-shadow: 0 2px 0 #070807;
    margin-bottom: 4px;
}
#bossBarState {
    color: #ff4d4d;
}
.boss-bar-track {
    height: 14px;
    background: rgba(0, 0, 0, 0.6);
    box-shadow:
        0 0 0 3px #070807,
        0 0 0 5px #2b302d;
}
.boss-bar-fill {
    height: 100%;
    background: #ff4d4d;
    box-shadow: inset 0 -4px 0 #8c1f1f;
    transition: width 0.15s;
}
.boss-bar.fury .boss-bar-fill {
    background: #ff2a2a;
    animation: px-pulse 0.6s ease-in-out infinite;
}
@media (max-width: 600px) {
    .boss-bar {
        top: 160px;
        width: 86vw;
    }
}

/* Boss fights ---------------------------------------------------------- */
.duel-card {
    width: min(980px, 94vw);
    max-height: 92dvh;
    overflow-y: auto;
}
.duel-sub {
    margin: 6px 0 18px;
    color: rgba(255, 255, 255, 0.8);
}
.duel-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.duel-boss {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 14px 14px;
    background: #171a18;
    color: #ffffff;
    border: 0;
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow:
        0 0 0 3px var(--px-frame-dark),
        0 0 0 5px var(--px-frame);
    transition:
        transform 0.08s ease,
        box-shadow 0.12s ease;
}
.duel-boss:hover,
.duel-boss:focus-visible {
    transform: translateY(-3px);
    box-shadow:
        0 0 0 3px var(--px-frame-dark),
        0 0 0 5px var(--danger);
}
.duel-boss canvas {
    width: 100%;
    height: auto;
    max-width: 100%;
    background: #101210;
    image-rendering: pixelated;
    margin-bottom: 4px;
}
.duel-name {
    font-family: var(--pixel);
    font-size: 22px;
}
.duel-blurb {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.4;
}
.duel-best {
    font-family: var(--pixel);
    font-size: 14px;
    color: var(--accent);
    margin-top: 4px;
}
.duel-win {
    min-width: 560px;
    max-width: 720px;
}
.duel-win h1 {
    font-family: var(--pixel);
    font-size: 54px;
    color: var(--accent);
    text-shadow:
        0 5px 0 var(--px-green-dark),
        0 10px 0 var(--px-frame-dark);
    animation: px-pop 0.35s cubic-bezier(0.2, 1.6, 0.4, 1) both;
    margin-bottom: 18px;
}
.duel-win .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.duel-new {
    display: inline-block;
    font-size: 13px;
    background: var(--accent);
    color: #062014;
    padding: 2px 6px;
    vertical-align: middle;
}
@media (max-width: 820px) {
    .duel-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .duel-win {
        min-width: 0;
        width: 94vw;
    }
    .duel-win h1 {
        font-size: 34px;
    }
}

/* Money values: Press Start 2P has an unambiguous dollar sign. */
.stat-value {
    font-family: 'Press Start 2P', var(--pixel);
    font-size: 20px;
    line-height: 1.5;
}

/* Setup level tiers: green → blue → purple → orange → gold. */
#hotbar .chip.active {
    box-shadow:
        inset 0 0 0 2px #262626,
        inset 0 -6px 0 var(--tier, var(--accent));
}
#hotbar .chip.maxed,
#hotbar .chip.evolved {
    background: var(--tier, var(--accent));
    color: #0d0d0d;
}
.upgrade-option[style*='--tier'] .up-code {
    background: var(--tier);
    color: #0d0d0d;
}
.upgrade-option[style*='--tier']:hover,
.upgrade-option[style*='--tier']:focus {
    box-shadow:
        0 0 0 3px var(--px-frame-dark),
        0 0 0 5px var(--tier);
}
.upgrade-option .perks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.upgrade-option .perks span {
    font-family: var(--pixel);
    font-size: 13px;
    line-height: 1;
    padding: 5px 7px 4px;
    color: #0d0d0d;
    background: var(--tier, var(--accent));
}

/* Title: Tiny5 has one weight; faux-bold ran the PropFirm letters together. */
.px-title {
    font-weight: 400;
}
.px-title-top {
    letter-spacing: 0.08em;
}
.px-title-bottom {
    letter-spacing: 0.02em;
}

/* Start session and Boss fights side by side. */
.title-play {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: stretch;
}
.title-play .px-start {
    align-self: auto;
}
.px-duel {
    font-size: 20px;
    padding: 18px 26px 22px;
}
@media (max-width: 820px) {
    .title-play > .btn {
        flex: 1 1 200px;
        justify-content: center;
    }
}

/* Trader picker on the title screen. */
.skin-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
}
.skin-label {
    width: 100%;
    font-family: var(--pixel);
    font-size: 15px;
    color: var(--muted);
}
.skin-opt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 64px;
    padding: 6px 6px 5px;
    border: 0;
    cursor: pointer;
    background: rgba(13, 13, 13, 0.82);
    box-shadow: inset 0 0 0 2px #262626;
    color: var(--text);
    font-family: var(--pixel);
    font-size: 13px;
    transition: transform 120ms ease;
}
.skin-opt canvas {
    width: 50px;
    height: 60px;
    image-rendering: pixelated;
}
.skin-opt[aria-checked='true'] {
    box-shadow:
        inset 0 0 0 2px var(--skin-accent),
        inset 0 -4px 0 var(--skin-accent);
    color: var(--skin-accent);
}
.skin-opt:hover {
    transform: translateY(-2px);
}
.skin-opt:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
    .skin-opt {
        transition: none;
    }
}

/* Public leaderboard (propfirm.compare/propfirmsurvivors/leaderboard) ---- */
.title-more a.btn {
    text-decoration: none;
    color: var(--text);
}
.online-note {
    font-size: 13px;
    color: var(--muted);
    max-width: 46ch;
}
.online-note a {
    color: var(--accent);
}
.online-score {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    margin: 0 0 18px;
    padding: 14px 16px;
    background: #121613;
    box-shadow:
        0 0 0 3px var(--px-frame-dark),
        inset 4px 0 0 var(--accent);
}
.online-score[hidden] {
    display: none;
}
.online-score[data-state='signed-out'],
.online-score[data-state='error'] {
    box-shadow:
        0 0 0 3px var(--px-frame-dark),
        inset 4px 0 0 #ffd166;
}
.online-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.online-head {
    font-family: var(--pixel);
    font-size: 18px;
    line-height: 1.2;
}
.online-sub {
    color: var(--muted);
    font-size: 14px;
}
.online-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.online-actions .btn {
    padding: 9px 16px;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}
.online-actions .btn.ghost {
    color: var(--text);
}
