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

body {
    overflow: hidden;
    background: #2a3040;
    font-family: 'IBM Plex Mono', monospace;
    -webkit-user-select: none;
    user-select: none;
}

canvas {
    display: block;
    width: 100vw;
    height: 100vh;
}

#stats-bar {
    position: fixed;
    top: 16px;
    left: 16px;
    color: #d0d8e0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 300;
    background: rgba(20, 25, 35, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    z-index: 10;
    line-height: 1.6;
}

#odometer {
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 1px;
    color: #e8ecf0;
}

#location {
    font-size: 11px;
    opacity: 0.7;
    font-style: italic;
    max-width: 220px;
}

#thought-area {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: min(400px, 70vw);
}

#thought-input {
    width: 100%;
    background: rgba(20, 25, 35, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 10px 20px;
    color: rgba(240, 235, 220, 0.9);
    font-family: 'Caveat', cursive;
    font-size: 18px;
    outline: none;
    transition: all 0.3s;
}

#thought-input::placeholder {
    color: rgba(200, 200, 200, 0.35);
    font-style: italic;
}

#thought-input:focus {
    background: rgba(20, 25, 35, 0.6);
    border-color: rgba(255,255,255,0.2);
}

#floating-thoughts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.floating-thought {
    position: absolute;
    font-family: 'Caveat', cursive;
    font-size: 20px;
    color: rgba(240, 235, 220, 0.7);
    white-space: nowrap;
    animation: floatUp 8s ease-out forwards;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

@keyframes floatUp {
    0% { opacity: 0.8; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-200px); }
}

#controls-toggle {
    position: fixed;
    bottom: 50px;
    right: 16px;
    width: 44px;
    height: 44px;
    background: rgba(20, 25, 35, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    color: #c0c8d0;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s;
}

#controls-toggle:hover {
    background: rgba(20, 25, 35, 0.75);
}

#controls {
    position: fixed;
    bottom: 104px;
    right: 16px;
    background: rgba(16, 20, 30, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 16px 20px;
    z-index: 20;
    min-width: 220px;
    transition: all 0.3s;
}

#controls.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: #b0b8c0;
    font-size: 12px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    min-width: 55px;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 10px;
    opacity: 0.7;
}

.control-group input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    outline: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #8899aa;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.2);
}

.control-group span {
    min-width: 50px;
    text-align: right;
    font-size: 11px;
    font-weight: 500;
    color: #d0d8e0;
}

.control-group button {
    flex: 1;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 6px 12px;
    color: #c0c8d0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.control-group button:hover {
    background: rgba(255,255,255,0.14);
}

#journal-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}

#journal-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

#journal-content {
    width: min(500px, 90vw);
    max-height: 70vh;
    background: rgba(30, 28, 24, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    overflow: hidden;
}

#journal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

#journal-header h2 {
    font-family: 'Caveat', cursive;
    font-size: 24px;
    color: #d8d0c0;
    font-weight: 400;
}

#journal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
}

#journal-entries {
    padding: 16px 20px;
    overflow-y: auto;
    max-height: calc(70vh - 60px);
}

.journal-entry {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.journal-entry-text {
    font-family: 'Caveat', cursive;
    font-size: 18px;
    color: #d0c8b8;
    line-height: 1.4;
}

.journal-entry-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: rgba(160, 155, 140, 0.6);
    margin-top: 4px;
}

.journal-empty {
    color: rgba(160,155,140,0.4);
    font-style: italic;
    font-family: 'Caveat', cursive;
    font-size: 18px;
    text-align: center;
    padding: 40px 0;
}

#footer {
    position: fixed;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

#footer a {
    color: rgba(180, 180, 180, 0.3);
    text-decoration: none;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    transition: color 0.2s;
}

#footer a:hover {
    color: rgba(200, 200, 200, 0.6);
}

@media (max-width: 600px) {
    #stats-bar {
        top: 70px;
        left: 10px;
        font-size: 11px;
        padding: 8px 12px;
    }
    #odometer { font-size: 18px; }
    #thought-area { width: min(300px, 85vw); top: 12px; }
    #thought-input { font-size: 16px; padding: 8px 16px; }
    #controls { right: 10px; bottom: 90px; min-width: 190px; }
    #controls-toggle { bottom: 44px; right: 10px; }
}