:root {
  --bone: #f3efe7;
  --bone-2: #ece6da;
  --ink: #111111;
  --red: #e63956;
  --paper: #ffffff;
  --line: #1b1b1b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bone);
  color: var(--ink);
  font-family: "Space Mono", ui-monospace, monospace;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  /* faint paper grain */
  background-image:
    radial-gradient(120% 80% at 12% 0%, rgba(255, 255, 255, 0.55), transparent 60%),
    radial-gradient(120% 90% at 100% 100%, rgba(0, 0, 0, 0.035), transparent 55%);
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 5vw, 40px);
}

.card {
  width: min(540px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(16px, 3.4vw, 26px);
}

/* ---- question ---- */
.question {
  font-family: "Anton", sans-serif;
  font-weight: 400;
  font-size: clamp(19px, 5.2vw, 28px);
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin: 0;
  color: var(--ink);
}
.question .q-mark {
  color: var(--red);
}

/* ---- picture frame: clean white gallery mat ---- */
.frame {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: clamp(10px, 2.2vw, 16px);
  width: min(360px, 86vw);
  margin: 0;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.05),
    0 22px 46px -24px rgba(20, 16, 10, 0.5);
  position: relative;
}
/* corner registration ticks — the one print detail kept */
.frame::before,
.frame::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none;
  border-color: var(--ink);
  border-style: solid;
  opacity: 0.55;
}
.frame::before {
  top: 5px;
  left: 5px;
  border-width: 1px 0 0 1px;
}
.frame::after {
  bottom: 5px;
  right: 5px;
  border-width: 0 1px 1px 0;
}

.photo-wrap {
  position: relative;
  background: var(--bone-2);
  overflow: hidden;
  aspect-ratio: 529 / 721;
  width: 100%;
  max-height: 56vh;
}
.photo-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain; /* faces never cropped */
  object-position: center;
}

/* ---- answer ---- */
.answer-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}
.answer-label {
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--red);
}
.answer {
  font-family: "Anton", sans-serif;
  font-weight: 400;
  font-size: clamp(38px, 11.5vw, 64px);
  line-height: 0.94;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  margin: 0;
  color: var(--ink);
  max-width: 14ch;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.answer .emoji {
  font-size: 0.6em;
  -webkit-text-fill-color: initial;
  vertical-align: 0.04em;
  margin-left: 0.05em;
}

/* ---- one restrained theme accent: three stripes + a single small leopard chip ---- */
.accent {
  display: flex;
  align-items: center;
  gap: 10px;
}
.accent .stripes {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 42px;
}
.accent .stripes i {
  height: 2px;
  background: var(--ink);
  display: block;
}
.accent .stripes i:nth-child(2) {
  width: 78%;
}
.accent .stripes i:nth-child(3) {
  width: 56%;
  background: var(--red);
}
.accent .leo {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 1px solid var(--ink);
  background-color: #c98f3f;
  background-image:
    radial-gradient(circle at 22% 26%, #2a1c0c 0 18%, transparent 19%),
    radial-gradient(circle at 70% 22%, #2a1c0c 0 14%, transparent 15%),
    radial-gradient(circle at 40% 58%, #2a1c0c 0 17%, transparent 18%),
    radial-gradient(circle at 84% 64%, #2a1c0c 0 13%, transparent 14%),
    radial-gradient(circle at 16% 84%, #2a1c0c 0 15%, transparent 16%),
    radial-gradient(circle at 50% 30%, #e7b766 0 40%, transparent 41%);
  background-size: 24px 24px, 20px 20px, 26px 26px, 18px 18px, 22px 22px, 200% 200%;
  background-blend-mode: multiply, multiply, multiply, multiply, multiply, normal;
}

/* ---- reroll ---- */
.reroll {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone);
  background: var(--ink);
  border: 1.5px solid var(--ink);
  padding: 14px 26px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  position: relative;
  transition: background 0.22s ease, color 0.22s ease, transform 0.12s ease;
}
.reroll .arrow {
  display: inline-block;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reroll::before {
  content: "";
  position: absolute;
  left: -1.5px;
  top: -1.5px;
  bottom: -1.5px;
  width: 6px;
  background: var(--red);
  transition: width 0.22s ease;
}
.reroll:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  transform: translateY(-1px);
}
.reroll:hover::before {
  width: 0;
}
.reroll:hover .arrow {
  transform: rotate(180deg);
}
.reroll:active {
  transform: translateY(0) scale(0.99);
}
.reroll:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

/* ---- animations ---- */
@keyframes ansIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes photoIn {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.anim-answer {
  animation: ansIn 0.42s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.anim-photo {
  animation: photoIn 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.swap-out-answer {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.swap-out-photo {
  opacity: 0;
  transition: opacity 0.16s ease;
}

@media (max-width: 430px) {
  .frame {
    width: min(300px, 82vw);
  }
  .photo-wrap {
    max-height: 50vh;
  }
  .answer {
    font-size: clamp(34px, 12vw, 52px);
  }
  .reroll {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .anim-answer,
  .anim-photo,
  .swap-out-answer,
  .swap-out-photo {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
