* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Book Antiqua', /* fallback to serif */;
}

body {
    font-family: 'Book Antiqua', serif;
    background-color: #111;
    color: #f0f0f0;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.kaleidoscope-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.kaleidoscope {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.6;
    background: 
        radial-gradient(circle, rgba(30,0,0,0.2) 0%, rgba(0,0,0,0.8) 10%), 
        url('https://files.catbox.moe/evylya.jpg');
    background-blend-mode: overlay;
    background-size: cover;
    background-position: center;
}

.mirror-shards {
    position: absolute;
    width: 100%;
    height: 100%;
}

.shard {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.5);
    transform-origin: center;
    backdrop-filter: blur(4px);
    box-shadow: 0 0 13px rgba(255, 200, 255, 0.5);
    border: 0.5px solid rgba(0, 0, 0);
    opacity: 0.7;
    cursor: grab;
    box-shadow: 0 0.5px rgba(0, 0, 0);
    background-image: url('https://files.catbox.moe/evylya.jpg');
    background-size: cover;
    background-position: center;
}

.content {
    height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    z-index: 10;
}

.thought-stream {
    width: 80%;
    height: 70vh;
    overflow: hidden;
    position: relative;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
}

.thought {
    position: absolute;
    padding: 17px;
    border-radius: 2px;
    background-color: rgba(200, 225, 255, 0.15);
    box-shadow: 0px 0px 10px rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    max-width: 60%;
    font: 1.1rem / 1.4 'Book Antiqua', serif;
    line-height: 1.4;
    transition: transform 0.5s, opacity 0.5s;
    opacity: 0;
    pointer-events: none;
    text-shadow: blur(3px);
}

.thought.active {
    opacity: 1;
    pointer-events: auto;
}

.thought.english {
  background-color: #e6fefe;
}

.thought.chaotic, .thought.ordered {
    border: 2px solid #ffffff;
}

.thought.alink {
    color: #b3dd4f;
    text-decoration: underline;
}

.action-link:hover {
    color: #ffc6b6;
}

@keyframes glitch {
    0% {text-shadow: 5px red, -5px 5px blue};
    40% {text-shadow: 5px 0 #d4ff3f, 0 #73f7};
    80% {text-shadow: 0px 0 orange, 5px #ffb};
    100% {text-shadow: 0 0 black};
}

.controls {
    display: flex;
    gap: 1rem;
}

button {
    padding: 10px 20px;
    border: none;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

button:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

#pause-btn {
    border-left: 3px solid #ff3366;
}

#fast-forward-btn {
    border-left: 3px solid #33aaff;
}

#order-btn {
    border-left: 3px solid #7cfc00;
}

@media (max-width: 768px) {
    .thought-stream {
        width: 95%;
    }
    
    .thought {
        max-width: 85%;
        font-size: 0.9rem;
    }
    
    .controls {
        flex-direction: column;
    }
}

.action-link {
    color: #33aaff;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s;
}

.action-link:hover {
    color: #ff3366;
    text-decoration: none;
}

/* Popup overlay*/
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.popup-content {
    background-color: rgba(20, 20, 20, 0.9);
    color: #fff;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    max-width: 80%;
    font-size: 1.2rem;
    text-align: center;
    cursor: pointer;
}