
:root{font-family:Georgia,'Yu Mincho','Hiragino Mincho ProN',serif;color:#e8ddc5;background:#141a19;font-size:14px}*{box-sizing:border-box}body{margin:0}button,select,input,textarea{font:inherit}button,select{cursor:pointer}button{background:#25352f;color:#ebdfc7;border:1px solid #6b6550;border-radius:5px;padding:9px 12px}button:hover{background:#36483e}button:disabled{opacity:.4;cursor:default}.primary{background:#76623a;border-color:#bc9f66;color:#fff6df}select,input,textarea{background:#202b27;color:#eee1c9;border:1px solid #615f50;border-radius:4px;padding:8px;max-width:100%}input[type=checkbox]{accent-color:#c3a46a}.shell{display:grid;grid-template-columns:300px minmax(0,1fr);min-height:100vh}aside{background:#1d2724;border-right:1px solid #535343;padding:20px;max-height:100vh;overflow-y:auto}h1{font-size:23px;letter-spacing:.18em;font-weight:normal;margin:0}header small,.subtle{color:#a9a28e}.version{font:11px sans-serif;letter-spacing:.15em;color:#baa67f}.section{border-top:1px solid #46483d;margin-top:18px;padding-top:14px}h2{font-size:13px;font-weight:normal;color:#d8c496;letter-spacing:.12em;margin:0 0 12px}.stack{display:grid;gap:8px}.row{display:flex;gap:7px;align-items:center;flex-wrap:wrap}.row>*{min-width:0}.row button{flex:1}.field{display:grid;gap:5px;color:#c8c1ae}.field select{width:100%}.choice{display:flex;gap:7px;align-items:center;font:12px sans-serif;color:#d7cebb}.mini{font:11px/1.5 sans-serif;color:#b8b19e}.swatches{display:grid;grid-template-columns:repeat(6,1fr);gap:7px}.swatch{padding:0;width:33px;height:28px;border:2px solid #777;box-shadow:inset 0 0 0 1px #222}.swatch.active{outline:2px solid #d7c28b;outline-offset:2px}.main{display:flex;flex-direction:column;min-width:0}.toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:12px 16px;background:#1b2421;border-bottom:1px solid #454b3e}.toolbar .status{flex:1;font:12px sans-serif;color:#c8bfa8}.toolbar button{padding:7px 10px}.stage-shell{flex:1;min-height:70vh;position:relative;overflow:hidden;background:#2b211b}.stage{position:absolute;inset:0;overflow:hidden;touch-action:none;background:radial-gradient(ellipse at center,#59483a 0,#271f19 100%)}.cloth{position:absolute;left:5%;top:13%;width:90%;height:80%;border:8px solid rgba(0,0,0,.17);box-shadow:0 15px 34px #0009,inset 0 0 65px #0004;border-radius:3px;background-color:var(--cloth,#171719);background-image:repeating-linear-gradient(90deg,#fff1 0px,transparent 1px,transparent 4px),repeating-linear-gradient(0deg,#0001 0px,transparent 1px,transparent 4px)}.cloth:after{content:'';position:absolute;inset:12px;border:1px solid #ffffff30;pointer-events:none}.altar{position:absolute;inset:0;pointer-events:none}.candle{position:absolute;top:2%;width:24px;height:70px;background:linear-gradient(90deg,#a99c80,#eee0bd 40%,#8a795a);box-shadow:0 6px 15px #0008;border-radius:3px}.candle:before{content:'';position:absolute;width:12px;height:22px;left:6px;top:-24px;background:#f4b54a;border-radius:70% 20% 65% 45%;transform:rotate(8deg);box-shadow:0 0 18px 8px #edab4770;animation:flicker 1.9s ease-in-out infinite alternate}.candle:after{content:'';position:absolute;bottom:-4px;left:-17px;width:58px;height:9px;background:linear-gradient(#ae8650,#59462f);border-radius:50%}.candle.left{left:16%}.candle.right{right:16%}@keyframes flicker{from{transform:scale(.9) rotate(-7deg);opacity:.8}to{transform:scale(1.12) rotate(12deg);opacity:1}}.table-zone{position:absolute;left:50%;transform:translateX(-50%);top:17%;width:88%;max-width:790px;height:74%;border-radius:4px}.slot{position:absolute;width:var(--cw);height:var(--ch);border:1px dashed #f5e4be89;background:#ffffff10;transform:translate(-50%,-50%) rotate(var(--angle));border-radius:4px;display:flex;justify-content:center;align-items:center;color:#f8e9c7;cursor:pointer}.slot .slot-num{font:14px sans-serif;background:#1d241f9e;border-radius:50%;padding:3px 7px}.card{position:absolute;width:var(--cw);height:var(--ch);transform:translate(-50%,-50%) rotate(var(--rotation));border-radius:4px;cursor:grab;user-select:none;touch-action:none;filter:drop-shadow(2px 5px 3px #000a);transition:left .48s cubic-bezier(.2,.7,.2,1),top .48s cubic-bezier(.2,.7,.2,1),transform .5s ease;z-index:var(--z,2)}.card.dragging{transition:none;cursor:grabbing}.card-inner{width:100%;height:100%;position:relative;transform-style:preserve-3d;transition:transform .56s}.card.faceup .card-inner{transform:rotateY(180deg)}.face{position:absolute;inset:0;backface-visibility:hidden;border-radius:4px;border:2px solid #e1cfaa;overflow:hidden}.back{background:repeating-linear-gradient(45deg,#274740 0,#274740 4px,#19342f 4px,#19342f 8px);display:grid;place-items:center}.back:before{content:'✧';position:absolute;inset:5px;border:1px solid #c0a476;display:grid;place-items:center;font-size:28px;color:#c2a574}.front{transform:rotateY(180deg);background:#eee1c3;color:#342a23;border:3px double #756444;padding:5px;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;gap:4px}.front .symbol{font-size:25px}.front .card-name{font-size:clamp(8px,1.1vw,13px);font-weight:bold;line-height:1.3}.front .card-id{font:9px sans-serif;color:#67523d}.front:before{content:'';position:absolute;inset:4px;border:1px solid #897252;pointer-events:none}.zone-label{position:absolute;transform:translateX(-50%);font:11px sans-serif;white-space:nowrap;color:#fff5d6;background:#17241fc9;padding:3px 6px;border-radius:3px;pointer-events:none;z-index:300}.deck{position:absolute;left:3%;top:82%;width:var(--cw);height:var(--ch);border-radius:4px;background:repeating-linear-gradient(45deg,#274740 0,#274740 4px,#19342f 4px,#19342f 8px);border:2px solid #d6b980;box-shadow:4px 4px 0 #b1aa98,7px 7px 0 #5e615b,8px 10px 8px #0008;display:grid;place-items:center;cursor:grab;z-index:4;color:#cdb78a}.deck:after{content:'✧';font-size:25px}.deck.empty{opacity:.3;cursor:default}.deck-label{position:absolute;left:2%;top:97%;font:11px sans-serif;color:#eeddb7}.info{min-height:52px;background:#1b2421;border-top:1px solid #4c4e40;padding:12px 18px;font:13px/1.7 sans-serif;color:#ddd2bd}.log{font:11px sans-serif;color:#a7a391}.modal-bg{position:fixed;inset:0;background:#000b;display:none;align-items:center;justify-content:center;z-index:999;padding:16px}.modal-bg.open{display:flex}.modal{width:min(600px,100%);max-height:85vh;overflow:auto;padding:24px;background:#24312b;border:1px solid #a88c60;border-radius:8px;box-shadow:0 20px 60px #0009}.modal h2{font-size:19px}.modal p{line-height:1.7}.close{float:right}.cut-piles{display:flex;gap:12px;justify-content:center;margin:20px 0}.cut-piles button{min-width:100px;min-height:80px;font-size:15px}.note{font:12px sans-serif;color:#cfc3a9}.legend{font:12px sans-serif}.spacer{flex:1}.hidden{display:none!important}@media(max-width:780px){.shell{grid-template-columns:1fr}aside{max-height:none;padding:12px;display:grid;grid-template-columns:1fr 1fr;gap:10px}aside header{grid-column:1/-1}aside .section{margin-top:0;padding-top:8px}h1{font-size:19px}.stage-shell{min-height:62vh}.toolbar{padding:8px}.toolbar .status{flex-basis:100%}.zone-label{font-size:9px}.front .symbol{font-size:15px}.front .card-name{font-size:9px}.front .card-id{display:none}.candle{transform:scale(.7);transform-origin:top}}@media(max-width:460px){aside{grid-template-columns:1fr}.stage-shell{min-height:58vh}.card{border-radius:2px}.front{padding:2px}.front .symbol{font-size:13px}}

.stage-shell{min-height:800px;}
.stage{display:flex;align-items:center;justify-content:center;padding:20px;}
.table-surface{position:relative;flex:none;aspect-ratio:1/1;width:min(100%,740px);max-height:100%;}
.cloth{inset:0;width:100%;height:100%;left:0;top:0;border-width:7px;}
.altar{inset:0;}
.candle{top:4%;}
.candle.left{left:14%;}
.candle.right{right:14%;}

.table-zone{left:7%;top:11%;width:86%;height:78%;max-width:none;transform:none;}
.deck{left:3.5%;top:83%;}
.deck-label{left:3%;top:96%;}
@media(max-width:780px){.stage-shell{min-height: min(96vw,740px)}.stage{padding:10px}.table-surface{width:min(100%,740px)} }
@media(max-width:460px){.stage-shell{min-height:98vw}.stage{padding:5px}.cloth{border-width:4px}.cloth:after{inset:7px}.candle{top:5%;}}

:root{background:#201d1a;color:#e9deca;--brass:#b69a65;--panel:#282620;--wood:#30261f}
aside{background:#242823;border-right-color:#655743}h2{color:#dac398}.toolbar,.info{background:#242823;border-color:#625642}
button{background:#373a32;border-color:#827357;color:#f3e5cb;line-height:1.3;white-space:nowrap;word-break:keep-all;font-size:12px;padding:10px 7px;min-width:0}
button:hover{background:#4b4b3d}.primary{background:#78623d;border-color:#c5a46d;color:#fff9e8}
select,input,textarea{background:#302f29;border-color:#71644c;color:#f3e8d3}
.row.operation-buttons{display:grid;grid-template-columns:1fr 1fr;gap:8px}.row.operation-buttons button{width:100%;font-size:11.5px;letter-spacing:-.035em;white-space:nowrap;padding-inline:3px}
.stage-shell{background:#221c18}.stage{background:radial-gradient(ellipse at center,#604e3d 0,#30261f 74%,#1c1714 100%)}
.back,.deck{background:repeating-linear-gradient(45deg,#583d42 0,#583d42 5px,#352a36 5px,#352a36 10px)}.back:before{color:#c9ad79;border-color:#c9ad79}
.modal{background:#292b25;border-color:#c0a275}.shuffle-layer{position:absolute;inset:0;z-index:5000;pointer-events:none;display:none;overflow:hidden;border-radius:6px}.shuffle-layer.active{display:block;background:#1a221abd}.shuffle-card{position:absolute;width:clamp(17px,7%,52px);aspect-ratio:2/3;border:2px solid #d7c19b;border-radius:4px;background:repeating-linear-gradient(45deg,#553944 0 4px,#322b38 4px 8px);box-shadow:2px 4px 8px #0007;will-change:transform}.shuffle-card:after{content:'✧';position:absolute;inset:5px;border:1px solid #c6ab77;display:grid;place-items:center;color:#dbbd85}
.cut-lengths{display:grid;grid-template-columns:repeat(auto-fit,minmax(68px,1fr));gap:8px;margin-top:8px}.cut-lengths label{display:grid;gap:3px;font:12px sans-serif}.cut-lengths input{width:100%}.cut-piles{display:flex;flex-wrap:wrap;gap:9px;justify-content:center}.cut-piles button.cut-stack{min-width:72px;min-height:94px;display:flex;flex-direction:column;gap:12px;justify-content:center;background:repeating-linear-gradient(45deg,#47353e 0 5px,#2d2934 5px 10px);border:3px double #d1b17a}.cut-piles button.cut-stack small{font-size:11px;color:#e6d9bc}.cut-piles button.cut-stack.picked{border-color:#ebd090;background:#716144}
@media(max-width:460px){.row.operation-buttons button{font-size:11px}}

.mobile-start{display:none}
@media(max-width:780px){
  .shell{display:flex;flex-direction:column;min-height:100dvh;padding:0}
  aside,.main{display:contents}
  aside header{order:0;display:block;padding:16px 14px 12px;background:#1d2724;border-bottom:1px solid #5d5440}
  aside .section{display:grid;order:5;margin:0;padding:16px 14px;gap:10px;background:#1d2724;border-top:1px solid #46483d;grid-template-columns:minmax(0,1fr)}
  aside .section:nth-of-type(1){order:5}
  aside .section:nth-of-type(2){order:6}
  aside .section:nth-of-type(3){order:7}
  aside .section:nth-of-type(4){order:8}
  .toolbar{order:1;display:flex;flex-wrap:wrap;padding:10px 12px;gap:7px;background:#1b2421}
  .toolbar .status{flex:1 0 100%;font-size:12px}
  .toolbar button{padding:8px 10px}
  .mobile-start{display:block!important;flex:1 0 100%;min-height:44px;font-size:14px}
  #newSession{display:none}
  .stage-shell{order:2;display:block;width:100%;height:min(100vw,650px);min-height:0;flex:none}
  .stage{padding:5px}
  .info{order:3;min-height:48px;padding:10px 13px;font-size:12px}
  #operations{position:static!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:16px 14px;max-height:none;overflow:visible;box-shadow:none;z-index:auto}
  #operations h2,#operations .field,#operations>p.mini{grid-column:1/-1}
  #operations .row{display:contents}
  #operations button{min-height:44px;white-space:nowrap;font-size:13px;padding:9px 5px}
  #operations .field select{width:100%;min-height:44px}
  .front .card-name{font-size:9px}
}
@media(max-width:460px){
 .stage-shell{height:100vw}
 .cloth{border-width:4px}.cloth:after{inset:7px}
 .candle{top:5%}
 #operations button{font-size:12px}
}
/* Mobile Safari: do not let relayout/focus anchor the page to the bottom. */
@media(max-width:780px){html,body,.shell,aside,.main,.stage-shell{overflow-anchor:none}button{touch-action:manipulation}#operations{order:6}aside .section:nth-of-type(1){order:5}aside .section:nth-of-type(2){order:6}aside .section:nth-of-type(3){order:7}aside .section:nth-of-type(4){order:8}}
@media (prefers-reduced-motion:reduce){.card,.card-inner{transition-duration:.01ms!important}}

.back{display:flex!important;align-items:center!important;justify-content:center!important}
.back:before{content:""!important;position:absolute!important;inset:7px!important;border:1px solid #c9ad79!important;display:block!important}
.back:after{content:"✦";position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:clamp(17px,3vw,29px);line-height:1;color:#d8bb83;pointer-events:none}
.front .card-name{font-family:Georgia,"Yu Mincho","Hiragino Mincho ProN",serif;font-weight:700;font-size:clamp(12px,1.7vw,19px);line-height:1.25;word-break:keep-all;overflow-wrap:anywhere;letter-spacing:-.045em}
.front .symbol,.front .card-id{display:none!important}
.recipe-step{display:grid;grid-template-columns:18px minmax(95px,2fr) minmax(55px,1fr) minmax(55px,1fr) 28px;gap:6px;align-items:center;margin:9px 0;padding:8px;border:1px solid #665841;border-radius:6px}
.recipe-step label{font-size:11px}.recipe-step input,.recipe-step select{width:100%;min-width:0;padding:7px 3px}.recipe-step button.recipe-remove{width:28px;min-width:28px;max-width:28px;height:32px;padding:0;justify-self:center;align-self:center;flex:none;box-sizing:border-box}
@media(max-width:780px){.front .card-name{font-size:clamp(10px,2.6vw,15px)}.recipe-step{grid-template-columns:14px minmax(75px,2fr) minmax(50px,1fr) minmax(50px,1fr) 24px;gap:3px}.recipe-step label{font-size:10px}.recipe-step button.recipe-remove{width:24px;min-width:24px;max-width:24px;height:30px}}

aside .section > h2 {margin:0}
aside .section > h2 .section-toggle{font-family:inherit;font-size:inherit;line-height:1.4;letter-spacing:inherit;text-align:left;color:#dac398;display:flex;align-items:center;justify-content:space-between;width:100%;min-height:44px;padding:5px 2px;border:0;background:transparent;white-space:normal;cursor:pointer}
aside .section > h2 .section-toggle:hover{background:transparent;color:#ffe4ab}
aside .section > h2 .section-toggle .section-heading{display:flex;flex-direction:column;align-items:flex-start;min-width:0;gap:3px}
aside .section > h2 .section-toggle .section-title{display:block}
aside .section > h2 .section-toggle .section-hint{display:block;font:11px/1.45 sans-serif;letter-spacing:normal;color:#a9a28e;white-space:normal}
aside .section > h2 .section-toggle:hover .section-hint{color:#c9beaa}

.fold-indicator{font-size:19px;color:#bda577;margin-left:12px;transition:transform .15s ease}
aside .section.is-collapsed > :not(h2){display:none!important}
/* Higher specificity than the mobile #operations .row display override. */
#operations.is-collapsed > :not(h2){display:none!important}
aside .section.is-collapsed .fold-indicator{transform:rotate(-90deg)}
@media(max-width:780px){aside .section.is-collapsed{display:grid!important;grid-template-columns:1fr!important;padding-block:10px!important}aside .section.is-collapsed h2{grid-column:1/-1}}

.table-shortcuts{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;padding:10px 9px;background:#1b2421;border-top:1px solid #5b5240;border-bottom:1px solid #4c4e40}
.table-shortcuts button{display:flex;align-items:center;justify-content:center;gap:7px;min-width:0;min-height:49px;padding:8px 4px;white-space:nowrap;font:13px/1.2 Georgia,'Yu Mincho',serif;background:#2f3a32;border-color:#857352;color:#f0dfbf}
.table-shortcuts button:active{background:#655437}
.table-shortcuts button:disabled{opacity:.42}
.quick-symbol{font:20px/1 sans-serif;color:#ceb277}
@media(max-width:780px){.table-shortcuts{order:3;position:static;z-index:auto;padding:9px 9px;gap:5px}.table-shortcuts button{flex-direction:column;min-height:61px;font-size:11px;gap:5px}.quick-symbol{font-size:21px}.info{order:4}}
@media(max-width:360px){.table-shortcuts button{font-size:10px}}

.front{gap:0!important;padding:3px!important;justify-content:space-evenly!important}
.suit-icon{width:76%;height:63%;display:flex;align-items:center;justify-content:center;flex:none;min-height:0}
.suit-icon svg{width:100%;height:100%;max-width:60px;display:block}
.rank-value{font-family:Georgia,serif;font-weight:700;font-size:clamp(18px,2.5vw,31px);line-height:1;color:#35271f}
.major-rank{font:700 clamp(17px,2.5vw,27px)/1 Georgia,serif;color:#56432b}
.major-name{font:700 clamp(10px,1.35vw,16px)/1.15 Georgia,'Yu Mincho',serif;word-break:keep-all;overflow-wrap:anywhere}
@media(max-width:780px){.rank-value{font-size:clamp(13px,4vw,24px)}.major-rank{font-size:clamp(12px,3.5vw,22px)}.major-name{font-size:clamp(8px,2.35vw,13px)}.table-shortcuts button{font-size:10px;min-height:62px;padding:6px 1px}.quick-symbol{font-size:18px}}
@media(max-width:360px){.table-shortcuts{gap:3px;padding:7px 4px}.table-shortcuts button{font-size:9px}}

.table-record-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:9px 12px 12px;background:#1b2421;border-bottom:1px solid #514b3a}
.table-record-actions:has(#printPlacement){grid-template-columns:repeat(3,minmax(0,1fr))}
.table-record-actions button{min-width:0;min-height:41px;background:#282f29;border-color:#9c8157;color:#f3e4c9;font-size:13px}
.record-restore{display:flex;justify-content:flex-end;margin:9px 0 16px}
.record-restore button{width:100%;max-width:300px}
@media(max-width:780px){.table-record-actions{order:4}.info{order:5}.table-record-actions button{font-size:12px;min-height:45px}}

.standalone-start{padding:14px 0 2px}
.standalone-start button{width:100%;min-height:44px;font-size:14px}
.table-surface .deck{left:3.5%;right:auto;top:83%}
.table-surface .deck-label{left:calc(3.5% + var(--cw) + 12px);right:2%;top:calc(83% + var(--ch) / 2);transform:translateY(-50%);max-width:none;white-space:normal;line-height:1.4;text-align:left;pointer-events:none}
@media(max-width:460px){.table-surface .deck-label{left:calc(3.5% + var(--cw) + 7px);font-size:10px}}
@media(max-width:780px){
 .standalone-start{order:5;display:block;padding:12px 14px 8px;background:#1d2724;border-top:1px solid #46483d}
 aside .section:nth-of-type(1){order:6}
 aside .section:nth-of-type(2){order:7}
 aside .section:nth-of-type(3){order:8}
 aside .section:nth-of-type(4){order:9}
 #operations{order:7}
}

.table-surface .deck{
  left:6%; right:auto; top:auto; bottom:5.5%;
}
.table-surface .deck-label{
  left:calc(6% + var(--cw) + 13px);
  right:3%; top:auto;
  bottom:calc(5.5% + var(--ch) / 2);
  transform:translateY(50%);
  max-width:none; white-space:normal;
  line-height:1.4; text-align:left; pointer-events:none;
}
@media(max-width:460px){
  .table-surface .deck{left:5.7%;bottom:5.2%;}
  .table-surface .deck-label{
    left:calc(5.7% + var(--cw) + 8px);
    bottom:calc(5.2% + var(--ch) / 2);
    font-size:10px;
  }
}

body[data-effect-preset="ritual"] .stage.effect-finale::before{
 content:"";position:absolute;inset:0;z-index:455;pointer-events:none;
 background:linear-gradient(180deg,rgba(255,243,209,.68) 0%,rgba(255,225,152,.35) 23%,rgba(239,179,82,.08) 68%,transparent 100%);
 clip-path:polygon(30% 0,70% 0,95% 93%,5% 93%);
 filter:blur(30px);transform-origin:50% 0;
 animation:descendBeam 4.7s ease-in-out both;
}
body[data-effect-preset="ritual"] .stage.effect-finale::after{
 background:radial-gradient(ellipse 58% 49% at 50% 54%,rgba(255,246,211,.48),rgba(255,218,151,.20) 48%,transparent 85%);
 animation:descendAtmosphere 4.7s ease-in-out both;
}
body[data-effect-preset="ritual"] .stage.effect-finale .cloth{
 animation:descendCloth 4.7s ease-in-out both;
}
body[data-effect-preset="ritual"] .stage.effect-finale .card.faceup{
 animation:descendCard 4.7s ease-in-out both;
}
body[data-effect-preset="ritual"] .stage.effect-finale .card.faceup .front{
 animation:none;
}
body[data-effect-preset="ritual"] .stage.effect-finale .zone-label{
 animation:descendLabel 4.7s ease-in-out both;
}
@keyframes descendBeam{
 0%,12%{opacity:0;transform:translateY(-38%) scaleX(.55)}
 34%{opacity:.3;transform:translateY(-9%) scaleX(.78)}
 53%{opacity:.9;transform:translateY(0) scaleX(1)}
 69%{opacity:.58;transform:translateY(3%) scaleX(1.1)}
 100%{opacity:0;transform:translateY(7%) scaleX(1.18)}
}
@keyframes descendAtmosphere{
 0%,15%{opacity:0}
 38%{opacity:.13}
 56%{opacity:1}
 73%{opacity:.62}
 100%{opacity:0}
}
@keyframes descendCloth{
 0%,14%{filter:brightness(.82) saturate(.9);box-shadow:0 15px 34px #0009,inset 0 0 65px #0004}
 40%{filter:brightness(.94) saturate(1)}
 57%{filter:brightness(1.3) saturate(1.12);box-shadow:0 15px 38px #0008,inset 0 0 100px #ffdf9048,0 0 38px #f3d18b33}
 75%{filter:brightness(1.13) saturate(1.05)}
 100%{filter:brightness(1);box-shadow:0 15px 34px #0009,inset 0 0 65px #0004}
}
@keyframes descendCard{
 0%,18%{filter:brightness(.88) drop-shadow(2px 6px 5px #000d)}
 43%{filter:brightness(1) drop-shadow(0 0 8px #e9c99188)}
 58%{filter:brightness(1.27) drop-shadow(0 0 13px #fff5cfed) drop-shadow(0 0 24px #efc776a8)}
 78%{filter:brightness(1.13) drop-shadow(0 0 12px #ead39e96)}
 100%{filter:brightness(1) drop-shadow(1px 4px 3px #000b) drop-shadow(0 0 9px #e7c88b88)}
}
@keyframes descendLabel{0%,18%{opacity:.66}55%{opacity:1}100%{opacity:1}}
@media(prefers-reduced-motion:reduce){
 body[data-effect-preset="ritual"] .stage.effect-finale::before,
 body[data-effect-preset="ritual"] .stage.effect-finale::after{animation:none!important;content:none!important}
 body[data-effect-preset="ritual"] .stage.effect-finale .cloth,
 body[data-effect-preset="ritual"] .stage.effect-finale .card.faceup,
 body[data-effect-preset="ritual"] .stage.effect-finale .zone-label{animation:none!important}
}


.removed-pile{position:absolute;z-index:16;left:6%;right:auto;top:5.8%;bottom:auto;width:var(--cw);height:var(--ch);display:none;pointer-events:none;filter:none}
.removed-pile.visible{display:block}
.removed-pile-card{position:absolute;inset:0;display:grid;place-items:center;border:3px double #d6b980;border-radius:4px;background:repeating-linear-gradient(45deg,#274740 0,#274740 4px,#19342f 4px,#19342f 8px);box-shadow:4px 4px 0 #b1aa98,7px 7px 0 #5e615b,8px 10px 8px #0008}
.removed-pile-card:before{content:'✧';font-size:25px;color:#cdb78a}
.removed-pile-count{position:absolute;top:-10px;right:-10px;min-width:34px;padding:3px 7px;border-radius:999px;background:#1a241fcc;border:1px solid #c9ad79;color:#f4e8c6;font:700 clamp(10px,1.05vw,14px)/1 sans-serif;text-align:center;box-shadow:0 2px 6px #0007}
.removed-pile-title{position:absolute;left:50%;bottom:-18px;transform:translateX(-50%);color:#e6d6b4;text-align:center;font-size:11px;white-space:nowrap;text-shadow:0 1px 3px #000}
@media(max-width:460px){.removed-pile{left:5.7%;top:5.8%;bottom:auto}.removed-pile-title{bottom:-16px;font-size:10px}.removed-pile-count{top:-8px;right:-8px;min-width:30px;padding:2px 6px}}
.spread-order-note{font-size:12px;opacity:.83;line-height:1.6}


.snapshot-compare{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.snapshot-board{position:relative;width:100%;aspect-ratio:1;background:repeating-linear-gradient(90deg,#263e34,#263e34 8px,#294237 9px);border:2px solid #8c795b;border-radius:6px;overflow:hidden}.snapshot-card{position:absolute;width:9%;height:15%;min-width:12px;background:#e8dbbb;border:1px solid #705e40;border-radius:2px;display:flex;align-items:center;justify-content:center;color:#392e23;font-size:clamp(7px,1vw,11px);text-align:center;line-height:1.05;overflow:hidden}.snapshot-card span{display:block;word-break:break-all}.snapshot-details{margin:8px 0 16px;max-height:none;overflow:visible;padding-right:16px}.snapshot-row{font-size:12px;padding:5px 0;border-bottom:1px solid #786c5b;display:flex;justify-content:space-between;gap:16px;align-items:baseline;padding-right:8px}.snapshot-row span{flex:0 0 auto;text-align:right}.history-row{display:flex;align-items:center;gap:8px;border-bottom:1px solid #786c5b;padding:8px 0}.history-row>div{flex:1;min-width:0}.history-row button{flex:none}.modal{max-width:min(960px,96vw)!important;max-height:85dvh;overflow:auto}@media(max-width:520px){.snapshot-compare{grid-template-columns:1fr}.snapshot-board{max-width:340px;margin:auto}.snapshot-card{font-size:9px}.history-row{flex-wrap:wrap}.history-row>div{flex-basis:100%}}

.modal-bg.records-active{padding:10px}
.modal-bg.records-active .modal{width:min(1220px,98vw);max-width:none!important;max-height:94dvh;padding:clamp(12px,2vw,26px);resize:horizontal;min-width:min(420px,96vw);overflow:auto}
.records-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:14px;margin:12px 0 16px}
.records-toolbar .choice{font-size:14px}
.snapshot-compare{display:grid;grid-template-columns:minmax(0,1fr);gap:18px}
.snapshot-compare.is-comparing{grid-template-columns:repeat(2,minmax(0,1fr))}
.snapshot-compare:not(.is-comparing) .record-b{display:none}
.snapshot-compare:not(.is-comparing) .snapshot-board{max-width:570px;margin:0 auto}
.snapshot-compare:not(.is-comparing) .snapshot-details{max-width:570px;margin:12px auto 20px}
.snapshot-compare .snapshot-card{font-size:clamp(8px,1.1vw,15px)}
.snapshot-compare:not(.is-comparing) .snapshot-card{font-size:clamp(10px,1.4vw,16px)}
@media(max-width:760px){
 .modal-bg.records-active .modal{width:100%;min-width:0;resize:none}
 .snapshot-compare.is-comparing{grid-template-columns:repeat(2,minmax(0,1fr));min-width:670px}
 .record-viewport{overflow-x:auto;overscroll-behavior-x:contain;padding-bottom:8px}
 .snapshot-compare .snapshot-board{max-width:none}
 .snapshot-compare .snapshot-card{font-size:10px}
}

.snapshot-details{max-height:none!important;overflow:visible!important;padding-right:10px!important}
.snapshot-row{padding-right:12px;min-height:29px}
.snapshot-row span{padding-right:10px;white-space:nowrap}
.snapshot-board{isolation:isolate;background:var(--record-cloth,#171719)!important;box-shadow:inset 0 0 18px #0005}
.snapshot-board::after{content:"";position:absolute;inset:2%;border:1px solid #d8c8a556;pointer-events:none}
.snapshot-card{width:9%!important;height:13.68%!important;min-width:0!important;overflow:visible!important;box-shadow:1px 2px 2px #0007;font-size:clamp(7px,1vw,13px)}
.snapshot-card span{max-width:100%;max-height:100%;overflow:hidden;word-break:break-all;line-height:1.1}
.record-altar{position:absolute;inset:0;pointer-events:none}
.record-candle{position:absolute;top:5%;height:12%;width:3%;background:linear-gradient(90deg,#8b7856,#f8e8bc,#ab9164);border-radius:3px;box-shadow:0 0 14px #ffdc8440}
.record-candle::before{content:"";position:absolute;bottom:100%;left:34%;width:35%;height:29%;background:#e9a739;border-radius:70% 10% 70% 30%;transform:rotate(20deg)}
.record-candle.left{left:13%}.record-candle.right{right:13%}

.snapshot-compare.is-comparing .snapshot-board{width:100%}
@media(max-width:520px){.snapshot-row{font-size:12px}.snapshot-row span{white-space:normal;overflow-wrap:anywhere}.snapshot-card{font-size:9px}}

body{--ui-bg:#151b18;--ui-aside:#202821;--ui-tool:#20271e;--ui-text:#eee0c8;--ui-accent:#bda477;--table-edge:#2b211b;--table-inner:#59483a;--card-back1:#553944;--card-back2:#322b38}
body[data-visual-theme="gothic"]{--ui-bg:#1b111a;--ui-aside:#291d27;--ui-tool:#281b24;--ui-text:#f0dfe1;--ui-accent:#c09a79;--table-edge:#28131d;--table-inner:#593341;--card-back1:#632739;--card-back2:#321b31}
body[data-visual-theme="minimal"]{--ui-bg:#d6d2cb;--ui-aside:#e7e1d6;--ui-tool:#e2dbd0;--ui-text:#3c3934;--ui-accent:#746b60;--table-edge:#aaa396;--table-inner:#d1cabd;--card-back1:#7c8583;--card-back2:#626d6b}
body[data-visual-theme="lovely"]{--ui-bg:#f0dfe9;--ui-aside:#f8e8f0;--ui-tool:#f1dfeb;--ui-text:#62455d;--ui-accent:#ac759d;--table-edge:#ae839c;--table-inner:#dbb9d2;--card-back1:#bb83ab;--card-back2:#9276ae}
body[data-visual-theme="psychic"]{--ui-bg:#151021;--ui-aside:#251835;--ui-tool:#27193b;--ui-text:#e6d7f6;--ui-accent:#b38dd9;--table-edge:#170e30;--table-inner:#4b2879;--card-back1:#59258a;--card-back2:#251046}
body[data-visual-theme="astral"]{--ui-bg:#101b30;--ui-aside:#1b2941;--ui-tool:#19273e;--ui-text:#e1e6f1;--ui-accent:#bdad84;--table-edge:#0a1632;--table-inner:#29436b;--card-back1:#213c70;--card-back2:#101e45}
body{background:var(--ui-bg)!important;color:var(--ui-text)!important}
aside{background:var(--ui-aside)!important}
.toolbar,.info,.table-shortcuts,.table-record-actions{background:var(--ui-tool)!important}
.section-toggle,h2{color:var(--ui-accent)}
.stage-shell{background:var(--table-edge)!important}
.stage{background:radial-gradient(ellipse at center,var(--table-inner),var(--table-edge))!important}
.back,.deck,.shuffle-card{background:repeating-linear-gradient(45deg,var(--card-back1) 0,var(--card-back1) 4px,var(--card-back2) 4px,var(--card-back2) 8px)!important}
/* Visual themes belong to the permanent tabletop and sidebar only.
   Opened reference pages, editors, help and dialogs retain their own palette. */
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) aside{color:var(--ui-text)}
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) aside :is(select,input,textarea,button){
 background:var(--ui-tool);color:var(--ui-text);border-color:var(--ui-accent);
}
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) aside .mini{color:var(--ui-text)}
body[data-effect-preset="silent"] .card,body[data-effect-preset="silent"] .card-inner{transition-duration:.20s!important}
body[data-effect-preset="ritual"] .card-inner{transition-duration:.7s}
body[data-effect-preset="mystic"] .card.faceup{filter:drop-shadow(0 0 8px #d3c28b77) drop-shadow(2px 5px 3px #000a)}
body[data-effect-preset="psychic"] .card.faceup{filter:drop-shadow(0 0 12px #ab62eeaa) drop-shadow(0 0 4px #a3ceff80);animation:psychic-glow 2s ease-in-out infinite alternate}
@keyframes psychic-glow{from{filter:drop-shadow(0 0 5px #a467e688) drop-shadow(2px 5px 3px #0009)}to{filter:drop-shadow(0 0 16px #b67aebcc) drop-shadow(2px 5px 3px #0009)}}
@media(prefers-reduced-motion:reduce){body[data-effect-preset="psychic"] .card.faceup{animation:none!important}}

.zone-label.tower-label{transform:translate(-100%,-50%);text-align:right;max-width:calc(23% - 4px);white-space:normal;font-size:10px;line-height:1.25;z-index:300}
@media(max-width:780px){.zone-label.tower-label{font-size:8px;padding:2px 3px}}
body[data-visual-theme="minimal"],body[data-visual-theme="lovely"]{--ui-muted:#5b514c;--ui-border:#a69a8d}
/* Permanent controls can be themed; opened windows cannot. */
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) :is(.toolbar,.info,.table-shortcuts,.table-record-actions){
 color:var(--ui-text);border-color:var(--ui-accent);
}
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) aside :is(.field,.choice,.subtle,.version,header small,.section-toggle,h2){
 color:var(--ui-text)!important;
}
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) .main>.toolbar :is(.status,.field,.choice,.subtle){
 color:var(--ui-text);
}
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) .main>.toolbar button:not(.toolbar-deck-option){
 color:var(--ui-text);background:var(--ui-tool);border-color:var(--ui-accent);
}
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) .main>.toolbar button.primary{
 color:#fff;background:var(--ui-accent);border-color:var(--ui-accent);
}
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) .table-shortcuts button{
 color:var(--ui-text);background:var(--ui-aside);
}
.effect-demo-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.effect-demo-row button{white-space:nowrap;flex:none}
.effect-demo-row .mini{flex:1;min-width:130px}
.stage.effect-demo::after{content:'';position:absolute;inset:0;pointer-events:none;z-index:450;animation:effectPulse .95s ease-out both}
body[data-effect-preset="silent"] .stage.effect-demo::after{animation:none;content:none}
body[data-effect-preset="ritual"] .stage.effect-demo::after{background:radial-gradient(ellipse at 50% 55%,#f1d8a53b,transparent 51%)}
body[data-effect-preset="mystic"] .stage.effect-demo::after{background:radial-gradient(circle at 50% 50%,#b6d7ef75 0,#d9bef45a 19%,transparent 62%);animation-duration:1.5s}
body[data-effect-preset="psychic"] .stage.effect-demo::after{background:radial-gradient(circle at 50% 50%,#eacfff99 0,#8a37eb80 22%,#4267ff55 37%,transparent 70%);animation:psychicPulse 1.65s ease-in-out both}
@keyframes effectPulse{0%{opacity:0;transform:scale(.86)}42%{opacity:1}100%{opacity:0;transform:scale(1.05)}}
@keyframes psychicPulse{0%{opacity:0;transform:scale(.55)}30%{opacity:1;transform:scale(1.06)}58%{opacity:.37;transform:scale(.96)}73%{opacity:.9;transform:scale(1.04)}100%{opacity:0;transform:scale(1.15)}}
body[data-effect-preset="silent"] .card.faceup{filter:drop-shadow(2px 4px 2px #0008)!important;animation:none!important}
body[data-effect-preset="ritual"] .card.faceup{filter:drop-shadow(1px 4px 3px #000b) drop-shadow(0 0 3px #d5b77b47)}
body[data-effect-preset="mystic"] .card.faceup{filter:drop-shadow(0 0 7px #b1e0ffb0) drop-shadow(0 0 11px #d4bbf688)}
@media(prefers-reduced-motion:reduce){.stage.effect-demo::after{animation:none!important;content:none!important}}
.stage.effect-finale::after{content:'';position:absolute;inset:0;pointer-events:none;z-index:460}
body[data-effect-preset="silent"] .stage.effect-finale::after{content:none}
body[data-effect-preset="ritual"] .stage.effect-finale::after{background:linear-gradient(180deg,#ffe8ba14,#f3d18d08 50%,transparent);animation:ritualAura 2.2s ease-in-out both}
body[data-effect-preset="mystic"] .stage.effect-finale::after{background:radial-gradient(circle at 50% 50%,#d9f3ffbb 0,#bdd6ff88 18%,#d4b6ff5d 38%,transparent 72%);animation:mysticFinale 2.45s ease-in-out both}
body[data-effect-preset="psychic"] .stage.effect-finale::after{background:radial-gradient(circle at 50% 50%,#f0d6ffbb 0,#ad67ff95 18%,#4f62ff70 42%,transparent 74%);animation:psychicFinale 2.8s ease-in-out both}
.stage.spread-complete-ritual{filter:brightness(1.04) saturate(1.03)}
.stage.spread-complete-mystic{filter:brightness(1.025) saturate(1.05)}
.stage.spread-complete-psychic{filter:brightness(1.08) saturate(1.18)}
body[data-effect-preset="ritual"] .card.faceup{filter:drop-shadow(1px 4px 3px #000b) drop-shadow(0 0 9px #e7c88b88)}
body[data-effect-preset="ritual"] .stage.effect-finale .card.faceup{animation:ritualCardFlash 3.1s ease-in-out both}
body[data-effect-preset="ritual"] .stage.effect-finale .card.faceup .front{animation:ritualFrontFlash 3.1s ease-in-out both}
body[data-effect-preset="mystic"] .card.faceup{filter:drop-shadow(0 0 6px #b1e0ff94) drop-shadow(0 0 10px #d4bbf678)}
@keyframes ritualAura{0%{opacity:0}20%{opacity:.18}44%{opacity:.28}72%{opacity:.1}100%{opacity:0}}
@keyframes ritualCardFlash{0%{filter:drop-shadow(2px 5px 3px #0009) drop-shadow(0 0 8px #e6bd6d88)}12%{filter:drop-shadow(0 0 10px #ffe6a9aa) drop-shadow(0 0 19px #eab75baa)}25%{filter:drop-shadow(0 0 15px #fffbe9ff) drop-shadow(0 0 32px #ffda74f5) drop-shadow(0 0 48px #d99737cb)}39%{filter:drop-shadow(2px 5px 3px #0009) drop-shadow(0 0 7px #cfa35e88)}52%{filter:drop-shadow(0 0 11px #fff0b5d0) drop-shadow(0 0 22px #e8b44fb0)}66%{filter:drop-shadow(0 0 20px #fffef0ff) drop-shadow(0 0 40px #ffd36cf5) drop-shadow(0 0 58px #e6a449dc)}80%{filter:drop-shadow(0 0 12px #f3d594bc) drop-shadow(0 0 23px #deb567aa)}100%{filter:drop-shadow(2px 5px 3px #0009) drop-shadow(0 0 10px #e7c88b99)}}
@keyframes ritualFrontFlash{0%{box-shadow:0 0 0 transparent;background:#eee1c3}25%{box-shadow:0 0 22px #fff3c9ee,0 0 34px #ecc165bb;background:#fff4d8}39%{box-shadow:0 0 5px #d2ac5a55;background:#eee1c3}66%{box-shadow:0 0 28px #fff6d9ff,0 0 44px #f1c76adc;background:#fff8e8}85%{box-shadow:0 0 12px #f5d89388;background:#f5e7c9}100%{box-shadow:0 0 0 transparent;background:#eee1c3}}
@keyframes mysticFinale{0%{opacity:0;transform:scale(.82)}28%{opacity:.86;transform:scale(1.01)}62%{opacity:.52;transform:scale(1.04)}100%{opacity:0;transform:scale(1.1)}}
@keyframes psychicFinale{0%{opacity:0;transform:scale(.62)}18%{opacity:1;transform:scale(1.02)}40%{opacity:.38;transform:scale(.98)}56%{opacity:.97;transform:scale(1.05)}76%{opacity:.28;transform:scale(1.01)}100%{opacity:0;transform:scale(1.16)}}
@media(prefers-reduced-motion:reduce){.stage.effect-finale::after{animation:none!important;content:none!important}.stage.spread-complete-ritual,.stage.spread-complete-mystic,.stage.spread-complete-psychic{filter:none!important}}



body[data-effect-preset="ritual"] .stage.effect-finale::before,
body[data-effect-preset="ritual"] .stage.effect-demo::before {content:none!important;animation:none!important}
body[data-effect-preset="ritual"] .stage.effect-finale::after,
body[data-effect-preset="ritual"] .stage.effect-demo::after {
 content:'';position:absolute;inset:0;pointer-events:none;z-index:460;
 background:radial-gradient(circle at 50% 50%,#fff4d7bb 0,#ffd99b88 18%,#e3a64c5d 38%,transparent 72%);
 animation:mysticFinale 2.45s ease-in-out both;
}
body[data-effect-preset="ritual"] .card.faceup {
 filter:drop-shadow(0 0 8px #ffdf9acf) drop-shadow(0 0 14px #dfb66cb0);
}
body[data-effect-preset="ritual"] .stage.effect-finale .card.faceup,
body[data-effect-preset="ritual"] .stage.effect-finale .card.faceup .front,
body[data-effect-preset="ritual"] .stage.effect-finale .cloth,
body[data-effect-preset="ritual"] .stage.effect-finale .zone-label {animation:none!important}
.stage.spread-complete-ritual {filter:brightness(1.05) saturate(1.08)}
@media(prefers-reduced-motion:reduce){body[data-effect-preset="ritual"] .stage.effect-finale::after,body[data-effect-preset="ritual"] .stage.effect-demo::after{content:none!important;animation:none!important}}

.results-toggle-bar{background:var(--ui-tool,#1b2421);padding:8px 12px 3px;border-top:1px solid var(--ui-border,#514b3a)}
.results-toggle-bar button{width:100%;min-height:36px;background:var(--ui-aside,#24312b);color:var(--ui-text,#f3e4c9);border:1px solid var(--ui-accent,#9c8157);letter-spacing:.10em}
.live-results{background:var(--ui-tool,#1b2421);color:var(--ui-text,#e8ddc5);padding:14px 18px 16px;border-bottom:1px solid var(--ui-border,#514b3a)}
.live-results[hidden]{display:none!important}
.live-results-title{font-size:14px;letter-spacing:.19em;color:var(--ui-text,#e8ddc5);margin-bottom:8px;display:flex;gap:15px;align-items:baseline}
.live-results-title span{font:11px sans-serif;letter-spacing:0;opacity:.8}
.live-result-row{display:grid;grid-template-columns:minmax(110px,1fr) minmax(130px,1.2fr);gap:14px;align-items:baseline;padding:7px 4px;border-bottom:1px solid var(--ui-border,#655c4a);font:13px/1.5 sans-serif}
.live-result-row:last-child{border-bottom:0}
.live-result-pos{opacity:.86}.live-result-card{text-align:right;font-weight:600}.live-result-card.unrevealed{font-weight:normal;opacity:.66}
@media(max-width:780px){.results-toggle-bar{order:4}.live-results{order:5}.table-record-actions{order:6}.info{order:7}}
@media(max-width:430px){.live-result-row{grid-template-columns:minmax(90px,1fr) minmax(110px,1.3fr);gap:7px;font-size:12px}}

@media (max-width:780px){
  aside header{
    padding-top:calc(16px + max(26px, env(safe-area-inset-top, 0px))) !important;
  }
  /* On narrow screens, preserve a clear luminous edge independent of CSS filter rendering. */
  body[data-effect-preset="ritual"] .card.faceup{
    box-shadow:0 0 8px 2px rgba(255,220,146,.85),
               0 0 19px 5px rgba(222,165,72,.52);
  }
  body[data-effect-preset="mystic"] .card.faceup{
    box-shadow:0 0 8px 2px rgba(188,226,255,.86),
               0 0 20px 5px rgba(178,172,255,.52);
  }
  body[data-effect-preset="psychic"] .card.faceup{
    box-shadow:0 0 8px 2px rgba(190,135,255,.82),
               0 0 18px 5px rgba(127,65,226,.45);
  }
  body[data-effect-preset="silent"] .card.faceup{box-shadow:none}
}
/* Honor motion-reduction while keeping the static visual treatment. */
@media (prefers-reduced-motion:reduce){
  body[data-effect-preset="ritual"] .card.faceup,
  body[data-effect-preset="mystic"] .card.faceup{animation:none!important}
}

@media(max-width:780px){
  .stage-shell{min-height:min(108vw,800px)}
  .zone-label.mobile-num-label{font-size:10px;line-height:1;padding:2px 4px;transform:translateX(-50%);background:#17241fdb;border:1px solid #d2b98670;min-width:16px;text-align:center}
  body[data-effect-preset="ritual"] .card.faceup,
  body[data-effect-preset="mystic"] .card.faceup,
  body[data-effect-preset="psychic"] .card.faceup{
    box-shadow:1px 3px 5px #0009!important;
    filter:drop-shadow(1px 3px 3px #0008)!important;
  }
  body[data-effect-preset="psychic"] .card.faceup{animation:none!important}
  /* Keep the finale glow but avoid the constant halo on small cards. */
  body[data-effect-preset="ritual"] .stage.effect-finale .card.faceup,
  body[data-effect-preset="mystic"] .stage.effect-finale .card.faceup,
  body[data-effect-preset="psychic"] .stage.effect-finale .card.faceup{filter:drop-shadow(0 0 9px #dfd5ffb0)!important}
  .stage,.stage-shell,.table-zone,.live-results{overflow-anchor:none}
}

@media(max-width:780px){
 html,body{overflow-anchor:none}
 .table-zone .card{touch-action:none}
 .stage-shell{contain:layout style}
}

.table-utility-actions{display:flex;gap:7px;flex-wrap:wrap;padding:9px 14px 4px;background:var(--ui-bg,#1b2421)}
.table-utility-actions button{font-size:11px;padding:8px 10px;flex:1 1 auto;white-space:nowrap}
@media(max-width:780px){.table-utility-actions{order:4;padding:8px}.table-utility-actions button{flex:1 1 30%;font-size:11px;min-height:38px}}
.card.no-reversal-spin{transition-property:left,top!important}
/* Drag must override the reversal-specific transition on every card. */
.card.dragging,.card.no-reversal-spin.dragging{transition:none!important;animation:none!important}
.wash-settings{border:1px solid #65553b;border-radius:7px;padding:10px 12px;margin:5px 0 12px;display:grid;gap:8px}.wash-settings .mini{margin:0}.table-active-recipe{font-size:12px;color:#c3ad85;text-align:center;margin:-2px 0 9px;letter-spacing:.04em}.table-active-recipe strong{color:#e1ca9b;font-weight:500}
.deal-rule-panel{border:1px solid rgba(185,157,101,.35);border-radius:9px;padding:12px;margin:12px 0;background:rgba(142,117,76,.07)}.deal-rule-panel h3{font-size:13px;letter-spacing:.08em;margin:2px 0 7px}.deal-rule-panel .field{margin-top:9px}.deal-rule-panel input{max-width:100%;box-sizing:border-box}.deal-rule-panel .mini{line-height:1.6}

/* One back design for cards on the spread, the deck and the excluded pile. */
.removed-pile-card{background:repeating-linear-gradient(45deg,var(--card-back1) 0,var(--card-back1) 4px,var(--card-back2) 4px,var(--card-back2) 8px)!important}
.table-surface .deck,.removed-pile-card{position:absolute;}
.table-surface .deck:before,.removed-pile-card:before{content:""!important;position:absolute;inset:5px;border:1px solid #c9ad79;pointer-events:none;display:block}
.table-surface .deck:after,.removed-pile-card:after{content:"✦"!important;position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:clamp(17px,3vw,29px);line-height:1;color:#d8bb83;pointer-events:none}


aside .section.stack{gap:9px}
aside .section .field{gap:4px}
aside .section .field select,aside .section .field input:not([type=checkbox]){padding:7px 9px}
aside .section .mini{line-height:1.5}
.setting-details{margin:3px 0;border:1px solid rgba(184,155,102,.38);border-radius:7px;background:rgba(140,116,80,.045);min-width:0}
.setting-details>summary{display:flex;align-items:center;justify-content:space-between;gap:8px;list-style:none;cursor:pointer;padding:11px 12px;font-size:12px;letter-spacing:.025em;color:#d7c49e;user-select:none}
.setting-details>summary::-webkit-details-marker{display:none}
.setting-details>summary:before{content:'▸';font:12px sans-serif;color:#b4a17f;flex:none}
.setting-details[open]>summary:before{content:'▾'}
.setting-details>summary:focus-visible{outline:2px solid #d8b97a;outline-offset:2px}
.details-sub{margin-left:auto;color:#aaa48e;font:11px/1.25 sans-serif;letter-spacing:0;text-align:right}
.setting-details-body{display:grid;gap:9px;padding:0 12px 12px}
.setting-details-body .spread-order-note{font-size:11px}
.setting-details-body .deal-rule-panel{border:0;background:transparent;padding:0;margin:0;display:grid;gap:9px}
.setting-details-body .deal-rule-panel .field{margin:0}
.setting-details-body .deal-rule-panel .mini{margin:0}
.wash-header{display:flex;align-items:center;gap:8px;margin-top:5px;color:#d7c49e;font-size:12px}
.wash-header .mini{font-size:10px}
.wash-settings{display:grid;grid-template-columns:minmax(0,1fr) 76px;gap:9px;align-items:end;margin:0 0 5px;padding:8px 10px}
.wash-settings .field{min-width:0;font-size:11px}
.wash-settings input{width:100%;min-width:0}
#dealRuleStatus:empty{display:none}

/* v0.7.8: cut stacks share the currently selected card-back palette. */
.cut-piles button.cut-stack{background:repeating-linear-gradient(45deg,var(--card-back1,#47353e) 0 5px,var(--card-back2,#2d2934) 5px 10px);color:#f3e5c5;position:relative;isolation:isolate;text-shadow:0 1px 3px #000}
.cut-piles button.cut-stack:before{content:'✦';position:absolute;inset:5px;border:1px solid #d2b685;display:grid;place-items:center;font-size:23px;color:#d7bd82;opacity:.55;z-index:-1}
.cut-piles button.cut-stack.picked{background:repeating-linear-gradient(45deg,var(--card-back1,#47353e) 0 5px,var(--card-back2,#2d2934) 5px 10px);outline:3px solid #d9b96f;outline-offset:2px;filter:brightness(1.18)}
.table-shortcuts button:disabled{opacity:.33;filter:grayscale(1);cursor:not-allowed;box-shadow:none}

/* TABULA series identity — shared masthead with a distinct edition subtitle. */
aside header .tabula-brand{display:flex;flex-direction:column;align-items:center;text-align:center;margin:0 0 12px;max-width:100%;}
aside header .tabula-brand h1{font-family:Georgia,'Times New Roman',serif;font-weight:normal;font-size:32px;letter-spacing:.2em;line-height:1.2;margin:0;padding-left:.2em;color:#e9ddbf;}
aside header .tabula-series{display:flex;align-items:center;gap:13px;width:83%;margin-top:9px;color:#c6ac77;font:normal 13px/1.2 Georgia,'Times New Roman',serif;letter-spacing:.28em;}
aside header .tabula-series:before,aside header .tabula-series:after{content:'';height:1px;background:#746344;flex:1;min-width:10px;}
aside header .tabula-series span{padding-left:.28em;white-space:nowrap;}
@media(max-width:780px){aside header .tabula-brand h1{font-size:30px;}aside header .tabula-series{max-width:240px;}}

/* v0.9.4 — Mobile: keep the whole divination workbench together,
   followed by new-session and four consistently sized setting panels.
   The existing display:contents layout requires an explicit order for
   every child; otherwise record buttons can fall between menu sections. */
@media(max-width:780px){
  .shell{display:flex;flex-direction:column;align-items:stretch}
  aside header{order:0}
  .toolbar{order:1}
  .stage-shell{order:2}
  .table-shortcuts{order:3}
  .table-active-recipe{order:4;margin:0;padding:6px 12px 9px;background:var(--ui-tool,#1b2421);width:100%;box-sizing:border-box}
  .table-utility-actions{order:5;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding:9px 12px;background:var(--ui-tool,#1b2421);width:100%;box-sizing:border-box}
  .table-utility-actions button{width:100%;min-width:0;max-width:none;white-space:normal;min-height:43px;font-size:12px;padding:8px 5px}
  .table-utility-actions button:first-child{grid-column:1/-1}
  .results-toggle-bar{order:6;width:100%;box-sizing:border-box}
  .live-results{order:7;width:100%;box-sizing:border-box}
  .table-record-actions{order:8;width:100%;box-sizing:border-box;grid-template-columns:repeat(2,minmax(0,1fr));padding:9px 12px 12px}
  .table-record-actions button{width:100%;min-width:0;min-height:44px;font-size:12px;white-space:normal}
  .info{order:9;width:100%;box-sizing:border-box}
  .standalone-start{order:10!important;display:block;width:100%;box-sizing:border-box;margin:0;padding:12px 14px;background:#1d2724}
  aside .section:nth-of-type(1){order:11!important}
  aside .section:nth-of-type(2){order:12!important}
  aside .section:nth-of-type(3){order:13!important}
  aside .section:nth-of-type(4){order:14!important}
  aside .section:nth-of-type(5){order:15!important}
  #operations{order:12!important;display:grid!important;grid-template-columns:minmax(0,1fr)!important}
  aside .section{width:100%;min-width:0;box-sizing:border-box;padding:12px 14px;grid-template-columns:minmax(0,1fr)!important}
  aside .section > *, aside .section .field, aside .section .row, aside .section .wash-settings,
  aside .section .setting-details, aside .section .deal-rule-panel{min-width:0;max-width:100%;box-sizing:border-box}
  aside .section .field input:not([type=checkbox]),aside .section .field select,
  aside .section > button,aside .section > select,aside .section .setting-details input,
  aside .section .setting-details select{width:100%;max-width:100%;min-width:0;box-sizing:border-box}
  aside .section .row{display:flex!important;gap:8px;width:100%}
  aside .section .row>button{flex:1 1 0;min-width:0;white-space:normal}
  #operations .row{display:flex!important}
  #operations .row button{min-width:0;white-space:normal}
  aside .section.is-collapsed{display:grid!important}
  .swatches{grid-template-columns:repeat(6,minmax(0,1fr));justify-items:center}
  .swatch{max-width:100%}
}

/* v0.9.5 — New session is a tabletop operation, alongside zoom controls. */
.toolbar #newSessionStandalone{margin-left:auto;min-height:39px;padding:8px 12px;white-space:nowrap;flex:0 0 auto}
.toolbar #zoomReset{min-width:39px;font-family:Georgia,serif;font-weight:bold}
@media(max-width:780px){
 .toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:7px;padding:9px 12px}
 .toolbar .status{flex:1 0 100%;min-width:0;margin-bottom:3px}
 .toolbar #zoomOut,.toolbar #zoomReset,.toolbar #zoomIn{width:39px;height:40px;min-width:39px;flex:0 0 39px;padding:6px;text-align:center}
 .toolbar #newSessionStandalone{flex:1 1 auto;min-width:0;width:auto;max-width:100%;margin-left:3px;min-height:40px;padding:7px 7px;font-size:12px;white-space:normal;line-height:1.3}
}
@media(max-width:355px){.toolbar{gap:5px;padding-inline:7px}.toolbar #zoomOut,.toolbar #zoomReset,.toolbar #zoomIn{width:34px;min-width:34px;flex-basis:34px}.toolbar #newSessionStandalone{font-size:11px;margin-left:1px}}

/* v0.9.29: tabletop selection; leave text selection enabled in menus and forms. */
.table-surface,.table-surface *, .table-zone,.table-zone *{-webkit-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important}
.table-zone .card{-webkit-tap-highlight-color:transparent}
.table-zone .card.is-selected{outline:2px solid #e4bd71;outline-offset:3px;box-shadow:0 0 0 1px #382b14,0 0 13px 2px rgba(225,183,98,.35)}
.table-card-controls{display:flex;align-items:center;gap:9px;flex-wrap:wrap;padding:8px 12px;background:#202b26;border-top:1px solid #60533d;border-bottom:1px solid #60533d;font:12px sans-serif;color:#ead9af}
.table-card-controls[hidden]{display:none!important}
@media(max-width:780px){.table-card-controls{order:3;width:100%;box-sizing:border-box}}
.table-card-controls .selection-caption{flex:1;min-width:90px}
.table-card-controls button{padding:7px 12px;min-height:34px;background:#354338;border-color:#927950;color:#f1ddad}
.table-card-controls .angle-status{font-variant-numeric:tabular-nums;color:#cfbc9a}

/* Dragging a new card mirrors a held card instead of jumping on release. */
.deck-drag-preview{position:fixed;transform:translate(-50%,-50%);z-index:10000;pointer-events:none;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;border:3px double #d6b980;border-radius:4px;background:repeating-linear-gradient(45deg,#274740 0,#274740 4px,#19342f 4px,#19342f 8px);box-shadow:3px 6px 12px #0009;display:grid;place-items:center;color:#cdb78a;will-change:left,top}
.deck-drag-preview-symbol{font-size:25px}


/* v0.9.29: five-button fine rotation bar, compact on mobile. */
.table-card-controls .angle-buttons{display:flex;gap:5px;align-items:center;flex-wrap:nowrap}
.table-card-controls .angle-buttons button{min-width:0;white-space:nowrap;padding:7px 9px}
@media(max-width:780px){
 .table-card-controls .selection-caption{flex-basis:calc(100% - 65px);min-width:0}
 .table-card-controls .angle-status{order:0}
 .table-card-controls .angle-buttons{order:1;width:100%;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}
 .table-card-controls .angle-buttons button{padding:9px 1px;font-size:11px;min-height:38px}
}
.spread-create-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px}.spread-create-actions button{font-size:11px;padding:9px 5px}.spread-editor-table{display:grid;gap:7px;margin:14px 0}.spread-editor-row{display:grid;grid-template-columns:48px 1fr;gap:8px;align-items:center}.spread-editor-row input{width:100%;min-width:0}.spread-editor-row label{font:12px sans-serif;color:#dac89d}.spread-editor-actions{display:grid;grid-template-columns:repeat(2,1fr);gap:7px;margin:12px 0}.spread-editor-actions button{font:12px sans-serif}.spread-editor-note{font:11px/1.6 sans-serif;color:#b9b1a0}
.spread-workbench[hidden]{display:none!important}.spread-workbench{background:#1f2a24;border:1px solid #756c52;padding:12px 15px;color:#ecdfc5}.spread-workbench-head{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;color:#dbbe83;margin-bottom:10px;font:13px sans-serif}.spread-workbench-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin-bottom:8px}.spread-workbench-actions button,.spread-workbench-actions select{font-size:11px;padding:8px 6px}.spread-workbench-actions select{min-width:0}.spread-workbench-meta{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin:-2px 0 10px;color:#d6c196;font:12px sans-serif}.spread-workbench-meta .mini-note{opacity:.84}.spread-workbench-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;max-height:210px;overflow:auto}.spread-workbench-fields label{display:flex;gap:8px;align-items:center;font:12px sans-serif;color:#dfc99a}.spread-workbench-fields input{min-width:0;flex:1;padding:6px;font-size:12px}.spread-workbench-bottom{display:flex;gap:8px;margin-top:10px}.spread-workbench-bottom button{flex:1}.spread-edit-badge{position:absolute;z-index:3000;min-width:22px;height:22px;border:1px solid #d4b66e;border-radius:5px;background:#17231e;color:#f3dfae;font:700 13px/20px sans-serif;text-align:center;transform:translate(-50%,-50%);pointer-events:none;box-shadow:0 1px 5px #0009}.spread-edit-badge.unassigned{opacity:.65;border-style:dashed}.spread-workbench-active .card{outline:2px solid #ceae65;outline-offset:3px}.spread-workbench-active .card.spread-numbered{outline-color:#88a994}@media(max-width:780px){.spread-workbench-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.spread-workbench-fields{grid-template-columns:1fr;max-height:165px}.spread-workbench{padding:10px}.spread-workbench-actions button,.spread-workbench-actions select{font-size:10px;padding:8px 4px}.spread-workbench-meta{font-size:11px}}

/* Spread archive / notebook - only the notebook is visible on the ordinary free table. */
.spread-archive-open .stage-shell,.spread-archive-open .table-shortcuts,.spread-archive-open .quick-actions{display:none!important}
.spread-create-actions[hidden],.spread-workbench-actions button[hidden],.spread-notebook[hidden],.spread-archive[hidden]{display:none!important}
.spread-notebook{position:absolute;right:2%;bottom:4.5%;width:50px;height:64px;z-index:7;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;background:linear-gradient(100deg,#37291c 0 12%,#6a5036 13%,#3c2d22 100%);border:2px solid #a58a5c;border-left:5px solid #2b1f18;border-radius:3px 6px 6px 3px;color:#e0c38c;box-shadow:3px 5px 10px #0008;transform:rotate(-8deg);padding:3px;touch-action:manipulation}
.spread-notebook .notebook-crest{font-size:20px;line-height:1}.spread-notebook .notebook-caption{font:7px Georgia,serif;letter-spacing:.05em}.spread-notebook:hover{background:#5b4330}
.spread-archive{position:relative;z-index:55;padding:18px;background:#131b20;min-height:400px;border-bottom:1px solid #756444}
.archive-paper{max-width:850px;margin:auto;background:linear-gradient(145deg,#202b2e,#192126);border:1px solid #716247;box-shadow:0 10px 40px #0009;padding:22px;color:#e9dec7}
.archive-top{display:flex;justify-content:space-between;align-items:flex-start;gap:8px;border-bottom:1px solid #776347;padding-bottom:14px;margin-bottom:16px}.archive-top small{font:9px sans-serif;letter-spacing:.18em;color:#b99d70}.archive-top h2{font:normal 25px Georgia,'Yu Mincho',serif;color:#e9d1a1;margin:7px 0}.archive-top p{font:11px sans-serif;color:#aa9d86;margin:0}.archive-top button{font-size:11px;flex:none}
.archive-capture{width:100%;text-align:left;border:1px solid #8d7754;background:#2d3b39;padding:15px;font-size:15px;color:#f1dfb9}.archive-capture span{display:block;font:11px sans-serif;color:#b8b2a1;margin-top:5px}
.archive-bar{display:flex;justify-content:space-between;margin:22px 0 8px;font:10px sans-serif;letter-spacing:.13em;color:#c0a778}.archive-entry{display:flex;align-items:center;gap:13px;padding:12px 0;border-top:1px solid #594e3f}.archive-thumb{width:90px;flex:none}.archive-thumb svg{width:90px;height:67px}.archive-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:7px}.archive-info strong{font-size:14px;font-weight:normal}.archive-info small{color:#ac9f87;font:11px sans-serif}.archive-actions{display:flex;flex-wrap:wrap;gap:5px}.archive-actions button{font:11px sans-serif;padding:6px 8px}.archive-empty{font:12px/1.7 sans-serif;color:#bcb3a1}
.spread-workbench-active #zone.spread-grid{background-image:linear-gradient(to right,rgba(196,202,182,.18) 1px,transparent 1px),linear-gradient(to bottom,rgba(196,202,182,.18) 1px,transparent 1px);background-size:var(--workgrid,24px) var(--workgrid,24px)}
@media(max-width:780px){.spread-notebook{right:1.5%;bottom:4%;width:38px;height:49px;border-width:1px;border-left-width:4px}.spread-notebook .notebook-crest{font-size:15px}.spread-notebook .notebook-caption{font-size:6px}.archive-paper{padding:13px}.spread-archive{padding:8px}.archive-entry{gap:8px;flex-wrap:wrap}.archive-actions{width:100%;padding-left:98px}.archive-actions button{flex:1}.archive-top h2{font-size:20px}}

/* v0.9.29 — independently chosen notebook bindings. Never inherit table theme. */
.spread-notebook{--book-cover:#241d1d;--book-mid:#46362d;--book-foil:#c8aa74;--book-spine:#120e13;--book-paper:#c0ad87;--book-gleam:#816e5c;box-sizing:content-box;display:block;position:absolute;right:2.2%;bottom:4.5%;width:46px;height:61px;min-width:0;min-height:0;padding:0;background:none!important;border:0!important;border-radius:0;box-shadow:none!important;transform:rotate(-9deg);cursor:pointer;touch-action:manipulation;isolation:isolate;transition:filter .18s,transform .18s}
.spread-notebook:before{content:'';position:absolute;inset:5px -3px -5px 5px;border-radius:3px;box-shadow:4px 8px 8px #0009;z-index:-1}
.spread-notebook:hover,.spread-notebook:focus-visible{transform:rotate(-7deg) translateY(-2px);filter:brightness(1.14)}
.spread-notebook .notebook-page-edge{position:absolute;inset:3px -2px 0 4px;background:repeating-linear-gradient(180deg,var(--book-paper) 0 2px,#9f947e 2px 3px);border-radius:2px 5px 5px 2px;transform:translate(2px,2px);box-shadow:1px 3px 3px #0008}
.spread-notebook .notebook-cover{position:absolute;inset:0 3px 2px 0;display:grid;place-items:center;border-radius:2px 5px 5px 2px;border:1px solid var(--book-foil);border-left:5px solid var(--book-spine);background:linear-gradient(100deg,var(--book-spine) 0 4%,var(--book-mid) 12%,var(--book-cover) 30%,var(--book-cover) 78%,var(--book-gleam) 100%);box-shadow:inset 2px 0 2px #fff2,inset -2px -2px 4px #0008,1px 2px 3px #0009}
.spread-notebook .notebook-cover:before,.spread-notebook .notebook-cover:after{content:'';position:absolute;width:9px;height:9px;border-color:var(--book-foil);border-style:solid;opacity:.75}.spread-notebook .notebook-cover:before{left:5px;top:4px;border-width:1px 0 0 1px}.spread-notebook .notebook-cover:after{right:4px;bottom:4px;border-width:0 1px 1px 0}
.spread-notebook .notebook-frame{position:absolute;inset:9px 6px 8px 7px;border:1px solid color-mix(in srgb,var(--book-foil),transparent 15%);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;color:var(--book-foil);font:9px Georgia,serif;letter-spacing:.05em;text-shadow:0 1px 1px #0007}
.spread-notebook .notebook-sigil{font-size:16px;line-height:1}.spread-notebook .notebook-title{font-size:8px;letter-spacing:.13em}
body[data-notebook-style="burgundy"] .spread-notebook{--book-cover:#4c1e31;--book-mid:#713444;--book-spine:#26121f;--book-gleam:#825463;--book-foil:#d5ae80;--book-paper:#d9c49d}
body[data-notebook-style="verdigris"] .spread-notebook{--book-cover:#193b36;--book-mid:#315c52;--book-spine:#112d2d;--book-gleam:#50746b;--book-foil:#c1aa7c;--book-paper:#c5ba9d}
body[data-notebook-style="linen"] .spread-notebook{--book-cover:#aca08a;--book-mid:#d0bea2;--book-spine:#6f665e;--book-gleam:#dfd0ac;--book-foil:#554732;--book-paper:#ede0c6}
@media(max-width:780px){.spread-notebook{right:1.4%;bottom:4%;width:38px;height:50px}.spread-notebook .notebook-frame{inset:7px 5px 6px 5px}.spread-notebook .notebook-sigil{font-size:14px}.spread-notebook .notebook-title{font-size:7px}}
.archive-capture[hidden]{display:none!important}

/* v0.9.29: notebook is a tool outside the cloth, never a physical object on the table. */
.notebook-tool{display:inline-flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap;background:#293630;border:1px solid #927b53;color:#e6d7b7;padding:7px 12px;min-height:38px}
.notebook-tool-icon{position:relative;display:inline-flex;align-items:center;justify-content:center;width:18px;height:23px;flex:none;background:linear-gradient(100deg,#0d1010 0 18%,#3b3430 18% 100%);border:1px solid #c7aa73;border-left:3px solid #b89c66;border-radius:2px 4px 4px 2px;box-shadow:2px 2px 0 #aca085;font-size:10px;color:#ddc48e}
.notebook-tool:hover{background:#3c4b41}
.notebook-tool[hidden],.archive-readings[hidden],#archiveSpreadsPanel[hidden]{display:none!important}
.archive-tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:13px 0 18px}
.archive-tabs button{background:#252e2b;border:1px solid #6c6251;color:#bfb49a;padding:12px 6px}
.archive-tabs button.active{background:#554a36;border-color:#d5b47a;color:#fff0cf;box-shadow:inset 0 -2px 0 #bca16c}
.archive-readings{padding:16px 13px 24px;border:1px solid #665944;border-radius:5px;background:#26302e;display:flex;flex-wrap:wrap;gap:10px}
.archive-readings p{width:100%;margin:0 0 8px;color:#d5c7ab;font-size:13px}
.archive-readings button{flex:1;min-width:130px}
@media(max-width:780px){.toolbar .notebook-tool{min-width:75px;flex:0 0 auto;font:12px sans-serif;padding:6px 8px}.notebook-tool-icon{width:16px;height:20px}}

/* v0.9.29: desktop setting menu follows the document, without a clipped internal viewport. */
@media(min-width:781px){
  .shell{align-items:start}
  .shell>aside{max-height:none!important;height:auto!important;overflow:visible!important;align-self:start}
  .shell>.main{height:100dvh;min-height:0;position:sticky;top:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;scrollbar-gutter:stable}
}
.aside-help-area{padding:18px 4px 4px;border-top:1px solid #655743;margin-top:18px}
.aside-help-button{display:block;width:100%;text-align:center;background:transparent;border-color:#766647;color:#dec798;font:13px/1.5 Georgia,'Yu Mincho',serif;min-height:44px}
.help-popup-content{font:13px/1.8 sans-serif;color:#d9d1c0}
.help-popup-content h3{font:normal 15px/1.5 Georgia,'Yu Mincho',serif;color:#d7bc85;margin:18px 0 6px}
.help-popup-content p{margin:0 0 10px}
.help-popup-content .mini{font-size:11px;line-height:1.65}
@media(max-width:780px){.aside-help-area{order:15;display:block;width:100%;box-sizing:border-box;padding:16px 14px 22px;background:#1d2724}.aside-help-button{width:100%}}
 .front:has(.tarot-face-art){padding:0!important;border:0;background:#f7e7c1;gap:0!important;} .front:has(.tarot-face-art):before{display:none} .tarot-face-art{display:block;width:100%;height:100%;object-fit:fill;pointer-events:none;user-select:none} 
/* Card gallery: independent viewer, never inherits tabletop card positioning */
body.gallery-open{overflow:hidden}
#cardGallery[hidden]{display:none!important}
#cardGallery{position:fixed;inset:0;z-index:20000;background:#151a18;color:#ecdfc4;display:flex;flex-direction:column;overscroll-behavior:contain;isolation:isolate}
.gallery-head{padding:14px max(15px,env(safe-area-inset-left)) 12px;display:flex;justify-content:space-between;gap:12px;align-items:center;border-bottom:1px solid #63573d;background:#202521}
.gallery-brand{font-size:clamp(17px,3.5vw,25px);color:#dac38c;letter-spacing:.1em}
.gallery-head small{display:block;font:11px/1.6 sans-serif;letter-spacing:.06em;color:#aba48f}
.gallery-controls{padding:10px 16px;display:flex;gap:12px;align-items:center;flex-wrap:wrap;border-bottom:1px solid #514b3b;background:#24251f}
.gallery-controls label{display:flex;align-items:center;gap:8px;font:12px sans-serif}
.gallery-controls select{padding:7px 9px;min-width:145px}
.gallery-controls output{font:12px sans-serif;color:#c5b28c}
.gallery-scroll{flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;padding:18px 15px calc(30px + env(safe-area-inset-bottom))}
.gallery-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(135px,1fr));gap:18px 12px;max-width:1200px;margin:0 auto;align-items:start}
.gallery-tile{background:transparent;border:none;padding:0 0 6px;min-width:0;display:flex;flex-direction:column;align-items:center;gap:7px;color:#ddd0ad;box-shadow:none}
.gallery-tile:hover{background:transparent}
.gallery-tile > :is(img,svg.card-art){width:100%;height:auto;max-width:210px;aspect-ratio:2/3;flex:none;object-fit:contain;display:block;border-radius:5px;box-shadow:0 7px 13px #0009}
.gallery-tile > span{font:12px/1.4 'Yu Mincho',serif;text-align:center}
.gallery-tile:focus-visible :is(img,svg.card-art){outline:3px solid #dbbf7c;outline-offset:3px}
.gallery-lightbox[hidden]{display:none!important}
.gallery-lightbox{position:absolute;inset:0;z-index:2;background:#080b0bea;display:flex;flex-direction:column;align-items:center;padding:10px 8px calc(10px + env(safe-area-inset-bottom));gap:6px}
.gallery-lightbox-bar{width:min(96%,700px);display:flex;align-items:center;gap:8px;justify-content:space-between}
.gallery-lightbox-bar strong{font-size:15px;color:#e0c58e}
.gallery-lightbox-view{display:flex;align-items:center;justify-content:center;gap:8px;min-height:0;flex:1;width:100%}
.gallery-lightbox-view :is(img,svg.card-art){display:block;width:auto;height:auto;max-height:100%;max-width:min(76vw,500px);object-fit:contain;box-shadow:0 8px 30px #000a;border-radius:8px}
.gallery-lightbox-view button{flex:none;min-width:37px;padding:9px 5px;font-size:20px}
@media(max-width:500px){.gallery-head{padding-top:calc(10px + env(safe-area-inset-top))}.gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:15px 11px}.gallery-scroll{padding:12px 12px 50px}.gallery-lightbox-view :is(img,svg.card-art){max-width:calc(100vw - 108px)}.gallery-controls{gap:8px}.gallery-controls label{flex:1}.gallery-controls select{min-width:0;flex:1}}
.face-preferences{display:flex;flex-wrap:wrap;gap:12px;padding:10px 16px;background:#24251f;border-bottom:1px solid #514b3b}.face-preferences label{display:flex;gap:8px;align-items:center;font:12px sans-serif}.face-preferences select{padding:6px}.tarot-face-art{object-fit:fill!important}
.zone-label.unified-label{color:#e2cc96!important;text-decoration:none!important;border:1px solid #927849;background:#22291ff0;font:11px/1.25 sans-serif;padding:3px 6px;border-radius:4px;transform:translate(-50%,-100%)!important;max-width:min(240px,calc(100vw - 24px));white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;z-index:var(--table-label-z,1)!important;pointer-events:none}
#tableLabelMode{min-height:38px;max-width:100%;color:#e2cc96}.table-card-view{display:flex;justify-content:center;padding:6px 0 18px}.table-card-view :is(img,svg.card-art){height:auto;max-height:65vh;max-width:100%;width:auto;aspect-ratio:2/3;object-fit:contain;border-radius:6px}.gallery-lightbox-bar{flex-wrap:wrap}.gallery-lightbox-view :is(img,svg.card-art){max-width:min(80vw,600px)}

.modal-bg{z-index:21000}.detail-body{display:flex;align-items:center;justify-content:center;gap:24px;min-width:0;min-height:0}.detail-copy[hidden]{display:none!important}.detail-copy{border:0;background:transparent;box-shadow:none;max-height:65vh;overflow:auto;width:min(32vw,380px);min-width:220px;padding:12px 8px;text-align:left}.card-prose{white-space:pre-wrap;overflow-wrap:anywhere;font:16px/1.95 'Yu Mincho','Hiragino Mincho ProN',serif;color:#e7d9bd}.card-source{font:12px/1.7 sans-serif;color:#b2a68c;white-space:pre-wrap}.gallery-lightbox-view .detail-body{flex:1;max-height:100%}.gallery-lightbox-view .has-copy :is(img,svg.card-art){max-width:42vw}.table-card-view.has-copy :is(img,svg.card-art){max-width:50%}.gallery-lightbox-bar button{font-size:12px;padding:7px}#labelPlacement{min-height:38px}@media(max-width:700px){.detail-body.has-copy{flex-direction:column;overflow:auto;justify-content:flex-start}.detail-copy{width:100%;min-width:0;max-height:none;flex:none;padding:15px 5px}.gallery-lightbox-view .has-copy :is(img,svg.card-art),.table-card-view.has-copy :is(img,svg.card-art){max-width:100%;max-height:60vh;flex:none}.gallery-lightbox-view{align-items:stretch}.gallery-lightbox-view button{align-self:center}.table-card-view.has-copy{max-height:76vh}.card-prose{font-size:15px}}

/* Keep gallery controls outside the bounded artwork viewport. */
.gallery-lightbox{display:grid;grid-template-rows:auto minmax(0,1fr);align-items:stretch;overflow:hidden;box-sizing:border-box;height:100%;height:100dvh}
.gallery-lightbox-bar{position:relative;z-index:3;justify-self:center;box-sizing:border-box;background:#101511;flex-shrink:0;padding:4px 0}
.gallery-lightbox-view{height:100%;min-height:0;overflow:hidden;box-sizing:border-box}
.gallery-lightbox-view .detail-body{height:100%;max-height:100%;min-height:0;overflow:auto;box-sizing:border-box}
.gallery-lightbox-view .detail-body>:is(img,svg.card-art){height:auto;width:auto;max-height:100%;object-fit:contain;min-height:0;flex-shrink:1}
@media(max-width:700px){.gallery-lightbox-view .detail-body.has-copy>:is(img,svg.card-art){max-height:55dvh;flex-shrink:0}.gallery-lightbox-bar{width:100%;gap:5px}.gallery-lightbox-bar strong{flex-basis:100%}}

#inspectCards{display:inline-flex;align-items:center;justify-content:center;gap:9px}
#inspectCards[aria-pressed="true"]{background:#80683d;color:#fff0cc;border-color:#e0c48b;box-shadow:inset 0 0 0 1px #d5b77c}
.card-inspection-mode #zone .card.faceup,.card-inspection-mode #zone .card.faceup *{cursor:zoom-in!important}
.card-inspection-mode #zone .card{touch-action:pan-x pan-y}
.card-inspection-mode #zone .card:not(.faceup),.card-inspection-mode #zone .card:not(.faceup) *{cursor:help!important}
.card-inspection-mode #zone .card.faceup:hover,.card-inspection-mode #zone .card.faceup:focus-visible{outline:2px solid #e2c384;outline-offset:4px}
.table-reading-context{margin:0 0 12px;padding:10px 13px;border-left:2px solid #b79a65;background:#b79a650c}
.table-reading-context strong{display:block;color:#e9d5a9;font-size:16px;line-height:1.6}
.table-reading-context p{margin:3px 0 0;color:#c6bca7;font-size:13px;line-height:1.7}
.card-viewer-active .table-card-view{animation:cardUnveil .24s ease-out both}
@keyframes cardUnveil{from{opacity:0;transform:translateY(9px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(prefers-reduced-motion:reduce){.card-viewer-active .table-card-view{animation:none}}


/* Keep the reading controls outside the scrolling artwork and explanation. */
.modal-bg.card-viewer-active{padding:8px;box-sizing:border-box}
.modal-bg.card-viewer-active .modal{height:calc(100dvh - 16px);max-height:96dvh;width:min(960px,96vw);box-sizing:border-box;position:relative;display:flex;flex-direction:column;overflow:hidden;padding:20px 22px}
.card-viewer-active #modalContent{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
.card-viewer-active #modalContent>h2{flex:none;margin:0 32px 10px 0;line-height:1.5;font-size:20px}
.card-viewer-active .table-reading-context{flex:none;margin:0 0 10px;padding:8px 12px;max-height:18dvh;overflow:auto}
.card-viewer-active .table-card-view{flex:1;min-height:0;max-height:none;height:100%;overflow:auto;padding:4px 0 12px;box-sizing:border-box;align-items:center}
.card-viewer-active .table-card-view>:is(img,svg.card-art){max-height:100%;max-width:100%;height:auto;width:auto;object-fit:contain;flex-shrink:1}
.card-viewer-active .table-card-view.has-copy>:is(img,svg.card-art){max-width:48%}
.card-viewer-active .table-card-view .detail-copy{max-height:100%;box-sizing:border-box;flex:1;min-width:0;padding:10px 8px}
.table-card-footer{flex:none;padding-top:8px;border-top:1px solid #b79a6540}
.table-card-footer .row{display:flex;gap:6px;margin:0 0 5px}
.table-card-footer .row button{flex:1;min-width:0;min-height:40px;padding:7px 5px}
.table-card-footer>button{font-size:12px;padding:5px 8px}
@media(max-width:700px){
 .modal-bg.card-viewer-active .modal{width:100%;max-width:100%!important;max-height:calc(100dvh - 16px);padding:14px 15px}
 .card-viewer-active .table-card-view.has-copy{flex-direction:column;align-items:center;justify-content:flex-start;gap:12px;overflow:auto}
 .card-viewer-active .table-card-view.has-copy>:is(img,svg.card-art){max-width:100%;max-height:52dvh;flex:none}
 .card-viewer-active .table-card-view .detail-copy{width:100%;max-height:none;flex:none;padding:7px 3px}
 .card-viewer-active .table-card-view:not(.has-copy)>:is(img,svg.card-art){max-height:100%;max-width:100%}
}

.card-viewer-active .modal>.close{position:absolute;top:12px;right:12px;width:34px;height:34px;min-width:0;min-height:0;padding:0;z-index:2}


/* Camera transforms the complete tabletop without changing card layout. */
#stage.mobile-camera-enabled{touch-action:none;overflow:hidden;overscroll-behavior:contain}
#surface{transform-origin:50% 50%;will-change:transform}
#stage.camera-moving,#stage.camera-moving *{cursor:grabbing!important}
#stage.camera-pan-mode,#stage.camera-pan-mode *{cursor:grab!important}
#stage.camera-pan-mode .card{touch-action:none!important}
#tableZoomLabel{font:11px sans-serif;min-width:40px;text-align:center;color:#d8c496}
.toolbar #zoomReset{width:auto;min-width:50px;flex:0 0 auto;font-size:11px;white-space:nowrap}
#tablePanToggle[hidden],.camera-help[hidden],#tableZoomLabel[hidden],.camera-card-size[hidden]{display:none!important}
#tablePanToggle[aria-pressed="true"]{background:#80683d;color:#fff0cc;border-color:#e0c48b}
.camera-help{font:11px/1.5 sans-serif;color:#c0b299;padding:6px 14px;background:#202a25}
@media(max-width:780px){.camera-help{order:2}}


/* Desktop zoom changes only the contents of a fixed tabletop viewport. */
@media(min-width:781px){
 body.pc-table-view .shell>.main{height:auto;min-height:100dvh;min-width:0;position:static;overflow:visible;scrollbar-gutter:auto;overscroll-behavior:auto}
 body.pc-table-view .main>.toolbar{position:sticky;top:0;z-index:6000;width:100%;max-width:100%}
 body.pc-table-view .stage-shell{flex:none;height:calc(var(--desktop-table-width) + 40px);min-height:0;overflow:hidden}
 body.pc-table-view #stage{overflow:hidden;touch-action:auto;cursor:default}
 body.pc-table-view #surface{width:var(--desktop-table-width);height:var(--desktop-table-width);max-height:none;will-change:auto}
 body.pc-table-expanded #stage{cursor:grab}
 body.pc-table-dragging #stage,body.pc-table-dragging #stage *{cursor:grabbing!important}
}

/* The upper edge holds viewing tools; secondary reference actions live below. */
.tool-sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.toolbar{gap:7px}
.toolbar .status{min-width:140px;flex:1 1 180px;font-size:11px}
.toolbar .toolbar-icon{position:relative;display:inline-flex!important;align-items:center;justify-content:center;width:42px!important;height:42px;min-width:42px!important;min-height:42px;flex:0 0 42px!important;padding:8px!important;gap:0}
.toolbar #inspectCards>svg{width:23px;height:23px;flex:none}
.toolbar .notebook-tool-icon{width:20px;height:26px}
.toolbar .toolbar-icon::after{content:attr(data-tool-label);position:absolute;left:50%;top:calc(100% + 7px);transform:translateX(-50%);padding:5px 8px;border:1px solid #8c7954;border-radius:4px;background:#18221f;color:#ecdfc3;white-space:nowrap;font:12px/1.4 sans-serif;pointer-events:none;opacity:0;z-index:100}
@media(hover:hover){.toolbar .toolbar-icon:hover::after{opacity:1}}
.toolbar .toolbar-icon:focus-visible::after{opacity:1}
.toolbar #newSessionStandalone{margin-left:0;min-height:42px;padding:8px 12px;flex:0 0 auto;white-space:nowrap;font-size:12px}
#mobileTableFit[hidden]{display:none!important}
#mobileTableFit{min-height:42px}
#cardGalleryOpen{display:inline-flex;justify-content:center;align-items:center;gap:7px}
.card-size-details{margin-top:8px}
.card-size-content{padding:0 11px 12px;display:grid;gap:9px}
.card-size-content .mini{margin:0}
.card-size-content input[type="range"]{width:100%}
.card-size-buttons button{min-height:38px}
@media(max-width:780px){
 .toolbar{gap:6px;padding:8px 12px}
 .toolbar .status{flex:1 0 100%;min-width:0;font-size:11px}
 .toolbar #newSessionStandalone{flex:1 1 auto;min-width:90px;font-size:12px;margin-left:auto}
 #tableZoomLabel{min-width:36px;font-size:10px}
 .table-utility-actions button:first-child{grid-column:auto}
}


/* Three compact scene views form one control, distinct from card inspection. */
.toolbar #newSessionStandalone{min-width:148px;min-height:46px;font-size:14px;letter-spacing:.06em;padding:10px 18px;border-color:#c4a369;box-shadow:inset 0 1px 0 #fff1}
.toolbar #inspectCards>svg{width:26px;height:26px}
@media(max-width:780px){.toolbar #newSessionStandalone{min-width:120px;min-height:44px;padding:9px 12px;font-size:13px}}



/* A single distance control, without visible magnification numbers. */
#tableZoomLabel{display:none!important}
aside .section #cardGalleryOpen{width:100%;min-height:40px;justify-content:center;font-size:12px;background:#2a352d;border-color:#75684e;margin:0 0 4px}


#spreadNotebook[aria-pressed="true"]{background:#80683d;border-color:#e0c48b;box-shadow:inset 0 0 0 1px #d5b77c}
#desktopTableViews{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));align-items:center;gap:2px;width:204px;height:46px;flex:0 0 204px;box-sizing:border-box;padding:3px;border:1px solid #776b50;border-radius:6px;background:#202a25}
#desktopTableViews[hidden]{display:none!important}
#desktopTableViews>button{display:grid;place-items:center;box-sizing:border-box;width:100%;min-width:0;height:38px;min-height:0;margin:0;padding:0;border:1px solid transparent;border-radius:3px;background:transparent;color:#d8c393;cursor:pointer;line-height:1}
#desktopTableViews>button:hover{background:#354238}
#desktopTableViews>button[aria-pressed="true"]{background:#80683d;border-color:#b99b64;color:#fff0cc}
#desktopTableViews>button:focus-visible{outline:2px solid #d7bd7e;outline-offset:-2px}
#desktopTableViews>button>svg{display:block;width:var(--card-icon-width);height:var(--card-icon-height);pointer-events:none}
@media(min-width:781px){
 body.pc-table-view .shell>aside{position:sticky;top:0;height:100dvh!important;max-height:100dvh!important;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior-y:contain;align-self:start;scrollbar-gutter:stable}
}

#altar{pointer-events:none;z-index:2700}
#altar.hidden{display:none!important}
#altar .altar-object{position:absolute;width:calc(76px * var(--candle-scale,1));height:calc(133px * var(--candle-scale,1));transform:translate(-50%,-94%);padding:0;margin:0;min-width:0;background:none;border:0;border-radius:0;box-shadow:none;pointer-events:auto;touch-action:none;cursor:grab;overflow:visible}
#altar .altar-object:active{cursor:grabbing}
#altar .altar-object>svg{display:block;width:100%;height:100%;overflow:visible;filter:drop-shadow(2px 3px 2px #0003)}
#altar .altar-object:focus-visible{outline:1px solid #d8ba79;outline-offset:3px}
#altar .altar-object[aria-pressed="true"]:after{content:'';position:absolute;left:20%;bottom:1%;width:60%;height:8%;border:1px solid #d8ba7999;border-radius:50%;pointer-events:none}
.candle-flame{transform-origin:60px 42px;animation:altarFlame 2.7s ease-in-out infinite alternate}
@keyframes altarFlame{0%,100%{transform:rotate(-2deg) scaleY(.97);opacity:.92}45%{transform:rotate(2deg) scaleY(1.04);opacity:1}70%{transform:rotate(-1deg) scaleY(1)}}
@media(prefers-reduced-motion:reduce){.candle-flame{animation:none}}
@media(max-width:780px){#altar .altar-object{width:calc(54px * var(--candle-scale,1));height:calc(95px * var(--candle-scale,1))}}
@media(max-width:780px){#surface.celtic-spread .table-zone{top:6%;height:88%}}
 .toolbar-card-size{display:inline-flex;align-items:center;gap:5px;padding:3px 6px;border:1px solid #525443;border-radius:5px;min-width:0}.toolbar-card-size #cardSizeQuickValue{display:inline-block;min-width:43px;text-align:center;font:12px sans-serif;font-variant-numeric:tabular-nums;color:#e8ddc5}.toolbar-card-size button{padding:5px 8px;min-height:30px}.toolbar-card-size #zoomReset{font-size:11px}@media(max-width:780px){.toolbar-card-size{flex:0 1 auto;justify-content:center}} .toolbar-spread-shortcut{display:inline-flex;align-items:center;gap:6px;min-width:0;font-size:12px;white-space:nowrap;color:#d6c9a6}.toolbar-spread-shortcut select{max-width:170px;min-width:110px;padding:7px 22px 7px 8px;font-size:12px;text-overflow:ellipsis}@media(max-width:780px){.toolbar-spread-shortcut{flex:1 1 140px}.toolbar-spread-shortcut select{width:100%;max-width:190px;min-width:95px}} #numberCardStyleField[hidden]{display:none!important} /* Compact desktop tools and a two-row mobile control surface. */
#desktopTableViews{grid-template-columns:22px repeat(4,minmax(0,1fr));width:180px;flex:0 0 180px;gap:2px}
#desktopTableViews .table-view-label{font:12px Georgia,'Yu Mincho',serif;color:#d8c393;text-align:center;align-self:center}
@media(max-width:780px){
  aside header{padding:calc(8px + env(safe-area-inset-top,0px)) 12px 8px!important;min-height:0}
  aside header .tabula-brand{display:flex;flex-direction:row;align-items:baseline;justify-content:center;gap:12px;margin:0!important}
  aside header .tabula-brand h1{font-size:23px;letter-spacing:.16em;padding-left:0;line-height:1.2}
  aside header .tabula-series{width:auto;max-width:none;margin:0;font-size:10px;letter-spacing:.2em;gap:0}
  aside header .tabula-series:before,aside header .tabula-series:after{display:none}
  aside header .tabula-series span{padding:0}
  aside header>.version,aside header>p.mini{display:none}
  .toolbar{display:grid!important;grid-template-columns:repeat(12,minmax(0,1fr));gap:5px!important;padding:6px 9px 8px!important;align-items:center}
  .toolbar .status{grid-column:1/-1;min-width:0!important;flex:none!important;margin:0!important;font-size:10px!important;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #mobileTableFit{grid-column:1/span 2;justify-self:stretch;min-width:0;min-height:36px;height:36px;padding:4px!important;font-size:12px}
  .toolbar-card-size{grid-column:3/-1;justify-self:stretch;justify-content:center;min-height:36px;gap:5px;padding:2px 4px}
  .toolbar-card-size button{min-width:32px;height:34px;padding:4px 7px!important}
  .toolbar-card-size #zoomReset{min-width:44px}
  .toolbar-spread-shortcut{grid-column:1/span 4;min-width:0;gap:4px;font-size:0}
  .toolbar-spread-shortcut span{display:none}
  .toolbar-spread-shortcut select{width:100%;max-width:none;min-width:0;min-height:38px;font-size:12px}
  .toolbar #inspectCards,.toolbar #spreadNotebook{width:36px!important;min-width:0!important;height:38px!important;min-height:38px!important;flex:none!important;padding:6px!important}
  .toolbar #inspectCards{grid-column:5/span 2;justify-self:center}
  .toolbar #spreadNotebook{grid-column:7/span 2;justify-self:center}
  .toolbar #newSessionStandalone{grid-column:9/-1;min-width:0!important;width:100%;min-height:38px!important;height:38px!important;padding:4px 5px!important;margin:0!important;font-size:11px!important;letter-spacing:0;white-space:normal;line-height:1.2}
  #desktopTableViews,#tableZoomLabel{display:none!important}
}
@media(min-width:781px){#desktopTableViews{width:180px;flex-basis:180px}}
/* Shared labels and safe sizing of mobile toolbar actions. */
#desktopTableViews .table-view-label,.toolbar-card-size .toolbar-size-label,.toolbar-spread-shortcut>span{font-family:Arial,'Hiragino Kaku Gothic ProN','Yu Gothic',sans-serif;font-size:12px;font-weight:400;line-height:1.2;letter-spacing:0;color:#d6c9a6}
@media(max-width:780px){.toolbar #inspectCards,.toolbar #spreadNotebook{box-sizing:border-box;max-width:100%;overflow:hidden}.toolbar .toolbar-icon{margin:0!important}.toolbar .toolbar-spread-shortcut{max-width:100%}.toolbar .toolbar-spread-shortcut select{box-sizing:border-box}.toolbar .toolbar-card-size{max-width:100%;box-sizing:border-box}}
/* Keep desktop toolbar inline; mobile uses a self-contained, stable 4-column cockpit row. */
.mobile-cockpit-actions{display:contents}
@media(max-width:780px){
  .toolbar .mobile-cockpit-actions{display:grid!important;grid-column:1/-1;grid-template-columns:minmax(0,1fr) 46px 46px minmax(0,1fr);gap:6px;align-items:stretch;width:100%;min-width:0}
  .toolbar .mobile-cockpit-actions>.toolbar-spread-shortcut{grid-column:1;display:flex;min-width:0;width:100%;max-width:none;align-items:stretch}
  .toolbar .mobile-cockpit-actions>.toolbar-spread-shortcut select{width:100%;max-width:100%;min-width:0;height:44px;min-height:44px;padding:6px 19px 6px 8px;font-size:12px;overflow:hidden;text-overflow:ellipsis}
  .toolbar .mobile-cockpit-actions>#inspectCards{grid-column:2}
  .toolbar .mobile-cockpit-actions>#spreadNotebook{grid-column:3}
  .toolbar .mobile-cockpit-actions>#inspectCards,.toolbar .mobile-cockpit-actions>#spreadNotebook{justify-self:stretch;align-self:stretch;width:100%!important;min-width:0!important;max-width:100%!important;height:44px!important;min-height:44px!important;padding:7px!important;margin:0!important;box-sizing:border-box}
  .toolbar .mobile-cockpit-actions>#newSessionStandalone{grid-column:4;width:100%!important;min-width:0!important;height:44px!important;min-height:44px!important;margin:0!important;padding:6px 4px!important;font-size:12px!important}
}

/* About: calm, centered application credits in the existing modal system. */
.aside-help-area .aside-help-button+.aside-help-button{margin-top:9px}
.about-panel{text-align:center;font-family:Georgia,'Yu Mincho',serif;color:#eadfc9;padding:4px 0 8px}
.about-panel .about-icon{display:block;width:84px;height:84px;margin:0 auto 18px;object-fit:contain;border-radius:17px}
.about-panel h2{font:normal 25px/1.3 Georgia,'Yu Mincho',serif;letter-spacing:.11em;color:#eddbb1;margin:0 0 8px}
.about-panel .about-subtitle{font:12px/1.6 Georgia,serif;letter-spacing:.14em;color:#c9b78f;margin:0 0 25px}
.about-panel .about-credits{font:13px/2 sans-serif;color:#d8d0bf;margin:0}
.about-panel .about-credits a,.about-panel .about-license{color:#e4ca95}
.about-panel .about-divider{width:70px;height:1px;background:#75674c;border:0;margin:21px auto}
.about-panel .about-meta{font:12px/1.9 sans-serif;color:#bcb29f;margin:0}
.about-panel .about-license{border:0;background:transparent;padding:9px 6px;margin:18px 0 0;text-decoration:underline;text-underline-offset:4px;font:12px/1.5 sans-serif;cursor:pointer}
.about-legal{font:13px/1.85 sans-serif;color:#ded4bf}
.about-legal h2{font:normal 19px/1.5 Georgia,'Yu Mincho',serif;color:#e4ca95}
.about-legal a{color:#e4ca95}
.about-back{margin-top:20px}

/* Movable pile: handle-only dragging preserves normal drag-to-deal gestures. */
.table-surface .deck .deck-move-handle{position:absolute;top:-13px;right:-13px;z-index:8;width:29px;height:29px;min-width:29px;min-height:29px;border:1px solid #c9ab75;border-radius:50%;background:#26382f;color:#e4c98e;font:19px/1 Georgia,serif;display:grid;place-items:center;cursor:move;touch-action:none;user-select:none;-webkit-user-select:none;box-shadow:0 2px 7px #0009;padding:0;opacity:.92}
.table-surface .deck .deck-move-handle:hover,.table-surface .deck .deck-move-handle:focus-visible{background:#3d5647;outline:2px solid #d6b980;outline-offset:2px}

/* Quick label visibility in the card-size toolbar; the detailed label selector stays available. */
.toolbar-card-size #toolbarLabelToggle{min-width:51px;white-space:nowrap;font:11px/1.2 Arial,sans-serif;padding:5px 6px;border-color:#7d704f;color:#e8d2a1}
.toolbar-card-size #toolbarLabelToggle[aria-pressed="false"]{color:#a9a59a;border-color:#50534c;background:#262b27}
@media(max-width:780px){.toolbar-card-size #toolbarLabelToggle{min-width:47px;padding:4px!important;font-size:10px}.toolbar-card-size{gap:4px}.toolbar-card-size .toolbar-size-label{font-size:11px}}
@media print{.table-surface .deck .deck-move-handle{display:none!important}}

/* User-configurable label cycle: one compact tabletop action and a settings drawer. */
.label-cycle-settings{flex:1 1 100%;min-width:0;border:1px solid #69614d;border-radius:5px;padding:6px 9px;color:var(--ui-text,#eadfc9)}
.label-cycle-settings summary{cursor:pointer;font-size:13px;color:var(--ui-accent,#d6c29d);user-select:none}
.label-cycle-settings .mini{margin:8px 0 6px}
.label-cycle-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 12px;padding:4px 0 7px}
.label-cycle-options label{display:flex;align-items:center;gap:6px;white-space:nowrap;font-size:12px;cursor:pointer}
.label-cycle-options input{accent-color:#b59b6b}
.label-cycle-placement{display:flex;align-items:center;gap:9px;font-size:12px;margin-top:5px}
.label-cycle-placement select{min-width:100px}
#tableLabelMode[hidden]{display:none!important}
.toolbar-card-size #toolbarLabelToggle{min-width:66px;max-width:94px;font-size:11px;color:#e8d2a1}
.toolbar-card-size #toolbarLabelToggle[data-label-mode="off"]{color:#a9a59a}
@media(max-width:780px){.toolbar-card-size #toolbarLabelToggle{min-width:57px;max-width:82px;font-size:10px;padding-inline:4px!important}}

/* The label settings disclosure uses the same button surface as its neighbors. */
.table-utility-actions .label-cycle-settings{flex:1 1 30%;width:auto;min-width:0;margin:0;padding:0;border:0;border-radius:0;background:transparent;color:inherit;box-sizing:border-box}
.table-utility-actions .label-cycle-settings>summary{position:relative;display:flex;align-items:center;justify-content:center;min-height:43px;width:100%;box-sizing:border-box;padding:8px 22px 8px 10px;border:1px solid #53614f;border-radius:5px;background:#29332c;color:#c7cdbd;font:inherit;font-size:12px;line-height:1.3;list-style:none;white-space:normal;cursor:pointer;text-align:center;word-break:keep-all}
.table-utility-actions .label-cycle-settings>summary::-webkit-details-marker{display:none}
.table-utility-actions .label-cycle-settings>summary::after{content:"▾";position:absolute;right:10px;top:50%;transform:translateY(-50%);font-size:11px;opacity:.85}
.table-utility-actions .label-cycle-settings[open]>summary::after{content:"▴"}
.table-utility-actions .label-cycle-settings>summary:hover{background:#4b4b3d}
.table-utility-actions .label-cycle-settings>summary:focus-visible{outline:2px solid #d6b980;outline-offset:2px}
.table-utility-actions .label-cycle-settings[open]{padding-bottom:9px;border:1px solid #827357;border-radius:6px;background:#28342d}
.table-utility-actions .label-cycle-settings[open]>summary{border-width:0 0 1px;border-radius:5px 5px 0 0}
.table-utility-actions .label-cycle-settings[open]>.mini,.table-utility-actions .label-cycle-settings[open]>.label-cycle-options,.table-utility-actions .label-cycle-settings[open]>.label-cycle-placement{margin-left:12px;margin-right:12px}
.table-utility-actions .label-cycle-settings .label-cycle-options label{white-space:normal}
@media(max-width:780px){
 .table-utility-actions .label-cycle-settings{grid-column:1;min-width:0;width:100%}
 .table-utility-actions .label-cycle-settings[open]{grid-column:1/-1}
 .table-utility-actions .label-cycle-settings>summary{min-height:43px;padding:8px 23px 8px 9px;font-size:12px}
}

/* Compact split-action dropdowns: retain the five-column tabletop toolbar. */
.table-shortcuts .quick-action-choice{position:relative;min-width:0;display:flex;align-items:stretch}
.table-shortcuts .quick-action-choice>button{width:100%;padding-right:29px}
.table-shortcuts .quick-action-choice>select{position:absolute;right:0;top:0;height:100%;width:27px;min-width:0;max-width:27px;margin:0;padding:0;box-sizing:border-box;appearance:none;-webkit-appearance:none;border:0;border-left:1px solid #857352;background:transparent;color:transparent;font-size:0;cursor:pointer;z-index:2}
.table-shortcuts .quick-action-choice>select option{color:#1b2421;background:#f1dfbd;font-size:14px}
.table-shortcuts .quick-action-choice::after{content:'▾';position:absolute;right:8px;top:50%;transform:translateY(-50%);font:16px/1 sans-serif;color:var(--ui-text,#f0dfbf);pointer-events:none;z-index:3}

/* Tabletop execution row and compact settings row */
.table-shortcuts .quick-action-choice{display:contents}
.table-shortcuts .quick-action-choice>button{width:100%;padding-right:4px}
.table-shortcuts .quick-action-choice>select{position:static;display:none}
.table-shortcuts .quick-action-choice::after{display:none}
.table-active-recipe[hidden]{display:none!important}
.table-action-settings{display:grid;grid-template-columns:1.25fr 1.1fr .8fr 1.1fr;gap:10px;padding:8px 10px;background:#202b25;border-bottom:1px solid #5d5b46;color:#e8d3a7;font:12px Georgia,'Yu Mincho',serif}
.table-action-settings>label{display:flex;align-items:center;gap:7px;min-width:0;white-space:nowrap}
.table-action-settings select{min-width:0;max-width:100%;width:100%;padding:5px 18px 5px 6px;border:1px solid #857352;border-radius:4px;background:#2f3a32;color:#f0dfbf;font:12px Georgia,'Yu Mincho',serif}
.table-action-settings label>span:not(.table-wash-controls){flex:1;min-width:0}
.table-action-settings .table-wash-controls{display:flex;flex:1;gap:4px;min-width:0}
.table-action-settings #tableWashRounds{max-width:65px}
.table-action-settings #quickShuffleChoice,.table-action-settings #quickDealChoice{display:block;position:static;appearance:auto;-webkit-appearance:menulist;font-size:12px;color:#f0dfbf;max-width:100%;height:auto;min-width:0;cursor:pointer}
@media(max-width:780px){.table-action-settings{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding:8px 6px}.table-action-settings>label{font-size:11px}.table-action-settings select{font-size:11px}}

/* v0.120: visually separate primary card actions, settings, table utilities and records. */
.table-action-settings{grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;padding:5px 10px 12px;background:var(--ui-tool,#1b2421);border-bottom:0}
.table-action-settings>label,.table-action-settings>.table-open-placeholder{min-width:0;width:100%;box-sizing:border-box;display:flex;align-items:center;height:30px}
.table-action-settings>label{gap:0}
.table-action-settings select{height:30px;min-height:30px;padding:4px 19px 4px 7px;background:#202a25;border-color:#485849;color:#bfc7b8;font-size:11px}
.table-action-settings .table-wash-controls{width:100%;gap:4px}
.table-action-settings #tableWashRounds{width:58px;flex:0 0 58px}
.table-action-settings #quickShuffleChoice,.table-action-settings #quickDealChoice{height:30px;min-height:30px;font-size:11px;background:#202a25;border-color:#485849;color:#bfc7b8}
.table-action-settings .table-open-placeholder{border:1px solid #303d33;border-radius:4px;background:transparent;opacity:.45}
.table-utility-actions{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;padding:13px 10px 7px;border-top:1px solid #4d594c;background:var(--ui-tool,#1b2421)}
.table-utility-actions button{width:100%;min-width:0;min-height:36px;box-sizing:border-box;flex:none;padding:6px 4px;font-size:11px;background:#29332c;border-color:#53614f;color:#c7cdbd;white-space:nowrap}
.results-toggle-bar{padding:12px 10px 4px;border-top:1px solid #4d594c}
.results-toggle-bar button{min-height:32px;font-size:11px}
.table-record-actions{gap:7px;padding:6px 10px 12px}
.table-record-actions button{min-height:36px;font-size:11px;background:#262e28;border-color:#786e55}
@media(max-width:780px){
.table-action-settings{order:3;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:7px 8px 10px}
.table-action-settings .table-open-placeholder{display:none}
.table-action-settings>label{height:auto;display:flex;flex-direction:column;align-items:stretch;gap:5px}
.table-action-settings>label::before{font:11px/1.3 Arial,'Hiragino Kaku Gothic ProN',sans-serif;color:var(--ui-text,#d6c9a6);opacity:.85}
.table-action-settings>label:nth-child(1)::before{content:'ウォッシュ'}
.table-action-settings>label:nth-child(2)::before{content:'シャッフル'}
.table-action-settings>label:nth-child(3)::before{content:'カット'}
.table-action-settings>label:nth-child(4)::before{content:'ディール'}
.table-utility-actions{grid-template-columns:repeat(3,minmax(0,1fr));padding:12px 8px 7px}
.table-utility-actions button,.table-utility-actions button:first-child{grid-column:auto;min-height:38px}
.table-record-actions button{min-height:42px}
}

/* v0.121: text hierarchy independent of compact settings selectors. */
.table-utility-actions button{font-size:12px;line-height:1.35}
.results-toggle-bar button{font-size:13px;line-height:1.35}
.table-record-actions button{font-size:13px;line-height:1.35;min-height:40px}
@media(max-width:780px){.table-utility-actions button{font-size:12px}.results-toggle-bar button{font-size:12px}.table-record-actions button{font-size:13px}}

/* Hide spread guides while wash or shuffle is visibly in progress. */
.table-surface:has(.shuffle-layer.active) .slot,
.table-surface:has(.shuffle-layer.active) .zone-label,
.table-surface:has(.shuffle-layer.active) .slot-num{visibility:hidden!important}

/* Keep the default deck fully inside the cloth after card-size increases. */
.deck{top:calc(100% - var(--ch) - 25px)}

/* Default deck: use one vertical anchor, safely inside the cloth. */
.deck{top:auto;bottom:25px}

/* Dragged cards use the same full-size back artwork as dealt cards. */
.deck-drag-preview{display:block;box-sizing:border-box;border:0;background:none;overflow:visible}
.deck-drag-preview>.face.back{position:absolute;inset:0;display:block;width:100%;height:100%;box-sizing:border-box;backface-visibility:visible}

/* TABULA dual deck / multiple-table controls */
.dual-mode-bar{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:8px 12px;border:1px solid #776b55;border-radius:8px;background:rgba(16,24,22,.89);color:#ecddbc;margin:8px auto;max-width:1140px}
.dual-mode-bar button,.dual-mode-bar select{font:inherit;font-size:12px;min-height:30px;border:1px solid #998464;border-radius:5px;background:#27352f;color:#f1e4c9;padding:4px 8px}
.dual-mode-bar button:hover{border-color:#d9be86}
.dual-mode-controls{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.dual-mode-controls[hidden]{display:none!important}
.dual-mode-controls label{display:flex;align-items:center;gap:5px;font-size:12px}
.dual-mode-summary{font-size:11px;opacity:.85}
body.dual-enabled #dualToggle{background:#655338;border-color:#d5bb81}
body.dual-enabled .table-zone .card[data-source-deck="B"]{outline:1px solid rgba(157,193,220,.7);outline-offset:2px}
@media(max-width:780px){.dual-mode-bar{margin:4px 5px;padding:6px;gap:5px}.dual-mode-bar button,.dual-mode-bar select{font-size:11px;padding:4px 5px}.dual-mode-controls{gap:5px}.dual-mode-summary{flex-basis:100%}}

/* Desktop: place the dual-deck dock in the spare left margin of the table.
   It is out of document flow, so it never pushes the five main operations below the viewport. */
@media(min-width:781px){
 .main>.toolbar{position:sticky}
 .main>.toolbar .dual-mode-bar{
  position:absolute;top:calc(100% + 12px);left:12px;z-index:10;
  display:flex;flex-direction:column;align-items:stretch;
  width:min(270px,24vw);max-width:270px;box-sizing:border-box;
  margin:0;padding:8px;gap:8px;box-shadow:0 8px 26px #0007;
 }
 .main>.toolbar .dual-mode-bar button{white-space:normal}
 .main>.toolbar .dual-mode-controls{display:grid;grid-template-columns:1fr;gap:7px}
 .main>.toolbar .dual-mode-controls[hidden]{display:none!important}
 .main>.toolbar .dual-mode-controls label{display:flex;justify-content:space-between;gap:8px}
 .main>.toolbar .dual-mode-controls select{min-width:95px}
 .main>.toolbar .dual-mode-summary{font-size:11px;line-height:1.55}
}

/* Two independent physical stocks on the tabletop. The existing A pile keeps its
   original position and move handle; B sits alongside it unless moved manually. */
.dual-second-deck[hidden]{display:none!important}
.dual-second-deck{left:calc(3% + var(--cw) + 24px);top:82%;z-index:5}
.dual-deck-identity{display:none;position:absolute;left:50%;bottom:calc(100% + 7px);transform:translateX(-50%);pointer-events:none;white-space:nowrap;
 font:600 11px/1.2 sans-serif;letter-spacing:.07em;color:#f0dfb9;background:#16251fe8;border:1px solid #9b8259;border-radius:5px;padding:3px 7px;box-shadow:0 3px 8px #0009}
body.dual-enabled .dual-deck-identity{display:block}
body.dual-enabled .deck.dual-selected{outline:2px solid #e0c485;outline-offset:4px}
body.dual-enabled .dual-second-deck:not(.dual-selected){filter:brightness(.88)}
@media(max-width:780px){.dual-second-deck{left:calc(3% + var(--cw) + 14px)}.dual-deck-identity{font-size:10px;padding:2px 5px}}

/* v0.168: keep the two independent stock piles side by side by default.
   Specificity must exceed the legacy .table-surface .deck positioning rules. */
body.dual-enabled .table-surface .deck.dual-second-deck{
 left:calc(6% + var(--cw) + 26px);
 right:auto;top:auto;bottom:25px;
}
body.dual-enabled .table-surface .deck .deck-move-handle{display:grid!important}
@media(max-width:780px){
 body.dual-enabled .table-surface .deck.dual-second-deck{left:calc(5.7% + var(--cw) + 16px)}
}

/* v0.169: Both unmoved stocks share the same baseline. Previous B used 25px
   while A inherited 5.5%, which caused a visible offset at some table sizes. */
body.dual-enabled .table-surface .deck.dual-primary-deck,
body.dual-enabled .table-surface .deck.dual-second-deck{
  top:auto;bottom:5.5%;
}
@media(max-width:780px){
 body.dual-enabled .table-surface .deck.dual-primary-deck,
 body.dual-enabled .table-surface .deck.dual-second-deck{bottom:5.5%}
}


/* v0.289: visible identity for independently configured reading tables. */
.dual-table-identity[hidden]{display:none!important}
.dual-table-identity{
 display:inline-flex;align-items:center;min-height:30px;
 padding:5px 10px;border-left:5px solid #b69a65;
 background:rgba(207,185,137,.10);border-radius:4px;
 font:600 12px/1.3 Georgia,'Yu Mincho',serif;letter-spacing:.04em;
 color:#f1e1c0;
}
#dualTableName{width:112px;max-width:100%;font-size:12px;padding:5px 7px;min-height:30px}


/* v0.290: tables are selected separately from the physical deck controls. */
.dual-mode-bar[hidden],.workspace-switcher[hidden],.dual-stored-controls[hidden]{display:none!important}
.workspace-switcher{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;color:#ddcda9;font-size:12px}
.workspace-switcher select{min-width:94px;max-width:170px;font-size:12px;padding:6px 7px}
.table-workspace-start{display:grid;gap:5px;padding:8px 0 12px}
.table-workspace-start #dualToggle{width:100%;text-align:center}
.dual-stored-controls{display:grid;gap:7px;width:100%;font-size:12px}
.dual-stored-controls span{color:#e9d7b4}
.dual-stored-controls button{width:100%}
@media(max-width:780px){.workspace-switcher select{min-width:92px;max-width:132px}}


/* v0.292: mobile table selector occupies its own row under the status;
   the existing compact toolbar controls retain their original grid tracks. */
@media(max-width:780px){
 .toolbar #workspaceSwitcher:not([hidden]){
  display:flex;grid-column:1/-1;grid-row:auto;
  min-width:0;width:100%;box-sizing:border-box;
  justify-content:flex-start;align-items:center;
  padding:1px 0 3px;gap:8px;
 }
 .toolbar #workspaceSwitcher select{
  width:min(100%,220px);max-width:220px;min-width:0;
  min-height:36px;font-size:12px;
 }
}


/* v0.293: hide deck-B-only controls in a one-deck shared workspace.
   Existing display:flex form rules must not override the hidden attribute. */
.dual-mode-controls label[hidden],
.dual-mode-controls button[hidden],
.table-workspace-start button[hidden]{display:none!important}

/* v0.299: table management is separate from deck selection. */
.table-workspace-start{display:grid;gap:10px;padding:8px 0 14px;min-width:0}
.table-current-chip{display:flex;justify-content:space-between;align-items:center;gap:10px;min-width:0;border:1px solid #655e4a;border-radius:5px;background:rgba(22,31,27,.62);padding:9px 10px}
.table-current-chip strong{font-size:13px;font-weight:600;overflow-wrap:anywhere}
.table-cloth-swatch{display:inline-block;flex:none;width:23px;height:23px;border-radius:5px;border:1px solid #b8a681;box-shadow:inset 0 0 0 2px #ffffff15}
.table-workspace-start button,.table-add-panel select{width:100%;min-width:0}
.table-add-panel{display:grid;gap:10px;padding:10px;border:1px solid #665c49;border-radius:6px;background:rgba(8,13,12,.33);min-width:0}
.table-add-panel[hidden],.table-shared-setup[hidden],.independent-deck-setup[hidden],#tableAddOpen[hidden],#dualDeckFieldsB[hidden]{display:none!important}
.independent-deck-setup,.table-shared-setup{display:grid;gap:9px;min-width:0}
.table-add-panel .field{display:grid;gap:4px;min-width:0}
.table-add-panel select,.table-add-panel button{box-sizing:border-box;max-width:100%;width:100%;white-space:normal}
.table-legacy-options{border-top:1px solid #514936;padding:7px 0 1px}
.table-legacy-options summary{cursor:pointer;font-size:12px;color:#c7b58f}
.table-legacy-inner{display:grid;gap:8px;margin-top:10px}
.table-legacy-options button[hidden]{display:none!important}
.dual-mode-controls{width:100%;min-width:0}
.dual-table-setup,.dual-deck-settings{display:grid;gap:8px;width:100%;min-width:0}
.dual-table-setup label,.dual-deck-fields label{display:grid;grid-template-columns:69px minmax(0,1fr);gap:8px;align-items:center;width:100%;min-width:0;font-size:12px}
.dual-table-setup select,.dual-table-setup input,.dual-deck-fields select{min-width:0;max-width:100%;width:100%}
.table-select-with-color{display:flex;align-items:center;gap:8px;min-width:0}
.table-select-with-color select{flex:1;min-width:0}
.dual-deck-fields{display:grid;gap:7px;min-width:0;padding-top:9px;border-top:1px solid rgba(189,163,116,.26)}
/* The pile selector already has a bottom divider. Avoid a second line above deck A. */
.dual-deck-fields:first-child{border-top:0;padding-top:0}
.dual-deck-fields strong{font-size:12px;color:#dcc89f;font-weight:600}
.dual-table-identity{display:none!important}
@media(max-width:780px){.dual-table-setup,.dual-deck-settings{width:100%}.dual-table-setup label,.dual-deck-fields label{grid-template-columns:64px minmax(0,1fr)}}

/* Respect a full-width name input within the compact table settings. */
.dual-table-setup #dualTableName{width:100%;max-width:100%;min-width:0}
.table-legacy-options[hidden]{display:none!important}

/* v0.301 — the three mutually exclusive workspace modes share one entry point. */
.table-double-setup{display:grid;gap:10px;min-width:0}
.table-double-setup[hidden],.dual-return-main[hidden]{display:none!important}
.table-mode-note{border-left:2px solid #887b64;padding-left:9px;line-height:1.55}
.dual-mode-controls .dual-return-main{display:block;width:100%;text-align:center;background:#3b433b;border:1px solid #988361;color:#f0dfbb;font-weight:600;margin-bottom:3px}
.dual-mode-controls .dual-return-main:hover{background:#4c5548}

/* v0.304: compact table identity and balanced dropdown widths. */
.dual-mode-controls>.dual-pile-field{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,100px);gap:8px;align-items:center;width:100%;min-width:0;padding:7px 0 10px;border-bottom:1px solid rgba(189,163,116,.26);font-size:12px}
.dual-mode-controls>.dual-pile-field select{min-width:0;width:100%;max-width:100%}
.dual-table-setup label{grid-template-columns:52px minmax(0,1fr)}
.dual-deck-fields label{grid-template-columns:54px minmax(0,1fr);padding-right:9px}
@media(max-width:780px){.dual-table-setup label{grid-template-columns:46px minmax(0,1fr)}.dual-deck-fields label{grid-template-columns:48px minmax(0,1fr);padding-right:8px}}

/* v0.305: override the older flex-label layout at the desktop toolbar.
   Without this specific selector, 外観 and 裏面 collapse vertically. */
.main>.toolbar .dual-mode-controls .dual-table-setup label,
.main>.toolbar .dual-mode-controls .dual-deck-fields label{
  display:grid;align-items:center;justify-content:initial;
  grid-template-columns:40px minmax(0,1fr);
  column-gap:7px;min-width:0;width:100%;
  white-space:nowrap;
}
.main>.toolbar .dual-mode-controls .dual-deck-fields label{
  padding-right:7px;
}
.main>.toolbar .dual-mode-controls .dual-table-setup label{
  grid-template-columns:36px minmax(0,1fr);
}
.main>.toolbar .dual-mode-controls .dual-table-setup label input,
.main>.toolbar .dual-mode-controls .dual-table-setup label select,
.main>.toolbar .dual-mode-controls .dual-deck-fields label select{
  display:block;min-width:0;max-width:100%;width:100%;
}
.main>.toolbar .dual-mode-controls>.dual-pile-field{
  display:grid;grid-template-columns:minmax(96px,1fr) minmax(0,110px);
  align-items:center;justify-content:initial;column-gap:7px;
  white-space:nowrap;
}
@media(max-width:780px){
 .main>.toolbar .dual-mode-controls .dual-table-setup label{grid-template-columns:36px minmax(0,1fr)}
 .main>.toolbar .dual-mode-controls .dual-deck-fields label{grid-template-columns:40px minmax(0,1fr)}
}

/* v0.306: mobile always uses the header table picker, while extended workspace
   controls stay collapsed unless the user opens them explicitly. */
#mobileWorkspaceSettingsToggle[hidden]{display:none!important}
#mobileWorkspaceSettingsToggle{display:none}
@media(max-width:780px){
 #dualModeBar{width:auto;min-width:0;margin:4px 5px 6px;box-sizing:border-box}
 #dualModeBar #mobileWorkspaceSettingsToggle:not([hidden]){
  display:flex;align-items:center;justify-content:space-between;
  width:100%;min-height:36px;padding:7px 12px;
  color:#ead8b6;background:#25342e;border:1px solid #8d7a5c;
  border-radius:5px;font-size:12px;text-align:left;
 }
 #dualModeBar #mobileWorkspaceSettingsToggle[aria-expanded="true"] span{transform:rotate(180deg)}
 #dualModeBar #dualControls:not(.mobile-expanded){display:none!important}
 #dualModeBar #dualControls.mobile-expanded{display:flex;flex-direction:column;align-items:stretch;width:100%;gap:8px}
 #dualModeBar .dual-mode-summary{overflow-wrap:anywhere}
}

/* v0.307: the small-screen tabletop controls form a compact, readable sequence.
   The existing JavaScript controls and desktop placement are unchanged. */
@media(max-width:780px){
 .main>.toolbar,.toolbar{
  display:grid!important;
  grid-template-columns:repeat(12,minmax(0,1fr));
  align-items:center;gap:6px;padding:7px 10px;
 }
 .toolbar #workspaceSwitcher:not([hidden]){
  order:0;grid-column:1/-1;grid-row:auto;
  display:flex;align-items:center;gap:8px;
  width:100%;min-width:0;padding:0 0 2px;
  font-size:12px;
 }
 .toolbar #workspaceSwitcher select{
  flex:1 1 auto;width:100%;max-width:none;min-width:0;
  min-height:36px;
 }
 .toolbar #workspaceClothSwatch{
  display:inline-block;flex:none;width:24px;height:24px;
 }
 .toolbar #mobileTableFit:not([hidden]){
  order:1;grid-column:1/4;grid-row:auto;
  width:100%;height:40px;min-height:40px;
  padding:5px 2px!important;
 }
 .toolbar .toolbar-card-size{
  order:1;grid-column:4/-1;grid-row:auto;
  display:flex;align-items:center;justify-content:space-between;
  width:100%;min-width:0;max-width:none;
  min-height:40px;padding:2px 4px;gap:3px;
 }
 .toolbar:has(#mobileTableFit[hidden]) .toolbar-card-size{grid-column:1/-1}
 .toolbar .toolbar-card-size button{flex:0 0 auto;min-width:27px;height:34px;padding:4px 5px!important}
 .toolbar .toolbar-card-size #toolbarLabelToggle{min-width:46px;max-width:75px}
 .toolbar .toolbar-card-size #zoomReset{min-width:42px}
 .toolbar .toolbar-card-size #cardSizeQuickValue{min-width:34px}
 .toolbar .mobile-cockpit-actions{
  order:2;grid-column:1/-1;grid-row:auto;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 44px 44px;
  grid-template-rows:44px 42px;
  gap:6px;width:100%;min-width:0;align-items:stretch;
 }
 .toolbar .mobile-cockpit-actions>.toolbar-spread-shortcut{
  display:flex;grid-column:1;grid-row:1;
  min-width:0;max-width:none;width:100%;align-items:stretch;
 }
 .toolbar .mobile-cockpit-actions>.toolbar-spread-shortcut select{
  width:100%;height:44px;min-height:44px;min-width:0;max-width:none;
 }
 .toolbar .mobile-cockpit-actions>#inspectCards{
  grid-column:2;grid-row:1;width:100%!important;min-width:0!important;
  height:44px!important;min-height:44px!important;
 }
 .toolbar .mobile-cockpit-actions>#spreadNotebook{
  grid-column:3;grid-row:1;width:100%!important;min-width:0!important;
  height:44px!important;min-height:44px!important;
 }
 .toolbar .mobile-cockpit-actions>#newSessionStandalone{
  grid-column:1/-1;grid-row:2;
  width:100%!important;min-width:0!important;
  height:42px!important;min-height:42px!important;
  margin:0!important;padding:7px!important;font-size:13px!important;
  letter-spacing:.03em;
 }
 .toolbar>.status{
  order:3;grid-column:1/-1;grid-row:auto;
  min-width:0!important;min-height:14px;
  max-height:28px;line-height:1.35;font-size:10px!important;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  opacity:.82;margin:0!important;
 }
 .toolbar #desktopTableViews,.toolbar #tableZoomLabel{display:none!important}
}

/* v0.314 — landscape phones: avoid the desktop-width layout, crop unused
   margins around the square table, and provide an escape from touch capture.
   The actual card gesture layer remains untouched. */
.landscape-scroll-controls{display:none}
@media (orientation:landscape) and (max-height:600px) and (pointer:coarse){
 html,body{overflow-x:hidden;overflow-y:auto!important;overscroll-behavior-y:auto}
 .shell{display:flex!important;flex-direction:column!important;align-items:stretch!important;
   min-height:100dvh!important;height:auto!important;overflow:visible!important}
 .shell>aside,.shell>.main{display:contents!important}
 .shell>aside>header{order:0;display:block;min-height:0!important;
   padding:4px 10px!important;text-align:center;background:var(--ui-tool,#242823)}
 .shell>aside>header .tabula-brand{display:flex;justify-content:center;gap:10px;align-items:baseline}
 .shell>aside>header h1{font-size:16px;line-height:1.15}
 .shell>aside>header .tabula-series{font-size:9px}
 .shell>aside>header>.version,.shell>aside>header>p.mini{display:none}
 .shell>.main>.toolbar{order:1;display:flex!important;flex-wrap:wrap;gap:4px!important;
   padding:4px 8px!important;min-height:0!important;width:100%}
 .shell>.main>.toolbar>.status{display:none!important}
 .shell>.main>.toolbar button{min-height:30px;padding:3px 6px!important}
 .shell>.main>.toolbar .toolbar-card-size{min-height:32px;padding:0 3px}
 .shell>.main>.toolbar .toolbar-card-size button{height:30px}
 #dualModeBar{order:2;width:100%;margin:0!important;max-width:100%;padding:2px 8px}
 #dualModeBar #dualControls:not(.mobile-expanded){display:none!important}
 #dualModeBar #mobileWorkspaceSettingsToggle:not([hidden]){display:flex;min-height:30px}
 .shell>.main>.stage-shell{order:3;flex:none!important;position:relative;
   width:100%!important;height:calc(100dvh - 10px)!important;
   min-height:0!important;max-height:520px!important;
   margin:0!important;padding:0!important;overflow:hidden!important}
 .shell>.main>.stage-shell .stage{padding:3px!important}
 .shell>.main>.stage-shell .table-surface{width:min(calc(100dvh - 18px),calc(100vw - 12px),500px)!important;
   height:auto!important;max-height:calc(100dvh - 16px)!important;
   aspect-ratio:1/1!important;flex:none}
 .shell>.main>.stage-shell .cloth{border-width:4px}
 .shell>.main>.stage-shell .cloth:after{inset:6px}
 .shell>.main>.table-card-controls{order:4;width:100%}
 .shell>.main>.camera-help{order:5}
 .shell>.main>.table-shortcuts{order:6;width:100%}
 .shell>.main>.table-action-settings{order:7;width:100%}
 .shell>.main>.table-active-recipe{order:8;width:100%}
 .shell>.main>.table-utility-actions{order:9;width:100%}
 .shell>.main>.results-toggle-bar{order:10;width:100%}
 .shell>.main>.live-results{order:11;width:100%}
 .shell>.main>.table-record-actions{order:12;width:100%}
 .shell>.main>.info{order:13;width:100%}
 .shell>aside>.section{order:15;display:grid!important;width:100%;
   max-height:none!important;overflow:visible!important;
   grid-template-columns:minmax(0,1fr);margin:0!important;padding:10px 12px!important}
 .shell>aside>.aside-help-area{order:20;width:100%}
 .shell>.main>.stage-shell .landscape-scroll-controls{
   display:block;position:absolute;right:max(8px,env(safe-area-inset-right));bottom:8px;
   z-index:950;background:rgba(28,44,36,.94);border:1px solid #c2a471;
   border-radius:6px;min-width:76px;min-height:36px;padding:7px 9px;
   color:#fff1cf;font:600 12px/1.2 sans-serif;
   touch-action:manipulation;box-shadow:0 2px 12px #0009}
 /* Swipe here to scroll normally; it is outside the stage pointer handlers. */
 .shell>.main>.stage-shell .landscape-scroll-controls:active{background:#576344}
}

/* v0.317 — separate gallery deck selection; table settings are not modified. */
.gallery-controls #cardGalleryDeck{max-width:min(270px,78vw);min-width:145px}
@media(max-width:600px){.gallery-controls #cardGalleryDeck{max-width:100%;min-width:0;width:100%}}


/* v0.319 — faithfully enlarge the actual tabletop simple face. */
.gallery-tile>.gallery-simple-face,
.gallery-lightbox-view>.gallery-simple-face{
 position:relative;box-sizing:border-box;display:block;
 aspect-ratio:2/3;background:transparent;border:0;border-radius:4px;
 overflow:hidden;flex:none;
}
.gallery-tile>.gallery-simple-face{width:100%;height:auto;max-width:210px;box-shadow:0 7px 13px #0009}
.gallery-lightbox-view>.gallery-simple-face{width:min(76vw,440px,calc(70dvh * 2 / 3));height:auto;max-height:100%;box-shadow:0 8px 30px #000a}
.gallery-simple-face>.gallery-simple-inner{
 position:absolute!important;left:0!important;top:0!important;right:auto!important;bottom:auto!important;
 box-sizing:border-box;width:90px!important;height:135px!important;
 transform-origin:top left!important;backface-visibility:visible!important;
 margin:0!important;
}
.gallery-tile:focus-visible>.gallery-simple-face{outline:3px solid #dbbf7c;outline-offset:3px}
@media(max-width:500px){.gallery-lightbox-view>.gallery-simple-face{width:min(76vw,calc(62dvh * 2 / 3))}}

/* v0.320 — redesigned simple face. All geometry is based on the original
   tabletop face (90 × 135); the gallery scales this same face uniformly. */
.front .simple-card{position:relative;box-sizing:border-box;width:100%;height:100%;flex:1 1 auto;min-height:0;font-family:Georgia,'Yu Mincho','Hiragino Mincho ProN',serif;color:#3b3025}
.front .simple-major-number{position:absolute;left:3px;right:3px;top:12%;height:24%;display:flex;align-items:center;justify-content:center;font:700 23px/1 Georgia,serif;color:#56432b}
.front .simple-major-number:empty{display:none}
.front .simple-major-name{position:absolute;top:43%;bottom:24%;left:4px;right:4px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;font-family:Georgia,'Yu Mincho','Hiragino Mincho ProN',serif;font-weight:700;line-height:1.17;overflow-wrap:anywhere;text-align:center}
.front .simple-major-name span{display:block;max-width:100%}
.front .simple-major-flourish{position:absolute;bottom:10%;left:0;right:0;text-align:center;font:10px/1 Georgia,serif;color:#987c54}
.front .simple-minor-symbol{position:absolute;top:13%;left:9%;right:9%;height:55%;display:flex;align-items:center;justify-content:center}
.front .simple-minor-symbol svg{display:block;width:100%;height:100%;max-width:60px}
.front .simple-minor-rule{position:absolute;top:73%;left:23%;right:23%;height:1px;background:#b5a27f}
.front .simple-minor-rank{position:absolute;left:3px;right:3px;bottom:7%;height:18%;display:flex;align-items:center;justify-content:center;font:700 25px/1 Georgia,serif;color:#3b3025}

/* Sliding cards must track physics positions immediately; the normal .48s
   left/top transition otherwise makes impacts appear to occur at a distance. */
.card.sliding{transition:none!important}


/* Compact simple-deck typography: the desktop 90x135 title dimensions
   otherwise overlap on narrow mobile tabletop cards. */
@media (max-width:780px){
 .card .front .simple-major-number{
  top:5%;height:22%;font-size:clamp(14px,4.2vw,19px);
 }
 .card .front .simple-major-name{
  top:31%;bottom:14%;left:2px;right:2px;
  font-size:clamp(9px,2.55vw,11.5px)!important;
  line-height:1.12;gap:0;overflow-wrap:anywhere;
 }
 .card .front .simple-major-flourish{
  bottom:5%;font-size:8px;
 }
 .card .front .simple-minor-rank{
  font-size:clamp(16px,4.8vw,22px);
 }
}

/* Deck capability-controlled fields must stay hidden even if grid styles apply. */
#pipBackgroundField[hidden]{display:none!important}

/* Independent deck blueprint placeholders: printed title, rank and suit glyph. */
.front .blueprint-card-face{display:flex;flex-direction:column;align-items:center;justify-content:space-between;width:100%;height:100%;min-height:0;padding:6px 3px;box-sizing:border-box;color:#2c2823;overflow:hidden}
.front .blueprint-card-face.red{color:#982d32}
.front .blueprint-card-rank{align-self:flex-start;font:bold clamp(11px,1.8vw,21px)/1 Georgia,serif}
.front .blueprint-card-symbol{font:clamp(22px,3.9vw,48px)/1 Georgia,serif}
.front .blueprint-card-title{font:bold clamp(9px,1.25vw,13px)/1.2 Georgia,'Yu Mincho',serif;text-align:center;overflow-wrap:anywhere;max-width:100%}
.blueprint-card-view{background:#eee1c3;border:6px double #766143;color:#2c2823;border-radius:7px;width:min(60vw,260px);height:auto;aspect-ratio:2/3;display:flex;padding:10px;box-sizing:border-box;box-shadow:0 6px 20px #0008}
.blueprint-card-view .blueprint-card-face{display:flex;flex-direction:column;align-items:center;justify-content:space-between;width:100%;height:100%;color:#2c2823;padding:8px;box-sizing:border-box}
.blueprint-card-view .blueprint-card-face.red{color:#982d32}
.blueprint-card-view .blueprint-card-rank{align-self:flex-start;font:bold 27px Georgia,serif}
.blueprint-card-view .blueprint-card-symbol{font:64px Georgia,serif}
.blueprint-card-view .blueprint-card-title{font:bold 19px Georgia,'Yu Mincho',serif;text-align:center;overflow-wrap:anywhere}
@media(max-width:780px){
 .front .blueprint-card-rank{font-size:clamp(10px,3vw,15px)}
 .front .blueprint-card-symbol{font-size:clamp(19px,6vw,30px)}
 .front .blueprint-card-title{font-size:clamp(8px,2.6vw,11px)}
}

/* English-pattern pip faces share the same proportions on the table and in the viewer. */
.front:has(> .playing-card-face-svg){padding:0!important;gap:0!important;border:0;background:#faf5e9}
.front:has(> .playing-card-face-svg):before{display:none}
.blueprint-card-view:has(> .playing-card-face-svg){padding:0;border:0;background:#faf5e9;overflow:hidden}
.front .playing-card-face-svg,.blueprint-card-view .playing-card-face-svg{display:block;width:100%;height:100%;pointer-events:none}

/* v0.398: align settings with the five tabletop actions; two columns on phones. */
.table-action-settings{grid-template-columns:repeat(5,minmax(0,1fr))}
@media(max-width:780px){.table-action-settings{grid-template-columns:repeat(2,minmax(0,1fr))}}
#zone .card.instant-faceup .card-inner{transition:none!important}

/* v0.393 — readable stacked controls in the custom deal editor. */
.deal-workbench-panel .deal-step-form,.deal-workbench-panel .deal-step-fields{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;align-items:stretch;min-width:0}
.deal-workbench-panel .deal-step-form>span,.deal-workbench-panel .deal-step-fields>span{display:block;min-width:0;font:13px/1.5 sans-serif;color:#e6d5b6;margin:2px 0 0}
.deal-workbench-panel .deal-step-form select,.deal-workbench-panel .deal-step-form input{box-sizing:border-box;display:block;width:100%;min-width:0;max-width:100%;margin:0;font-size:16px}
.deal-workbench-panel .deal-step-form>button{justify-self:start;max-width:100%;white-space:normal}

/* v0.394 — visible physical pile stages for custom deal actions. */
.deal-pile-layer{position:absolute;inset:0;z-index:680;pointer-events:none;overflow:hidden}
/* Shared stock rendering: retain .deck, including identical artwork and appearance. */
.table-surface .deck.deal-pile-card{
 position:absolute;
 width:var(--cw);height:var(--ch);
 min-width:0;
 box-sizing:border-box;
 display:block;
 pointer-events:none;
 cursor:default;
 opacity:1;
 z-index:1;
 will-change:transform,left,top;
}
/* Temporary dealing piles are clones of the stock and retain its computed dimensions. */
.table-surface .deck.deal-pile-card .deal-pile-caption{
 position:absolute;left:50%;top:calc(100% + 7px);
 transform:translateX(-50%);
 white-space:nowrap;text-align:center;
 color:#f2dfb7;font:600 12px/1.25 sans-serif;
 text-shadow:1px 1px 4px #000,0 0 8px #000;
 min-width:75px;
}
@media(max-width:600px){
 .table-surface .deck.deal-pile-card .deal-pile-caption{font-size:10px;min-width:55px}
}

/* v0.411: Explicit, movable physical tabletop piles.
   Overlapping tarot cards remain independent unless manually dropped here. */
.table-zone.pile-placement-armed{cursor:crosshair}
/* v0.610 — semantic stacking: an empty pile is a reusable placement frame.
   Keep empty frames below all cards and occupied piles, independent of render order.
   Elevated drag/drop layers remain governed by their existing dedicated rules. */
#zone > .table-pile.pile-is-empty{z-index:1}
#zone > .table-pile.pile-is-occupied{z-index:1600}
.table-pile{position:absolute;z-index:1600;transform:translate(-50%,-50%);box-sizing:border-box;border:2px dashed #d6b57c;border-radius:6px;background:#191d1bdd;box-shadow:0 4px 12px #0009;touch-action:none}
.table-pile::before{content:"";position:absolute;inset:4px;pointer-events:none;border:1px solid #ab8c59;border-radius:4px}
.table-pile-handle{position:absolute;left:-2px;right:-2px;top:-29px;width:calc(100% + 4px);min-height:25px;border:1px solid #a18b62;border-radius:6px 6px 0 0;background:#29362d;color:#ead9b5;font:11px/1.2 Arial,sans-serif;z-index:3;cursor:grab;touch-action:none;white-space:nowrap;padding:3px 1px}
.table-pile-top{position:absolute;inset:0;z-index:2;overflow:hidden;border-radius:5px;cursor:grab;touch-action:none;user-select:none;background:#e1d1aa}
.table-pile-top.is-face-down{background:#423329}
.table-pile-top>.face.back{display:block;position:absolute;inset:0;width:100%;height:100%;transform:none;backface-visibility:visible}
.table-pile-top .card-art,.table-pile-top svg{width:100%;height:100%;max-height:100%;display:block}
.table-pile-empty{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;text-align:center;padding:4px;color:#e1c995;font:11px/1.4 sans-serif;pointer-events:none}
.table-pile-remove{position:absolute;z-index:2;right:-9px;bottom:-9px;width:25px;height:25px;padding:0;border:1px solid #d5b678;border-radius:50%;background:#27362c;color:#eee0c6;cursor:pointer}
.table-utility-actions #addTablePile[aria-pressed="true"]{border-color:#d7ae63;background:#59432b;color:#fff0c9}
@media(max-width:780px){.table-pile-handle{font-size:10px;min-height:24px;top:-27px}.table-pile-empty{font-size:9px}}

/* v0.413: choose the number of top cards to lift from an ordered pile. */
.table-pile-take-count{position:absolute;top:calc(100% + 33px);left:50%;transform:translateX(-50%);z-index:5;width:max(112px,100%);min-width:112px;height:27px;box-sizing:border-box;border:1px solid #a58c60;border-radius:5px;background:#29362d;color:#f2e5c5;font:12px/1.2 Arial,sans-serif;text-align:center;text-align-last:center;padding:2px 18px 2px 8px;cursor:pointer;touch-action:manipulation}
.table-pile-take-count:focus-visible{outline:2px solid #e6bd72;outline-offset:2px}
@media(max-width:780px){.table-pile-take-count{font-size:11px;height:25px;top:calc(100% + 31px);min-width:108px}}

/* A compact control leaves pile counts unobtrusive until explicitly requested. */
.table-pile-take-toggle{position:absolute;top:calc(100% + 5px);left:50%;transform:translateX(-50%);z-index:5;min-width:78px;height:24px;padding:2px 8px;border:1px solid #8b7753;border-radius:5px;background:#29362d;color:#e2d4b8;font:11px/1.2 Arial,sans-serif;white-space:nowrap;cursor:pointer;touch-action:manipulation}
.table-pile-take-count[hidden]{display:none}
@media(max-width:780px){.table-pile-take-toggle{height:22px;font-size:10px}}

/* v0.419: a small gesture grip opens a pile at any angle; expanded cards
   retain their own physical identity and remain full-size surfaces. */
.table-pile-top{width:100%;height:100%;right:auto;bottom:auto;box-sizing:border-box}
.table-pile-fan-grip{position:absolute;right:-13px;top:3px;z-index:500;width:25px;height:25px;border:1px solid #ae966b;border-radius:50%;background:#26332ae8;color:#f2e4c4;font:17px/1 sans-serif;padding:0;cursor:grab;touch-action:none}
.table-pile-fan-grip:active{cursor:grabbing}
.table-pile-handle{z-index:450}
.table-pile-take-toggle,.table-pile-take-count{z-index:460}

/* v0.420: a lifted sequence must appear above destination piles during drag. */
#zone > .table-pile.pile-drag-active{z-index:2100}

/* v0.423: role selection is disclosed by the existing pile handle.
   It remains absent from the tabletop until the handle is clicked. */
.table-pile-role-select{position:absolute;top:0;left:0;width:100%;height:30px;z-index:650;
 box-sizing:border-box;border:1px solid #b59b68;border-radius:4px;background:#26392f;color:#f0dfc1;
 font:12px Arial,sans-serif;cursor:pointer}
.table-pile-role-select[hidden]{display:none}

/* v0.424 — accessible pile creation and deliberate stack gesture */
.table-shortcuts{grid-template-columns:repeat(6,minmax(0,1fr))}
.table-shortcuts #addTablePile[aria-pressed="true"]{border-color:#d7ae63;background:#59432b;color:#fff0c9}
.stack-hover-target{outline:3px solid #d7bc83;outline-offset:3px;box-shadow:0 0 0 4px #3b302a77,0 0 18px #d7bc83a8}
@media(max-width:780px){.table-shortcuts{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* v0.425: keep five introductory shortcuts; advanced pile creation lives in
   the bottom-right placement popover beside manual placement and hand mode. */
.table-shortcuts{grid-template-columns:repeat(5,minmax(0,1fr))}
#placementToolsContent .placement-add-pile{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;min-height:35px;padding:6px 9px;border:1px solid #9d8862;border-radius:5px;background:#29392e;color:#e5d9bf;font:12px/1.3 Georgia,'Yu Mincho',serif;cursor:pointer}
#placementToolsContent .placement-add-pile[aria-pressed="true"]{border-color:#d7ae63;background:#59432b;color:#fff0c9}
#placementToolsContent .placement-add-pile .quick-symbol{font-size:16px}
@media(max-width:780px){.table-shortcuts{grid-template-columns:repeat(5,minmax(0,1fr))}}

/* v0.427 — consistent placement tools, arranged by purpose */
#placementToolsContent{min-width:188px}
#placementToolsContent .placement-tools-layout{display:flex;flex-direction:column;gap:10px;min-width:178px}
#placementToolsContent .placement-tools-group{display:flex;flex-direction:column;gap:5px}
#placementToolsContent .placement-tools-group+.placement-tools-group{border-top:1px solid #665e49;padding-top:9px}
#placementToolsContent .placement-tools-heading{font:11px/1.4 Georgia,'Yu Mincho',serif;letter-spacing:.1em;color:#cbb68a;padding:0 2px 2px}
#placementToolsContent .placement-tools-button,
#placementToolsContent .placement-add-pile{display:flex;align-items:center;justify-content:center;gap:6px;box-sizing:border-box;width:100%;min-width:0;min-height:36px;padding:7px 10px;border:1px solid #857354;border-radius:5px;background:#29392e;color:#eddfc3;font:12px/1.3 Georgia,'Yu Mincho',serif;text-align:center;white-space:nowrap;cursor:pointer}
#placementToolsContent .placement-tools-button[aria-pressed="true"]{border-color:#bb995b;background:#4c4430;color:#fff0ca}
#placementToolsContent .placement-tools-button[hidden]{display:none!important}
#placementToolsContent .placement-tools-button .quick-symbol{font-size:16px;color:inherit}

/* v0.430: registered empty piles remain usable refill targets. Other empty
   piles retain their previous passive placeholder behavior. */
.table-pile-empty.refill-ready{pointer-events:auto;cursor:pointer;touch-action:manipulation;border:1px dashed #b69d6b;border-radius:4px;background:#2631269e;color:#f0deb5}
.table-pile-empty.refill-ready:hover{background:#384536d9;border-color:#d8bc7e}

/* v0.431 — location ordering, compaction and refill share the placement popup */
#placementToolsContent .placement-tools-order-label{display:flex;align-items:center;justify-content:space-between;gap:8px;color:#d6c49e;font:11px/1.4 Georgia,'Yu Mincho',serif;padding:1px 0}
#placementToolsContent #arrangementOrderChoice{min-width:0;flex:1;height:34px;padding:4px 7px;border:1px solid #857354;border-radius:5px;background:#29392e;color:#eddfc3;font:12px/1.3 Georgia,'Yu Mincho',serif}
#placementToolsContent #arrangementCompact,#placementToolsContent #arrangementRefill{min-height:36px}

/* v0.433 — tactile cards, with the role/move control separate from labels.
   A covered multi-card pile shows up to three fine paper edges; the face
   still has the original dimensions and pointer interactions. */
.table-pile:has(>.table-pile-top){border-color:transparent;background:transparent;box-shadow:none}
.table-pile:has(>.table-pile-top)::before{border-color:transparent}
.table-pile-depth{position:absolute;inset:0;z-index:1;pointer-events:none;overflow:visible}
.table-pile-depth-sheet{position:absolute;inset:0;width:100%;height:100%;box-sizing:border-box;
 left:calc(var(--depth-index) * 2.5px);top:calc(var(--depth-index) * 3px);
 border:1px solid #a58c64;border-radius:5px;background:linear-gradient(90deg,#eee0be 0%,#cdb993 60%,#977b58 100%);
 box-shadow:1px 2px 3px #0006;pointer-events:none}
.table-pile-handle{left:-13px;right:auto;top:-17px;width:28px;min-width:28px;height:28px;min-height:28px;
 padding:0;border:1px solid #b39a6b;border-radius:50%;display:grid;place-items:center;
 background:#28392fee;color:#f0dcb8;font:15px/1 Georgia,serif;box-shadow:0 2px 6px #0008;
 white-space:nowrap;z-index:550}
.table-pile-role-select{left:12px;top:-19px;width:max(115px,100%);min-width:115px;height:30px;z-index:650}
.table-zone .zone-label.unified-label.pile-label{pointer-events:none;z-index:2500}
@media(max-width:780px){
 .table-pile-handle{left:-12px;top:-15px;width:26px;min-width:26px;height:26px;min-height:26px;font-size:14px}
 .table-pile-role-select{top:-16px}
}

/* v0.434: the pile count is a quiet, noninteractive annotation. */
.table-pile-count-badge{
 position:absolute;right:-7px;bottom:-9px;z-index:570;
 min-width:23px;height:21px;padding:0 5px;box-sizing:border-box;
 display:flex;align-items:center;justify-content:center;
 border:1px solid #ad9166;border-radius:11px;
 background:#25352de8;color:#ebdec3;
 box-shadow:0 1px 5px #0008;
 font:11px/1.1 Georgia,"Yu Mincho",serif;
 white-space:nowrap;pointer-events:none;user-select:none;
}
@media(max-width:780px){.table-pile-count-badge{height:20px;min-width:22px;right:-6px;bottom:-8px;font-size:10px}}

/* Stock drag: indicate the card that will receive the dropped stock card. */
.card.deck-stack-hover{outline:3px solid #f2d58b;outline-offset:3px;filter:drop-shadow(0 0 12px rgba(255,215,120,.95));z-index:9999!important}

/* Dedicated spread editing workspace: distinguish it from ordinary menus. */
.spread-workbench{border:2px solid #c7a66d;box-shadow:0 0 0 3px #171c18,0 8px 25px #0007}
.spread-workbench-head{padding:10px 12px;margin:-12px -15px 10px;background:#394437;border-bottom:2px solid #c7a66d}
.spread-workbench-head strong{font-size:15px;letter-spacing:.04em}
.spread-workbench-mode-note{font:12px/1.65 sans-serif;color:#e2d1aa;margin:0 0 12px}
@media(max-width:780px){
 body.spread-workbench-active .shell>aside{display:none!important}
 body.spread-workbench-active .spread-workbench{border-width:3px;padding:12px;margin:10px 0 16px;box-shadow:0 0 0 4px #101812,0 8px 22px #0009}
 body.spread-workbench-active .spread-workbench-head{margin:-12px -12px 12px;padding:13px 12px;display:block}
 body.spread-workbench-active .spread-workbench-head strong{display:block;font-size:16px;margin-bottom:8px}
 body.spread-workbench-active .spread-workbench-head span{display:block;line-height:1.5}
 body.spread-workbench-active .spread-workbench-mode-note{font-size:12px}
}


/* Four Seasons physical frames recede while the stock is washed, shuffled or cut. */
#surface.four-seasons-spread.shuffle-in-progress .table-pile,
#surface.four-seasons-spread.cut-in-progress .table-pile{visibility:hidden!important}

/* Keep Four Seasons placement controls out of stock animations, including on mobile Safari. */
#surface.four-seasons-spread.shuffle-in-progress .table-pile-handle,
#surface.four-seasons-spread.cut-in-progress .table-pile-handle,
#surface.four-seasons-spread:has(.shuffle-layer.active) .table-pile-handle,
#surface.four-seasons-spread.shuffle-in-progress .slot,
#surface.four-seasons-spread.cut-in-progress .slot{visibility:hidden!important}

/* Render an individual card's original orientation inside a fixed pile frame. */
.table-pile-artwork{position:absolute;inset:0;width:100%;height:100%;transform-origin:center center;pointer-events:none}
.table-pile-artwork>.card-art,.table-pile-artwork>svg{width:100%;height:100%;max-height:100%;display:block}

/* Selection-only rotation mode; no permanent grip competing with the fan handle. */
.table-card-controls #rotateDragMode[aria-pressed="true"]{background:#665239;border-color:#e4c98f;color:#fff2cd}
#zone .table-pile.is-rotation-selected{outline:2px solid #d4b47b;outline-offset:2px}
#zone .card.is-selected,#zone .table-pile.is-rotation-selected{touch-action:none}

/* v0.469: external precision rotation grip, shared by cards and physical piles. */
#zone .rotation-handle{
 position:absolute;left:calc(100% + 12px);top:50%;transform:translateY(-50%);
 width:38px;height:38px;min-width:38px;min-height:38px;
 display:flex;align-items:center;justify-content:center;
 padding:0;border:2px solid #f0cb82;border-radius:50%;
 background:#26352ff2;color:#ffe1a0;font:26px/1 sans-serif;
 box-shadow:0 2px 12px #000b;z-index:2500;
 cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;
 -webkit-tap-highlight-color:transparent;
}
#zone .rotation-handle:active{cursor:grabbing;background:#4d5234}
#zone .rotation-handle:focus-visible{outline:3px solid #ffe1a0;outline-offset:3px}
@media(max-width:780px){#zone .rotation-handle{width:44px;height:44px;min-width:44px;min-height:44px;left:calc(100% + 15px)}}

/* v0.470: shared contextual compact shortcut. */
#surface #quickCompactAction{position:absolute;right:45px;bottom:12px;z-index:10001;min-height:34px;padding:6px 13px;border:1px solid #ad9266;border-radius:5px;background:#26372fe8;color:#f0deb5;box-shadow:0 2px 9px #0008;font:12px/1.2 Georgia,"Yu Mincho",serif;white-space:nowrap;touch-action:manipulation}
#surface #quickCompactAction[hidden]{display:none!important}
#surface:has(#placementToolsContent:not([hidden])) #quickCompactAction{display:none!important}
#placementToolsContent .compact-shortcut-toggle{display:flex;align-items:center;gap:7px;padding:5px 2px;font:11px/1.4 Georgia,"Yu Mincho",serif;color:#ddcda8;cursor:pointer}
#placementToolsContent .compact-shortcut-toggle input{width:16px;height:16px;flex:none;accent-color:#b99b65}
@media(max-width:780px){#surface #quickCompactAction{right:47px;bottom:12px;min-height:38px;padding:7px 12px;font-size:12px}}

/* v0.477: sound shortcut in the toolbar, including narrow phone layouts. */
.toolbar #toolbarSoundToggle{width:42px;min-width:42px;height:42px;min-height:42px;flex:0 0 42px;padding:8px;box-sizing:border-box;border:1px solid #8b7851;border-radius:5px;background:#27342d;color:#d2c09c;cursor:pointer}
.toolbar #toolbarSoundToggle svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.toolbar #toolbarSoundToggle[aria-pressed="true"]{background:#62502e;color:#f1d68b;border-color:#c2a46a}
@media(max-width:780px){
 /* Preserve the previous wide spread selector: first row is spread + inspect + notebook. */
 .toolbar .mobile-cockpit-actions{grid-template-columns:44px minmax(0,1fr) 44px 44px;grid-template-rows:44px 42px;gap:6px}
 .toolbar .mobile-cockpit-actions>.toolbar-spread-shortcut{grid-column:1 / 3;grid-row:1;min-width:0}
 .toolbar .mobile-cockpit-actions>.toolbar-spread-shortcut select{font-size:12px;padding-left:8px;padding-right:19px;min-width:0}
 .toolbar .mobile-cockpit-actions>#inspectCards{grid-column:3;grid-row:1}
 .toolbar .mobile-cockpit-actions>#spreadNotebook{grid-column:4;grid-row:1}
 /* The sound control shares the bottom action row instead of shrinking the spread selector. */
 .toolbar .mobile-cockpit-actions>#toolbarSoundToggle{grid-column:1;grid-row:2;width:44px!important;min-width:0!important;max-width:44px!important;height:42px!important;min-height:42px!important;margin:0!important;padding:7px!important}
 .toolbar .mobile-cockpit-actions>#newSessionStandalone{grid-column:2 / -1;grid-row:2;width:100%!important;min-width:0!important;height:42px!important;min-height:42px!important;margin:0!important}
}

/* v0.483: antique emblem-book layout for inscribed standalone oracle cards. */
.blueprint-card-face.blueprint-oracle-face{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:4px;padding:6px 5px 5px}
.blueprint-oracle-face .blueprint-oracle-emblem{flex:none;font:clamp(13px,1.45vw,19px)/1 Georgia,serif;max-height:22%;overflow:hidden}
.blueprint-oracle-face .blueprint-oracle-content{width:100%;min-height:0;min-width:0;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;text-align:center}
.blueprint-oracle-face .blueprint-oracle-title{font:bold clamp(12px,2vw,26px)/1.2 Georgia,"Yu Mincho",serif;max-width:100%;overflow-wrap:anywhere}
.blueprint-oracle-face .blueprint-oracle-subtitle{font:clamp(8px,1vw,12px)/1.3 Georgia,serif;letter-spacing:.07em;max-width:100%;overflow-wrap:anywhere}
.blueprint-oracle-face .blueprint-oracle-rule{width:78%;display:flex;align-items:center;gap:5px;font:10px/1 Georgia,serif;opacity:.55}
.blueprint-oracle-face .blueprint-oracle-rule::before,.blueprint-oracle-face .blueprint-oracle-rule::after{content:"";height:1px;background:currentColor;flex:1}
.blueprint-oracle-face .blueprint-card-oracle-line{display:block;white-space:pre-line;overflow:hidden;max-width:100%;max-height:5.8em;font:clamp(8px,.95vw,11px)/1.45 Georgia,"Yu Mincho",serif;text-align:center;overflow-wrap:anywhere;opacity:.85}
.blueprint-oracle-face .blueprint-oracle-footer{flex:none;font:10px/1 Georgia,serif;opacity:.6}
.blueprint-card-view .blueprint-oracle-face .blueprint-oracle-emblem{font-size:22px}
.blueprint-card-view .blueprint-oracle-face .blueprint-oracle-title{font-size:32px}
.blueprint-card-view .blueprint-oracle-face .blueprint-oracle-subtitle{font-size:14px}
.blueprint-card-view .blueprint-oracle-face .blueprint-card-oracle-line{font-size:13px;line-height:1.5}
@media(max-width:780px){.front .blueprint-oracle-face .blueprint-oracle-title{font-size:clamp(11px,3.5vw,18px)}.front .blueprint-oracle-face .blueprint-card-oracle-line{font-size:clamp(7px,2vw,10px)}}

/* v0.487: the deck designer's generated card faces in the encyclopedia. */
.gallery-tile>.gallery-blueprint-face,.gallery-lightbox-view>.gallery-blueprint-face{
 position:relative;display:block;box-sizing:border-box;aspect-ratio:2/3;
 overflow:hidden;flex:none;border:0;border-radius:5px;background:#faf5e9;
}
.gallery-tile>.gallery-blueprint-face{width:100%;height:auto;max-width:210px;box-shadow:0 7px 13px #0009}
.gallery-lightbox-view>.gallery-blueprint-face{width:min(76vw,440px,calc(70dvh * 2 / 3));height:auto;max-height:100%;box-shadow:0 8px 30px #000a}
.gallery-blueprint-face>.gallery-blueprint-inner{
 position:absolute!important;left:0!important;top:0!important;right:auto!important;bottom:auto!important;
 box-sizing:border-box;width:90px!important;height:135px!important;
 transform-origin:top left!important;backface-visibility:visible!important;margin:0!important;
}
.gallery-tile:focus-visible>.gallery-blueprint-face{outline:3px solid #dbbf7c;outline-offset:3px}
@media(max-width:500px){.gallery-lightbox-view>.gallery-blueprint-face{width:min(76vw,calc(62dvh * 2 / 3))}}

/* v0.488: gallery lightbox artwork is INSIDE .detail-body, not a direct
   child of .gallery-lightbox-view. Without an explicit flex width the
   generated DIV faces collapse to zero width in the enlarged viewer. */
.gallery-lightbox-view .detail-body > :is(.gallery-simple-face,.gallery-blueprint-face){
 display:block;
 position:relative;
 box-sizing:border-box;
 flex:0 0 auto;
 width:min(76vw,440px,calc(70dvh * 2 / 3));
 height:auto;
 aspect-ratio:2/3;
 max-height:70dvh;
 min-width:0;
 overflow:hidden;
 border-radius:5px;
 box-shadow:0 8px 30px #000a;
}
@media(max-width:700px){
 .gallery-lightbox-view .detail-body > :is(.gallery-simple-face,.gallery-blueprint-face){
  width:min(calc(100vw - 106px),440px,calc(62dvh * 2 / 3));
  max-height:62dvh;
 }
 .gallery-lightbox-view .detail-body.has-copy > :is(.gallery-simple-face,.gallery-blueprint-face){
  width:min(calc(100vw - 106px),440px,calc(50dvh * 2 / 3));
  max-height:50dvh;
 }
}

/* v0.489 — fixed 90 × 135 card typography; only the entire card scales.
   VW-based typography would be multiplied AGAIN by the gallery transform,
   clipping oracle inscriptions and over-enlarging the title. */
.gallery-blueprint-inner .blueprint-card-face{width:100%;height:100%;min-height:0}
.gallery-blueprint-inner .blueprint-card-rank{font-size:11px;line-height:1}
.gallery-blueprint-inner .blueprint-card-symbol{font-size:27px;line-height:1}
.gallery-blueprint-inner .blueprint-card-title{font-size:9px;line-height:1.2}
.gallery-blueprint-inner .blueprint-oracle-face .blueprint-oracle-emblem{font-size:11px;line-height:1;max-height:20%}
.gallery-blueprint-inner .blueprint-oracle-face .blueprint-oracle-content{gap:3px}
.gallery-blueprint-inner .blueprint-oracle-face .blueprint-oracle-title{font-size:12px;line-height:1.2}
.gallery-blueprint-inner .blueprint-oracle-face .blueprint-oracle-subtitle{font-size:8px;line-height:1.2}
.gallery-blueprint-inner .blueprint-oracle-face .blueprint-oracle-rule{font-size:7px;line-height:1;gap:3px}
.gallery-blueprint-inner .blueprint-oracle-face .blueprint-card-oracle-line{font-size:7px;line-height:1.45;max-height:5.8em;white-space:pre-line}
.gallery-blueprint-inner .blueprint-oracle-face .blueprint-oracle-footer{font-size:7px;line-height:1}
@media(max-width:780px){
 .gallery-blueprint-inner .blueprint-oracle-face .blueprint-oracle-title{font-size:12px}
 .gallery-blueprint-inner .blueprint-oracle-face .blueprint-card-oracle-line{font-size:7px}
}

/* v0.494: keep the original corner arrangement and scale the visual controls
   with the rendered card width. All controls remain immediately available. */
@media(max-width:780px) and (pointer:coarse){
 .table-pile > .table-pile-handle,
 .table-pile > .table-pile-fan-grip{
  width:var(--pile-tool-size,26px);min-width:0;
  height:var(--pile-tool-size,26px);min-height:0;
  top:calc(var(--pile-tool-size,26px) * -0.56);
  opacity:1;visibility:visible;pointer-events:auto;
 }
 .table-pile > .table-pile-handle{
  left:calc(var(--pile-tool-size,26px) * -0.46);
  top:calc(var(--pile-tool-size,26px) * -0.56 - 3px);
  font-size:calc(var(--pile-tool-size,26px) * 0.54);
 }
 .table-pile > .table-pile-fan-grip{
  right:calc(var(--pile-tool-size,26px) * -0.46);
  font-size:calc(var(--pile-tool-size,26px) * 0.65);
 }
 .table-pile > .table-pile-count-badge{
  right:-5px;bottom:-7px;
  min-width:calc(var(--pile-tool-size,26px) * 0.70);
  height:calc(var(--pile-tool-size,26px) * 0.65);
  padding:0 3px;font-size:calc(var(--pile-tool-size,26px) * 0.38);
 }
 .table-pile:not(.pile-has-multiple) > .table-pile-count-badge{display:none}
}

/* v0.495: a pile glows only when the current drop-point resolves to it. */
#zone .table-pile.pile-drop-target{
 outline:3px solid #f2d58b;outline-offset:3px;
 filter:drop-shadow(0 0 12px rgba(255,215,120,.9));
 z-index:1900!important;
}

/* v0.496: stock movement uses the same card-relative size as pile tools. */
@media(max-width:780px) and (pointer:coarse){
 .table-surface .deck .deck-move-handle{
  width:var(--deck-tool-size,26px);height:var(--deck-tool-size,26px);
  min-width:0;min-height:0;
  top:calc(var(--deck-tool-size,26px) * -0.56 - 3px);
  right:calc(var(--deck-tool-size,26px) * -0.46);
  font-size:calc(var(--deck-tool-size,26px) * 0.54);
 }
}

/* v0.513 — Lenormand faces use original PNG artwork plus shared SVG ornaments. */
.face.front:has(> .lenormand-face-svg){padding:0!important;gap:0!important;border:0;background:#f7e8c5;overflow:hidden}
.face.front:has(> .lenormand-face-svg):before{display:none}
.front .lenormand-face-svg,.gallery-blueprint-inner .lenormand-face-svg,.blueprint-card-view .lenormand-face-svg{display:block;width:100%;height:100%;pointer-events:none;user-select:none;flex:none}
.gallery-blueprint-inner:has(> .lenormand-face-svg){padding:0!important;gap:0!important;border:0!important;background:#f7e8c5!important}
.gallery-blueprint-inner:has(> .lenormand-face-svg):before{display:none!important}

/* Card contour normalization: the SVG artwork owns its outline.
   Transparent wrappers prevent square paper backgrounds from protruding
   through the SVG's rounded corners at high magnification. The radii match
   the artwork viewBoxes (playing: 6/120 by 6/180; Lenormand: 5/300 by 5/450).
   Tarot uses raster card artwork and retains its existing image clipping. */
:is(.face.front,.blueprint-card-view,.gallery-blueprint-inner):has(> .playing-card-face-svg){
  background:transparent!important;
  border:0!important;
  padding:0!important;
  border-radius:5% / 3.333333%!important;
  overflow:hidden;
}
:is(.face.front,.blueprint-card-view,.gallery-blueprint-inner):has(> .lenormand-face-svg){
  background:transparent!important;
  border:0!important;
  padding:0!important;
  border-radius:1.666667% / 1.111111%!important;
  overflow:hidden;
}
:is(.face.front,.blueprint-card-view,.gallery-blueprint-inner):has(> :is(.playing-card-face-svg,.lenormand-face-svg))::before{
  display:none!important;
}
:is(.face.front,.blueprint-card-view,.gallery-blueprint-inner) > :is(.playing-card-face-svg,.lenormand-face-svg){
  display:block;
  width:100%;
  height:100%;
  overflow:hidden;
  border-radius:inherit;
  flex:none;
}

/* v0.529 — restrained, collapsible deck introduction in the gallery. */
#galleryDeckIntro[hidden],#galleryDeckIntroEditor[hidden]{display:none!important}
.gallery-deck-intro,.gallery-deck-intro-actions,.gallery-deck-intro-editor{max-width:1200px;margin-left:auto;margin-right:auto;box-sizing:border-box}
.gallery-deck-intro{border-block:1px solid #655b43;margin-bottom:3px;padding:3px 0}
.gallery-deck-intro-toggle{display:flex;width:100%;align-items:center;justify-content:space-between;gap:12px;padding:10px 4px;border:0;background:transparent;box-shadow:none;color:#d4bd8e;text-align:left;font:600 15px/1.45 'Yu Mincho','Hiragino Mincho ProN',serif;cursor:pointer}
.gallery-deck-intro-toggle:hover{background:#ffffff08}
.gallery-deck-intro-toggle>span:last-child{font:20px/1 sans-serif;color:#a48d61}
.gallery-deck-intro-body{padding:3px 5px 13px}
.gallery-deck-intro-body p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;color:#e4d9c5;font:14px/1.95 'Yu Mincho','Hiragino Mincho ProN',serif}
.gallery-deck-intro-actions{display:flex;justify-content:flex-end;margin-bottom:17px}
.gallery-deck-intro-actions button{background:transparent;border:0;box-shadow:none;color:#b6a47d;padding:5px 4px;font:12px/1.4 sans-serif;text-decoration:underline;cursor:pointer}
.gallery-deck-intro-editor{padding:14px;margin-top:-9px;margin-bottom:21px;border:1px solid #695c42;border-radius:6px;background:#222821}
.gallery-deck-intro-editor>label{display:block;margin-bottom:8px;color:#e4cfaa;font:13px sans-serif}
.gallery-deck-intro-editor textarea{display:block;width:100%;box-sizing:border-box;min-height:110px;resize:vertical;padding:10px;background:#151d18;border:1px solid #776746;border-radius:4px;color:#eee2cb;font:14px/1.7 'Yu Mincho',serif}
.gallery-deck-intro-editor-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;margin-top:12px}
.gallery-deck-intro-editor-actions button{font:12px sans-serif}
.gallery-deck-intro-editor-actions #galleryDeckIntroSave{background:#5c5239;color:#fff0d2;border-color:#b79b63}
.gallery-deck-intro-editor-status{margin:8px 0 0;color:#dfc89e;font:12px sans-serif}
@media(max-width:500px){.gallery-deck-intro-toggle{font-size:14px}.gallery-deck-intro-body p{font-size:13px}.gallery-deck-intro-editor{padding:10px}}

/* Hide numeral selectors not relevant to the chosen gallery deck. */
.face-preferences label[hidden],.face-preferences[hidden]{display:none!important}

/* v0.543 — Each desktop toolbar item wraps naturally. Every resulting
   flex line is right-aligned, instead of forcing a fixed two-group breakpoint.
   Display-contents wrappers retain DOM order and mobile layout. */
@media(min-width:781px){
 .main>.toolbar{justify-content:flex-end;}
 .main>.toolbar .toolbar-leading,
 .main>.toolbar .toolbar-trailing,
 .main>.toolbar .toolbar-trailing>.mobile-cockpit-actions{
  display:contents;
 }
 .main>.toolbar .toolbar-leading>.status{
  flex:1 1 180px;
  min-width:105px;
  margin:0;
 }
 .main>.toolbar .toolbar-leading>.workspace-switcher,
 .main>.toolbar .toolbar-leading>.toolbar-card-size,
 .main>.toolbar .toolbar-leading>#desktopTableViews,
 .main>.toolbar .toolbar-trailing .toolbar-spread-shortcut{
  flex-shrink:0;
 }
}
@media(max-width:780px){
 .main>.toolbar .toolbar-leading,
 .main>.toolbar .toolbar-trailing{display:contents;}
 .shell>.main>.toolbar .toolbar-leading>.status{display:none!important;}
}

/* v0.544 — Reflow the status message below the controls when the actual
   available desktop width cannot fit a readable message and all controls. */
@media(min-width:781px){
 .main>.toolbar.status-on-second-row .toolbar-leading>.status{
  order:99;
  flex:0 0 100%;
  width:100%;
  min-width:0;
  text-align:left;
  padding-top:2px;
 }
}

/* v0.548 — UI type is sans-serif; editorial, archival and card typography
   intentionally remain Mincho/Georgia. This only targets interface controls. */
:root{
 --tabula-ui-font:Arial,'Hiragino Kaku Gothic ProN','Yu Gothic',sans-serif;
 --tabula-editorial-font:Georgia,'Yu Mincho','Hiragino Mincho ProN',serif;
}
.main>.toolbar :is(button,select,output,.status,.table-view-label,.toolbar-size-label,.toolbar-spread-shortcut>span,.workspace-switcher),
.table-shortcuts button,
.table-action-settings :is(button,select,label),
.table-utility-actions button,
.results-toggle-bar button,
.table-record-actions button,
.gallery-controls :is(button,select,label,output),
aside .section :is(button,select,input,textarea),
#modalBg :is(button,select,input,textarea){
 font-family:var(--tabula-ui-font);
}

/* v0.551 — rotate the card or pile itself; no external grip.
   Direct manipulation should not animate away from the pointer. */
#zone.rotation-mode-active .card,
#zone.rotation-mode-active .table-pile :is(.table-pile-top,.table-pile-empty){
 cursor:grab;
 touch-action:none;
}
#zone .card.body-rotating,
#zone .table-pile.body-rotating{
 transition:none!important;
 animation:none!important;
 cursor:grabbing!important;
}
#zone .card.body-rotating *,
#zone .table-pile.body-rotating *{cursor:grabbing!important;}

/* v0.552 — Remove positions in the spread editor without disturbing others. */
.spread-workbench-position-row{
 grid-column:1/-1;
 display:grid;grid-template-columns:minmax(0,1.3fr) minmax(130px,.8fr) auto;
 align-items:center;gap:7px;padding:4px 0;
 border-bottom:1px solid rgba(182,163,122,.21);
}
.spread-workbench-position-row label{min-width:0;}
.spread-workbench-position-row select{min-width:0;width:100%;}
.spread-workbench-position-row .spread-position-remove{
 min-width:52px;min-height:32px;padding:5px 8px;
 background:#352b29;border:1px solid #9c796d;color:#f0d5bc;
 font:12px var(--tabula-ui-font,Arial,sans-serif);
}
.spread-workbench-position-row .spread-position-remove:disabled{opacity:.35;cursor:not-allowed;}
.spread-position-unassigned{font-size:12px;color:#bba98b;}
@media(max-width:780px){
 .spread-workbench-position-row{grid-template-columns:minmax(0,1fr) auto;}
 .spread-workbench-position-row select{grid-column:1;}
 .spread-workbench-position-row .spread-position-remove{grid-column:2;grid-row:1 / span 2;}
}

/* v0.553 — whole-spread translation, distinct from circle alignment. */
.spread-workbench-actions .spread-translate-controls{
 grid-column:1/-1;display:flex;align-items:center;flex-wrap:wrap;
 justify-content:center;gap:7px;padding:8px 9px;
 border:1px solid #786a50;border-radius:5px;background:#27362d;
}
.spread-translate-title{font:12px var(--tabula-ui-font,Arial,sans-serif);color:#ead4a8;margin-right:auto;}
.spread-workbench-actions .spread-translate-controls button{
 width:36px;height:36px;min-height:36px;padding:0;
 font-size:20px;line-height:1;flex:0 0 36px;
}
.spread-workbench-actions .spread-translate-controls select{
 width:auto;max-width:136px;height:36px;min-width:0;padding:4px 6px;
 font:12px var(--tabula-ui-font,Arial,sans-serif);
}
@media(max-width:780px){
 .spread-workbench-actions .spread-translate-controls{gap:5px;padding:7px 5px;}
 .spread-translate-title{flex:1 0 100%;text-align:center;margin:0;}
 .spread-workbench-actions .spread-translate-controls button{width:34px;flex-basis:34px;}
}

/* v0.560: Hide only the visual frames, never slot geometry, card faces or hit targets. */
#zone > .slot{transition:opacity .32s ease}
#zone.frames-hidden > .slot{opacity:0;pointer-events:none}
#zone.frames-hidden > .table-pile{border-color:transparent;background:transparent;box-shadow:none}
#zone.frames-hidden > .table-pile::before{border-color:transparent}
#zone.frames-hidden .table-pile-empty{border-color:transparent;background:transparent}
#zone.frames-hidden .table-pile-depth-sheet{border-color:transparent}

/* v0.575: Deal options open in a floating menu. The toolbar remains one row. */
.table-action-settings{position:relative;z-index:15;overflow:visible}
.table-action-settings>label{height:30px;min-height:30px;align-items:center}
.table-action-settings .table-deal-control{position:relative;min-width:0;width:100%;height:30px}
/* v0.612: Deal controls mirror the Wash direction/rounds proportions. */
.table-action-settings .table-deal-controls{display:flex;align-items:stretch;gap:5px;width:100%;min-width:0}
.table-action-settings .table-deal-controls #tableDealFace{box-sizing:border-box;flex:0 0 60px;width:60px;min-width:0;height:30px;min-height:30px;padding:4px 3px;font-size:12px;text-align:center}
.table-action-settings #tableOpenMode{display:block;width:100%;min-width:0}

/* v0.575: animate actual front/back card faces in one synchronized pass. */
/* v0.609 — keep the actual front and back visible through a genuine
   3-D flip. Filters on the rotating parent flatten its 3-D descendants. */
@keyframes tabula-simultaneous-turn{
 0%{transform:translate3d(0,0,0) rotateY(0deg)}
 22%{transform:translate3d(0,-27px,0) rotateY(0deg)}
 55%{transform:translate3d(0,-34px,0) rotateY(96deg)}
 82%{transform:translate3d(0,-20px,0) rotateY(170deg)}
 100%{transform:translate3d(0,0,0) rotateY(180deg)}
}
#zone .card.simultaneous-opening{
 perspective:900px;
 -webkit-perspective:900px;
}
#zone .card.faceup.simultaneous-opening .card-inner{
 animation:tabula-simultaneous-turn 820ms cubic-bezier(.26,.5,.34,1) both!important;
 transition:none!important;
 transform-style:preserve-3d!important;
 -webkit-transform-style:preserve-3d!important;
 will-change:transform;
}
#zone .card.simultaneous-opening .card-inner>.face{
 backface-visibility:hidden!important;
 -webkit-backface-visibility:hidden!important;
}
#zone .card.simultaneous-opening .card-inner>.face.front{
 transform:rotateY(180deg);
 -webkit-transform:rotateY(180deg);
}
@keyframes tabula-simultaneous-pile-lift{
 0%,100%{transform:translateY(0);filter:brightness(1)}
 35%{transform:translateY(-29px);filter:brightness(1.14)}
 65%{transform:translateY(-29px);filter:brightness(1.12)}
}
#zone .table-pile-top.simultaneous-opening{
 animation:tabula-simultaneous-pile-lift 820ms cubic-bezier(.26,.5,.34,1) both!important;
}
@media(prefers-reduced-motion:reduce){
 #zone .card.faceup.simultaneous-opening .card-inner,
 #zone .table-pile-top.simultaneous-opening{animation:none!important}
}

/* v0.577: Presentation settings belong to I. Table Management. */
#tableDisplaySettings{margin-top:14px;padding-top:11px;border-top:1px solid var(--ui-border,#514b3a)}
#tableDisplaySettings .label-cycle-settings{width:100%;box-sizing:border-box;margin:8px 0 12px}
#tableDisplaySettings .field{margin:8px 0 10px}
#tableDisplaySettings .table-display-frame-control{display:flex;align-items:center;gap:10px;margin-top:12px}
#tableDisplaySettings .table-display-frame-control>span{font-size:12px;flex:1;min-width:0}
#tableDisplaySettings #quickFrames{width:auto;min-width:113px;padding:7px 10px;font-size:12px;white-space:nowrap}
#tableDisplaySettings>.mini{margin:6px 0 0}

/* v0.578: The primary deck selector matches the full-width deck actions. */
#deckLibrarySelect{display:block;width:100%;min-height:44px;height:44px;border-radius:6px;padding:9px 34px 9px 12px;font-size:13px;line-height:1.4;box-sizing:border-box}

/* v0.579: Align Table Management with the denser card-settings rhythm.
   Only recently added controls are normalized; other sections are untouched. */
#tableManagement .table-workspace-start{
 gap:7px;
 padding:3px 0 5px;
}
#tableManagement .table-current-chip{
 padding:7px 10px;
}
#tableManagement #tableDisplaySettings{
 margin-top:7px;
 padding-top:8px;
}
#tableManagement #tableDisplaySettings .label-cycle-settings{
 margin:5px 0 6px;
 padding:0;
 border:0;
 width:100%;
}
#tableManagement #tableDisplaySettings .label-cycle-settings>summary{
 font-family:var(--tabula-ui-font);
 font-size:12px;
 line-height:1.4;
 font-weight:normal;
 box-sizing:border-box;
 min-height:35px;
 display:list-item;
 padding:7px 10px;
 border:1px solid #655e4a;
 border-radius:5px;
 background:rgba(22,31,27,.36);
}
#tableManagement #tableDisplaySettings .label-cycle-settings .mini{
 margin:6px 0 5px;
}
#tableManagement #tableDisplaySettings .label-cycle-options{
 grid-template-columns:minmax(0,1fr);
 gap:7px;
 padding:4px 0 5px;
}
#tableManagement #tableDisplaySettings .label-cycle-options label{
 min-width:0;
 overflow-wrap:anywhere;
}
#tableManagement #tableDisplaySettings .label-cycle-options label,
#tableManagement #tableDisplaySettings .label-cycle-placement{
 font-family:var(--tabula-ui-font);
 font-size:12px;
}
#tableManagement #tableDisplaySettings .field{
 margin:5px 0 6px;
 font-size:12px;
}
#tableManagement #tableDisplaySettings .field select{
 min-height:35px;
 font-size:12px;
}
#tableManagement #tableDisplaySettings .table-display-frame-control{
 margin-top:6px;
 gap:8px;
}
#tableManagement #tableDisplaySettings #quickFrames{
 min-height:35px;
 font-family:var(--tabula-ui-font);
 font-size:12px;
}

/* v0.580: Blueprint cards share the enlarged reading view with their text. */
.card-viewer-active .table-card-view #tableCardArtFrame{
 display:flex;
 align-items:center;
 justify-content:center;
 min-width:0;
 flex:0 1 auto;
 max-width:100%;
}
.card-viewer-active .table-card-view #tableCardArtFrame .blueprint-card-view{
 flex:0 1 auto;
 /* Match the enlarged Tarot card, rather than the small 260px preview. */
 width:min(43vw,400px,calc(70dvh * 2 / 3));
 height:auto;
 aspect-ratio:2/3;
 max-width:100%;
 max-height:min(70dvh,630px);
}
.card-viewer-active .table-card-view.has-copy #tableCardArtFrame{max-width:50%;flex:0 1 50%}
@media(max-width:700px){
 .card-viewer-active .table-card-view.has-copy #tableCardArtFrame{
  flex:none;width:100%;max-width:100%;max-height:52dvh;
 }
 .card-viewer-active .table-card-view #tableCardArtFrame .blueprint-card-view{
  max-height:52dvh;width:min(86vw,calc(52dvh * 2 / 3));
 }
}

/* v0.582: Independent refill shortcut, sharing the placement-panel visibility rule.
   When both actions are shown, stack them vertically rather than overlap. */
#surface #quickRefillAction{
 position:absolute;right:45px;bottom:12px;z-index:10001;
 min-height:34px;padding:6px 13px;border:1px solid #ad9266;border-radius:5px;
 background:#26372fe8;color:#f0deb5;box-shadow:0 2px 9px #0008;
 font:12px/1.2 Georgia,"Yu Mincho",serif;white-space:nowrap;
 touch-action:manipulation;
}
#surface #quickRefillAction.above-compact{bottom:54px}
#surface #quickRefillAction[hidden]{display:none!important}
#surface:has(#placementToolsContent:not([hidden])) #quickRefillAction{display:none!important}
@media(max-width:780px){
 #surface #quickRefillAction{right:47px;bottom:12px;min-height:38px;padding:7px 12px;font-size:12px}
 #surface #quickRefillAction.above-compact{bottom:58px}
}

/* v0.583: Keep both optional table arrangements on one line, compact first. */
#surface #tableArrangementShortcuts{
 position:absolute;right:45px;bottom:12px;z-index:10001;
 display:flex;flex-direction:row;align-items:center;justify-content:flex-end;
 gap:7px;max-width:calc(100% - 60px);pointer-events:none;
}
#surface #tableArrangementShortcuts > :is(#quickCompactAction,#quickRefillAction){
 position:static;left:auto;right:auto;top:auto;bottom:auto;
 flex:0 0 auto;pointer-events:auto;
}
#surface:has(#placementToolsContent:not([hidden])) #tableArrangementShortcuts{display:none!important}
@media(max-width:780px){
 #surface #tableArrangementShortcuts{right:47px;bottom:12px;max-width:calc(100% - 60px);gap:6px}
}


/* v0.586 — mobile tabletop settings: independent grid cells, natural label
   height, and an in-flow deal menu. Desktop popover behavior is unchanged. */
@media(max-width:780px){
 .main>.table-action-settings{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  align-items:start;
  column-gap:8px;
  row-gap:12px;
  padding:10px 10px 14px;
 }
 .main>.table-action-settings>label{
  box-sizing:border-box;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  justify-content:flex-start;
  width:100%;
  height:auto;
  min-height:0;
  min-width:0;
  margin:0;
  gap:6px;
  white-space:normal;
 }
 .main>.table-action-settings>label::before{
  display:block;
  flex:none;
  line-height:1.35;
 }
 .main>.table-action-settings>label:last-child::before{content:'オープン'}
 .main>.table-action-settings>label>span,
 .main>.table-action-settings #tableShuffleChoiceSlot,
 .main>.table-action-settings .table-wash-controls{
  box-sizing:border-box;
  width:100%;
  min-width:0;
 }
 .main>.table-action-settings .table-wash-controls{
  display:flex;
  align-items:stretch;
  gap:5px;
 }
 .main>.table-action-settings .table-wash-controls #tableWashDirection{
  flex:1 1 auto;
  width:0;
  min-width:0;
 }
 .main>.table-action-settings .table-wash-controls #tableWashRounds{
  flex:0 0 60px;
  width:60px;
  min-width:0;
 }
 .main>.table-action-settings select{
  box-sizing:border-box;
  display:block;
  width:100%;
  max-width:100%;
  min-width:0;
  height:36px;
  min-height:36px;
  font-size:12px;
 }
 .main>.table-action-settings .table-deal-control{
  box-sizing:border-box;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  min-width:0;
  width:100%;
  height:auto;
  min-height:0;
  gap:0;
 }
 .main>.table-action-settings .table-deal-control::before{
  content:'ディール';
  display:block;
  margin-bottom:6px;
  font:11px/1.35 Arial,'Hiragino Kaku Gothic ProN',sans-serif;
  color:var(--ui-text,#d6c9a6);
  opacity:.85;
 }
 .main>.table-action-settings .table-deal-controls #tableDealFace{height:36px;min-height:36px}

}

/* v0.616: One-step native animation picker; separate procedure menu and face. */
.table-action-settings .table-deal-controls #dealAnimation{
 box-sizing:border-box;flex:1 1 auto;width:0;min-width:0;max-width:none;
 height:30px;min-height:30px;padding:4px 19px 4px 6px;
 font:12px Georgia,'Yu Mincho',serif;color:#bfc7b8;
 border:1px solid #485849;border-radius:4px;background:#202a25;
 appearance:auto;-webkit-appearance:menulist;
}
/* v0.619: keep both Deal selectors level with Wash, Shuffle and Cut.
   This override follows the base 30px rules and uses the mobile 36px height. */
@media(max-width:780px){
 .main>.table-action-settings .table-deal-controls #dealAnimation,
 .main>.table-action-settings .table-deal-controls #tableDealFace{
  height:36px;min-height:36px;max-height:36px;
 }
}
/* Registered procedure choices appear inside the native animation menu. */
/* Registered physical piles also have an optional, non-interactive placement frame. */
#zone > .slot.registered-pile-frame{
 pointer-events:none;
 z-index:0;
}
#zone > .slot.registered-pile-frame .slot-num{
 position:absolute;
 top:2px;left:2px;
 font-size:10px;
 padding:2px 4px;
 background:#1d241fd9;
}

/* v0.589: The placement menu is a scrollable popover, including on phones.
   Its scroll surface is separate from the tabletop pan/pinch surface. */
#placementToolsContent{
 box-sizing:border-box;
 max-height:min(68dvh,420px);
 max-width:calc(100vw - 36px);
 overflow-x:hidden;
 overflow-y:auto;
 overscroll-behavior:contain;
 -webkit-overflow-scrolling:touch;
 touch-action:pan-y;
 scrollbar-width:thin;
}
@media(max-width:780px){
 #placementToolsContent{
  max-height:min(65dvh,calc(100vw - 42px),360px);
 }
}

/* v0.595 — quick deck access beside the spread; status lives below the table. */
.main>.stage-shell>.table-status{
 position:absolute;z-index:550;left:0;right:0;bottom:2px;
 display:block;box-sizing:border-box;height:23px;min-height:0;
 padding:3px 13px;margin:0;background:transparent;border:0;
 color:#c8bfa8;font:11px/1.45 var(--tabula-ui-font,Arial,sans-serif);
 white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none;
}
.toolbar-deck-picker{position:relative;flex:0 1 150px;min-width:105px;max-width:170px;z-index:7000;font-family:var(--tabula-ui-font,Arial,sans-serif)}
#toolbarDeckButton{display:flex;align-items:center;gap:6px;width:100%;height:38px;min-width:0;padding:5px 8px!important;
 border:1px solid #786b50;border-radius:5px;background:#27362e;color:#eedfbe;text-align:left;font:12px var(--tabula-ui-font,Arial,sans-serif)}
#toolbarDeckButton svg{flex:none;color:#d5bb83}#toolbarDeckName{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.toolbar-deck-chevron{flex:none;color:#bdaa83}#toolbarDeckButton[aria-expanded="true"]{border-color:#c7a66e;background:#3c4432}
#toolbarDeckButton:disabled{opacity:.55;cursor:default}
.toolbar-deck-menu{position:absolute;top:calc(100% + 5px);left:0;z-index:7100;width:max-content;min-width:250px;max-width:min(340px,calc(100vw - 20px));max-height:min(65dvh,480px);
 overflow-y:auto;overscroll-behavior:contain;padding:7px;background:#25332b;border:1px solid #796c50;border-radius:7px;box-shadow:0 14px 30px #000b}
.toolbar-deck-menu[hidden]{display:none!important}
.toolbar-deck-group{padding:9px 9px 5px;font:10px/1.3 var(--tabula-ui-font,Arial,sans-serif);letter-spacing:.08em;color:#c8aa74}
.toolbar-deck-group:not(:first-child){margin-top:5px;border-top:1px solid #655d49}
.toolbar-deck-option{display:block;width:100%;padding:10px 9px!important;margin:0;border:0;border-radius:4px;background:transparent;
 text-align:left;color:#f0e2c6;font:12px/1.35 var(--tabula-ui-font,Arial,sans-serif);white-space:normal;overflow-wrap:anywhere}
.toolbar-deck-option.secondary{color:#c4c0b3}
.toolbar-deck-option:hover,.toolbar-deck-option:focus-visible{background:#45523e;outline:1px solid #ad9162}
.toolbar-deck-option.selected{background:#554d36;color:#f9e8c4}
#desktopTableViews{width:148px!important;flex-basis:148px!important;grid-template-columns:17px repeat(4,minmax(0,1fr));gap:1px}
#desktopTableViews>button{height:34px}
.toolbar-spread-shortcut>span{display:none!important}
.toolbar-spread-shortcut{gap:3px}
.toolbar-spread-shortcut select{max-width:160px;min-width:100px}
@media(min-width:781px){
 .main>.toolbar{gap:5px;padding-left:9px;padding-right:9px}
 .main>.toolbar .toolbar-card-size{gap:3px;padding:3px 4px}
 .main>.toolbar .toolbar-card-size button{padding-left:5px!important;padding-right:5px!important}
}
@media(max-width:780px){
 .main>.stage-shell>.table-status{font-size:10px;height:22px;padding:3px 10px}
 .toolbar .mobile-cockpit-actions{grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:44px 42px;gap:6px}
 .toolbar .mobile-cockpit-actions>.toolbar-deck-picker{grid-column:1 / 5;grid-row:1;min-width:0;max-width:none;width:100%}
 .toolbar .mobile-cockpit-actions>.toolbar-spread-shortcut{grid-column:5 / -1;grid-row:1;min-width:0;width:100%;max-width:none}
 .toolbar .mobile-cockpit-actions>.toolbar-spread-shortcut select{width:100%;max-width:100%;min-width:0;height:44px;min-height:44px}
 .toolbar .mobile-cockpit-actions>#toolbarSoundToggle{grid-column:1;grid-row:2;min-width:0!important;width:100%!important}
 .toolbar .mobile-cockpit-actions>#inspectCards{grid-column:2;grid-row:2;min-width:0!important;width:100%!important}
 .toolbar .mobile-cockpit-actions>#spreadNotebook{grid-column:8;grid-row:2;min-width:0!important;width:100%!important}
 .toolbar .mobile-cockpit-actions>#newSessionStandalone{grid-column:3 / 8;grid-row:2;min-width:0;width:100%!important}
 #toolbarDeckButton{height:44px;font-size:11px;gap:4px;padding:5px 6px!important}
 #toolbarDeckButton svg{width:16px;height:16px}
 .toolbar-deck-menu{min-width:min(260px,calc(100vw - 20px));max-width:calc(100vw - 20px)}
}

/* v0.597 — PC toolbar starts at the left edge; the New Reading action alone
   absorbs unused horizontal space. Keep the existing mobile grid unchanged. */
@media(min-width:781px){
 .main>.toolbar{
  justify-content:flex-start;
 }
 .main>.toolbar .toolbar-trailing .mobile-cockpit-actions>#newSessionStandalone{
  flex:1 1 148px;
  width:auto;
  min-width:120px;
  max-width:none;
  margin-left:0;
  white-space:nowrap;
 }
}

/* v0.599 — slow, restrained 3-D reveal for FLOAT and staggered BLOOM.
   Transform only the inner face; outer card angle and position stay intact. */
/* Preserve both sides throughout the turn. Animating 'filter' on the
   3-D parent forced flattening in Chromium/WebKit and exposed the back twice. */
/* v0.606 — FLOAT follows a smoothly sampled lift and 180-degree turn.
   Linear interpolation prevents the browser easing separately at each stop. */
@keyframes tabula-ceremonial-turn{
 0%{transform:translate3d(0,0,0) rotateY(0deg)}
 10%{transform:translate3d(0,-2px,0) rotateY(5deg)}
 20%{transform:translate3d(0,-6px,0) rotateY(18deg)}
 30%{transform:translate3d(0,-12px,0) rotateY(38deg)}
 40%{transform:translate3d(0,-18px,0) rotateY(63deg)}
 50%{transform:translate3d(0,-22px,0) rotateY(90deg)}
 60%{transform:translate3d(0,-18px,0) rotateY(117deg)}
 70%{transform:translate3d(0,-12px,0) rotateY(142deg)}
 80%{transform:translate3d(0,-6px,0) rotateY(162deg)}
 90%{transform:translate3d(0,-2px,0) rotateY(175deg)}
 100%{transform:translate3d(0,0,0) rotateY(180deg)}
}
#zone .card.ceremonial-opening{
 perspective:900px;
 -webkit-perspective:900px;
}
#zone .card.faceup.ceremonial-opening .card-inner{
 animation:tabula-ceremonial-turn 1050ms linear var(--ceremonial-delay,0ms) both!important;
 transition:none!important;
 transform-style:preserve-3d!important;
 -webkit-transform-style:preserve-3d!important;
 will-change:transform;
}
#zone .card.ceremonial-opening .card-inner>.face{
 backface-visibility:hidden!important;
 -webkit-backface-visibility:hidden!important;
}
#zone .card.ceremonial-opening .card-inner>.face.front{
 transform:rotateY(180deg);
 -webkit-transform:rotateY(180deg);
}
@keyframes tabula-ceremonial-pile{
 0%,100%{transform:translateY(0)}
 50%{transform:translateY(-18px)}
}
#zone .table-pile-top.ceremonial-opening{
 animation:tabula-ceremonial-pile 1050ms ease-in-out var(--ceremonial-delay,0ms) both!important;
}
#zone.ceremonial-opening-active{pointer-events:none}
@media(prefers-reduced-motion:reduce){
 #zone .card.faceup.ceremonial-opening .card-inner,
 #zone .table-pile-top.ceremonial-opening{animation:none!important}
}

/* v0.602 — keep the native spread selector accessible next to the deck menu. */
.main>.toolbar .toolbar-spread-shortcut{
 position:relative;
 z-index:7001;
 min-width:0;
}
.main>.toolbar .toolbar-spread-shortcut select{
 position:relative;
 z-index:1;
 pointer-events:auto;
}

/* v0.605 — BLOOM: continuous, wind-borne turn. Sample the smooth
   flight path at even intervals and interpolate linearly between samples.
   This avoids re-easing to a stop at every intermediate keyframe. */
@keyframes tabula-bloom-gust{
 0%{transform:translate3d(0,0,0) rotateZ(0deg) rotateX(0deg) rotateY(0deg)}
 10%{transform:translate3d(-3px,-3px,0) rotateZ(-2deg) rotateX(-3deg) rotateY(5deg)}
 20%{transform:translate3d(-5px,-8px,0) rotateZ(-3deg) rotateX(-6deg) rotateY(19deg)}
 30%{transform:translate3d(1px,-15px,0) rotateZ(-2deg) rotateX(-8deg) rotateY(40deg)}
 40%{transform:translate3d(var(--bloom-wind-half,16px),-23px,0) rotateZ(var(--bloom-tilt,0deg)) rotateX(-10deg) rotateY(65deg)}
 50%{transform:translate3d(var(--bloom-wind,30px),-31px,0) rotateZ(3deg) rotateX(-10deg) rotateY(90deg)}
 60%{transform:translate3d(var(--bloom-wind,30px),-32px,0) rotateZ(4deg) rotateX(-9deg) rotateY(115deg)}
 70%{transform:translate3d(var(--bloom-wind-half,16px),-25px,0) rotateZ(3deg) rotateX(-7deg) rotateY(140deg)}
 80%{transform:translate3d(7px,-16px,0) rotateZ(2deg) rotateX(-4deg) rotateY(161deg)}
 90%{transform:translate3d(2px,-6px,0) rotateZ(1deg) rotateX(-2deg) rotateY(175deg)}
 100%{transform:translate3d(0,0,0) rotateZ(0deg) rotateX(0deg) rotateY(180deg)}
}
#zone .card.faceup.ceremonial-opening.bloom-opening .card-inner{
 animation:tabula-bloom-gust 1350ms linear var(--ceremonial-delay,0ms) both!important;
}
@keyframes tabula-bloom-pile-gust{
 0%{transform:translate3d(0,0,0)}
 10%{transform:translate3d(-3px,-3px,0)}
 20%{transform:translate3d(-5px,-8px,0)}
 30%{transform:translate3d(1px,-15px,0)}
 40%{transform:translate3d(var(--bloom-wind-half,16px),-21px,0)}
 50%,60%{transform:translate3d(var(--bloom-wind,30px),-28px,0)}
 70%{transform:translate3d(var(--bloom-wind-half,16px),-22px,0)}
 80%{transform:translate3d(7px,-14px,0)}
 90%{transform:translate3d(2px,-5px,0)}
 100%{transform:translate3d(0,0,0)}
}
#zone .table-pile-top.ceremonial-opening.bloom-opening{
 animation:tabula-bloom-pile-gust 1350ms linear var(--ceremonial-delay,0ms) both!important;
}



/* v0.629 — Scope visual themes to persistent controls.
   The entire v0.622–0.628 light-theme patch stack is consolidated here.
   Opened windows intentionally use the original shared dark reference style. */
body[data-visual-theme="minimal"]{
 --light-action-band:#cfc2b2;
 --light-action-face:#77695a;
 --light-action-text:#fff9ec;
 --light-action-border:#665849;
 --light-action-symbol:#f2d8a4;
 --light-action-hover:#665849;
 --light-setting-band:#ded7cb;
 --light-setting-face:#ede7dc;
 --light-setting-text:#423a33;
 --light-setting-border:#a69b8c;
 --light-sidebar-bronze:#725437;
 --light-sidebar-rule:#947757;
 --light-sidebar-link-bg:#e0d5c4;
 --light-sidebar-link-border:#91775a;
}
body[data-visual-theme="lovely"]{
 --light-action-band:#e5c8d9;
 --light-action-face:#925d80;
 --light-action-text:#fff7fa;
 --light-action-border:#815070;
 --light-action-symbol:#ffdfad;
 --light-action-hover:#814b6d;
 --light-setting-band:#f1e0e9;
 --light-setting-face:#f8edf3;
 --light-setting-text:#593b51;
 --light-setting-border:#c5a5b9;
 --light-sidebar-bronze:#80506b;
 --light-sidebar-rule:#ab7996;
 --light-sidebar-link-bg:#f1d9e6;
 --light-sidebar-link-border:#ac7899;
}
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) .table-shortcuts{
 background:var(--light-action-band)!important;
 border-top:1px solid var(--light-action-border);
 border-bottom:1px solid var(--light-action-border);
}
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) .table-shortcuts button:not(:disabled){
 background:var(--light-action-face);
 color:var(--light-action-text);
 border-color:var(--light-action-border);
}
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) .table-shortcuts .quick-symbol{
 color:var(--light-action-symbol);
}
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) .table-action-settings{
 background:var(--light-setting-band);
 color:var(--light-setting-text);
 border-bottom:1px solid var(--light-setting-border);
}
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) .table-action-settings :is(select,#quickShuffleChoice,#dealAnimation,#tableDealFace){
 background:var(--light-setting-face);
 color:var(--light-setting-text);
 border-color:var(--light-setting-border);
}
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) aside header .tabula-brand h1,
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) aside header .tabula-series,
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) aside .deck-setting-heading,
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) aside .wash-header{
 color:var(--light-sidebar-bronze);
}
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) aside header .tabula-series::before,
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) aside header .tabula-series::after{
 background:var(--light-sidebar-rule);
}
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) aside .section #cardGalleryOpen,
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) aside .table-current-chip,
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) aside .wash-settings{
 background:var(--light-sidebar-link-bg);
 border-color:var(--light-sidebar-link-border);
 color:var(--ui-text);
}
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) aside .section #cardGalleryOpen :is(svg,svg *){
 color:currentColor;
}
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) aside .deck-edit-actions a[href$="deck-designer.html"]{
 color:var(--light-sidebar-bronze)!important;
 border-color:var(--light-sidebar-link-border)!important;
}
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) aside :is(.wash-header .mini,.wash-settings .field,.table-current-chip strong){
 color:var(--ui-text);
}
body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) #tableManagement #tableDisplaySettings .label-cycle-settings>summary{
 background:var(--ui-tool)!important;
 color:var(--ui-text)!important;
 border-color:var(--ui-accent)!important;
}
@media(hover:hover){
 body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) .table-shortcuts button:not(:disabled):hover{
  background:var(--light-action-hover);
 }
 body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) #tableManagement #tableDisplaySettings .label-cycle-settings>summary:hover,
 body:is([data-visual-theme="minimal"],[data-visual-theme="lovely"]) aside .section #cardGalleryOpen:hover{
  background:var(--light-sidebar-link-bg)!important;
 }
}

/* Reference windows are visually independent of the active tabletop theme.
   CSS variables are reset at each window boundary to protect shared headings
   and controls which intentionally use theme tokens inside their own content. */
:is(.modal-bg,#cardGallery,#spreadArchive){
 --ui-bg:#151b18;
 --ui-aside:#202821;
 --ui-tool:#20271e;
 --ui-text:#eee0c8;
 --ui-accent:#bda477;
 --ui-muted:#a9a28e;
 --ui-border:#655c49;
 color:#e9dec7;
}

/* v0.631 — mobile theme boundaries.
   On narrow screens, aside uses display:contents; its section backgrounds
   no longer receive the aside background. Theme those persistent sections
   explicitly, but leave opened dialogs and reference windows unthemed. */
@media(max-width:780px){
 body :is(.shell>aside>header,.shell>aside>.section,.shell>aside>.aside-help-area){
  background:var(--ui-aside);
  color:var(--ui-text);
  border-color:var(--ui-border,#655c49);
 }
 body .shell>aside>.aside-help-area :is(button,.aside-help-button){
  color:var(--ui-text);
  border-color:var(--ui-accent);
  background:var(--ui-tool);
 }
 body .shell>aside>.section :is(.section-title,.section-hint){
  color:var(--ui-text);
 }
 body .shell>aside>.section :is(.field,.mini){
  color:var(--ui-text);
 }
 body .shell>.main>.table-utility-actions button,
 body .shell>.main>.table-record-actions button{
  background:var(--ui-tool);
  color:var(--ui-text);
  border-color:var(--ui-accent);
 }
}
/* Preserve the reference palette on all viewports, independent of whichever
   theme is selected for the table. These selectors target only controls
   inside opened reference views; the normal tabletop buttons are untouched. */
#cardGallery :is(.gallery-head,.gallery-controls,.face-preferences){
 color:#e9dec7;
}
#cardGallery :is(#cardGalleryClose,#galleryDeckIntroDefault,#galleryDeckIntroCancel,
  #cardGalleryBack,#cardGalleryPrev,#cardGalleryNext){
 background:#373a32;
 color:#f3e5cb;
 border-color:#827357;
}
#cardGallery :is(#cardGalleryDeck,#cardGalleryFilter,#galleryDeckIntroInput){
 background:#302f29;
 color:#f3e8d3;
 border-color:#71644c;
}
#cardGallery .gallery-deck-intro-toggle{
 background:transparent;
 color:#d4bd8e;
 border-color:transparent;
}
#cardGallery .gallery-deck-intro-actions #galleryDeckIntroEdit{
 background:transparent;
 color:#b6a47d;
 border-color:transparent;
}
#cardGallery #galleryDeckIntroSave{
 background:#5c5239;
 color:#fff0d2;
 border-color:#b79b63;
}
#modalBg .modal{
 color:#e9dec7;
 background:#292b25;
}
#modalBg :is(button,select,input,textarea){
 color:#f3e5cb;
 background:#373a32;
 border-color:#827357;
}
#modalBg :is(input,select,textarea){
 background:#302f29;
 color:#f3e8d3;
 border-color:#71644c;
}
/* Preserve transparencies in the editorial and navigation controls. */
#modalBg :is(.about-license,.about-back,.tarot-editor-nav button){
 background:transparent;
}
