* {
    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;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#app {
    width: 100%;
    max-width: 900px;
    height: 90vh;
    max-height: 700px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.screen {
    display: none;
    flex-direction: column;
    height: 100%;
    padding: 30px;
}

.screen.active {
    display: flex;
}

/* Welcome Screen */
.welcome-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.welcome-content h1 {
    font-size: 3.5rem;
    color: #333;
    margin-bottom: 15px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

.welcome-content p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 30px;
}

.hint {
    font-size: 0.9rem !important;
    color: #999 !important;
}

/* Camera Screen */
.camera-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

#video {
    width: 100%;
    max-width: 640px;
    aspect-ratio: 4/3;
    border-radius: 15px;
    background: #000;
    object-fit: cover;
}

#canvas {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 640px;
    aspect-ratio: 4/3;
    border-radius: 15px;
}

.countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 30px rgba(0,0,0,0.8);
    animation: countdownAnim 1s ease-out;
}

@keyframes countdownAnim {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.camera-controls {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Edit Screen */
.edit-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.edit-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.editor-main {
    flex: 1;
    display: flex;
    gap: 20px;
    overflow: hidden;
}

.preview-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#editCanvas {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.edit-tools {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.filter-column {
    width: 200px;
    flex-shrink: 0;
}

.filter-column h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1rem;
}

.filter-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-item {
    padding: 12px 15px;
    border: 2px solid #eee;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    font-size: 0.95rem;
}

.filter-item:hover,
.filter-item.active {
    border-color: #667eea;
    background: #f0f2ff;
    transform: translateX(5px);
}

.edit-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Print Preview */
.print-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.print-container h2 {
    margin-bottom: 20px;
    color: #333;
}

.print-area {
    width: 100%;
    max-width: 600px;
    aspect-ratio: 4/3;
    background: #f5f5f5;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.1);
}

.print-area img {
    max-width: 100%;
    max-height: 100%;
}

.print-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

/* Buttons */
.btn-primary, .btn-secondary, .tool-btn {
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

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

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.tool-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #f0f0f0;
    font-size: 1.3rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-btn:hover {
    background: #e0e0e0;
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
    #app {
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }

    .screen {
        padding: 20px;
    }

    .welcome-content h1 {
        font-size: 2.5rem;
    }

    .editor-main {
        flex-direction: column;
    }

    .filter-column {
        width: 100%;
    }

    .filter-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .filter-item {
        flex-shrink: 0;
        min-width: 120px;
    }

    .camera-controls, .edit-actions, .print-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
    }
}