:root {
  --red: #3b070b;
  --red2: #6d1018;
  --cream: #fff6e6;
  --ink: #2a1a0c;
  --gold: #e8b04a;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--red); color: var(--cream); }
body { font-family: "Special Elite", ui-monospace, monospace; overscroll-behavior: none; }
button, input, a.btn { font: inherit; }

#app { min-height: 100%; display: flex; flex-direction: column; align-items: center; }
#stage {
  position: relative;
  width: min(100vw, calc((100dvh - 34px) * 9 / 16));
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: #1c0306;
}
#out { width: 100%; height: 100%; display: block; }
footer { font-size: 11px; opacity: .7; padding: 8px 16px 10px; text-align: center; line-height: 1.4; }
footer a { color: var(--gold); }

.sheet {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px; text-align: center;
  background: rgba(30, 3, 6, .55);
  backdrop-filter: blur(2px);
}
.sheet[hidden], #controls[hidden] { display: none; }
h1 { font-family: "Caveat", cursive; font-weight: 700; font-size: clamp(48px, 15vw, 76px); line-height: .9; margin: 0; transform: rotate(-4deg); }
h1 span { display: block; font-size: .55em; color: var(--gold); }
.sheet p { margin: 0; max-width: 28ch; }
.small { font-size: 12px; opacity: .75; }

.big {
  border: 0; border-radius: 999px; padding: 15px 30px; font-size: 18px;
  background: var(--cream); color: var(--ink); cursor: pointer;
  box-shadow: 3px 4px 0 var(--ink);
}
.big:active { transform: translate(2px, 2px); box-shadow: 1px 2px 0 var(--ink); }

#controls {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 10px calc(10px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: linear-gradient(transparent, rgba(20, 2, 4, .88) 40%);
}
#styles { display: flex; gap: 6px; overflow-x: auto; max-width: 100%; scrollbar-width: none; padding: 0 4px; }
#styles::-webkit-scrollbar { display: none; }
#doodles { display: flex; flex-direction: column; gap: 5px; }
.chip {
  border: 1.5px solid rgba(255, 246, 230, .55); background: rgba(0, 0, 0, .3); color: var(--cream);
  border-radius: 999px; padding: 5px 11px; font-size: 13px; cursor: pointer; white-space: nowrap; flex: none;
}
.chip[aria-checked="true"] { background: var(--cream); color: var(--ink); border-color: var(--cream); }
#doodles .chip { padding: 2px 8px; font-size: 15px; }
.rec-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; width: 100%; }
#doodles { justify-self: end; flex-direction: row; }
.side { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
#sign {
  width: 108px; padding: 4px 10px; border-radius: 999px; border: 1.5px dashed rgba(255, 246, 230, .6);
  background: rgba(0, 0, 0, .3); color: var(--cream); font-family: "Caveat", cursive; font-size: 18px;
}
#sign::placeholder { color: rgba(255, 246, 230, .65); }
#btnRec {
  width: 70px; height: 70px; border-radius: 50%; border: 4px solid var(--cream); background: transparent;
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
#btnRec span { width: 52px; height: 52px; border-radius: 50%; background: #e0312f; transition: transform .15s; }
#btnRec:active span { transform: scale(.9); }

#result { justify-content: flex-start; padding-top: 18px; background: rgba(30, 3, 6, .92); }
#vid { width: 62%; aspect-ratio: 9 / 16; border-radius: 10px; background: #000; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.btns { display: flex; flex-direction: column; gap: 9px; width: 80%; align-items: stretch; }
.row2 { display: flex; gap: 8px; }
a.btn {
  flex: 1; text-decoration: none; text-align: center; padding: 10px 6px; border-radius: 999px;
  border: 1.5px solid var(--cream); color: var(--cream); font-size: 14px;
}
.link { background: none; border: 0; color: var(--cream); opacity: .85; cursor: pointer; font-size: 14px; }
.tip { font-size: 12.5px; opacity: .9; }
.tip b { color: var(--gold); font-weight: normal; }
#msg p { max-width: 30ch; }
