:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #a855f7;
    --primary-hover: #9333ea;
    --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: 600px;
    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: #d8b4fe; }
.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: #d8b4fe; 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: 1.1rem; color: #d8b4fe; }

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

.game-area { width: 100%; height: 350px; position: relative; border-radius: 8px; overflow: hidden; background: #0f172a; border: 2px solid #475569; }

#room-bg { position: absolute; top:0; left:0; width:100%; height:100%; z-index: 1; background: linear-gradient(135deg, #1e293b, #0f172a); }

#room-scene {
    width: 100%; height: 100%;
    position: absolute; top:0; left:0;
    z-index: 5;
}

.obj {
    position: absolute;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex; justify-content: center; align-items: center;
    /* Make hit area slightly larger than visual for easy tapping */
    padding: 10px;
    margin: -10px;
}
.obj:active { transform: scale(1.5); }

/* Hint animation */
@keyframes hintPulse { 0% { filter: drop-shadow(0 0 5px yellow); } 50% { filter: drop-shadow(0 0 20px yellow); transform: scale(1.2); } 100% { filter: drop-shadow(0 0 5px yellow); } }
.hinted { animation: hintPulse 1s infinite; z-index: 10;}

.list-area { width: 100%; margin-top: 15px; background: #0f172a; padding: 10px; border-radius: 8px; border: 1px solid #334155; }
.list-title { font-size: 0.9rem; color: #94a3b8; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; text-align: left;}
#target-list { display: flex; flex-wrap: wrap; gap: 10px; min-height: 40px; }
.target-item { 
    background: #1e293b; padding: 5px 15px; border-radius: 6px; 
    font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
    border: 1px solid #334155;
    transition: opacity 0.3s;
}
.target-item.found { opacity: 0.3; text-decoration: line-through; border-color: #10b981;}

.msg-overlay {
    position: absolute; top: 40%; left: 0; width: 100%; text-align: center;
    font-size: 3rem; 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); } }
