/* Tabletop cards: uncoated stock, dyed art panels, and restrained cut edges. */
:root {
  --card-scale: 1;
  --card-w: min(calc(300px * var(--card-scale)), calc(100vw - 64px));
  --font-title: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --ink: #292e29;
  --muted: #737365;
  --stock: #ded9c7;
  --page: #405348;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Cpath fill='%23808080' filter='url(%23n)' opacity='.28' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
}
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; background: var(--page); color: #e9e6d9; font: 14px/1.6 var(--font-sans); background-image: var(--grain); }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, .card-wrapper:focus-visible { outline: 2px solid #e5ba77; outline-offset: 5px; }
.stage-container { max-width: 1460px; margin: auto; padding: 48px 50px 100px; }
.cards-grid { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--card-w), 100%), 1fr)); gap: 64px 40px; justify-items: center; align-items: start; }
/* Header slots retain the resting deal of the draggable controls. */
.table-header { grid-column: 1 / -1; width: 100%; display: flex; align-items: flex-start; justify-content: space-between; gap: 45px; min-height: 140px; pointer-events: none; }
.title-card-slot, .title-card { width: min(290px, calc(100vw - 64px)); height: 132px; flex-shrink: 0; }
.title-card .playing-card { padding: 23px 27px; justify-content: center; background-color: #a45640; color: #f0dfb9; border-color: #bc775b; border-bottom-color: #703d2f; box-shadow: 0 1px 0 #8c4935, 0 2px 0 #7b402e, 0 3px 0 #713c2d, 0 4px 1px #21322877, 0 12px 18px -9px #14261ccc; }
.title-card h1 { font: 600 40px/1 var(--font-title); letter-spacing: -.02em; }
.title-card p { margin-top: 12px; font-size: 12px; letter-spacing: .025em; }
.table-controls { position: relative; z-index: 5; pointer-events: auto; max-width: 570px; display: flex; flex-direction: column; align-items: flex-end; gap: 27px; padding: 10px 0 0; }
.card-filters { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; padding: 0 3px; }
.table-token, .size-token { color: var(--ink); background: var(--grain), #d4ceba; border: 1px solid #e6dfc9; border-bottom-color: #a8a088; border-radius: 3px; box-shadow: 0 1px 0 #b5ab91, 0 2px 0 #a49b80, 0 3px 0 #948d74, 0 6px 8px #16291e55; }
.table-token { padding: 10px 13px; font: 500 11px/1.2 var(--font-sans); transform: translateY(var(--offset, 0px)) rotate(var(--angle, -1deg)); transition: transform .13s ease, box-shadow .13s ease; white-space: nowrap; }
.table-token:nth-child(2) { --angle: 1.6deg; --offset: 4px; }
.table-token:nth-child(3) { --angle: -.8deg; --offset: -2px; }
.table-token:nth-child(4) { --angle: 1.1deg; --offset: 2px; }
.table-token:nth-child(5) { --angle: -1.8deg; --offset: 5px; }
.table-token[aria-pressed="true"], .table-token:active { transform: translateY(calc(var(--offset, 0px) + 3px)) rotate(var(--angle, -1deg)); box-shadow: 0 1px 0 #a49b80, 0 2px 3px #16291e44; }
.size-token { display: flex; align-items: center; gap: 20px; padding: 14px 19px; margin-right: 10px; transform: rotate(-1.3deg); font-size: 10px; }
.size-token input { appearance: none; width: 135px; height: 4px; border-radius: 0; background: #8d8b7566; box-shadow: inset 0 1px 2px #343a3540, 0 1px 0 #f4ecda88; cursor: ew-resize; }
.size-token input::-webkit-slider-thumb { appearance: none; width: 13px; height: 19px; border-radius: 1px; background: var(--grain), #69725c; border: 1px solid #858b72; box-shadow: 0 2px 0 #495640, 0 3px 4px #24342655; }
.size-token input::-moz-range-thumb { width: 13px; height: 19px; border-radius: 1px; background: var(--grain), #69725c; border: 1px solid #858b72; box-shadow: 0 2px 0 #495640, 0 3px 4px #24342655; }
@media (max-width: 1050px) { .table-header { gap: 28px; } .table-controls { max-width: 410px; } }
@media (max-width: 760px) { .table-header { flex-direction: column; gap: 27px; } .table-controls { align-self: flex-end; padding: 0; gap: 23px; } .card-filters { gap: 11px; } .table-token { padding: 9px 11px; } }
.card-wrapper { width: var(--card-w); aspect-ratio: 1 / 1.42; position: relative; perspective: 1200px; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; border-radius: 8px; }
.card-wrapper.title-card { position: absolute; top: 0; left: 0; width: min(290px, calc(100vw - 64px)); height: 132px; aspect-ratio: auto; }
.card-wrapper.is-hovered { z-index: 2; }
.card-wrapper.is-dragging { cursor: grabbing; z-index: 3; }
.card-wrapper.is-dragging .playing-card { transform: translateZ(6px); }
.playing-card { width: 100%; height: 100%; padding: 5.5%; display: flex; flex-direction: column; gap: 0; color: var(--ink); background-color: var(--stock); background-image: linear-gradient(120deg, #fff9e81a, #5c58310a), var(--grain); border: 1px solid #f7f1ddbb; border-bottom-color: #b8af96; border-radius: 8px; position: relative; pointer-events: none; box-shadow: 0 1px 0 #c7bea5, 0 2px 0 #b9b095, 0 3px 0 #b0a88e, 0 4px 0 #9d9980, 0 5px 1px #1a2b224a, 0 9px 13px -7px #14261ccc, 0 18px 32px -16px #14241ba6; transition: transform .2s ease, box-shadow .2s ease; }
.playing-card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(115deg, #fff7db0d, transparent 50%, #544a3010); pointer-events: none; }
.card-wrapper.is-hovered .playing-card, .card-wrapper:focus-visible .playing-card { box-shadow: 0 1px 0 #c7bea5, 0 2px 0 #b9b095, 0 3px 0 #b0a88e, 0 4px 0 #9d9980, 0 5px 1px #1a2b224a, 0 13px 17px -8px #14261ccc, 0 23px 35px -14px #14241b99; }
.tc-header { display: flex; align-items: center; justify-content: space-between; gap: 9px; min-height: calc(var(--card-w) * .115); margin-bottom: 4%; }
.tc-title { font: 600 calc(var(--card-w) * .088)/.95 var(--font-title); letter-spacing: .005em; text-transform: uppercase; text-wrap: balance; }
.tc-badge { display: inline-flex; align-items: center; flex-shrink: 0; font: 500 calc(var(--card-w) * .026)/1.4 var(--font-sans); letter-spacing: .06em; padding: .4em .5em; background: #333b32; color: #e6dfc9; border: 1px solid #333b32; border-radius: 1px; }
.tc-art-frame { flex-shrink: 0; width: 100%; height: calc(var(--card-w) * .59); display: flex; align-items: center; justify-content: center; position: relative; border-radius: 2px; background-color: var(--tint); background-image: radial-gradient(ellipse at 30% 15%, #fff7dc0d, transparent 65%), var(--grain); color: var(--tone); border: 1px solid #ffffff30; border-bottom-color: #514c3a30; box-shadow: inset 0 1px 3px #151c2445, 0 1px 0 #fff8de99; }
.tc-art-frame::before { content: ''; position: absolute; inset: 8px; border: 1px solid currentColor; opacity: .3; border-radius: 1px; }
.tc-art-svg { width: 31%; height: 48%; stroke-width: 1.15; opacity: .95; }
.tc-type-line { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin: 5% 0 0; font: 600 calc(var(--card-w) * .030)/1.45 var(--font-sans); color: #404b3d; text-transform: uppercase; letter-spacing: .025em; }
.tc-text-box { flex: 1; display: flex; align-items: flex-start; padding: 5% 0; margin-top: 3%; border-top: 1px solid #68705966; }
.tc-tagline { font: 400 calc(var(--card-w) * .044)/1.5 var(--font-sans); color: #41493b; }
.tc-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 3%; border-top: 1px solid #68705966; font: 400 calc(var(--card-w) * .024)/1.5 var(--font-sans); color: #747665; }
.tc-stack { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-card-num { white-space: nowrap; color: #5a604f; }
.theme-denim { --tint: #435b61; --tone: #d7d7bc; }
.theme-terracotta { --tint: #895841; --tone: #e9d3a5; }
.theme-ochre { --tint: #a38940; --tone: #eee1b9; }
.theme-teal { --tint: #3e645b; --tone: #d3d7b8; }
.theme-sage { --tint: #727d57; --tone: #e5dec0; }
.theme-seafoam { --tint: #637f6c; --tone: #e1dfbd; }
.theme-moss { --tint: #586446; --tone: #e0dabc; }
.theme-apricot { --tint: #997447; --tone: #ead9b0; }
.theme-sand { --tint: #8a8060; --tone: #eee4c7; }
.theme-graphite { --tint: #545c53; --tone: #dbdbc3; }
.modal-backdrop { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; background: #14251dd9; backdrop-filter: blur(6px); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s, visibility .2s; }
.modal-backdrop.open { opacity: 1; visibility: visible; pointer-events: auto; }
.dossier-card { width: min(100%, 640px); max-height: calc(100dvh - 48px); overflow-y: auto; padding: 40px; background: var(--grain), var(--stock); border: 1px solid #f7f1dd99; border-radius: 8px; color: var(--ink); position: relative; box-shadow: 0 2px 0 #bfb69d, 0 4px 0 #a49e86, 0 24px 60px #0005; }
.modal-close-btn { position: absolute; top: 15px; right: 15px; width: 32px; height: 32px; border: 1px solid #89897640; border-radius: 50%; background: #f0ecdf; color: var(--ink); font-size: 22px; }
.dossier-header { display: flex; align-items: center; gap: 22px; padding-right: 8px; margin: 12px 0 28px; }
.dossier-emblem { width: 86px; height: 92px; flex-shrink: 0; }
.dossier-emblem svg { width: 40px; height: 40px; }
.dossier-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.dossier-meta .tc-badge { font-size: 9px; }
.dossier-title { font: 600 42px/1.03 var(--font-title); letter-spacing: 0; text-transform: uppercase; }
.dossier-description { font-size: 14px; line-height: 1.85; color: #555c4d; margin-bottom: 28px; }
.dossier-specs { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; padding: 24px; background: var(--grain), #eee9da; box-shadow: 0 1px 0 #bcb49d, 0 3px 6px #514d3622; }
.spec-item { display: flex; flex-direction: column; gap: 5px; }
.spec-label { color: #767967; font: 9px/1.4 var(--font-sans); text-transform: uppercase; letter-spacing: .06em; }
.spec-val { font-size: 11px; color: #4d5546; }
.dossier-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 30px; }
.dossier-nav-btn { padding: 10px 12px; border: 1px solid #8d907b44; color: #59624e; background: transparent; border-radius: 4px; font-size: 11px; }
.dossier-nav-btn:hover { background: #fff4; }
.btn-launch { display: flex; gap: 20px; align-items: center; background: #3e5141; color: #f0eedf; border: 1px solid #314334; border-radius: 4px; padding: 12px 18px; font-size: 11px; text-decoration: none; box-shadow: 0 2px 0 #243128; }
.btn-launch:hover { background: #314535; }
.site-footer { max-width: 1424px; margin: auto; padding: 25px 0 35px; border-top: 1px solid #ffffff1a; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; color: #b3bcae; font-size: 10px; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { color: #b3bcae; text-decoration: none; }
.footer-links a:hover { color: #eeeadd; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

.card-slot { width: var(--card-w); aspect-ratio: 1 / 1.42; pointer-events: none; }
.card-table-scene { position: absolute; left: 0; top: 0; pointer-events: none; }
@media (max-width: 760px) {
  .stage-container { padding: 44px 32px 65px; }
  .cards-grid { gap: 46px 30px; }
  .site-footer { margin: 0 20px; }
  .footer-inner { flex-wrap: wrap; }
  .dossier-card { padding: 28px 22px; }
  .dossier-title { font-size: 30px; }
  .dossier-emblem { width: 65px; height: 78px; }
  .dossier-specs { padding: 18px; gap: 16px; }
  .dossier-actions { flex-wrap: wrap; }
}
