body {
    margin: 0;
    overflow: hidden;
    background-color: #000;
    color: white;
    font-family: sans-serif;
    cursor: grab;
}

body:active {
    cursor: grabbing;
}

canvas {
    display: block;
}

#info {
    position: absolute;
    top: 10px;
    width: 100%;
    text-align: center;
    z-index: 100;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 0;
    pointer-events: none;
}

#progress-bar-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    min-width: 150px;
    max-width: 400px;
    background-color: rgba(50, 50, 50, 0.8);
    border-radius: 5px;
    padding: 8px 15px;
    z-index: 101;
    text-align: center;
    display: none;
}

#progress-text {
    display: block;
    color: #fff;
    font-weight: bold;
}

#selected-info {
     color: lightgreen;
     font-weight: bold;
     min-height: 1.2em;
}

.annotation-popup {
    position: fixed;
    background: rgba(30,30,30,0.95);
    color: #fff;
    padding: 6px 8px 8px 8px;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    font-size: 1.1em;
    white-space: pre-line;
    pointer-events: auto;
    z-index: 3000;
    transition: opacity 0.2s;
    max-width: 320px;
    overflow: hidden;
    box-sizing: border-box;
}

.annotation-popup button,
.sound-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #fff;
    border: none;
    font-size: 1.3em;
    cursor: pointer;
    border-radius: 50%;
    padding: 4px 12px;
    transition: background 0.15s;
    z-index: 3001;
}

.annotation-popup button:active,
.annotation-popup button:focus,
.sound-btn:active,
.sound-btn:focus {
    background: rgba(255,255,255,0.08);
    outline: none;
}

.annotation-popup img {
    display: block;
    max-width: 240px;
    margin: 16px auto 0 auto;
    border-radius: 8px;
    cursor: zoom-in;
}

.annotation-popup img,
.annotation-popup video {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    display: block;
    margin: 12px auto 0 auto;
}

.photo-enlarged-backdrop {
    position: fixed;
    left: 0; top: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.7);
    z-index: 4000;
}

.photo-enlarged-wrapper {
    position: fixed;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 90vh;
    z-index: 5000;
    background: #fff;
    box-shadow: 0 8px 32px rgba(0,0,0,0.7);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.enlarged-photo {
    position: static;
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    cursor: zoom-out;
    background: #fff;
}

.enlarged-photo {
    transition: all 0.2s;
}

.sound-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    cursor: pointer;
    background: transparent;
    border: none;
    color: #fff;
    padding: 4px 12px;
    border-radius: 50%;
    transition: background 0.15s;
}

.sound-btn:active,
.sound-btn:focus {
    background: rgba(255,255,255,0.08);
    outline: none;
}

#preview-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    padding: 8px 0;
    gap: 12px;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

@media (max-width: 600px) {
    #preview-bar {
        padding-bottom: env(safe-area-inset-bottom, 8px);
    }
    .annotation-popup img,
    .annotation-popup video {
        max-height: 40vh;
    }
}