/* Waggle: mobile-first, bee-themed. Honey on cream by day, honey on dark comb by night. */

:root {
  --bg: #fff6dc;
  --bg-deep: #ffecb3;
  --card: #fffdf6;
  --ink: #2b2118;
  --ink-soft: #6e5a40;
  --line: #ecd79e;
  --honey: #ffc21a;
  --honey-deep: #f5a300;
  --amber: #c77c02;
  --comb: rgba(214, 150, 20, 0.16);
  --wing: rgba(255, 255, 255, 0.88);
  --backdrop: rgba(43, 33, 24, 0.55);

  /* The bee keeps its colours in both themes. */
  --bee-ink: #2b2118;
  --bee-yellow: #ffc93c;
  --bee-blush: #ff8a65;

  --radius: 20px;
  --hex: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  --font: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #19130c;
    --bg-deep: #241a0f;
    --card: #2a2016;
    --ink: #fff2d4;
    --ink-soft: #cdb68c;
    --line: #4a3922;
    --amber: #ffb000;
    --comb: rgba(255, 194, 26, 0.07);
    --wing: rgba(255, 255, 255, 0.8);
    --backdrop: rgba(0, 0, 0, 0.65);
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  background-color: var(--bg);
  /* Honeycomb */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100' fill='none' stroke='%23d69614' stroke-opacity='.2' stroke-width='2'/%3E%3C/svg%3E");
  background-size: 56px 100px;
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-color-scheme: dark) {
  body {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100' fill='none' stroke='%23ffc21a' stroke-opacity='.07' stroke-width='2'/%3E%3C/svg%3E");
  }
}

h1,
h2,
p {
  margin: 0;
}

b {
  font-weight: 600;
}

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

[tabindex="-1"]:focus {
  outline: none;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */

.topbar,
main {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 16px 4px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.01em;
}

.brand__mark {
  width: 26px;
  height: 29px;
}

.brand__mark path {
  fill: var(--honey);
  stroke: var(--bee-ink);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.hexbtn {
  width: 38px;
  height: 42px;
  border: 0;
  clip-path: var(--hex);
  background: var(--bee-ink);
  color: var(--honey);
  font: 700 19px var(--font);
  cursor: pointer;
}

main {
  padding: 8px 16px max(40px, env(safe-area-inset-bottom));
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: screen-in 0.35s ease-out both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.eyebrow {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 2.5px solid var(--bee-ink);
  font: 600 17px var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s, box-shadow 0.08s;
}

.btn--primary {
  background: linear-gradient(180deg, #ffd04a, var(--honey));
  color: var(--bee-ink);
  box-shadow: 0 4px 0 var(--bee-ink);
}

.btn--primary:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--bee-ink);
}

.btn--primary:disabled {
  cursor: progress;
  filter: saturate(0.6);
}

.btn--big {
  width: 100%;
  min-height: 58px;
  font-size: 20px;
}

.btn--ghost {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}

.btn--link {
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn--share {
  animation: share-glow 2.4s ease-in-out infinite;
}

@keyframes share-glow {
  50% {
    box-shadow: 0 4px 0 var(--bee-ink), 0 0 0 6px rgba(255, 194, 26, 0.35);
  }
}

.icon {
  width: 22px;
  height: 22px;
}

/* ── Bee artwork ────────────────────────────────────────────────────────── */

.bee {
  display: block;
  width: 100%;
}

.bee__flip,
.bee__anim {
  display: block;
}

.bee__svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.bee-ink {
  fill: var(--bee-ink);
}

.bee-yellow {
  fill: var(--bee-yellow);
}

.bee-outline {
  fill: none;
  stroke: var(--bee-ink);
  stroke-width: 3;
}

.bee-line {
  fill: none;
  stroke: var(--bee-ink);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.bee-line--thin {
  stroke-width: 2;
}

.bee-sting {
  stroke: var(--bee-ink);
  stroke-width: 2;
  stroke-linejoin: round;
}

.bee-wing {
  fill: var(--wing);
  stroke: var(--bee-ink);
  stroke-width: 2.5;
}

.bee-shine {
  fill: #fff;
}

.bee-blush {
  fill: var(--bee-blush);
  opacity: 0.7;
}

.bee__wings {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: flap 0.14s ease-in-out infinite alternate;
}

@keyframes flap {
  to {
    transform: scaleY(0.55);
  }
}

.hive__svg {
  display: block;
  width: 100%;
  height: auto;
}

.hive-dome {
  fill: var(--honey-deep);
  stroke: var(--bee-ink);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.hive-band {
  fill: none;
  stroke: var(--bee-ink);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.55;
}

.hive-door,
.hive-base {
  fill: var(--bee-ink);
}

/* ── Landing ────────────────────────────────────────────────────────────── */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding-top: 8px;
}

.dance {
  position: relative;
  width: 240px;
  height: 120px;
  margin-bottom: 10px;
}

.dance__trail {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.dance__trail path {
  fill: none;
  stroke: var(--amber);
  stroke-width: 2.5;
  stroke-dasharray: 2 9;
  stroke-linecap: round;
  opacity: 0.6;
}

.dance__bee {
  position: absolute;
  top: 0;
  left: 0;
  width: 46px;
  offset-rotate: auto;
  offset-anchor: center;
  animation: dance 6s linear infinite;
}

.dance__bee .bee__anim {
  animation: waggle-run 0.18s ease-in-out infinite alternate;
}

@keyframes dance {
  from {
    offset-distance: 0%;
  }
  to {
    offset-distance: 100%;
  }
}

@keyframes waggle-run {
  from {
    transform: rotate(-7deg);
  }
  to {
    transform: rotate(7deg);
  }
}

.title {
  font-size: 64px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 0 var(--honey);
}

.lede {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 30ch;
}

.lede em {
  font-style: normal;
  color: var(--ink);
  font-weight: 600;
  background: linear-gradient(transparent 62%, var(--honey) 62%);
}

/* ── Progress ───────────────────────────────────────────────────────────── */

.progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}

.pips {
  display: flex;
  gap: 5px;
}

.pip {
  width: 20px;
  height: 23px;
  clip-path: var(--hex);
  background: var(--line);
}

.pip.is-done {
  background: var(--honey);
}

.pip.is-current {
  background: var(--amber);
  animation: pip-pulse 1.2s ease-in-out infinite;
}

@keyframes pip-pulse {
  50% {
    transform: scale(0.82);
  }
}

/* ── Prompt ─────────────────────────────────────────────────────────────── */

.prompt {
  text-align: center;
  padding: 12px 0 4px;
}

.prompt__ask {
  color: var(--ink-soft);
  font-size: 17px;
}

.prompt__title {
  font-size: clamp(30px, 9vw, 42px);
  line-height: 1.1;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.prompt--small .prompt__title {
  font-size: 26px;
}

.prompt__credit {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ink-soft);
}

.hint {
  text-align: center;
  font-size: 15px;
  color: var(--ink-soft);
}

/* ── Play track ─────────────────────────────────────────────────────────── */

.track {
  --bee-w: 68px;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

.track__range {
  position: absolute;
  top: 40px;
  left: 50%;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.track__field {
  height: 110px;
  padding-inline: calc(var(--bee-w) / 2);
  touch-action: none;
  cursor: grab;
}

.track.is-held .track__field {
  cursor: grabbing;
}

.track.is-locked .track__field {
  cursor: default;
}

.track__inner {
  position: relative;
  height: 100%;
}

.track__rail {
  position: absolute;
  left: -14px;
  right: -14px;
  top: 64%;
  height: 18px;
  transform: translateY(-50%);
  border-radius: 999px;
  border: 2.5px solid var(--bee-ink);
  background: linear-gradient(90deg, var(--bg-deep), var(--honey) 50%, var(--bg-deep));
}

.track__tick {
  position: absolute;
  top: 64%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--bee-ink);
  opacity: 0.45;
  transform: translate(-50%, -50%);
}

.track__tick.is-mid {
  width: 8px;
  height: 8px;
}

.track:has(.track__range:focus-visible) .track__rail {
  outline: 3px solid var(--amber);
  outline-offset: 5px;
}

.track__bee {
  position: absolute;
  top: 64%;
  width: var(--bee-w);
  transform: translate(-50%, -78%);
  pointer-events: none;
}

.track__bee .bee__flip {
  transition: transform 0.2s;
}

.track.is-facing-left .track__bee .bee__flip {
  transform: scaleX(-1);
}

.track__bee .bee__anim {
  animation: hover 2.2s ease-in-out infinite;
}

.track.is-held .track__bee .bee__anim {
  animation: wiggle 0.32s ease-in-out infinite;
}

.track.is-held .track__bee {
  filter: drop-shadow(0 6px 4px rgba(43, 33, 24, 0.25));
}

.track.is-waggling .track__bee .bee__anim {
  animation: waggle 0.95s ease-in-out both;
}

@keyframes hover {
  50% {
    transform: translateY(-5px);
  }
}

@keyframes wiggle {
  0%,
  100% {
    transform: rotate(-9deg) scale(1.12);
  }
  50% {
    transform: rotate(9deg) scale(1.12);
  }
}

/* A tiny waggle dance: shimmy, loop up, shimmy, settle. */
@keyframes waggle {
  0% {
    transform: none;
  }
  10% {
    transform: translateX(-5px) rotate(-14deg);
  }
  20% {
    transform: translateX(5px) rotate(14deg);
  }
  30% {
    transform: translateX(-5px) rotate(-14deg);
  }
  40% {
    transform: translateX(5px) rotate(14deg);
  }
  60% {
    transform: translate(0, -26px) rotate(-180deg) scale(1.1);
  }
  80% {
    transform: translate(0, -8px) rotate(-360deg);
  }
  90% {
    transform: translateY(3px) rotate(-360deg) scale(1.05, 0.92);
  }
  100% {
    transform: rotate(-360deg);
  }
}

.track__labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}

.track__label {
  max-width: 48%;
  padding: 6px 12px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: var(--card);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  overflow-wrap: anywhere;
  transition: border-color 0.15s, background 0.15s;
}

.track__label[data-side="right"] {
  text-align: right;
}

.track__label.is-near {
  border-color: var(--bee-ink);
  background: var(--honey);
  color: var(--bee-ink);
}

/* ── Reveal ─────────────────────────────────────────────────────────────── */

.reveal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.reveal__words {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.reveal__word {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
}

.reveal__caption {
  text-align: center;
  color: var(--ink-soft);
}

.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--bee-ink);
  color: var(--honey);
  font-weight: 600;
  font-size: 15px;
  animation: pop 0.5s 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

@keyframes pop {
  from {
    transform: scale(0);
  }
}

.scorehex {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 118px;
  height: 134px;
  clip-path: var(--hex);
  background: var(--bee-ink);
  color: var(--bee-ink);
  animation: pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

.scorehex::before {
  content: "";
  position: absolute;
  inset: 5px;
  clip-path: var(--hex);
  background: linear-gradient(180deg, #ffd65c, var(--honey-deep));
}

.scorehex.is-bullseye::before {
  background:
    radial-gradient(circle, transparent 30%, rgba(255, 255, 255, 0.35) 31% 38%, transparent 39%),
    linear-gradient(180deg, #ffd65c, var(--honey-deep));
}

.scorehex__num,
.scorehex__of {
  position: relative;
}

.scorehex__num {
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.scorehex__of {
  font-size: 15px;
  font-weight: 600;
  opacity: 0.75;
}

.scorehex--big {
  width: 168px;
  height: 192px;
}

.scorehex--big .scorehex__num {
  font-size: 62px;
}

.scorehex--big .scorehex__of {
  font-size: 18px;
}

.rtrack {
  --bee-w: 46px;
  --dist-h: 92px;
  --rail-h: 12px;
  --rail-top: calc(var(--dist-h) + 10px);
}

.rtrack--compact {
  --bee-w: 34px;
  --dist-h: 64px;
}

.rtrack__field {
  padding-inline: calc(var(--bee-w) / 2);
}

.rtrack__inner {
  position: relative;
  height: calc(var(--rail-top) + var(--rail-h) + 58px);
}

.rtrack--compact .rtrack__inner {
  height: calc(var(--rail-top) + var(--rail-h) + 46px);
}

.dist {
  position: absolute;
  inset: 0 0 auto;
  height: var(--dist-h);
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

.dist__bar {
  flex: 1;
  height: var(--h);
  border-radius: 4px 4px 1px 1px;
  background: var(--honey);
  transform-origin: bottom;
  animation: grow 0.5s calc(var(--i) * 18ms) ease-out both;
}

.dist__bar.is-hive {
  background: var(--amber);
}

@keyframes grow {
  from {
    transform: scaleY(0);
  }
}

.rtrack__line {
  position: absolute;
  top: 0;
  height: var(--rail-top);
  border-left: 2px dashed var(--bee-ink);
  opacity: 0.55;
  transform: translateX(-1px);
}

.rtrack__rail,
.rtrack__gap {
  position: absolute;
  top: var(--rail-top);
  height: var(--rail-h);
}

.rtrack__rail {
  left: -10px;
  right: -10px;
  border-radius: 999px;
  border: 2px solid var(--bee-ink);
  background: var(--bg-deep);
}

.rtrack__gap {
  border-block: 2px solid var(--bee-ink);
  background: repeating-linear-gradient(90deg, var(--honey-deep) 0 6px, transparent 6px 10px);
  animation: fade-in 0.3s 0.6s both;
}

.rtrack__bee {
  position: absolute;
  top: calc(var(--rail-top) + var(--rail-h) / 2);
  width: var(--bee-w);
  transform: translate(-50%, -62%);
}

.rtrack__hive {
  position: absolute;
  top: calc(var(--rail-top) + var(--rail-h) + 4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 70px;
  margin-left: -35px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  animation: drop 0.55s 0.3s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}

.rtrack__hive .hive__svg {
  width: 30px;
}

.rtrack--compact .rtrack__hive .hive__svg {
  width: 24px;
}

@keyframes drop {
  from {
    opacity: 0;
    transform: translateY(-24px);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

/* ── Results ────────────────────────────────────────────────────────────── */

.results-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.results-title {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
}

.results-percentile {
  font-size: 18px;
  color: var(--ink-soft);
}

.results-percentile b {
  color: var(--ink);
}

.share-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.card {
  padding: 18px 16px;
  border-radius: var(--radius);
  background: var(--card);
  border: 2px solid var(--line);
}

.card__title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.card__note {
  margin-top: 10px;
  font-size: 14px;
  color: var(--ink-soft);
}

.tchart__bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
  padding-top: 30px;
}

.tchart__bar {
  position: relative;
  flex: 1;
  height: var(--h);
  border-radius: 4px 4px 1px 1px;
  background: var(--honey);
  transform-origin: bottom;
  animation: grow 0.5s calc(var(--i) * 25ms) ease-out both;
}

.tchart__bar.is-me {
  background: var(--bee-ink);
}

@media (prefers-color-scheme: dark) {
  .tchart__bar.is-me {
    background: var(--ink);
  }
}

.tchart__me {
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  width: 26px;
  transform: translateX(-50%);
}

.tchart__axis {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-soft);
}

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.row {
  padding: 10px 0 12px;
  border-top: 2px solid var(--line);
}

.row:first-child {
  border-top: 0;
  padding-top: 0;
}

.row__head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.row__num {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 29px;
  clip-path: var(--hex);
  background: var(--honey);
  color: var(--bee-ink);
  font-weight: 700;
  font-size: 14px;
}

.row__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.row__prompt {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.row__labels {
  font-size: 14px;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.row__score {
  flex: none;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.row__detail {
  margin-top: 12px;
}

.row__caption {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ink-soft);
}

.mtrack {
  --bee-w: 26px;
  margin-top: 6px;
  padding-inline: calc(var(--bee-w) / 2);
}

.mtrack__inner {
  position: relative;
  height: 28px;
}

.mtrack__rail {
  position: absolute;
  left: -6px;
  right: -6px;
  top: 50%;
  height: 6px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: var(--line);
}

.mtrack__hive {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 16px;
  clip-path: var(--hex);
  background: var(--amber);
  transform: translate(-50%, -50%);
}

.mtrack__bee {
  position: absolute;
  top: 50%;
  width: var(--bee-w);
  transform: translate(-50%, -60%);
}

.mtrack .bee__wings,
.tchart .bee__wings {
  animation: none;
}

.countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bee-ink);
  color: var(--honey);
  text-align: center;
  font-weight: 600;
}

.countdown b {
  font-size: 34px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

/* ── Loading / empty ────────────────────────────────────────────────────── */

.loading,
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-top: 70px;
  text-align: center;
  color: var(--ink-soft);
}

.empty h1 {
  color: var(--ink);
  font-size: 30px;
}

.loading__bee {
  width: 60px;
  animation: buzz-around 1.6s linear infinite;
}

@keyframes buzz-around {
  from {
    transform: rotate(0deg) translateX(30px) rotate(0deg);
  }
  to {
    transform: rotate(360deg) translateX(30px) rotate(-360deg);
  }
}

.empty__art {
  width: 90px;
}

/* ── Dialogs ────────────────────────────────────────────────────────────── */

dialog {
  width: min(440px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 2.5px solid var(--bee-ink);
  border-radius: 26px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 6px 0 var(--bee-ink);
}

dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(3px);
}

dialog[open] {
  animation: sheet-up 0.35s cubic-bezier(0.2, 1.2, 0.4, 1) both;
}

@keyframes sheet-up {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
}

@media (max-width: 520px) {
  dialog {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    border-radius: 26px 26px 0 0;
    border-bottom: 0;
    box-shadow: none;
    padding-bottom: env(safe-area-inset-bottom);
  }
}

.sheet {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 20px 20px;
}

.sheet h2 {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
}

.sheet > p {
  text-align: center;
  color: var(--ink-soft);
}

.sheet__bee {
  width: 64px;
  margin: 0 auto -6px;
  animation: hover 2.2s ease-in-out infinite;
}

.sheet__row {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.sharecard {
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--bg);
  border: 2px dashed var(--line);
  font: 500 16px/1.5 ui-monospace, "SF Mono", Menlo, monospace;
  white-space: pre-wrap;
  text-align: left;
  align-self: center;
}

.howto {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.howto li {
  display: flex;
  align-items: center;
  gap: 14px;
}

.howto__art {
  flex: none;
  display: grid;
  place-items: center;
  width: 58px;
}

.howto__art--hex {
  font-size: 15px;
  letter-spacing: -2px;
}

.howto__note {
  font-size: 15px;
  color: var(--ink-soft);
  text-align: center;
}

.howto__note--fun {
  font-style: italic;
}

/* ── Toast ──────────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 10;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--bee-ink);
  color: var(--honey);
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: opacity 0.2s, transform 0.2s;
}

.toast.is-shown {
  opacity: 1;
  transform: translate(-50%, 0);
}

.noscript {
  padding: 40px 16px;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .dance__bee {
    offset-distance: 10%;
  }
}
