@font-face {
    font-family: 'CnC';
    src: url('../assets/fonts/font1.ttf') format('truetype');
    font-weight: normal;
    font-display: swap;
}

@font-face {
    font-family: 'CnC';
    src: url('../assets/fonts/font2.ttf') format('truetype');
    font-weight: bold;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none !important;
}

body {
    background: #000;
    overflow: hidden;
    font-family: 'CnC', monospace;
    color: #fff;
    user-select: none;
}

#game-canvas {
    display: block;
    width: 100vw;
    height: 100vh;
}

/* ── Pixel art hand cursor ── */
#custom-cursor {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.6s;
}

#custom-cursor.slow-reveal {
    transition: opacity 1.2s;
}

#custom-cursor.visible {
    opacity: 1;
}

#custom-cursor img {
    transition: transform 0.08s ease;
}

/* ── Screen transition overlay ── */
#transition-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#transition-overlay.active {
    opacity: 1;
}

/* ── Crosshair ── */
#crosshair {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.15s;
}

#crosshair.visible {
    opacity: 1;
}

#crosshair::before,
#crosshair::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
}

#crosshair::before {
    width: 1px;
    height: 10px;
    top: -5px;
    left: 0;
}

#crosshair::after {
    width: 10px;
    height: 1px;
    top: 0;
    left: -5px;
}

/* ── Main Menu ── */
#main-menu {
    position: fixed;
    inset: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.2s;
}

#main-menu.visible {
    opacity: 1;
    pointer-events: auto;
}

.menu-title {
    font-size: 2.2rem;
    letter-spacing: 0.3em;
    color: rgba(255, 255, 255, 0.4);
    text-indent: 0.3em;
    transition: color 0.3s, text-shadow 0.3s, letter-spacing 0.3s;
    image-rendering: pixelated;
    -webkit-font-smoothing: none;
}

.menu-title:hover {
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.35em;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.08);
}

/* ── Pause Menu ── */
#pause-menu {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

#pause-menu.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Panel — pixel-art bordered container */
.pause-panel {
    background: rgba(10, 10, 10, 0.96);
    border: 2px solid rgba(255, 255, 255, 0.12);
    outline: 1px solid rgba(0, 0, 0, 0.6);
    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, 0.06),
        inset -1px -1px 0 rgba(0, 0, 0, 0.3),
        0 0 40px rgba(0, 0, 0, 0.5);
    padding: 0;
    image-rendering: pixelated;
    min-width: 420px;
    max-width: 520px;
    width: 90vw;
}

/* Tabs row — sits on top of the panel border */
.pause-tabs {
    display: flex;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

.pause-tab {
    flex: 1;
    text-align: center;
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.22);
    padding: 12px 16px;
    border: none;
    background: rgba(255, 255, 255, 0.01);
    cursor: pointer;
    transition: color 0.12s, background 0.12s;
    user-select: none;
    -webkit-font-smoothing: none;
    position: relative;
}

.pause-tab + .pause-tab {
    border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.pause-tab:hover {
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.02);
}

.pause-tab.active {
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.04);
}

.pause-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 8px;
    right: 8px;
    height: 2px;
    background: rgba(255, 255, 255, 0.25);
}

/* Content area — fixed height so tabs don't cause layout shift */
.pause-content {
    position: relative;
    min-height: 220px;
    padding: 20px 24px 24px;
}

/* Pages stack on top of each other */
.pause-page {
    position: absolute;
    inset: 0;
    padding: 20px 24px 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s;
}

.pause-page.active {
    opacity: 1;
    visibility: visible;
}

.pause-columns {
    display: flex;
    gap: 40px;
}

.pause-section {
    flex: 1;
    min-width: 0;
}

.pause-heading {
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 12px;
    padding-bottom: 6px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    -webkit-font-smoothing: none;
}

.control-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.22);
    letter-spacing: 0.04em;
}

.control-row .key {
    color: rgba(255, 255, 255, 0.45);
    min-width: 65px;
    font-weight: bold;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.28);
}

.setting-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-btn {
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    padding: 2px 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.1s;
    user-select: none;
    font-weight: bold;
}

.setting-btn:hover {
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.05);
}

#setting-shadow-val {
    color: rgba(255, 255, 255, 0.5);
    min-width: 28px;
    text-align: center;
    font-weight: bold;
}

.info-val {
    color: rgba(255, 255, 255, 0.4);
    font-weight: bold;
}

/* ── Pixel-art slider ── */
.slider-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-val {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 32px;
    text-align: right;
}

.pixel-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 110px;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    outline: none;
    cursor: pointer;
    image-rendering: pixelated;
}

.pixel-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 16px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: background 0.1s;
}

.pixel-slider::-webkit-slider-thumb:hover {
    background: rgba(255, 255, 255, 0.9);
}

.pixel-slider::-moz-range-thumb {
    width: 12px;
    height: 16px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0;
    cursor: pointer;
}

.pixel-slider::-moz-range-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

