:root {
    --bg-hue: 180;
    /* Cyan base */
    --bg-sat: 30%;
    --bg-light: 95%;
    --bg-color: hsl(var(--bg-hue), var(--bg-sat), var(--bg-light));

    --text-color: #546e7a;
    --thought-color: #b39ddb;
    --highlight-color: #80cbc4;

    --ring-scale: 1;
    --ring-opacity: 0.3;
}

* {
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 2s ease;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#background-breathing {
    position: absolute;
    width: 300px;
    height: 300px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: scale(var(--ring-scale));
    opacity: var(--ring-opacity);
    pointer-events: none;
    z-index: 0;
    transition: transform 0.1s linear, opacity 0.1s linear;
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.2);
}

#hud {
    position: absolute;
    top: 15%;
    width: 100%;
    text-align: center;
    pointer-events: none;
    z-index: 100;
}

#title {
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 2px;
    opacity: 0.8;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.5);
}

#calm-indicator {
    margin-top: 15px;
    width: 200px;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    margin-left: auto;
    margin-right: auto;
    border-radius: 2px;
    overflow: hidden;
}

#calm-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--highlight-color), var(--thought-color));
    transition: width 1s ease;
    box-shadow: 0 0 10px var(--highlight-color);
}

#instruction {
    font-size: 1rem;
    margin-top: 10px;
    opacity: 0;
    /* Hidden by default, fades in */
    font-style: italic;
    transition: opacity 2s ease;
}

#world {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.thought {
    position: absolute;
    width: 60px;
    height: 60px;
    background-color: var(--thought-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 24px;
    opacity: 0.8;
    cursor: pointer;
    transition: transform 0.5s ease, opacity 0.5s ease, background-color 0.5s ease, top 0.1s, left 0.1s;
    /* Smooth movement handled by JS mostly, but transitions help */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.thought:hover {
    transform: scale(1.1);
    background-color: var(--highlight-color);
}

.thought.released {
    transform: scale(1.5);
    opacity: 0;
    pointer-events: none;
}

/* Micro-completion zones */
.zone-pulse {
    position: absolute;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.5);
    animation: pulse-fade 1.5s ease-out forwards;
}

@keyframes pulse-fade {
    0% {
        opacity: 0.6;
        transform: scale(0.5);
    }

    100% {
        opacity: 0;
        transform: scale(2);
    }
}

/* Quote System */
#quote-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 200;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
}

#quote-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

#quote-text {
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--text-color);
    text-align: center;
    max-width: 80%;
    line-height: 1.6;
    margin-bottom: 20px;
    transform: translateY(20px);
    transition: transform 1s ease-out;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.8);
}

#quote-overlay.visible #quote-text {
    transform: translateY(0);
}

#quote-hint {
    font-size: 0.9rem;
    opacity: 0.5;
    margin-top: 20px;
    font-style: italic;
}

.blurred {
    filter: blur(5px);
    transition: filter 1s ease;
}