:root {
  --rose: #ea2f78;
  --rose-deep: #a9235a;
  --rose-ink: #78183f;
  --rose-paper: #fff8fb;
}

html, .sheet {
  scrollbar-color: #a9235a #ffeaf2;
  scrollbar-width: thin;
}

html::-webkit-scrollbar, .sheet::-webkit-scrollbar { width: 10px; }
html::-webkit-scrollbar-track, .sheet::-webkit-scrollbar-track { background: #ffeaf2; }
html::-webkit-scrollbar-thumb, .sheet::-webkit-scrollbar-thumb {
  border: 2px solid #ffeaf2;
  border-radius: 20px;
  background: #a9235a;
}

button { font: inherit; -webkit-tap-highlight-color: transparent; }

.cards-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 9px 20px 22px;
  background: #005ca9;
}

.journey { width: 100%; max-width: 320px; margin-bottom: 32px; }
.journey__meta { height: 18px; margin-bottom: 4px; display: flex; align-items: center; justify-content: space-between; }
.journey__meta > span { color: #fff; font-size: 14px; font-weight: 700; line-height: 1.3; }
.journey__meta > span span { font-weight: 400; }
.journey__track { height: 4px; overflow: hidden; border-radius: 50px; background: rgb(255 255 255 / 20%); }
.journey__track span { display: block; width: 3.333%; height: 100%; border-radius: inherit; background: #f68800; transition: width .35s cubic-bezier(.2,.8,.2,1); }
.cards-stage__index {
  width: 20px;
  height: 18px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  color: #fff;
  background: transparent;
  cursor: pointer;
}
.cards-stage__index img { display: block; }

.deck { --card-head: #f3aa44; position: relative; width: 100%; max-width: 320px; touch-action: pan-y; outline: none; -webkit-user-select: none; user-select: none; }
.deck[data-theme="prevent"] { --card-head: #e67d57; }
.deck[data-theme="notice"] { --card-head: #e95f7d; }
.deck[data-theme="exam"] { --card-head: #e56eb0; }
.deck[data-theme="care"] { --card-head: #ad66c5; }
.deck__shadow { position: absolute; height: 100%; width: 100%; pointer-events: none; overflow: hidden; border-radius: 12px; background: linear-gradient(var(--card-head) 0 64px, #ccc 64px); }
.deck__shadow--back { left: -8px; top: 0; background: linear-gradient(var(--card-head) 0 64px, #919191 64px); transform: rotate(-2.08deg); }
.deck__shadow--front { left: 3px; top: 1px; transform: rotate(1.8deg); }
.card {
  position: relative;
  z-index: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  border-radius: 12px;
  color: #2c2c2c;
  background: #fff;
  box-shadow: 0 0 7px #005ca9;
  transform-origin: center center;
  will-change: transform;
}
.card__art { position: relative; height: 64px; flex: 0 0 auto; overflow: hidden; background: var(--card-head); }
.card__flower { position: absolute; display: block; max-width: none; right: -78px; top: -74px; pointer-events: none; }
.card__art-number { position: absolute; left: 11px; top: 7px; color: #fff; font-size: 58px; font-weight: 800; line-height: 1.3; letter-spacing: -.055em; }
.card__category { position: absolute; right: 8px; bottom: 8px; padding: 4px 8px; border: 1px solid #fff; border-radius: 26px; color: #fff; font-size: 12px; font-weight: 500; line-height: 1.3; text-transform: uppercase; white-space: nowrap; }
.card__content { display: flex; align-items: center; min-height: var(--card-content-height, 156px); padding: 30px 16px; }
.card__statement { margin: 0; color: #2c2c2c; font-size: 17px; font-weight: 400; line-height: 1.34; letter-spacing: -.025em; }

.deck-nav { width: 100%; max-width: 320px; height: 55px; margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.deck-nav__arrow { flex: 0 0 32px; width: 32px; height: 32px; padding: 0; display: grid; place-items: center; border: 1px solid #fff; border-radius: 50%; color: #fff; background: transparent; cursor: pointer; transition: background .2s ease, transform .2s ease; }
.deck-nav__arrow:not(:disabled):active { transform: scale(.94); background: rgb(255 255 255 / 20%); }
.deck-nav__arrow:disabled { cursor: not-allowed; opacity: .45; }
.deck-nav__arrow img { display: block; }
#previousCard img { transform: rotate(90deg); }
#nextCard img { transform: rotate(-90deg); }
.deck-nav__hint { flex: 1; margin: 0; display: grid; color: #fff; text-align: center; }
.deck-nav__hint span { font-size: 14px; font-weight: 700; line-height: 1.3; }
.deck-nav__hint small { color: #fff; font-size: 14px; line-height: 1.3; }

.sheet { position: fixed; inset: auto 0 0; width: min(100%, 480px); max-width: 480px; max-height: min(88svh, 780px); margin: 0 auto; padding: 10px 19px calc(26px + env(safe-area-inset-bottom)); overflow-y: auto; border: 0; border-radius: 26px 26px 0 0; color: var(--rose-ink); background: var(--rose-paper); box-shadow: 0 -24px 60px rgb(92 9 45 / 25%); }
.sheet::backdrop { background: rgb(81 10 43 / 63%); backdrop-filter: blur(4px); }
.sheet__handle { width: 38px; height: 5px; margin: 0 auto 19px; border-radius: 10px; background: #edb9d0; }
.sheet__header { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.sheet__header p { margin: 0 0 4px; color: var(--rose-deep); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.sheet__header h2 { margin: 0; font-size: 26px; letter-spacing: -.04em; }
.sheet__close { flex: 0 0 35px; width: 35px; height: 35px; display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--rose-ink); background: #fce1ec; font-size: 27px; line-height: 1; cursor: pointer; }
.sheet__intro { margin: 8px 0 20px; color: #9c4e70; font-size: 13px; line-height: 1.5; }
.index-list { margin: 0; padding: 0 0 12px; display: grid; gap: 7px; list-style: none; }
.index-list button { width: 100%; padding: 12px; display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; border: 1px solid #f1d4e0; border-radius: 12px; color: var(--rose-ink); background: #fff; text-align: left; cursor: pointer; }
.index-list button[aria-current="step"] { border-color: #d9598d; background: #fff0f6; }
.index-list__number { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--rose-deep); font-size: 12px; font-weight: 800; }
.index-list__text { font-size: 12px; font-weight: 600; line-height: 1.35; }
body.modal-open { overflow: hidden; }
:is(button, .deck):focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px var(--rose-deep); }

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