/* Original presentation only: the engine's indices, pips and click targets stay in place. */
.cards-appearance{position:relative;z-index:1;box-sizing:border-box;display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;margin:0;padding:12px 18px;background:#fffaf0;color:#253f3c;border-bottom:1px solid #cfccb8;font:14px/1.4 system-ui,sans-serif;text-align:start;flex:0 0 auto}
.cards-appearance>label{font-weight:700}
.cards-appearance .select,.cards-appearance .btn{box-sizing:border-box;min-height:44px;max-width:100%;border:1px solid #a9bcb2;border-radius:9px;padding:8px 12px;background:#fffdf5;color:#25433c;font:600 14px/1.35 system-ui,sans-serif;touch-action:manipulation;white-space:normal;overflow-wrap:anywhere;cursor:pointer}
.cards-appearance .select{min-width:145px;max-width:240px}
.cards-art-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.cards-appearance .btn:disabled{opacity:.55;cursor:default}
.cards-appearance [hidden]{display:none!important}
.cards-appearance :focus-visible,.cards-gallery-dialog :focus-visible{outline:3px solid #1767b5;outline-offset:3px}
#card-art-status{flex:1 1 210px;min-width:0;margin:0;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
[data-cards-style=living][data-cards-ready=true] .board-scroll,
[data-cards-style=living][data-cards-ready=true] .board-panel,
[data-cards-style=living][data-cards-ready=true] .table-area{background-image:linear-gradient(#173e33e8,#173e33e8),var(--cards-living-wood)!important;background-size:cover!important;background-position:center!important}
[data-cards-style=living][data-cards-ready=true] .card:not(.back){background:linear-gradient(115deg,#fffef7,#f4ecd9);border-color:#b9ae92;box-shadow:0 2px 3px #08271c55,0 5px 10px #08271c26;color:#183c35}
[data-cards-style=living][data-cards-ready=true] .card.red{color:#b6243c}
[data-cards-style=living][data-cards-ready=true] .card .corner,
[data-cards-style=living][data-cards-ready=true] .card .bottom-corner{z-index:2}
[data-cards-style=living][data-cards-ready=true] .card.back{background:repeating-linear-gradient(45deg,#184d43,#184d43 5px,#285f52 5px,#285f52 10px);border-color:#fff6df}
[data-cards-style=living][data-cards-ready=true] .card.back::after{color:#f4d59a;border-color:#e5c17d}
[data-cards-style=living][data-cards-ready=true] .stock-button:not(.empty),[data-cards-style=living][data-cards-ready=true] .stock-pile{background:repeating-linear-gradient(45deg,#184d43,#184d43 5px,#285f52 5px,#285f52 10px);border-color:#fff6df;color:#fff7e2}
[data-cards-style=living][data-cards-ready=true] .stock-button .stock-count,[data-cards-style=living][data-cards-ready=true] .stock-pile .stock-count{background:#173c30;color:#fff7e2}
[data-cards-style=living][data-cards-ready=true] .card.selected{box-shadow:0 0 0 4px #ffcf57,0 6px 15px #002f3655}
[data-cards-style=living][data-cards-ready=true] .card.hinted{border-color:#dfba54;box-shadow:0 0 0 4px #65f2ec,0 4px 9px #002f3655}
[data-cards-style=living][data-cards-ready=true] .card:focus-visible{outline:3px solid #ffdb73;outline-offset:3px;z-index:12}
/* Hide only the court SVG after its photograph is ready; numeric SVGs stay exact. */
[data-cards-style=living][data-cards-ready=true] .cards-court-art>svg{visibility:hidden}
.cards-living-court{position:absolute;display:none;left:50%;top:50%;height:100%;max-height:100%;max-width:100%;aspect-ratio:var(--card-court-ratio,2/3);transform:translate(-50%,-50%);background-image:var(--cards-living-court);background-size:400% 300%;background-repeat:no-repeat;clip-path:inset(1% 0 0);pointer-events:none}
[data-cards-style=living][data-cards-ready=true] .cards-living-court,.cards-gallery-dialog[data-cards-ready=true] .cards-living-court{display:block}
[data-cards-motion=off] .card{animation:none!important;transition:none!important}
[data-cards-motion=off] .card.hinted{outline:3px solid #edb637;outline-offset:2px}
/* Journey uses a single bottom suit; keep it visible beside the portrait. */
[data-cards-type=journey][data-cards-style=living][data-cards-ready=true] .card .large-suit{z-index:2;font-size:18px;right:4px;bottom:4px}
[data-cards-type=journey][data-cards-style=living][data-cards-ready=true] .table-top{background:#fff8e8;color:#254236;border-bottom-color:#cbbd9c}
[data-cards-type=journey][data-cards-style=living][data-cards-ready=true] .table-top .route-badge,[data-cards-type=journey][data-cards-style=living][data-cards-ready=true] .table-top .rule-text{color:#254236}
.table-shell[data-theme=night][data-cards-style=living][data-cards-ready=true] .board-scroll{background-image:linear-gradient(#182c4ae8,#182c4ae8),var(--cards-living-wood)!important}
.table-shell[data-theme=felt][data-cards-style=living][data-cards-ready=true] .board-scroll{background-image:linear-gradient(#1c5b42e8,#184d38e8),var(--cards-living-wood)!important}
[data-cards-type=journey][data-cards-style=living][data-cards-ready=true] .playbar{background:#f7f1df}
[data-cards-type=journey][data-cards-style=living][data-cards-ready=true] .playbar .pile-label,[data-cards-type=journey][data-cards-style=living][data-cards-ready=true] .playbar .move-note strong,[data-cards-type=journey][data-cards-style=living][data-cards-ready=true] .playbar .move-note p{color:#254236}
[data-cards-type=journey][data-cards-style=living][data-cards-ready=true] .playbar .move-note.warning strong{color:#8b2433}
[data-cards-type=journey][data-cards-style=living][data-cards-ready=true] .playbar .quiet{background:#fffaf0;color:#254236;border:1px solid #bcb39a}
.cards-living-flight{position:fixed;inset:0;z-index:100;pointer-events:none!important}
.cards-living-ghost{position:fixed!important;pointer-events:none!important;margin:0!important;min-height:0!important;max-width:none!important;max-height:none!important;z-index:1!important;animation:none!important;transition:none!important}
.cards-gallery-dialog{box-sizing:border-box;width:min(1000px,calc(100vw - 28px));max-height:calc(100vh - 28px);max-height:calc(100dvh - 28px);border:1px solid #bdb69f;border-radius:20px;padding:24px;background:#fffbf1;color:#253f3c;box-shadow:0 20px 70px #112a3466;font:16px/1.5 system-ui,sans-serif;overflow:auto;text-align:start}
.cards-gallery-dialog::backdrop{background:#142d3bcc}
.cards-gallery-dialog h2{margin:0 0 12px;font:700 1.7rem/1.2 Georgia,serif}
.cards-gallery-dialog>p{margin:8px 0 14px;line-height:1.5}
.cards-gallery-dialog [hidden]{display:none!important}
.cards-gallery-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;direction:ltr;margin-top:18px}
.cards-gallery-item{min-width:0;padding:10px;border:1px solid #cfc5a9;border-radius:12px;background:#fffef8}
.cards-gallery-image{position:relative;height:240px;overflow:hidden;border-radius:8px;background:linear-gradient(#fffaf0,#eae2d0);display:grid;place-items:center}
.cards-gallery-fallback{font:700 3rem/1.2 Georgia,serif;color:#1f4238}
.cards-gallery-item.red .cards-gallery-fallback,.cards-gallery-item.red .cards-gallery-index{color:#b6243c}
.cards-gallery-dialog[data-cards-ready=true] .cards-gallery-fallback{visibility:hidden}
.cards-gallery-item h3{font-size:14px;line-height:1.5;font-weight:650;margin:10px 0 0;text-align:center;overflow-wrap:anywhere}
.cards-gallery-index{display:inline-block;padding:1px 5px;margin-inline-end:5px;border:1px solid #cfc5a9;border-radius:4px;background:#fffaf0;font:700 15px/1.5 Georgia,serif;color:#1f4238;white-space:nowrap}
.cards-gallery-actions{position:sticky;z-index:2;bottom:-24px;padding:12px 0 0;margin-top:20px;background:#fffbf1;text-align:end}
.cards-gallery-dialog button{box-sizing:border-box;min-height:44px;border:1px solid #a9bcb2;border-radius:9px;padding:10px 15px;background:#255e4b;color:#fffaf0;font:600 14px/1.4 system-ui,sans-serif;touch-action:manipulation;cursor:pointer;white-space:normal;overflow-wrap:anywhere}
.cards-gallery-dialog #card-gallery-retry{background:#fffdf5;color:#25433c}
html[data-km-contrast=high] .cards-appearance,html[data-km-contrast=high] .cards-gallery-dialog,html[data-km-contrast=high] .cards-gallery-item{background:#fff;color:#102b20;border-color:#102b20;border-width:2px}
html[data-km-contrast=high] [data-cards-style=living][data-cards-ready=true] .card:not(.back){border:2px solid #111;color:#090909}
html[data-km-contrast=high] [data-cards-style=living][data-cards-ready=true] .card.red{color:#a70000}
html[data-km-contrast=high] [data-cards-style=living][data-cards-ready=true] .card.selected{outline:3px solid #ffcf57;outline-offset:2px}
@media(max-width:700px){.cards-appearance{gap:7px 9px;padding:10px 12px}.cards-art-actions{gap:7px}.cards-appearance .select{min-width:0;flex:1 1 145px;max-width:100%}.cards-art-actions{flex:1 1 100%}.cards-art-actions>.btn{flex:1 1 140px}#card-art-status{flex-basis:100%}.cards-gallery-dialog{padding:18px}.cards-gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.cards-gallery-image{height:220px}.cards-gallery-actions{bottom:-18px}.cards-gallery-item{padding:7px}}
@media(max-width:360px){.cards-gallery-dialog{padding:13px}.cards-gallery-image{height:180px}.cards-gallery-item h3{font-size:13px}.cards-gallery-actions{bottom:-13px}}
@media(max-height:500px){.cards-appearance{padding:7px 10px;gap:6px 9px}.cards-appearance>label{font-size:12px}.cards-art-actions>.btn{flex:none}.cards-art-actions{flex-basis:auto}#card-art-status{flex-basis:150px}.cards-gallery-dialog{padding:16px}.cards-gallery-image{height:170px}.cards-gallery-actions{bottom:-16px}}
@media(prefers-reduced-motion:reduce){.cards-living-ghost,.cards-gallery-dialog *{animation:none!important;transition:none!important}}
