:root {
  --bg: #14110f;
  --panel: #221d19;
  --ink: #f3ece2;
  --muted: #a89f93;
  --accent: #e0a458;
  --accent-ink: #14110f;
  --danger: #c0563f;
  --ok: #7fb069;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 18px/1.4 -apple-system, "Helvetica Neue", Arial, sans-serif; }
body { padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto; }
header { text-align: center; margin-bottom: 8px; }
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: 0.02em; }
h2 { font-size: 17px; margin: 24px 0 8px; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.fatal, .warn { background: var(--panel); border-left: 4px solid var(--danger); padding: 12px; border-radius: 8px; }
.warn { border-left-color: var(--accent); }

.counter { text-align: center; margin: 12px 0 4px; }
#remaining { font-size: 72px; font-weight: 700; line-height: 1; display: block; color: var(--accent); }

.looks { display: flex; gap: 8px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.look { border: 2px solid var(--panel); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 10px 16px; font-size: 16px; min-height: 44px; }
.look.active { border-color: var(--accent); color: var(--accent); }

.shutter-row { text-align: center; margin: 12px 0; }
.shutter { display: inline-flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer; }
.shutter .ring { width: 112px; height: 112px; border-radius: 50%; border: 6px solid var(--ink); background: var(--accent); box-shadow: 0 0 0 6px var(--bg), 0 0 0 8px var(--ink); display: block; }
.shutter:active .ring { transform: scale(0.94); }
.shutter.done .ring { background: var(--panel); }
.shutter span:last-child { font-size: 18px; font-weight: 600; }
.status { min-height: 1.4em; margin: 12px 0 0; color: var(--accent); font-size: 16px; }

.name-row { margin: 16px 0; }
.name-row label { display: block; color: var(--muted); font-size: 15px; margin-bottom: 4px; }
input[type=text] { width: 100%; font-size: 18px; padding: 12px; border-radius: 10px; border: 1px solid #3a322c; background: var(--panel); color: var(--ink); min-height: 44px; }

.shots { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.shot { display: flex; align-items: center; gap: 12px; background: var(--panel); border-radius: 10px; padding: 10px; }
.shot .frame { width: 56px; height: 42px; border-radius: 4px; background: repeating-linear-gradient(135deg, #2e2722 0 6px, #3a322c 6px 12px); flex: none; }
.shot.failed .frame { background: var(--danger); opacity: 0.5; }
.shot .meta { flex: 1; font-size: 15px; }
.shot small { color: var(--muted); }
.delete { background: transparent; color: var(--muted); border: 1px solid #3a322c; border-radius: 8px; padding: 8px 12px; min-height: 44px; font-size: 15px; }

.footer { margin-top: 24px; display: grid; gap: 10px; }
.secondary { display: block; width: 100%; text-align: center; background: var(--panel); color: var(--ink); border: 1px solid #3a322c; border-radius: 10px; padding: 12px; font-size: 16px; min-height: 44px; text-decoration: none; }

/* Album */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 12px; }
.grid a { display: block; aspect-ratio: 1; background: var(--panel); overflow: hidden; border-radius: 4px; }
.grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.countdown { text-align: center; font-size: 40px; font-weight: 700; color: var(--accent); margin: 24px 0 8px; }
.viewer { position: fixed; inset: 0; background: rgba(0,0,0,0.96); display: none; flex-direction: column; align-items: center; justify-content: center; padding: 12px; gap: 12px; }
.viewer.open { display: flex; }
.viewer img { max-width: 100%; max-height: 78vh; object-fit: contain; }
.viewer .bar { display: flex; gap: 8px; width: 100%; max-width: 520px; }
.viewer .bar > * { flex: 1; }
.viewer .caption { color: var(--muted); font-size: 15px; text-align: center; }

/* Host */
.host-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 12px; }
.host-grid figure { margin: 0; background: var(--panel); border-radius: 8px; overflow: hidden; }
.host-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.host-grid figcaption { padding: 6px; font-size: 13px; color: var(--muted); }
.host-grid button { width: 100%; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
pre { background: var(--panel); padding: 10px; border-radius: 8px; font-size: 14px; overflow-x: auto; }
