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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Holographic Button */
.holographic-btn {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.2), rgba(0, 100, 255, 0.2));
    border: 1px solid rgba(0, 255, 255, 0.5);
    color: #0ff;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.holographic-btn:hover {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.4), rgba(0, 100, 255, 0.4));
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5), inset 0 0 10px rgba(0, 255, 255, 0.2);
    text-shadow: 0 0 10px #0ff;
}

.holographic-btn.large {
    padding: 15px 40px;
    font-size: 18px;
}

/* Start Screen */
#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(ellipse at center, #0a1a2a 0%, #000 100%);
    z-index: 1000;
    transition: opacity 1s ease;
}

#start-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

#start-screen h1 {
    font-size: 64px;
    color: #0ff;
    text-shadow: 0 0 20px #0ff, 0 0 40px #0ff, 0 0 60px #00f;
    letter-spacing: 10px;
    animation: flicker 3s infinite;
}

.subtitle {
    font-size: 24px;
    color: #88f;
    margin-bottom: 40px;
    letter-spacing: 5px;
}

.controls-hint {
    margin-top: 30px;
    text-align: center;
    color: #668;
    font-size: 14px;
}

.controls-hint p {
    margin: 5px 0;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    5% { opacity: 0.8; }
    10% { opacity: 1; }
    15% { opacity: 0.9; }
    20% { opacity: 1; }
    50% { opacity: 1; }
    52% { opacity: 0.7; }
    54% { opacity: 1; }
    70% { opacity: 1; }
    72% { opacity: 0.6; }
    74% { opacity: 1; }
}

/* HUD */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

#hud.hidden {
    display: none;
}

/* Top Bar */
#top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: linear-gradient(180deg, rgba(0, 20, 40, 0.8) 0%, transparent 100%);
    pointer-events: auto;
}

#player-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 18px;
}

#player-name {
    color: #fff;
    text-shadow: 0 0 10px #0ff;
}

#player-rank {
    background: linear-gradient(135deg, #333, #111);
    border: 2px solid #666;
    padding: 5px 15px;
    border-radius: 5px;
    font-weight: bold;
    color: #aaa;
}

#player-rank.rank-S { border-color: #f0f; color: #f0f; box-shadow: 0 0 15px #f0f; }
#player-rank.rank-A { border-color: #f00; color: #f00; box-shadow: 0 0 15px #f00; }
#player-rank.rank-B { border-color: #f90; color: #f90; box-shadow: 0 0 15px #f90; }
#player-rank.rank-C { border-color: #ff0; color: #ff0; box-shadow: 0 0 15px #ff0; }
#player-rank.rank-D { border-color: #0f0; color: #0f0; box-shadow: 0 0 15px #0f0; }
#player-rank.rank-E { border-color: #0ff; color: #0ff; box-shadow: 0 0 15px #0ff; }

#player-level {
    color: #0ff;
    font-weight: bold;
}

#xp-bar-container {
    flex: 1;
    max-width: 400px;
    margin: 0 30px;
    position: relative;
}

#xp-bar-fill {
    height: 20px;
    background: linear-gradient(90deg, #006, #00a);
    border: 1px solid #0ff;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

#xp-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

#xp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    color: #fff;
    text-shadow: 0 0 5px #000;
}

#currency {
    font-size: 20px;
    color: #fd0;
    text-shadow: 0 0 10px #fd0;
}

/* Vitals Container */
#vitals-container {
    position: absolute;
    bottom: 30px;
    left: 30px;
    width: 250px;
    pointer-events: auto;
}

#health-container, #energy-container {
    margin-bottom: 10px;
    position: relative;
}

#health-bar-fill, #energy-bar-fill {
    height: 25px;
    border: 2px solid;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

#health-bar-fill {
    background: linear-gradient(90deg, #600, #c00);
    border-color: #f00;
    box-shadow: 0 0 10px #f00;
}

#energy-bar-fill {
    background: linear-gradient(90deg, #006, #00c);
    border-color: #0ff;
    box-shadow: 0 0 10px #0ff;
}

#health-text, #energy-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 0 5px #000;
}

/* Panels */
.panel, .module-panel {
    position: absolute;
    background: linear-gradient(135deg, rgba(0, 20, 40, 0.95), rgba(0, 10, 20, 0.98));
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 15px;
    padding: 20px;
    pointer-events: auto;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.2), inset 0 0 30px rgba(0, 255, 255, 0.05);
    max-height: 80vh;
    overflow-y: auto;
}

.panel.hidden, .module-panel.hidden {
    display: none;
}

.panel h3, .module-panel h3 {
    color: #0ff;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 0 10px #0ff;
    letter-spacing: 3px;
}

#stats-panel {
    top: 100px;
    right: 30px;
    width: 280px;
}

.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(0, 50, 80, 0.3);
    border-radius: 5px;
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.stat-row input {
    width: 60px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #0ff;
    color: #0ff;
    text-align: center;
    padding: 5px;
    font-size: 14px;
}

.stat-plus {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #066, #044);
    border: 1px solid #0ff;
    color: #0ff;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
}

.stat-plus:hover {
    background: linear-gradient(135deg, #088, #066);
    box-shadow: 0 0 15px #0ff;
}

#stat-points {
    text-align: center;
    margin: 15px 0;
    color: #fd0;
    font-size: 16px;
}

/* Module Panels */
.module-panel {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    max-width: 90vw;
}

.module-panel h3 {
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    padding-bottom: 10px;
}

.module-panel .holographic-btn {
    margin-top: 10px;
    width: 100%;
}

/* Quest/Habit/Task Items */
.quest-item, .habit-item, .goal-item, .task-item, .workout-item, .achievement-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(0, 30, 50, 0.5);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.quest-item:hover, .habit-item:hover, .goal-item:hover, .task-item:hover, .workout-item:hover, .achievement-item:hover {
    background: rgba(0, 50, 80, 0.6);
    border-color: #0ff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.quest-item.completed, .habit-item.completed, .task-item.completed {
    opacity: 0.5;
    border-color: #0f0;
}

.quest-reward {
    font-size: 12px;
    color: #fd0;
    margin-top: 4px;
}

.streak-counter {
    color: #f60;
    font-weight: bold;
}

/* Focus Timer */
#timer-display {
    font-size: 72px;
    text-align: center;
    color: #0ff;
    text-shadow: 0 0 20px #0ff, 0 0 40px #00f;
    font-family: 'Courier New', monospace;
    margin: 20px 0;
}

#timer-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

#timer-presets {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 15px 0;
}

.timer-preset {
    padding: 8px 15px;
    background: rgba(0, 50, 80, 0.5);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #0ff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timer-preset:hover, .timer-preset.active {
    background: rgba(0, 100, 150, 0.6);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
}

/* Breathe Exercise */
#breathe-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 3px solid rgba(0, 255, 255, 0.5);
    margin: 30px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: breathe-expand 16s infinite;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.2), transparent);
}

@keyframes breathe-expand {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    25% { transform: scale(1.5); opacity: 0.8; }
    50% { transform: scale(1.5); opacity: 0.8; }
    75% { transform: scale(1); opacity: 0.5; }
}

#breathe-instruction {
    text-align: center;
    font-size: 24px;
    color: #0ff;
    text-shadow: 0 0 10px #0ff;
}

/* Statistics Dashboard */
#stats-dashboard {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-card {
    background: rgba(0, 30, 50, 0.5);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.stat-card h4 {
    color: #88f;
    font-size: 14px;
    margin-bottom: 10px;
}

.stat-card span {
    font-size: 28px;
    color: #0ff;
    text-shadow: 0 0 10px #0ff;
}

/* Radial Menu */
#radial-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: auto;
}

#radial-menu.hidden {
    display: none;
}

.radial-item {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 50, 80, 0.8), rgba(0, 20, 40, 0.9));
    border: 2px solid rgba(0, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
}

.radial-item:hover {
    background: linear-gradient(135deg, rgba(0, 100, 150, 0.9), rgba(0, 50, 80, 0.95));
    border-color: #0ff;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
    transform: scale(1.2);
}

.radial-icon {
    font-size: 24px;
}

.radial-label {
    font-size: 10px;
    color: #0ff;
    margin-top: 2px;
}

.radial-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 30, 50, 0.9), rgba(0, 10, 20, 0.95));
    border: 3px solid rgba(0, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 12px;
    color: #0ff;
    text-shadow: 0 0 10px #0ff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3), inset 0 0 20px rgba(0, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.radial-center:hover {
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.5), inset 0 0 30px rgba(0, 255, 255, 0.2);
}

.radial-center:active {
    transform: translate(-50%, -50%) scale(0.95);
}

/* Gesture Indicator */
#gesture-indicator {
    position: absolute;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    background: rgba(0, 20, 40, 0.8);
    border: 2px solid rgba(0, 255, 255, 0.5);
    border-radius: 10px;
    font-size: 16px;
    color: #0ff;
    text-shadow: 0 0 10px #0ff;
    backdrop-filter: blur(5px);
}

/* Notifications */
#notifications {
    position: absolute;
    top: 100px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(0, 50, 80, 0.95), rgba(0, 20, 40, 0.98));
    border: 2px solid rgba(0, 255, 255, 0.5);
    border-radius: 10px;
    color: #0ff;
    text-shadow: 0 0 10px #0ff;
    animation: slideIn 0.3s ease, fadeOut 0.5s ease 2.5s forwards;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateX(100%); }
}

.notification.success {
    border-color: #0f0;
    color: #0f0;
    text-shadow: 0 0 10px #0f0;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.notification.levelup {
    border-color: #f0f;
    color: #f0f;
    text-shadow: 0 0 10px #f0f;
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.5);
    font-size: 18px;
}

/* Level Up Overlay */
#level-up-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    pointer-events: auto;
}

#level-up-overlay.hidden {
    display: none;
}

#level-up-overlay h1 {
    font-size: 72px;
    color: #f0f;
    text-shadow: 0 0 20px #f0f, 0 0 40px #f0f, 0 0 60px #f0f;
    animation: pulse 0.5s infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

#level-up-overlay p {
    font-size: 24px;
    color: #0ff;
    text-shadow: 0 0 10px #0ff;
    margin: 10px 0;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1500;
}

.modal {
    background: linear-gradient(135deg, rgba(0, 30, 50, 0.98), rgba(0, 10, 20, 0.99));
    border: 2px solid rgba(0, 255, 255, 0.5);
    border-radius: 15px;
    padding: 25px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

.modal h3 {
    color: #0ff;
    margin-bottom: 20px;
    text-align: center;
}

.modal input, .modal textarea, .modal select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    background: rgba(0, 20, 40, 0.8);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
}

.modal input:focus, .modal textarea:focus, .modal select:focus {
    outline: none;
    border-color: #0ff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 20, 40, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 255, 0.5);
}

/* Power Mode Effect */
body.power-mode #scene-container {
    filter: brightness(1.3) contrast(1.2);
}

body.power-mode #hud {
    animation: power-flicker 0.1s infinite;
}

@keyframes power-flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.95; }
}

/* Responsive */
@media (max-width: 768px) {
    #stats-panel {
        right: 10px;
        left: 10px;
        width: auto;
    }

    .module-panel {
        width: 95vw;
    }

    #top-bar {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    #xp-bar-container {
        max-width: 100%;
    }
}
