* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    width: 100%;
    height: 100vh;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.circle {
    width: 40px;
    height: 40px;
    background-color: black;
    border-radius: 50%;
    cursor: grab;
    user-select: none;
    transition: cursor 0.1s;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid transparent;
}

.circle:active {
    cursor: grabbing;
}

.red-dot {
    position: fixed;
    width: 30px;
    height: 30px;
    background-color: red;
    border-radius: 50%;
    pointer-events: none;
}

.blue-square {
    position: fixed;
    width: 30px;
    height: 30px;
    background-color: blue;
    pointer-events: none;
}

.laser {
    position: fixed;
    width: 4px;
    height: 20px;
    background-color: cyan;
    pointer-events: none;
}

.timer {
    position: fixed;
    top: 20px;
    left: 20px;
    font-size: 32px;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    letter-spacing: 2px;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 12px 20px;
    border-radius: 8px;
    border: 2px solid black;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.best-time {
    position: fixed;
    top: 75px;
    left: 20px;
    font-size: 14px;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    letter-spacing: 1px;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 8px 20px;
    border-radius: 8px;
    border: 2px solid black;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.settings-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: white;
    border: 2px solid black;
    border-radius: 8px;
    font-size: 24px;
    cursor: pointer;
    z-index: 100;
    transition: background-color 0.2s;
}

.settings-button:hover {
    background-color: #f5f5f5;
}

.game-over-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.game-over-modal.active {
    display: flex;
}

.settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.settings-modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
}

.modal-content h1 {
    font-size: 48px;
    margin-bottom: 30px;
    font-family: Noto Sans, sans-serif;
}

.restart-button {
    padding: 12px 30px;
    font-size: 16px;
    background-color: black;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: Noto Sans, sans-serif;
    transition: background-color 0.2s;
    margin: 6px 4px;
}

.restart-button:hover {
    background-color: #333;
}

.setting-item {
    margin-bottom: 30px;
    text-align: left;
}

.setting-item label {
    display: block;
    font-size: 16px;
    margin-bottom: 12px;
    font-family: Noto Sans, sans-serif;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

#sensitivitySlider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

#sensitivitySlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: black;
    cursor: pointer;
}

#sensitivitySlider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: black;
    cursor: pointer;
    border: none;
}

.sensitivity-value {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 14px;
    min-width: 50px;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

#darkModeToggle {
    width: 50px;
    height: 26px;
    cursor: pointer;
}

.toggle-label {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 14px;
    min-width: 50px;
}

body.dark-mode {
    background-color: black;
}

body.dark-mode .circle {
    /* remove background override so skins show */
}

body.hardcore-mode {
    background-color: black;
}

body.hardcore-mode .circle {
    /* keep hardened visibility without forcing color */
    /* opacity moved to skin-specific rules below */
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25), 0 0 6px rgba(255, 255, 255, 0.15);
}
/* In hardcore mode, only non-default skins are half transparent */
body.hardcore-mode .circle[data-skin="green"],
body.hardcore-mode .circle[data-skin="striped"] {
    opacity: 0.5;
}

.close-settings-button {
    padding: 12px 30px;
    font-size: 16px;
    background-color: black;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: Noto Sans, sans-serif;
    transition: background-color 0.2s;
    margin: 6px 4px;
}

.close-settings-button:hover {
    background-color: #333;
}

.pause-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.pause-modal.active {
    display: flex;
}

.resume-button {
    padding: 12px 30px;
    font-size: 16px;
    background-color: black;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: Noto Sans, sans-serif;
    transition: background-color 0.2s;
}

.resume-button:hover {
    background-color: #333;
}

/* Library modal */
.library-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
/* Toast notification */
.toast {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translate(-50%, -8px);
    background-color: rgba(255, 255, 255, 0.95);
    color: black;
    padding: 10px 16px;
    border: 2px solid black;
    border-radius: 8px;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.library-modal.active {
    display: flex;
}

.library-modal .modal-content {
    width: min(90vw, 520px);
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
}

.library-modal .modal-content h1 {
    margin-bottom: 0;
    text-align: left;
}

.scores-list {
    list-style: none;
    text-align: left;
    max-height: 50vh;
    overflow-y: auto;
    padding: 6px 0;
    margin: 0;
    font-family: 'Space Mono', monospace;
    border: 2px solid black;
    border-radius: 6px;
    width: 100%;
    background: white;
}

.scores-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid black;
    gap: 12px;
    font-size: 14px;
}

.scores-list li:last-child {
    border-bottom: none;
}

.score-text {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 8px;
}

.list-delete {
    padding: 6px 12px;
    font-size: 12px;
    background-color: black;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.list-delete:hover {
    background-color: #333;
}

/* Admin modal */
.admin-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.admin-modal.active {
    display: flex;
}

.admin-modal .modal-content {
    width: min(90vw, 520px);
    max-height: 80vh;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
}

.admin-modal .modal-content h1 {
    margin-bottom: 0;
    text-align: left;
}

.skins-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(80px, 1fr));
    gap: 12px;
}

.skin-card {
    border: 2px solid black;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    user-select: none;
}

.skin-preview {
    width: 48px;
    height: 48px;
    margin: 0 auto 8px;
    border-radius: 50%;
    border: 2px solid transparent;
}

.leaderboard-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.leaderboard-modal.active {
    display: flex;
}

.leaderboard-modal .modal-content {
    width: min(90vw, 520px);
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
}

.leaderboard-modal .modal-content h1 {
    margin-bottom: 0;
    text-align: left;
}