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

body {
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: #808080;
    position: relative;
}

/* Noise pattern background */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    pointer-events: none;
}

#deck {
    width: 100%;
    height: 100%;
    position: relative;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    will-change: transform;
}

/* Blurred & dimmed full-cover background */
.bg-blur {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(30px) brightness(90%);
    z-index: 0;
}

/* Foreground image fitting the window */
.inner {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    touch-action: none;
}

/* Bottom left sample ID */
#sample-id {
    position: fixed;
    bottom: 20px;
    left: 20px;
    color: #ffffff;
    font-size: 12px;
    user-select: none;
    z-index: 10;
}

/* Bottom right controls container */
#controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    z-index: 10;
}

/* Language flag button */
#lang-toggle {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: opacity 0.2s;
}

#lang-toggle:hover {
    opacity: 0.7;
}

/* Button container */
#buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.1);
    padding: 16px 12px 12px 12px;
    border-radius: 8px;
}

/* Play and Next buttons */
.btn {
    width: 70px;
    height: 70px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.7;
}

.btn:active {
    opacity: 0.5;
}

/* Button images */
.btn img {
    width: 45px;
    height: 45px;
    filter: brightness(0);
}

/* Loading state */
#loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 18px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.hidden {
    display: none;
}

/* Mobile styles - target phones and tablets with touch screens */
@media (max-width: 1024px), ((hover: none) and (pointer: coarse)) {
    #play-btn, #next-btn {
        display: none !important;
    }

    /* Prevent overscroll/bounce on iOS */
    body {
        overscroll-behavior-y: none;
    }

    /* Make image draggable */
    .image {
        touch-action: none;
    }
}
