/* 클레이 원화와 HTML 글자를 겹쳐 쓰는 3.0 화면. */
:root  {
  --bg:#1b1650;
  --ink:#3a1d63;
  --surface:#f6e6c8;
  --surface-2:#efdab3;
  --sub:#5a3671;
  --accent:#5b2d91;
  --gold:#f2b62b;
  --game:"Jua",sans-serif;
  --body:"Noto Sans KR",sans-serif;
  --osc-card:#f6e6c8;
  --orak-next-bg:#f6e6c8;
  --orak-next-ink:#3a1d63;
  --orak-next-sub:#5a3671
}
*  {
  box-sizing:border-box
}
body  {
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:var(--body);
  font-size:15px
}
button,a  {
  -webkit-tap-highlight-color:transparent
}
button  {
  font:inherit;
  color:inherit;
  cursor:pointer;
  border:0
}
button:focus-visible,a:focus-visible,summary:focus-visible  {
  outline:3px solid #fff;
  outline-offset:3px
}
button:disabled  {
  cursor:default
}
button:active  {
  filter:brightness(1.08)
}
h1,h2,h3,p  {
  margin:0
}
h1,h2,h3  {
  font-family:var(--game);
  font-weight:400
}
img  {
  display:block;
  max-width:100%;
  user-select:none
}
button  {
  min-width:44px;
  min-height:44px
}
a  {
  color:inherit
}
[hidden]  {
  display:none!important
}
.stage  {
  position:relative;
  isolation:isolate;
  width:min(100%,480px);
  height:100svh;
  min-height:560px;
  margin:0 auto;
  background:#1b1650 url('art/bg-room.webp') center/100% 100% no-repeat;
  overflow:hidden;
  box-shadow:0 0 80px #0008
}
.topbar  {
  position:absolute;
  z-index:20;
  inset:10px 10px auto;
  display:flex;
  justify-content:space-between;
  pointer-events:none
}
.round-btn  {
  pointer-events:auto;
  width:52px;
  height:52px;
  padding:0;
  background:transparent center/contain no-repeat;
  filter:drop-shadow(0 3px 3px #160d28a0)
}
#home  {
  background-image:url('art/ui/btn-home.webp')
}
#back  {
  position:absolute;
  top:57px;
  left:0;
  width:48px;
  height:44px;
  background-image:url('art/ui/label.webp');
  font-size:13px;
  font-weight:700
}
.screen  {
  position:relative;
  height:100%;
  width:100%;
  padding:0 12px max(12px,env(safe-area-inset-bottom));
  overflow-y:auto;
  overflow-x:hidden;
  scrollbar-width:thin;
  scrollbar-color:#f2b62b #3a1d63
}
.screen>*  {
  flex-shrink:0
}
.sign  {
  position:relative;
  z-index:2;
  width:74%;
  height:113px;
  margin:-18px auto 0;
  padding:66px 12px 15px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:url('art/ui/plaque-sign.webp') center/100% 100% no-repeat;
  color:#fff0ce;
  font-size:24px;
  text-align:center;
  text-shadow:0 2px 2px #351247;
  line-height:1.1
}
.sul  {
  object-fit:contain;
  filter:drop-shadow(0 5px 6px #170b2d55)
}
.label  {
  display:grid;
  place-items:center;
  background:transparent url('art/ui/label.webp') center/100% 100% no-repeat;
  padding:10px 9px;
  font-family:var(--game);
  font-size:18px;
  line-height:1.1;
  color:#3a1d63
}
.clay-btn  {
  position:relative;
  display:grid;
  place-items:center;
  background:transparent url('art/ui/btn-gold.webp') center/100% 100% no-repeat;
  padding:16px 19%;
  min-height:66px;
  width:100%;
  color:#37164e;
  font-family:var(--game);
  font-size:24px;
  line-height:1.1;
  text-align:center;
  text-decoration:none;
  text-shadow:0 1px #fff7
}
.clay-btn.purple  {
  background-image:url('art/ui/btn-purple.webp');
  color:#fff1d2;
  text-shadow:0 2px #34134a
}
.panel  {
  border:24px solid transparent;
  border-image:url('art/ui/panel.webp') 75 80 fill / 24px / 0 stretch;
  padding:6px 0;
  color:#3a1d63
}
.panel p  {
  line-height:1.65
}
.guide-link  {
  color:#fff0ce;
  font-size:12px;
  text-align:center;
  min-height:44px;
  display:grid;
  place-items:center
}
.screen-home  {
  display:flex;
  flex-direction:column;
  padding-top:9px;
  gap:0;
  overflow:hidden
}
.title-plaque  {
  position:relative;
  z-index:3;
  width:83%;
  height:18%;
  min-height:112px;
  margin:0 auto;
  background:url('art/ui/plaque-title.webp') center/100% 100% no-repeat;
  display:grid;
  place-items:center;
  padding:25px 16% 10px;
  text-align:center;
  color:#fff0cf;
  font-family:var(--game);
  font-size:36px;
  letter-spacing:-2px;
  text-shadow:0 3px 2px #30123c
}
.title-plaque em  {
  color:#ffe374;
  font-style:normal
}
.home-cat  {
  position:relative;
  z-index:1;
  width:76%;
  height:calc(32% - 10px);
  margin:0 auto;
  object-position:bottom
}
.quick-paths  {
  position:relative;
  z-index:2;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-top:-1%;
  height:23%;
  padding:0 17px
}
.quick-paths button  {
  background:none;
  padding:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-end;
  min-width:0
}
.quick-paths img  {
  height:74%;
  width:100%;
  object-fit:contain;
  filter:drop-shadow(0 3px 5px #1b1650)
}
.quick-paths .label  {
  width:100%;
  min-height:42px;
  padding-inline:12%;
  font-size:23px
}
.screen-home>.clay-btn  {
  margin-top:auto;
  min-height:76px;
  height:10%;
  padding-inline:calc(19% + 6px)
}
.home-tiles  {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:9px;
  margin:5px 12px 0;
  height:15%
}
.home-tiles button  {
  background:transparent url('art/ui/tile.webp') center/100% 100% no-repeat;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:7px 11% 13px;
  color:#fff0cf;
  font-family:var(--game);
  font-size:19px;
  text-shadow:0 2px 2px #291037
}
.home-tiles img  {
  height:62%;
  width:75%;
  object-fit:contain
}
.screen-home .guide-link  {
  position:absolute;
  left:-9999px
}
.menu-panel  {
  position:relative;
  z-index:3;
  margin-top:3px;
  padding-top:0;
  min-height:calc(100% - 157px);
  border-width:23px 20px
}
.menu-grid  {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:9px
}
.spread-tile  {
  position:relative;
  min-width:0;
  min-height:129px;
  border:2px solid #d59a31;
  border-radius:19px;
  background:#f5e1bb99;
  box-shadow:inset 0 0 0 2px #fff4da,0 2px 3px #7e481d44;
  padding:5px 6px 9px;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  align-items:center;
  gap:0
}
.spread-tile>img  {
  width:100%;
  height:96px;
  object-fit:contain
}
.spread-tile>b  {
  font-family:var(--game);
  font-size:21px;
  font-weight:400;
  line-height:1.2;
  white-space:nowrap
}
.count  {
  position:absolute;
  right:5px;
  top:7px;
  border-radius:50%;
  background:#ffd35e;
  border:2px solid #e5a22c;
  box-shadow:0 2px 2px #8a502c77;
  color:#3a1d63;
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  font-family:var(--game);
  font-size:21px
}
.spread-description {
  display:block;
  margin-top:4px;
  color:#4d285d;
  font:400 12px/1.32 var(--body);
  text-align:center;
  text-wrap:balance;
}
.spread-tile:is(:active,.is-pressing,.tile-press) { transform:scale(.96) }
.spread-tile.tile-press { animation:tarot-tile-press .15s ease-out both }
@keyframes tarot-tile-press { 35% { transform:scale(.95) } 100% { transform:scale(.98) } }
@media(prefers-reduced-motion:reduce) { .spread-tile.tile-press { animation:none; transform:none } }
.waiting-cat  {
  width:66%;
  height:35%;
  margin:20px auto
}
.screen-waiting .panel  {
  text-align:center
}
.osc-book  {
  background:#f6e6c8;
  color:#3a1d63;
  border-radius:24px;
  padding:16px
}
.osc-book button  {
  min-height:44px
}
.osc-record-value,.osc-done-stamp,.osc-tier  {
  color:#5b2d91!important
}
.menu-panel  {
  background:#f6e6c8;
  background-clip:padding-box
}
#stage .orak-home-button  {
  width:52px;
  height:52px;
  min-width:44px;
  min-height:44px;
  background:transparent url('art/ui/btn-home.webp') center/contain no-repeat;
  box-shadow:none;
  pointer-events:auto
}
#stage .orak-home-button svg,#stage .orak-home-button span  {
  display:none
}
.topbar:has(.orak-home-button)  {
  padding:0
}
/* frame.json의 비율을 유지하고 역방향도 이름은 바로 읽힌다. */
.tarot-card  {
  position:relative;
  display:block;
  width:100%;
  aspect-ratio:600/959;
  perspective:800px;
  filter:drop-shadow(0 3px 3px #150b2b88)
}
.card-turn  {
  position:absolute;
  inset:0;
  transform-style:preserve-3d;
  transition:transform .55s cubic-bezier(.25,.8,.25,1)
}
.closed .card-turn  {
  transform:rotateY(180deg)
}
.card-front,.card-rear  {
  position:absolute;
  inset:0;
  backface-visibility:hidden;
  -webkit-backface-visibility:hidden
}
.card-rear  {
  transform:rotateY(180deg)
}
.card-back  {
  width:100%;
  height:100%;
  object-fit:fill
}
.card-picture  {
  position:absolute;
  left:5.8%;
  top:3.5%;
  width:88.7%;
  height:81%;
  overflow:hidden;
  border-radius:10%
}
.card-picture img  {
  width:100%;
  height:100%;
  object-fit:cover
}
.card-frame  {
  position:absolute;
  inset:0;
  width:100%;
  height:100%
}
.card-name  {
  position:absolute;
  left:19%;
  top:87.8%;
  width:62%;
  height:8.55%;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:2px;
  color:#37164e;
  font-family:var(--game);
  font-size:clamp(12px,4vw,24px);
  line-height:1;
  white-space:nowrap;
  letter-spacing:-.5px
}
.card-name b  {
  font-size:12px
}
.reversed .card-front  {
  transform:rotate(180deg)
}
.reversed .card-name  {
  transform:rotate(180deg)
}
.small-card .card-name  {
  font-size:12px
}
.small-card .card-name b  {
  font-size:12px
}
.guide  {
  max-width:480px;
  margin:auto;
  padding:32px 22px 60px;
  color:#fff0d3;
  font-size:15px;
  line-height:1.8;
  display:grid;
  gap:22px
}
.guide h2  {
  font-size:24px
}
.guide a  {
  display:inline-block;
  min-height:44px;
  margin-right:12px
}
.guide button  {
  background:#f6e6c8;
  border-radius:15px;
  padding:8px 20px
}
.guide ul,.guide ol  {
  padding-left:22px
}
@media(max-height:700px)  {
  .title-plaque  {
    font-size:32px;
    min-height:98px
  }
  .home-cat  {
    height:calc(31% - 10px)
  }
  .quick-paths  {
    height:24%;
    padding-inline:15px
  }
  .quick-paths .label  {
    font-size:21px;
    min-height:40px
  }
  .screen-home>.clay-btn  {
    min-height:66px;
    font-size:23px
  }
  .home-tiles  {
    height:16%;
    margin-inline:12px
  }
  .home-tiles button  {
    font-size:18px
  }
  .menu-panel  {
    margin-top:0
  }
  .spread-tile  {
    min-height:119px
  }
  .spread-tile>img  {
    height:82px
  }
  .spread-tile>b  {
    font-size:19px
  }
  .round-btn  {
    width:47px;
    height:47px
  }
}
@media(prefers-reduced-motion:reduce)  {
  .sul,.twinkle,.spark  {
    animation:none!important
  }
  .card-turn  {
    transition:transform .4s
  }
}
.topic-cat  {
  height:36%;
  width:72%;
  margin:12px auto 0
}
.topic-panel  {
  text-align:center
}
.topics  {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:15px
}
.topics .label  {
  min-height:60px;
  font-size:24px
}
.topics button:last-child  {
  grid-column:1/-1;
  width:60%;
  justify-self:center
}
.screen-star-intro>.clay-btn  {
  margin-top:20px;
  font-size:21px
}
.screen-star-intro .panel  {
  text-align:center
}
.screen-star-intro .panel h2  {
  font-size:24px;
  margin-bottom:10px
}
.screen-shuffle  {
  display:flex;
  flex-direction:column;
  align-items:center
}
.screen-shuffle .sign  {
  width:74%;
  flex:none
}
.screen-shuffle .topic-cat  {
  height:29%;
  margin-top:0
}
.shuffle-plaque  {
  width:95%;
  padding:12px 10% 10px;
  gap:5px;
  font-size:17px;
  text-align:center
}
.shuffle-hint { width:100% }
.deck-area  {
  background:none;
  width:100%;
  flex:1;
  min-height:180px;
  display:grid;
  place-items:center;
  touch-action:none
}
.deck-stack  {
  position:relative;
  width:110px;
  height:176px
}
.deck-stack img  {
  position:absolute;
  inset:0;
  transition:transform .25s
}
.deck-stack img:nth-child(2n)  {
  transform:translate(8px,-3px) rotate(4deg)
}
.deck-stack img:nth-child(3n)  {
  transform:translate(-8px,-6px) rotate(-4deg)
}
.mixing .deck-stack img:nth-child(2n)  {
  animation:mix .3s
}
.cut .deck-stack img:nth-child(2n)  {
  transform:translateX(70px) rotate(12deg)
}
.cut .deck-stack img:nth-child(2n+1)  {
  transform:translateX(-70px) rotate(-12deg)
}
.screen-pick  {
  display:flex;
  flex-direction:column
}
.screen-pick .sign  {
  font-size:22px;
  width:77%;
  flex:none
}
.pick-host  {
  position:relative;
  height:30%;
  min-height:160px
}
.pick-host>.sul  {
  width:69%;
  height:100%;
  object-position:bottom
}
.speech  {
  position:absolute;
  right:0;
  top:15%;
  width:43%;
  font-family:var(--game);
  font-size:20px;
  line-height:1.3;
  text-align:center;
  border-width:17px;
  border-image-width:17px;
  padding:7px 0
}
.spread-layout  {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  align-items:end;
  gap:8px;
  width:100%;
  padding:7px 14px
}
.layout-place  {
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px
}
.placed-card  {
  background:none;
  padding:0;
  width:100%;
  max-width:105px;
  aspect-ratio:600/959;
  min-width:44px;
  display:grid;
  place-items:center;
  position:relative
}
.position-name  {
  font-size:16px;
  min-height:34px;
  width:100%;
  padding:8px 4px;
  text-align:center
}
.empty-slot  {
  border:2px dashed #ffe47a;
  border-radius:10px;
  box-shadow:0 0 6px #ffdc4c,inset 0 0 8px #ffce4380
}
.slot-light  {
  width:12px;
  height:18px;
  background:#ffe69a;
  clip-path:polygon(50% 0,65% 35%,100% 50%,65% 65%,50% 100%,35% 65%,0 50%,35% 35%);
  filter:drop-shadow(0 0 8px #fff)
}
.fan-area  {
  position:relative;
  flex:1;
  min-height:205px;
  width:100%;
  margin-top:0;
  overflow:hidden
}
.fan-card  {
  position:absolute;
  width:64px;
  height:102px;
  top:46px;
  left:50%;
  margin-left:-32px;
  padding:0;
  background:none;
  transform:translate(calc((var(--i) - 11.5)*10px),calc((var(--i) - 11.5)*(var(--i) - 11.5)*.22px)) rotate(calc((var(--i) - 11.5)*2.6deg));
  transition:filter .2s
}
.fan-card:hover,.fan-card:focus-visible  {
  filter:drop-shadow(0 0 8px #ffe79c)
}
.fan-card.chosen  {
  opacity:0;
  pointer-events:none
}
.pick-hint  {
  font-size:21px;
  min-height:48px;
  width:85%;
  align-self:center
}
.flying-card img  {
  width:100%;
  height:100%
}
.screen-reveal  {
  display:flex;
  flex-direction:column;
  gap:6px
}
.screen-reveal .sign  {
  flex:none;
  font-size:23px
}
.reveal-scene  {
  position:relative;
  flex:1;
  min-height:220px;
  display:flex;
  justify-content:center;
  align-items:center;
  padding:5px 0 10px
}
.reveal-card  {
  position:relative;
  z-index:2;
  background:none;
  padding:0;
  width:52%;
  max-width:210px;
  max-height:100%;
  aspect-ratio:600/959
}
.reveal-card>.tarot-card  {
  height:100%;
  width:100%
}
.reveal-cat  {
  position:absolute;
  left:-5%;
  bottom:3%;
  width:37%;
  height:58%;
  z-index:3;
  pointer-events:none
}
.reveal-copy  {
  max-height:33%;
  overflow:auto;
  flex:none;
  width:100%;
  padding-top:2px;
  padding-bottom:2px
}
.core-line  {
  font-size:23px;
  line-height:1.35;
  text-align:center;
  word-break:keep-all
}
.keywords  {
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:5px;
  margin:8px 0
}
.keywords span  {
  border:2px solid #e4aa3c;
  border-radius:99px;
  color:#fff0ce;
  background:#5b2d91;
  padding:4px 10px;
  font-family:var(--game);
  font-size:15px
}
.meaning  {
  border-top:1px solid #ba8c4b55;
  padding:5px 0;
  font-size:14px
}
.meaning summary  {
  display:flex;
  align-items:center;
  gap:7px;
  cursor:pointer;
  font-family:var(--game);
  font-size:18px;
  min-height:44px;
  list-style:none
}
.meaning summary img  {
  width:32px;
  height:32px;
  object-fit:contain
}
.meaning p  {
  padding:3px 3px 7px
}
.meaning[open] summary:after  {
  content:'−';
  margin-left:auto
}
.meaning:not([open]) summary:after  {
  content:'+';
  margin-left:auto
}
.flip-hint  {
  width:92%;
  align-self:center;
  margin-bottom:10px
}
.reveal-actions  {
  flex:none
}
.reveal-actions .clay-btn  {
  min-height:67px
}
.yn-answer  {
  display:block;
  font-family:var(--game);
  font-size:44px;
  text-align:center
}
.yn-reason  {
  text-align:center
}
.screen-note>.sign  {
  width:79%;
  font-size:23px
}
.note-cat  {
  height:29%;
  width:73%;
  margin:-3px auto -3%
}
.screen-note .spread-layout  {
  position:relative;
  z-index:2
}
.note-panel  {
  margin-top:14px;
  padding:2px 0 10px
}
.note-panel>h2  {
  font-size:24px;
  line-height:1.35;
  text-align:center;
  word-break:keep-all;
  margin-bottom:12px
}
.lens  {
  margin:6px 0;
  border:1px solid #c7954266;
  border-radius:13px;
  background:#f7e6c688;
  padding:0 8px
}
.lens summary  {
  list-style:none;
  display:flex;
  align-items:center;
  gap:7px;
  cursor:pointer;
  min-height:48px;
  font-family:var(--game);
  font-size:20px
}
.lens summary img  {
  width:36px;
  height:36px;
  object-fit:contain
}
.lens p  {
  font-size:14px;
  padding:7px 0 12px
}
.reason  {
  margin:16px 0;
  font-size:14px
}
.reason p+p  {
  margin-top:8px
}
.todo,.note-panel .orak-next  {
  border-top:1px solid #b7814666;
  padding-top:12px
}
.todo h3,.note-panel .orak-next-title  {
  color:var(--ink);
  font-family:var(--orak-font,var(--game));
  font-weight:400;
  font-size:21px
}
.todo p  {
  font-size:15px;
  margin-top:7px
}
.note-actions  {
  position:sticky;
  bottom:0;
  z-index:8;
  display:grid;
  grid-template-columns:1.3fr 1fr;
  gap:5px;
  margin-top:10px;
  padding:6px 0;
  background:linear-gradient(transparent,#261343cc)
}
.note-actions .clay-btn  {
  padding:16px 14%;
  font-size:22px
}
.detail-art  {
  width:46%;
  margin:18px auto
}
.screen-detail .panel .core-line  {
  font-size:23px
}
.screen-detail>.clay-btn  {
  margin-top:10px
}
.reading-list  {
  margin-top:17px;
  display:grid;
  gap:14px
}
.reading-row  {
  display:flex;
  gap:13px;
  background:none;
  padding:0;
  text-align:left;
  width:100%;
  align-items:center
}
.reading-row>.tarot-card  {
  width:60px;
  flex:none
}
.reading-row>span:last-child  {
  display:grid;
  gap:8px;
  font-size:15px
}
.reading-row b  {
  font-family:var(--game);
  font-size:20px;
  font-weight:400
}
.reading-list>.panel>p  {
  margin-top:10px;
  font-size:14px
}
.small-card .card-name  {
  font-size:12px
}
.small-card .compact-name  {
  display:none
}
.count-1  {
  grid-template-columns:1fr
}
.count-1 .layout-place  {
  width:40%;
  margin:auto
}
.count-1 .placed-card  {
  max-width:145px
}
@keyframes mix  {
  50%  {
    transform:translateX(50px) rotate(20deg)
  }
}
@media(max-height:700px)  {
  .screen-reveal .sign,.screen-pick .sign  {
    height:97px;
    padding-top:55px;
    font-size:20px
  }
  .reveal-scene  {
    min-height:185px
  }
  .reveal-card  {
    width:39%;
    max-width:150px
  }
  .reveal-copy  {
    max-height:34%
  }
  .core-line  {
    font-size:21px
  }
  .screen-reveal .clay-btn  {
    min-height:60px;
    font-size:22px
  }
  .pick-host  {
    height:27%;
    min-height:140px
  }
  .screen-pick .spread-layout  {
    padding-top:0
  }
  .screen-pick .placed-card  {
    max-width:76px
  }
  .position-name  {
    font-size:15px
  }
  .fan-area  {
    min-height:150px
  }
  .fan-card  {
    top:24px;
    width:58px;
    height:93px;
    margin-left:-29px;
    transform:translate(calc((var(--i) - 11.5)*9px),calc((var(--i) - 11.5)*(var(--i) - 11.5)*.17px)) rotate(calc((var(--i) - 11.5)*2.5deg))
  }
  .pick-hint  {
    font-size:19px;
    min-height:44px
  }
  .speech  {
    font-size:17px
  }
  .note-cat  {
    height:25%
  }
  .screen-note .placed-card  {
    max-width:90px
  }
  .screen-note>.sign  {
    font-size:21px
  }
  .note-panel>h2  {
    font-size:22px
  }
}
body .orak-hub-toast  {
  top:180px!important
}
.note-actions  {
  background:#32194e
}
.reveal-copy  {
  max-height:38%
}
.meaning summary  {
  font-size:18px
}
.screen-reveal .reveal-copy  {
  scroll-padding-block:12px
}
.position-index  {
  display:none
}
.count-4  {
  grid-template-columns:repeat(4,minmax(0,1fr));
  padding-inline:4px
}
.count-4 .position-name  {
  font-size:13px;
  min-height:44px
}
.count-5  {
  grid-template-columns:repeat(3,minmax(0,1fr));
  max-width:310px;
  margin:auto
}
.count-5 .placed-card  {
  max-width:66px
}
.count-5 .position-name  {
  font-size:13px;
  min-height:30px
}
.count-7  {
  grid-template-columns:repeat(4,minmax(0,1fr))
}
.count-7 .placed-card  {
  max-width:57px
}
.count-7 .position-name  {
  font-size:13px;
  min-height:28px
}
.count-10  {
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:6px;
  padding-inline:4px;
  align-items:center
}
.count-10 .placed-card  {
  max-width:48px
}
.count-10 .position-name  {
  display:none
}
.count-13  {
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:6px;
  align-items:center
}
.count-13 .placed-card  {
  max-width:53px
}
.count-13 .position-name  {
  font-size:12px;
  min-height:24px;
  padding:5px 2px
}
.count-10 .card-name,.count-13 .card-name  {
  display:none
}
.count-10 .position-index,.count-13 .position-index  {
  display:grid;
  place-items:center;
  position:absolute;
  bottom:-3px;
  right:-3px;
  border:1px solid #b17722;
  background:#ffe199;
  color:#37164e;
  min-width:18px;
  height:18px;
  border-radius:50%;
  font-size:12px;
  font-weight:700
}
.count-10 .layout-place[data-pos="1"] .position-index  {
  transform:rotate(-90deg)
}
.count-10 .layout-place[data-pos="1"] .placed-card  {
  box-shadow:0 0 4px #1b1650
}
.spread-note  {
  border-top:1px solid #b7814666;
  margin-top:16px;
  padding-top:12px
}
.spread-note h3  {
  font-size:21px
}
.spread-note p  {
  font-size:14px;
  margin-top:9px
}
.bulk-flip  {
  min-height:44px;
  font-size:16px;
  width:65%;
  align-self:center
}
.screen-pick:has(.count-5) .pick-host,.screen-pick:has(.count-7) .pick-host  {
  height:100px;
  min-height:100px
}
.screen-pick:has(.count-10) .pick-host,.screen-pick:has(.count-13) .pick-host  {
  height:55px;
  min-height:55px
}
.screen-pick:has(.count-10) .speech,.screen-pick:has(.count-13) .speech  {
  font-size:13px;
  width:65%;
  border-width:10px;
  border-image-width:10px;
  padding:0;
  top:0
}
.screen-pick:has(.count-10) .pick-host>.sul,.screen-pick:has(.count-13) .pick-host>.sul  {
  width:33%
}
.screen-pick .count-5 .placed-card,.screen-pick .count-10 .placed-card,.screen-pick .count-13 .placed-card  {
  width:44px;
  max-width:44px;
  height:70px
}
.screen-pick .count-5 .position-name,.screen-pick .count-13 .position-name  {
  display:none
}
.screen-pick .count-5 .position-index  {
  display:grid;
  position:absolute;
  right:-2px;
  bottom:-2px;
  place-items:center;
  width:18px;
  height:18px;
  border-radius:50%;
  background:#ffe199;
  font-size:12px
}
.screen-pick .count-10,.screen-pick .count-13  {
  gap:5px;
  padding-block:4px
}
.screen-pick:has(.count-5) .fan-area,.screen-pick:has(.count-7) .fan-area,.screen-pick:has(.count-10) .fan-area,.screen-pick:has(.count-13) .fan-area  {
  min-height:125px
}
.screen-pick .count-7 .placed-card  {
  max-width:50px
}
.screen-note:has(.count-10) .note-cat,.screen-note:has(.count-13) .note-cat  {
  height:18%;
  min-height:100px
}
@media(max-height:700px)  {
  .screen-pick:has(.count-5) .pick-host,.screen-pick:has(.count-7) .pick-host  {
    height:80px;
    min-height:80px
  }
  .screen-pick:has(.count-10) .pick-host,.screen-pick:has(.count-13) .pick-host  {
    height:45px;
    min-height:45px
  }
  .screen-pick .count-5  {
    gap:5px
  }
  .screen-pick .count-7 .position-name  {
    font-size:12px;
    min-height:25px;
    padding:5px 2px
  }
  .count-4 .position-name  {
    font-size:12px
  }
  .bulk-flip  {
    min-height:44px
  }
  .screen-reveal:has([data-bulk]) .reveal-scene  {
    min-height:140px
  }
  .screen-reveal:has([data-bulk]) .reveal-card  {
    width:32%
  }
}
.reveal-copy  {
  padding:0;
  border-width:20px;
  border-image-width:20px
}
.reveal-copy .meaning  {
  padding:0
}
.reveal-copy .keywords  {
  margin:5px 0
}
#stage[data-screen="pick"],#stage[data-screen="note"]  {
  background-size:100% 116%;
  background-position:center bottom
}
.panel  {
  background-color:#f6e6c8;
  background-clip:padding-box
}
.screen-note:has(.count-5) .note-cat  {
  height:100px
}
.screen-note .count-5 .placed-card,.screen-note .count-10 .placed-card,.screen-note .count-13 .placed-card  {
  width:44px;
  max-width:44px;
  height:70px
}
.screen-note .count-5 .position-name,.screen-note .count-13 .position-name  {
  display:none
}
.screen-note .count-5 .position-index  {
  display:grid;
  place-items:center;
  position:absolute;
  bottom:-2px;
  right:-2px;
  width:18px;
  height:18px;
  font-size:12px;
  border-radius:50%;
  background:#ffe199
}
.screen-note:has(.count-10) .note-cat,.screen-note:has(.count-13) .note-cat  {
  height:70px;
  min-height:70px
}
.screen-note .count-5  {
  gap:5px
}
.screen-note .count-7 .placed-card  {
  max-width:50px
}
.screen-note .count-7 .position-name  {
  font-size:12px;
  min-height:24px;
  padding:5px 2px
}
@media(max-height:700px)  {
  .screen-note:has(.count-5) .note-cat,.screen-note:has(.count-7) .note-cat  {
    height:60px;
    min-height:60px
  }
  .screen-note:has(.count-10) .note-cat,.screen-note:has(.count-13) .note-cat  {
    height:40px;
    min-height:40px
  }
  .screen-note:has(.count-10) .sign,.screen-note:has(.count-13) .sign  {
    height:85px;
    padding-top:48px;
    font-size:19px
  }
  .screen-note .count-7  {
    gap:5px
  }
}
.count-4 .card-name,.count-5 .card-name,.count-7 .card-name  {
  display:none
}
.star-legend  {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:5px;
  margin:10px 0
}
.star-legend>span  {
  display:flex;
  align-items:center;
  gap:6px;
  font-size:14px
}
.star-legend img  {
  width:30px;
  height:30px;
  object-fit:contain
}
.screen-star-intro  {
  display:flex;
  flex-direction:column;
  gap:7px
}
.screen-star-intro>.sign  {
  flex:none
}
.screen-star-intro>.topic-cat  {
  height:20%;
  min-height:90px;
  margin:0 auto
}
.screen-star-intro>.panel p  {
  font-size:13px;
  line-height:1.7
}
.screen-star-intro>.panel h2  {
  font-size:22px
}
.screen-star-intro>.clay-btn  {
  margin-top:auto;
  min-height:62px
}
.speed-picker  {
  display:flex;
  justify-content:center;
  gap:8px
}
.speed-picker button  {
  min-width:66px;
  min-height:44px;
  font-size:17px
}
.speed-picker button[aria-pressed=true]  {
  background-image:url('art/ui/btn-gold.webp')
}
.skip-stars  {
  min-height:44px;
  width:75%;
  align-self:center;
  font-size:17px
}
.screen-stars  {
  display:flex;
  flex-direction:column;
  gap:8px
}
.screen-stars>.sign  {
  flex:none
}
.star-hud  {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:0 6px
}
.star-time  {
  width:62px;
  min-height:44px;
  font-size:24px;
  font-variant-numeric:tabular-nums
}
.star-time.rush  {
  color:#8a2449
}
.star-tally  {
  display:flex;
  gap:10px;
  color:#fff3d3;
  text-shadow:0 2px #291349;
  font-size:16px
}
.star-tally>span  {
  display:flex;
  align-items:center;
  gap:4px
}
.star-tally img  {
  width:24px;
  height:24px;
  object-fit:contain
}
.sky-wrap  {
  position:relative;
  flex:1;
  min-height:260px;
  touch-action:none;
  border:2px solid #ac7e45;
  border-radius:23px;
  overflow:hidden;
  background:none
}
.sky-wrap canvas  {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  touch-action:none
}
.star-combo  {
  position:absolute;
  left:0;
  right:0;
  top:14%;
  font-family:var(--game);
  color:#fff0bf;
  text-shadow:0 3px #3a1d63;
  text-align:center;
  font-size:30px;
  pointer-events:none
}
.sky-instruction  {
  font-size:12px;
  color:#fff0d3;
  text-align:center
}
.screen-star-result  {
  display:flex;
  flex-direction:column;
  gap:15px;
  text-align:center
}
.result-star  {
  height:27%;
  width:60%;
  object-fit:contain;
  align-self:center;
  margin:15px auto 0
}
.screen-star-result h2  {
  font-size:29px
}
.screen-star-result .panel p  {
  font-size:15px;
  margin-top:10px
}
.screen-star-result>.clay-btn  {
  margin-top:auto
}
.star-reward  {
  border-top:1px solid #b7814666;
  margin-top:16px;
  padding-top:12px
}
.star-reward h3  {
  font-size:22px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:5px
}
.star-reward h3>img  {
  width:32px;
  height:32px
}
.star-reward p  {
  font-size:14px;
  margin-top:9px
}
.bonus-card  {
  width:43%;
  margin:12px auto
}
.bonus-card .card-name  {
  font-size:12px
}
@media(max-height:700px)  {
  .screen-star-intro  {
    gap:4px
  }
  .screen-star-intro .sign,.screen-stars .sign  {
    height:95px;
    padding-top:52px;
    font-size:22px
  }
  .screen-star-intro>.topic-cat  {
    height:85px;
    min-height:85px
  }
  .screen-star-intro .panel  {
    border-width:18px;
    border-image-width:18px;
    padding:0
  }
  .screen-star-intro>.clay-btn  {
    min-height:55px;
    font-size:21px
  }
  .screen-star-intro .panel h2  {
    font-size:20px;
    margin-bottom:0
  }
  .star-legend  {
    margin:5px 0
  }
  .star-legend img  {
    width:24px;
    height:24px
  }
  .screen-stars  {
    gap:5px
  }
  .star-tally  {
    gap:7px
  }
  .star-tally img  {
    width:20px;
    height:20px
  }
  .sky-wrap  {
    min-height:230px
  }
  .screen-star-result .sign  {
    height:100px;
    padding-top:57px
  }
  .screen-star-result  {
    gap:8px
  }
  .screen-star-result .panel p  {
    font-size:14px
  }
  .screen-star-result h2  {
    font-size:26px
  }
}
.dex-panel,.journal-panel  {
  margin-top:16px
}
.dex-count  {
  text-align:center;
  font-family:var(--game);
  font-size:23px;
  margin:2px 0 17px
}
.dex-grid  {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px 7px
}
.dex-cell  {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  background:none;
  padding:0;
  min-width:44px;
  min-height:110px
}
.dex-cell:disabled  {
  opacity:1
}
.dex-cell .tarot-card  {
  width:100%
}
.dex-cell .card-name  {
  display:none
}
.dex-name  {
  display:block;
  font-size:12px;
  font-weight:700;
  line-height:1.5;
  text-align:center;
  word-break:keep-all;
  min-height:36px
}
.card-picture  {
  background:#1b1650 url('art/back.webp') center/cover
}
.card-picture img[data-src]  {
  opacity:0
}
.screen-dex-detail .panel h2  {
  font-size:23px;
  margin:12px 0 6px
}
.screen-dex-detail .panel p  {
  font-size:15px;
  margin:8px 0
}
.collection-date  {
  border-top:1px solid #be9c61;
  padding-top:10px;
  font-size:13px!important
}
.screen-dex-detail>.clay-btn  {
  font-size:21px;
  margin-top:10px
}
.journal-panel>p  {
  text-align:center;
  font-size:14px
}
.journal-list  {
  display:grid;
  gap:9px;
  margin-top:15px
}
.journal-entry  {
  width:100%;
  display:flex;
  align-items:center;
  gap:12px;
  background:#efd9b4;
  border:1px solid #c08e41;
  border-radius:15px;
  padding:8px;
  text-align:left
}
.journal-entry>img  {
  width:76px;
  height:75px;
  object-fit:contain;
  flex:none
}
.journal-entry>span  {
  display:grid;
  gap:5px
}
.journal-entry b  {
  font-size:21px;
  font-weight:400;
  font-family:var(--game)
}
.journal-entry span span  {
  font-size:13px
}
.journal-entry small  {
  font-size:12px
}
.empty-cat  {
  width:65%;
  margin:30px auto 15px
}
.daily-extra  {
  border-top:1px solid #c79542;
  margin-top:8px;
  padding-top:10px;
  font-size:12px;
  text-align:center
}
.daily-extra .advice-copy  {
  text-align:left;
  font-size:14px;
  margin-top:8px
}
.screen-share  {
  display:flex;
  flex-direction:column;
  gap:8px;
  align-items:center
}
.screen-share .sign  {
  flex:none
}
.share-preview  {
  width:100%;
  min-height:40%;
  display:grid;
  place-items:center;
  text-align:center
}
.result-image  {
  width:100%;
  height:auto;
  max-height:calc(100% - 290px);
  object-fit:contain;
  user-select:auto;
  -webkit-touch-callout:default
}
.share-help  {
  font-size:12px;
  color:#fff0ce;
  text-align:center;
  line-height:1.6
}
.share-actions  {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6px;
  width:100%
}
.share-actions .clay-btn  {
  padding:14px 14%;
  font-size:21px;
  min-height:61px
}
.screen-share>[data-share]  {
  margin-top:auto
}
.osc-book  {
  border:22px solid transparent;
  border-image:url('art/ui/panel.webp') 75 80 fill / 22px / 0 stretch;
  background:#f6e6c8;
  background-clip:padding-box;
  padding:2px 0
}
.screen-record .osc-book  {
  margin-bottom:10px
}
.screen-record .osc-back  {
  position:sticky;
  bottom:0;
  background:#f6e6c8
}
.osc-title  {
  font-family:var(--game)
}
@media(max-height:700px)  {
  .screen-dex .sign,.screen-journal .sign,.screen-share .sign,.screen-dex-detail .sign  {
    height:95px;
    padding-top:52px;
    font-size:22px
  }
  .dex-panel,.journal-panel  {
    margin-top:10px
  }
  .dex-count  {
    font-size:22px
  }
  .screen-share .result-image  {
    max-height:calc(100% - 270px)
  }
  .screen-share>[data-share]  {
    min-height:59px
  }
  .share-actions .clay-btn  {
    min-height:54px;
    font-size:20px
  }
  .journal-entry b  {
    font-size:20px
  }
}
.panel,.osc-book  {
  border-image-slice:100 80 60 fill
}
.screen-record .osc-book  {
  position:relative;
  inset:auto;
  z-index:1;
  height:auto;
  overflow:visible;
  margin:0
}
.screen-record .osc-date  {
  font-size:12px
}
.screen-record .osc-header  {
  padding:0 8px 5px;
  border:0
}
.screen-record .osc-title  {
  display:none
}
.screen-record .osc-book-scroll  {
  padding:0 6px 18px;
  overflow:visible
}
.screen-record .osc-back  {
  background:transparent url("art/ui/label.webp") center/100% 100% no-repeat;
  border:0
}
.screen-share  {
  gap:4px
}
.screen-share .result-image  {
  max-height:none;
  width:100%;
  height:auto
}
@media(max-height:700px)  {
  .screen-share .sign  {
    height:85px;
    padding-top:45px
  }
  .screen-share .share-help  {
    line-height:1.4
  }
}
.title-plaque  {
  font-size:40px
}
.screen-home>.clay-btn  {
  font-size:30px
}
.orak-ad-tag  {
  font-size:12px;
  color:#3a1d63
}
@media(max-height:700px)  {
  .title-plaque  {
    font-size:36px
  }
  .screen-home>.clay-btn  {
    font-size:27px
  }
}
.tarot-card  {
  container-type:inline-size
}
.meaning-name  {
  font-family:var(--game);
  font-size:15px;
  text-align:center;
  margin:0 0 4px
}
.reveal-scene  {
  container-type:size
}
.screen-reveal .reveal-card  {
  width:min(56%,calc(100cqh * .62565));
  max-height:none
}
.screen-reveal:has([data-bulk]) .reveal-card  {
  width:min(46%,calc(100cqh * .62565))
}

@media(prefers-reduced-motion:reduce) {
  .card-turn {
    transition-duration:.4s!important
  }
}
.screen-note {
  display:flex;
  flex-direction:column;
  overflow:hidden
}
.screen-note>.sign {
  flex:none
}
.screen-note>.note-cat {
  height:24%;
  max-height:205px
}
.screen-note>.spread-layout {
  flex:none
}
.screen-note .count-3 .placed-card {
  max-width:95px
}
.screen-note>.note-panel {
  flex:1;
  min-height:115px;
  overflow-y:auto;
  overscroll-behavior:contain;
  margin-top:12px;
  scrollbar-width:thin;
  scrollbar-color:#bd832a #f6e6c8
}
.screen-note>.note-actions {
  position:static;
  flex:none;
  margin-top:7px;
  padding:0;
  background:none
}
.note-panel .orak-next {
  margin-top:18px;
  gap:8px;
  background:transparent;
}
.note-panel .orak-next-title { margin:0 0 4px }
.note-panel .orak-next-card {
  gap:10px;
  padding:10px 12px;
  border:1px solid #b7814666;
  background:transparent;
}
.note-panel .orak-next-sub { white-space:normal }
.screen-note>.note-panel:has(.orak-next:not(:empty)) { padding-bottom:17px }
.note-panel .bonus-card {
  display:block;
  width:64px;
  padding:0;
  border:0;
  background:none
}
.screen-bonus .panel h2 {
  font-size:24px;
  margin-bottom:10px;
  text-align:center
}
.screen-bonus .panel p {
  font-size:15px;
  margin-top:10px
}
.screen-bonus>.clay-btn {
  margin-top:10px
}
@media(max-height:700px) {
  .screen-note>.note-cat {
    height:100px;
    min-height:60px
  }
  .screen-note .count-3 .placed-card {
    max-width:74px
  }
  .screen-note .count-3 .position-name {
    min-height:28px;
    font-size:15px;
    padding:6px 3px
  }
  .screen-note>.note-panel {
    margin-top:8px;
    border-width:20px;
    border-image-width:20px
  }
  .screen-note .note-actions .clay-btn {
    min-height:61px;
    font-size:21px
  }
  .screen-note>.note-actions {
    margin-top:5px
  }
  .screen-note:has(.count-5)>.note-cat,.screen-note:has(.count-7)>.note-cat {
    height:60px
  }
  .screen-note:has(.count-10)>.note-cat,.screen-note:has(.count-13)>.note-cat {
    height:40px;
    min-height:40px
  }
}
.screen-note .count-1 .placed-card {
  max-width:120px
}
@media(max-height:700px) {
  .screen-note .count-1 .placed-card {
    max-width:90px
  }
  .screen-note:has(.count-1)>.note-cat {
    height:60px;
    min-height:60px
  }
  .screen-note:has(.count-5)>.note-cat,.screen-note:has(.count-7)>.note-cat {
    height:35px;
    min-height:35px
  }
  .screen-note:has(.count-5)>.sign,.screen-note:has(.count-7)>.sign {
    height:90px;
    padding-top:50px
  }
  .screen-note:has(.count-10)>.note-cat,.screen-note:has(.count-13)>.note-cat {
    height:30px;
    min-height:30px
  }
  .screen-note:has(.count-10)>.sign,.screen-note:has(.count-13)>.sign {
    height:78px;
    padding-top:42px
  }
  .screen-note .count-10 .placed-card,.screen-note .count-13 .placed-card {
    height:56px;
    aspect-ratio:auto
  }
  .screen-note .count-10 .placed-card>.tarot-card,.screen-note .count-13 .placed-card>.tarot-card {
    width:34px;
    height:auto
  }
}
/* FIX-1 1: 큰 상차림은 원화 깔개 위에서 읽을 크기를 유지한다. */
.screen-note { display:block; overflow-y:auto; padding-bottom:105px }
.screen-note>.note-panel { min-height:0; overflow:visible; margin-top:18px }
.screen-note>.note-cat,.screen-note:has(.card-mat)>.note-cat { width:73%; height:205px; min-height:205px; max-height:none; margin:0 auto -12px }
.screen-pick:has(.card-mat) { display:block; overflow-y:auto; padding-bottom:210px }
.screen-pick:has(.card-mat) .pick-host { height:190px; min-height:190px }
.screen-pick:has(.card-mat) .pick-host>.sul { width:69% }
.spread-layout.card-mat {
  border:24px solid transparent;
  border-image:url('art/ui/mat.webp') 96 fill / 32px / 0 stretch;
  padding:4px 0 8px; max-width:none; margin:0; align-items:center; gap:18px 8px;
}
#view .card-mat .layout-place { transform:none; gap:0 }
#view .card-mat .placed-card { width:100%; height:auto; aspect-ratio:600/959; max-width:none; min-width:min(44px,100%) }
#view .card-mat .placed-card>.tarot-card { width:100%; height:auto }
.position-badge,#view .card-mat .position-index {
  display:grid; place-items:center; width:21px; height:21px; border-radius:50%;
  border:1px solid #b17722; background:#ffe199; color:#37164e; font-size:12px; font-weight:700;
}
#view .card-mat .position-index { position:absolute; bottom:-8px; right:calc(50% - 10px); transform:none }
.card-mat[data-layout=month] { grid-template-columns:repeat(4,minmax(0,1fr)) }
#view .count-5.card-mat .placed-card { width:clamp(76px,23vw,105px) }
#view .count-7.card-mat .placed-card { width:100% }
#view .count-10.card-mat { grid-template-columns:minmax(0,3fr) minmax(0,1fr); gap:12px }
.celtic-cross { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px 6px }
.celtic-staff { display:flex; flex-direction:column-reverse; gap:15px }
#view .celtic-cross .placed-card { width:min(78%,75px) }
#view .celtic-staff .placed-card { width:min(61%,51px) }
#view .count-10.card-mat .layout-place[data-pos="1"] .placed-card { transform:rotate(90deg); box-shadow:0 0 5px #160c2b }
#view .count-10.card-mat .layout-place[data-pos="1"] .position-index { transform:rotate(-90deg) }
#view .count-13.card-mat .placed-card { width:min(100%,82px) }
.position-list { margin:12px 0; padding:0; list-style:none; font-size:14px; line-height:1.4 }
.position-list li {
  display:grid; grid-template-columns:21px minmax(0,1fr) minmax(0,1.25fr);
  align-items:baseline; gap:8px; padding:7px 0;
  border-bottom:1px solid #b7814666; overflow-wrap:anywhere;
}
.slot-positions { margin:0 }
.slot-positions li { grid-template-columns:21px minmax(0,1fr) }
.position-reversed { color:var(--sub); font-size:.9em }
.screen-pick:has(.card-mat) .fan-area { position:fixed; z-index:9; bottom:46px; left:50%; transform:translateX(-50%); width:min(100%,480px); height:150px; min-height:150px; background:#32194e }
.screen-pick:has(.card-mat) .pick-hint { position:fixed; z-index:10; bottom:0; left:50%; transform:translateX(-50%); width:min(85%,400px); margin:0 }
.screen-note>.note-actions { position:fixed; z-index:10; bottom:0; left:50%; transform:translateX(-50%); width:min(100%,480px); padding:8px 12px max(8px,env(safe-area-inset-bottom)); margin:0; background:#32194e }

/* FIX-1 2: 틀과 이름은 바로 두고 안쪽 그림만 뒤집는다. */
.reversed .card-front,.reversed .card-name { transform:none }
.reversed .card-picture img { transform:rotate(180deg) }
.card-name { font-size:20px; letter-spacing:-.5px }
.card-name.long-name { display:flex; font-size:16px; letter-spacing:-1px; left:17%; width:66% }
.card-reversed { position:absolute; z-index:4; right:-5%; top:-3%; width:25%; height:auto; pointer-events:none }
#view .position-name { font-size:12px; min-height:44px; line-height:1.35; white-space:normal }
.screen-reveal .reveal-scene { min-height:305px }
.screen-reveal .reveal-card,.screen-reveal:has([data-bulk]) .reveal-card { width:190px; max-width:210px }
@media(max-height:700px) {
 .screen-reveal .reveal-copy { max-height:150px }
 .screen-reveal .sign { flex-shrink:0 }
}

/* FIX-1 3: 장식 아래에서 시작하는 내용과 불투명한 하단 행동 띠. */
.panel,.screen-note>.note-panel,.screen-reveal .reveal-copy,.topic-panel,.journal-panel { padding-top:16px }
.screen-note>.note-panel { height:auto; max-height:none; overflow:visible }
.headline-rest { font-size:14px; line-height:1.7; margin:0 0 12px }
.screen-note .note-actions { background:#32194e }

/* FIX-1 4: 꼬리가 왼쪽 아래인 원화 말풍선과 둥근 뒤로 버튼. */
#back { top:57px; width:48px; height:48px; background-image:url('art/ui/btn-back.webp') }
#view .speech { background:transparent url('art/ui/bubble.webp') center/100% 100% no-repeat; border:0; padding:18px 14px 25px; width:46%; min-height:100px; top:16%; font-size:18px; display:grid; place-items:center }
#view .pick-host>.sul { width:69%; padding-inline-start:48px }
.screen-record .osc-header { display:none }

/* FIX-1 6: 하늘은 화면 전체, 조작 안내와 점수는 크림 이름표 위에. */
#stage[data-screen=stars] { background:#1b1650 url('art/bg-roof.webp') center bottom/cover no-repeat }
.screen-stars { display:block; padding:0; overflow:hidden }
.screen-stars>.sky-wrap { position:absolute; inset:0; width:100%; height:100%; min-height:0; border:0; border-radius:0; background:none }
.screen-stars>.sign { z-index:3 }
.screen-stars .star-hud { position:absolute; z-index:3; left:12px; right:12px; top:110px; padding:0 }
.screen-stars .star-tally { color:#3a1d63; text-shadow:none; gap:12px; padding:12px 15px; font-size:16px }
.screen-stars .star-tally img { width:24px; height:24px }
.star-controls {
  position:absolute; z-index:3; inset:auto 12px max(12px,env(safe-area-inset-bottom));
  display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1fr); gap:8px; min-height:44px;
}
.star-controls .sky-instruction { color:var(--ink); font-size:14px; font-weight:700; pointer-events:none }
.star-controls .skip-stars { grid-column:2; width:100%; align-self:stretch; font-size:14px }
@media(max-height:700px) { .screen-stars .star-hud { top:94px } }

/* FIX-1 7: 결과 이미지를 한 화면 안에 둥근 모서리로 미리 본다. */
.screen-share .result-image { width:auto; max-width:100%; height:calc(100% - 285px); max-height:calc(100% - 285px); aspect-ratio:1080/1350; object-fit:contain; border-radius:18px }
.screen-share .share-help { flex:none }
.screen-stars .star-hud { top:126px }
@media(max-height:700px) { .screen-share .result-image { height:calc(100% - 255px); max-height:calc(100% - 255px) } }

/* 이미지 자체 크기와 둥근 모서리를 일치시킨다. */
.screen-share .result-image { width:min(100%,calc((100svh - 285px)*.8)); height:auto; max-height:none; aspect-ratio:1080/1350; border-radius:18px }

/* FIX-2 1: 한눈에 읽는 예·아니요 답 도장. 금색 글자도 크림 위 대비를 지킨다. */
.journal-entry .journal-answer { font-size:18px; color:#5b2d91 }

/* FIX-2 2: 풀이 판은 자연 높이, 화면 전체를 스크롤하고 행동은 불투명 띠에 둔다. */
.screen-reveal { display:block; padding-bottom:105px }
.screen-reveal .reveal-scene { flex:none; container-type:normal; height:330px; min-height:330px }
.screen-reveal .reveal-copy { max-height:none; height:auto; overflow:visible; margin-top:8px }
.screen-reveal .reveal-card,.screen-reveal:has([data-bulk]) .reveal-card { width:190px; max-width:none }
.screen-reveal .reveal-actions { position:fixed; z-index:10; bottom:0; left:50%; transform:translateX(-50%); width:min(100%,480px); padding:8px 12px max(8px,env(safe-area-inset-bottom)); background:#32194e; display:grid; gap:6px }
.reveal-actions:has([data-bulk]) { grid-template-columns:1fr 1fr }
.reveal-actions:has([data-bulk]) .clay-btn { font-size:20px; padding-inline:8px }
.reveal-actions .bulk-flip { width:100%; min-height:60px; font-size:16px; align-self:stretch }
@media(max-height:700px) {
 .screen-reveal .reveal-scene { height:260px; min-height:260px }
 .screen-reveal .reveal-card,.screen-reveal:has([data-bulk]) .reveal-card { width:150px }
}

/* FIX-2 3: 방 배경에서 떨어져 보이는 공유 미리보기와 크림 안내 이름표. */
.screen-share { background:rgb(0 0 0 / 55%) }
.screen-share .result-image { border-radius:16px; border:3px solid #f2b62b; box-shadow:0 8px 24px #000b }
.screen-share .share-help { color:#3a1d63; width:100%; min-height:44px; padding:10px 18px; font-size:12px }

/* FIX-3 1: 스크롤 중에는 집·뒤로·제목·소리를 한 줄에 둔다. */
.stage { --top-cover:60px }
.topbar-title { display:none }
.stage.is-scrolled .topbar { top:4px; padding:0 }
.stage.is-scrolled #back { top:2px; left:56px }
.stage.is-scrolled .topbar-title { display:grid; place-items:center; position:absolute; left:50%; transform:translateX(-50%); width:calc(100% - 212px); height:52px; color:#f6e6c8; font:16px/1.2 var(--game); text-align:center }
.stage.is-scrolled .topbar::before { content:''; position:absolute; z-index:-1; top:-4px; left:-10px; right:-10px; height:var(--top-cover); background:#32194e; border-bottom:1px solid #f2b62b }
.dex-tabs { position:sticky; top:var(--top-cover); z-index:19; background:var(--surface) }
.screen-dex { scroll-padding-top:calc(var(--top-cover) + 60px) }

/* FIX-2 5: 부채 뒤는 방 그림 아래쪽 깔개로 잇고 금색 선으로 마감한다. */
.screen-pick:has(.card-mat) { padding-bottom:250px }
.screen-pick:has(.card-mat) .fan-area { height:190px; min-height:190px; background:#32194e url('art/bg-room.webp') center bottom / 100% auto no-repeat; border-top:2px solid #f2b62b; box-shadow:0 -3px 8px #1b165088 }
@media(max-height:700px) {
 .screen-pick:has(.card-mat) { padding-bottom:220px }
 .screen-pick:has(.card-mat) .fan-area { height:160px; min-height:160px }
}

/* Leave the rooftop clear below the score and timer. */
.screen-stars .star-hud { top:116px; left:12px; right:12px; flex-direction:column; align-items:flex-end; gap:4px }
.screen-stars .star-tally { gap:8px; padding:10px 12px; font-size:14px }
.screen-stars .star-tally img { width:20px; height:20px }

/* Keep the shuffle track inside the cream plaque. */
.intro-host { width:200px; height:170px; overflow:hidden; margin:0 auto; flex:none }
.intro-host>.intro-cat { width:200px; height:auto; max-width:none; margin:0 }
.mix-progress {
  width:min(80%,220px); height:4px; appearance:none; border:0; border-radius:4px;
  background:#cca463; color:#ad681a; overflow:hidden;
}
.mix-progress::-webkit-progress-bar { background:#cca463 }
.mix-progress::-webkit-progress-value { background:#ad681a }
.mix-progress::-moz-progress-bar { background:#ad681a }
@media(max-height:700px) {
 .intro-host { height:160px }
 .screen-note:not(:has(.card-mat))>.note-cat { height:140px; min-height:140px }
}

/* Local scripts keep the same plaque sizes and use their own readable glyphs. */
html[lang="ja"] { --game:"Noto Sans JP",sans-serif; --body:"Noto Sans JP",sans-serif }
html[lang="zh-TW"] { --game:"Noto Sans TC",sans-serif; --body:"Noto Sans TC",sans-serif }
html[lang="th"] { --game:"Noto Sans Thai",sans-serif; --body:"Noto Sans Thai",sans-serif }
html[lang="vi"] { --game:"Noto Sans",sans-serif; --body:"Noto Sans",sans-serif }

html:not([lang="ko"]) .card-name,
html:not([lang="ko"]) .card-name.long-name {
  font-size:12px;line-height:1.05;white-space:normal;overflow-wrap:anywhere;letter-spacing:0;text-align:center
}

/* FIX-4: 그림은 모든 언어에서 유지하고 글자만 내용 영역에 맞춘다. */
.fit-text { display:block; min-width:0; max-width:100%; text-align:center; font-family:inherit; font-weight:inherit; letter-spacing:inherit }
.fit-text,.fit-text * { transition:none!important }
.fit-wrap { white-space:normal; overflow-wrap:anywhere }
.fit-wrap>.fit-text { overflow-wrap:anywhere }
.title-plaque>.fit-text { width:100% }
.title-plaque.fit-title-lines em { display:block }
.home-tiles button>span,.spread-tile>b,.dex-name { width:100%; min-width:0 }
.fit-wrap.clay-btn,.fit-wrap.label { height:auto }
.sign>.fit-text,.topbar-title>.fit-text { line-height:1.15 }
html:not([lang="ko"]) .title-plaque { letter-spacing:0 }
html:not([lang="ko"]) .home-tiles img { flex-shrink:1; min-height:0 }
html:not([lang="ko"]) .screen-home { overflow-y:auto }
html:not([lang="ko"]) .quick-paths img { min-height:0; flex-shrink:1 }
html:not([lang="ko"]) .dex-grid { grid-template-columns:repeat(3,minmax(0,1fr)) }
html:not([lang="ko"]) .meaning summary { display:grid; grid-template-columns:32px minmax(0,1fr) 18px }
.meaning summary>span { min-width:0; overflow-wrap:anywhere }
.meaning summary img { flex:none }
html:not([lang="ko"]) .meaning summary::after { text-align:center; margin-left:0!important }
.reading-row>span:last-child,.journal-entry>span,.lens summary>span { min-width:0; overflow-wrap:anywhere }
#stage .panel { overflow-wrap:anywhere }
.keywords>span { max-width:100%; min-width:0 }
html[lang="th"] #stage :is(h1,h2,h3,p,button,summary,.label,.card-name,.home-tiles span,.dex-name,.fit-text) { line-height:1.35 }
html[lang="th"] body,html[lang="th"] .yn-answer { line-height:1.35 }
html[lang="th"] .card-name { line-height:1.35 }
html[lang="th"] .count { font-size:18px; line-height:1.35; white-space:nowrap }

/* FIX-5: fit inside the painted area, including its vertical safe space. */
html:not([lang="ko"]) .card-name-roomy {
  left:3%; top:auto; bottom:2%; width:94%; height:auto; min-height:12%;
  padding:5px 9px; background:url('art/ui/label.webp') center/100% 100% no-repeat;
  line-height:1.15; letter-spacing:0
}
#view .spread-layout:not(.card-mat) .position-caption {
  display:flex; flex-direction:column; justify-content:center; gap:2px;
  height:auto; padding:7px 12px; overflow:visible
}
.position-caption>span { display:block; width:100%; font-size:14px; line-height:1.35; text-wrap:balance }
html:not([lang="ko"]) .clay-btn { padding-inline:calc(19% + 6px) }
#stage .fit-no-paws {
  padding-inline:12px; background-size:180% 100%; border-radius:999px;
  box-shadow:inset 0 0 0 2px #d69a38,inset 0 -4px 4px #66322255
}
html:not([lang="ko"]) :is(.core-line,.note-panel>h2,.headline-rest,.panel h2,.panel h3,.yn-reason) { text-wrap:balance }
html:is([lang="ja"],[lang="zh-TW"]) #stage { line-break:strict }
html:is([lang="ja"],[lang="zh-TW"]) #stage :is(.core-line,.note-panel>h2,.headline-rest,.panel h2,.panel h3,.yn-reason) { word-break:normal; overflow-wrap:normal }
html[lang="th"] #stage { word-break:normal }
html[lang="th"] #stage :is(.fit-wrap,.fit-text,.card-name,.panel,.core-line,.note-panel>h2) { word-break:normal; overflow-wrap:normal }

#view .spread-layout:has(.position-caption) { align-items:start; padding-inline:4px; gap:12px 4px }
#view .spread-layout.caption-wide-grid { grid-template-columns:repeat(2,minmax(0,1fr)) }

/* FIX-11: keep sprite motion on an inner layer so the layout stays still. */
.sul { position:relative; display:block; overflow:visible; filter:none }
.host-tap,.host-frame { display:block; width:100%; height:100%; padding:0; background:none }
.host-tap { pointer-events:auto; position:relative; transform-origin:center bottom }
.host-frame {
  display:flex;
  align-items:end;
  justify-content:center;
  transform-origin:center bottom;
  animation:tarot-host-breathe 3s ease-in-out infinite;
  filter:drop-shadow(0 5px 6px #170b2d55);
}
.host-frame>img { width:auto; height:auto; max-height:100%; object-fit:contain; object-position:center bottom; transform-origin:center bottom }
.host-nod { animation:tarot-nod .46s ease-out }
.host-tap.host-nod { animation-name:tarot-host-nod }
.host-jump { animation:tarot-jump .59s ease-out }
.host-tap.host-jump { animation-name:tarot-host-pounce }
.host-blink { animation:tarot-blink .12s ease-in-out }
.host-speech {
  position:absolute; z-index:6; top:4px; left:50%; translate:-50% 0;
  width:max-content; max-width:min(230px,86vw); min-height:52px; padding:10px 17px;
  display:grid; place-items:center; background:#f6e6c8; border:2px solid #c48a34;
  color:#3a1d63; border-radius:19px; box-shadow:0 4px 8px #24123f70;
  text-align:center; font-size:15px; font-weight:700; line-height:1.35;
  pointer-events:none; animation:tarot-paper .25s ease-out both;
}
.host-speech::after {
  content:""; position:absolute; bottom:-7px; left:calc(50% - 6px); width:10px; height:10px;
  background:#f6e6c8; border-right:2px solid #c48a34; border-bottom:2px solid #c48a34; rotate:45deg;
}
.topic-cat { margin-inline:auto }
.intro-host { overflow:visible }
.intro-cat { height:100%!important }
.screen-note>.note-cat,.screen-note:has(.card-mat)>.note-cat {
  width:min(73%,calc(100% - 102px)); margin-bottom:6px;
}
.note-cat .host-speech { top:8% }
.screen-reveal .reveal-scene,.reading-hero { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:10px; padding:12px 4px 16px }
.screen-reveal .reveal-scene { align-items:center }
.reveal-cat,.reading-cat { width:100%; height:100%; max-height:195px; align-self:end; inset:auto; z-index:3 }
.reveal-cat .host-speech,.reading-cat .host-speech { left:0; translate:0 -80% }
.reading-hero .detail-art { margin:0; width:clamp(132px,46vw,190px) }
.list-cat { width:190px; height:135px; margin:0 auto 8px }

.room-lights { position:absolute; z-index:0; inset:0; pointer-events:none }
.room-lights i {
  position:absolute; left:var(--x); top:var(--y); translate:-50% -50%;
  width:25px; aspect-ratio:1; border-radius:50%;
  background:radial-gradient(circle,#fff2acdd, #ffb22e55 42%,transparent 72%);
  animation:tarot-glow 2.8s ease-in-out infinite var(--delay);
}
.room-lights i:nth-child(-n+4) { width:42px; transform-origin:50% 90%; animation-name:tarot-flame }
.quick-paths button { position:relative }
.quick-paths button::after {
  content:""; position:absolute; pointer-events:none; left:50%; top:19%;
  width:32px; height:32px; border-radius:50%;
  background:radial-gradient(circle,#fff8ca 0%,#ffd56c80 35%,transparent 70%);
  animation:tarot-glow 2.9s ease-in-out infinite;
}
.quick-paths [data-daily]::after { left:calc(50% - 15px); top:54%; width:30px; height:30px }
.quick-paths [data-yesno]::after {
  left:calc(50% - 19px); top:20%; width:38px; height:38px;
  background:conic-gradient(from 0deg,transparent,#dcbaffb0,transparent,#fff0b7a0,transparent);
  mask-image:radial-gradient(black 20%,transparent 72%);
  animation:tarot-spin 6s linear infinite;
}
.screen-enter>.panel,.screen-enter>.reading-list,.screen-enter>.menu-panel { animation:tarot-paper .25s ease-out both }
.clay-btn { overflow:hidden }
.clay-btn::after {
  content:""; position:absolute; inset:10% 6%; border-radius:22px; pointer-events:none;
  background:linear-gradient(114deg,transparent 35%,#fff4c41c 44%,#fffbd480 50%,transparent 60%);
  animation:tarot-shine 4s linear infinite;
}
.clay-btn:active,.clay-btn.is-pressing,.quick-paths button:active,.home-tiles button:active,.label:is(button):active { transform:scale(.97) }
.clay-btn:active::after,.clay-btn.is-pressing::after {
  inset:20% auto 20% 2%; width:16%; border-radius:50%; background:#fff3be60;
  animation:tarot-nod .28s ease-out;
}
.deck-stack img { --stack-shift:calc((var(--deck-i) - 2.5)*20px); --stack-turn:calc((var(--deck-i) - 2.5)*9deg) }
.mixing:not(.cut) .deck-stack img { animation:tarot-mix .38s ease-in-out }
.fan-card img {
  transition:translate .14s ease-out;
}
.fan-card:is(:hover,:focus-visible,.is-pressing):not(.chosen) img { translate:0 -9px }
.fan-card:has(+.fan-card:hover) img,.fan-card:hover+.fan-card img { translate:0 -4px }
.reveal-card>.closed { animation:tarot-float 3s ease-in-out infinite }
.reveal-card::after {
  content:""; position:absolute; inset:0; border-radius:12px; pointer-events:none;
  background:linear-gradient(128deg,transparent 30%,#ffe9a51a 42%,#ffe9a56b 49%,transparent 64%);
  opacity:0;
}
.reveal-card:has(.closed)::after { animation:tarot-shine 4s 1s linear infinite }
.reveal-card.card-flipped::after { animation:tarot-card-glint .55s .43s both }
.card-turn { transition-duration:.5s }
.screen-note .placed-card>.tarot-card { animation:tarot-paper .3s calc(var(--place)*48ms) both }
.screen-note .celtic-cross .placed-card>.tarot-card { animation:tarot-card-fade .22s ease-out both }
@keyframes tarot-card-fade { from { opacity:.65 } to { opacity:1 } }
.dex-cell[data-new] .tarot-card::after,.unseen-card::after {
  content:""; position:absolute; inset:0; pointer-events:none;
  background:radial-gradient(circle at 50% 46%,#fff2b3aa,transparent 45%);
  animation:tarot-glow 3.6s ease-in-out infinite;
}
.dex-cell[data-new] .tarot-card::after { background:radial-gradient(circle at 22% 21%,#fff8b9,transparent 34%) }

.sky-glints,.catch-player { position:absolute; inset:0; pointer-events:none }
.sky-glints { background:radial-gradient(circle at 39.3% 9%,#fff7bc 0,transparent 1.6%),radial-gradient(circle at 86% 22%,#fff6bf 0,transparent 1.3%),radial-gradient(circle at 16% 59%,#fff7bc 0,transparent 1.5%); animation:tarot-glow 2.8s ease-in-out infinite }
.catch-cat { position:absolute; width:var(--sprite-width); translate:-50% 0 }
.catch-cat img { width:100%; height:100%; object-fit:contain; object-position:center bottom }
.catch-spark {
  position:absolute; width:28px; height:28px; opacity:0;
  translate:-50% -50%; background:#fff5ba;
  clip-path:polygon(50% 0,63% 37%,100% 50%,63% 63%,50% 100%,37% 63%,0 50%,37% 37%);
}
.catch-spark-pop { animation:tarot-catch-spark .35s ease-out }
@keyframes tarot-catch-spark { 0% { opacity:1; scale:.45 } 35% { opacity:1; scale:1 } 100% { opacity:0; scale:.4 } }
@media(prefers-reduced-motion:reduce) {
  .catch-spark-pop { animation-name:tarot-catch-fade }
  @keyframes tarot-catch-fade { from { opacity:1 } to { opacity:0 } }
}
.star-callout {
  position:absolute; inset:36% 0 auto; margin:auto; width:max-content; max-width:90%;
  border-radius:28px; background:#32194e; border:3px solid #f6c94f; color:#fff0ce;
  font:700 clamp(32px,14vw,62px)/1.1 var(--game); text-align:center; padding:8px 26px;
  pointer-events:none;
}
.sky-call,.score-pop { animation:tarot-pop .34s both }
.star-combo { top:220px }
.star-time.rush { background:#53205e; border:2px solid #ffd464; border-radius:16px; color:#fff2c8 }

.result-stage { position:relative; width:70%; height:clamp(107px,23svh,200px); align-self:center; display:grid; place-items:center }
.result-star { position:relative; z-index:1; background:none; height:100%; width:100%; margin:0; padding:0; animation:tarot-drop .64s both }
.result-figure { display:block; width:100%; height:100%; animation:tarot-float 2.8s .65s ease-in-out infinite }
.result-figure img { width:100%; height:100%; object-fit:contain }
.result-star.result-jump { animation:tarot-jump .59s ease-out }
.result-spark {
  position:absolute; z-index:2; pointer-events:none; left:calc(10% + var(--i)*13%); top:46%;
  width:12px; height:12px; background:#fff3bd;
  clip-path:polygon(50% 0,63% 36%,100% 50%,63% 63%,50% 100%,37% 63%,0 50%,37% 37%);
  animation:tarot-spark 2.1s calc(var(--i)*-.32s) ease-out infinite;
}
.result-spark:nth-of-type(3n+2) { top:60% }
.result-spark:nth-of-type(3n+3) { top:74% }
.star-grade { animation:tarot-pop .48s .15s both }
.screen-star-result .panel .star-total { font-weight:700; font-size:20px; margin-top:0 }
.reward-row { animation:tarot-paper .3s calc(.14s + var(--i,0)*.11s) both }
.motion-hidden *,.motion-hidden *::before,.motion-hidden *::after,
.motion-offscreen,.motion-offscreen *,.motion-offscreen::before,.motion-offscreen::after,
.motion-offscreen *::before,.motion-offscreen *::after { animation-play-state:paused!important }

@keyframes tarot-paper { from { transform:translateY(9px); opacity:.87 } to { transform:none; opacity:1 } }
@keyframes tarot-host-breathe { 50% { transform:scale(1.027,.98) } }
@keyframes tarot-host-nod { 35% { transform:rotate(1.4deg) scaleY(.98) } 65% { transform:scaleY(.995) } }
@keyframes tarot-host-pounce { 15% { transform:scale(1.05,.94) } 43% { transform:scaleX(.98) } 75% { transform:scale(1.04,.96) } }
@keyframes tarot-nod { 35% { transform:translateY(4px) rotate(1.4deg) } 65% { transform:translateY(-1px) } }
@keyframes tarot-jump { 15% { transform:scale(1.05,.94) } 43% { transform:translateY(-15px) scale(.98,1.04) } 75% { transform:scale(1.04,.96) } }
@keyframes tarot-blink { 50% { transform:scaleY(.985) } }
@keyframes tarot-glow { 0%,100% { opacity:.16; transform:scale(.72) } 43% { opacity:.83; transform:scale(1.08) } }
@keyframes tarot-flame { 0%,100% { opacity:.3; transform:skewX(-9deg) scale(.8) } 55% { opacity:.76; transform:skewX(7deg) scale(1.07) } }
@keyframes tarot-spin { to { transform:rotate(360deg) } }
@keyframes tarot-float { 50% { transform:translateY(-5px) } }
@keyframes tarot-shine {
  0%,73% { transform:translateX(-102%); opacity:0 }
  75% { opacity:1 }
  93%,100% { transform:translateX(102%); opacity:0 }
}
@keyframes tarot-card-glint { 47% { opacity:.95 } 100% { opacity:0 } }
@keyframes tarot-mix { 48% { transform:translateX(var(--stack-shift)) rotate(var(--stack-turn)) } }
@keyframes tarot-sway { 50% { transform:rotate(2.5deg) } }
@keyframes tarot-squash { 28% { transform:scale(1.1,.78) } 68% { transform:scale(.98,1.08) } }
@keyframes tarot-pop { 0% { opacity:.7; transform:scale(.84) } 57% { opacity:1; transform:scale(1.13) } 100% { transform:none } }
@keyframes tarot-drop { 0% { transform:translateY(-125px) } 58% { transform:scale(1.1,.88) } 78% { transform:translateY(-16px) } 100% { transform:none } }
@keyframes tarot-spark { 0% { opacity:0 } 32% { opacity:.96 } 100% { opacity:0; transform:translateY(-34px) scale(.35) } }
@keyframes tarot-fade { 50% { opacity:.35 } }

@media(max-height:700px) {
  .screen-star-result { gap:7px }
  .result-stage { height:clamp(99px,20svh,143px) }
}
@media(prefers-reduced-motion:reduce) {
  .host-tap,.host-frame,.result-figure,.result-star,.reveal-card,.screen-note .placed-card>.tarot-card,
  .room-lights i,.quick-paths button::after,.catch-player img,
  .deck-stack img,.screen-enter>.panel,.screen-enter>.reading-list,
  .reward-row,.star-grade,.score-pop,.sky-call,.host-speech {
    animation:none!important; transition:none!important;
  }
  .reveal-card>.closed { animation:none }
  .result-spark,.dex-cell[data-new] .tarot-card::after,.unseen-card::after,.sky-glints { animation:tarot-fade 3s ease-in-out infinite }
  .clay-btn::after,.reveal-card:has(.closed)::after { animation:none }
  .fan-card img { transition:none; translate:none!important }
  .card-turn { transition:none!important }
}

/* FIX-11: names live on the card; the plate below it labels its position. */
#view .spread-layout:not(.card-mat) .position-caption {
  width:100%; max-width:100%; min-height:44px; margin-inline:auto;
  padding:6px 0; text-align:center; color:#37164e;
}
.position-caption .position-title {
  width:auto; white-space:inherit; font:inherit;
}
#view .position-caption { font:700 14px/1.35 var(--body) }
.small-card:not(.card-name-fit) .card-frame {
  mask:linear-gradient(black 0 0),linear-gradient(black 0 0) center 98% / 72% 16.5% no-repeat;
  mask-composite:subtract;
}
@supports not (mask-composite:subtract) {
  .small-card:not(.card-name-fit) .card-frame {
    mask:none;
    clip-path:polygon(0 0,100% 0,100% 100%,86% 100%,86% 82%,14% 82%,14% 100%,0 100%);
  }
}
.small-card:not(.card-name-fit) .card-picture { height:94.5% }
.small-card:not(.card-name-fit) .card-name { visibility:hidden; overflow:hidden }
#view .small-card[data-card-title] .card-name {
  display:flex; left:21.6%; top:86.3%; width:56.7%; height:11%;
  padding:0; font-weight:700; letter-spacing:0;
}
#view .card-name { text-shadow:none }
#view .card-name-roomy {
  left:3%; top:auto; bottom:2%; width:94%; height:auto; min-height:12%;
  padding:5px 9px; background:url('art/ui/label.webp') center/100% 100% no-repeat;
  line-height:1.15; letter-spacing:0;
}
#view .next-card-time {
  width:100%; min-height:36px; margin:0 auto;
  padding:6px 13px; font-size:14px; font-weight:700; text-align:center;
}
#view.screen-note :is(.count-2,.count-3) .placed-card { width:min(100%,106px); max-width:none }
#view.screen-share { display:block; padding-bottom:145px }
#view.screen-share .result-image { width:100%; max-width:none; margin:4px auto 6px }
.share-footer {
  position:fixed; z-index:10; bottom:0; left:50%; translate:-50% 0; width:min(100%,480px);
  display:grid; gap:4px; padding:5px 12px max(6px,env(safe-area-inset-bottom)); background:#32194e;
}
.share-footer>.clay-btn { font-size:21px; min-height:53px; padding-block:12px }
.share-footer .share-actions .clay-btn { min-height:49px; padding-block:10px }
@media(max-height:700px) {
  #view.screen-note:has(.count-2,.count-3)>.note-cat { height:116px; min-height:116px }
}

.yn-panel { text-align:center; margin:6px 0 0; border-width:15px 20px; padding:2px 0 5px }
.yn-scale { --yn-gap:8px; position:relative; padding-top:19px }
.yn-scale ol {
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--yn-gap);
  margin:0; padding:0; list-style:none;
}
.yn-cell {
  position:relative; display:grid; place-items:center; min-height:39px; padding:3px;
  border:2px solid #9d81968c; border-radius:12px; background:#d5be9f8c; color:#563d54;
  font:bold clamp(15px,4.45vw,17px)/1.25 var(--body);
}
.yn-cell[aria-current=true] {
  z-index:1; border-color:#b37723; background:#ffd472; color:#37164e; transform:scale(1.08);
  box-shadow:inset 0 0 0 2px #ffe6a2,0 0 10px #f8b3308c;
}
.yn-orbit {
  --step:calc(100% + var(--yn-gap));
  position:absolute; z-index:2; inset:0 auto auto 0; width:calc((100% - 2 * var(--yn-gap))/3);
  display:grid; justify-items:center;
  transform:translateX(calc(var(--answer) * var(--step)));
  animation:tarot-answer-meter .85s ease-in-out both;
  filter:drop-shadow(0 1px 1px #8a501b);
}
.yn-pointer,.yn-pointer::after {
  width:27px; height:21px; clip-path:polygon(0 0,100% 0,50% 100%);
}
.yn-pointer { position:relative; background:#92551f }
.yn-pointer::after {
  content:""; position:absolute; inset:1px 2px 2px; width:auto; height:auto;
  background:linear-gradient(#ffed9d,#e69a19);
}
#view .yn-answer {
  display:block; margin:6px 0 2px; padding:0; border:0; background:none; box-shadow:none;
  color:#37164e; font:700 clamp(24px,5.8vw,27px)/1.2 var(--game);
}
#view .yn-reason { margin:0; font-size:14px; line-height:1.35; color:#4d285d }
#view .note-panel>.yn-answer { margin:0 0 4px }
.note-panel>.yn-reason+.headline-rest { margin-top:10px }
@keyframes tarot-answer-meter {
  0% { transform:translateX(var(--step)) }
  24% { transform:translateX(calc(2 * var(--step))) }
  51% { transform:translateX(0) }
  71% { transform:translateX(calc(1.6 * var(--step))) }
}
@media(prefers-reduced-motion:reduce) { .yn-orbit { animation:none } }

.tabs {
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px;
  margin:0 0 10px; padding:0;
}
.tabs button {
  width:100%; min-width:0; min-height:46px; padding:6px 7px; border:2px solid #c28e40;
  border-radius:14px; background:#fff1d5; color:#34204c;
  box-shadow:inset 0 -3px 0 #ecd5a5,0 2px 3px #6b421a33;
  font:700 17px/1.2 var(--body); text-align:center;
}
.tabs button:focus-visible { outline-color:#4d266d }
.tabs button[aria-pressed=true] {
  position:relative; background:#39204f; color:#fff; border-color:#f3bd48;
  box-shadow:inset 0 -3px 0 #271634,0 2px 3px #6b421a44;
  padding-inline:20px;
}
.tabs button[aria-pressed=true]::after {
  content:""; pointer-events:none; position:absolute; width:13px; height:13px; top:50%; right:2px;
  transform:translateY(-50%) rotate(-16deg);
  background:radial-gradient(ellipse at 50% 72%,#ffd675 0 29%,transparent 32%),
             radial-gradient(circle at 14% 38%,#ffd675 0 9%,transparent 11%),
             radial-gradient(circle at 39% 20%,#ffd675 0 10%,transparent 12%),
             radial-gradient(circle at 65% 18%,#ffd675 0 10%,transparent 12%),
             radial-gradient(circle at 87% 38%,#ffd675 0 9%,transparent 11%);
}
.menu-grid .spread-tile:not(.tile-press) { animation:tarot-paper .25s calc(var(--tile)*55ms) both }
.reveal-scene:has(.closed) .host-frame img { animation:tarot-anticipate 2.4s ease-in-out infinite }
@keyframes tarot-anticipate { 62%,84% { transform:none } 69% { transform:rotate(-1.5deg) } 77% { transform:rotate(1.5deg) } }
@media(prefers-reduced-motion:reduce) {
  .menu-grid .spread-tile,.reveal-scene:has(.closed) .host-frame img { animation:none!important }
  .screen-shuffle .cut .deck-stack img { transform:none }
}
/* Let long readings grow with the paper, with enough scroll space to clear
   the fixed action strip even when its translated buttons take two lines. */
html:not([lang="ko"]) .screen-reveal { padding-bottom:calc(var(--reveal-actions-height, 89px) + 24px) }
html:not([lang="ko"]) :is(.core-line,.reading-row>span:last-child>span) {
  min-height:min-content; word-break:normal; overflow-wrap:normal; text-wrap:balance
}

/* The bust and the table in the room artwork share the same baseline. */
.stage { --table-line:calc(38svh + 10px) }
#stage:has(.single-note-scene) {
  --scale-gap:0px;
  background-size:100% calc(116% + var(--scale-gap) / .46);
  background-position:center top calc(-16svh - 12px);
}
#stage:has(.single-note-scene):has(.yn-panel) {
  --scale-gap:var(--note-scale-gap,0px);
}
.single-note-scene {
  display:grid; grid-template-columns:1fr 1fr; align-items:start;
  gap:4px; margin-inline:4px;
}
.single-note-scene .note-cat {
  width:100%; height:calc(var(--table-line) - 95px); margin:0;
}
.single-note-scene .host-tap,.journal-cat .host-tap { height:calc(100% - 20px); top:20px }
.single-note-scene .note-cat .host-speech { left:0; translate:0; max-width:100% }
#view .single-note-scene .spread-layout { padding:8px 1px 0 }
#view .single-note-scene .layout-place { width:100% }
#view .single-note-scene .placed-card { width:min(100%,132px); max-width:none }
#view .single-note-scene .position-caption { min-width:min(76px,100%) }
#view .single-note-scene .position-title { white-space:normal; text-wrap:balance }
.screen-note:has(.single-note-scene)>.note-panel { margin-top:4px; border-top-width:21px; padding-top:2px }
.screen-note:has(.single-note-scene)>.note-panel>h2 { font-size:20px; line-height:1.25 }

.plaque-peek {
  display:grid; grid-template-columns:minmax(0,1fr) clamp(94px,30vw,125px);
  align-items:end; gap:6px; padding:65px 7px 0 44px;
}
.plaque-peek .sign { width:100%; height:103px; margin:0 0 5px; font-size:23px }
.peek-cat { height:102px }
.peek-cat .host-speech { left:auto; right:0; translate:0; top:100% }
.plaque-peek+.panel,.plaque-peek+.osc-book { position:relative; z-index:3; margin-top:-6px }
.screen-share .plaque-peek { padding-top:0; align-items:start }
.screen-share .plaque-peek .sign { height:113px; margin-top:-18px }
.screen-share .peek-cat { height:75px; margin-top:68px }
.screen-share .peek-cat .host-speech { top:auto; bottom:0 }
@media(max-height:700px) {
  .screen-share .peek-cat { margin-top:63px }
  #view.screen-share { padding-bottom:84px }
  .share-footer { grid-template-columns:minmax(0,1fr) minmax(0,2fr) }
  .share-footer .share-actions { grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px }
  .share-footer .clay-btn,.share-footer .share-actions .clay-btn {
    min-height:54px; padding-block:8px; font-size:17px;
  }
}

.screen-journal>.sign { height:113px }
.journal-cat {
  z-index:1; width:52%; height:calc(var(--table-line) - 95px);
  margin-left:6%;
}
.journal-cat .host-speech { top:25%; left:92%; translate:0; max-width:140px }
.journal-cat .host-speech::after { left:-7px; bottom:calc(50% - 5px); rotate:135deg }
.screen-journal>.journal-panel { position:relative; z-index:2; margin-top:-6px }
.journal-panel>p+p { margin-top:8px }

/* Leave a lane above the active controls for the room's shell announcements. */
.tarot-room > :is(.osc-toast,.orak-hub-toast) { display:none!important }
.tarot-toast-tray {
  position:absolute; z-index:30; pointer-events:none;
  inset:auto 0 max(var(--toast-bottom,0px),env(safe-area-inset-bottom,0px));
  padding:5px 12px;
}
.tarot-toast-tray:empty { display:none }
.tarot-toast-tray > :is(.osc-toast,.orak-hub-toast) {
  position:static!important; transform:none!important; max-width:100%!important;
  width:max-content; margin:auto; padding:6px 12px!important; animation:none;
}
.tarot-toast-tray > .orak-hub-toast img { width:26px!important; height:26px!important }
.tarot-toast-tray > .orak-hub-toast span { min-width:0; overflow-wrap:anywhere }
.stage.toast-clips-view #view:not(.screen-stars) {
  height:calc(100% - max(var(--toast-bottom,0px),env(safe-area-inset-bottom,0px)) - var(--toast-lane,0px));
  padding-bottom:12px;
}
.screen-pick:not(:has(.card-mat)) .pick-hint,.deck-area { margin-top:var(--toast-lane,0px) }

/* The fitted text is positioned against the artwork, independent of layout padding. */
#view :is(.title-plaque,.sign) { padding:0 }
#view .clay-btn { padding-inline:0 }
#view .home-tiles button { position:relative; padding:0 }
#view .home-tiles img { position:absolute; top:12%; height:36% }
#view .home-tiles button>span { display:grid; justify-items:center }
#view .shuffle-plaque { position:relative; padding-block:9px 17px }
#view .shuffle-plaque .mix-progress { position:absolute; bottom:20%; width:min(62%,220px) }
#view .star-tally { width:min(300px,100%); gap:6px; min-height:48px; justify-content:center; font-variant-numeric:tabular-nums; padding-inline:0 }
#view.screen-pick .count-4:not(.card-mat) { width:calc(100% + 16px); align-self:center; padding-inline:0; column-gap:4px }
.screen-star-result .star-rewards { margin-bottom:var(--toast-lane,0px) }
/* 2026-12-02 도감 탭: 짧은 낱말(Mayor)이 발 도장 아이콘 때문에 글자 단위로 끊기던 것 → 좌우 여백을 줄이고 낱말은 끊지 않는다 */
.dex-tabs .label { padding-left: 10px; padding-right: 10px; }
.dex-tabs .label .fit-text { overflow-wrap: normal; word-break: keep-all; }
.dex-tabs .label[aria-pressed="true"] { padding-right: 17px; padding-left: 6px; }
/* 2026-12-02 일본어: 말풍선·안내 글이 낱말 가운데(な/る, 浮か/べて, 場/面)에서 줄이 바뀌던 것 → 구절 단위로 */
html[lang="ja"] body { word-break: auto-phrase; }
html[lang="ja"] body :is(.speech, .bubble, p, .fit-text) { text-wrap: pretty; }
html[lang="ja"] body { overflow-wrap: anywhere; }
/* 2026-12-02 판 위 가운데 별 장식: 3칸 자르기로 판 비율이 바로 서면서 별이 조금 커져 첫 줄 글(Your last 30 readings)에 닿던 것 → 위 여백을 별 아래까지 */
.panel,.screen-note>.note-panel,.topic-panel,.journal-panel { padding-top:26px }

/* 아래 고정 버튼 띠 위로 글자가 칼같이 잘리지 않게 띠 위를 부드럽게 흐린다 */
.screen-note>.note-actions::before { content:""; position:absolute; left:0; right:0; bottom:100%; height:30px; background:linear-gradient(#32194e00,#32194e); pointer-events:none }
