:root {
  --ink: #172039;
  --ink-soft: #61728d;
  --deep: #091020;
  --deep-2: #111a2d;
  --deep-3: #1a2945;
  --felt: #111c37;
  --felt-light: #1b345b;
  --cream: #eef4ff;
  --paper: #f9fcff;
  --sand: #b7c7df;
  --muted: #8d9cb5;
  --gold: #50d8ed;
  --gold-light: #b9f5ff;
  --red: #e97994;
  --red-dark: #a94763;
  --border-dark: rgba(186, 218, 245, 0.18);
  --shadow-deep: 0 24px 60px rgba(1, 7, 20, 0.42);
  --radius-lg: 28px;
  --radius-md: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--cream);
  background:
    radial-gradient(circle at 78% 10%, rgba(37, 177, 207, 0.15), transparent 26rem),
    radial-gradient(circle at 0% 44%, rgba(70, 102, 196, 0.12), transparent 25rem),
    var(--deep);
  font-family: "Manrope", "Microsoft YaHei", sans-serif;
  min-width: 320px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.13;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  z-index: 20;
}

button, a { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: not-allowed; }

.app-shell { min-height: 100vh; overflow: hidden; }

.topbar {
  height: 76px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(186, 218, 245, 0.12);
  position: relative;
  z-index: 2;
}

.brand { color: var(--cream); text-decoration: none; display: flex; gap: 12px; align-items: center; }
.brand-mark { position: relative; width: 36px; height: 36px; display: block; color: var(--gold-light); font-family: Georgia, serif; font-size: 20px; }
.brand-mark span { position: absolute; line-height: 1; }
.brand-mark span:first-child { top: 1px; left: 2px; }
.brand-mark span:last-child { right: 0; bottom: 0; color: #f08aa1; font-size: 18px; }
.brand-copy { display: flex; flex-direction: column; gap: 1px; }
.brand-copy strong { font-family: "Noto Serif SC", serif; font-size: 18px; font-weight: 700; letter-spacing: 0.18em; }
.brand-copy small { color: var(--muted); font: 500 8px/1.2 "DM Mono", monospace; letter-spacing: 0.25em; }
.topbar-center { display: flex; align-items: center; gap: 13px; color: var(--muted); font: 500 10px "DM Mono", monospace; letter-spacing: 0.15em; text-transform: uppercase; }
.topbar-center .eyebrow { color: var(--gold); }
.topbar-divider { display: block; width: 28px; height: 1px; background: var(--border-dark); }
.topbar-actions { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #69e7f6; box-shadow: 0 0 0 4px rgba(105, 231, 246, 0.1); }
.icon-button { border: 0; background: transparent; color: var(--gold-light); opacity: .8; width: 30px; height: 30px; padding: 0; font-size: 18px; margin-left: 12px; transition: .2s; }
.icon-button:hover { opacity: 1; transform: scale(1.08); }
.icon-button.is-muted { color: var(--muted); }

.main-content { max-width: 1380px; margin: 0 auto; padding: 72px 50px 60px; }
.intro-row { display: flex; justify-content: flex-end; align-items: flex-end; gap: 40px; margin-bottom: 54px; }
.section-kicker { margin: 0 0 16px; color: var(--gold); font: 500 10px "DM Mono", monospace; letter-spacing: .19em; }
.section-kicker span { color: var(--cream); margin-right: 12px; opacity: .55; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 620px; margin-bottom: 17px; font-family: "Noto Serif SC", serif; font-size: clamp(34px, 5vw, 62px); font-weight: 600; line-height: 1.15; letter-spacing: -.06em; }
h1 em { color: var(--gold-light); font-style: normal; }
.intro-copy { max-width: 550px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.9; }
.deck-specs { display: flex; align-items: center; flex: none; gap: 22px; padding-bottom: 8px; }
.spec { display: flex; flex-direction: column; gap: 3px; color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.spec-number { color: var(--gold-light); font: 500 25px "DM Mono", monospace; letter-spacing: -.06em; }
.spec-divider { width: 1px; height: 30px; background: var(--border-dark); }

.play-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 18px; align-items: stretch; }
.control-panel, .table-panel { border: 1px solid var(--border-dark); border-radius: var(--radius-lg); box-shadow: var(--shadow-deep); }
.control-panel { background: linear-gradient(145deg, rgba(27, 47, 78, .96), rgba(12, 24, 46, .98)); padding: 30px 27px 26px; display: flex; flex-direction: column; }
.table-panel { background: linear-gradient(145deg, rgba(25, 46, 78, .96), rgba(10, 22, 42, .99)); padding: 32px; min-width: 0; }
.panel-label { color: var(--gold); font: 500 9px "DM Mono", monospace; letter-spacing: .18em; text-transform: uppercase; display: flex; align-items: center; gap: 9px; }
.label-line { display: inline-block; width: 24px; height: 1px; background: var(--gold); opacity: .65; }
.deck-panel-copy { display: flex; gap: 13px; align-items: center; margin-top: 28px; }
.mini-icon { display: grid; place-items: center; flex: none; width: 39px; height: 39px; border: 1px solid rgba(80, 216, 237, .38); border-radius: 11px; color: var(--gold-light); font: 22px Georgia, serif; }
.deck-panel-copy h2 { margin: 0 0 4px; font: 600 16px "Noto Serif SC", serif; letter-spacing: -.02em; }
.deck-panel-copy p { margin: 0; color: var(--muted); font-size: 10px; }
.deck-visual-wrap { height: 253px; display: flex; align-items: center; justify-content: center; position: relative; margin-top: 8px; }
.deck-stack { width: 165px; height: 224px; position: relative; transition: transform .3s ease; }
.deck-shadow-card { position: absolute; width: 100%; height: 100%; border: 1px solid rgba(132, 211, 229, .22); border-radius: 13px; background: #152949; transform: rotate(-5deg) translate(-7px, 6px); box-shadow: 0 15px 22px rgba(0,0,0,.22); }
.deck-shadow-card.second { transform: rotate(4deg) translate(6px, 5px); background: #1e3b68; }
.card { aspect-ratio: 2.5 / 3.5; border-radius: 13px; position: relative; overflow: hidden; box-shadow: 0 12px 25px rgba(0, 0, 0, .24); }
.deck-top-card { width: 100%; height: 100%; }
.card-back { padding: 8px; background: #e9f2fc; border: 1px solid #bfcee0; }
.card-back-inner { width: 100%; height: 100%; border-radius: 8px; border: 2px solid #2d7992; background: #15516f; background-image: radial-gradient(circle at 50% 50%, rgba(205, 247, 255, .22) 1px, transparent 1.5px), linear-gradient(45deg, transparent 47%, rgba(205, 247, 255, .22) 48%, rgba(205, 247, 255, .22) 52%, transparent 53%), linear-gradient(-45deg, transparent 47%, rgba(205, 247, 255, .22) 48%, rgba(205, 247, 255, .22) 52%, transparent 53%); background-size: 8px 8px, 15px 15px, 15px 15px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 14px 0 12px; color: #d7f8ff; }
.back-ornament { font: 21px Georgia, serif; opacity: .85; }
.back-ornament.bottom { transform: rotate(180deg); }
.back-center-mark { display: grid; place-items: center; width: 71px; height: 82px; border: 1px solid rgba(248, 227, 182, .65); border-radius: 50%; font-family: "Noto Serif SC", serif; font-size: 20px; line-height: 1.2; letter-spacing: .15em; text-indent: .15em; box-shadow: inset 0 0 0 4px rgba(248, 227, 182, .13); }
.back-center-mark span { font-size: 18px; }
.deck-count-badge { position: absolute; right: 28px; bottom: 9px; width: 69px; padding: 8px 0 7px; border: 1px solid rgba(80, 216, 237, .4); border-radius: 10px; background: rgba(6, 18, 35, .78); text-align: center; box-shadow: 0 7px 20px rgba(0,0,0,.2); }
.deck-count-badge span { color: var(--gold-light); font: 500 17px "DM Mono", monospace; }
.deck-count-badge small { color: var(--muted); font: 10px "DM Mono", monospace; }
.deck-count-badge b { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 500; letter-spacing: .16em; }

.status-card { border-top: 1px solid var(--border-dark); border-bottom: 1px solid var(--border-dark); padding: 17px 0 16px; }
.status-card-top { display: flex; align-items: center; gap: 8px; color: var(--cream); font-size: 12px; font-weight: 700; }
.status-indicator { width: 7px; height: 7px; border-radius: 50%; background: #70849f; box-shadow: 0 0 0 4px rgba(112, 132, 159, .15); }
.status-indicator.ready { background: #50d8ed; box-shadow: 0 0 0 4px rgba(80, 216, 237, .14); }
.status-indicator.done { background: #72e6bc; box-shadow: 0 0 0 4px rgba(114, 230, 188, .12); }
.status-indicator.busy { background: #b9f5ff; animation: pulse 1s infinite; }
.lock-icon { margin-left: auto; color: var(--gold); font-size: 18px; transform: rotate(-45deg); opacity: .8; }
.status-card p { margin: 8px 0 0 15px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.action-stack { display: flex; flex-direction: column; gap: 10px; padding-top: 22px; }
.primary-button, .secondary-button { width: 100%; border-radius: 10px; padding: 13px 12px; display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 700; transition: transform .2s, background .2s, border-color .2s, opacity .2s; }
.primary-button { color: #092034; border: 1px solid var(--gold-light); background: linear-gradient(135deg, #c8f8ff, #45c9e3); box-shadow: 0 8px 16px rgba(0,0,0,.18); }
.primary-button:hover { transform: translateY(-2px); background: linear-gradient(135deg, #e0fbff, #63e2f5); }
.secondary-button { color: var(--cream); border: 1px solid rgba(221, 220, 188, .28); background: rgba(238, 232, 205, .07); }
.secondary-button:not(:disabled):hover { border-color: rgba(221, 220, 188, .63); background: rgba(238, 232, 205, .12); transform: translateY(-2px); }
.secondary-button:disabled, .primary-button:disabled { opacity: .45; transform: none; }
.button-symbol { width: 18px; color: inherit; font-size: 19px; line-height: 1; }
.button-key { margin-left: auto; width: 22px; height: 19px; display: grid; place-items: center; color: inherit; border: 1px solid currentColor; border-radius: 4px; opacity: .45; font: 9px "DM Mono", monospace; }
.panel-note { margin-top: auto; padding-top: 23px; color: var(--muted); font: 9px "DM Mono", monospace; letter-spacing: .03em; }
.panel-note span { color: var(--gold); margin-right: 5px; }

.table-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 25px; }
.table-header h2, .history-heading h2 { margin: 11px 0 0; font: 600 26px "Noto Serif SC", serif; letter-spacing: -.04em; }
.deal-progress { min-width: 170px; padding-bottom: 2px; }
.progress-label { color: var(--muted); font: 500 9px "DM Mono", monospace; letter-spacing: .16em; }
.deal-progress strong { float: right; color: var(--gold-light); font: 500 14px "DM Mono", monospace; }
.deal-progress strong i { color: var(--muted); font-style: normal; margin: 0 3px; font-size: 10px; }
.progress-track { clear: both; height: 3px; margin-top: 10px; border-radius: 9px; background: rgba(185, 222, 245, .14); overflow: hidden; }
.progress-track span { display: block; width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--gold-light)); transition: width .4s ease; }
.table-surface-wrap { position: relative; }
.table-surface { position: relative; min-height: 505px; padding: 29px; overflow: hidden; border: 1px solid rgba(156, 225, 239, .2); border-radius: 19px; background: radial-gradient(ellipse at 52% 45%, #245a78 0%, #173c60 45%, #102845 100%); box-shadow: inset 0 0 55px rgba(0, 0, 0, .3); }
.table-surface::before { content: ""; position: absolute; inset: 11px; border: 1px solid rgba(169, 226, 239, .12); border-radius: 13px; pointer-events: none; }
.table-grid { position: absolute; inset: 0; opacity: .2; background-image: linear-gradient(rgba(157, 231, 242, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(157, 231, 242, .08) 1px, transparent 1px); background-size: 37px 37px; mask-image: radial-gradient(ellipse at center, black, transparent 72%); }
.empty-table { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--muted); z-index: 1; }
.empty-table[hidden] { display: none; }
.empty-orbit { width: 100px; height: 100px; position: relative; margin-bottom: 22px; border: 1px solid rgba(157, 231, 242, .18); border-radius: 50%; display: grid; place-items: center; color: rgba(185, 245, 255, .62); font: 27px Georgia, serif; }
.empty-orbit::before, .empty-orbit::after { content: ""; position: absolute; border: 1px solid rgba(157, 231, 242, .12); border-radius: 50%; }
.empty-orbit::before { inset: 12px; }
.empty-orbit::after { inset: -13px 25px; border-top-color: transparent; border-bottom-color: transparent; transform: rotate(32deg); }
.empty-orbit span { position: absolute; font-size: 14px; }
.empty-orbit span:nth-child(1) { top: 14px; }
.empty-orbit span:nth-child(2) { right: 14px; color: rgba(240, 138, 161, .78); }
.empty-orbit span:nth-child(3) { bottom: 14px; color: rgba(240, 138, 161, .78); }
.empty-orbit span:nth-child(4) { left: 14px; }
.empty-table h3 { margin-bottom: 7px; color: rgba(245, 239, 224, .76); font: 600 16px "Noto Serif SC", serif; }
.empty-table p { margin: 0; font-size: 11px; color: var(--muted); }
.dealt-grid { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 18px 15px; align-content: start; }
.table-stamp { position: absolute; right: 28px; bottom: 25px; color: rgba(185, 245, 255, .24); text-align: right; font: 500 9px/1.65 "DM Mono", monospace; letter-spacing: .16em; pointer-events: none; }
.table-stamp span { font-size: 7px; letter-spacing: .25em; }
.table-mascot { position: absolute; z-index: 4; left: 50%; bottom: calc(100% - 19px); width: min(210px, 27%); transform: translateX(-50%); pointer-events: none; filter: drop-shadow(0 10px 16px rgba(3, 8, 22, .38)); transition: opacity .35s ease, transform .35s ease; }
.table-mascot img { display: block; width: 100%; height: auto; image-rendering: auto; }
.table-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 19px; color: var(--muted); }
.tip-line { display: flex; align-items: center; gap: 8px; font-size: 10px; }
.tip-icon { display: grid; place-items: center; width: 15px; height: 15px; border: 1px solid rgba(80, 216, 237, .42); border-radius: 50%; color: var(--gold); font: 9px Georgia, serif; }
.shortcut-hint { display: flex; align-items: center; gap: 6px; font: 9px "DM Mono", monospace; letter-spacing: .03em; white-space: nowrap; }
.shortcut-hint span { width: 1px; height: 13px; margin: 0 6px; background: var(--border-dark); }
kbd { display: grid; place-items: center; min-width: 19px; height: 17px; padding: 0 4px; color: var(--gold-light); border: 1px solid rgba(80, 216, 237, .4); border-radius: 4px; font: 9px "DM Mono", monospace; }

/* Card faces */
.card-face { min-width: 0; height: 100%; padding: 9px 8px 8px; background: var(--paper); color: var(--ink); border: 1px solid #ddd3bc; }
.card-face.red { color: var(--red-dark); }
.card-corner { position: absolute; top: 7px; left: 8px; z-index: 1; display: flex; flex-direction: column; align-items: center; font-family: Georgia, serif; font-weight: 700; line-height: .91; }
.card-corner.bottom { top: auto; left: auto; right: 8px; bottom: 7px; transform: rotate(180deg); }
.card-rank { font-size: 19px; letter-spacing: -.06em; }
.card-corner-suit { margin-top: 2px; font-size: 14px; }
.card-art { position: absolute; inset: 37px 10px; overflow: hidden; border-radius: 9px; border: 1px solid currentColor; background: linear-gradient(135deg, rgba(208, 174, 105, .18), rgba(218, 184, 108, .48)); display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 13px 0 11px; }
.card-art::before { content: ""; position: absolute; inset: 5px; border: 1px solid currentColor; opacity: .38; }
.court-crown { position: relative; z-index: 1; font-size: 20px; line-height: 1; }
.court-head { position: relative; z-index: 1; display: grid; place-items: center; width: 45px; height: 45px; color: #f4d792; border: 2px solid currentColor; border-radius: 50%; background: #9d343e; font: 700 18px Georgia, serif; box-shadow: 0 0 0 4px rgba(255,255,255,.2); }
.card-face.black .court-head { background: #183b35; }
.court-body { position: relative; z-index: 1; width: 48px; height: 27px; border-radius: 24px 24px 7px 7px; background: currentColor; opacity: .8; }
.court-suit { position: relative; z-index: 1; font: 25px Georgia, serif; }
.pip-grid { position: absolute; inset: 38px 15px; }
.pip { position: absolute; transform: translate(-50%, -50%); font: 21px/1 Georgia, serif; }
.ace-pip { position: absolute; inset: 0; display: grid; place-items: center; font: 66px/1 Georgia, serif; }
.joker-face { position: absolute; inset: 32px 9px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; border: 1px solid currentColor; border-radius: 9px; background: linear-gradient(135deg, #f2e4bb, #cfb56e); }
.joker-face::before { content: "✦"; font-size: 33px; line-height: 1; }
.joker-face strong { font: 700 13px "DM Mono", monospace; letter-spacing: .12em; }
.joker-face small { font: 7px "DM Mono", monospace; letter-spacing: .13em; opacity: .68; }
.card-joker .card-corner { color: #b4494b; }

.dealt-card { width: 100%; max-width: 126px; justify-self: center; animation: cardAppear .52s cubic-bezier(.18,.9,.3,1.16) both; transform-origin: center bottom; }
.dealt-card-flip { width: 100%; aspect-ratio: 2.5 / 3.5; position: relative; transform-style: preserve-3d; perspective: 900px; transform: rotateY(180deg); }
.dealt-card-flip > .card { position: absolute; inset: 0; width: 100%; height: 100%; backface-visibility: hidden; }
.dealt-card-front { transform: rotateY(180deg); }
.dealt-card-back { transform: rotateY(0deg); }
.dealt-card.is-pending { opacity: 0; animation: none; }
.dealt-card.is-pending .dealt-card-flip { transform: rotateY(0deg); }
.dealt-card.is-settling { animation: cardSettle .26s ease-out both; }
.dealt-card:hover { transform: translateY(-5px) rotate(-1deg); z-index: 3; transition: transform .2s ease; }
.dealt-card .card-face { box-shadow: 0 11px 19px rgba(0,0,0,.21); }
.dealt-number { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); color: rgba(18, 40, 34, .55); font: 8px "DM Mono", monospace; letter-spacing: .08em; }
.dealt-card.red .dealt-number { color: rgba(140, 47, 58, .55); }
.deal-flight { position: fixed; z-index: 40; left: var(--start-left); top: var(--start-top); width: var(--start-width); height: var(--start-height); pointer-events: none; transform-origin: center center; transform: rotate(-4deg); transition: left .63s cubic-bezier(.2,.85,.25,1), top .63s cubic-bezier(.2,.85,.25,1), width .63s cubic-bezier(.2,.85,.25,1), height .63s cubic-bezier(.2,.85,.25,1), transform .63s cubic-bezier(.2,.85,.25,1); will-change: left, top, width, height, transform, opacity; }
.deal-flight.is-flying { left: var(--target-left); top: var(--target-top); width: var(--target-width); height: var(--target-height); transform: rotate(3deg); }
.deal-flight-flip { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; perspective: 900px; }
.deal-flight-flip > .card { position: absolute; inset: 0; width: 100%; height: 100%; backface-visibility: hidden; }
.deal-flight-flip > .dealt-card-front { transform: rotateY(180deg); }
.deal-flight-flip > .dealt-card-back { transform: rotateY(0deg); }
.deal-flight.is-revealing .deal-flight-flip { animation: dealFlip .5s cubic-bezier(.2,.8,.25,1) both; }
.deal-flight .card-face { box-shadow: 0 18px 29px rgba(0,0,0,.28); }
.dealt-card.returning { animation: returnToDeck .68s cubic-bezier(.45,.05,.75,.2) var(--return-delay) forwards; pointer-events: none; }

.history-section { margin-top: 61px; }
.history-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 19px; }
.history-heading .section-kicker { margin-bottom: 0; }
.history-heading h2 { margin-top: 8px; font-size: 22px; }
.session-tag { padding: 5px 9px; color: var(--muted); border: 1px solid var(--border-dark); border-radius: 5px; font: 9px "DM Mono", monospace; letter-spacing: .07em; text-transform: uppercase; }
.session-tag.active { color: var(--gold-light); border-color: rgba(80, 216, 237, .42); background: rgba(80, 216, 237, .09); }
.history-list { min-height: 50px; border-top: 1px solid var(--border-dark); }
.history-item { min-height: 49px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid rgba(228, 217, 184, .08); color: var(--cream); font-size: 11px; }
.history-index { width: 23px; color: var(--gold); font: 10px "DM Mono", monospace; }
.history-dot { width: 5px; height: 5px; margin-left: 1px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(80, 216, 237, .1); }
.history-item time { margin-left: auto; color: var(--muted); font: 9px "DM Mono", monospace; }
.muted-history { color: var(--muted); }
.muted-history .history-dot { background: var(--muted); box-shadow: none; }

.footer { max-width: 1380px; margin: 0 auto; padding: 23px 50px 29px; border-top: 1px solid var(--border-dark); color: rgba(141, 156, 181, .72); display: flex; justify-content: space-between; font: 9px "DM Mono", monospace; letter-spacing: .08em; }
.footer-center { color: rgba(185, 245, 255, .68); }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 50; padding: 11px 17px; border: 1px solid rgba(80, 216, 237, .42); border-radius: 9px; background: rgba(6, 18, 35, .96); color: var(--gold-light); font-size: 11px; box-shadow: 0 15px 35px rgba(0,0,0,.32); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.deck-stack.is-shuffling { animation: shuffleStack .88s cubic-bezier(.3,.7,.2,1); }
.deck-stack.is-shuffling .deck-top-card { animation: shuffleCard .88s cubic-bezier(.3,.7,.2,1); }
.table-surface.is-dealing { box-shadow: inset 0 0 55px rgba(0, 0, 0, .3), 0 0 0 1px rgba(80, 216, 237, .16); }
.table-surface.is-returning { box-shadow: inset 0 0 55px rgba(0, 0, 0, .3), 0 0 0 1px rgba(80, 216, 237, .2); }

@keyframes pulse { 50% { opacity: .45; } }
@keyframes shuffleStack { 0%, 100% { transform: rotate(0) scale(1); } 20% { transform: rotate(-5deg) scale(1.025); } 45% { transform: rotate(5deg) translateX(3px) scale(1.02); } 70% { transform: rotate(-3deg) translateX(-2px); } }
@keyframes shuffleCard { 0%, 100% { transform: translate(0, 0) rotate(0); } 20% { transform: translate(-9px, -9px) rotate(-9deg); } 40% { transform: translate(11px, -5px) rotate(8deg); } 60% { transform: translate(-6px, 4px) rotate(-5deg); } 80% { transform: translate(4px, -3px) rotate(3deg); } }
@keyframes cardAppear { 0% { opacity: 0; transform: translateY(26px) rotate(4deg) scale(.72); } 66% { opacity: 1; transform: translateY(-5px) rotate(-1.5deg) scale(1.03); } 100% { opacity: 1; transform: translateY(0) rotate(0) scale(1); } }
@keyframes cardSettle { 0% { transform: translateY(4px) rotate(1deg); } 100% { transform: translateY(0) rotate(0); } }
@keyframes dealFlip { 0% { transform: rotateY(0deg); } 100% { transform: rotateY(180deg); } }
@keyframes returnToDeck { 0% { opacity: 1; transform: translate3d(0, 0, 0) scale(1) rotate(0); } 100% { opacity: 0; transform: translate3d(var(--return-x), var(--return-y), 0) scale(.28) rotate(12deg); } }

@media (max-width: 900px) {
  .topbar { padding: 0 25px; }
  .main-content { padding: 52px 25px 48px; }
  .intro-row { align-items: flex-start; flex-direction: column; margin-bottom: 38px; }
  .deck-specs { padding-bottom: 0; }
  .play-layout { grid-template-columns: 1fr; }
  .control-panel { min-height: 0; }
  .deck-visual-wrap { height: 230px; }
  .action-stack { flex-direction: row; }
  .panel-note { margin-top: 20px; }
  .table-surface { min-height: 500px; }
  .footer { padding-left: 25px; padding-right: 25px; }
}

@media (max-width: 560px) {
  .topbar { height: 66px; padding: 0 18px; }
  .topbar-center, .topbar-label { display: none; }
  .main-content { padding: 40px 16px 38px; }
  h1 { font-size: 36px; }
  .intro-copy { font-size: 12px; }
  .deck-specs { width: 100%; justify-content: space-between; gap: 10px; }
  .control-panel, .table-panel { border-radius: 21px; }
  .control-panel { padding: 23px 20px 21px; }
  .table-panel { padding: 22px 15px 17px; }
  .action-stack { flex-direction: column; }
  .primary-button, .secondary-button { min-height: 44px; }
  .table-header { align-items: flex-start; flex-direction: column; gap: 18px; margin-bottom: 20px; }
  .deal-progress { width: 100%; }
  .table-surface { min-height: 430px; padding: 21px 12px; }
  .table-mascot { left: 50%; width: 175px; bottom: calc(100% - 17px); }
  .dealt-grid { grid-template-columns: repeat(3, minmax(76px, 1fr)); gap: 12px 8px; }
  .dealt-card { max-width: 105px; }
  .card-corner { top: 5px; left: 5px; }
  .card-corner.bottom { left: auto; right: 5px; bottom: 5px; }
  .card-rank { font-size: 14px; }
  .card-corner-suit { font-size: 11px; }
  .pip-grid { inset: 33px 11px; }
  .pip { font-size: 16px; }
  .ace-pip { font-size: 48px; }
  .card-art { inset: 30px 7px; padding: 8px 0; }
  .court-head { width: 34px; height: 34px; font-size: 14px; }
  .court-crown { font-size: 15px; }
  .court-body { width: 36px; height: 21px; }
  .court-suit { font-size: 19px; }
  .joker-face { inset: 29px 7px; }
  .joker-face::before { font-size: 24px; }
  .joker-face strong { font-size: 9px; }
  .joker-face small { font-size: 5px; }
  .table-stamp { right: 15px; bottom: 13px; }
  .table-footer { align-items: flex-start; flex-direction: column; gap: 13px; }
  .shortcut-hint { display: none; }
  .history-section { margin-top: 44px; }
  .history-item { gap: 9px; }
  .footer { padding: 20px 16px 24px; font-size: 8px; }
  .footer-center { display: none; }
}
