:root {
  color-scheme: light;
  --ink: #1c140c;
  --paper: #f7f3ea;
  --header: #0b3a45;
  --header-ink: #f7f3ea;
  --button: #0e4d5c;
  --button-ink: #ffffff;
  --line: #1c140c;
  --hint: #3d3228;
  --banner: #fff4cc;
  --banner-ink: #3d2e00;
  --stop: #7a1f1f;
  --focus: #a15c00;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  font-size: 125%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  line-height: 1.4;
}

body,
button,
input,
textarea {
  font: inherit;
}

.top {
  background: var(--header);
  color: var(--header-ink);
  padding: calc(1rem + env(safe-area-inset-top)) 1rem 1.25rem;
}

.mark {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0.25rem 0 0.5rem;
  line-height: 1.15;
  font-weight: 700;
}

h1 {
  font-size: 2rem;
}

#status {
  margin: 0;
  font-size: 1.05rem;
}

main,
footer {
  width: min(40rem, 100%);
  margin: 0 auto;
  padding: 1rem 1rem calc(1.5rem + env(safe-area-inset-bottom));
}

.hint,
.intro,
footer p {
  margin: 0 0 1rem;
  color: var(--hint);
  font-size: 1.05rem;
}

.top #status {
  color: var(--header-ink);
}

.big {
  display: block;
  width: 100%;
  min-height: 5.25rem;
  margin: 0 0 0.75rem;
  padding: 1rem 1.1rem;
  border: 3px solid var(--line);
  border-radius: 1rem;
  background: var(--button);
  color: var(--button-ink);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}

.big.secondary {
  background: #ffffff;
  color: var(--ink);
}

.big.stop {
  background: var(--stop);
  color: #ffffff;
}

.big:disabled {
  background: #d7d0c4;
  color: #4d463e;
  cursor: not-allowed;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.row .big {
  margin-bottom: 0.75rem;
}

.stage {
  min-height: 12rem;
  margin-bottom: 1rem;
  border: 3px solid var(--line);
  border-radius: 1rem;
  background: #fff;
  overflow: hidden;
  display: grid;
  place-items: center;
}

#stage-note {
  margin: 1rem;
  text-align: center;
  font-size: 1.2rem;
}

video,
#still {
  width: 100%;
  height: auto;
  max-height: 22rem;
  object-fit: contain;
  background: #111;
}

.file-label {
  display: block;
  margin: 0.25rem 0 0.4rem;
  font-size: 1.15rem;
  font-weight: 700;
}

input[type="file"],
textarea {
  display: block;
  width: 100%;
  margin: 0 0 1rem;
  padding: 0.9rem;
  border: 3px solid var(--line);
  border-radius: 0.8rem;
  background: #fff;
  color: var(--ink);
}

textarea {
  font-size: 1.35rem;
  line-height: 1.35;
}

.banner {
  margin: 0 0 0.75rem;
  padding: 0.9rem 1rem;
  border: 3px solid #8a6a00;
  border-radius: 0.8rem;
  background: var(--banner);
  color: var(--banner-ink);
  font-size: 1.15rem;
  font-weight: 700;
}

.result {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  line-height: 1.35;
  white-space: pre-wrap;
}

footer {
  padding-top: 0;
}

:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}
