.ritual-section {
  --rt-bg: #16191e;
  --rt-paper: #f1e5cc;
  --rt-metal: #c4a572;
  --rt-muted: #bcad97;
  color: var(--rt-paper);
  background:
    radial-gradient(ellipse at 76% 55%, #363028 0, #262426 21%, transparent 53%),
    linear-gradient(115deg, #161b23, #191b20 50%, #1b1b1e);
  border-block: 1px solid #bda16e33;
}
#ritual { max-width: 1510px; margin: 0 auto; }
#ritual [hidden] { display: none !important; }
#ritual .rt-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.rt-room { font-family: system-ui, "Microsoft YaHei", sans-serif; }
.rt-room *, .rt-room *::before, .rt-room *::after { box-sizing: border-box; }
.rt-room button { appearance: none; color: inherit; font: inherit; cursor: pointer; }
.rt-room button:focus-visible { outline: 2px solid #f3dcad; outline-offset: 4px; }
.rt-shell {
  display: grid;
  grid-template-columns: minmax(235px,.79fr) minmax(0,1.21fr);
  align-items: center;
  gap: clamp(20px,4vw,75px);
  width: min(1280px, calc(100% - clamp(48px, 10vw, 150px)));
  margin: 0 auto;
  padding-block: clamp(58px,7vw,102px); row-gap: 38px;
}
.rt-room h2, .rt-room h3, .rt-room p { margin: 0; }
.rt-room .rt-label {
  display: flex; align-items: center; gap: 11px;
  font: 500 12px/1.4 ui-monospace, "Courier New", monospace;
  color: var(--rt-metal); letter-spacing: .2em;
}
.rt-label span { width: 32px; height: 1px; background: currentColor; }
.rt-room h2, .rt-reading h3 {
  font-family: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  font-weight: 500;
}
.rt-room h2 { margin: .26em 0 .24em; font-size: clamp(48px,5.3vw,77px); letter-spacing: -.05em; line-height: 1.25; color: var(--rt-paper); }
.rt-room .rt-lead { font: 400 clamp(16px,1.35vw,20px)/1.7 "Noto Serif SC","Songti SC",SimSun,serif; color: #d8c7ac; letter-spacing: .025em; }
.rt-options { margin-top: 32px; }
.rt-options > p { color: #d4c7b6; font-size: 14px; line-height: 1.65; }
.rt-choices { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 12px; }
.rt-room .rt-choice {
  border: 1px solid #897a645e; border-radius: 30px; background: #211f1d6b;
  min-width: 62px; min-height: 36px; padding: 5px 16px;
  color: #cfc0aa; font-size: 14px; transition: background-color .25s, border-color .25s;
}
.rt-room .rt-choice[aria-pressed="true"] { background: #d6ba88; border-color: #d6ba88; color: #26231c; }
.rt-room .rt-choice:hover:not([aria-pressed="true"]) { border-color: #d6ba88; }
.rt-prompt { min-height: 2.9em; color: var(--rt-muted); font-size: 15px; line-height: 1.75; }
.rt-room .rt-shuffle {
  display: inline-flex; gap: 10px; align-items: center; padding: 6px 0;
  border: 0; border-bottom: 1px solid #a18c6b8f; background: transparent;
  color: #ead8b9; font-size: 15px; letter-spacing: .08em; min-height: 42px;
}
.rt-shuffle svg { width: 18px; height: 18px; }
.rt-shuffle:hover svg { transform: rotate(-12deg); }
.rt-stage { position: relative; display: grid; align-items: center; justify-items: center; isolation: isolate; min-width: 0; container-type: inline-size; }
.rt-stage::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none; inset: 10% -4% 6%;
  background: radial-gradient(ellipse closest-side, #9475462d, transparent 100%);
}
.rt-mat { position: absolute; width: 87%; aspect-ratio: 2.3; border: 1px solid #b0956940; border-radius: 50%; top: 36%; z-index: -1; transform: rotate(-4deg); }
.rt-mat::before, .rt-mat::after, .rt-mat > div { content: ""; position: absolute; border-radius: 50%; inset: 3%; border: 1px solid #b095692a; }
.rt-mat::after { inset: 10% -4%; border-color: #b0956928; transform: rotate(16deg); }
.rt-mat > div { inset: 3% -1%; transform: rotate(-14deg); border-style: dotted; }
.rt-fan { position: relative; width: 100%; height: clamp(235px, 44cqw, 365px); }
.rt-room .rt-card {
  --card-scale: 1;
  --lift: 0px;
  --step: 9cqw;
  --x: calc(var(--step) * var(--translation));
  --rot: var(--angle);
  position: absolute; top: 42%; left: 50%; width: min(25cqw,165px); aspect-ratio: 160/248; padding: 0;
  border: 1px solid #ba9d72; border-radius: 7px;
  color: #cbb084;
  background:
    repeating-linear-gradient(74deg, #ffffff06 0px, transparent 1px 4px),
    linear-gradient(140deg, #434044, #272b35 33%, #1b222d 74%, #35312e);
  box-shadow: -4px 6px 11px #090a0e8c, inset 0 0 10px #d3b88a0f;
  transform-origin: center 80%;
  transform: translate(-50%, -50%) translate(var(--x),calc(var(--sink) + var(--lift))) rotate(var(--rot)) scale(var(--card-scale));
  transition: transform .48s cubic-bezier(.2,.72,.2,1), filter .3s, opacity .42s;
  z-index: var(--order);
  -webkit-tap-highlight-color: transparent;
}
.rt-card svg, .rt-face svg { width: 100%; height: 100%; display: block; border-radius: inherit; }
.rt-card:nth-child(2n) { filter: brightness(.97); }
@media(hover: hover) {
  .rt-room:not(.rt-shuffling):not(.rt-drawing) .rt-card:not(:disabled):hover { --lift:-22px; --card-scale:1.05; filter: brightness(1.2); z-index: 9; }
}
.rt-room:not(.rt-shuffling):not(.rt-drawing) .rt-card:not(:disabled):focus-visible { --lift:-22px; --card-scale:1.05; filter: brightness(1.2); z-index:9; }
.rt-room .rt-stage-hint {
  text-align: center; color: #c6b698; font-size: 13px; line-height: 1.6; margin: 9px 0 0;
  display:flex; align-items:center; justify-content:center; gap:13px; min-height: 28px; letter-spacing: .105em;
}
.rt-stage-hint::after, .rt-stage-hint::before {
  content:""; width: 27px; height:1px; background: linear-gradient(90deg,transparent,#b0996c);
}
.rt-stage-hint::after { transform: rotate(180deg); }
.rt-room.rt-shuffling .rt-card {
  animation: rt-gather .82s cubic-bezier(.4,0,.15,1) both;
}
@keyframes rt-gather {
  0%,100% {transform:translate(-50%,-50%) translate(var(--x),var(--sink)) rotate(var(--angle));}
  32% {transform:translate(-50%,-50%) translate(calc(var(--translation) * .9px),calc(var(--translation) * 1px)) rotate(-6deg);}
  55% {transform:translate(-50%,-50%) translate(calc(var(--translation) * -5px),calc(var(--translation) * -2px)) rotate(6deg);}
}

.rt-room .rt-controls {display:flex;align-items:center;gap:1rem}
.rt-room .rt-shuffle::before {content:'⤨';font:22px Georgia,serif}
.rt-room .rt-shuffle[hidden],.rt-room .rt-new[hidden]{display:none}
.rt-room .rt-new{padding:7px 0;border:0;border-bottom:1px solid #c7ab7b99;color:#f2d9a7;background:none;min-height:44px;font-size:15px}
.rt-room .rt-choice:disabled{cursor:default;opacity:.57}
.rt-room .rt-choice:disabled[aria-pressed=true]{opacity:1}
.rt-rule{margin-top:16px;max-width:35em;color:#c9bdab;font-size:14px}
.rt-rule summary{cursor:pointer;width:fit-content;padding:3px 0;color:#d4bc96}
.rt-rule p{margin-top:.5rem;line-height:1.85}
.rt-rule a{text-decoration:underline;text-underline-offset:3px}
.rt-room .rt-card.rt-taken{opacity:0;pointer-events:none}
.rt-room .rt-card.rt-chosen{z-index:10;animation:rt-select .44s cubic-bezier(.22,.65,.25,1) both}
@keyframes rt-select{to{transform:translate(-50%,-50%) translate(0,-14px) perspective(680px) rotateY(86deg);opacity:.15}}
.rt-spread{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;max-width:660px;gap:clamp(5px,1.15vw,20px);margin-top:1rem}
.rt-slot{display:flex;align-items:center;justify-content:center;min-width:0;min-height:64px;gap:9px;text-align:center}
.rt-room .rt-empty{background:#14161b35;border:1px dashed #c5aa7550;padding:9px;color:#cbb891;font-size:14px}
.rt-place-index{font:italic 14px/1 Georgia,serif;color:#a98f65}
.rt-room .rt-filled{padding:5px;border:1px solid #b79b695c;background:#242427;color:#f4e1bd}
.rt-room .rt-filled[aria-pressed=true]{border-color:#dac190;box-shadow:inset 0 -2px #c9a56a}
.rt-slot-copy{min-width:0;display:grid;gap:.22em;text-align:left}
.rt-slot-copy small{font:400 13px/1.5 system-ui,"Microsoft YaHei",sans-serif;color:#c5b394}
.rt-slot-copy b{font:500 16px/1.35 "Noto Serif SC",SimSun,serif;color:#f7ebce}
.rt-face{position:relative;display:block;width:34px;flex:none;aspect-ratio:.58;color:#493720;background:#e8d8b4;border-radius:3px;overflow:hidden;box-shadow:0 3px 9px #08090a70}
.rt-print,.rt-plate,.rt-print>svg{position:absolute;inset:0;width:100%;height:100%;display:block}
.rt-plate{background:#e8d8b4;object-fit:contain}
.rt-inverted{transform:rotate(180deg)}
.rt-room.rt-complete .rt-spread{order:-1;gap:clamp(5px,1.4vw,22px);margin:0}
.rt-complete .rt-slot{min-height:0}
.rt-room.rt-complete .rt-filled{flex-direction:column;gap:8px;background:none;border:0;box-shadow:none;padding:8px 0}
.rt-complete .rt-filled .rt-face{width:min(94%,165px);box-shadow:0 9px 19px #06070a90;outline:1px solid #c9aa7348;outline-offset:3px;transition:transform .25s,outline-color .25s}
.rt-complete .rt-filled[aria-pressed=true] .rt-face{outline-color:#efcb89;transform:translateY(-4px)}
.rt-complete .rt-slot-copy{text-align:center;gap:3px}
.rt-complete .rt-slot-copy small{letter-spacing:.08em}
.rt-room.rt-complete .rt-slot-copy b{font-size:clamp(16px,1.6vw,23px)}
.rt-complete .rt-mat{top:40%}
.rt-complete .rt-stage-hint{margin-top:15px}
.rt-complete .rt-options{margin-top:22px}
.rt-reading{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:clamp(1rem,4vw,4.4rem);padding-top:1.45rem;border-top:1px solid #a78f6655;align-self:start}
.rt-reading:focus{outline:none}
.rt-card-note,.rt-thread{min-width:0;max-width:58ch}
.rt-room .rt-answer-label{color:#d4b780;font-size:14px;letter-spacing:.06em}
.rt-room .rt-reading h3{font:500 clamp(26px,2.7vw,38px)/1.4 "Noto Serif SC",SimSun,serif;margin:.2em 0}
.rt-reading h3 small{font:400 14px/1.7 system-ui,sans-serif;display:inline-block;color:#dac7aa;margin-left:.8rem}
.rt-room .rt-answer-copy,.rt-room .rt-thread>p:not(.rt-answer-label){color:#e1d6c4;line-height:1.85;font-size:16px}
.rt-room .rt-context{color:#bfb3a0;font-size:14px;line-height:1.7;margin-top:.4rem}
.rt-room .rt-thread>.rt-answer-label{margin-bottom:.45rem}
.rt-room .rt-thread .rt-reflection{font-family:"Noto Serif SC",SimSun,serif;border-left:1px solid #c3a06a;padding-left:.8rem;margin-top:.7rem;color:#efdbb6}
@media(max-width:740px){
  .rt-shell{grid-template-columns:1fr;gap:22px;width:min(100% - 36px,580px);padding-block:48px 44px}
  .rt-options{margin-top:16px}.rt-room h2{font-size:45px}.rt-room .rt-lead{font-size:16px}.rt-prompt{min-height:1.8em}
  .rt-rule{margin-top:9px}
  .rt-room .rt-fan{height:max(200px,48cqw)}
  .rt-room .rt-card{width:25.5cqw;--step:8.45cqw;font-size:12px}
  .rt-room .rt-stage-hint{margin-top:0;font-size:13px;letter-spacing:.025em}
  .rt-spread{gap:5px;margin-top:.5rem}
  .rt-slot{min-height:53px;gap:4px}
  .rt-filled .rt-face{width:24px}
  .rt-filled .rt-slot-copy small{font-size:12px}
  .rt-filled .rt-slot-copy b{font-size:13px}
  .rt-complete .rt-filled .rt-face{width:min(92%,140px)}
  .rt-room.rt-complete .rt-slot-copy b{font-size:16px}
  .rt-room.rt-complete .rt-spread{gap:8px}
  .rt-reading{grid-template-columns:1fr;gap:1.2rem;padding-top:1rem}
}
@media(prefers-reduced-motion:reduce){.rt-room *, .rt-room *::after, .rt-room *::before{animation:none!important;transition:none!important}}
