* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); background-image: var(--bg-art); background-attachment: fixed; color-scheme: dark; }
:root[data-mode="light"] { color-scheme: light; }
body { margin: 0; color: var(--ink); font: 16px/1.5 var(--sans); padding-bottom: 72px; overflow-x: clip; min-height: 100vh; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--gold); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--primary); color: var(--on-primary); padding: 10px 14px; border-radius: 6px; z-index: 80; }
.skip:focus { left: 8px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

canvas.sky { position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.amb { position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; }

.top { text-align: center; padding: 14px 0 6px; position: relative; }
.top .wrap { position: relative; padding: 0 64px; }
.brand { display: inline-flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--ink); min-height: 44px; view-transition-name: brand; }
.brand b { font-family: var(--display); font-size: 22px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: var(--display-weight); line-height: 1.1; background: var(--foil-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand span { display: flex; align-items: center; gap: 10px; color: var(--gold); font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; margin-top: 2px; }
.brand span::before, .brand span::after { content: ""; width: 36px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-line)); }
.brand span::after { transform: scaleX(-1); }
.theme { position: absolute; right: 12px; top: 4px; min-height: 44px; min-width: 44px; padding: 0 14px; background: var(--chip); border: 1px solid var(--line); border-radius: 22px; font-size: 13px; font-weight: 600; transition: border-color 0.3s, background-color 0.3s; }
.theme:hover { border-color: var(--gold-line); }

.pane { display: none; }
.stage[data-view="draw"] .pane-draw, .stage[data-view="cast"] .pane-cast, .stage[data-view="saved"] .pane-saved { display: block; }
.pane { animation: pane-in 0.45s var(--ease) both; }
.vt .pane { animation: none; }
@keyframes pane-in { from { opacity: 0; transform: translateY(10px); } }
.pane-draw, body[data-page="category"] main { position: relative; isolation: isolate; }

.tabs { display: flex; justify-content: center; gap: 4px; margin: 8px auto 12px; position: sticky; top: 0; z-index: 25; background: var(--bar); padding: 6px 12px; border-bottom: 1px solid var(--line); box-shadow: 0 8px 20px -12px rgba(0, 0, 0, 0.5); view-transition-name: tabs; }
.tabs button { min-height: 44px; flex: 1; max-width: 200px; border: 1px solid transparent; background: transparent; border-radius: 22px; font-weight: 600; font-size: 15px; color: var(--muted); transition: color 0.3s, background-color 0.3s; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--primary-grad); color: var(--on-primary); view-transition-name: tabsel; box-shadow: 0 0 18px var(--glow-soft); }
.tabs .n { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; font-size: 12px; background: rgba(127, 127, 127, 0.25); }

h1 { font-family: var(--display); font-weight: var(--display-weight); font-size: 34px; line-height: 1.12; margin: 8px 0 6px; text-align: center; letter-spacing: var(--display-track); }
h1 em { font-style: normal; background: var(--foil-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { text-align: center; color: var(--muted); max-width: 520px; margin: 0 auto 16px; font-size: 15px; }
h2 { font-family: var(--display); font-weight: var(--display-weight); font-size: 26px; margin: 0 0 8px; letter-spacing: var(--display-track); }

.decks { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px 2px 10px; scrollbar-width: none; }
.decks::-webkit-scrollbar { display: none; }
.deck { flex: 0 0 132px; min-height: 76px; scroll-snap-align: start; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; position: relative; overflow: hidden; transition: border-color 0.3s, transform 0.3s var(--ease), box-shadow 0.3s; }
.deck b { display: block; font-family: var(--serif); font-size: 19px; font-weight: var(--name-weight); }
.deck small { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; margin-top: 2px; }
.deck:hover { transform: translateY(-2px); border-color: var(--gold-line); }
.deck[aria-pressed="true"] { border-color: var(--gold-line); box-shadow: inset 0 0 0 1px var(--gold-line), 0 6px 22px var(--glow-soft); }
.deck[aria-pressed="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: var(--primary-grad); border-radius: 2px; animation: grow-x 0.5s var(--ease) both; }

details.table { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin: 6px 0 14px; }
details.table summary { min-height: 48px; padding: 12px 14px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
details.table summary::-webkit-details-marker { display: none; }
details.table summary span { color: var(--muted); font-weight: 400; font-size: 14px; }
details.table[open] .opts { animation: pane-in 0.35s var(--ease) both; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 14px 14px; }
.opts label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.opts .wide { grid-column: 1 / -1; }
.opts select { min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); padding: 0 10px; font-size: 16px; text-transform: none; letter-spacing: 0; font-weight: 400; width: 100%; }
.opts label.check { flex-direction: row; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ink); }
.opts input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--gold-line); }

.dealbar { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 8px 0 18px; }
.btn { min-height: 52px; padding: 0 28px; border-radius: 26px; border: 0; background: var(--primary-grad); color: var(--on-primary); font-weight: 700; font-size: 17px; letter-spacing: 0.02em; position: relative; overflow: hidden; isolation: isolate; box-shadow: 0 6px 22px var(--glow-soft); transition: transform 0.25s var(--ease), box-shadow 0.3s; }
.btn::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 50%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent); transform: translateX(0) skewX(-18deg); opacity: 0; z-index: -1; pointer-events: none; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 28px var(--glow-soft); }
.btn:hover::after { animation: btn-shine 1s ease-out; }
.btn:active { transform: translateY(1px) scale(0.98); }
@keyframes btn-shine { 0% { transform: translateX(0) skewX(-18deg); opacity: 0; } 8% { opacity: 1; } 30%, 100% { transform: translateX(380%) skewX(-18deg); opacity: 0; } }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--gold-line); font-weight: 600; font-size: 15px; min-height: 44px; padding: 0 18px; box-shadow: none; }
.btn.ghost:hover { background: var(--chip); }
.btn.sm { min-height: 44px; font-size: 14px; padding: 0 16px; }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn.done { border-color: var(--jade, var(--gold-line)); color: var(--ink); }
.btn .tick { width: 18px; height: 18px; margin-right: 6px; vertical-align: -4px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; animation: tick 0.45s 0.05s var(--ease) forwards; }
@keyframes tick { to { stroke-dashoffset: 0; } }
.linkbtn { background: transparent; border: 0; color: var(--gold); text-decoration: underline; text-underline-offset: 3px; min-height: 44px; padding: 0 8px; font-size: 14px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.hand { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 14px 16px 26px; margin: 0 -16px; scrollbar-width: thin; }
.card { flex: 0 0 min(76vw, 288px); height: 420px; perspective: 1200px; scroll-snap-align: center; position: relative; isolation: isolate; }
.card::before { content: ""; position: absolute; inset: -6% -10%; border-radius: 50%; background: radial-gradient(closest-side, var(--glow), transparent); opacity: 0; z-index: -1; pointer-events: none; transition: opacity 0.6s; }
.card.flipped::before { opacity: 0.4; }
.card.reveal::before { animation: aura 1.3s var(--ease) both; }
@keyframes aura { 0% { opacity: 0; transform: scale(0.7); } 35% { opacity: 1; transform: scale(1.08); } 100% { opacity: 0.4; transform: scale(1); } }
.card-in { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(var(--rx, 0deg)) rotateY(calc(var(--ry, 0deg) + var(--flip, 0deg))); transition: transform var(--flip-dur) var(--flip-ease); }
.card.flipped { --flip: 180deg; }
.card.tilt .card-in { transition: transform 0.18s ease-out; }
.card.flipping .card-in { transition: transform var(--flip-dur) var(--flip-ease); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.face { position: absolute; inset: 0; border-radius: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: var(--shadow); overflow: hidden; }
.face::after { content: ""; position: absolute; inset: -20% -40%; background: linear-gradient(105deg, transparent 38%, var(--foil) 50%, transparent 62%); transform: translateX(calc((var(--mx, 0.5) - 0.5) * 70%)); opacity: 0; transition: opacity 0.4s; pointer-events: none; z-index: 2; mix-blend-mode: var(--foil-blend); }
.front::after { --foil: var(--foil-front); }
.card.tilt .face::after { opacity: 1; }
.card.reveal .front::after { animation: sweep 1.3s 0.3s var(--ease); }
@keyframes sweep { 0% { transform: translateX(-70%); opacity: 0; } 12% { opacity: 1; } 30% { transform: translateX(70%); opacity: 0; } 100% { transform: translateX(70%); opacity: 0; } }
.card:not(.flipped) .front { visibility: hidden; transition: visibility 0s linear 0.3s; }
.card.flipped .back { visibility: hidden; transition: visibility 0s linear 0.3s; }
.back { border: 0; padding: 0; width: 100%; background: var(--back-art); color: var(--back-ink); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; }
.back::before { content: ""; position: absolute; inset: 10px; border: 1px solid var(--back-line); border-radius: 10px; background: var(--back-pattern); }
.back .seal { position: relative; width: 88px; height: 88px; border-radius: 50%; border: 1px solid var(--back-line); background: var(--back-seal); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 6px var(--back-ring), 0 0 30px var(--glow-soft); }
.back .seal svg { width: 40px; height: 40px; fill: var(--back-ink); position: relative; z-index: 1; }
@keyframes seal-breathe { 0%, 100% { transform: scale(1) rotate(0); opacity: 0.85; } 50% { transform: scale(1.12) rotate(45deg); opacity: 1; } }
.back .cap { position: relative; font-family: var(--display); letter-spacing: 0.24em; text-transform: uppercase; font-size: 12px; background: var(--back-cap); padding: 3px 12px; border-radius: 2px; }
.back:hover .seal { box-shadow: 0 0 0 6px var(--back-ring), 0 0 44px var(--glow); }
.front { transform: rotateY(180deg); background: var(--card-art); color: var(--card-ink); display: flex; flex-direction: column; padding: 14px 16px 10px; border: 1px solid var(--card-line); }
.front::before { content: ""; position: absolute; inset: 6px; border: 1px solid var(--card-line-2); border-radius: 11px; pointer-events: none; }
.front .kick { text-align: center; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--card-gold); font-weight: 700; }
.front .nm { font-family: var(--serif); font-weight: var(--name-weight); font-size: 28px; line-height: 1.08; text-align: center; margin: 10px 0 2px; overflow-wrap: anywhere; }
.front .sc { font-family: var(--cjk); text-align: center; font-size: 20px; color: var(--card-muted); }
.front .pr { text-align: center; font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--card-gold); margin-top: 4px; font-weight: 600; }
.front .orn { height: 1px; background: linear-gradient(90deg, transparent, var(--card-line), transparent); margin: 10px 0; flex: none; position: relative; overflow: visible; }
.front .orn::after { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; background: var(--card-line); transform: rotate(45deg); }
.front .mean { font-size: 14px; line-height: 1.4; text-align: center; color: var(--card-ink); }
.front .sub { font-size: 12px; color: var(--card-muted); text-align: center; margin-top: 4px; line-height: 1.35; }
.front .tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 8px; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.tag.over { background: var(--over-bg); color: var(--over-ink); }
.tag.warn { background: var(--warn-bg); color: var(--warn-ink); }
.tag.era { background: var(--era-bg); color: var(--era-ink); }
.tag.unsure { background: var(--unsure-bg); color: var(--unsure-ink); }
.front .acts { margin-top: auto; display: flex; gap: 6px; position: relative; z-index: 3; }
.front .acts button { flex: 1; min-height: 44px; border-radius: 22px; border: 1px solid var(--card-line); background: transparent; color: var(--card-ink); font-size: 13px; font-weight: 700; transition: background-color 0.25s, transform 0.2s var(--ease); }
.front .acts button:hover { background: var(--card-pressed); }
.front .acts button:active { transform: scale(0.95); }
.front .acts button.main { background: var(--card-btn); color: var(--card-btn-ink); border-color: var(--card-btn); flex: 1.4; }
.front .acts button[aria-pressed="true"] { background: var(--card-pressed); }
.front .body { overflow: hidden; flex: 1 1 auto; min-height: 0; padding-bottom: 6px; }
.front.ghost { box-shadow: 0 0 0 1px var(--card-line), 0 18px 50px var(--glow); }

.cast-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.cast-head p { margin: 0; color: var(--muted); font-size: 14px; }
.board { background: var(--board-art); border: 1px solid var(--line); border-radius: 16px; padding: 16px 10px; display: flex; flex-direction: column; gap: 22px; align-items: center; position: relative; }
.tier { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; position: relative; }
.tier + .tier::before { content: ""; position: absolute; top: -22px; left: 50%; width: 1px; height: 22px; background: linear-gradient(var(--gold-line), var(--gold-line)); transform-origin: top; }
.couple { position: relative; }
.couple::after { content: ""; position: absolute; top: 50%; left: 50%; width: 22px; height: 1px; margin-left: -11px; background: var(--gold-line); }
.board.enter .tier + .tier::before { animation: grow-y 0.5s var(--ease) both; animation-delay: 0.35s; }
.board.enter .tier + .tier + .tier::before { animation-delay: 0.75s; }
.board.enter .couple::after { animation: grow-x 0.45s var(--ease) both; animation-delay: 0.3s; }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes grow-x { from { transform: scaleX(0); } }
.slot { width: 96px; height: 132px; border-radius: 10px; padding: 6px; display: flex; flex-direction: column; text-align: center; position: relative; transition: transform 0.25s var(--ease), box-shadow 0.25s; }
.slot.empty { border: 1px dashed var(--gold-line); background: transparent; color: var(--muted); justify-content: center; align-items: center; font-size: 12px; gap: 4px; }
.slot.empty:hover { border-style: solid; color: var(--ink); }
.slot.empty[aria-pressed="true"] { border-style: solid; box-shadow: 0 0 0 2px var(--gold-line), 0 0 22px var(--glow); color: var(--ink); }
@keyframes slot-call { 50% { transform: scale(1.04); } }
.slot.filled { background: var(--card-art); color: var(--card-ink); border: 1px solid var(--card-line); box-shadow: var(--shadow); justify-content: flex-start; align-items: center; }
.slot.filled:hover { transform: translateY(-3px); box-shadow: var(--shadow), 0 0 22px var(--glow-soft); }
.slot .role { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--card-gold); line-height: 1.2; min-height: 22px; display: flex; align-items: center; }
.slot .nm { font-family: var(--serif); font-weight: var(--name-weight); font-size: 14.5px; line-height: 1.1; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; }
.slot .sc { font-family: var(--cjk); font-size: 13px; color: var(--card-muted); margin-top: auto; }
.slot svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.sect-title { text-align: center; }
.sect-title b { font-family: var(--display); font-weight: var(--display-weight); font-size: 24px; display: block; }
.sect-title span { color: var(--muted); font-size: 13px; }
.note { font-size: 13px; color: var(--muted); max-width: 560px; text-align: center; margin: 0 auto; }

.glossary { margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.glossary .gh { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.tw { overflow-x: auto; margin: 10px -4px 0; }
table.g { border-collapse: collapse; min-width: 560px; width: 100%; font-size: 14px; }
table.g th { text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.g td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.g td.n { font-family: var(--serif); font-weight: var(--name-weight); font-size: 17px; white-space: nowrap; color: var(--gold); }
.empty-g { color: var(--muted); padding: 14px 4px; }

.saved-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.saved-list li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 14px; animation: pane-in 0.4s var(--ease) both; }
.saved-list li:nth-child(2) { animation-delay: 0.05s; }
.saved-list li:nth-child(3) { animation-delay: 0.1s; }
.saved-list li:nth-child(n+4) { animation-delay: 0.15s; }
.saved-list .nm { font-family: var(--serif); font-size: 19px; font-weight: var(--name-weight); display: block; }
.saved-list .su { color: var(--muted); font-size: 13px; display: block; }
.ib { min-width: 44px; min-height: 44px; border: 1px solid var(--line); background: transparent; border-radius: 22px; font-size: 13px; font-weight: 600; padding: 0 12px; transition: border-color 0.25s, background-color 0.25s; }
.ib:hover { border-color: var(--gold-line); }

dialog { border: 1px solid var(--card-line); border-radius: 16px; background: var(--card-art); color: var(--card-ink); padding: 0; width: min(420px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 60px var(--glow-soft); }
dialog[open] { animation: dlg-in 0.45s var(--ease) both; }
dialog::backdrop { background: var(--scrim); }
dialog[open]::backdrop { animation: fade-in 0.4s ease both; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(24px) scale(0.96); } }
@keyframes fade-in { from { opacity: 0; } }
dialog .dh { display: flex; justify-content: space-between; align-items: center; padding: 8px 8px 0 18px; }
dialog .dh span { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 700; color: var(--card-gold); }
dialog .db { padding: 4px 18px 18px; }
dialog h3 { font-family: var(--serif); font-weight: var(--name-weight); font-size: 30px; margin: 4px 0 0; line-height: 1.1; }
dialog dl { display: grid; grid-template-columns: 92px 1fr; gap: 6px 10px; font-size: 14px; margin: 12px 0; }
dialog dt { color: var(--card-muted); font-weight: 700; }
dialog dd { margin: 0; overflow-wrap: anywhere; }
dialog .callout { padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-top: 8px; }
dialog .callout.over { background: var(--over-bg); color: var(--over-ink); }
dialog .callout.warn { background: var(--warn-bg); color: var(--warn-ink); }
dialog .callout button { margin-top: 6px; min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1px solid currentColor; background: transparent; color: inherit; font-weight: 700; }
dialog .dacts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
dialog .dacts button { flex: 1; min-height: 44px; border-radius: 22px; border: 1px solid var(--card-line); background: transparent; color: var(--card-ink); font-weight: 700; transition: background-color 0.25s; }
dialog .dacts button:hover { background: var(--card-pressed); }
dialog .ib { border-color: var(--card-line); color: var(--card-ink); }

.ad { width: 100%; background: repeating-linear-gradient(45deg, rgba(127, 127, 127, 0.12), rgba(127, 127, 127, 0.12) 10px, transparent 10px, transparent 20px); border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; display: flex; align-items: center; justify-content: center; }
.ad--under, .ad--mid { height: 250px; max-width: 336px; margin: 18px auto; }
.ad--anchor { position: fixed; left: 0; right: 0; bottom: 0; height: 56px; border-radius: 0; border-width: 1px 0 0; z-index: 20; background-color: var(--bg); }

.copy p { margin: 0 0 14px; }
.copy { max-width: 680px; margin: 0 auto; }
.crumbs { font-size: 13px; color: var(--muted); padding: 14px 0 0; text-align: center; }
.crumbs a { color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
.faq { max-width: 680px; margin: 28px auto 0; }
.faq details { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--surface); }
.faq summary { min-height: 48px; padding: 12px 16px; font-weight: 600; cursor: pointer; }
.faq details[open] p { animation: pane-in 0.35s var(--ease) both; }
.faq details p { margin: 0; padding: 0 16px 14px; color: var(--muted); }
.related { margin-top: 28px; }
.related ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.related a { display: flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 22px; text-decoration: none; font-size: 14px; font-weight: 600; color: var(--ink); background: var(--surface); transition: border-color 0.25s, transform 0.25s var(--ease); }
.related a:hover { border-color: var(--gold-line); transform: translateY(-2px); }
footer.site { margin-top: 36px; padding: 20px 0; color: var(--muted); font-size: 13px; text-align: center; border-top: 1px solid var(--line); }

.toast { position: fixed; left: 50%; bottom: 76px; transform: translate(-50%, 16px) scale(0.92); background: var(--toast-bg); color: var(--toast-ink); border: 1px solid var(--gold-line); padding: 10px 18px 10px 14px; border-radius: 24px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.45s var(--spring); z-index: 90; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 24px var(--glow-soft); display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px); }
.toast::before { content: var(--toast-icon); color: var(--spark-a); font-size: 15px; line-height: 1; }
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

.spark { position: fixed; left: 0; top: 0; width: 10px; height: 10px; margin: -5px 0 0 -5px; pointer-events: none; z-index: 100; will-change: transform, opacity; }
.spark.star { background: var(--spark-a); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.spark.petal { width: 9px; height: 13px; margin: -6px 0 0 -4px; background: var(--spark-a); border-radius: 80% 0 80% 0; }
.spark.dot { width: 7px; height: 7px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--spark-a); box-shadow: 0 0 8px var(--spark-a); }
.spark.alt { background: var(--spark-b); }
.spark.ring { width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 2px solid var(--spark-a); background: transparent; box-shadow: none; }
.tabs .n.bump { animation: bump 0.6s var(--spring); }
@keyframes bump { 40% { transform: scale(1.6); background: var(--gold-line); color: var(--on-primary); } }

.halo { position: absolute; left: 50%; top: -18px; width: min(400px, 96vw); height: min(400px, 96vw); margin-left: max(-200px, -48vw); z-index: -1; pointer-events: none; overflow: hidden; }
.halo > * { position: absolute; inset: 0; }
.halo svg { width: 100%; height: 100%; overflow: visible; }
body[data-page="category"] .halo { opacity: 0.6; }
.halo.paused *, .amb.paused * { animation-play-state: paused !important; }

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 0.35s ease both; }
::view-transition-new(root) { animation: vt-in 0.5s var(--ease) both; }
::view-transition-group(tabsel) { animation-duration: 0.45s; animation-timing-function: var(--ease); }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
.vt-theme::view-transition-old(root) { animation: none; }
.vt-theme::view-transition-new(root) { animation: theme-reveal 0.75s ease-in-out both; }
@keyframes theme-reveal { from { clip-path: circle(0 at var(--vx, 90%) var(--vy, 30px)); } to { clip-path: circle(150vmax at var(--vx, 90%) var(--vy, 30px)); } }
@supports not (view-transition-name: none) { body { animation: fade-in 0.5s ease both; } }

@media (min-width: 768px) {
  .brand b { font-size: 28px; letter-spacing: 0.22em; }
  body { padding-bottom: 0; }
  .ad--anchor { display: none; }
  .toast { bottom: 24px; }
  .opts { grid-template-columns: repeat(4, 1fr); }
  .opts .wide { grid-column: auto; }
  .related ul { grid-template-columns: repeat(4, 1fr); }
  .ad--under, .ad--mid { height: 90px; max-width: 728px; }
  .decks { justify-content: center; }
  .hand { justify-content: center; margin: 0; }
  .card { flex-basis: 260px; }
  h1 { font-size: 46px; }
}

@media (min-width: 1100px) {
  .stage[data-view="draw"], .stage[data-view="cast"] { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: start; }
  .stage[data-view="draw"] .pane-cast, .stage[data-view="cast"] .pane-draw { display: block; }
  .stage .pane-cast { position: sticky; top: 70px; }
  .hand { justify-content: flex-start; flex-wrap: nowrap; overflow: visible; gap: 12px; }
  .card { flex: 1 1 0; min-width: 0; max-width: 210px; height: 410px; }
  .front .nm { font-size: 23px; }
  .front .pr { font-size: 16px; }
  .decks { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-property: opacity, color, background-color, border-color !important; transition-duration: 0.2s !important; }
  .card-in { transition: none !important; }
  .halo, .amb { display: none !important; }
  ::view-transition-old(root) { animation: vt-out 0.2s ease both !important; }
  ::view-transition-new(root) { animation: fade-in 0.25s ease both !important; }
  ::view-transition-group(*) { animation-duration: 0s !important; }
}

:root[data-theme="grimoire"], [data-world="grimoire"] {
  --bg: #0a1030;
  --bg-2: #10173d;
  --surface: #161e4a;
  --ink: #f3ebdd;
  --muted: #b4b8d6;
  --gold: #e7c887;
  --gold-line: #b69451;
  --primary: #e2c285;
  --on-primary: #0a1030;
  --primary-grad: linear-gradient(135deg, #f1ce89, #d6b36d 55%, #b69451);
  --chip: rgba(231, 200, 135, 0.08);
  --bar: #0d1438;
  --line: rgba(182, 148, 81, 0.36);
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 18px 40px rgba(2, 4, 20, 0.55);
  --focus: #9cc2ff;
  --scrim: rgba(4, 6, 22, 0.74);
  --bg-art: radial-gradient(120% 70% at 50% -10%, #1d2a6e 0%, rgba(29, 42, 110, 0) 60%), radial-gradient(80% 50% at 85% 110%, rgba(240, 163, 94, 0.1), rgba(240, 163, 94, 0) 70%);
  --board-art: linear-gradient(180deg, #121a45, #0d1438);
  --card-art: linear-gradient(170deg, #fbf5e8, #f1e6cc);
  --card-ink: #1a1838;
  --card-muted: #4e4a66;
  --card-gold: #7a5a24;
  --card-line: #b69451;
  --card-line-2: rgba(182, 148, 81, 0.55);
  --card-btn: #1e2763;
  --card-btn-ink: #fbf5e8;
  --card-pressed: #ecdcb6;
  --back-art: radial-gradient(circle at 50% 45%, #1f2b74 0%, #141c52 45%, #0a1030 100%);
  --back-ink: #e7c887;
  --back-line: #b69451;
  --back-seal: radial-gradient(circle, #1a2366, #0e1540);
  --back-ring: rgba(182, 148, 81, 0.18);
  --back-cap: #0e1540;
  --back-pattern: radial-gradient(1.2px 1.2px at 18% 22%, #fff4e2 50%, transparent 52%), radial-gradient(1.6px 1.6px at 72% 16%, #f1ce89 50%, transparent 52%), radial-gradient(1.2px 1.2px at 84% 64%, #fff4e2 50%, transparent 52%), radial-gradient(1.4px 1.4px at 28% 80%, #f1ce89 50%, transparent 52%), radial-gradient(1.1px 1.1px at 62% 88%, #fff4e2 50%, transparent 52%), radial-gradient(1.1px 1.1px at 12% 52%, #fff4e2 50%, transparent 52%), radial-gradient(1.4px 1.4px at 90% 34%, #f1ce89 50%, transparent 52%), radial-gradient(1px 1px at 40% 10%, #fff4e2 50%, transparent 52%), repeating-radial-gradient(circle at 50% 45%, transparent 0 58px, rgba(182, 148, 81, 0.18) 58px 59px, transparent 59px 78px);
  --era-bg: #e3e6f6;
  --era-ink: #2a3170;
  --unsure-bg: #ece6d8;
  --unsure-ink: #4e4a66;
  --warn-bg: #fbe6c8;
  --warn-ink: #6b3a00;
  --over-bg: #f4dce2;
  --over-ink: #7e2f3c;
  --glow: rgba(240, 163, 94, 0.5);
  --glow-soft: rgba(226, 194, 133, 0.2);
  --foil: rgba(255, 236, 190, 0.5);
  --foil-front: rgba(214, 170, 90, 0.35);
  --foil-blend: normal;
  --foil-text: linear-gradient(100deg, #b69451 0%, #f1ce89 30%, #fff4e2 48%, #e2c285 62%, #b69451 100%);
  --toast-bg: #161e4a;
  --toast-ink: #f3ebdd;
  --toast-icon: "\2726";
  --spark-a: #f1ce89;
  --spark-b: #fff4e2;
  --amb-a: #fff4e2;
  --amb-b: #f1ce89;
  --display: "Cinzel", "Trajan Pro", "Times New Roman", Georgia, serif;
  --display-weight: 600;
  --display-track: 0.03em;
  --serif: "Cormorant Garamond", Garamond, "Palatino Linotype", Georgia, serif;
  --name-weight: 700;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cjk: "Noto Serif KR", "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Serif SC", "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  --ease: cubic-bezier(0.165, 0.84, 0.44, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --flip-dur: 0.7s;
  --flip-ease: cubic-bezier(0.3, 0.7, 0.2, 1);
}

:root[data-theme="grimoire"][data-mode="light"] {
  --bg: #f5efe3;
  --bg-2: #ece3d0;
  --surface: #fffdf8;
  --ink: #12183a;
  --muted: #4a4e6e;
  --gold: #7a5a24;
  --primary: #1e2763;
  --on-primary: #fff8ea;
  --primary-grad: linear-gradient(135deg, #2e3a85, #1e2763);
  --chip: rgba(30, 39, 99, 0.06);
  --bar: #f5efe3;
  --line: rgba(18, 24, 58, 0.16);
  --shadow: 0 2px 4px rgba(18, 24, 58, 0.1), 0 14px 30px rgba(18, 24, 58, 0.14);
  --focus: #1c4fd8;
  --scrim: rgba(18, 24, 58, 0.5);
  --bg-art: radial-gradient(120% 60% at 50% -10%, #e1e1f3 0%, rgba(225, 225, 243, 0) 60%), radial-gradient(80% 50% at 85% 110%, rgba(240, 163, 94, 0.12), rgba(240, 163, 94, 0) 70%);
  --board-art: linear-gradient(180deg, #ece3d0, #e6dcc6);
  --glow: rgba(240, 163, 94, 0.4);
  --glow-soft: rgba(30, 39, 99, 0.14);
  --foil-text: linear-gradient(100deg, #1e2763 0%, #3d4aa0 45%, #7a5a24 62%, #1e2763 100%);
  --toast-bg: #12183a;
  --toast-ink: #f5efe3;
  --spark-a: #b69451;
  --spark-b: #3d4aa0;
  --amb-a: #3d4aa0;
  --amb-b: #b69451;
}

:root[data-theme="grimoire"] .halo { color: var(--gold-line); }
:root[data-theme="grimoire"] .halo .ring { opacity: 0.4; animation: spin 220s linear infinite; }
:root[data-theme="grimoire"] .halo .star8 { opacity: 0.35; animation: spin 140s linear infinite reverse; }
:root[data-theme="grimoire"] .halo .glow { inset: 22%; border-radius: 50%; background: radial-gradient(closest-side, rgba(240, 163, 94, 0.22), rgba(240, 163, 94, 0)); animation: candle 5s ease-in-out infinite; }
:root[data-theme="grimoire"][data-mode="light"] .halo .ring { opacity: 0.32; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes candle { 0%, 100% { opacity: 0.7; transform: scale(1); } 40% { opacity: 1; transform: scale(1.06); } 60% { opacity: 0.85; transform: scale(0.98); } }
:root[data-theme="grimoire"] .amb .neb { position: absolute; border-radius: 50%; filter: none; }
:root[data-theme="grimoire"] .amb .n1 { width: 90vmax; height: 60vmax; left: -30vmax; top: 20vh; background: radial-gradient(closest-side, rgba(88, 70, 170, 0.18), rgba(88, 70, 170, 0)); animation: drift 70s ease-in-out infinite alternate; }
:root[data-theme="grimoire"] .amb .n2 { width: 70vmax; height: 50vmax; right: -25vmax; top: -10vh; background: radial-gradient(closest-side, rgba(40, 90, 170, 0.16), rgba(40, 90, 170, 0)); animation: drift 90s ease-in-out infinite alternate-reverse; }
:root[data-theme="grimoire"] .amb .shoot { position: absolute; top: 12vh; right: 8vw; width: 120px; height: 1.5px; background: linear-gradient(90deg, rgba(255, 244, 226, 0.9), rgba(255, 244, 226, 0)); transform-origin: left center; opacity: 0; animation: shoot 13s 3s ease-in infinite; }
:root[data-theme="grimoire"][data-mode="light"] .amb .shoot { background: linear-gradient(90deg, rgba(61, 74, 160, 0.6), rgba(61, 74, 160, 0)); }
@keyframes drift { to { transform: translate(12vmax, -6vmax) scale(1.1); } }
@keyframes shoot { 0% { transform: translate(0, 0) rotate(155deg); opacity: 0; } 2% { opacity: 1; } 7% { transform: translate(-260px, 120px) rotate(155deg); opacity: 0; } 100% { transform: translate(-260px, 120px) rotate(155deg); opacity: 0; } }
:root[data-theme="grimoire"] .back .seal::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; box-shadow: inset 7px -3px 0 0 rgba(231, 200, 135, 0.45); }
@media (min-width: 768px) { :root[data-theme="grimoire"] .brand b::after { content: " \2726"; font-size: 0.6em; vertical-align: 0.35em; } }

:root[data-theme="rose"], [data-world="rose"] {
  --bg: #1f0e1c;
  --bg-2: #2a1226;
  --surface: #351831;
  --ink: #f9ecef;
  --muted: #d2b9c6;
  --gold: #ebc1a6;
  --gold-line: #c99178;
  --primary: #e8b9a0;
  --on-primary: #2a0f1f;
  --primary-grad: linear-gradient(135deg, #f3d0bd, #e2ad94 50%, #c98e77);
  --chip: rgba(235, 193, 166, 0.08);
  --bar: #220f1f;
  --line: rgba(232, 185, 160, 0.3);
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 18px 40px rgba(15, 2, 12, 0.6);
  --focus: #9fd0ff;
  --scrim: rgba(18, 4, 14, 0.74);
  --bg-art: radial-gradient(70% 45% at 85% -5%, rgba(217, 220, 232, 0.13), rgba(217, 220, 232, 0) 60%), radial-gradient(110% 70% at 5% 0%, #3d1236 0%, rgba(61, 18, 54, 0) 60%), radial-gradient(100% 60% at 50% 115%, rgba(124, 19, 44, 0.5), rgba(124, 19, 44, 0) 70%);
  --board-art: linear-gradient(180deg, #2c1328, #24101f);
  --card-art: linear-gradient(170deg, #fdf6f2, #f4e2de);
  --card-ink: #2a1020;
  --card-muted: #634658;
  --card-gold: #8e4a3a;
  --card-line: #c99178;
  --card-line-2: rgba(201, 145, 120, 0.55);
  --card-btn: #7c132c;
  --card-btn-ink: #fff3f0;
  --card-pressed: #f3d9d2;
  --back-art: radial-gradient(circle at 50% 40%, #8a1a36 0%, #5e0f26 45%, #330a1d 100%);
  --back-ink: #f0cdb6;
  --back-line: #c99178;
  --back-seal: radial-gradient(circle, #5e0f26, #3a0b1f);
  --back-ring: rgba(217, 220, 232, 0.16);
  --back-cap: #3a0b1f;
  --back-pattern: radial-gradient(circle at 50% 40%, rgba(255, 220, 230, 0.1), rgba(255, 220, 230, 0) 55%), repeating-linear-gradient(45deg, rgba(240, 205, 182, 0.1) 0 1px, transparent 1px 15px), repeating-linear-gradient(-45deg, rgba(240, 205, 182, 0.1) 0 1px, transparent 1px 15px);
  --era-bg: #f3e3ea;
  --era-ink: #6e2a48;
  --unsure-bg: #efe6e6;
  --unsure-ink: #5e4a52;
  --warn-bg: #fbe6cf;
  --warn-ink: #6b3a00;
  --over-bg: #f7d9de;
  --over-ink: #7e1f35;
  --glow: rgba(232, 140, 165, 0.5);
  --glow-soft: rgba(232, 160, 170, 0.2);
  --foil: rgba(255, 226, 214, 0.5);
  --foil-front: rgba(214, 150, 130, 0.32);
  --foil-blend: normal;
  --foil-text: linear-gradient(100deg, #c98e77 0%, #f3d0bd 35%, #fff6f2 50%, #e8b9a0 65%, #c98e77 100%);
  --toast-bg: #351831;
  --toast-ink: #f9ecef;
  --toast-icon: "\2766";
  --spark-a: #e8a3b4;
  --spark-b: #f3d0bd;
  --amb-a: #e8a3b4;
  --amb-b: #d9dce8;
  --display: "Playfair Display", "Didot", "Bodoni 72", Georgia, serif;
  --display-weight: 600;
  --display-track: 0;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --script: "Pinyon Script", "Snell Roundhand", "Segoe Script", cursive;
  --name-weight: 700;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cjk: "Noto Serif KR", "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Serif SC", "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  --ease: cubic-bezier(0.22, 0.9, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --flip-dur: 0.95s;
  --flip-ease: cubic-bezier(0.3, 0.6, 0.25, 1.16);
}

:root[data-theme="rose"][data-mode="light"] {
  --bg: #fbf2f0;
  --bg-2: #f4e4e2;
  --surface: #ffffff;
  --ink: #2a1020;
  --muted: #66485a;
  --gold: #8e4a3a;
  --primary: #7c132c;
  --on-primary: #fff3f0;
  --primary-grad: linear-gradient(135deg, #9a2440, #7c132c);
  --chip: rgba(124, 19, 44, 0.06);
  --bar: #fbf2f0;
  --line: rgba(124, 19, 44, 0.16);
  --shadow: 0 2px 4px rgba(42, 16, 32, 0.08), 0 14px 30px rgba(42, 16, 32, 0.13);
  --focus: #1c4fd8;
  --scrim: rgba(42, 16, 32, 0.5);
  --bg-art: radial-gradient(70% 45% at 85% -5%, rgba(154, 160, 184, 0.2), rgba(154, 160, 184, 0) 60%), radial-gradient(110% 70% at 5% 0%, #f6dce2 0%, rgba(246, 220, 226, 0) 60%);
  --board-art: linear-gradient(180deg, #f4e4e2, #efdcda);
  --glow: rgba(217, 140, 154, 0.4);
  --glow-soft: rgba(124, 19, 44, 0.12);
  --foil-text: linear-gradient(100deg, #7c132c 0%, #b0485e 45%, #8e4a3a 62%, #7c132c 100%);
  --toast-bg: #2a1020;
  --toast-ink: #fbf2f0;
  --spark-a: #d98c9a;
  --spark-b: #c99178;
  --amb-a: #d98c9a;
  --amb-b: #9aa0b8;
}

:root[data-theme="rose"] .brand span { font-family: var(--script); text-transform: none; letter-spacing: 0; font-size: 21px; line-height: 1.2; margin-top: 0; }
:root[data-theme="rose"] h1 em { font-style: italic; font-weight: 500; }
:root[data-theme="rose"] .front .pr { font-weight: 500; }
:root[data-theme="rose"] .back .cap { font-family: var(--serif); font-style: italic; letter-spacing: 0.08em; text-transform: none; font-size: 15px; }
:root[data-theme="rose"] .halo { color: var(--gold-line); }
:root[data-theme="rose"] .halo .arch { opacity: 0.5; stroke-dasharray: 1700; stroke-dashoffset: 1700; animation: draw 3.2s 0.2s var(--ease) forwards; }
:root[data-theme="rose"] .halo .rosette { opacity: 0.45; transform-origin: 200px 92px; animation: spin 90s linear infinite; }
:root[data-theme="rose"] .halo .glow { inset: 18% 20% 30%; border-radius: 50%; background: radial-gradient(closest-side, rgba(232, 140, 165, 0.2), rgba(232, 140, 165, 0)); animation: breathe 6s ease-in-out infinite; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { opacity: 0.55; transform: scale(1.08); } }
:root[data-theme="rose"] .amb .moon { position: absolute; top: 12px; left: -18px; width: 64px; height: 64px; border-radius: 50%; background: radial-gradient(circle at 62% 36%, #f4f5fa, #c9ccda 60%, #9ea2b8); -webkit-mask: radial-gradient(circle at 26% 34%, transparent 36%, #000 37.5%); mask: radial-gradient(circle at 26% 34%, transparent 36%, #000 37.5%); opacity: 0.85; }
:root[data-theme="rose"] .amb .moonhalo { position: absolute; top: -58px; left: -88px; width: 204px; height: 204px; border-radius: 50%; background: radial-gradient(closest-side, rgba(217, 220, 232, 0.2), rgba(217, 220, 232, 0)); animation: breathe 7s ease-in-out infinite; }
:root[data-theme="rose"] .amb .velvet { position: absolute; inset: -20%; background: radial-gradient(60% 40% at 20% 80%, rgba(124, 19, 44, 0.22), rgba(124, 19, 44, 0) 70%); animation: sway 40s ease-in-out infinite alternate; }
:root[data-theme="rose"][data-mode="light"] .amb .moon { opacity: 0.6; }
:root[data-theme="rose"][data-mode="light"] .amb .velvet { opacity: 0.4; }
@keyframes sway { to { transform: translate(8%, -4%) rotate(4deg); } }
:root[data-theme="rose"] .back .seal::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; box-shadow: inset -7px 3px 0 0 rgba(217, 220, 232, 0.45); }
:root[data-theme="rose"] .back .seal::after { content: ""; position: absolute; inset: -16px; border-radius: 50%; border: 1px dotted rgba(240, 205, 182, 0.5); }
@media (min-width: 768px) { :root[data-theme="rose"] .amb .moon { top: 18px; left: -14px; width: 92px; height: 92px; }:root[data-theme="rose"] .amb .moonhalo { top: -54px; left: -84px; width: 236px; height: 236px; } }

:root[data-theme="jade"], [data-world="jade"] {
  --bg: #07191b;
  --bg-2: #0b2326;
  --surface: #0f2e2f;
  --ink: #eef3ea;
  --muted: #a8c3bc;
  --gold: #e3c98a;
  --gold-line: #b89a55;
  --jade: #6cc3a5;
  --primary: #e3c98a;
  --on-primary: #07191b;
  --primary-grad: linear-gradient(135deg, #f0dca6, #dcc07e 50%, #c7a55e);
  --chip: rgba(108, 195, 165, 0.08);
  --bar: #091d1f;
  --line: rgba(108, 195, 165, 0.26);
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 18px 40px rgba(0, 8, 8, 0.55);
  --focus: #9fd8ff;
  --scrim: rgba(2, 12, 12, 0.74);
  --bg-art: radial-gradient(120% 60% at 50% -10%, #154c49 0%, rgba(21, 76, 73, 0) 60%), linear-gradient(180deg, #07191b, #061416);
  --board-art: linear-gradient(180deg, #0d2a2b, #0a2224);
  --card-art: linear-gradient(170deg, #f8f5ec, #ebe8da);
  --card-ink: #13231f;
  --card-muted: #475c55;
  --card-gold: #1d6655;
  --card-line: #b89a55;
  --card-line-2: rgba(29, 102, 85, 0.35);
  --card-btn: #164c44;
  --card-btn-ink: #f8f5ec;
  --card-pressed: #dcebdf;
  --back-art: radial-gradient(circle at 50% 38%, #1a5a52 0%, #0f3b36 45%, #07191b 100%);
  --back-ink: #e3c98a;
  --back-line: #b89a55;
  --back-seal: radial-gradient(circle, #124740, #0b2b28);
  --back-ring: rgba(108, 195, 165, 0.16);
  --back-cap: #0b2b28;
  --back-pattern: radial-gradient(circle at 50% 100%, transparent 9px, rgba(227, 201, 138, 0.14) 9.5px 10.5px, transparent 11px 14px, rgba(227, 201, 138, 0.1) 14.5px 15.5px, transparent 16px) 0 0 / 32px 16px, radial-gradient(circle at 50% 100%, transparent 9px, rgba(227, 201, 138, 0.14) 9.5px 10.5px, transparent 11px 14px, rgba(227, 201, 138, 0.1) 14.5px 15.5px, transparent 16px) 16px 8px / 32px 16px;
  --cinnabar: #b5412f;
  --era-bg: #dcede5;
  --era-ink: #1b5545;
  --unsure-bg: #ece8dc;
  --unsure-ink: #4f5a52;
  --warn-bg: #fbe6cf;
  --warn-ink: #6b3a00;
  --over-bg: #f6dad5;
  --over-ink: #7e2f2a;
  --glow: rgba(108, 195, 165, 0.48);
  --glow-soft: rgba(108, 195, 165, 0.18);
  --foil: rgba(230, 255, 240, 0.45);
  --foil-front: rgba(108, 195, 165, 0.28);
  --foil-blend: normal;
  --foil-text: linear-gradient(100deg, #b89a55 0%, #f0dca6 35%, #fffbe8 50%, #9fdcc4 66%, #b89a55 100%);
  --toast-bg: #0f2e2f;
  --toast-ink: #eef3ea;
  --toast-icon: "\2756";
  --spark-a: #7fd1b4;
  --spark-b: #e3c98a;
  --amb-a: #9be3c8;
  --amb-b: #e3c98a;
  --display: "Marcellus", "Trajan Pro", Georgia, serif;
  --display-weight: 400;
  --display-track: 0.03em;
  --serif: "Marcellus", Georgia, "Times New Roman", serif;
  --name-weight: 400;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cjk: "Noto Serif SC", "Noto Serif KR", "Songti SC", "SimSun", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans SC", "Microsoft YaHei", serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.3, 1.35, 0.5, 1);
  --flip-dur: 0.85s;
  --flip-ease: cubic-bezier(0.25, 0.8, 0.25, 1);
}

:root[data-theme="jade"][data-mode="light"] {
  --bg: #f1efe6;
  --bg-2: #e6e7dc;
  --surface: #fffffb;
  --ink: #10221f;
  --muted: #4a5d57;
  --gold: #6b5420;
  --jade: #1f6b5a;
  --primary: #165247;
  --on-primary: #f6f2e7;
  --primary-grad: linear-gradient(135deg, #1f6b5a, #165247);
  --chip: rgba(22, 82, 71, 0.06);
  --bar: #f1efe6;
  --line: rgba(16, 34, 31, 0.16);
  --shadow: 0 2px 4px rgba(16, 34, 31, 0.08), 0 14px 30px rgba(16, 34, 31, 0.13);
  --focus: #1c4fd8;
  --scrim: rgba(16, 34, 31, 0.5);
  --bg-art: radial-gradient(120% 60% at 50% -10%, #d9e9e0 0%, rgba(217, 233, 224, 0) 60%);
  --board-art: linear-gradient(180deg, #e6e7dc, #dfe1d4);
  --glow: rgba(31, 107, 90, 0.3);
  --glow-soft: rgba(22, 82, 71, 0.12);
  --foil-text: linear-gradient(100deg, #165247 0%, #2f8a73 45%, #6b5420 62%, #165247 100%);
  --toast-bg: #10221f;
  --toast-ink: #f1efe6;
  --spark-a: #2f8a73;
  --spark-b: #b89a55;
  --amb-a: #3e8f77;
  --amb-b: #b89a55;
}

:root[data-theme="jade"] .brand span { letter-spacing: 0.32em; }
:root[data-theme="jade"] .front .pr { font-family: var(--sans); font-style: normal; font-size: 16px; letter-spacing: 0.02em; }
:root[data-theme="jade"] .front .sc, :root[data-theme="jade"] .slot .sc { font-weight: 600; }
:root[data-theme="jade"] .halo { color: var(--gold-line); border-radius: 50%; }
:root[data-theme="jade"] .halo .sun { inset: 26% 26% 34%; border-radius: 50%; background: radial-gradient(circle, rgba(240, 220, 166, 0.3), rgba(240, 220, 166, 0.08) 60%, rgba(240, 220, 166, 0) 70%); animation: qi 6s ease-in-out infinite; }
:root[data-theme="jade"] .halo .rings { opacity: 0.4; transform-origin: 50% 46%; animation: spin 180s linear infinite; }
:root[data-theme="jade"] .halo .peaks .p1 { fill: rgba(108, 195, 165, 0.1); }
:root[data-theme="jade"] .halo .peaks .p2 { fill: rgba(108, 195, 165, 0.17); }
:root[data-theme="jade"][data-mode="light"] .halo .peaks .p1 { fill: rgba(31, 107, 90, 0.12); }
:root[data-theme="jade"][data-mode="light"] .halo .peaks .p2 { fill: rgba(31, 107, 90, 0.2); }
:root[data-theme="jade"] .halo .peaks { opacity: 0.55; }
:root[data-theme="jade"] .halo .cloud { opacity: 0.5; animation: float 14s ease-in-out infinite alternate; }
@keyframes qi { 50% { transform: scale(1.06); opacity: 0.75; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { to { transform: translateX(26px); } }
:root[data-theme="jade"] .amb .mist { position: absolute; left: -50%; width: 200%; height: 34vh; border-radius: 50%; background: radial-gradient(closest-side, rgba(170, 225, 205, 0.09), rgba(170, 225, 205, 0)); }
:root[data-theme="jade"] .amb .m1 { top: 18vh; animation: mist 60s linear infinite alternate; }
:root[data-theme="jade"] .amb .m2 { top: 52vh; animation: mist 80s linear infinite alternate-reverse; }
:root[data-theme="jade"] .amb .m3 { top: 78vh; height: 26vh; animation: mist 50s linear infinite alternate; }
:root[data-theme="jade"][data-mode="light"] .amb .mist { background: radial-gradient(closest-side, rgba(31, 107, 90, 0.07), rgba(31, 107, 90, 0)); }
@keyframes mist { from { transform: translateX(-12%); } to { transform: translateX(12%); } }
:root[data-theme="jade"] .back .seal::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; border: 1px solid rgba(227, 201, 138, 0.35); }
:root[data-theme="jade"] .back .seal::after { content: "\540D"; position: absolute; right: -40px; top: -16px; z-index: 2; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: var(--cinnabar); color: #fbefe6; font-family: var(--cjk); font-size: 17px; font-weight: 600; border-radius: 3px; transform: rotate(-8deg); box-shadow: 0 0 0 2px rgba(181, 65, 47, 0.35); }

.halo[data-for], .amb[data-for] { display: none; }
:root[data-theme="grimoire"] [data-for="grimoire"], :root[data-theme="rose"] [data-for="rose"], :root[data-theme="jade"] [data-for="jade"] { display: block; }
.world { position: absolute; left: 12px; top: 4px; min-height: 44px; min-width: 44px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--chip); border: 1px solid var(--line); border-radius: 22px; font-size: 13px; font-weight: 600; transition: border-color 0.3s; }
.world:hover { border-color: var(--gold-line); }
.world i { width: 18px; height: 18px; flex: none; border-radius: 50%; background: conic-gradient(#e2c285 0 33.3%, #e8a3b4 0 66.6%, #6cc3a5 0); box-shadow: 0 0 0 2px var(--bar), 0 0 0 3px var(--gold-line); }
.world span { display: none; }
.pick-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; color: var(--gold); font-weight: 600; }

dialog.picker { width: min(1000px, calc(100vw - 20px)); max-width: none; max-height: calc(100vh - 20px); padding: 0; border: 1px solid rgba(231, 214, 180, 0.22); border-radius: 22px; background: radial-gradient(120% 70% at 50% -10%, #23224a 0%, #100f1c 55%, #0b0a12 100%); color: #f4efe6; box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6); overflow: auto; overscroll-behavior: contain; }
dialog.picker::backdrop { background: rgba(6, 6, 12, 0.8); }
.wp-in { padding: 22px 14px 14px; text-align: center; }
.wp-k { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.32em; text-transform: uppercase; color: #d9c9a3; }
.picker h2 { margin: 6px 0 4px; font-family: var(--display); font-weight: var(--display-weight); font-size: 30px; line-height: 1.1; color: #f4efe6; letter-spacing: var(--display-track); }
.wp-l { margin: 0 auto 16px; max-width: 460px; font-size: 14px; color: #c9c3d6; }
.wp-grid { display: grid; gap: 12px; }
.wp-card { position: relative; display: grid; grid-template-columns: 104px 1fr; text-align: left; min-height: 136px; padding: 0; overflow: hidden; border-radius: 16px; border: 1px solid var(--line); background: var(--bg-art), var(--bg); color: var(--ink); isolation: isolate; animation: fan-in 0.75s var(--ease) backwards; animation-delay: calc(var(--i) * 120ms + 160ms); transition: transform 0.35s var(--ease), border-color 0.3s, box-shadow 0.35s; }
.wp-card:nth-child(1) { --r: -8deg; }
.wp-card:nth-child(3) { --r: 8deg; }
@keyframes fan-in { from { opacity: 0; transform: translateY(48px) rotate(var(--r, 0deg)) scale(0.9); } }
.wp-card:hover, .wp-card:focus-visible { transform: translateY(-4px); border-color: var(--gold-line); box-shadow: 0 0 0 1px var(--gold-line), 0 18px 44px var(--glow-soft); }
.wp-card:focus-visible { outline: 3px solid #9cc2ff; outline-offset: 3px; }
.wp-card[aria-pressed="true"] { border-color: var(--gold-line); box-shadow: 0 0 0 2px var(--gold-line); }
.wp-scene { position: relative; display: block; overflow: hidden; color: var(--gold-line); }
.wp-orn { position: absolute; left: 50%; top: 50%; width: 150px; height: 150px; margin: -75px 0 0 -75px; opacity: 0.5; transition: transform 0.8s var(--ease); }
.wp-card:hover .wp-orn, .wp-card:focus-visible .wp-orn { transform: rotate(20deg) scale(1.08); }
.wp-tarot { position: absolute; left: 50%; top: 50%; width: 52px; height: 74px; margin: -37px 0 0 -26px; border-radius: 6px; border: 1px solid var(--back-line); background: var(--back-art); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45); display: flex; align-items: center; justify-content: center; transform: rotate(7deg) translateX(8px); transition: transform 0.5s var(--ease); }
.wp-tarot::before { content: ""; position: absolute; inset: 4px; border: 1px solid var(--back-line); border-radius: 4px; background: var(--back-pattern); }
.wp-tarot b { position: relative; color: var(--back-ink); font-size: 18px; }
.wp-tarot.f { background: var(--card-art); border-color: var(--card-line); transform: rotate(-9deg) translateX(-12px); }
.wp-tarot.f::before { background: none; border-color: var(--card-line-2); }
.wp-card:hover .wp-tarot, .wp-card:focus-visible .wp-tarot { transform: rotate(14deg) translateX(18px) translateY(-4px); }
.wp-card:hover .wp-tarot.f, .wp-card:focus-visible .wp-tarot.f { transform: rotate(-16deg) translateX(-20px) translateY(-2px); }
.wp-txt { display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 12px 14px 12px 4px; }
.wp-name { font-family: var(--display); font-weight: var(--display-weight); font-size: 20px; line-height: 1.15; letter-spacing: var(--display-track); background: var(--foil-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wp-sample { font-family: var(--serif); font-weight: var(--name-weight); font-size: 16px; line-height: 1.2; color: var(--ink); }
.wp-cjk { font-family: var(--cjk); font-weight: 600; white-space: nowrap; }
.wp-mood { font-size: 13px; line-height: 1.35; color: var(--muted); }
.wp-cur { display: none; position: absolute; right: 10px; top: 10px; padding: 2px 9px; border-radius: 10px; background: var(--primary-grad); color: var(--on-primary); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; }
.wp-card[aria-pressed="true"] .wp-cur { display: block; }
.wp-skip { margin-top: 12px; min-height: 44px; padding: 0 16px; border: 0; background: transparent; color: #d9c9a3; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.wp-skip:focus-visible { outline: 3px solid #9cc2ff; }

@media (min-width: 720px) {
  .wp-in { padding: 30px 26px 20px; }
  .picker h2 { font-size: 40px; }
  .wp-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .wp-card { grid-template-columns: 1fr; grid-template-rows: 200px auto; min-height: 340px; }
  .wp-orn { width: 210px; height: 210px; margin: -105px 0 0 -105px; }
  .wp-tarot { width: 78px; height: 112px; margin: -56px 0 0 -39px; }
  .wp-tarot b { font-size: 24px; }
  .wp-txt { justify-content: flex-start; padding: 4px 18px 20px; text-align: center; }
  .wp-name { font-size: 23px; }
}
@media (min-width: 768px) { .world span { display: inline; } }
:root[data-theme="rose"] .amb .moon { display: none; }
@media (min-width: 1240px) { :root[data-theme="rose"] .amb .moon { display: block; left: -40px; } }
