:root {
    --background-colour: hsl(0, 0%, 0%);
    --foreground-colour: #f2f2f2;
    --action-colour: red;
    --action-colour-light: #ff6666;
    --spacing-one: 4px;
    --spacing-two: 8px;
    --spacing-three: 12px;
    --spacing-four: 16px;
    --spacing-five: 16px;
    --tiny-font-size: 1em;
    --small-font-size: 1.4em;
    --font-size: 2em;
    --large-font-size: 2.5em;
    --largest-font-size: 3em;
    --twitter-colour: #1DA1F2;
    --cd-size: 90px;
    --volume-size: 120px;
}

html {
    font-family: "Gaegu", sans-serif;
    font-weight: 400;
    font-size: var(--font-size);
    color: var(--foreground-colour);
}

body {
    background-color: var(--background-colour);
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
    padding: var(--spacing-five);
}

p {
    margin: var(--spacing-one);
}

h1, h2 {
    margin: 0px;
    padding: 0px;
}

h1 {
    font-family: "Creepster", system-ui;
    font-weight: 500;
    font-size: var(--largest-font-size);
    user-select: none;
}

.mode-buttons {
    display: flex;
    gap: var(--spacing-five);
    margin: 10px 0;
    justify-content: center;
}

#shareContainer {
    display: flex;
    gap: var(--spacing-three);    
    position: fixed;
    bottom:  var(--spacing-five);
    margin: 10px 0;
    justify-content: center;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#shareContainer.visible {
    transform: translateY(0);
}

#shareContainer button {
    font-size: 0.8em;
    font-weight: 600;
}

#tweet {
    background: var(--twitter-colour);
    border-color: var(--twitter-colour);
}

#copy {
    background-color: var(--action-colour);
    border-color: var(--action-colour);
}

button {
    padding: var(--spacing-two) var(--spacing-four);
    font-family: "Gaegu", sans-serif;
    font-size: var(--tiny-font-size);
    background: transparent;
    color: var(--foreground-colour);
    border: 2px solid var(--foreground-colour);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    transform: scale(1);
}

button:hover {
    transform: scale(1.07);
}

.mode-button:hover {
    background: var(--foreground-colour);
    color: var(--background-colour);
}

.mode-button.active {
    background: var(--action-colour);
    color: var(--background-colour);
    border-color: var(--action-colour);
}


.mode-button.active:hover {
    transform: scale(1);
    cursor: default;
}

.info-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-two);
    border-radius: var(--spacing-two);
    transition: all 0.3s ease;
    color: var(--foreground-colour);
}

.info-button:hover {
    color: var(--action-colour);
}

h2 {
    font-family: "Gaegu", sans-serif;
    font-weight: 400;
    user-select: none;
}

.cd {
    width: var(--cd-size);
    height: var(--cd-size);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: grab;
    user-select: none;
}

.cd svg {
    width: var(--cd-size) !important;
    height: var(--cd-size) !important;
    transition: transform 0.2s ease;
    position: absolute;
    opacity: 0;
}

.cd-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    z-index: 2;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
}



.cd:hover svg {
    transform: scale(1.05);
}


.circleSlider {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--volume-size);
    height:var(--volume-size);
    z-index: 1;
    pointer-events: none;
    transform-origin: center;
}

.sliderPath, .sliderKnobPos { 
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 40;
    stroke: var(--foreground-colour); 
}


.sliderKnobPos { stroke:var(--action-colour-light); stroke-dasharray: 888.4247436523438; stroke-dashoffset: 888.4247436523438; }
.circleSlider circle { 
    fill: var(--action-colour); 
    touch-action: none; 
    pointer-events: auto;
}

.circleSlider circle:hover { 
    cursor: move; 
}

.track-container {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3 ease, visibility 0.3s ease;
}

.sound-label {
    position: absolute;
    bottom: calc(var(--cd-size) * -0.5);
    left: 50%;
    transform: translateX(-50%);
    color: var(--foreground-colour);
    font-size: 0.8em;
    pointer-events: none;
    text-align: center;
}

.volume-value {
    font-size: 0.9em;
    font-weight: normal;
    margin-bottom: 0;
    padding: 0;
    line-height: 0.4;
}

.sound-name {
    font-size: 1.1em;
    font-weight: bold;
    padding: 0;
}

.track-container.visible {
    opacity: 1;
    visibility: visible;
}

#infoButton  {
    position: fixed;
    bottom:  var(--spacing-five);
    z-index: 2;
    font-size: var(--font-size);
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    user-select: none;
}

#infoButton {
    right: var(--spacing-five);
}

#infoButton:hover,
#infoButton:focus {
    cursor: pointer;
    color: var(--action-colour);
}

#sharelink:hover,
#sharelink:focus {
    cursor: pointer;
    color: var(--action-colour);
}

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.show {
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--background-colour);
    border: 2px solid var(--foreground-colour);
    border-radius: var(--spacing-three);
    width: 100%;
    max-width: 720px;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.3);
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.3);
}

.modal.show .modal-content {
    transform: scale(1);
}



.modal-tabs {
    display: flex;
    background-color: var(--background-colour);
    border-bottom: 1px solid var(--foreground-colour);
}

.tab-button {
    flex: 1;
    background: none;
    border: none;
    color: var(--foreground-colour);
    padding: var(--spacing-three);
    cursor: pointer;
    font-size: var(--small-font-size);
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    font-family: "Gaegu", sans-serif;
    border-radius: 0;
}

.tab-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.tab-button.active {
    border-bottom-color: var(--foreground-colour);
    background-color: var(--foreground-colour);
    color: var(--background-colour);
}

.modal-body {
    padding: var(--spacing-four);
    max-height: 400px;
    overflow-y: auto;
}

.tab-content {
    display: none;
    color: var(--foreground-colour);
    line-height: 1.6;
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    color: var(--foreground-colour);
    margin-top: 0;
    margin-bottom: var(--spacing-three);
}

.tab-content p {
    margin-bottom: var(--spacing-three);
}

.onboarding-modal {
    z-index: 10000;
}

.onboarding-content {
    max-width: 500px;
    text-align: center;
    padding: var(--spacing-five);
}

.onboarding-step {
    display: none;
}

.onboarding-step.active {
    display: block;
}

.onboarding-step h2 {
    margin-bottom: var(--spacing-three);
    color: #f2f2f2;
}

.onboarding-step p {
    font-family: 'Gaegu', sans-serif;
    margin-bottom: var(--spacing-three);
    color: #ccc;
    line-height: 1.5;
}

.onboarding-next,
.onboarding-start {
    background: #f2f2f2;
    color: #1a1a1a;
    border: none;
    padding: 12px 24px;
    font-family: 'Gaegu', sans-serif;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.onboarding-next:hover,
.onboarding-start:hover {
    background: #d4d4d4;
}

.onboarding-start {
    background: var(--action-colour-light);
    color: white;
}

.onboarding-start:hover {
    background: var(--action-colour);
}

a {
    color: var(--action-colour);
}

.ghost {
    position: fixed;
    z-index: 10;
    transform-origin: center;
    width: 90px;
    height: 140px;
    pointer-events: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    --ghost-color: white;
    --fear-intensity: 0;
    transition: all 0.3s ease;
    animation: gentle-bob 3s ease-in-out infinite;
}

@keyframes gentle-bob {
    0%, 100% { transform: translate(-50%, -50%) scale(0.7) translateY(0px); }
    50% { transform: translate(-50%, -50%) scale(0.7) translateY(-5px); }
}

.ghost__head {
    position: relative;
    width: 100%;
    height: 100px;
}

.ghost.fear {
    filter: brightness(1.2) saturate(1.5);
    animation: fear-bob 2s ease-in-out infinite;
}

@keyframes fear-bob {
    0%, 100% { transform: translate(-50%, -50%) scale(0.7) translateY(0px); }
    50% { transform: translate(-50%, -50%) scale(0.7) translateY(-10px); }
}

.ghost__eyes {
    position: absolute;
    z-index: 1;
    width: 15px;
    height: 15px;
    top: 34px;
    left: 50%;
    transform: translate(-50%);
    border-radius: 50px;
    background: var(--ghost-color);
    margin-left: -20px;
    transform-origin: center;
}

.ghost__eyes {
    box-shadow: 40px 0 0 black;
    display: block;
    visibility: visible;
    background: black !important;
}

.ghost__mouth {
    position: absolute;
    z-index: 1;
    top: 60px;
    left: 45%;
    border-radius: 50%;
    width: 8px;
    height: 8px;
    overflow: hidden;
    background: black !important;
}

.ghost__tail {
    position: absolute;
    z-index: -1;
    top: 82px;
    height: 55px;
    width: 100%;
    filter: url(#goo);
}

.ghost__tail:before {
    content: '';
    background: var(--ghost-color);
    position: absolute;
    bottom: 35px;
    left: 0;
    height: 100px;
    width: 100%;
    border-radius: 40px 40px 5px 5px;
}

.ghost__rip {
    width: 15px;
    height: 28px;
    background: var(--ghost-color);
    position: absolute;
    top: 15px;
    left: 0;
    box-shadow: -62px 0 0 var(--ghost-color), -31px 0 0 var(--ghost-color), 31px 0 0 var(--ghost-color), 62px 0 0 var(--ghost-color), 93px 0 0 var(--ghost-color);
    border-radius: 50%;
    animation: ghost-rips 1.2s linear infinite;
}

@keyframes ghost-rips {
    0% {
        left: 0;
        top: 12px;
    }
    50% {
        left: 31px;
        top: 20px;
    }
    100% {
        left: 62px;
        top: 12px;
    }
}