/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    font-weight: 600;
    min-height: clamp(56px, 8vh, 80px);
    padding: 0.75em 2em;
    border-radius: var(--border-radius);
    transition: transform var(--transition-speed), opacity var(--transition-speed), box-shadow var(--transition-speed);
    user-select: none;
    -webkit-user-select: none;
    text-align: center;
}

.btn:active {
    transform: scale(0.96);
}

.btn--primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 4px 20px rgba(255, 45, 120, 0.3);
}

.btn--primary:active {
    box-shadow: 0 2px 10px rgba(255, 45, 120, 0.4);
}

.btn--secondary {
    background: var(--color-secondary);
    color: var(--color-text);
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.btn--accent {
    background: var(--color-accent);
    color: #1A1A2E;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
}

.btn--ghost {
    background: transparent;
    color: var(--color-text);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn--large {
    font-size: clamp(1.25rem, 3.5vw, 2rem);
    min-height: clamp(70px, 12vh, 120px);
    padding: 1em 2.5em;
    min-width: clamp(200px, 40vw, 350px);
}

.btn--icon {
    min-height: 48px;
    min-width: 48px;
    padding: 0.5em;
    border-radius: 50%;
    font-size: 1.5rem;
}

/* Viewfinder */
.viewfinder {
    position: relative;
    width: min(100%, 960px);
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--border-radius);
    background: #000;
}

.viewfinder video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.viewfinder.mirrored video {
    transform: scaleX(-1);
}

.viewfinder__controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 5;
}

/* Countdown overlay */
.countdown {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

.countdown__number {
    font-size: clamp(6rem, 20vw, 14rem);
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 40px rgba(0, 0, 0, 0.6), 0 0 80px rgba(0, 0, 0, 0.3);
    opacity: 0;
}

/* Photo counter for strip mode */
.photo-counter {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 0.5em 1em;
    border-radius: var(--border-radius);
    font-size: clamp(0.875rem, 2vw, 1.25rem);
    font-weight: 600;
    z-index: 5;
}

/* Flash overlay */
.flash-overlay {
    position: fixed;
    inset: 0;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    z-index: 100;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    z-index: 90;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Error toast */
.error-toast {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%) translateY(-120%);
    background: #e74c3c;
    color: #fff;
    padding: 1em 2em;
    border-radius: var(--border-radius);
    font-weight: 600;
    z-index: 200;
    transition: transform 0.3s ease;
    max-width: 90vw;
    text-align: center;
}

.error-toast.visible {
    transform: translateX(-50%) translateY(0);
}

/* QR container */
.qr-container {
    background: #fff;
    padding: clamp(1rem, 3vw, 2rem);
    border-radius: var(--border-radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.qr-container canvas,
.qr-container img {
    width: clamp(180px, 30vw, 280px) !important;
    height: clamp(180px, 30vw, 280px) !important;
}

/* Review image */
.review-image {
    width: min(100%, 600px);
    max-height: 60vh;
    object-fit: contain;
    border-radius: var(--border-radius);
}

/* Key hints on buttons */
.key-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.7em;
    font-weight: 700;
    min-width: 1.8em;
    height: 1.8em;
    padding: 0 0.4em;
    border-radius: 5px;
    margin-right: 0.5em;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-family: monospace;
    vertical-align: middle;
    line-height: 1;
}

/* Logo */
.event-logo {
    width: clamp(80px, 15vw, 160px);
    height: auto;
    object-fit: contain;
}

/* Camera permission screen */
.permission-help {
    text-align: center;
    max-width: 500px;
}

.permission-help p {
    margin-bottom: 1rem;
    opacity: 0.8;
}
