:root {
    --primary-color: #8b5cf6;
    /* Violet */
    --secondary-color: #a78bfa;
    --accent-color: #facc15;
    --background-color: #f5f3ff;
    --text-color: #4c1d95;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#game-container {
    width: 100%;
    max-width: 800px;
    height: 100vh;
    max-height: 600px;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

#game-header {
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    color: white;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.game-title {
    font-size: 1.5rem;
    font-weight: bold;
}

.icon-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    margin-left: 10px;
}

.icon-btn:hover {
    opacity: 0.8;
}

.hidden {
    display: none !important;
}

#game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background-color: #f5f3ff;
    gap: 20px;
}

.canvas-container {
    flex: 2;
    background: white;
    border: 2px solid #ddd;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    cursor: crosshair;
}

.frame-editor {
    width: 100%;
    height: 100%;
    position: relative;
}

.ball {
    font-size: 3rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    user-select: none;
}

.ball:active {
    cursor: grabbing;
}

.timeline {
    height: 100px;
    background: #ddd6fe;
    border-radius: 10px;
    display: flex;
    align-items: center;
    padding: 10px;
    gap: 10px;
    overflow-x: auto;
}

.timeline-frames {
    display: flex;
    gap: 10px;
}

.frame-thumb {
    width: 60px;
    height: 60px;
    background: white;
    border: 2px solid #8b5cf6;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    cursor: pointer;
}

.frame-thumb.active {
    background: #8b5cf6;
    color: white;
}

.add-frame-btn {
    width: 60px;
    height: 60px;
    background: #22c55e;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 2rem;
    cursor: pointer;
    flex-shrink: 0;
}

.controls {
    text-align: center;
    color: #6d28d9;
}