/* «Camera oscura» (VG-305). Un mondo solo, scuro come l'album. La pagina non
   scorre mai: occupa l'altezza dello schermo, e lo swipe ovunque guida il
   fotografo (anche col pollice sotto il campo). I pulsanti restano toccabili. */
:root {
	--dr-ink: #0d0d0d;
	--dr-panel: #161515;
	--dr-line: #2c2a2a;
	--dr-fg: #f2efee;
	--dr-mute: #9a9494;
	--dr-red: #d3263a;
	color-scheme: dark;
}
html, body {
	height: 100%;
	margin: 0;
	box-sizing: border-box;
	overflow: hidden;
	overscroll-behavior: none;
	background: var(--dr-ink);
	color: var(--dr-fg);
}
body {
	padding: max(12px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom));
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
	-webkit-tap-highlight-color: transparent;
}
button, a { touch-action: manipulation; }
[hidden] { display: none !important; }

.dr-wrap { max-width: 440px; height: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.dr-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dr-top h1 { margin: 0; font-size: clamp(20px, 6.2vw, 26px); white-space: nowrap; font-weight: 400; font-style: italic; letter-spacing: .01em; }
.dr-back { color: var(--dr-fg); text-decoration: none; font-size: 22px; line-height: 1; padding: 4px 8px 4px 0; }
.dr-lvl { flex: 1; min-width: 0; white-space: nowrap; font-size: 13px; color: var(--dr-mute); font-variant-numeric: tabular-nums; }

.dr-hud { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--dr-mute); font-variant-numeric: tabular-nums; }
.dr-hud b { color: var(--dr-fg); font-weight: 600; }
.dr-snd { font: inherit; font-size: 12px; color: var(--dr-mute); background: transparent; border: 1px solid var(--dr-line); border-radius: 6px; padding: 3px 8px; cursor: pointer; }
.dr-snd[aria-pressed="true"] { color: var(--dr-fg); }

.dr-bar { height: 3px; background: var(--dr-line); border-radius: 2px; position: relative; overflow: hidden; }
.dr-bar i { position: absolute; inset: 0 auto 0 0; background: var(--dr-fg); width: 0; }
.dr-bar s { position: absolute; top: -2px; bottom: -2px; left: 80%; width: 1.5px; background: var(--dr-red); }
.dr-bar.dr-tb { height: 2px; margin-top: -6px; }
.dr-bar.dr-tb i { width: 100%; background: var(--dr-mute); }
.dr-bar.dr-tb.dr-warn i { background: var(--dr-red); }

.dr-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.dr-board { position: relative; max-width: 100%; }
.dr-board canvas { display: block; width: 100%; height: 100%; border-radius: 4px; }

.dr-ov { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px; background: rgba(13, 13, 13, .74); border-radius: 4px; }
.dr-ov.dr-win { background: linear-gradient(transparent 50%, rgba(13, 13, 13, .88)); justify-content: flex-end; }
.dr-ov h2 { margin: 0; font-size: 26px; font-weight: 400; font-style: italic; }
.dr-ov p { margin: 0; font-size: 14px; line-height: 1.5; max-width: 32ch; }
.dr-btn { font: inherit; font-size: 14px; color: var(--dr-fg); background: transparent; border: 1px solid var(--dr-fg); border-radius: 6px; padding: 9px 16px; cursor: pointer; text-decoration: none; }
.dr-btn.dr-solid { background: var(--dr-fg); color: var(--dr-ink); }
.dr-btn:focus-visible, .dr-snd:focus-visible, .dr-back:focus-visible { outline: 2px solid var(--dr-red); outline-offset: 2px; }

/* Fine partita e classifica (VG-306): sopra il campo, scorre dentro se non ci sta. */
.dr-end { justify-content: flex-start; overflow-y: auto; padding-top: 40px; touch-action: pan-y; }
.dr-end h3 { margin: 6px 0 4px; font-size: 15px; font-weight: 600; }
.dr-close { position: absolute; top: 8px; right: 10px; font: inherit; font-size: 24px; line-height: 1; color: var(--dr-fg); background: none; border: 0; cursor: pointer; padding: 4px 8px; }
.dr-section { width: 100%; max-width: 300px; display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.dr-section input { font: inherit; font-size: 15px; color: var(--dr-fg); background: var(--dr-panel); border: 1px solid var(--dr-line); border-radius: 6px; padding: 9px 10px; user-select: text; -webkit-user-select: text; }
.dr-small { font-size: 12px !important; color: var(--dr-mute); }
.dr-list { list-style: none; margin: 0; padding: 0; font-size: 13px; text-align: left; }
.dr-list li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 2px; border-bottom: 1px solid var(--dr-line); font-variant-numeric: tabular-nums; }
.dr-list li .dr-rank { color: var(--dr-mute); min-width: 1.8em; }
.dr-list li .dr-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-list li.dr-you { color: var(--dr-red); }
.dr-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

.dr-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 8; background: var(--dr-fg); color: var(--dr-ink); border-radius: 999px; padding: 9px 18px; font-size: 14px; }

.dr-hint, .dr-credit { margin: 0; font-size: 12px; color: var(--dr-mute); text-align: center; line-height: 1.45; }
.dr-credit { min-height: 1.45em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
