*{box-sizing:border-box} :root{--gold:#c9a56b;--ink:#6b4a24} html{scroll-behavior:smooth} body{margin:0;color:var(--ink);font-family:Georgia,"Hiragino Kaku Gothic ProN",serif;background:linear-gradient(135deg,#fffaf1,#f1dfbd)} button,a{-webkit-tap-highlight-color:transparent}button{cursor:pointer;font:inherit}button:focus-visible,a:focus-visible{outline:3px solid #8b5f22;outline-offset:4px}.hidden{display:none!important}header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px clamp(16px,4vw,50px);background:#fffaf1;border-bottom:1px solid #c9a56b66}.brand{color:inherit;text-decoration:none;font-size:21px;letter-spacing:.14em;white-space:nowrap}.langs{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}.langs button,.action{border:1px solid #c9a56b;border-radius:24px;padding:10px 15px;color:#6b4a24;background:#fff9ef;min-height:44px}.langs button.active{background:#6b4a24;color:#fff9ef}.detail{min-height:80vh;text-align:center;padding:42px 16px 60px;background:linear-gradient(#fff1cc,#fbd4a7)}.intro{max-width:720px;margin:auto}.intro small{font-size:11px;letter-spacing:.18em}.intro h1{font-weight:normal;font-size:clamp(30px,6vw,48px);margin:18px 0}.intro p{line-height:1.9}#notice{font-size:13px} .reading-copy{white-space:pre-line}footer{text-align:center;padding:25px 12px;font-size:12px}.footer-links{display:flex;gap:16px;flex-wrap:wrap;justify-content:center;margin-top:12px}.footer-links a{color:inherit}body.sparkles-off .gold-particle,body.sparkles-off .magic-halo{display:none!important}.policy{max-width:800px;margin:auto;padding:36px 22px 70px;line-height:1.9}.policy h1{font-size:clamp(26px,5vw,36px)}.policy h2{font-size:20px;margin-top:28px}.policy a{color:inherit;overflow-wrap:anywhere}[hidden]{display:none!important}
.reading {
  max-width: 850px;
  margin: 30px auto 0;
  padding: 28px 18px;
  background: #fffaf0e8;
  border: 1px solid #d4b47b;
  border-radius: 24px;
  color: #674825;
  box-shadow: 0 12px 30px #8a602a22;
}

.reading h3 {
  font-size: 25px;
  font-weight: normal;
  margin: 8px 0;
}

.reading .hint {
  font-size: 14px;
  line-height: 1.9;
}

.cards {
  display: flex;
  justify-content: flex-start;
  gap: 14px;
  margin: 32px 0;
  padding: 18px 14px 28px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  perspective: 1100px;
}

.card-slot {
  position: relative;
  width: clamp(88px, 12vw, 128px);
  aspect-ratio: 2 / 3;
  flex-shrink: 0;
  scroll-snap-align: center;
}


.detail.morning .cards {
  justify-content: center;
  gap: clamp(8px, 2.8vw, 22px);
  padding-right: clamp(8px, 2vw, 14px);
  padding-left: clamp(8px, 2vw, 14px);
  overflow-x: hidden;
  scroll-snap-type: none;
}

.detail.morning .card-slot {
  width: clamp(64px, 21vw, 120px);
}

.tarot-card {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: none;
  position: relative;
  z-index: 2;
  transform-style: preserve-3d;
  transition: transform .35s, filter .35s;
  filter: drop-shadow(0 9px 9px #26314a55);
  cursor: pointer;
}

.tarot-card:hover:not(:disabled) {
  transform: translateY(-14px);
}

.tarot-card:disabled {
  cursor: default;
}

.card-face {
  position: absolute;
  inset: 0;
  border: 4px solid #cba76b;
  border-radius: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.card-face::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid #d6b97b;
  border-radius: 7px;
  pointer-events: none;
}

.card-back {
  background:
    radial-gradient(ellipse at center, #f8e4a1 0 2%, transparent 3% 100%),
    repeating-conic-gradient(from 22.5deg at 50% 50%, #edcc78 0deg 1deg, #815821 1.5deg 3deg, #d8ad51 3.5deg 5deg),
    linear-gradient(145deg, #f2d98f, #8e6426 48%, #f4da91);
  color: #fff3c5;
  box-shadow: inset 0 0 0 5px #9b722f, inset 0 0 0 8px #f7dfa0;
}

.card-back::after {
  content: "✧";
  position: absolute;
  inset: 12px;
  border: 1px solid #fff0b4aa;
  border-radius: 45% 45% 12px 12px;
  display: grid;
  place-items: center;
  color: #fff3c5aa;
  font-size: clamp(38px, 5vw, 64px);
  text-shadow: 0 0 16px #fff2be;
  pointer-events: none;
}

.card-back .star {
  display: none;
}

.card-back .number {
  position: relative;
  z-index: 1;
  margin-top: auto;
  margin-bottom: 20px;
  padding: 3px 9px;
  border: 1px solid #fff1bd;
  border-radius: 20px;
  background: #583b18bb;
  font-size: 12px;
  letter-spacing: 2px;
}


.detail.morning .card-back .number {
  display: none;
}

.card-front {
  background: radial-gradient(
    circle at 50% 36%,
    #fffdf1, #f3e1b9 65%, #d9b67b
  );
  color: #745026;
  transform: rotateY(180deg);
}

.card-front .art-symbol {
  width:100%; height:100%; display:block;
  font-size: clamp(37px, 8vw, 70px);
  line-height: 1.2;
}

.card-front .art-name {
  position: absolute;
  inset: auto 0 0;
  padding: 7px 3px 5px;
  background: #fffaf0e8;
  color: #67491f;
  font-size: clamp(9px, 1.1vw, 12px);
  font-weight: bold;
  text-align: center;
}

.card-front .card-art-image { width: 100%; height: 100%; object-fit: contain; display: block; }
.card-front .card-image-missing { position: absolute; inset: 12px 8px 30px; display: grid; place-items: center; text-align: center; color: #76552a; font: 12px/1.5 Georgia, serif; }

.tarot-card.turning {
  animation: tarotFlip 2s
    cubic-bezier(.32, .04, .18, 1) forwards;
  pointer-events: none;
}

@keyframes tarotFlip {
  0% {
    transform: translateY(0) rotateY(0) scale(1);
  }
  25% {
    transform: translateY(-5px) rotateY(38deg) scale(1.02);
  }
  50% {
    transform: translateY(-8px) rotateY(90deg) scale(1.04);
  }
  75% {
    transform: translateY(-5px) rotateY(142deg) scale(1.02);
  }
  100% {
    transform: translateY(0) rotateY(180deg) scale(1);
  }
}

.tarot-card.is-reversed .card-front { transform: rotateY(180deg) rotateZ(180deg); }

.tarot-card.face-revealed .card-back {
  opacity: 0;
  transition: opacity .18s ease;
}

.tarot-card.face-revealed .card-front {
  opacity: 1;
  transition: opacity .18s ease;
}

.card-stage {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #291d0b99, #130e08dd);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: stageAppear .45s ease both;
}

@keyframes stageAppear {
  from { opacity: 0; }
  to { opacity: 1; }
}

.stage-holder {
  position: relative;
  width: min(340px, 72vw, 44vh);
  aspect-ratio: 2 / 3;
  perspective: 1400px;
}

.stage-holder .tarot-card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 24px 34px #000a);
}

.stage-holder .card-face { border-radius: 12px; }
.stage-holder .card-back::after { inset: 18px; font-size: clamp(80px, 18vw, 145px); }
.stage-holder .card-back .number { font-size: 17px; margin-bottom: 30px; padding: 7px 15px; }
.stage-holder .card-front .art-name { font-size: clamp(14px, 3vw, 19px); padding: 11px 8px 9px; }
.stage-holder .card-front .card-image-missing { font-size: 17px; padding: 20px; }
.stage-holder .magic-halo { width: 180%; inset: auto; left: 50%; top: 50%; }
.stage-holder.magic-active .magic-halo { animation: centralHaloBloom 2.45s ease-out forwards; }
.stage-holder.magic-active .card-front::after { animation-duration: 2.2s; }
.stage-holder .gold-particle { width: calc(var(--size) * 1.8); height: calc(var(--size) * 1.8); }

@keyframes centralHaloBloom {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.2); }
  35% { opacity: .95; transform: translate(-50%, -50%) scale(.85); }
  70% { opacity: .8; transform: translate(-50%, -50%) scale(1.18); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.55); }
}

.reading-position { color: #9a7134; font-weight: bold; letter-spacing: .08em; }
.revealed-card.is-reversed .full-card-image,
.revealed-card.is-reversed .no-card-image { transform: rotate(180deg); }
.revealed-card .full-card-image,
.revealed-card .no-card-image { transition: transform .35s ease; }


.card-slot { aspect-ratio: 2 / 3; }
.card-face { border: 0; border-radius: 7px; }
.card-front { background: #fffaf0; }
.card-front::before { display: none; }
.card-art-image { width:100%; height:100%; object-fit:contain; display:block; }
.revealed-card { width:min(320px, 76vw); min-height:0; padding:0; border:0; background:transparent; }
.revealed-card .full-card-image { width:100%; height:auto; display:block; border-radius:9px; box-shadow:0 14px 28px #8a602a55; }
.revealed-card .no-card-image { min-height:260px; padding:28px; border:7px double #c7a15f; border-radius:12px; background:radial-gradient(circle at 50% 35%, #fffdf3, #e6c891); box-shadow:0 14px 28px #8a602a55; display:grid; place-content:center; gap:14px; text-align:center; color:#68451e; }
.no-card-image strong { font: bold 24px Georgia, serif; }
.no-card-image span { font-size:14px; line-height:1.7; }
.revealed-card .full-card-image[role="button"] { cursor: zoom-in; }
.revealed-card .full-card-image[role="button"]:focus-visible { outline: 3px solid #efca76; outline-offset: 5px; }

.card-lightbox {
  position: fixed;
  z-index: 250;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #070a12ed;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.card-lightbox-panel {
  position: relative;
  display: grid;
  place-items: center;
  max-width: 100%;
  max-height: 100%;
}

.card-lightbox-image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(88vw, 620px);
  max-height: calc(100vh - 48px);
  max-height: calc(100svh - 48px);
  object-fit: contain;
  border-radius: 10px;
  filter: drop-shadow(0 0 13px #e7c56b99) drop-shadow(0 0 34px #d5a84855);
}

.card-lightbox-image.is-reversed { transform: rotate(180deg); }

.card-lightbox-close {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 1;
  width: 44px;
  height: 44px;
  border: 1px solid #d8bd79;
  border-radius: 50%;
  background: #182039ee;
  color: #fff1ca;
  font-size: 27px;
  line-height: 1;
}

.card-lightbox-close:hover { background: #34405d; }

@media (max-width: 600px) {
  .card-lightbox { padding: 18px; }
  .card-lightbox-image {
    max-width: 90vw;
    max-height: calc(100vh - 36px);
    max-height: calc(100svh - 36px);
  }
}

.magic-halo {
  position: absolute;
  z-index: 1;
  width: 190%;
  aspect-ratio: 1;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.3);
  background: radial-gradient(
    circle,
    #fff7cb99 0%,
    #ffe6a655 28%,
    #f4c66c20 52%,
    transparent 72%
  );
}

.card-slot.magic-active .magic-halo {
  animation: haloBloom 1.65s ease-out forwards;
}

@keyframes haloBloom {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.25);
  }
  30% {
    opacity: .7;
    transform: translate(-50%, -50%) scale(.8);
  }
  65% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.55);
  }
}

.magic-particles {
  position: absolute;
  inset: -75px;
  z-index: 4;
  pointer-events: none;
  overflow: visible;
}

.gold-particle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at 35% 30%,
    #fff, #fff2bd 35%, #e7b85d 75%, #c28d3d
  );
  box-shadow: 0 0 5px #ffe8a5;
  animation: goldScatter var(--duration)
    ease-out var(--delay) forwards;
}

@keyframes goldScatter {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%)
      translate(0, 0) scale(.15);
  }
  18% { opacity: 1; }
  48% { opacity: .95; }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%)
      translate(var(--dx), var(--dy)) scale(.35);
  }
}

.gold-particle.sparkle {
  border-radius: 0;
  background: #fff2c2;
  clip-path: polygon(
    50% 0%, 61% 39%, 100% 50%, 61% 61%,
    50% 100%, 39% 61%, 0% 50%, 39% 39%
  );
}

.card-slot.magic-active .card-front::after,
.stage-holder.magic-active .card-front::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 15%,
    #fff8d9cc 45%,
    #ffffffee 50%,
    #fff8d9aa 55%,
    transparent 85%
  );
  transform: translateX(-150%);
  animation: cardShimmer 1.55s ease forwards;
  pointer-events: none;
}

@keyframes cardShimmer {
  0%, 42% {
    transform: translateX(-150%);
  }
  78%, 100% {
    transform: translateX(150%);
  }
}


.result {
  max-width: 560px;
  margin: 25px auto 0;
  animation: appear .8s ease both;
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.revealed-card {
  width: 205px;
  min-height: 325px;
  margin: 22px auto;
  border: 7px double #c7a15f;
  border-radius: 12px;
  background: radial-gradient(
    circle at 50% 35%, #fffdf3, #e6c891
  );
  box-shadow: 0 14px 28px #8a602a55;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  padding: 18px;
}

.revealed-card .symbol {
  font-size: 85px;
  line-height: 1.2;
}

.revealed-card .card-name {
  font-size: 20px;
  font-weight: bold;
}

.result-card-label {
  margin: 0 auto 16px;
  color: #765622;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
}

.message {
  padding: 18px;
  background: #fffdf8;
  border: 1px solid #e3cfaa;
  border-radius: 15px;
  text-align: left;
  line-height: 2;
}

.message h4 {
  margin: 0 0 8px;
  font-size: 18px;
}

.message p {
  margin: 8px 0;
}

.action {
  margin-top: 18px;
  padding: 12px 25px;
}

.action:hover {
  background: #795226;
}


.share-panel {
  margin: 24px auto 0;
  padding: 20px 14px;
  border: 1px solid #d4b47b;
  border-radius: 18px;
  background: #fff9ee;
}

.share-panel h4 {
  margin: 0 0 8px;
  font-size: 19px;
}

.share-panel p {
  font-size: 13px;
  line-height: 1.7;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 14px;
}

.share-buttons button {
  border: 1px solid #b78c4e;
  border-radius: 24px;
  padding: 11px 14px;
  color: #68451e;
  background: white;
  font-size: 14px;
}

.share-buttons button:hover {
  background: #f5e6c9;
}

#shareStatus {
  min-height: 1.5em;
  font-size: 12px;
}


.qr-panel {
  width: min(310px, 90%);
  margin: 20px auto 30px;
  padding: 19px 15px;
  text-align: center;
  border: 2px solid #c9a56b;
  border-radius: 20px;
  background: linear-gradient(
    145deg, #fffdf7, #f8e8ca
  );
  box-shadow: 0 8px 24px #8a602a22;
  color: #6b4a24;
}

.qr-title {
  display: block;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: bold;
}

.qr-box {
  width: 164px;
  height: 164px;
  margin: 0 auto 12px;
  padding: 8px;
  background: white;
  border: 2px solid #d4b47b;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.qr-box canvas,
.qr-box img {
  max-width: 100%;
  max-height: 100%;
}

.qr-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: repeating-linear-gradient(
    45deg,
    #f7e9cd 0px,
    #f7e9cd 10px,
    #fffaf0 10px,
    #fffaf0 20px
  );
  border-radius: 5px;
}

.qr-placeholder .qr-icon {
  font-family: Georgia, serif;
  font-size: 47px;
  font-weight: bold;
  letter-spacing: 2px;
}

.qr-placeholder .qr-small {
  font-size: 12px;
  margin-top: 5px;
}

.qr-caption {
  font-size: 12px;
  line-height: 1.7;
  margin: 0;
}


@media(max-width:700px){header{flex-direction:column;padding:14px 12px}.langs{gap:6px}.langs button{font-size:12px;padding:9px 12px}.detail{padding:28px 12px 40px}.reading{padding:22px 10px}.share-buttons button{min-height:44px}.magic-particles{inset:-35px}}@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* Museum entrance: only the central morning door is interactive. */
.museum-entrance{text-align:center;padding:40px 12px 54px;background:radial-gradient(ellipse at 50% 20%,#fff9df,#f1dfbd 75%)}
.museum-entrance .intro{padding:0 12px 8px}.intro h2{font-weight:normal;font-size:clamp(30px,6vw,48px);margin:18px 0}
.museum{position:relative;width:min(1200px,96%);margin:25px auto 30px;border:5px solid var(--gold);border-radius:17px;overflow:hidden;box-shadow:0 15px 35px #8a602a44,0 0 34px #e8bd6355}
.museum>img{display:block;width:100%;height:auto}
.door{position:absolute;top:29%;height:45%;width:17%;left:41.5%;border:1px solid #ffe7a088;background:radial-gradient(ellipse,#ffe9a51c,transparent 75%);border-radius:50% 50% 12px 12px;color:#6b4a24;transition:box-shadow .35s,transform .35s;box-shadow:inset 0 0 20px #ffe5a633,0 0 15px #ffe5a644}
.door:hover,.door:focus-visible{outline:2px solid #fff8c9;box-shadow:0 0 32px #ffebaa,inset 0 0 25px #ffebaa66;transform:scale(1.025)}
.door span{position:absolute;bottom:-4%;left:50%;transform:translateX(-50%);white-space:nowrap;background:#fff9efed;padding:8px;border:1px solid #d3b479;border-radius:14px;font-size:clamp(9px,1.1vw,14px);font-weight:bold}
.morning-entry-button{box-shadow:0 0 22px #d9b35b44}.morning-entry-button:hover{background:#fff2cc;box-shadow:0 0 30px #dbb34c66}
.entrance-notice{max-width:650px;margin:18px auto 28px;line-height:1.9;font-size:13px}.museum-back{margin-bottom:14px}
@media(max-width:700px){.museum-entrance{padding:28px 10px 40px}.museum{border-width:3px;width:100%;margin:20px auto 28px}.door span{font-size:10px;padding:6px 7px}.morning-entry-button{width:min(340px,94%);min-height:48px}.entrance-notice{padding:0 10px}}
@media(prefers-reduced-motion:reduce){.door{transition:none}}
