/* 4K Mania */

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    overflow-x: hidden;
}

body {
    font-family: 'Outfit', system-ui, sans-serif;
    background: #0c0c0f;
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(120, 80, 255, 0.25), transparent),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(255, 100, 150, 0.12), transparent);
    color: #e8e6f0;
    min-height: 100vh;
}

.wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 14px 20px;
    background: rgba(20, 18, 28, 0.9);
    border: 1px solid rgba(160, 140, 255, 0.4);
    border-radius: 12px;
}

.topbar h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #fff;
}

.topbar .home {
    color: #a090ff;
    text-decoration: none;
    font-weight: 600;
}

.topbar .home:hover {
    color: #c0b0ff;
}

/* Menu */
.menu {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 60vh;
}

.menu-content {
    background: rgba(24, 22, 34, 0.95);
    border: 1px solid rgba(160, 140, 255, 0.3);
    border-radius: 16px;
    padding: 28px 32px;
    width: 100%;
    max-width: 480px;
}

.menu-content h2 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #a090ff;
}

.menu-content h2:not(:first-child) {
    margin-top: 24px;
}

.settings-row {
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.settings-row > label:first-child {
    flex: 0 0 100%;
    font-size: 13px;
    color: #b0a0c0;
}

.receptor-feedback-toggles {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.settings-toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #b0a0c0;
}

.settings-toggle-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #a090ff;
}

.keybind-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.keybind-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.lane-label {
    font-size: 11px;
    color: #8080a0;
}

.keybind-btn {
    width: 48px;
    height: 36px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    background: rgba(80, 60, 140, 0.5);
    border: 1px solid rgba(160, 140, 255, 0.5);
    border-radius: 8px;
    color: #e0d8ff;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.keybind-btn:hover {
    background: rgba(100, 80, 160, 0.6);
    border-color: rgba(180, 160, 255, 0.7);
}

.keybind-btn.listening {
    background: rgba(255, 180, 80, 0.4);
    border-color: #ffb050;
    animation: pulse 0.6s ease infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 180, 80, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(255, 180, 80, 0); }
}

.settings-row input[type="range"] {
    flex: 1;
    min-width: 120px;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(80, 60, 140, 0.4);
    border-radius: 4px;
}

.settings-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #a090ff;
    border-radius: 50%;
    cursor: pointer;
}

.settings-row input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #a090ff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

#scrollSpeedValue,
#notesPerSecondValue,
#gameDurationValue {
    font-family: 'JetBrains Mono', monospace;
    min-width: 36px;
    color: #c0b0e0;
}

#gameDurationValue {
    min-width: 40px;
}

.skin-buttons, .style-buttons {
    display: flex;
    gap: 8px;
}

.skin-btn, .style-btn {
    padding: 8px 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    background: rgba(80, 60, 140, 0.4);
    border: 1px solid rgba(160, 140, 255, 0.4);
    border-radius: 8px;
    color: #c0b0e0;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.skin-btn:hover, .style-btn:hover {
    background: rgba(100, 80, 160, 0.5);
    border-color: rgba(180, 160, 255, 0.6);
    color: #fff;
}

.skin-btn.active, .style-btn.active {
    background: rgba(160, 140, 255, 0.35);
    border-color: #a090ff;
    color: #fff;
}

.instructions {
    margin: 20px 0;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border-left: 3px solid #a090ff;
}

.instructions h3 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #c0b0e0;
}

.instructions p {
    margin: 0;
    font-size: 13px;
    color: #a090a0;
    line-height: 1.5;
}

.start-btn {
    width: 100%;
    padding: 14px 24px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #7860e0, #a080ff);
    border: none;
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
}

.start-btn:hover {
    box-shadow: 0 4px 24px rgba(160, 140, 255, 0.5);
    transform: translateY(-1px);
}

.start-btn:active {
    transform: translateY(0);
}

.menu-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.reset-default-btn {
    padding: 10px 20px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    background: rgba(80, 60, 140, 0.4);
    border: 1px solid rgba(160, 140, 255, 0.5);
    border-radius: 10px;
    color: #b0a0c0;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.reset-default-btn:hover {
    background: rgba(100, 80, 160, 0.5);
    color: #e0d8ff;
}

/* Game container – fill viewport */
.game-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    padding: 12px;
    z-index: 2;
}

.game-hud {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px 24px;
    padding: 8px 14px;
    background: rgba(20, 18, 28, 0.9);
    border-radius: 10px;
    border: 1px solid rgba(160, 140, 255, 0.3);
    flex-shrink: 0;
}

.game-hud-score {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 12;
    margin: 0;
}

.game-hud-score.hidden {
    display: none;
}

.hud-score {
    font-size: 14px;
    color: #b0a0c0;
}

.hud-score span {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #fff;
}

/* Top-right HUD: accuracy and timer (outside board) */
.game-hud-topright {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 12;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    pointer-events: none;
}

.hud-accuracy-wrap,
.hud-timer-wrap {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(0, 0, 0, 0.8);
}

.hud-accuracy-wrap.hidden,
.hud-timer-wrap.hidden {
    display: none;
}

/* Combo inside board */
.combo-wrap {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 14;
    display: flex;
    align-items: center;
    justify-content: center;
}

.combo-wrap.hidden {
    display: none;
}

/* Unstable bar (early/late tendency) – position/size set from JS */
.unstable-bar-wrap {
    position: absolute;
    pointer-events: none;
    z-index: 14;
    transform: translate(-50%, -50%);
}

.unstable-bar-wrap.hidden {
    display: none;
}

.unstable-bar-track {
    position: relative;
    width: 100%;
    height: 100%;
    background: rgba(80, 60, 140, 0.5);
    border-radius: 2px;
    border: 1px solid rgba(160, 140, 255, 0.3);
}

.unstable-bar-midline {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    margin-left: -0.5px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 0;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 1;
}

.unstable-bar-ticks {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.unstable-bar-tick {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    border-radius: 1px;
    transform: translateX(-50%);
    opacity: 0.5;
}

.unstable-bar-tick.perfect {
    background: rgba(96, 255, 160, 0.8);
}

.unstable-bar-tick.great {
    background: rgba(96, 192, 255, 0.8);
}

.unstable-bar-tick.good {
    background: rgba(255, 192, 96, 0.8);
}

.combo-number {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #e0d8ff;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%);
}

/* Judge on board – position/size set from JS */
.judge-wrap {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 15;
}

.judge-wrap.hidden {
    display: none;
}

.judge {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    padding: 0;
    border-radius: 0;
    background: transparent;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(0, 0, 0, 0.8);
    transition: opacity 0.15s;
    transform: translate(-50%, -50%);
}

.judge.perfect { color: #60ffa0; }
.judge.great   { color: #60c0ff; }
.judge.good    { color: #ffc060; }
.judge.miss    { color: #ff6060; }

.customize-judge-btn {
    padding: 8px 16px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    background: rgba(80, 60, 140, 0.5);
    border: 1px solid rgba(160, 140, 255, 0.5);
    border-radius: 8px;
    color: #e0d8ff;
    cursor: pointer;
}

.customize-judge-btn:hover {
    background: rgba(100, 80, 160, 0.6);
    border-color: rgba(180, 160, 255, 0.7);
}

/* Unified Gameplay UI customize overlay – large so scaling isn't confusing */
.gameplay-ui-customize-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
}

/* Custom scrollbar – overlay */
.gameplay-ui-customize-overlay::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.gameplay-ui-customize-overlay::-webkit-scrollbar-track {
    background: rgba(40, 35, 60, 0.4);
    border-radius: 5px;
}

.gameplay-ui-customize-overlay::-webkit-scrollbar-thumb {
    background: rgba(160, 140, 255, 0.5);
    border-radius: 5px;
}

.gameplay-ui-customize-overlay::-webkit-scrollbar-thumb:hover {
    background: rgba(160, 140, 255, 0.7);
}

.gameplay-ui-customize-overlay {
    scrollbar-width: thin;
    scrollbar-color: rgba(160, 140, 255, 0.5) rgba(40, 35, 60, 0.4);
}

.gameplay-ui-customize-content {
    background: rgba(24, 22, 34, 0.98);
    border: 1px solid rgba(160, 140, 255, 0.4);
    border-radius: 16px;
    padding: 28px 32px;
    width: 100%;
    max-width: 920px;
    min-width: 320px;
    max-height: 85vh;
    overflow-y: auto;
}

/* Custom scrollbar – content */
.gameplay-ui-customize-content::-webkit-scrollbar {
    width: 10px;
}

.gameplay-ui-customize-content::-webkit-scrollbar-track {
    background: rgba(40, 35, 60, 0.4);
    border-radius: 5px;
}

.gameplay-ui-customize-content::-webkit-scrollbar-thumb {
    background: rgba(160, 140, 255, 0.5);
    border-radius: 5px;
}

.gameplay-ui-customize-content::-webkit-scrollbar-thumb:hover {
    background: rgba(160, 140, 255, 0.7);
}

.gameplay-ui-customize-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(160, 140, 255, 0.5) rgba(40, 35, 60, 0.4);
}

.gameplay-ui-customize-content h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #c0b0e0;
}

.gameplay-ui-customize-hint {
    margin: 0 0 20px 0;
    font-size: 13px;
    color: #9080a0;
}

.gameplay-ui-preview-area {
    position: relative;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.gameplay-ui-preview-corners {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    max-width: 400px;
}

.gameplay-ui-topleft-preview {
    padding: 10px 14px;
    background: rgba(20, 18, 28, 0.8);
    border: 1px solid rgba(160, 140, 255, 0.25);
    border-radius: 10px;
}

.gameplay-ui-preview-score {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #e0d8ff;
}

/* Top-right preview (accuracy + timer) in overlay */
.gameplay-ui-topright-preview {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    padding: 10px 14px;
    background: rgba(20, 18, 28, 0.8);
    border: 1px solid rgba(160, 140, 255, 0.25);
    border-radius: 10px;
}

.gameplay-ui-preview-accuracy,
.gameplay-ui-preview-timer {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #e0d8ff;
}

.gameplay-ui-board-wrap {
    display: flex;
    justify-content: center;
}

/* Large preview board so scaling isn't confusing (same aspect as real playfield) */
.judge-preview-board.gameplay-ui-preview-board {
    width: 400px;
    height: 677px;
    min-width: 400px;
    min-height: 677px;
}

.judge-preview-board {
    position: relative;
    width: 248px;
    height: 420px;
    background: rgba(12, 10, 18, 0.95);
    border: 1px solid rgba(160, 140, 255, 0.3);
    border-radius: 12px;
    overflow: hidden;
}

.judge-preview-lanes {
    display: flex;
    gap: 6px;
    height: 100%;
    padding: 0 4px;
}

.judge-preview-lane {
    width: 56px;
    flex: 0 0 56px;
    background: linear-gradient(to bottom, rgba(40, 35, 60, 0.3), rgba(20, 18, 35, 0.5));
    border-radius: 4px;
}

.gameplay-ui-preview-board .judge-preview-lanes {
    padding: 0 6px;
    gap: 10px;
}

.gameplay-ui-preview-board .judge-preview-lane {
    flex: 1;
    min-width: 0;
}

.judge-preview-draggable {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #60ffa0;
    cursor: grab;
    user-select: none;
    transform: translate(-50%, -50%);
    border: 2px dashed rgba(160, 140, 255, 0.6);
}

.judge-preview-draggable:active {
    cursor: grabbing;
}

.combo-preview-draggable {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #e0d8ff;
    cursor: grab;
    user-select: none;
    transform: translate(-50%, -50%);
    border: 2px dashed rgba(160, 140, 255, 0.5);
    padding: 4px 12px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.5);
}

.combo-preview-draggable:active {
    cursor: grabbing;
}

.unstable-bar-preview {
    position: absolute;
    cursor: grab;
    user-select: none;
    transform: translate(-50%, -50%);
    border: 2px dashed rgba(160, 140, 255, 0.5);
    border-radius: 2px;
    background: rgba(80, 60, 140, 0.5);
    pointer-events: auto;
}

.unstable-bar-preview::after {
    content: '';
    display: block;
    width: 8px;
    height: 6px;
    margin: -3px 0 0 -4px;
    position: absolute;
    left: 50%;
    top: 50%;
    background: rgba(224, 216, 255, 0.9);
    border-radius: 1px;
}

.unstable-bar-preview:active {
    cursor: grabbing;
}

.gameplay-ui-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.gameplay-ui-tab {
    padding: 8px 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    background: rgba(80, 60, 140, 0.4);
    border: 1px solid rgba(160, 140, 255, 0.4);
    border-radius: 8px;
    color: #b0a0c0;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.gameplay-ui-tab:hover {
    background: rgba(100, 80, 160, 0.5);
    color: #e0d8ff;
}

.gameplay-ui-tab.active {
    background: rgba(160, 140, 255, 0.35);
    border-color: #a090ff;
    color: #fff;
}

.gameplay-ui-panels {
    margin-bottom: 20px;
}

.gameplay-ui-panel {
    display: none;
}

.gameplay-ui-panel.active {
    display: block;
}

.gameplay-ui-drag-hint {
    margin: 10px 0 0 0;
    font-size: 12px;
    color: #8080a0;
}

.gameplay-ui-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #b0a0c0;
    margin-bottom: 10px;
}

.gameplay-ui-toggle-row input {
    width: 18px;
    height: 18px;
    accent-color: #a090ff;
}

.gameplay-ui-size-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gameplay-ui-size-row label {
    font-size: 13px;
    color: #b0a0c0;
    flex-shrink: 0;
}

.gameplay-ui-size-row input[type="range"] {
    flex: 1;
    min-width: 0;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(80, 60, 140, 0.4);
    border-radius: 4px;
}

.gameplay-ui-size-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #a090ff;
    border-radius: 50%;
    cursor: pointer;
}

.gameplay-ui-size-row input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #a090ff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.gameplay-ui-size-row #judgeSizeValue,
.gameplay-ui-size-row #comboSizeValue,
.gameplay-ui-size-row #unstableBarWidthValue,
.gameplay-ui-size-row #scoreSizeValue,
.gameplay-ui-size-row #accuracySizeValue,
.gameplay-ui-size-row #timerSizeValue {
    font-family: 'JetBrains Mono', monospace;
    min-width: 24px;
    color: #c0b0e0;
}

.gameplay-ui-snap-row {
    margin-bottom: 16px;
}

.gameplay-ui-modal-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.gameplay-ui-reset-layout-btn {
    padding: 10px 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    background: rgba(80, 60, 140, 0.4);
    border: 1px solid rgba(160, 140, 255, 0.5);
    border-radius: 8px;
    color: #b0a0c0;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.gameplay-ui-reset-layout-btn:hover {
    background: rgba(100, 80, 160, 0.5);
    color: #e0d8ff;
}

.judge-customize-done {
    flex: 1;
    min-width: 120px;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(135deg, #7860e0, #a080ff);
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
}

.judge-customize-done:hover {
    opacity: 0.95;
}

/* Playfield scaler – fills remaining space, keeps aspect ratio */
.playfield-scaler {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.playfield {
    background: rgba(12, 10, 18, 0.95);
    border: 1px solid rgba(160, 140, 255, 0.25);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    width: 248px;
    height: 420px;
    flex-shrink: 0;
    transform-origin: center center;
}

.lanes {
    display: flex;
    gap: 6px;
    height: 420px;
    padding: 0 4px;
}

.lane {
    width: 56px;
    flex: 0 0 56px;
    position: relative;
    border-radius: 4px;
    background: linear-gradient(to bottom, rgba(40, 35, 60, 0.3), rgba(20, 18, 35, 0.5));
}

.lane + .lane {
    margin-left: 0;
}

.receptor {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 52px;
    height: 52px;
    z-index: 10;
    pointer-events: none;
}

.receptor[data-skin="circle"] {
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(160, 140, 255, 0.9), rgba(100, 80, 180, 0.9));
    border: 3px solid rgba(255, 255, 255, 0.4);
    box-shadow:
        0 0 20px rgba(160, 140, 255, 0.5),
        inset 0 2px 8px rgba(255, 255, 255, 0.2);
}

.receptor[data-skin="square"] {
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(160, 140, 255, 0.9), rgba(100, 80, 180, 0.9));
    border: 3px solid rgba(255, 255, 255, 0.4);
    box-shadow:
        0 0 20px rgba(160, 140, 255, 0.5),
        inset 0 2px 8px rgba(255, 255, 255, 0.2);
}

.receptor {
    transition: transform 0.08s ease-out, box-shadow 0.08s ease-out;
}

.receptor.receptor-hit-light {
    box-shadow:
        0 0 24px rgba(200, 160, 255, 0.75),
        0 0 36px rgba(180, 140, 255, 0.4),
        inset 0 2px 10px rgba(255, 255, 255, 0.3);
}

.receptor.receptor-hit-pulse {
    transform: translateX(-50%) scale(1.18);
    box-shadow:
        0 0 28px rgba(200, 160, 255, 0.85),
        0 0 42px rgba(180, 140, 255, 0.5),
        inset 0 2px 10px rgba(255, 255, 255, 0.35);
}

.notes-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.note {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 48px;
    z-index: 5;
    pointer-events: none;
}

.note[data-skin="circle"] {
    border-radius: 50%;
    background: linear-gradient(145deg, #c0a0ff, #9060e0);
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 12px rgba(120, 80, 200, 0.6);
}

.note[data-skin="square"] {
    border-radius: 6px;
    background: linear-gradient(145deg, #c0a0ff, #9060e0);
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 12px rgba(120, 80, 200, 0.6);
}

.keys-hint {
    margin-top: 12px;
    text-align: center;
    font-size: 13px;
    color: #706090;
}

.keys-hint span {
    display: inline-block;
    margin: 0 4px;
    padding: 4px 8px;
    background: rgba(80, 60, 140, 0.4);
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: #a090c0;
}

/* Results overlay */
.results {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(12, 10, 18, 0.92);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    z-index: 20;
}

.results h2 {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #fff;
}

.results-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
    font-size: 15px;
    color: #b0a0c0;
}

.results-stats strong {
    color: #fff;
}

.results-score {
    margin: 0 0 24px 0;
    font-size: 18px;
    color: #c0b0e0;
}

.results-score strong {
    color: #a090ff;
}

.back-btn {
    padding: 12px 28px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    background: rgba(160, 140, 255, 0.4);
    border: 1px solid rgba(160, 140, 255, 0.6);
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
}

.back-btn:hover {
    background: rgba(160, 140, 255, 0.6);
}

/* Pause overlay */
.pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(12, 10, 18, 0.9);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 25;
}

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

.pause-content h2 {
    margin: 0 0 24px 0;
    font-size: 28px;
    color: #fff;
}

.pause-btn {
    display: block;
    width: 200px;
    margin: 0 auto 12px auto;
    padding: 14px 24px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, #7860e0, #a080ff);
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
}

.pause-btn.secondary {
    background: rgba(80, 60, 140, 0.5);
    border: 1px solid rgba(160, 140, 255, 0.5);
}

.pause-btn:hover {
    opacity: 0.95;
}

.results-accuracy {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #c0b0e0;
}

.results-accuracy strong {
    color: #a090ff;
}

.results-rating {
    margin: 0 0 24px 0;
    font-size: 16px;
    color: #c0b0e0;
}

.results-rating strong {
    color: #a090ff;
}

.results-rating .unrated {
    color: #8080a0;
    font-weight: 400;
}

.rated-play-hint {
    margin: -8px 0 0 0;
    font-size: 12px;
    color: #80c080;
    flex: 0 0 100%;
}

/* Career overlay */
.career-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 10, 18, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.career-content {
    background: rgba(24, 22, 34, 0.98);
    border: 1px solid rgba(160, 140, 255, 0.4);
    border-radius: 16px;
    padding: 28px 32px;
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    overflow: auto;
}

.career-content h2 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.career-sr-section {
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(80, 60, 140, 0.2);
    border-radius: 10px;
    border: 1px solid rgba(160, 140, 255, 0.3);
}

.career-total-sr {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #c0b0e0;
}

.career-total-sr strong {
    color: #a090ff;
}

.career-sr-max {
    font-size: 14px;
    color: #8080a0;
}

.career-mode-ratings {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #b0a0c0;
}

.career-mode-ratings strong {
    color: #e0d8ff;
}

.career-actions-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.career-danger-btn {
    padding: 8px 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    background: rgba(180, 60, 60, 0.3);
    border: 1px solid rgba(220, 100, 100, 0.5);
    border-radius: 8px;
    color: #e0a0a0;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.career-danger-btn:hover {
    background: rgba(180, 60, 60, 0.5);
    color: #ffb0b0;
}

.career-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    margin-bottom: 12px;
}

.career-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.career-filter-label {
    font-size: 12px;
    color: #8080a0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.career-filter-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.career-filter-btn {
    padding: 6px 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    background: rgba(80, 60, 140, 0.4);
    border: 1px solid rgba(160, 140, 255, 0.4);
    border-radius: 6px;
    color: #b0a0c0;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.career-filter-btn:hover {
    background: rgba(100, 80, 160, 0.5);
    color: #e0d8ff;
}

.career-filter-btn.active {
    background: rgba(160, 140, 255, 0.35);
    border-color: #a090ff;
    color: #fff;
}

.career-scores-heading {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #a090ff;
}

.career-scores-wrap {
    margin-bottom: 20px;
    overflow-x: auto;
}

.career-scores-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.career-scores-table th,
.career-scores-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(160, 140, 255, 0.2);
}

.career-scores-table th {
    color: #a090ff;
    font-weight: 600;
}

.career-scores-table td {
    color: #c0b0e0;
}

.career-scores-table tbody tr:hover {
    background: rgba(80, 60, 140, 0.15);
}

.career-scores-table .unrated {
    color: #8080a0;
    font-weight: 400;
}

.career-no-scores {
    margin: 12px 0 0 0;
    font-size: 13px;
    color: #8080a0;
    display: none;
}

.career-no-scores.visible {
    display: block;
}

.career-close-btn {
    padding: 10px 24px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    background: rgba(160, 140, 255, 0.4);
    border: 1px solid rgba(160, 140, 255, 0.6);
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
}

.career-close-btn:hover {
    background: rgba(160, 140, 255, 0.6);
}

.career-btn {
    padding: 10px 20px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    background: rgba(80, 60, 140, 0.4);
    border: 1px solid rgba(160, 140, 255, 0.5);
    border-radius: 10px;
    color: #b0a0c0;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.career-btn:hover {
    background: rgba(100, 80, 160, 0.5);
    color: #e0d8ff;
}

/* Confirm modal */
.confirm-modal {
    position: fixed;
    inset: 0;
    background: rgba(12, 10, 18, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.confirm-modal-content {
    background: rgba(28, 26, 38, 0.98);
    border: 1px solid rgba(160, 140, 255, 0.4);
    border-radius: 14px;
    padding: 24px 28px;
    max-width: 360px;
    width: 100%;
}

.confirm-modal-message {
    margin: 0 0 20px 0;
    font-size: 15px;
    color: #e0d8f0;
    line-height: 1.5;
}

.confirm-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.confirm-modal-btn {
    padding: 10px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.confirm-modal-btn.cancel {
    background: rgba(80, 60, 140, 0.4);
    border: 1px solid rgba(160, 140, 255, 0.5);
    color: #b0a0c0;
}

.confirm-modal-btn.cancel:hover {
    background: rgba(100, 80, 160, 0.5);
    color: #e0d8ff;
}

.confirm-modal-btn.confirm {
    background: linear-gradient(135deg, #7860e0, #a080ff);
    border: none;
    color: #fff;
}

.confirm-modal-btn.confirm:hover {
    opacity: 0.95;
}
