:root {
    --orange-dark: #e65100;
    --orange-main: #f57c00;
    --orange-light: #ffb347;
    --yellow-main: #ffca28;
    --red-main: #e53935;
    --blue-main: #1e88e5;
    --green-main: #4caf50;
    --white: #ffffff;
    --text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #ffc107, #f57c00);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    color: var(--white);
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.game-container {
    width: 100%;
    max-width: 480px;
    height: 100%;
    max-height: 850px;
    background-color: #fef9e7;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    border: 8px solid var(--white);
    display: flex;
    flex-direction: column;
}

.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
    transition: opacity 0.5s, transform 0.5s;
}

/* --- Screen Styles --- */
#start-screen { background: linear-gradient(to bottom, #ffcc4d, var(--orange-light)); z-index: 10; }
#camera-screen { background-color: #212121; z-index: 25; }
#how-to-play-screen { background: rgba(0, 0, 0, 0.85); z-index: 20; justify-content: flex-start; padding-top: 50px; }
#game-screen { background-color: #fdf2e9; z-index: 5; padding: 0; }
#result-screen { background: linear-gradient(to bottom, #4fc3f7, #29b6f6); z-index: 15; }

.title-container {
    background-color: var(--red-main);
    color: var(--white);
    padding: 10px 40px;
    border-radius: 30px;
    border: 5px solid var(--white);
    text-shadow: var(--text-shadow);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}
.title { font-size: 32px; font-weight: bold; margin: 0; }
.subtitle { font-size: 16px; margin: 0; }

.btn {
    background-color: var(--red-main);
    color: var(--white);
    border: 3px solid var(--white);
    border-radius: 50px;
    padding: 15px 40px;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    text-shadow: var(--text-shadow);
    box-shadow: 0 5px 10px rgba(0,0,0,0.2);
    transition: transform 0.2s, background-color 0.2s;
    margin: 10px;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.95); }
.btn-secondary { background-color: var(--blue-main); font-size: 18px; }
.btn-camera { background-color: var(--green-main); font-size: 22px; }

/* --- Camera Screen --- */
#camera-preview-container {
    width: 90%;
    padding-top: 90%; /* 1:1 Aspect Ratio */
    position: relative;
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 4px solid var(--white);
}
#camera-video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror view */
}
#camera-screen p { font-size: 14px; max-width: 90%;}

#game-canvas { width: 100%; height: 100%; display: block; cursor: pointer; }

#result-screen h2 { font-size: 48px; margin-bottom: 20px; color: var(--yellow-main); text-shadow: var(--text-shadow); }
.score-display { background: rgba(255,255,255,0.2); padding: 15px; border-radius: 15px; margin: 8px 0; width: 80%; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.score-display h3 { margin: 0 0 5px 0; font-size: 20px; font-weight: normal; }
.score-display p { margin: 0; font-size: 36px; font-weight: bold; color: var(--yellow-main); }

.hidden { opacity: 0; transform: scale(0.9); pointer-events: none; }