/* Bonkler Battle — cleaned Windows 2000 game shell */
:root {
    --desktop: #007d7b;
    --desktop-dark: #005e5c;
    --chrome: #c6c9c8;
    --chrome-light: #e9eceb;
    --chrome-mid: #d5d8d7;
    --chrome-dark: #808786;
    --chrome-deep: #3d4443;
    --field: #f7f8f3;
    --ink: #111514;
    --muted: #4d5553;
    --title: #000b78;
    --title-bright: #1249c4;
    --teal: #007c76;
    --teal-dark: #005a56;
    --orange: #d84a16;
    --red: #a91d1d;
    --green: #087b34;
    --yellow: #f0d95f;
    --focus: #fff23b;
    --font-ui: Tahoma, "MS Sans Serif", "Segoe UI", sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    --bevel-raised: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #5f6665, inset 2px 2px 0 #dde0df, inset -2px -2px 0 #9da2a1;
    --bevel-sunken: inset 1px 1px 0 #5d6362, inset -1px -1px 0 #ffffff, inset 2px 2px 0 #929796, inset -2px -2px 0 #dfe2e1;
    --shadow-window: 10px 14px 0 rgb(0 45 44 / 0.28), 0 20px 50px rgb(0 20 20 / 0.24);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { min-width: 320px; background: var(--desktop); }

body {
    margin: 0;
    min-height: 100dvh;
    padding: clamp(0px, 2.2vw, 28px);
    color: var(--ink);
    background-color: var(--desktop);
    background-image:
        linear-gradient(45deg, rgb(255 255 255 / 0.025) 25%, transparent 25%),
        linear-gradient(-45deg, rgb(255 255 255 / 0.025) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgb(0 0 0 / 0.035) 75%),
        linear-gradient(-45deg, transparent 75%, rgb(0 0 0 / 0.035) 75%);
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0;
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: none;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; touch-action: manipulation; -webkit-tap-highlight-color: rgb(0 11 120 / 0.16); }
button, [role="button"] { min-width: 28px; min-height: 28px; }
.ui-symbol { width: 16px; height: 16px; display: inline-block; flex: none; overflow: visible; color: currentColor; vertical-align: -0.18em; shape-rendering: geometricPrecision; }
.ui-symbol use { pointer-events: none; }
button:focus-visible, [tabindex]:focus-visible {
    outline: 2px dotted var(--ink);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px var(--focus);
}
button:disabled { cursor: not-allowed !important; filter: grayscale(0.7); opacity: 0.58; }
[hidden] { display: none !important; }

h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; scroll-margin-top: 76px; }
p { text-wrap: pretty; }

.skip-link {
    position: fixed;
    top: -100px;
    left: 8px;
    z-index: 20000;
    padding: 10px 14px;
    color: #fff;
    background: var(--title);
    border: 2px solid #fff;
}
.skip-link:focus-visible { top: 8px; }

/* Shared retro primitives */
.application-window,
.window-frame {
    border: 2px solid var(--chrome-light);
    outline: 1px solid var(--chrome-deep);
    background: var(--chrome);
    box-shadow: var(--shadow-window);
}

.window-titlebar {
    min-height: 32px;
    padding: 4px 5px 4px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #fff;
    background: linear-gradient(90deg, var(--title), var(--title-bright) 70%, #2498a5);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.titlebar-label { display: flex; align-items: center; gap: 8px; }
.titlebar-label img { image-rendering: pixelated; }
.window-controls { display: flex; gap: 3px; }
.window-controls span {
    width: 23px;
    height: 22px;
    display: grid;
    place-items: center;
    color: var(--ink);
    background: var(--chrome);
    box-shadow: var(--bevel-raised);
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1;
}

.section-titlebar,
.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.section-titlebar {
    min-height: 62px;
    padding: 11px 13px;
    margin-bottom: 12px;
    color: var(--ink);
    background: linear-gradient(180deg, var(--chrome-light), var(--chrome-mid));
    border: 1px solid var(--chrome-dark);
    border-top-color: #fff;
    border-left-color: #fff;
}
.section-titlebar > div:first-child { display: flex; align-items: center; gap: 11px; }
.section-titlebar h2 { font-size: clamp(17px, 1.5vw, 22px); line-height: 1.1; letter-spacing: -0.02em; }
.section-titlebar > p { max-width: 48ch; color: var(--muted); font-size: 12px; text-align: right; }
.section-index {
    min-width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--title);
    border: 1px solid #fff;
    outline: 1px solid var(--chrome-dark);
    font: 700 11px/1 var(--font-mono);
}
.panel-heading { margin-bottom: 10px; }
.panel-heading h3 { font-size: 15px; }
.panel-heading p, .panel-heading span, .panel-hint { color: var(--muted); font-size: 11px; }
.panel-hint { font-family: var(--font-mono); letter-spacing: 0.03em; }
.field-label {
    color: var(--muted);
    font: 700 10px/1.2 var(--font-mono);
    letter-spacing: 0.08em;
}

/* Loader */
.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 20px;
    background: var(--desktop);
    background-image: radial-gradient(circle at 50% 50%, rgb(255 255 255 / 0.08), transparent 54%);
}
.loading-content { width: min(680px, 100%); animation: boot-window 480ms var(--ease-out) both; }
.loading-body { padding: clamp(16px, 4vw, 30px); }
.loading-copy { margin-bottom: 14px; }
.loading-kicker { margin-bottom: 6px; color: var(--title); font: 700 10px/1.2 var(--font-mono); letter-spacing: 0.1em; }
.loading-title { font-size: clamp(21px, 4vw, 30px); letter-spacing: -0.025em; }
.loading-subtitle { margin-top: 5px; color: var(--muted); }
.asset-preview {
    height: min(42vh, 330px);
    min-height: 220px;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(rgb(0 125 123 / 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgb(0 125 123 / 0.08) 1px, transparent 1px),
        var(--field);
    background-size: 24px 24px;
    box-shadow: var(--bevel-sunken);
}
.asset-preview canvas { width: min(290px, 74vw); height: min(290px, 74vw); image-rendering: pixelated; }
#asset-preview-text {
    position: absolute;
    left: 8px;
    bottom: 8px;
    padding: 3px 6px;
    color: #fff;
    background: var(--title);
    font: 11px/1.2 var(--font-mono);
}
.loading-bar-container { margin-top: 16px; }
.loading-bar { height: 22px; padding: 3px; background: var(--field); box-shadow: var(--bevel-sunken); }
.loading-bar-fill {
    width: 0;
    height: 100%;
    background-color: var(--teal);
    background-image: linear-gradient(90deg, rgb(255 255 255 / 0.3) 50%, transparent 50%);
    background-size: 14px 100%;
    transition: width 240ms var(--ease-out);
}
.loading-readout { display: flex; justify-content: space-between; gap: 16px; margin-top: 7px; font: 11px/1.3 var(--font-mono); }
.loading-readout strong { font-variant-numeric: tabular-nums; }

/* Application shell */
#game-container { display: none; }
.application-window {
    width: min(1440px, 100%);
    min-height: calc(100dvh - clamp(0px, 4.4vw, 56px));
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    animation: app-open 420ms var(--ease-out) both;
}
.game-header { padding: 4px; background: var(--chrome); }
.header-content {
    min-height: 43px;
    padding: 4px 5px 4px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #fff;
    background: linear-gradient(90deg, var(--title), var(--title-bright) 68%, #258d99);
}
.brand-lockup { min-width: 0; display: flex; align-items: center; gap: 10px; }
.brand-icon { flex: none; image-rendering: pixelated; }
.game-title { font-size: 17px; line-height: 1.15; letter-spacing: -0.01em; }
.game-build { display: block; margin-top: 2px; color: #dce8ff; font: 9px/1.2 var(--font-mono); letter-spacing: 0.08em; }
.header-actions { display: flex; align-items: center; gap: 7px; }
.collection-link {
    min-height: 27px;
    padding: 5px 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    background: rgb(0 0 0 / 0.16);
    border: 1px solid rgb(255 255 255 / 0.64);
    box-shadow: inset 1px 1px 0 rgb(255 255 255 / 0.24), inset -1px -1px 0 rgb(0 0 0 / 0.38);
    font: 700 10px/1 var(--font-mono);
    text-decoration: none;
    white-space: nowrap;
}
.collection-link:hover { color: var(--title); background: var(--yellow); }
.collection-link:active { transform: translate(1px, 1px); box-shadow: var(--bevel-sunken); }
.command-bar {
    min-height: 48px;
    margin-top: 4px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--chrome-mid);
    box-shadow: var(--bevel-raised);
}
.session-state { min-width: 210px; padding-left: 7px; display: flex; align-items: center; gap: 7px; font-size: 11px; }
.session-state strong { color: var(--title); font: 700 11px/1 var(--font-mono); }
.session-state > span:last-child { color: var(--muted); }
.status-light {
    width: 9px;
    height: 9px;
    display: inline-block;
    flex: none;
    background: #1cb252;
    border: 1px solid #06451d;
    box-shadow: inset 1px 1px 0 #78e39a;
}
.user-stats { display: flex; align-items: stretch; gap: 5px; }
.stat, .wallet-btn, .sound-btn {
    border: 0;
    background: var(--chrome);
    box-shadow: var(--bevel-raised);
}
.stat {
    min-height: 34px;
    padding: 5px 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.stat .ui-icon { color: var(--title); }
.stat .stat-label { color: var(--muted); font: 9px/1 var(--font-mono); }
.stat strong { min-width: 2ch; font: 700 13px/1 var(--font-mono); text-align: right; font-variant-numeric: tabular-nums; }
.wallet-btn, .sound-btn {
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    font-weight: 700;
    font-size: 11px;
    white-space: nowrap;
}
.wallet-btn { color: #fff; background: var(--title-bright); box-shadow: inset 1px 1px 0 #80a9ff, inset -1px -1px 0 #00175e, 1px 1px 0 #fff; }
.wallet-btn:hover { background: #1d58d6; }
.wallet-btn:active, .sound-btn:active { transform: translate(1px, 1px); box-shadow: var(--bevel-sunken); }
.sound-btn[aria-pressed="true"] { color: #fff; background: var(--teal); }

.game-nav {
    padding: 5px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    background: var(--chrome-mid);
    border-top: 1px solid #fff;
    border-bottom: 1px solid var(--chrome-dark);
}
.nav-btn {
    min-height: 45px;
    padding: 7px 11px;
    position: relative;
    display: grid;
    grid-template-columns: 22px auto 24px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 0;
    background: var(--chrome);
    box-shadow: var(--bevel-raised);
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
}
.nav-btn small { color: var(--muted); font: 9px/1 var(--font-mono); }
.nav-icon { width: 18px; height: 18px; }
.nav-btn:hover { background: #e0e3e2; }
.nav-btn.active {
    color: #fff;
    background: var(--title);
    box-shadow: inset 1px 1px 0 #00053b, inset -1px -1px 0 #6b8eea;
}
.nav-btn.active small { color: #c7d5ff; }
.nav-btn.active::after { content: ""; position: absolute; right: 7px; bottom: 5px; width: 5px; height: 5px; background: var(--yellow); }

.game-main { flex: 1; padding: 8px; background: var(--chrome); }
.screen {
    min-height: 420px;
    display: none;
    padding: clamp(8px, 1.4vw, 16px);
    background: var(--chrome-mid);
    box-shadow: var(--bevel-sunken);
}
.screen.active { display: block; animation: screen-in 260ms var(--ease-out) both; }

.app-statusbar {
    min-height: 29px;
    padding: 4px 6px;
    display: grid;
    grid-template-columns: 1fr auto 64px;
    gap: 5px;
    background: var(--chrome);
    border-top: 1px solid #fff;
    font: 10px/1 var(--font-mono);
}
.app-statusbar > span { padding: 5px 7px; box-shadow: var(--bevel-sunken); }
.app-statusbar .status-light { margin-right: 5px; vertical-align: -1px; }
.status-clock { text-align: center; font-variant-numeric: tabular-nums; }

/* Tabs and buttons */
.inventory-tabs, .shop-categories, .leaderboard-tabs, .battle-modes {
    display: flex;
    align-items: center;
    gap: 3px;
}
.inventory-tabs { margin-bottom: 8px; padding-left: 3px; }
.inventory-tab-btn, .category-btn, .tab-btn, .battle-mode-btn,
.carousel-btn, .refresh-btn, .load-more-btn, .clear-log-btn,
.back-btn, .save-btn, .confirm-btn, .buy-btn, .equip-btn, .unequip-btn {
    border: 0;
    background: var(--chrome);
    box-shadow: var(--bevel-raised);
    cursor: pointer;
    font-weight: 700;
    font-size: 11px;
}
.inventory-tab-btn, .category-btn, .tab-btn, .battle-mode-btn { padding: 7px 12px; }
.inventory-tab-btn:hover, .category-btn:hover, .tab-btn:hover, .battle-mode-btn:hover,
.refresh-btn:hover, .load-more-btn:hover, .clear-log-btn:hover,
.back-btn:hover, .save-btn:hover { background: #e2e5e4; }
.inventory-tab-btn.active, .category-btn.active, .tab-btn.active, .battle-mode-btn.active {
    color: #fff;
    background: var(--title);
    box-shadow: var(--bevel-sunken);
}
.inventory-tab-btn:active, .category-btn:active, .tab-btn:active, .battle-mode-btn:active,
.carousel-btn:active, .refresh-btn:active, .load-more-btn:active, .clear-log-btn:active,
.back-btn:active, .save-btn:active, .confirm-btn:active, .buy-btn:active, .equip-btn:active, .unequip-btn:active {
    transform: translate(1px, 1px);
    box-shadow: var(--bevel-sunken);
}

/* Inventory */
.inventory-container { min-width: 0; }
.nft-carousel-section, .skills-section, .nft-selection, .battle-arena,
.purchased-items-section, .shop-items, .leaderboard-list {
    padding: 12px;
    background: var(--chrome);
    box-shadow: var(--bevel-raised);
}
.carousel-container { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; align-items: center; gap: 7px; }
.carousel-btn { width: 36px; height: 64px; font: 700 24px/1 Arial, sans-serif; }
.carousel-viewport { min-width: 0; overflow: hidden; background: var(--field); box-shadow: var(--bevel-sunken); }
.carousel-track { display: flex; transition: transform 360ms var(--ease-out); }
.carousel-page { min-width: 100%; padding: 9px; gap: 9px !important; }
.carousel-page .nft-card { min-width: 0 !important; flex: 1 1 0 !important; }
.carousel-indicators { min-height: 14px; margin-top: 9px; display: flex; justify-content: center; gap: 5px; }
.carousel-indicator { width: 24px; height: 24px; padding: 0; position: relative; border: 0; background: transparent; cursor: pointer; }
.carousel-indicator::after { content: ""; position: absolute; inset: 8px 1px; background: var(--chrome-dark); border: 1px solid #4c5251; }
.carousel-indicator.active::after { background: var(--title); border-color: #000; }

.nft-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 9px; }
.nft-card {
    width: 100%;
    min-width: 0;
    padding: 8px;
    border-radius: 0;
    font: inherit;
    text-align: left;
    position: relative;
    overflow: hidden;
    color: var(--ink);
    background: var(--chrome-mid);
    border: 1px solid var(--chrome-dark);
    border-top-color: #fff;
    border-left-color: #fff;
    cursor: pointer;
    transition: transform 180ms var(--ease-out), background-color 180ms ease, box-shadow 180ms ease;
}
.nft-card:hover { z-index: 1; background: #eef0ef; transform: translateY(-2px); box-shadow: 3px 4px 0 rgb(0 0 0 / 0.22); }
.nft-card:active { transform: translateY(0); }
.nft-card.selected { color: #fff; background: var(--title); outline: 2px dotted var(--focus); outline-offset: -5px; }
.nft-card.selected .nft-description, .nft-card.selected .nft-stats { color: #dce5ff; }
.nft-avatar {
    min-height: 156px;
    margin-bottom: 8px;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(rgb(0 125 123 / 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgb(0 125 123 / 0.07) 1px, transparent 1px),
        #f6f7f1;
    background-size: 16px 16px;
    box-shadow: var(--bevel-sunken);
}
.nft-avatar.custom-fighter { width: 100%; height: 190px; }
.fighter-preview { width: 127px; height: 190px; display: block; image-rendering: pixelated; }
.nft-name { overflow: hidden; font-weight: 700; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.nft-description { min-height: 30px; margin: 3px 0 7px; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nft-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px 8px; color: #303735; font: 10px/1.3 var(--font-mono); }
.nft-badge { position: absolute; top: 5px; right: 5px; padding: 3px 5px; color: #fff; background: var(--teal); font: 700 9px/1 var(--font-mono); }
.inventory-empty, .no-nfts-message, .leaderboard-empty {
    width: 100%;
    min-height: 100px;
    padding: 24px;
    display: grid;
    place-items: center;
    color: var(--muted);
    background: var(--field);
    border: 1px dashed var(--chrome-dark);
    text-align: center;
}

.skills-container { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.equipped-skills, .available-skills { min-width: 0; padding: 10px; background: var(--chrome-mid); box-shadow: var(--bevel-sunken); }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 7px; }
.skill-item { min-height: 130px; padding: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: var(--chrome); box-shadow: var(--bevel-raised); text-align: center; }
.skill-item.equipped { color: #fff; background: var(--title); }
.skill-icon { font-size: 26px; }
.skill-name { font-weight: 700; font-size: 11px; }
.equip-btn, .unequip-btn, .buy-btn { width: 100%; padding: 7px 9px; }
.equip-btn.equipped { color: #fff; background: var(--title); }

/* Builder */
.fighter-builder-container { min-width: 0; }
.builder-layout { display: grid; grid-template-columns: minmax(330px, 0.88fr) minmax(420px, 1.12fr); gap: 10px; }
.left-column, .right-column { min-width: 0; }
.builder-content { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 8px; }
.canvas-container { min-width: 0; position: relative; padding: 8px; background: var(--field); box-shadow: var(--bevel-sunken); }
#fighter-canvas { width: 100%; max-height: 640px; display: block; object-fit: contain; image-rendering: pixelated; }
.canvas-overlay { position: absolute; right: 12px; bottom: 12px; left: 12px; }
.layer-info { padding: 5px 7px; color: #fff; background: rgb(0 11 120 / 0.9); font: 9px/1.3 var(--font-mono); text-align: center; }
.builder-info { padding: 10px; background: var(--chrome); box-shadow: var(--bevel-raised); }
.builder-info h3 { margin: 7px 0 5px; font-size: 14px; overflow-wrap: anywhere; }
.builder-info p { color: var(--muted); font-size: 11px; }
.builder-controls { margin-top: 8px; display: flex; justify-content: flex-end; gap: 6px; }
.back-btn, .save-btn, .confirm-btn { padding: 9px 13px; }
.confirm-btn { color: #fff; background: var(--title-bright); box-shadow: inset 1px 1px 0 #8bb0ff, inset -1px -1px 0 #001658, 1px 1px 0 #fff; }
.confirm-btn:hover { background: #1d58d6; }
.purchased-items-section { height: min(760px, calc(100dvh - 260px)); min-height: 500px; overflow: hidden; }
.purchased-items-content { height: calc(100% - 48px); overflow: auto; padding: 2px 4px 10px 2px; scrollbar-color: var(--chrome-dark) var(--chrome); }
.items-by-category { display: grid; gap: 8px; }
.category-section { padding: 8px; background: var(--chrome-mid); box-shadow: var(--bevel-sunken); }
.category-section h4 { margin-bottom: 7px; color: var(--title); font-size: 12px; }
.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 6px; }
.purchased-item { min-width: 0; padding: 6px; display: flex; flex-direction: column; gap: 5px; background: var(--chrome); box-shadow: var(--bevel-raised); text-align: center; }
.purchased-item.empty { min-height: 55px; justify-content: center; color: var(--muted); font-size: 10px; box-shadow: none; border: 1px dashed var(--chrome-dark); }
.purchased-item img { width: 100%; height: 105px; object-fit: contain; image-rendering: pixelated; background: var(--field); box-shadow: var(--bevel-sunken); }
.purchased-item-name { overflow: hidden; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }

/* Battle */
.battle-container { min-width: 0; }
.battle-header { margin-bottom: 10px; }
.battle-modes { flex: none; align-items: stretch; }
.difficulty-control { display: flex; align-items: center; gap: 6px; padding: 3px 5px 3px 8px; background: var(--chrome-mid); box-shadow: var(--bevel-sunken); }
.difficulty-control span { color: var(--muted); font: 700 8px/1 var(--font-mono); text-transform: uppercase; }
.difficulty-control select { min-height: 25px; padding: 3px 24px 3px 6px; color: var(--ink); background: var(--field); border: 1px solid var(--chrome-dark); border-radius: 0; font: 700 10px/1 var(--font-ui); }
.nft-selection { margin-bottom: 10px; }
.nft-selection.battle-running { display: none; }
.nft-controls { margin-top: 10px; padding-top: 9px; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--chrome-dark); color: var(--muted); font-size: 11px; }
.load-more-btn { padding: 8px 11px; color: #fff; background: var(--teal); box-shadow: inset 1px 1px 0 #76d6cf, inset -1px -1px 0 #003c39, 1px 1px 0 #fff; }
.nft-count { padding: 4px 7px; color: #fff !important; background: var(--teal); font: 700 10px/1.2 var(--font-mono); }
.battle-arena { position: relative; }
.arena-header { margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.arena-header h3 { margin-top: 2px; font-size: 17px; }
.battle-timer { min-width: 56px; padding: 6px 10px; color: var(--ink); background: var(--field); box-shadow: var(--bevel-sunken); font: 700 22px/1 var(--font-mono); text-align: center; font-variant-numeric: tabular-nums; }
.battle-field { background: var(--chrome-mid); box-shadow: var(--bevel-sunken); }
.battle-canvas-container {
    width: 100%;
    aspect-ratio: 2 / 1;
    position: relative;
    overflow: hidden;
    background: #075c5c url("battle-bg.png") center / cover no-repeat;
    isolation: isolate;
}
.battle-canvas-container::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgb(0 5 25 / 0.05), rgb(0 45 44 / 0.18)); pointer-events: none; }
#battle-canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.arena-corner { position: absolute; width: 24px; height: 24px; border-color: #fff; border-style: solid; pointer-events: none; }
.corner-tl { top: 8px; left: 8px; border-width: 2px 0 0 2px; }
.corner-br { right: 8px; bottom: 8px; border-width: 0 2px 2px 0; }
.battle-canvas-container.impact { animation: arena-hit 250ms steps(2, end); }
.battle-canvas-container.special-impact { animation: arena-special 520ms var(--ease-out); }
.battle-health-bars { padding: 9px; display: grid; grid-template-columns: 1fr 46px 1fr; align-items: end; gap: 10px; background: var(--chrome); border-top: 1px solid #fff; }
.player-health, .enemy-health { min-width: 0; }
.health-label { margin-bottom: 4px; display: flex; justify-content: space-between; gap: 8px; font: 700 10px/1.2 var(--font-mono); }
.health-bar { height: 18px; padding: 3px; overflow: hidden; background: var(--field); box-shadow: var(--bevel-sunken); }
.health-fill { width: 100%; height: 100%; background: var(--green); transition: width 380ms var(--ease-out), background-color 180ms ease; }
.enemy-health .health-fill { background: var(--red); }
.vs-indicator { color: var(--title); font: 900 20px/1 var(--font-mono); text-align: center; }
.battle-controls { margin-top: 9px; padding: 7px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; background: var(--chrome-mid); box-shadow: var(--bevel-raised); }
.battle-btn { min-height: 58px; padding: 7px 9px; display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 7px; border: 0; background: var(--chrome); box-shadow: var(--bevel-raised); cursor: pointer; font-weight: 700; text-align: left; }
.battle-btn > span { color: var(--title); font-size: 18px; text-align: center; }
.battle-btn > .ui-symbol { width: 20px; height: 20px; }
.battle-btn small { color: var(--muted); font: 8px/1 var(--font-mono); }
.battle-btn:hover { background: #f1f3f2; transform: translateY(-1px); }
.battle-btn:active { transform: translate(1px, 1px); box-shadow: var(--bevel-sunken); }
.special-btn { color: #fff !important; background: var(--orange) !important; box-shadow: inset 1px 1px 0 #ffae85, inset -1px -1px 0 #772006 !important; }
.bonkler-beam-btn { color: #fff !important; background: var(--red) !important; box-shadow: inset 1px 1px 0 #ff8d8d, inset -1px -1px 0 #520000 !important; }
.special-btn > span, .special-btn small, .bonkler-beam-btn > span, .bonkler-beam-btn small { color: #fff; }
.battle-log { margin-top: 9px; background: var(--chrome); box-shadow: var(--bevel-raised); }
.battle-log-header { padding: 6px 8px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--chrome-dark); }
.battle-log-header h4 { font-size: 11px; }
.clear-log-btn { padding: 4px 8px; }
.battle-log-content { height: 116px; overflow: auto; padding: 7px; background: #fbfcf7; box-shadow: var(--bevel-sunken); font: 10px/1.45 var(--font-mono); }
.log-entry { padding: 3px 5px; color: var(--ink); border-bottom: 1px dotted #aeb4b2; animation: log-in 180ms ease both; }
.log-entry.battle-event { color: #242a28; font-weight: 700; }
.log-entry::before { content: "> "; color: var(--muted); }
.log-entry.player-action, .log-entry.defend, .log-entry.dodge { color: var(--title); font-weight: 700; }
.log-entry.enemy-action, .log-entry.damage { color: var(--red); font-weight: 700; }
.log-entry.heal { color: var(--green); font-weight: 700; }
.log-entry.special, .log-entry.power-up { color: #864000; font-weight: 700; }

/* Active desktop battles become a viewport-sized command console: arena left, actions and log right. */
@media (min-width: 900px) and (min-height: 650px) {
    .application-window.battle-session {
        height: calc(100dvh - clamp(0px, 4.4vw, 56px));
        min-height: 0;
        max-height: calc(100dvh - clamp(0px, 4.4vw, 56px));
        overflow: hidden;
    }
    .battle-session .game-main { min-height: 0; overflow: hidden; }
    #battle-screen.combat-active { height: 100%; min-height: 0; padding: 6px; overflow: hidden; }
    #battle-screen.combat-active .battle-container { height: 100%; min-height: 0; display: flex; flex-direction: column; }
    #battle-screen.combat-active .battle-header { min-height: 46px; margin-bottom: 6px; padding: 6px 9px; flex: none; }
    #battle-screen.combat-active .section-index { width: 32px; min-width: 32px; height: 32px; }
    #battle-screen.combat-active .battle-arena {
        min-height: 0;
        flex: 1;
        display: grid !important;
        grid-template-columns: minmax(0, 2.15fr) minmax(300px, 0.85fr);
        grid-template-rows: 35px auto minmax(110px, 1fr);
        gap: 6px;
    }
    #battle-screen.combat-active .arena-header { grid-column: 1 / -1; margin: 0; }
    #battle-screen.combat-active .arena-header h3 { font-size: 14px; }
    #battle-screen.combat-active .battle-timer { min-width: 46px; padding: 4px 8px; font-size: 17px; }
    #battle-screen.combat-active .battle-field {
        min-width: 0;
        min-height: 0;
        grid-column: 1;
        grid-row: 2 / 4;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    #battle-screen.combat-active .battle-canvas-container { min-height: 0; flex: 1; aspect-ratio: auto; }
    #battle-screen.combat-active #battle-canvas { object-fit: contain; }
    #battle-screen.combat-active .battle-health-bars { flex: none; padding: 6px; gap: 7px; }
    #battle-screen.combat-active .health-label { margin-bottom: 2px; font-size: 9px; }
    #battle-screen.combat-active .health-bar { height: 14px; padding: 2px; }
    #battle-screen.combat-active .battle-controls {
        min-width: 0;
        grid-column: 2;
        grid-row: 2;
        margin: 0;
        padding: 5px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px;
        align-content: start;
    }
    #battle-screen.combat-active .battle-btn { min-height: 44px; padding: 5px 7px; gap: 5px; }
    #battle-screen.combat-active .battle-log {
        min-width: 0;
        min-height: 0;
        grid-column: 2;
        grid-row: 3;
        margin: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    #battle-screen.combat-active .battle-log-header { flex: none; padding: 4px 6px; }
    #battle-screen.combat-active .battle-log-content { height: auto; min-height: 0; flex: 1; padding: 5px; }
}

@media (max-width: 899px) and (min-height: 650px) {
    .application-window.battle-session {
        height: 100dvh;
        min-height: 0;
        max-height: 100dvh;
        overflow: hidden;
    }
    .battle-session .command-bar, .battle-session .app-statusbar { display: none; }
    .battle-session .game-main { min-height: 0; padding: 4px; overflow: hidden; }
    #battle-screen.combat-active { height: 100%; min-height: 0; padding: 5px; overflow: hidden; }
    #battle-screen.combat-active .battle-container { height: 100%; min-height: 0; display: flex; flex-direction: column; }
    #battle-screen.combat-active .battle-header { min-height: 82px; margin-bottom: 4px; padding: 6px; flex: none; gap: 3px; }
    #battle-screen.combat-active .battle-modes { width: 100%; padding-left: 0; flex-wrap: nowrap; }
    #battle-screen.combat-active .battle-mode-btn { min-height: 34px; padding: 4px 6px; }
    #battle-screen.combat-active .difficulty-control { min-width: 0; flex: 1; padding-left: 5px; }
    #battle-screen.combat-active .difficulty-control span { display: none; }
    #battle-screen.combat-active .difficulty-control select { min-width: 0; width: 100%; }
    #battle-screen.combat-active .battle-arena { min-height: 0; flex: 1; display: flex !important; flex-direction: column; gap: 5px; }
    #battle-screen.combat-active .arena-header { margin: 0; flex: none; }
    #battle-screen.combat-active .arena-header h3 { font-size: 14px; }
    #battle-screen.combat-active .battle-timer { min-width: 45px; padding: 4px 7px; font-size: 17px; }
    #battle-screen.combat-active .battle-field { min-height: 180px; flex: 1; display: flex; flex-direction: column; overflow: hidden; }
    #battle-screen.combat-active .battle-canvas-container { min-height: 0; flex: 1; aspect-ratio: auto; }
    #battle-screen.combat-active #battle-canvas { object-fit: contain; }
    #battle-screen.combat-active .battle-health-bars { flex: none; grid-template-columns: minmax(0, 1fr) 25px minmax(0, 1fr); align-items: end; gap: 5px; padding: 5px; }
    #battle-screen.combat-active .health-label { margin-bottom: 2px; font-size: 8px; }
    #battle-screen.combat-active .health-bar { height: 13px; padding: 2px; }
    #battle-screen.combat-active .vs-indicator { margin: 0; align-self: end; font-size: 12px; }
    #battle-screen.combat-active .battle-controls { margin: 0; padding: 5px; flex: none; gap: 5px; }
    #battle-screen.combat-active .battle-btn { min-height: 44px; padding: 5px 7px; }
    #battle-screen.combat-active .battle-log { min-height: 90px; max-height: 145px; margin: 0; display: flex; flex-direction: column; overflow: hidden; }
    #battle-screen.combat-active .battle-log-header { flex: none; padding: 4px 6px; }
    #battle-screen.combat-active .battle-log-content { height: auto; min-height: 0; flex: 1; padding: 5px; }
}

/* Shop */
.shop-categories { margin-bottom: 8px; padding: 6px; flex-wrap: wrap; background: var(--chrome); box-shadow: var(--bevel-raised); }
.shop-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 8px; align-content: start; }
.shop-item { min-width: 0; padding: 8px; display: grid; grid-template-rows: 160px auto auto auto auto; gap: 5px; background: var(--chrome-mid); border: 1px solid var(--chrome-dark); border-top-color: #fff; border-left-color: #fff; transition: transform 180ms var(--ease-out), background 180ms ease; }
.shop-item:hover { z-index: 1; background: #e9eceb; transform: translateY(-2px); box-shadow: 3px 4px 0 rgb(0 0 0 / 0.2); }
.item-icon { position: relative; min-width: 0; display: grid; place-items: center; overflow: hidden; background: var(--field); box-shadow: var(--bevel-sunken); font-size: 34px; }
.item-fallback { display: grid; place-items: center; color: var(--title); transition: opacity 120ms ease; }
.item-fallback .ui-symbol, .skill-symbol { width: 58px; height: 58px; color: var(--title); }
.item-icon.has-preview .item-fallback { opacity: 0; }
.item-icon img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--preview-width, 100%) !important;
    max-width: none;
    height: auto !important;
    padding: 0;
    opacity: 0;
    image-rendering: pixelated;
    background: transparent !important;
    border: 0 !important;
    transform: translate(var(--preview-shift-x, -50%), var(--preview-shift-y, -50%));
    transition: opacity 120ms ease;
}
.item-icon img.is-ready { opacity: 1; }
.item-name { overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.item-description { min-height: 32px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.item-price { color: var(--title); font: 700 11px/1.2 var(--font-mono); }
.buy-btn { color: #fff; background: var(--teal); box-shadow: inset 1px 1px 0 #70d2ca, inset -1px -1px 0 #003d3a, 1px 1px 0 #fff; }
.buy-btn:hover { background: #008f88; }

/* Leaderboard */
.leaderboard-header { margin-bottom: 8px; }
.leaderboard-controls { display: flex; align-items: center; gap: 6px; }
.refresh-btn { padding: 7px 10px; }
.status-indicator { padding: 5px 8px; display: inline-flex; align-items: center; gap: 5px; color: #fff; background: var(--teal); font: 700 10px/1 var(--font-mono); }
.status-indicator::before { content: ""; width: 7px; height: 7px; background: #42ec7c; border: 1px solid #06451d; }
.status-indicator.local { color: var(--ink); background: var(--yellow); }
.status-indicator.local::before { background: #d47c00; border-color: #6c3e00; }
.leaderboard-tabs { margin-bottom: 7px; }
.leaderboard-list { display: grid; gap: 4px; }
.leaderboard-entry { min-height: 62px; padding: 7px 9px; display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 10px; background: var(--chrome-mid); border: 1px solid var(--chrome-dark); border-top-color: #fff; border-left-color: #fff; }
.leaderboard-entry:hover { background: #eef0ef; }
.leaderboard-entry.current-player { color: #fff; background: var(--title); }
.rank { font: 700 15px/1 var(--font-mono); }
.rank.gold { color: #7d5700; }
.rank.silver { color: #4d5553; }
.rank.bronze { color: #7a3519; }
.current-player .rank { color: var(--yellow); }
.player-info { min-width: 0; display: flex; align-items: center; gap: 9px; }
.player-avatar { width: 38px; height: 38px; display: grid; place-items: center; color: var(--title); background: var(--field); box-shadow: var(--bevel-sunken); }
.player-avatar .ui-symbol { width: 24px; height: 24px; }
.player-details { min-width: 0; }
.player-details h3 { font-size: 12px; }
.player-details p, .player-details small { display: block; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.current-player .player-details p, .current-player .player-details small { color: #d9e2ff; }
.player-stats { display: grid; grid-template-columns: auto auto; gap: 2px 7px; align-items: baseline; font-family: var(--font-mono); }
.player-stats .stat-value { font-size: 13px; font-weight: 700; text-align: right; }
.player-stats .stat-label { color: var(--muted); font-size: 8px; }
.current-player .stat-label { color: #d9e2ff; }

/* Dialogs */
.modal-overlay { position: fixed; inset: 0; z-index: 1000; display: none; place-items: center; padding: 20px; overflow: auto; overscroll-behavior: contain; background: rgb(0 34 34 / 0.68); }
.modal-overlay.active { display: grid; animation: overlay-in 150ms ease both; }
.modal { width: min(430px, 100%); padding: 4px; background: var(--chrome); border: 2px solid #fff; outline: 1px solid var(--chrome-deep); box-shadow: 10px 12px 0 rgb(0 0 0 / 0.32); animation: modal-in 220ms var(--ease-out) both; }
.modal-header { min-height: 31px; padding: 3px 4px 3px 7px; }
.modal-header h3 { font-size: 12px; }
.modal-close { width: 24px; height: 23px; min-height: 23px; border: 0; background: var(--chrome); box-shadow: var(--bevel-raised); cursor: pointer; font: 700 17px/1 Arial, sans-serif; }
.modal-content { min-height: 90px; padding: 18px; display: grid; place-items: center; background: var(--chrome-mid); line-height: 1.55; white-space: pre-line; }
.modal-actions { padding: 8px; display: flex; justify-content: flex-end; }
.modal-actions .confirm-btn { min-width: 86px; }
.battle-result { text-align: center; }
.result-icon { min-height: 64px; display: grid; place-items: center; }
.result-icon .ui-symbol { width: 58px; height: 58px; }
.result-icon.victory { color: #a06c00; }
.result-icon.defeat { color: var(--red); }
.result-title { margin-top: 5px; font-size: 20px; font-weight: 700; }
.rewards { width: 100%; margin-top: 12px; padding: 8px; background: var(--field); box-shadow: var(--bevel-sunken); }
.reward-item { padding: 4px; display: flex; justify-content: space-between; font-family: var(--font-mono); }
.reward-value { color: var(--green); font-weight: 700; }

/* Legacy component selectors retained for compatibility */
.component-selector { display: grid; gap: 6px; }
.component-category, .component-info { padding: 6px; background: var(--chrome); box-shadow: var(--bevel-raised); }
.component-navigator { display: flex; align-items: center; gap: 5px; }
.nav-arrow { width: 30px; height: 30px; border: 0; background: var(--chrome); box-shadow: var(--bevel-raised); }
.component-display { flex: 1; }
.component-item { min-height: 44px; padding: 5px; display: grid; place-items: center; background: var(--chrome-mid); box-shadow: var(--bevel-sunken); }
.component-item img { max-width: 100%; max-height: 100px; object-fit: contain; image-rendering: pixelated; }
.component-name { display: block; font-weight: 700; }
.component-stats { display: block; color: var(--muted); font: 10px/1.3 var(--font-mono); }

/* Motion */
@keyframes boot-window { from { opacity: 0; transform: translateY(18px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes app-open { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes log-in { from { opacity: 0; transform: translateX(-4px); } to { opacity: 1; transform: none; } }
@keyframes arena-hit { 0%, 100% { transform: translateX(0); filter: none; } 35% { transform: translateX(-5px); filter: saturate(1.4) brightness(1.15); } 70% { transform: translateX(4px); } }
@keyframes arena-special { 0% { filter: none; } 35% { filter: brightness(1.45) saturate(1.7); } 100% { filter: none; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes glow { 0%, 100% { box-shadow: var(--bevel-raised); } 50% { box-shadow: var(--bevel-raised), 0 0 0 3px var(--yellow); } }
@keyframes death { to { transform: translateY(16px) scale(0.9); opacity: 0.28; } }
.pulse { animation: pulse 500ms var(--ease-out); }
.shake { animation: shake 360ms steps(3, end); }
.glow { animation: glow 700ms steps(2, end) 2; }
.death { animation: death 900ms var(--ease-out) forwards; }

@media (max-width: 980px) {
    .command-bar { align-items: stretch; flex-direction: column; }
    .session-state { min-height: 28px; }
    .user-stats { display: grid; grid-template-columns: repeat(3, 1fr) auto auto; }
    .stat { justify-content: center; }
    .builder-layout { grid-template-columns: 1fr; }
    .purchased-items-section { height: auto; min-height: 0; }
    .purchased-items-content { max-height: 620px; height: auto; }
    .battle-controls { grid-template-columns: repeat(3, 1fr); }
    .shop-items { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

@media (max-width: 720px) {
    body {
        padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
        background: var(--chrome);
        font-size: 13px;
    }
    .application-window { min-height: 100dvh; border-width: 0; outline: 0; box-shadow: none; }
    .app-controls { display: none; }
    .header-content { min-height: 48px; }
    .game-build { font-size: 8px; }
    .header-actions { gap: 3px; }
    .collection-link { min-height: 28px; padding-inline: 6px; font-size: 9px; }
    .command-bar { margin-top: 3px; padding: 4px; gap: 4px; }
    .session-state { min-width: 0; padding: 3px 4px; }
    .session-state > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .user-stats { grid-template-columns: repeat(3, 1fr); }
    .wallet-btn { grid-column: span 2; }
    .sound-btn { grid-column: span 1; }
    .stat { padding-inline: 5px; }
    .stat .stat-label { display: none; }
    .sound-label { display: none; }
    .game-nav { position: sticky; top: 0; z-index: 20; padding: 4px; }
    .nav-btn { min-height: 49px; padding: 5px 2px; grid-template-columns: 1fr; grid-template-rows: 20px auto; gap: 1px; font-size: 10px; }
    .nav-btn small { display: none; }
    .game-main { padding: 5px; }
    .screen { min-height: 0; padding: 7px; }
    .section-titlebar { min-height: 55px; align-items: flex-start; flex-direction: column; gap: 5px; }
    .section-titlebar > p { max-width: none; padding-left: 47px; text-align: left; }
    .section-titlebar .battle-modes, .section-titlebar .leaderboard-controls { width: 100%; padding-left: 47px; }
    .panel-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
    .panel-hint { display: none; }
    .carousel-container { grid-template-columns: 31px minmax(0, 1fr) 31px; gap: 4px; }
    .carousel-btn { width: 31px; height: 58px; }
    .carousel-page { padding: 7px; }
    .skills-container { grid-template-columns: 1fr; }
    .builder-content { grid-template-columns: 1fr; }
    .builder-info { min-height: 90px; }
    #fighter-canvas { max-height: 520px; }
    .builder-controls { display: grid; grid-template-columns: 1fr 1fr; }
    .builder-controls .confirm-btn { grid-column: 1 / -1; order: -1; }
    .items-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .battle-modes { flex-wrap: wrap; }
    .battle-mode-btn { flex: 1; }
    .difficulty-control { flex: 1 1 130px; justify-content: space-between; }
    .difficulty-control select { flex: 1; }
    .nft-grid { grid-template-columns: 1fr; }
    .nft-selection .nft-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nft-selection .nft-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .nft-controls { align-items: stretch; flex-direction: column; }
    .battle-health-bars { grid-template-columns: 1fr; align-items: stretch; }
    .vs-indicator { margin: -3px 0; font-size: 14px; }
    .battle-controls { grid-template-columns: repeat(2, 1fr); }
    .battle-btn { min-height: 54px; }
    .shop-categories { display: grid; grid-template-columns: repeat(3, 1fr); }
    .category-btn { padding-inline: 5px; }
    .shop-items { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 7px; }
    .shop-item { grid-template-rows: 135px auto auto auto auto; }
    .leaderboard-entry { grid-template-columns: 42px minmax(0, 1fr); }
    .leaderboard-entry .player-stats { grid-column: 2; justify-self: start; }
    .player-details small { max-width: 34ch; }
    .app-statusbar { grid-template-columns: 1fr 58px; }
    .app-statusbar > span:nth-child(2) { display: none; }
}

@media (max-width: 440px) {
    .brand-icon { width: 24px; height: 25px; }
    .game-title { font-size: 15px; }
    .game-build { letter-spacing: 0.03em; }
    .user-stats { gap: 3px; }
    .stat { min-height: 32px; }
    .section-index { min-width: 32px; width: 32px; height: 32px; }
    .section-titlebar > p, .section-titlebar .battle-modes, .section-titlebar .leaderboard-controls { padding-left: 43px; }
    .nft-selection .nft-grid { grid-template-columns: 1fr; }
    .nft-selection .nft-card:last-child:nth-child(odd) { grid-column: auto; }
    .shop-categories { grid-template-columns: repeat(2, 1fr); }
    .shop-items { grid-template-columns: 1fr; }
    .shop-item { grid-template-rows: 170px auto auto auto auto; }
    .battle-controls { grid-template-columns: 1fr 1fr; }
    #battle-screen.combat-active .battle-controls:has(.battle-btn:nth-child(n + 5):not([style*="display: none"])) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .battle-btn { grid-template-columns: 20px 1fr; }
    #battle-screen.combat-active .battle-btn { padding-inline: 4px; gap: 3px; font-size: 10px; }
    #battle-screen.combat-active .battle-btn > .ui-symbol { width: 17px; height: 17px; }
    .battle-btn small { display: none; }
    .leaderboard-controls { flex-wrap: wrap; }
    .player-details small { max-width: 22ch; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

@media (forced-colors: active) {
    .status-light, .nav-btn.active::after, .status-indicator::before { border: 1px solid CanvasText; }
    .nft-card.selected { outline: 3px solid Highlight; }
}
