:root {
    --bg-color: #0b0f19;
    --primary: #8a2be2;
    --primary-glow: rgba(138, 43, 226, 0.5);
    --secondary: #ff007f;
    --text-main: #ffffff;
    --text-muted: #a0aabf;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    background: radial-gradient(circle at 50% 50%, #1a1a2e 0%, #0d0d16 100%);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Fun Background Elements */
body::before, body::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    animation: float 10s infinite alternate ease-in-out;
}

body::before {
    background: var(--primary);
    top: -50px;
    left: -50px;
}

body::after {
    background: var(--secondary);
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(100px, 50px); }
}

.app-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 10;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    width: 90%;
    max-width: 550px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.highlight {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 3rem;
}

p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Inputs */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.task-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.task-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* Buttons */
button {
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
    width: 100%;
    box-shadow: 0 5px 15px rgba(138, 43, 226, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 0, 127, 0.4);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Physics Container */
#physics-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#matter-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#dom-balls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* DOM Balls representing tasks */
.dom-ball {
    position: absolute;
    background: radial-gradient(circle at 30% 30%, #ffffff, #e0e0e0);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: inset -5px -5px 15px rgba(0, 0, 0, 0.3), 5px 5px 15px rgba(0, 0, 0, 0.5);
    color: #111;
    font-weight: 800;
    font-size: 0.8rem;
    padding: 10px;
    line-height: 1.1;
    /* Transformation updated by JS */
    transform-origin: center center;
    pointer-events: auto;
    cursor: grab;
    will-change: transform;
}

.dom-ball.default-task {
    background: radial-gradient(circle at 30% 30%, #ffd700, #ff8c00);
    box-shadow: inset -5px -5px 15px rgba(255, 140, 0, 0.5), 5px 5px 15px rgba(0, 0, 0, 0.5);
}

/* Result Screen */
.result-display {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--primary);
    border-radius: 16px;
    padding: 2rem;
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 2rem;
    text-shadow: 0 0 10px var(--primary-glow);
    animation: pulse-glow 2s infinite alternate;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Animations */
@keyframes pulse-glow {
    from { box-shadow: 0 0 10px var(--primary-glow); border-color: var(--primary); }
    to { box-shadow: 0 0 30px rgba(255, 0, 127, 0.6); border-color: var(--secondary); }
}

.scale-in {
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
