:root {
  color-scheme: light;
  --bg: #eff4f7;
  --ink: #17242c;
  --muted: #647782;
  --blue: #174a7c;
  --blue-2: #0f3158;
  --navy: #101723;
  --paper: #fffdf8;
  --line: rgba(23, 36, 44, .14);
  --gold: #e8b44b;
  --green: #1f7a52;
  --red: #b34848;
  --shadow: 0 18px 48px rgba(12, 34, 52, .16);
  --sans: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;
  --serif: "Yu Mincho", "Hiragino Mincho ProN", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at 18% 8%, rgba(232, 180, 75, .22), transparent 32%),
    radial-gradient(circle at 85% 22%, rgba(45, 125, 121, .16), transparent 30%),
    linear-gradient(145deg, #f7fafb, var(--bg));
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.75;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(232, 180, 75, .92);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
}

.app {
  width: min(100%, 480px);
  min-height: 100dvh;
  margin: 0 auto;
  background: linear-gradient(180deg, #fffdf8 0%, #f7f4ea 100%);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 13px;
  background: #061223;
  color: #fff;
  border-bottom: 1px solid rgba(232, 180, 75, .34);
}

.brand,
.eyebrow,
.label,
.counter,
.isbn,
.genre {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
}

.brand,
.counter {
  color: rgba(255, 255, 255, .72);
}

.topbar h1 {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: .04em;
}

.progress {
  height: 4px;
  background: #102235;
}

.progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
  transition: width .35s ease;
}

.screen {
  display: none;
  flex: 1;
  padding: 28px 22px 30px;
}

.screen.is-active {
  display: flex;
  flex-direction: column;
}

.hero {
  --pack-accent: #1d5f8f;
  --shelf-filter: saturate(1) brightness(1);
  --shelf-overlay:
    radial-gradient(circle at 52% 38%, rgba(232, 180, 75, .24), transparent 28%),
    linear-gradient(180deg, transparent 0%, rgba(6, 18, 35, .18) 62%, #061223 100%);
  --shelf-pattern: radial-gradient(circle at 50% 44%, rgba(232, 180, 75, .42), transparent 8%);
  justify-content: flex-start;
  padding: 0 0 22px;
  background: #061223;
  color: #f7efe3;
}

.hero .eyebrow,
.question .eyebrow,
.result > .eyebrow {
  color: var(--gold);
}

.hero h2,
.question h2,
.draw h2,
.result-card h2 {
  font-family: var(--serif);
  letter-spacing: .03em;
}

.hero h2 {
  margin: 6px 0 8px;
  font-size: 27px;
  line-height: 1.36;
  color: #fff5e7;
}

.copy {
  margin: 0;
  color: rgba(255, 245, 231, .74);
  font-size: 14px;
}

.mode-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  width: 100%;
}

.mode-rail::-webkit-scrollbar {
  display: none;
}

.mode-panel {
  min-height: 468px;
  scroll-snap-align: start;
  position: relative;
}

.shelf-hero {
  position: relative;
  height: 232px;
  overflow: hidden;
  border-bottom: 1px solid rgba(232, 180, 75, .42);
  background: #061223;
  isolation: isolate;
  transition: border-color .28s ease, background .28s ease;
}

.shelf-hero img {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 35%;
  display: block;
  filter: var(--shelf-filter);
  opacity: 1;
  transform: scale(1.02);
  transition: filter .28s ease, opacity .28s ease, transform .28s ease;
}

.shelf-hero:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background: var(--shelf-overlay);
  mix-blend-mode: screen;
  opacity: .95;
  pointer-events: none;
}

.shelf-hero:after,
.pack-stage:after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  background:
    var(--shelf-pattern),
    linear-gradient(180deg, rgba(6, 18, 35, .04), rgba(6, 18, 35, .24) 58%, #061223 100%);
  pointer-events: none;
}

.pack-stage:after {
  background: linear-gradient(180deg, rgba(6, 18, 35, .04), rgba(6, 18, 35, .24) 58%, #061223 100%);
}

.shelf-runway {
  display: none;
}

.pack-theme-all {
  --shelf-filter: saturate(1.04) brightness(.98) contrast(1.02);
  --shelf-overlay:
    radial-gradient(circle at 52% 34%, rgba(232, 180, 75, .26), transparent 25%),
    linear-gradient(180deg, transparent 0%, rgba(6, 18, 35, .14) 58%, #061223 100%);
  --shelf-pattern:
    radial-gradient(circle at 52% 34%, rgba(232, 180, 75, .5), transparent 9%);
}

.pack-theme-new {
  --shelf-filter: saturate(1.18) brightness(1.03) hue-rotate(-9deg);
  --shelf-overlay:
    radial-gradient(circle at 50% 32%, rgba(255, 208, 155, .32), transparent 24%),
    radial-gradient(circle at 72% 24%, rgba(229, 92, 132, .28), transparent 28%),
    linear-gradient(115deg, transparent 0 36%, rgba(255, 255, 255, .2) 43%, transparent 51%),
    linear-gradient(180deg, rgba(143, 63, 95, .12), rgba(6, 18, 35, .12) 58%, #061223 100%);
  --shelf-pattern:
    radial-gradient(circle at 50% 34%, rgba(255, 210, 150, .46), transparent 9%),
    linear-gradient(90deg, transparent 0 44%, rgba(255, 255, 255, .16) 48%, transparent 54%);
}

.pack-theme-mystery {
  --shelf-filter: saturate(.82) brightness(.72) contrast(1.2) hue-rotate(12deg);
  --shelf-overlay:
    radial-gradient(circle at 47% 42%, rgba(97, 111, 171, .28), transparent 20%),
    radial-gradient(circle at 20% 18%, rgba(23, 40, 70, .52), transparent 32%),
    linear-gradient(90deg, rgba(0, 0, 0, .42), transparent 28% 72%, rgba(0, 0, 0, .44)),
    linear-gradient(180deg, rgba(13, 17, 34, .34), rgba(6, 18, 35, .22) 54%, #061223 100%);
  --shelf-pattern:
    radial-gradient(circle at 48% 42%, rgba(119, 133, 194, .34), transparent 7%),
    repeating-linear-gradient(100deg, transparent 0 18px, rgba(255,255,255,.035) 19px 20px);
}

.pack-theme-summer {
  --shelf-filter: saturate(1.16) brightness(1.08) contrast(.96) hue-rotate(4deg);
  --shelf-overlay:
    radial-gradient(circle at 46% 30%, rgba(255, 221, 130, .32), transparent 24%),
    radial-gradient(circle at 72% 18%, rgba(68, 193, 185, .26), transparent 28%),
    linear-gradient(160deg, rgba(255, 244, 188, .18), transparent 38%),
    linear-gradient(180deg, rgba(45, 125, 121, .14), rgba(6, 18, 35, .12) 58%, #061223 100%);
  --shelf-pattern:
    radial-gradient(circle at 46% 31%, rgba(255, 222, 126, .46), transparent 9%),
    linear-gradient(115deg, transparent 0 42%, rgba(117, 224, 215, .13) 46%, transparent 55%);
}

.shelf-copy {
  padding: 18px 28px 12px;
  text-align: center;
}

.pack-summary {
  margin: 0 22px 12px;
  border: 1px solid color-mix(in srgb, var(--pack-accent), var(--gold) 42%);
  border-radius: 8px;
  padding: 10px 16px;
  text-align: center;
  background:
    linear-gradient(90deg, rgba(255,255,255,.06), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 14px 28px rgba(0,0,0,.2);
}

.pack-summary span,
.pack-summary small {
  display: block;
  color: rgba(255, 245, 231, .66);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
}

.pack-summary b {
  display: block;
  margin: 2px 0;
  color: #fff5e7;
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: .04em;
}

.mode-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 0 14px;
}

.mode-dots i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .28);
}

.mode-dots i.on {
  width: 22px;
  background: var(--gold);
}

.theme-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 22px 6px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .16em;
  white-space: nowrap;
}

.theme-label:before,
.theme-label:after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(232, 180, 75, .42);
}

.pack-stage {
  --pack-accent: #1d5f8f;
  position: relative;
  height: 272px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(232, 180, 75, .24), transparent 36%),
    linear-gradient(180deg, #111a28, #061223);
  border-bottom: 1px solid rgba(232, 180, 75, .42);
}

.gacha-machine {
  position: absolute;
  left: 50%;
  top: 18px;
  width: 214px;
  height: 232px;
  transform: translateX(-50%);
  z-index: 2;
}

.machine-dome {
  position: relative;
  width: 164px;
  height: 116px;
  margin: 0 auto;
  border: 2px solid rgba(232, 180, 75, .66);
  border-radius: 82px 82px 24px 24px;
  background:
    radial-gradient(circle at 48% 44%, rgba(255,255,255,.38), transparent 13%),
    radial-gradient(circle at 52% 58%, color-mix(in srgb, var(--pack-accent), #fff 18%), transparent 35%),
    linear-gradient(145deg, rgba(255,255,255,.2), rgba(255,255,255,.04));
  box-shadow: inset 0 0 18px rgba(255,255,255,.18), 0 18px 48px rgba(0,0,0,.32);
  overflow: hidden;
}

.machine-dome:before {
  content: "";
  position: absolute;
  inset: 16px 22px auto 22px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.28), transparent);
}

.machine-body {
  position: relative;
  min-height: 102px;
  margin-top: -6px;
  border: 2px solid rgba(232, 180, 75, .72);
  border-radius: 16px 16px 22px 22px;
  padding: 20px 70px 16px 20px;
  color: #fff5e7;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--pack-accent), #fff 5%), color-mix(in srgb, var(--pack-accent), #000 34%)),
    #12314f;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16), 0 18px 42px rgba(0,0,0,.34);
}

.machine-body:after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -12px;
  height: 12px;
  border-radius: 0 0 9px 9px;
  background: linear-gradient(180deg, #946021, #4b2c13);
}

.machine-body b {
  display: block;
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.28;
}

.machine-body small {
  display: block;
  margin-top: 6px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
}

.machine-knob {
  position: absolute;
  right: 20px;
  top: 26px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 32%, #fff2b9, #c18a36 34%, #714411 70%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.22), 0 8px 16px rgba(0,0,0,.32);
}

.machine-knob:after {
  content: "";
  position: absolute;
  left: 50%;
  top: 9px;
  width: 5px;
  height: 24px;
  margin-left: -2.5px;
  border-radius: 999px;
  background: rgba(73, 45, 15, .58);
  transform: rotate(48deg);
}

.capsule,
.book-capsule {
  position: absolute;
  display: block;
}

.capsule {
  width: 34px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,.84) 0 48%, var(--gold) 49% 100%);
  opacity: .8;
}

.capsule-a {
  left: 26px;
  bottom: 22px;
  transform: rotate(-22deg);
}

.capsule-b {
  right: 22px;
  bottom: 30px;
  transform: rotate(20deg);
}

.capsule-c {
  right: 54px;
  top: 28px;
  transform: rotate(-12deg);
  opacity: .55;
}

.book-capsule {
  left: 50%;
  bottom: 18px;
  width: 46px;
  height: 62px;
  margin-left: -23px;
  border-radius: 5px 9px 9px 5px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.16), transparent 32%),
    linear-gradient(180deg, #203962, #07172d);
  border: 1px solid rgba(232, 180, 75, .72);
  box-shadow: 0 0 28px rgba(232, 180, 75, .62);
  animation: pulseGlow 1.7s ease-in-out infinite alternate;
}

.hero-shelf {
  position: relative;
  width: min(100%, 318px);
  height: 154px;
  margin: 0 auto 24px;
  perspective: 800px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .14), transparent 42%),
    linear-gradient(92deg, #26323b, #15202a);
  box-shadow: inset 0 -15px 0 #8a5c35, 0 18px 32px rgba(16, 35, 54, .18);
  overflow: hidden;
}

.hero-shelf:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  height: 9px;
  background: #a66f40;
  box-shadow: 0 28px 0 #7d512e;
}

.hero-shelf span {
  position: absolute;
  bottom: 31px;
  width: 42px;
  height: 94px;
  border-radius: 4px 8px 8px 4px;
  box-shadow: 0 12px 18px rgba(0, 0, 0, .22);
  transform: rotateY(-12deg);
}

.hero-shelf span:nth-child(1) {
  left: 34px;
  background: #b84f57;
}

.hero-shelf span:nth-child(2) {
  left: 82px;
  background: var(--blue);
  height: 106px;
}

.hero-shelf span:nth-child(3) {
  left: 132px;
  background: var(--gold);
  height: 86px;
}

.hero-shelf span:nth-child(4) {
  left: 180px;
  background: #2d7d79;
  height: 112px;
}

.hero-shelf span:nth-child(5) {
  left: 232px;
  background: #3c455e;
}

.hero-shelf span:nth-child(4):after {
  content: "";
  position: absolute;
  inset: -14px -18px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 180, 75, .5), transparent 68%);
  filter: blur(6px);
  z-index: -1;
  animation: pulseGlow 1.7s ease-in-out infinite alternate;
}

.pack-picker {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  margin: 0;
  padding: 6px 22px 10px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  align-items: center;
}

.pack-picker::-webkit-scrollbar {
  display: none;
}

.pack-booster {
  --pack-accent: var(--blue);
  position: relative;
  flex: 0 0 auto;
  width: 138px;
  min-height: 72px;
  border-radius: 6px;
  padding: 10px 13px 9px;
  overflow: hidden;
  text-align: left;
  color: #261a0e;
  background:
    linear-gradient(135deg, rgba(255,255,255,.28), transparent 38%),
    linear-gradient(180deg, #d9b66b, #a97830);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.24), 0 8px 18px rgba(0,0,0,.22);
  transform: none;
  scroll-snap-align: start;
  transition: transform .22s ease, box-shadow .22s ease;
  border: 1px solid rgba(255, 255, 255, .3);
}

.pack-booster:before,
.pack-booster:after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  top: 50%;
  margin-top: -3.5px;
  border-radius: 50%;
  background: rgba(73, 45, 15, .42);
}

.pack-booster:before {
  left: 7px;
  right: auto;
}

.pack-booster:after {
  right: 7px;
  left: auto;
}

.pack-booster.is-selected {
  transform: translateY(-2px);
  color: #fff5e7;
  background: linear-gradient(180deg, #173a60, #081b34);
  box-shadow: 0 0 0 2px rgba(232, 180, 75, .72), 0 12px 22px rgba(0,0,0,.28);
}

.pack-booster.is-selected:before {
  box-shadow: 0 -10px 22px rgba(232, 180, 75, .32);
}

.pack-booster b,
.pack-booster small,
.pack-booster em,
.pack-window,
.pack-top {
  position: relative;
  display: block;
  z-index: 2;
}

.pack-booster b {
  display: block;
  min-height: auto;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.25;
}

.pack-booster small {
  display: block;
  margin-top: 4px;
  color: rgba(38, 26, 14, .72);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.45;
}

.pack-booster em {
  display: block;
  margin-top: 8px;
  color: rgba(38, 26, 14, .62);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .12em;
}

.pack-booster.is-selected small,
.pack-booster.is-selected em {
  color: rgba(255, 245, 231, .7);
}

.pack-shine,
.pack-top,
.pack-window {
  display: none;
}

/*
.pack-shine {
  position: absolute;
  inset: -42px auto auto 38%;
  width: 86px;
  height: 320px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent);
  transform: rotate(18deg);
}

.pack-top {
  position: absolute;
  top: 35px;
  left: 50%;
  width: 72px;
  height: 18px;
  margin-left: -36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .24);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
}

.pack-window {
  width: 94px;
  height: 54px;
  margin: 0 auto 13px;
  border-radius: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  padding: 8px;
  background: rgba(10, 17, 26, .28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .24);
}

.pack-window i {
  display: block;
  width: 17px;
  border-radius: 3px 5px 5px 3px;
  background: rgba(255, 255, 255, .88);
}

.pack-window i:nth-child(1) { height: 32px; transform: rotate(-5deg); }
.pack-window i:nth-child(2) { height: 38px; background: var(--gold); }
.pack-window i:nth-child(3) { height: 28px; transform: rotate(5deg); }

.pack-booster.is-selected .pack-shine {
  animation: packSweep 1.3s ease-in-out infinite;
}
*/

.data-note {
  margin: 12px 30px 0;
  color: rgba(255, 245, 231, .68);
  font-size: 12px;
  text-align: center;
}

.store-preference {
  order: 5;
  display: grid;
  gap: 6px;
  margin: 2px 22px 14px;
}

.store-preference span {
  color: rgba(255, 245, 231, .72);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
}

.store-preference select,
.preferred-stock select {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(232, 180, 75, .42);
  border-radius: 6px;
  padding: 10px 36px 10px 12px;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.primary,
.secondary,
.ghost,
.link-button {
  width: 100%;
  min-height: 50px;
  border-radius: 6px;
  padding: 13px 16px;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .04em;
}

.primary {
  width: calc(100% - 44px);
  margin: 0 22px;
  border: 1px solid rgba(232, 180, 75, .64);
  background: linear-gradient(180deg, #143354, #071a32);
  color: #fff5e7;
  box-shadow: 0 12px 22px rgba(0,0,0,.28);
}

.hero .primary {
  order: 6;
}

.hero .data-note {
  order: 7;
}

.secondary {
  background: #e7eef3;
  color: var(--blue-2);
}

.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.question h2 {
  margin: 12px 0 22px;
  font-size: 23px;
  line-height: 1.5;
}

.options {
  display: grid;
  gap: 10px;
}

.option {
  width: 100%;
  padding: 15px 16px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 9px;
  text-align: left;
  box-shadow: 0 8px 18px rgba(21, 39, 51, .05);
}

.option:hover {
  border-color: rgba(23, 74, 124, .32);
}

.option strong {
  display: block;
  font-size: 15px;
}

.option span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.option:active {
  transform: translateY(1px);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
  padding-top: 24px;
}

.actions .secondary {
  grid-column: 1 / -1;
}

.draw {
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding-top: 0;
  background: #061223;
  color: #fff5e7;
  overflow: hidden;
}

.draw h2 {
  margin: 10px 0 8px;
  color: #fff5e7;
}

.draw p {
  margin: 0;
  color: rgba(255, 245, 231, .72);
}

.draw-shelf {
  --pack-accent: #1d5f8f;
  position: relative;
  width: calc(100% + 44px);
  height: min(58dvh, 430px);
  min-height: 344px;
  margin: 0 -22px 22px;
  perspective: 900px;
  background: #061223;
  border-bottom: 1px solid rgba(232, 180, 75, .48);
  box-shadow: 0 24px 48px rgba(0,0,0,.32);
  overflow: hidden;
}

.draw-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 33%;
  opacity: 0;
  transform: scale(1.05);
  filter: saturate(.96) brightness(.64) contrast(1.08);
  animation: drawBgIn 2.65s ease both;
}

.draw-dark,
.draw-beam,
.draw-slot,
.draw-flare {
  position: absolute;
  pointer-events: none;
}

.draw-dark {
  inset: 0;
  background:
    radial-gradient(circle at 50% 36%, transparent 0 13%, rgba(6, 18, 35, .3) 26%, rgba(6, 18, 35, .9) 78%),
    linear-gradient(180deg, rgba(6,18,35,.04), #061223 95%);
  animation: drawDarkPulse 2.65s ease both;
}

.draw-beam {
  left: 50%;
  top: 18px;
  width: 190px;
  height: 260px;
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse at 50% 50%, rgba(255, 226, 145, .62), rgba(232, 180, 75, .18) 38%, transparent 72%);
  filter: blur(8px);
  opacity: 0;
  animation: drawBeam 2.65s ease both;
}

.draw-slot {
  left: 50%;
  top: 104px;
  width: 108px;
  height: 158px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--pack-accent), #fff 28%), rgba(232, 180, 75, .48) 30%, transparent 67%);
  filter: blur(15px);
  opacity: 0;
  animation: drawSlotGlow 2.65s ease both;
}

.draw-book {
  --spine: #1b2d48;
  position: absolute;
  left: 50%;
  top: 128px;
  width: 84px;
  height: 132px;
  transform-style: preserve-3d;
  transform-origin: center;
  opacity: 0;
  animation: bookExtract 2.35s cubic-bezier(.17,.78,.2,1) .24s both;
}

.draw-book img,
.draw-spine {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: 5px 9px 9px 5px;
  backface-visibility: hidden;
  box-shadow: 0 0 0 1px rgba(232, 180, 75, .58), 0 22px 34px rgba(0,0,0,.45);
}

.draw-book img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: none;
  animation: coverAppear .86s ease 1.72s both;
}

.draw-spine {
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255,255,255,.18), transparent 30%, rgba(0,0,0,.18) 72%),
    linear-gradient(180deg, color-mix(in srgb, var(--spine), #fff 8%), color-mix(in srgb, var(--spine), #000 26%));
  animation: spineFade .78s ease 1.68s both;
}

.draw-spine:before,
.draw-spine:after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 1px;
  background: rgba(232, 180, 75, .7);
}

.draw-spine:before {
  top: 14px;
}

.draw-spine:after {
  bottom: 14px;
}

.draw-spine i {
  position: absolute;
  left: 50%;
  top: 30px;
  max-width: 92px;
  color: rgba(255, 245, 231, .88);
  font-family: var(--serif);
  font-size: 10px;
  font-style: normal;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateX(-50%) rotate(90deg);
  transform-origin: center;
}

.draw-flare {
  left: 50%;
  top: 174px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: #fff7d6;
  box-shadow: 0 0 18px #fff2ad, 0 0 48px color-mix(in srgb, var(--pack-accent), #fff 35%);
  opacity: 0;
  animation: drawFlare 2.65s ease both;
}

.draw-dust {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.draw-dust i {
  position: absolute;
  left: calc(50% + var(--x, 0px));
  top: calc(44% + var(--y, 0px));
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 233, 170, .8);
  opacity: 0;
  animation: dustRise 1.7s ease var(--d, .5s) both;
}

.draw-dust i:nth-child(1) { --x: -70px; --y: 20px; --d: .52s; }
.draw-dust i:nth-child(2) { --x: -36px; --y: -18px; --d: .72s; }
.draw-dust i:nth-child(3) { --x: 48px; --y: 10px; --d: .64s; }
.draw-dust i:nth-child(4) { --x: 78px; --y: -26px; --d: .88s; }
.draw-dust i:nth-child(5) { --x: 12px; --y: 34px; --d: .76s; }

@keyframes wobble {
  from { transform: translateY(0) rotate(-4deg); }
  to { transform: translateY(-10px) rotate(7deg); }
}

@keyframes spin {
  from { transform: rotate(0); }
  to { transform: rotate(430deg); }
}

@keyframes drop {
  from { opacity: 0; transform: translateY(-60px) scale(.7); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shelfIn {
  from { opacity: 0; transform: translateY(28px) rotateY(-28deg); }
  to { opacity: 1; transform: translateY(16px) rotateY(-18deg) rotate(var(--tilt)); }
}

@keyframes chosenBook {
  0% { opacity: 0; transform: translateY(16px) rotateY(-18deg) scale(.8); }
  45% { opacity: 1; transform: translateY(-14px) rotateY(0) scale(1.08); }
  100% { opacity: 1; transform: translateY(-8px) rotateY(0) scale(1); }
}

@keyframes drawBgIn {
  0% { opacity: 0; transform: scale(1.08); filter: saturate(.85) brightness(.34) contrast(1.08); }
  18% { opacity: 1; }
  100% { opacity: 1; transform: scale(1.02); filter: saturate(.96) brightness(.64) contrast(1.08); }
}

@keyframes drawDarkPulse {
  0% { opacity: 1; }
  44% { opacity: .92; }
  100% { opacity: 1; }
}

@keyframes drawBeam {
  0% { opacity: 0; transform: translateX(-50%) scale(.7); }
  28% { opacity: .25; }
  58% { opacity: .9; transform: translateX(-50%) scale(1.08); }
  100% { opacity: .62; transform: translateX(-50%) scale(1); }
}

@keyframes drawSlotGlow {
  0% { opacity: 0; transform: translateX(-50%) scale(.58); }
  42% { opacity: .35; }
  68% { opacity: .95; transform: translateX(-50%) scale(1.12); }
  100% { opacity: .58; transform: translateX(-50%) scale(1); }
}

@keyframes bookExtract {
  0% { opacity: 0; transform: translateX(-50%) translateY(-4px) translateZ(-120px) rotateY(82deg) scale(.58); }
  28% { opacity: 1; transform: translateX(-50%) translateY(-8px) translateZ(-80px) rotateY(68deg) scale(.66); }
  58% { opacity: 1; transform: translateX(-50%) translateY(18px) translateZ(40px) rotateY(28deg) scale(.94); }
  78% { opacity: 1; transform: translateX(-50%) translateY(26px) translateZ(92px) rotateY(-4deg) scale(1.08); }
  100% { opacity: 1; transform: translateX(-50%) translateY(22px) translateZ(96px) rotateY(0) scale(1.04); }
}

@keyframes spineFade {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes coverAppear {
  0% { opacity: 0; filter: brightness(1.15); }
  100% { opacity: 1; filter: brightness(1); }
}

@keyframes drawFlare {
  0%, 30% { opacity: 0; transform: translateX(-50%) scale(.4); }
  54% { opacity: 1; transform: translateX(-50%) scale(1.55); }
  100% { opacity: .18; transform: translateX(-50%) scale(.7); }
}

@keyframes dustRise {
  0% { opacity: 0; transform: translateY(18px) scale(.7); }
  30% { opacity: .95; }
  100% { opacity: 0; transform: translateY(-46px) scale(1.15); }
}

@keyframes pulseGlow {
  from { opacity: .45; transform: scale(.92); }
  to { opacity: 1; transform: scale(1.08); }
}

@keyframes packSweep {
  from { transform: translateX(-40px) rotate(18deg); }
  to { transform: translateX(56px) rotate(18deg); }
}

.result {
  gap: 16px;
}

.result-card,
.stock-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(18, 39, 54, .06);
}

.result-book-hero {
  display: grid;
  grid-template-columns: 106px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.cover-wrap {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.cover-wrap img {
  width: 106px;
  max-height: 158px;
  border-radius: 4px;
  box-shadow: 0 14px 28px rgba(12, 34, 52, .20);
  background: #eef2f5;
}

.genre {
  color: var(--gold);
}

.result-card h2 {
  margin: 6px 0 6px;
  font-size: 24px;
  line-height: 1.45;
}

.book-meta {
  min-width: 0;
}

.sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.isbn {
  margin-top: 8px;
  color: var(--muted);
}

.match-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.match-summary {
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  background: #f3f7f6;
  border: 1px solid rgba(31, 122, 82, .14);
}

.match-summary .match-chips {
  margin-top: 8px;
}

.match-summary .match-chips span {
  padding: 6px 10px;
  font-size: 12px;
}

.selection-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.match-chips span {
  border-radius: 999px;
  padding: 4px 9px;
  background: #eef4f1;
  color: #245a4b;
  font-size: 11px;
  font-weight: 700;
}

.recommendation-lead {
  margin-top: 16px;
  padding: 15px;
  border: 1px solid rgba(232, 180, 75, .34);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff8e9, #fffdf8);
}

.recommendation-lead h3 {
  margin: 7px 0 6px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.55;
}

.recommendation-lead p:last-child {
  margin: 0;
  color: #40545d;
  font-size: 14px;
  line-height: 1.75;
}

.reason,
.analysis-grid,
.comment {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.preferred-stock {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(23, 74, 124, .18);
  border-radius: 8px;
  background: #f7fafc;
}

.preferred-stock label {
  display: grid;
  gap: 6px;
}

.preferred-stock label > span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}

.preferred-stock select {
  border-color: var(--line);
  background: #fff;
}

.preferred-stock-body p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.preferred-stock-status {
  display: grid;
  gap: 3px;
  border-left: 4px solid var(--green);
  padding: 8px 10px;
  background: #edf7f1;
}

.preferred-stock-status b {
  color: #195f40;
}

.preferred-stock-status small {
  color: #48645a;
}

.preferred-stock-status.is-unavailable {
  border-left-color: var(--muted);
  background: #eef2f4;
}

.preferred-stock-status.is-unavailable b {
  color: #455a64;
}

.result-stock-link {
  width: 100%;
  margin: 16px 0 0;
}

.result-details {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.result-details > summary,
.stock-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  color: var(--blue-2);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.result-details > summary::-webkit-details-marker,
.stock-summary::-webkit-details-marker {
  display: none;
}

.result-details > summary span,
.stock-summary i {
  font-style: normal;
  font-size: 20px;
  transition: transform .2s ease;
}

.result-details[open] > summary span,
.stock-card[open] .stock-summary i {
  transform: rotate(45deg);
}

.result-details .reason {
  margin-top: 0;
}

.analysis-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.answer-trail {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: #f5f8f8;
}

.answer-trail span,
.quality-note span {
  width: 100%;
  color: #55707b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.answer-trail b {
  border-radius: 999px;
  padding: 4px 9px;
  color: #12314f;
  background: #e6f1ef;
  font-size: 12px;
  line-height: 1.4;
}

.axis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin-bottom: 6px;
}

.axis-meter {
  display: grid;
  gap: 5px;
}

.axis-meter span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
}

.axis-meter i {
  display: block;
  height: 6px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--gold) var(--pct), #e6ecef 0);
}

.analysis-item {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 9px 0;
}

.analysis-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
}

.analysis-item b {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.7;
}

.quality-note {
  display: grid;
  gap: 3px;
  border-radius: 8px;
  padding: 12px;
  background: #fff8e7;
  border: 1px solid rgba(232, 180, 75, .34);
}

.quality-note b {
  color: #493214;
  font-size: 13px;
  line-height: 1.55;
}

.quality-high {
  background: #f0f8f3;
  border-color: rgba(31, 122, 82, .22);
}

.quality-high b {
  color: #1f5f42;
}

.label {
  color: var(--blue);
}

.reason p:last-child,
blockquote {
  margin: 8px 0 0;
}

blockquote {
  padding-left: 14px;
  border-left: 3px solid var(--gold);
  color: #30424c;
}

.stock-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.stock-card {
  padding: 0 18px;
}

.stock-summary small,
.stock-summary b {
  display: block;
}

.stock-summary small {
  color: var(--blue);
  font-size: 10px;
  letter-spacing: .1em;
}

.stock-summary b {
  margin-top: 2px;
  color: var(--ink);
  font-size: 14px;
}

.stock-expanded {
  padding: 0 0 18px;
}

.stock-tools {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}

.stock-head h3 {
  margin: 3px 0 0;
  font-size: 17px;
}

.mini {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 12px;
  background: #e7eef3;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.stock-body {
  color: var(--muted);
  font-size: 14px;
}

.stock-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.store {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.store:first-child {
  border-top: 0;
}

.store b {
  font-size: 14px;
}

.store small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.badge {
  align-self: start;
  min-width: 38px;
  border-radius: 999px;
  padding: 3px 8px;
  text-align: center;
  background: #e3f2ea;
  color: var(--green);
  font-weight: 700;
}

.notice {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.error {
  color: var(--red);
}

.result-actions {
  display: grid;
  gap: 10px;
}

.wide {
  width: 100%;
}

@media (min-width: 760px) {
  body {
    padding: 24px 0;
  }

  .app {
    min-height: calc(100dvh - 48px);
    border-radius: 14px;
    overflow: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
