* { box-sizing: border-box; }

html, body { width: 100%; min-height: 100%; margin: 0; }

body {
    overflow: hidden;
    background: #000;
    color: #eee4ce;
    font-family: Arial, Helvetica, sans-serif;
}

.shadow-stage { position: relative; width: 100%; height: 100vh; height: 100dvh; min-height: 200px; overflow: hidden; background: #000; }

#shadow-canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
#shadow-canvas:focus-visible { outline: 2px solid #f0c675; outline-offset: -5px; }

#tealight-canvas { position: absolute; top: 0; left: 0; pointer-events: none; }
#shadow-status { position: absolute; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); left: 16px; margin: 0; color: #eee4ce; text-align: center; font-size: .85rem; pointer-events: none; }

.shadow-header {
    position: absolute;
    z-index: 1;
    inset: 0 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 66px;
    padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
    pointer-events: none;
}

.shadow-header h1 { margin: 0; color: #a7997c; font-size: clamp(.8rem, 2vw, 1rem); font-weight: 600; letter-spacing: .12em; text-align: center; text-transform: uppercase; }
.back-link { display: inline-flex; align-items: center; gap: 8px; width: fit-content; min-width: 44px; min-height: 44px; color: #d4c4a1; font-size: .9rem; text-decoration: none; pointer-events: auto; }
.back-link:hover { color: #fff0cc; }
.back-link:focus-visible { border-radius: 4px; outline: 2px solid #f0c675; outline-offset: 2px; }
.back-link span:first-child { font-size: 1.5rem; line-height: 1; }

.shadow-hint { position: absolute; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); left: 18px; margin: 0; color: #a99b7b; font-size: clamp(.75rem, 2.5vw, .875rem); letter-spacing: .03em; text-align: center; pointer-events: none; }

@media (max-width: 375px) {
    .back-label { display: none; }
    .shadow-header { grid-template-columns: 44px 1fr 44px; }
    .shadow-header h1 { font-size: .72rem; letter-spacing: .06em; }
}

@media (max-height: 350px) {
    .shadow-hint { display: none; }
}
