:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #22c55e;
    --primary-hover: #16a34a;
    --success: #10b981;
    --danger: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; touch-action: manipulation; user-select: none; }

.new-game-wrapper {
    background-color: var(--bg-color); color: var(--text-main);
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; overflow: hidden;
}

#game-container {
    width: 100%; max-width: 500px; background-color: var(--card-bg);
    border-radius: 16px; padding: 16px; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    position: relative;
    min-height: 650px;
    display: flex; flex-direction: column;
}

.screen { display: none; flex-direction: column; align-items: center; text-align: center; animation: fadeIn 0.3s; flex: 1; justify-content: center; }
.screen.active { display: flex; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.game-title { font-size: 2.2rem; font-weight: 800; margin-bottom: 16px; color: #86efac; }
.instructions { color: var(--text-muted); margin-bottom: 32px; line-height: 1.6; padding: 0 20px; font-size: 1.1rem; }
.final-score { font-size: 1.8rem; font-weight: 700; color: #86efac; margin-bottom: 24px; }

.btn {
    border: none; padding: 12px 24px; border-radius: 8px; font-size: 1.1rem; font-weight: 700;
    color: white; cursor: pointer; transition: all 0.2s; width: 100%; max-width: 250px;
}
.btn:active { transform: scale(0.95); }
.btn.primary { background-color: var(--primary); }
.btn.primary:hover { background-color: var(--primary-hover); }

.header { display: flex; justify-content: space-between; width: 100%; margin-bottom: 10px; padding-bottom: 12px; border-bottom: 1px solid #334155; font-weight: 700; font-size: 0.95rem; color: #86efac; }

.actions-area { display: flex; justify-content: flex-end; width: 100%; margin-bottom: 5px; }
.btn-sm {
    background: #334155; border: none; color: #fff; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-weight: bold;
}
.btn-sm:active { background: #475569; }

.game-area { width: 100%; flex: 1; display: flex; flex-direction: column; gap: 10px; position: relative; }

.scene-container {
    flex: 1; display: flex; flex-direction: column; position: relative;
    border-radius: 8px; overflow: hidden; border: 2px solid #475569; background: #0f172a;
}
.scene-label {
    position: absolute; top: 0; left: 0; background: rgba(0,0,0,0.7); color: #fff;
    padding: 2px 8px; font-size: 0.8rem; border-bottom-right-radius: 8px; z-index: 10;
}

#scene-bg-catch { position: absolute; top:0; left:0; width:100%; height:100%; z-index: 1; }

.scene {
    width: 100%; height: 100%; position: absolute; top:0; left:0;
    background: linear-gradient(to bottom, #87ceeb 50%, #4ade80 50%); /* Default sky/grass */
    z-index: 5;
    pointer-events: none; /* Only children are clickable, EXCEPT bottom scene where we override */
}

#scene-bottom { pointer-events: auto; } /* Allow clicking elements */
#scene-bottom .obj { cursor: pointer; }
#scene-top .obj { pointer-events: none; }

.obj {
    position: absolute;
    display: flex; justify-content: center; align-items: center;
    /* Extra padding for easier tapping */
    padding: 10px; margin: -10px;
}
.obj:active { transform: scale(1.2); }

/* Circled when found */
.circle-mark {
    position: absolute; border: 3px solid #ef4444; border-radius: 50%;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
    pointer-events: none; z-index: 20;
    animation: pulseCircle 1s;
}
@keyframes pulseCircle { 0% { transform: scale(0.5); opacity: 0;} 100% { transform: scale(1); opacity: 1;} }

.hinted { filter: drop-shadow(0 0 10px yellow); }

.msg-overlay {
    position: absolute; top: 40%; left: 0; width: 100%; text-align: center;
    font-size: 2.5rem; font-weight: 900; color: #10b981; text-shadow: 0 0 15px #000;
    z-index: 50; animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); pointer-events: none;
}
.msg-overlay.hidden { display: none; }
@keyframes popIn { 0% { transform: scale(0); } 100% { transform: scale(1); } }
