:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  color: #fff1da;
  background: #281517;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100svh;
  background: radial-gradient(ellipse at 50% 15%, #734139, transparent 75%);
}
header, main {
  width: min(900px, calc(100% - 32px));
  margin: auto;
}
header { padding: 22px 0; }
header a { color: #ffe0aa; text-underline-offset: 4px; }
main { padding: 12px 0 44px; }
h1, h2 { font-family: Georgia, serif; font-weight: 400; }
h1 { margin: 0; font-size: clamp(2.7rem, 7vw, 5rem); text-align: center; }
.intro { margin: 12px auto 28px; max-width: 55ch; line-height: 1.55; text-align: center; color: #f3dac8; }
.game { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(20px, 5vw, 56px); }
.controls { display: grid; justify-items: center; gap: 20px; }
.wheel-frame {
  position: relative;
  width: min(100%, 355px);
  aspect-ratio: 1;
  border: 6px solid #eec286;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #432525, 0 10px 42px #1b0c10b0;
}
.wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from -30deg, #83445c 0 60deg, #285552 60deg 120deg, #815629 120deg 180deg, #55446e 180deg 240deg, #963e49 240deg 300deg, #355471 300deg);
  transition: transform 3.2s cubic-bezier(.14,.78,.11,1);
}
.wheel span { position: absolute; transform: translate(-50%, -50%); color: #fff8e6; font-size: clamp(.74rem, 2.4vw, 1rem); font-weight: 700; text-align: center; width: 25%; text-shadow: 0 1px 3px #29171a; }
.pointer { position: absolute; z-index: 1; top: -9px; left: calc(50% - 11px); width: 22px; height: 32px; clip-path: polygon(0 0,100% 0,50% 100%); background: #fff1c0; }
.hub { position: absolute; inset: 42%; display: grid; place-items: center; border-radius: 50%; border: 2px solid #eec286; background: #48242c; font-size: 1.45rem; }
button { cursor: pointer; border: 0; border-radius: 999px; padding: 12px 22px; font: 700 1rem system-ui, sans-serif; background: #f4cf99; color: #3a201b; }
button:disabled { cursor: wait; opacity: .8; }
:focus-visible { outline: 2px solid #fff3d8; outline-offset: 4px; }
.result { min-height: 285px; padding: 22px; border: 1px solid #edbd876e; border-radius: 18px; background: #391f27; text-align: center; }
.result h2 { color: #ffdda3; margin: 0; font-size: clamp(1.6rem, 4vw, 2rem); }
.result p { line-height: 1.5; }
#pose-art { width: min(100%, 270px); display: block; margin: 4px auto; }
@media (max-width: 640px) { .game { grid-template-columns: 1fr; } .result { min-height: 0; } }
@media (prefers-reduced-motion: reduce) { .wheel { transition: none; } }

.wheel span {
  width: 2ch;
  font-size: clamp(.7rem, 2.6vw, .88rem);
  font-variant-numeric: tabular-nums;
}
.gallery { margin-top: 36px; }
.gallery summary { cursor: pointer; color: #ffe0aa; font-weight: 700; padding: 10px 0; }
#pose-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 215px), 1fr));
  gap: 14px;
  margin-top: 10px;
}
#pose-gallery article { padding: 14px; border: 1px solid #edbd876e; border-radius: 14px; background: #391f27; }
#pose-gallery h3 { color: #ffdda3; margin: 0; font: 1.25rem Georgia, serif; }
#pose-gallery svg { display: block; width: 100%; }
#pose-gallery p { margin: 0; line-height: 1.45; }

#pose-art,
#pose-gallery svg {
  border: 1px solid #c58d82;
  border-radius: 12px;
  background: radial-gradient(ellipse at 50% 35%, #fff0d6, #e8b9b0);
}
#pose-art {
  width: 100%;
  margin: 16px auto 0;
}
#pose-gallery svg { margin: 12px 0; }

.source-art {
  display: block;
  width: 100%;
  margin: 12px 0 6px;
  border-radius: 12px;
}
.source-credit {
  display: inline-block;
  margin: 8px 0;
  color: #ffe0aa;
  font-size: .875rem;
}
.source-credit a { color: inherit; }
