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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: white;
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    text-align: center;
    color: rgba(255,255,255,0.9);
    font-size: 1.3em;
    margin-bottom: 30px;
}

.workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    margin-bottom: 30px;
}

.candle-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, #f5f5f5, #e0e0e0);
    border-radius: 15px;
    padding: 30px;
    position: relative;
    min-height: 600px;
}

#candleCanvas {
    border-radius: 10px;
    background: transparent;
}

.flame {
    position: absolute;
    width: 20px;
    height: 30px;
    background: radial-gradient(ellipse at center, #fff 0%, #ffcc00 20%, #ff6600 60%, transparent 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: flicker 0.3s infinite alternate;
    filter: blur(1px);
    box-shadow: 0 0 20px #ff6600, 0 0 40px #ff6600;
}

.flame.hidden {
    display: none;
}

@keyframes flicker {
    0% {
        transform: translate(-50%, -50%) scale(1) rotate(-2deg);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -52%) scale(1.05) rotate(2deg);
        opacity: 0.95;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.98) rotate(-1deg);
        opacity: 1;
    }
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
}

.control-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.button-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.btn {
    padding: 12px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn.selected {
    background: #667eea;
    color: white;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    width: 100%;
}

.btn-secondary:hover {
    background: #5a6268;
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.color-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 3px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.color-btn.selected {
    border-color: #667eea;
    border-width: 4px;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #667eea;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar.hidden {
    display: none;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.1s linear;
    border-radius: 15px;
}

.collection {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.collection h3 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5em;
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.collection-item {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.collection-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-color: #667eea;
}

.collection-item canvas {
    width: 100%;
    height: auto;
    border-radius: 5px;
}

.collection-item .scent-label {
    margin-top: 8px;
    font-size: 0.9em;
    color: #666;
}

@media (max-width: 1024px) {
    .workspace {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2em;
    }
}

/* Menu Screen */
.menu-screen {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.game-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.menu-screen .game-card {
    background: linear-gradient(to bottom, #f9f9f9, #f0f0f0);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    border: 3px solid #e0e0e0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.menu-screen .game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    border-color: #667eea;
}

.menu-screen .game-icon {
    font-size: 5em;
    margin-bottom: 20px;
}

.menu-screen .game-card h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.8em;
}

.menu-screen .game-card p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Game Screens */
.game-screen {
    display: block;
}

.game-screen.hidden {
    display: none;
}

.back-btn {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #667eea;
    color: white;
    transform: translateX(-5px);
}

/* T-Shirt Designer */
.tshirt-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, #f5f5f5, #e0e0e0);
    border-radius: 15px;
    padding: 30px;
    position: relative;
    min-height: 600px;
}

#tshirtCanvas {
    border-radius: 10px;
    background: transparent;
}

.graphics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.graphic-btn {
    padding: 15px;
    font-size: 2em;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.graphic-btn:hover {
    transform: scale(1.1);
    border-color: #667eea;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.graphic-btn.selected {
    border-color: #667eea;
    border-width: 3px;
    background: #f0f0ff;
}

.text-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    margin-bottom: 10px;
    transition: border-color 0.3s ease;
}

.text-input:focus {
    outline: none;
    border-color: #667eea;
}

.text-color-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 3px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.text-color-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.text-color-btn.selected {
    border-color: #667eea;
    border-width: 4px;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #667eea;
}

.hidden {
    display: none;
}

/* Plushie Designer */
.plushie-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, #fff5f5, #ffe0e0);
    border-radius: 15px;
    padding: 30px;
    position: relative;
    min-height: 600px;
}

#plushieCanvas {
    border-radius: 10px;
    background: transparent;
}

.animal-btn, .pattern-btn, .eye-btn, .accessory-btn {
    min-width: 120px;
}

/* Mask Designer */
.mask-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, #2d1b4e, #1a0f2e);
    border-radius: 15px;
    padding: 30px;
    position: relative;
    min-height: 600px;
}

#maskCanvas {
    border-radius: 10px;
    background: transparent;
}

.mask-type-btn, .mask-pattern-btn {
    min-width: 100px;
}

.decorations-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.decoration-btn {
    padding: 15px;
    font-size: 2em;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.decoration-btn:hover {
    transform: scale(1.1);
    border-color: #667eea;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.accent-color-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 3px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.accent-color-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.accent-color-btn.selected {
    border-color: #667eea;
    border-width: 4px;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #667eea;
}

/* Concert Poster Designer */
.poster-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 15px;
    padding: 30px;
    position: relative;
    min-height: 800px;
}

#posterCanvas {
    border-radius: 10px;
    background: white;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.poster-style-btn {
    min-width: 140px;
}

@media (max-width: 600px) {
    .button-group {
        grid-template-columns: 1fr;
    }
    
    .color-palette {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .graphics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Puppet Maker Styles */
.puppet-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.puppet-preview-area {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px;
    padding: 40px;
    min-height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.puppet-display {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.puppet-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.puppet-head {
    width: 120px;
    height: 120px;
    background: #FFD700;
    border-radius: 50%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.puppet-head.square {
    border-radius: 20px;
}

.puppet-head.triangle {
    width: 0;
    height: 0;
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    border-bottom: 120px solid #FFD700;
    border-radius: 10px;
    background: transparent;
}

.puppet-head.star {
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    border-radius: 0;
}

.eyes {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}

.eye {
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    border: 2px solid #333;
    position: relative;
    animation: blink 4s infinite;
}

.pupil {
    width: 10px;
    height: 10px;
    background: #333;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: lookAround 3s infinite;
}

@keyframes blink {
    0%, 96%, 100% { height: 20px; }
    98% { height: 2px; }
}

@keyframes lookAround {
    0%, 100% { left: 50%; }
    25% { left: 60%; }
    75% { left: 40%; }
}

.mouth {
    font-size: 30px;
    position: absolute;
    bottom: 15px;
    transition: all 0.3s ease;
}

.accessories {
    position: absolute;
    top: -25px;
    font-size: 40px;
}

.puppet-body {
    width: 100px;
    height: 120px;
    background: #667eea;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.arms {
    position: absolute;
    width: 100%;
    top: 20px;
}

.arm {
    width: 50px;
    height: 12px;
    background: #667eea;
    border-radius: 10px;
    position: absolute;
    transition: all 0.3s ease;
}

.arm.left {
    left: -40px;
    transform-origin: right center;
}

.arm.right {
    right: -40px;
    transform-origin: left center;
}

.hand {
    position: absolute;
    font-size: 20px;
    top: -8px;
}

.arm.left .hand {
    left: -15px;
}

.arm.right .hand {
    right: -15px;
}

.puppet-legs {
    display: flex;
    gap: 15px;
}

.leg {
    width: 18px;
    height: 70px;
    background: #667eea;
    border-radius: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.foot {
    position: absolute;
    bottom: -12px;
    left: -8px;
    font-size: 20px;
}

.puppet-controls {
    max-height: 500px;
    overflow-y: auto;
}

.puppet-controls::-webkit-scrollbar {
    width: 6px;
}

.puppet-controls::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.puppet-controls::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.btn-special {
    width: 100%;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    border: none;
}

.btn-special.talking {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-30deg); }
    75% { transform: rotate(30deg); }
}

@keyframes jump {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-60px); }
}

@keyframes dance {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-10deg) scale(1.05); }
    75% { transform: rotate(10deg) scale(1.05); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
