﻿:root {
    --bg: #f9f9f9;
    --ink: #222;
    --accent: #2ecc71;
    --danger: #e74c3c;
    --border: #ccc;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--ink);
}

/* ---------------- Screens ---------------- */

.screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    animation: fadeIn 0.4s ease;
}

.hidden {
    display: none;
}

/* ---------------- Box ---------------- */

.box {
    max-width: 720px;
    width: 100%;
    background: white;
    border: 2px solid var(--border);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 6px 16px #00000015;
    text-align: center;
}

h1, h2 {
    margin-bottom: 12px;
}

/* ---------------- Options ---------------- */

.options {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.layout-btn {
    padding: 10px 16px;
    border: 2px solid var(--ink);
    background: white;
    cursor: pointer;
    border-radius: 6px;
}

    .layout-btn.active {
        background: var(--accent);
        color: white;
        border-color: var(--accent);
    }

/* ---------------- Camera Frame ---------------- */

.frame {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 2px solid var(--ink);
    margin-bottom: 20px;
    background: #000;
    overflow: hidden;
}

video,
canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---------------- Overlay ---------------- */

#overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    pointer-events: none;
}

    #overlay .btn {
        pointer-events: auto;
    }

/* ---------------- Countdown ---------------- */

.countdown {
    width: 72px;
    height: 72px;
    border: 3px solid var(--ink);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    font-weight: bold;
    background: white;
    visibility: hidden;
}

/* ---------------- Buttons ---------------- */

.btn {
    padding: 10px 16px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    border-radius: 6px;
}

    .btn.primary {
        background: var(--accent);
        color: white;
    }

    .btn.danger {
        background: var(--danger);
        color: white;
    }

/* ---------------- Result Image ---------------- */

.result {
    display: block;
    margin: 0 auto 12px;
    width: 140px;
    height: auto;
    border: 4px solid #000;
    background: #fff;
    box-shadow: 0 0 8px #00000030;
}

/* ---------------- Footer ---------------- */

.tip {
    font-size: 12px;
    color: #666;
}

.actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---------------- Animations ---------------- */

.flash {
    animation: flashEffect 0.35s ease;
}

@keyframes flashEffect {
    0% {
        background-color: rgba(255, 255, 255, 0.9);
    }

    100% {
        background-color: transparent;
    }
}

.capture-anim {
    animation: captureZoom 0.25s ease;
}

@keyframes captureZoom {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.04);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ---------------- PRINT (ONE PAGE ONLY) ---------------- */

@media print {
    body {
        margin: 0;
        padding: 0;
        background: white;
    }

    * {
        page-break-before: avoid !important;
        page-break-after: avoid !important;
        page-break-inside: avoid !important;
    }

    .screen,
    .box {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    #delivery {
        display: block !important;
    }

    .result {
        width: 140px;
        margin: 0 auto;
        border: 4px solid #000;
    }

    .actions,
    .tip,
    h2 {
        display: none !important;
    }
}
canvas {
    display: none;
}
/* ================= Capture Animations ================= */

/* Flash */
.flash {
    animation: flashAnim 0.35s ease;
}

@keyframes flashAnim {
    0% {
        background: rgba(255,255,255,0.9);
    }

    100% {
        background: rgba(255,255,255,0);
    }
}

/* Camera shake */
.shake {
    animation: shakeAnim 0.25s ease;
}

@keyframes shakeAnim {
    0% {
        transform: translate(0);
    }

    25% {
        transform: translate(-4px, 2px);
    }

    50% {
        transform: translate(4px, -2px);
    }

    75% {
        transform: translate(-3px, 1px);
    }

    100% {
        transform: translate(0);
    }
}

/* Snapshot pop */
.snapshot {
    animation: snapAnim 0.4s ease;
}

@keyframes snapAnim {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    40% {
        transform: scale(1.1);
        opacity: 0.8;
    }

    100% {
        transform: scale(0.95);
        opacity: 0;
    }
}
#intro {
    background: url("images/2.gif") no-repeat center center fixed;
   background-size: cover;
    /* min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;*/
}

/*#delivery, #booth {
    background-color: red;
    background-size: cover;
}*/
