:root {
  --bg: #141a10;
  --bg2: #1e2816;
  --card: #24331c;
  --line: #4a5c38;
  --cyan: #9bb56e;
  --teal: #6d8850;
  --gold: #c5d4a0;
  --text: #eef3e6;
  --muted: #b4c4a0;
  --danger: #e07a7a;
  --ok: #9bb56e;
  --radius: 16px;
  --green: #6d8850;
  --green-dark: #4f6438;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(1200px 600px at 20% -10%, #3d522c, var(--bg)); color: var(--text); font: 16px/1.45 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
body { padding: env(safe-area-inset-top) 16px calc(16px + env(safe-area-inset-bottom)); }
.app { max-width: 440px; margin: 0 auto; padding-bottom: 32px; }
header { display: flex; flex-direction: column; gap: 8px; align-items: center; padding: 12px 4px 8px; text-align: center; }
.logo { width: auto; height: auto; background: none; box-shadow: none; border-radius: 0; display: block; }
.logo img { width: min(280px, 78vw); height: auto; display: block; filter: drop-shadow(0 8px 18px #0006); }
h1 { margin: 0; font-size: 1.15rem; letter-spacing: .02em; color: #e8f0d8; }
.sub { color: var(--muted); font-size: .82rem; }
.card { background: color-mix(in srgb, var(--card) 88%, transparent); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 12px 0; backdrop-filter: blur(8px); }
label { display: block; font-size: .78rem; color: var(--muted); margin: 10px 0 4px; }
input { width: 100%; padding: 12px 12px; border-radius: 10px; border: 1px solid var(--line); background: #141a10; color: var(--text); font-size: 1rem; }
input:focus { outline: 2px solid var(--green); border-color: transparent; }
button { width: 100%; border: 0; border-radius: 12px; padding: 13px 14px; font-weight: 700; font-size: 1rem; cursor: pointer; }
button.primary { background: linear-gradient(180deg, #8aa45e, #6d8850); color: #141a10; }
button.primary:disabled { opacity: .55; }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.gold { background: linear-gradient(180deg, #d5e0c4, #9bb56e); color: #24331c; }
.hint { color: var(--muted); font-size: .86rem; margin: 0; }
.error { color: var(--danger); font-size: .88rem; margin: 8px 0 0; }
.ok { color: var(--ok); }
.hidden { display: none !important; }
.stage { position: relative; border-radius: 18px; overflow: hidden; background: #000; aspect-ratio: 3/4; }
video, canvas#preview { width: 100%; height: 100%; object-fit: cover; display: block; }
.overlay {
  position: absolute;
  right: 6px;
  bottom: 6px;
  left: auto;
  width: max-content;
  max-width: 58%;
  background: rgba(8, 14, 22, 0.62);
  color: #f8fafc;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 16px;
  line-height: 1.25;
  padding: 6px 8px;
  border-radius: 2px;
  border: 0;
  white-space: pre;
  text-align: right;
  font-weight: 500;
}
.timer { position: absolute; top: 10px; right: 10px; background: #041018cc; color: var(--gold); padding: 6px 10px; border-radius: 999px; font-weight: 700; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; background: #6d885033; border: 1px solid var(--line); color: var(--cyan); border-radius: 999px; padding: 2px 8px; font-size: .75rem; }
.row { display: flex; gap: 8px; }
.row button { flex: 1; }
.list { display: flex; flex-direction: column; gap: 10px; }
.item { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #141a1088; }
.item img { width: 100%; border-radius: 8px; margin-top: 8px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; word-break: break-all; }
footer { text-align: center; color: var(--muted); font-size: .75rem; margin-top: 20px; }
a { color: var(--cyan); }
.rules h2 { margin: 0 0 8px; font-size: 1.05rem; letter-spacing: .06em; }
.rules ul { margin: 0 0 12px; padding-left: 18px; color: var(--text); }
.rules li { margin: 8px 0; }
.warn { color: #fecdd3; background: #88133755; border: 1px solid #fb718555; padding: 10px 12px; border-radius: 10px; font-size: .86rem; font-weight: 700; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; color: var(--text); font-size: .9rem; }
.check input { width: auto; margin-top: 3px; }
