:root {
    --bg-gradient: radial-gradient(circle at 50% 50%, #1a1a1a 0%, #000000 100%);
    --glass-bg: rgba(30, 30, 30, 0.6);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-main: #fff;
    --text-muted: rgba(255,255,255,0.6);
    --primary-color: #888;
    --warm-primary: #FF5E00;
    --warm-bg-gradient: radial-gradient(circle at 50% 30%, #4a1000 0%, #000000 90%);
    --warm-glass: rgba(60, 20, 0, 0.7);
    --warm-border: rgba(255, 94, 0, 0.4);
    --cool-primary: #00C3FF;
    --cool-bg-gradient: radial-gradient(circle at 50% 30%, #001529 0%, #000000 90%);
    --cool-glass: rgba(0, 30, 60, 0.7);
    --cool-border: rgba(0, 195, 255, 0.4);
}

* { box-sizing: border-box; }

body {
    margin: 0; padding: 0;
    background: var(--bg-gradient);
    background-size: 200% 200%;
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    height: 100vh; overflow: hidden;
    display: flex; flex-direction: column; align-items: center;
    transition: background 1.2s ease;
}

/* Header & Logo */
.site-header {
    margin-top: 3vh; margin-bottom: -2vh;
    z-index: 150; position: relative;
    display: flex; justify-content: center;
    opacity: 0.95; transition: transform 0.3s ease;
}
.site-header:hover {
    transform: scale(1.02);
    filter: drop-shadow(0 0 15px rgba(0, 255, 255, 0.2));
}

/* Dashboard */
.dashboard-wrapper {
    width: 95%; max-width: 900px; margin-top: 5vh; z-index: 100;
    display: flex; flex-wrap: wrap; gap: 15px;
    justify-content: center; align-items: stretch;
}
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px; padding: 15px 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    transition: all 0.8s ease;
}
.status-card { flex: 1 1 200px; display: flex; align-items: center; min-width: fit-content; }
.status-icon-wrapper {
    width: 44px; height: 44px; border-radius: 50%;
    border: 2px solid var(--primary-color);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary-color); background: rgba(0,0,0,0.3);
    flex-shrink: 0; transition: all 0.5s ease;
}
.status-info { margin-left: 12px; display: flex; flex-direction: column; justify-content: center; }
.status-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.status-title { font-size: 1.2rem; font-weight: 800; color: #fff; white-space: nowrap; }
.status-value-box {
    margin-left: auto; background: rgba(0,0,0,0.4);
    border: 1px solid var(--card-border); padding: 4px 8px; border-radius: 8px;
    font-family: 'Courier New', monospace; font-weight: bold; font-size: 0.85rem;
    color: var(--primary-color);
}
.energy-control-panel {
    flex: 2 1 350px; display: flex; align-items: center; gap: 10px;
    justify-content: space-between;
}
.click-btn {
    width: 64px; height: 64px; border-radius: 18px; border: none; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: transform 0.1s; position: relative; overflow: visible;
    color: #fff; background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1); flex-shrink: 0; user-select: none;
}
.click-btn:active { transform: scale(0.92); }
.click-btn svg { width: 28px; height: 28px; margin-bottom: 2px; pointer-events: none; }
.count-display { font-size: 0.7rem; font-weight: bold; opacity: 0.9; pointer-events: none; }

.btn-warm { color: var(--warm-primary); }
.btn-warm.active-mode { background: rgba(255, 94, 0, 0.15); border-color: var(--warm-primary); box-shadow: 0 0 15px var(--warm-primary); }
.btn-cool { color: var(--cool-primary); }
.btn-cool.active-mode { background: rgba(0, 195, 255, 0.15); border-color: var(--cool-primary); box-shadow: 0 0 15px var(--cool-primary); }

.bar-container {
    flex-grow: 1; height: 48px; background: #000; border-radius: 24px;
    position: relative; overflow: hidden; display: flex;
    border: 1px solid rgba(255,255,255,0.1); margin: 0 5px;
}
.bar-segment {
    height: 100%; display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 800;
    transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap; overflow: hidden;
}
#bar-warm {
    background: linear-gradient(90deg, #5e1e00, var(--warm-primary)); color: #fff;
    box-shadow: 5px 0 20px rgba(0,0,0,0.5); z-index: 2; text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
#bar-cool {
    background: linear-gradient(90deg, var(--cool-primary), #003366); color: #000; z-index: 1;
}

/* Floating System */
#floating-area {
    position: absolute; top: 38%; bottom: 0; left: 0; right: 0;
    z-index: 10; pointer-events: none;
}
.vibe-wrapper {
    position: absolute; pointer-events: auto;
    animation-name: organicFloat; animation-timing-function: ease-in-out;
    animation-iteration-count: infinite; animation-direction: alternate;
    z-index: 10;
}
.vibe-wrapper:hover { animation-play-state: paused; z-index: 999; }
.vibe-inner {
    padding: 10px 18px; border-radius: 30px; font-size: 0.9rem; cursor: pointer;
    backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.4); color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.2s, background 0.2s;
}
.vibe-wrapper:hover .vibe-inner { transform: scale(1.15); background: rgba(0,0,0,0.85); border-color: #fff; }
.vibe-inner.warm { border-color: var(--warm-primary); box-shadow: 0 0 15px rgba(255, 94, 0, 0.2); color: #ffd6b3; }
.vibe-inner.cool { border-color: var(--cool-primary); box-shadow: 0 0 15px rgba(0, 195, 255, 0.2); color: #b3ecff; }

@keyframes organicFloat {
    0% { transform: translate(0, 0); }
    33% { transform: translate(20px, -20px); }
    66% { transform: translate(-15px, -40px); }
    100% { transform: translate(10px, -60px); }
}

.feedback-float {
    position: absolute; font-weight: 900; font-size: 1.2rem; pointer-events: none;
    animation: floatUpFade 0.8s forwards ease-out; z-index: 200; text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
@keyframes floatUpFade {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-40px) scale(1.5); opacity: 0; }
}

/* Modals */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); z-index: 1000;
    display: none; justify-content: center; align-items: center;
    backdrop-filter: blur(8px); opacity: 0; transition: opacity 0.3s;
}
.modal-overlay.show { opacity: 1; }
.modal-content {
    background: #1a1a1a; border: 1px solid #333;
    width: 85%; max-width: 400px; padding: 25px; border-radius: 24px;
    text-align: center; position: relative;
    transform: scale(0.9); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 60px #000;
}
.modal-overlay.show .modal-content { transform: scale(1); }
#view-text { font-size: 1.3rem; line-height: 1.5; margin-bottom: 25px; color: #fff; font-weight: 500; }
.close-btn {
    background: transparent; border: 1px solid #fff; color: #fff;
    padding: 10px 30px; border-radius: 30px; cursor: pointer; margin-top: 10px;
    font-weight: bold; transition: all 0.2s;
}
.close-btn:hover { background: #fff; color: #000; }
textarea {
    width: 100%; height: 100px; background: #000; border: 1px solid #333;
    color: #fff; padding: 15px; border-radius: 16px; font-size: 1rem;
    resize: none; outline: none; margin-bottom: 5px; font-family: inherit;
}
textarea:focus { border-color: #666; }
.char-counter { width: 100%; text-align: right; font-size: 0.75rem; color: #666; margin-bottom: 10px; }
.char-counter.limit { color: #ff4444; }
.emoji-bar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 10px; scrollbar-width: none; }
.emoji-btn { background: #2a2a2a; border: none; font-size: 1.2rem; padding: 8px; border-radius: 12px; cursor: pointer; flex-shrink: 0; }
.side-selector { display: flex; gap: 15px; margin-bottom: 20px; }
.side-option {
    flex: 1; padding: 12px; border-radius: 16px; border: 2px solid transparent;
    cursor: pointer; font-weight: bold; font-size: 0.9rem; opacity: 0.5;
    transition: all 0.2s; background: #222; color: #fff;
}
.side-option.selected { opacity: 1; transform: scale(1.05); }
.side-option.warm.selected { background: rgba(255, 94, 0, 0.2); border-color: var(--warm-primary); color: var(--warm-primary); }
.side-option.cool.selected { background: rgba(0, 195, 255, 0.2); border-color: var(--cool-primary); color: var(--cool-primary); }
.submit-btn {
    width: 100%; padding: 14px; border-radius: 16px; border: none;
    background: #fff; color: #000; font-weight: 800; font-size: 1rem; cursor: pointer;
    opacity: 0.5; pointer-events: none; transition: 0.3s;
}
.submit-btn.ready { opacity: 1; pointer-events: auto; }
.shatter { animation: shatterAnim 0.5s forwards; pointer-events: none; }
@keyframes shatterAnim {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2); opacity: 0; filter: blur(10px); }
}
.fab {
    position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px;
    background: #fff; border-radius: 50%; color: #000; font-size: 30px;
    border: none; box-shadow: 0 4px 20px #000; cursor: pointer; z-index: 200;
    transition: transform 0.2s;
}
.fab:hover { transform: scale(1.1) rotate(90deg); }