@font-face {
  font-family: Barlow Condensed;
  src: url("assets/barlow-condensed-black.ttf") format("truetype");
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: Space Mono;
  src: url("assets/space-mono.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #211a17;
  --paper: #f6e3e9;
  --frame-paper: #fff2f5;
  --light: #fcf0d8;
  --red: #aa3023;
  --display: "Barlow Condensed", Impact, sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding: 20px;
  place-items: center;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 system-ui, sans-serif;
}

.page { width: min(100%, 700px); }

.greeting-title {
  margin-bottom: clamp(14px, 2.5vw, 24px);
  text-align: center;
}

.greeting-title h1 {
  margin: 0;
  color: var(--red);
  font: 900 clamp(34px, 7.5vw, 68px)/.95 var(--display);
  text-transform: uppercase;
}

.greeting-title p {
  margin: 8px 0 0;
  font: 700 clamp(11px, 2.8vw, 14px)/1.4 var(--mono);
}

.frame {
  padding: clamp(8px, 1.5vw, 14px);
  border: 2px solid var(--ink);
  background: var(--frame-paper);
  box-shadow: 6px 6px 0 var(--ink);
}

.stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 1.35;
  border: 1px solid var(--ink);
  background: radial-gradient(ellipse at 50% 44%, #ffd4e1, #d88ba8);
}

.stage::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  content: "";
  background: url("assets/grain.svg");
  mix-blend-mode: multiply;
  opacity: .18;
}

.puppet {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(5px 7px 0 #442a2a56);
}

.jaw-cutout { filter: drop-shadow(.6px 1.2px 1px #21181577); }

.controls {
  padding: clamp(14px, 2.2vw, 22px) 4px 5px;
  text-align: center;
}

.controls__actions {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 12px;
  width: min(100%, 360px);
  margin-inline: auto;
}

.action {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 11px;
  min-width: 0;
  min-height: 55px;
  padding: 7px 12px;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  box-shadow: 4px 4px 0 var(--ink);
  font: 400 13px/1.2 var(--mono);
  letter-spacing: .035em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}

.play { background: var(--red); color: var(--light); }
.play:hover { background: #8d261c; }
.gift { background: #f4c55c; color: var(--ink); }
.gift:hover { background: #ffda7e; }
.action:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.action:focus-visible { outline: 2px dashed var(--red); outline-offset: 5px; }

.action__glyph {
  display: grid;
  flex: 0 0 34px;
  height: 34px;
  place-items: center;
  background: var(--light);
}

.play .action__glyph { color: var(--red); }
.action__glyph svg { width: 21px; }
.pause-icon, .play.is-playing .play-icon { display: none; }
.play.is-playing .pause-icon { display: initial; }

.play-status { margin: 0; }
.play-status:not(:empty) { margin-top: 12px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.gift-burst {
  position: fixed;
  z-index: 10;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.burst-piece {
  position: absolute;
  top: var(--burst-y);
  left: var(--burst-x);
  translate: -50% -50%;
  opacity: 0;
}

.burst-wish {
  display: flex;
  z-index: 2;
  align-items: center;
  gap: .36em;
  width: max-content;
  padding: .24em .54em .3em;
  border: 1.5px solid var(--ink);
  border-radius: 2px 6px 3px 5px;
  box-shadow: 3px 3px 0 var(--ink);
  background: var(--light);
  font: 900 clamp(15px, 2.1vw, 24px)/1.05 var(--display);
}

.burst-wish > :last-child { overflow-wrap: anywhere; }
.burst-wish--1 { background: #ffd36d; }
.burst-wish--2 { background: var(--red); color: var(--light); }
.burst-emoji { z-index: 1; font-size: clamp(20px, 4vw, 36px); line-height: 1; }
.burst-confetti { width: 7px; height: 12px; border-radius: 2px; }
.burst-ring { width: 58px; height: 58px; border: 3px solid #edb83c; border-radius: 50%; }

@media (max-width: 430px) {
  .controls__actions { gap: 10px; }
  .action { gap: 7px; padding-inline: 7px; font-size: 11px; letter-spacing: 0; }
  .action__glyph { flex-basis: 26px; height: 26px; }
  .action__glyph svg { width: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .action { transition: none; }
}
