html, body {
    margin: 0;
    height: 100%;
    background: #000;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    font-family: system-ui, sans-serif;
}

#stage { position: fixed; inset: 0; }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* Level 1 */
.circle { position: absolute; border-radius: 50%; background: #fff; }

/* Levels 2-7 */
.grid {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template: 1fr 1fr / 1fr 1fr;
    gap: 10px;
    padding: 10px;
    box-sizing: border-box;
}
.panel { position: relative; overflow: hidden; border-radius: 18px; background: #1c1c1c; }
.panel.has-target { background: #f4f4f4; }
.panel img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    -webkit-user-drag: none;
}
.panel img.fill { object-fit: cover; }
.panel img.target { object-fit: contain; padding: 4%; box-sizing: border-box; }
/* Actor standing in a scene: height and left set per round by app.js */
.panel img.overlay {
    inset: auto;
    bottom: 3%;
    width: auto;
    max-width: 90%;
    object-fit: contain;
    transform: translateX(-50%);
    filter: drop-shadow(0 4px 4px #0006);
}

/* Miss feedback */
.sparkle { position: fixed; width: 0; height: 0; pointer-events: none; }
.sparkle i {
    position: absolute;
    left: -6px;
    top: -6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff2a2a;
    box-shadow: 0 0 8px #ff2a2a;
    animation: sparkle 450ms ease-out forwards;
}
@keyframes sparkle {
    from { transform: rotate(var(--angle)) translateX(0) scale(1); opacity: 1; }
    to { transform: rotate(var(--angle)) translateX(46px) scale(0.2); opacity: 0; }
}

/* Start / level menu */
#start {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    background: #101820;
    color: #fff;
}
#start[hidden] { display: none; }
#start h1 { margin: 0; font-size: 64px; }
#levels { display: grid; grid-template-columns: repeat(4, 220px); gap: 16px; }
#levels button {
    height: 110px;
    border: 0;
    border-radius: 16px;
    background: #2d6cdf;
    color: #fff;
    font-size: 26px;
    font-weight: 700;
    cursor: pointer;
}
#levels button small { display: block; font-size: 15px; font-weight: 400; opacity: 0.85; }
#start .hint { opacity: 0.6; }

/* Dev overlay (D key with ?dev) */
.debug .panel[data-target="yes"] { outline: 6px dashed #0f0; outline-offset: -6px; }
.debug .circle { outline: 4px dashed #0f0; }
