/* --- CSS Reset & Basic Styles --- */
:root {
    --primary-color: #ff9800;
    --secondary-color: #4caf50;
    --background-color: #fffde7;
    --text-color: #5d4037;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    user-select: none; 
    -webkit-tap-highlight-color: transparent; 
}

html, body {
    width: 100%; 
    height: 100dvh; 
    overflow: hidden;
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    background-color: #f0f0f0; 
    color: var(--text-color);
}

#game-container {
    position: relative; 
    width: 100%; 
    height: 100%; 
    max-width: 500px; 
    margin: 0 auto;
    background-color: var(--background-color); 
    overflow: hidden; 
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* --- Screens --- */
.screen {
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    display: flex;
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    padding: 20px;
    text-align: center; 
    opacity: 1; 
    visibility: visible; 
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.screen.hidden { 
    opacity: 0; 
    visibility: hidden; 
    pointer-events: none; 
}

h1 { font-size: 2rem; color: var(--primary-color); margin-bottom: 20px; }
h2 { font-size: 1.8rem; margin-bottom: 10px; }
p { line-height: 1.6; }

/* --- Top & Mission Intro Screen --- */
.intro-icon { font-size: 80px; margin-bottom: 20px; }
.intro-box { background: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.intro-box h3 { font-size: 1.5rem; color: var(--primary-color); margin-bottom: 10px; }

/* --- Mission Screen --- */
#screen-mission { padding: 0; background-color: #000; justify-content: flex-start; }
#camera-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
#camera-view { width: 100%; height: 100%; object-fit: cover; }
#camera-overlay {
    position: relative; 
    width: 100%; 
    height: 100%; 
    display: flex; 
    flex-direction: column;
    justify-content: space-between; 
    align-items: center; 
    padding: 20px;
}
.mission-header { width: 100%; background: rgba(0,0,0,0.5); color: #fff; padding: 10px; border-radius: 10px; }
.mission-footer { width: 100%; text-align: center; }
.countdown, .stopwatch { font-weight: bold; color: #fff; text-shadow: 0 0 10px rgba(0,0,0,0.7); }
.countdown { font-size: 5rem; }
.stopwatch { font-size: 3rem; background: rgba(0,0,0,0.5); padding: 5px 15px; border-radius: 10px; }

/* --- Result Screen --- */
#screen-result { justify-content: flex-start; padding-top: 30px; }
#result-photo-container {
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
    width: 100%;
    height: calc(100% - 210px);
    overflow-y: auto; 
    padding: 0 10px 15px 10px;
}
.result-item {
    background: #fff; 
    border-radius: 12px; 
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
    width: 100%; 
    flex-shrink: 0;
}
.result-item h3 { font-size: 1rem; color: var(--primary-color); margin-bottom: 5px; text-align: left; }
.result-photo-wrapper { width: 100%; aspect-ratio: 4 / 3; background-color: #eee; border-radius: 8px; overflow: hidden; }
.result-photo-wrapper img { width: 100%; height: 100%; object-fit: cover; }

#result-footer {
    position: absolute; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    padding: 15px;
    background: var(--background-color); 
    border-top: 1px solid #eee;
}

/* --- Buttons --- */
.btn {
    display: inline-block; 
    padding: 12px 28px; 
    font-size: 1.1rem; 
    font-weight: bold;
    text-decoration: none; 
    border-radius: 50px; 
    cursor: pointer; 
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); 
    transition: transform 0.1s ease; 
    margin-top: 20px;
}
.btn:active { transform: translateY(2px); }
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-secondary { background-color: var(--secondary-color); color: white; }
.btn-shutter { width: 70px; height: 70px; border-radius: 50%; border: 5px solid #fff; background-color: rgba(255, 255, 255, 0.3); }
.btn-sound { width: 60px; height: 60px; font-size: 1.8rem; margin-top: 15px; }

/* --- Share Buttons --- */
.share-buttons { margin-top: 15px; }
.share-buttons p { font-size: 0.9rem; margin-bottom: 10px; }
.share-buttons-container { display: flex; justify-content: center; align-items: center; gap: 20px; }
.btn-share {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    border: 1px solid #ddd;
}
.btn-share img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}