:root {
  color-scheme: light;
  --ink: #4e3b3e;
  --muted: #806e6d;
  --cream: #fff9ef;
  --paper: #fffdf8;
  --latte: #f6e8d4;
  --peach: #ef9c82;
  --peach-dark: #d87865;
  --pink: #edb1bd;
  --mint: #91cfc0;
  --mint-dark: #4c9b8d;
  --blue: #89b9d8;
  --blue-dark: #568dad;
  --butter: #f3cf77;
  --lavender: #bbb2df;
  --green: #9ccc9c;
  --red: #d96867;
  --line: #e7d8c6;
  --shadow: 0 18px 50px rgba(91, 61, 52, .12);
  --shadow-soft: 0 8px 24px rgba(91, 61, 52, .1);
  --radius-sm: 14px;
  --radius: 22px;
  --radius-lg: 32px;
  --font-display: 'Trebuchet MS', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --font-body: 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--ink); background: var(--latte); font-family: var(--font-body); line-height: 1.45; overflow-x: hidden; }
body::before { content: ''; position: fixed; inset: 0; z-index: -2; background: radial-gradient(circle at 12% 18%, rgba(255,255,255,.9) 0 2px, transparent 3px), radial-gradient(circle at 90% 32%, rgba(255,255,255,.75) 0 2px, transparent 3px), linear-gradient(135deg, #f9eddb, #f5e3cc 60%, #f8ead8); background-size: 36px 36px, 52px 52px, auto; }
body.in-game { background: #d7c09e; }
button, input, select, summary { font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
button { min-height: 44px; color: inherit; }
button:not(:disabled), summary { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
input, select { width: 100%; min-height: 50px; padding: .78rem 1rem; color: var(--ink); background: #fffdfa; border: 1.5px solid var(--line); border-radius: var(--radius-sm); outline: none; transition: border-color .16s, box-shadow .16s; }
input:hover, select:hover { border-color: #cdb5a1; }
input:focus, select:focus, button:focus-visible, summary:focus-visible { outline: 3px solid rgba(76,155,141,.28); outline-offset: 2px; }
input:focus, select:focus { border-color: var(--mint-dark); box-shadow: 0 0 0 4px rgba(76,155,141,.12); }
label, legend { color: var(--ink); font-weight: 800; font-size: .9rem; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; }
p { color: var(--muted); }
[hidden] { display: none !important; }
.ui-icon { width: 1.25em; height: 1.25em; display: inline-block; flex: 0 0 auto; vertical-align: -.2em; }
.skip-link { position: fixed; z-index: 1000; top: .5rem; left: .5rem; padding: .7rem 1rem; color: white; background: var(--ink); border-radius: 10px; transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.app-shell { min-height: 100vh; min-height: 100dvh; }
.topbar { position: relative; z-index: 30; min-height: 70px; padding: .75rem clamp(1rem, 4vw, 3rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { padding: 0; display: inline-flex; align-items: center; gap: .65rem; border: 0; background: transparent; text-align: left; }
.brand > span:last-child { display: grid; line-height: .9; }
.brand strong { font: 700 1.18rem/1 var(--font-display); letter-spacing: -.02em; }
.brand small { margin-top: .15rem; color: var(--peach-dark); font: 700 .82rem/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; }
.brand-mark { position: relative; width: 44px; height: 44px; display: grid; place-items: center; background: var(--peach); border: 3px solid var(--ink); border-radius: 50% 50% 44% 48%; box-shadow: inset 0 -4px 0 rgba(100,50,45,.1); transform: rotate(-5deg); }
.brand-mark::before, .brand-mark::after, .brand-mark span::before, .brand-mark span::after { content: ''; position: absolute; width: 8px; height: 10px; background: white; border-radius: 50%; }
.brand-mark::before { top: 8px; left: 9px; transform: rotate(-25deg); }.brand-mark::after { top: 6px; right: 9px; transform: rotate(25deg); }
.brand-mark span::before { top: 15px; left: 4px; transform: rotate(-45deg); }.brand-mark span::after { top: 14px; right: 4px; transform: rotate(45deg); }
.brand-mark span { width: 16px; height: 14px; margin-top: 9px; background: white; border-radius: 55% 55% 45% 45%; }
.topbar-actions { display: flex; align-items: center; gap: .5rem; }
.icon-button, .soft-button, .back-button { border: 1.5px solid var(--line); background: rgba(255,253,248,.82); border-radius: 14px; box-shadow: 0 3px 12px rgba(83,58,50,.06); }
.icon-button { width: 44px; padding: 0; display: grid; place-items: center; }
.soft-button { padding: .55rem .85rem; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font-weight: 800; }
.back-button { padding: .45rem .75rem; display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .9rem; font-weight: 800; }
.icon-button:hover, .soft-button:hover, .back-button:hover { background: white; border-color: #ccb3a0; transform: translateY(-1px); }

.screen { min-height: calc(100dvh - 70px); animation: screen-in .35s ease both; }
.home-screen { max-width: 1220px; margin: 0 auto; padding: clamp(1.5rem, 5vw, 5.2rem) clamp(1.1rem, 5vw, 4rem) 3rem; display: grid; align-items: center; gap: 2rem; }
.hero-copy { position: relative; z-index: 2; max-width: 630px; }
.eyebrow { margin-bottom: .7rem; color: var(--peach-dark); font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.live-dot { width: 8px; height: 8px; display: inline-block; margin-right: .3rem; background: var(--mint-dark); border-radius: 50%; box-shadow: 0 0 0 4px rgba(76,155,141,.13); }
.hero-copy h1 { margin-bottom: 1.1rem; font-size: clamp(2.7rem, 10.5vw, 5.6rem); letter-spacing: -.05em; }
.hero-copy h1 em { color: var(--peach-dark); font-style: normal; }
.hero-lead { max-width: 560px; margin-bottom: 1.6rem; font-size: clamp(1rem, 2vw, 1.2rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.primary-button, .secondary-button { min-height: 50px; padding: .75rem 1.15rem; display: inline-flex; align-items: center; justify-content: center; gap: .55rem; border-radius: 15px; font-weight: 800; transition: transform .16s, box-shadow .16s, background .16s; }
.primary-button { color: #fffaf4; background: var(--peach-dark); border: 2px solid var(--ink); box-shadow: 0 5px 0 var(--ink), 0 12px 22px rgba(204,104,91,.22); }
.primary-button:hover:not(:disabled) { background: #e58570; transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink), 0 14px 26px rgba(204,104,91,.24); }
.primary-button:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.secondary-button { color: var(--ink); background: #fffaf1; border: 2px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.secondary-button:hover:not(:disabled) { background: white; transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.blue-button { color: white; background: var(--blue-dark); }
.full-width { width: 100%; }
.quick-facts { margin-top: 1.6rem; display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; color: var(--muted); font-size: .78rem; }
.quick-facts b { color: var(--ink); }.quick-facts i { width: 3px; height: 3px; background: #bba59b; border-radius: 50%; }

.hero-scene { position: relative; width: min(100%, 510px); min-height: 390px; margin: 0 auto; isolation: isolate; }
.sun-blob { position: absolute; inset: 2% 1% 4%; z-index: -2; background: #f6c88d; border: 3px solid var(--ink); border-radius: 48% 52% 42% 58% / 54% 44% 56% 46%; box-shadow: 16px 18px 0 rgba(216,149,103,.16); transform: rotate(-3deg); }
.sun-blob::before { content: ''; position: absolute; width: 78px; height: 78px; top: 26px; right: 30px; border: 3px dashed rgba(85,63,66,.32); border-radius: 50%; }
.hero-table { position: absolute; z-index: 1; left: 8%; right: 8%; bottom: 20px; height: 83px; background: #bf7b5f; border: 3px solid var(--ink); border-radius: 50% 50% 20px 20px; box-shadow: inset 0 -10px 0 rgba(90,46,40,.13); }
.hero-table::after { content: ''; position: absolute; left: 15%; right: 15%; bottom: -28px; height: 30px; background: #955a4c; border: 3px solid var(--ink); border-top: 0; border-radius: 0 0 12px 12px; }
.hero-cat, .hero-bunny { position: absolute; z-index: 2; bottom: 79px; width: 133px; height: 142px; border: 3px solid var(--ink); }
.hero-cat { left: 12%; background: #d79d79; border-radius: 48% 48% 42% 42%; transform: rotate(-4deg); }
.hero-bunny { right: 9%; background: #fff3df; border-radius: 48% 48% 43% 43%; transform: rotate(4deg); }
.hero-cat .ear, .hero-bunny .ear { position: absolute; z-index: -1; border: 3px solid var(--ink); }
.hero-cat .ear { width: 54px; height: 60px; top: -27px; background: #d79d79; }.hero-cat .ear.left { left: 3px; clip-path: polygon(0 0,100% 100%,0 100%); }.hero-cat .ear.right { right: 3px; clip-path: polygon(100% 0,100% 100%,0 100%); }
.hero-bunny .ear { width: 32px; height: 87px; top: -67px; background: #fff3df; border-radius: 50%; }.hero-bunny .ear::after { content: ''; position: absolute; inset: 12px 8px; background: #f1b8ba; border-radius: 50%; }.hero-bunny .ear.left { left: 17px; transform: rotate(-10deg); }.hero-bunny .ear.right { right: 17px; transform: rotate(10deg); }
.hero-cat b, .hero-cat i, .hero-bunny b, .hero-bunny i { position: absolute; width: 10px; height: 13px; top: 56px; background: var(--ink); border-radius: 50%; box-shadow: inset 2px 2px white; }.hero-cat b, .hero-bunny b { left: 35px; }.hero-cat i, .hero-bunny i { right: 35px; }
.hero-cat em, .hero-bunny em { position: absolute; top: 78px; left: 50%; width: 26px; height: 15px; border-bottom: 3px solid var(--ink); border-radius: 50%; transform: translateX(-50%); }
.hero-cat::after { content: ''; position: absolute; top: 84px; right: -23px; width: 42px; height: 27px; border: 8px solid #d79d79; border-left: 0; border-radius: 0 50% 50% 0; }
.hero-cup { position: absolute; z-index: 4; left: 50%; bottom: 83px; width: 76px; height: 70px; background: #a4d8cd; border: 3px solid var(--ink); border-radius: 8px 8px 24px 24px; transform: translateX(-50%); box-shadow: inset 0 -7px rgba(54,111,101,.11); }
.hero-cup::after { content: ''; position: absolute; right: -28px; top: 13px; width: 30px; height: 29px; border: 8px solid var(--ink); border-left: 0; border-radius: 0 50% 50% 0; }
.hero-cup span::before, .hero-cup span::after, .hero-cup i { content: ''; position: absolute; top: 25px; width: 6px; height: 8px; background: var(--ink); border-radius: 50%; }.hero-cup span::before { left: 22px; }.hero-cup span::after { right: 22px; }.hero-cup i { top: 37px; left: 50%; width: 16px; height: 9px; border-bottom: 2px solid var(--ink); background: none; transform: translateX(-50%); }
.steam { position: absolute; z-index: 5; width: 14px; height: 53px; top: 114px; left: calc(50% - 18px); border-left: 4px solid rgba(255,255,255,.85); border-radius: 50%; transform: rotate(12deg); animation: steam 2.4s ease-in-out infinite; }.steam-two { left: calc(50% + 7px); top: 106px; animation-delay: -1.1s; }
.floating-cookie { position: absolute; z-index: 3; width: 38px; height: 38px; display: grid; place-items: center; color: #8e5d49; background: #f3bd71; border: 3px solid var(--ink); border-radius: 50%; font-size: .7rem; }.cookie-one { top: 48px; left: 14px; transform: rotate(-12deg); }.cookie-two { top: 88px; right: 4px; transform: scale(.75) rotate(18deg); }
.scene-note { position: absolute; z-index: 7; right: 5%; bottom: 4px; margin: 0; padding: .55rem .7rem; display: flex; align-items: center; gap: .35rem; color: var(--ink); background: white; border: 2px solid var(--ink); border-radius: 13px; box-shadow: 0 4px 0 var(--ink); font-size: .75rem; font-weight: 800; }.scene-note .ui-icon { color: var(--red); fill: var(--red); }

.panel-screen { padding: 1rem; display: grid; place-items: start center; }
.panel-card { width: min(100%, 760px); padding: clamp(1rem, 4vw, 2rem); background: rgba(255,253,248,.94); border: 2px solid var(--ink); border-radius: var(--radius-lg); box-shadow: 8px 9px 0 rgba(78,59,62,.9), var(--shadow); }
.setup-card { max-width: 620px; }
.panel-heading { margin: 1.2rem 0 1.5rem; display: flex; align-items: center; gap: 1rem; }
.panel-heading h1 { margin-bottom: .3rem; font-size: clamp(1.8rem, 6vw, 2.6rem); }.panel-heading p:last-child { margin: 0; }
.heading-icon { width: 60px; height: 60px; display: grid; place-items: center; flex: 0 0 auto; color: var(--ink); border: 2px solid var(--ink); border-radius: 20px; transform: rotate(-3deg); }.heading-icon .ui-icon { width: 30px; height: 30px; }
.heading-icon-peach { background: #f6c5b3; }.heading-icon-mint { background: #b7e0d6; }
.centered-heading { display: block; text-align: center; }.centered-heading .heading-icon { margin: 0 auto .9rem; }.centered-heading p { max-width: 540px; margin-left: auto; margin-right: auto; }
.form-stack { display: grid; gap: .68rem; }
.form-stack > label:not(:first-child), .form-stack > fieldset { margin-top: .35rem; }
.segmented-field { min-width: 0; margin-inline: 0; padding: 0; border: 0; }.segmented-field legend { margin-bottom: .55rem; }
.segmented-control { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; }.segmented-control label { position: relative; }.segmented-control input { position: absolute; opacity: 0; pointer-events: none; }.segmented-control span { min-height: 48px; display: grid; place-items: center; color: var(--muted); background: white; border: 1.5px solid var(--line); border-radius: 13px; }.segmented-control input:checked + span { color: var(--ink); background: #f5c8b7; border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }.segmented-control input:focus-visible + span { outline: 3px solid rgba(76,155,141,.28); outline-offset: 2px; }
#player-count { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.form-tip { margin: .5rem 0; padding: .8rem; display: flex; gap: .65rem; color: #715f58; background: #fff4d5; border: 1px solid #edd49a; border-radius: 14px; }.form-tip .ui-icon { flex: 0 0 auto; color: #c88b27; }.form-tip p { margin: 0; color: inherit; font-size: .82rem; }

.multiplayer-card { width: min(100%, 980px); }
.mode-grid { display: grid; gap: 1rem; }
.mode-card { position: relative; padding: 1.2rem; background: white; border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mode-card h2 { margin: .75rem 0 .2rem; font-size: 1.5rem; }.mode-card > p { margin-bottom: .9rem; font-size: .86rem; }.mode-number { position: absolute; top: .7rem; right: .9rem; color: #eaded3; font: 700 2rem/1 var(--font-display); }
.mode-icon { width: 48px; height: 48px; display: grid; place-items: center; color: #a65c4e; background: #f9d3c7; border-radius: 15px; }.mode-icon-blue { color: #477f9e; background: #cee4f1; }
.mode-divider { display: none; }.code-input { text-transform: uppercase; letter-spacing: .2em; font-weight: 800; }
.privacy-note { margin: 1.2rem 0 0; display: flex; align-items: center; justify-content: center; gap: .4rem; font-size: .78rem; text-align: center; }.privacy-note .ui-icon { color: var(--mint-dark); }
.connection-settings { margin-top: 1rem; background: #fbf6ec; border: 1.5px solid var(--line); border-radius: 15px; }
.connection-settings summary { min-height: 46px; padding: .7rem .9rem; display: flex; align-items: center; gap: .45rem; font-size: .84rem; font-weight: 800; list-style: none; }.connection-settings summary::-webkit-details-marker { display: none; }.connection-settings summary::after { content: '+'; margin-left: auto; font-size: 1.2rem; }.connection-settings[open] summary::after { content: '−'; }.connection-settings .form-stack { padding: 0 .9rem .9rem; }.optional-label { margin-left: .3rem; color: var(--muted); font-weight: 600; font-size: .72rem; }.field-help { margin: -.2rem 0 0; color: var(--muted); font-size: .76rem; }

.lobby-card { max-width: 760px; }.lobby-heading { margin-bottom: 1rem; }.room-code-card { margin-bottom: 1.2rem; padding: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: #e1f2ed; border: 1.5px dashed var(--mint-dark); border-radius: var(--radius); }.room-code-card > div { display: grid; }.room-code-card span { color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }.room-code-card strong { font: 700 clamp(1.5rem, 7vw, 2.2rem)/1.15 var(--font-display); letter-spacing: .12em; }
.lobby-section-heading { display: flex; align-items: center; justify-content: space-between; }.lobby-section-heading h2 { margin: 0; font-size: 1.25rem; }.lobby-section-heading span { padding: .25rem .55rem; color: var(--muted); background: var(--latte); border-radius: 20px; font-size: .76rem; font-weight: 800; }
.lobby-seats { margin-top: .8rem; display: grid; gap: .6rem; }.seat-card { min-height: 68px; padding: .65rem; display: flex; align-items: center; gap: .7rem; background: white; border: 1.5px solid var(--line); border-radius: 16px; }.seat-card > div { min-width: 0; display: grid; }.seat-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.seat-card small { color: var(--muted); font-size: .72rem; }.seat-card.is-waiting { background: #faf7f1; border-style: dashed; }.avatar { width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 auto; color: var(--ink); border: 2px solid var(--ink); border-radius: 50%; font-weight: 800; }.avatar-cat { background: #e7b49a; }.avatar-bunny { background: #eee3d5; }.avatar-empty { color: #ac9890; background: #f0e8dd; border: 1.5px dashed #b9a49a; }.status-pill { margin-left: auto; padding: .24rem .5rem; color: #35796b; background: #d8eee7; border-radius: 20px; font-size: .65rem; font-weight: 800; }.waiting-dots { margin-left: auto; display: flex; gap: 3px; }.waiting-dots i { width: 5px; height: 5px; background: #bba99d; border-radius: 50%; animation: dots 1.2s ease-in-out infinite; }.waiting-dots i:nth-child(2) { animation-delay: .15s; }.waiting-dots i:nth-child(3) { animation-delay: .3s; }
.lobby-footer { margin-top: 1.3rem; padding-top: 1rem; border-top: 1px solid var(--line); display: grid; gap: .8rem; }.lobby-footer > p { margin: 0; display: flex; align-items: center; justify-content: center; gap: .5rem; font-size: .78rem; }.spinner { width: 16px; height: 16px; border: 2px solid #cdded9; border-top-color: var(--mint-dark); border-radius: 50%; animation: spin .8s linear infinite; }.lobby-actions { display: grid; gap: .6rem; }

.game-screen { position: relative; min-height: calc(100dvh - 70px); padding: .6rem .65rem 0; background: radial-gradient(ellipse at 50% 25%, rgba(255,255,255,.18), transparent 55%), #caa97b; border-top: 2px solid rgba(78,59,62,.24); overflow: hidden; }
.game-screen::before { content: ''; position: absolute; inset: 0; pointer-events: none; background-image: repeating-linear-gradient(10deg, rgba(89,58,45,.025) 0 2px, transparent 2px 9px); }
.game-hud { position: relative; z-index: 4; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .45rem; }.round-info, .turn-status, .score-chip { min-height: 44px; padding: .5rem .7rem; background: rgba(255,250,241,.94); border: 1.5px solid rgba(78,59,62,.65); border-radius: 14px; box-shadow: 0 3px 0 rgba(78,59,62,.55); }.round-info { display: flex; align-items: center; gap: .5rem; font-size: .72rem; font-weight: 800; }.round-progress { display: flex; gap: 3px; }.round-progress i { width: 10px; height: 5px; background: #dccfc0; border-radius: 4px; }.round-progress i.is-filled { background: var(--peach-dark); }.turn-status { grid-column: 1 / -1; grid-row: 2; display: flex; align-items: center; justify-content: center; gap: .45rem; color: #316f64; background: #e1f2ed; font-size: .8rem; font-weight: 800; }.pulse-ring { width: 9px; height: 9px; background: var(--mint-dark); border-radius: 50%; box-shadow: 0 0 0 0 rgba(76,155,141,.45); animation: pulse 1.8s infinite; }.score-chip { display: flex; align-items: center; gap: .3rem; font-size: .7rem; }.score-chip .ui-icon { color: var(--red); fill: var(--red); }.score-chip strong { font: 700 1.2rem/1 var(--font-display); }
.opponents { position: relative; z-index: 3; min-height: 81px; margin: .85rem 0; display: flex; justify-content: center; gap: .5rem; overflow-x: auto; scrollbar-width: none; }.opponents::-webkit-scrollbar { display: none; }.opponent { position: relative; min-width: 124px; max-width: 170px; padding: .45rem; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: .4rem; background: rgba(255,250,241,.93); border: 1.5px solid rgba(78,59,62,.7); border-radius: 15px; box-shadow: 0 3px 0 rgba(78,59,62,.55); }.opponent-avatar { position: relative; width: 38px; height: 38px; display: grid; place-items: center; background: #e8b293; border: 1.5px solid var(--ink); border-radius: 50%; font-weight: 800; }.opponent-avatar i { position: absolute; right: -3px; bottom: -4px; width: 18px; height: 18px; display: grid; place-items: center; color: white; background: var(--blue-dark); border-radius: 50%; }.opponent-avatar i .ui-icon { width: 12px; }.opponent-info { min-width: 0; display: grid; }.opponent-info strong { overflow: hidden; font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }.opponent-info small { color: var(--muted); font-size: .62rem; white-space: nowrap; }.opponent-score { display: flex; align-items: center; gap: 2px; color: var(--red); font-size: .65rem; }.opponent-score .ui-icon { width: 12px; fill: currentColor; }.opponent-score b { color: var(--ink); }.mini-hand { grid-column: 1 / -1; height: 13px; display: flex; justify-content: center; }.mini-hand i { width: 14px; height: 19px; margin-left: -3px; background: #8fc6bb; border: 1px solid var(--ink); border-radius: 3px; transform-origin: bottom; }.mini-hand i:nth-child(1) { transform: rotate(-10deg); }.mini-hand i:nth-last-child(1) { transform: rotate(10deg); }.opponent.is-ready { box-shadow: 0 0 0 3px rgba(76,155,141,.24), 0 3px 0 rgba(78,59,62,.55); }
.table-center { position: relative; z-index: 2; min-height: 240px; display: grid; place-items: center; }.table-pattern { position: absolute; width: min(82vw, 800px); height: 230px; border: 2px dashed rgba(83,57,47,.2); border-radius: 50%; }.deck-area { position: absolute; left: 50%; top: 0; transform: translateX(-50%); text-align: center; }.deck-area p { margin-top: .45rem; display: flex; align-items: center; gap: .25rem; color: rgba(78,59,62,.75); font-size: .62rem; font-weight: 800; }.deck-stack { position: relative; width: 50px; height: 67px; display: grid; place-items: center; color: white; background: #5aa398; border: 2px solid var(--ink); border-radius: 8px; box-shadow: -3px 3px 0 #f5e5cf, -5px 5px 0 var(--ink), -8px 8px 0 #f5e5cf, -10px 10px 0 var(--ink); }.deck-stack .ui-icon { width: 25px; height: 25px; }
.your-tableau { position: absolute; left: .3rem; right: .3rem; bottom: .35rem; }.tableau-heading { display: flex; justify-content: space-between; align-items: baseline; }.tableau-heading h2 { margin: 0; color: rgba(78,59,62,.82); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }.tableau-heading span { color: rgba(78,59,62,.75); font-size: .65rem; font-weight: 800; }.tableau-cards { min-height: 100px; margin-top: .4rem; padding: .45rem; display: flex; align-items: end; gap: .25rem; overflow-x: auto; background: rgba(255,255,255,.12); border: 1.5px dashed rgba(78,59,62,.3); border-radius: 15px; scrollbar-width: thin; }.empty-tableau { width: 100%; margin: auto; color: rgba(78,59,62,.62); font-size: .7rem; text-align: center; }
.hand-dock { position: relative; z-index: 5; margin: .5rem -.65rem 0; padding: .8rem .75rem calc(.75rem + env(safe-area-inset-bottom)); background: rgba(255,250,241,.98); border-top: 2px solid var(--ink); border-radius: 22px 22px 0 0; box-shadow: 0 -12px 32px rgba(63,42,36,.16); }.hand-heading { display: flex; justify-content: space-between; align-items: center; }.hand-heading .eyebrow { margin: 0; font-size: .58rem; }.hand-heading h2 { margin: 0; font-size: 1.1rem; }.hand-count { padding: .24rem .5rem; color: var(--muted); background: var(--latte); border-radius: 20px; font-size: .68rem; font-weight: 800; }
.hand { min-height: 218px; margin: .55rem -.75rem 0; padding: .45rem .75rem 1rem; display: flex; align-items: end; gap: .6rem; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; scroll-padding-inline: .75rem; }.hand::after { content: ''; min-width: .15rem; height: 1px; }.hand-actions { display: grid; gap: .55rem; }.hand-actions p { margin: 0; display: flex; align-items: flex-start; gap: .35rem; font-size: .68rem; }.hand-actions p .ui-icon { margin-top: .12rem; color: var(--blue-dark); }.hand-actions .primary-button { min-height: 46px; }

.game-card { --card-accent: #f0ad80; --card-accent-soft: #ffd6ae; position: relative; width: 135px; min-width: 135px; min-height: 202px; padding: .32rem; display: flex; flex-direction: column; color: #50363b; background: var(--card-accent); border: 1.5px solid rgba(78,59,62,.72); border-radius: 17px; box-shadow: 0 5px 0 #50363b, 0 12px 22px rgba(78,59,62,.18); scroll-snap-align: center; overflow: hidden; text-align: left; transform-origin: bottom center; transition: transform .18s, box-shadow .18s; }.game-card:not(:disabled):hover { transform: translateY(-7px) rotate(-1deg); box-shadow: 0 9px 0 #50363b, 0 18px 26px rgba(78,59,62,.2); }.game-card.is-selected { transform: translateY(-10px); box-shadow: 0 0 0 4px #fff8ec, 0 0 0 7px var(--mint-dark), 0 9px 0 #50363b; }.game-card.is-disabled { filter: grayscale(.45); }
.game-card[data-card-type="cookie_set"] { --card-accent: #f7a62d; }.game-card[data-card-type="afternoon_set"] { --card-accent: #d992a9; }.game-card[data-card-type="sweet_bun"] { --card-accent: #f3bf49; }.game-card[data-card-type^="drink_"] { --card-accent: #47bdb8; }.game-card[data-card-type="bunny_guest"] { --card-accent: #9ba6df; }.game-card[data-card-type="cat_guest"] { --card-accent: #918fd4; }.game-card[data-card-type="dog_guest"] { --card-accent: #7e8fce; }.game-card[data-card-type="adoption_pet"] { --card-accent: #b4d437; }.game-card[data-card-type="cream_topping"] { --card-accent: #e9c892; }.game-card[data-card-type="extra_paws"] { --card-accent: #eaa348; }
.card-picture { position: relative; width: 100%; aspect-ratio: 1 / 1; display: block; flex: 0 0 auto; background: var(--card-accent); border-radius: 13px 13px 8px 8px; overflow: hidden; }.card-art-image { width: 100%; height: 100%; display: block; object-fit: cover; }.card-art-missing { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(78,59,62,.7); font: 900 3rem/1 var(--font-display); }.card-value-badge { position: absolute; top: 5px; left: 5px; min-width: 28px; height: 28px; padding: 0 .38rem; display: grid; place-items: center; color: #50363b; background: rgba(255,248,232,.94); border: 1.5px solid rgba(78,59,62,.72); border-radius: 10px; box-shadow: 0 2px 0 rgba(78,59,62,.45); font: 900 .78rem/1 var(--font-display); }
.card-info { position: relative; z-index: 1; min-height: 63px; margin-top: -9px; padding: .38rem .38rem .34rem; display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; color: #50363b; background: #fff1d6; border: 1.5px solid rgba(91,61,51,.3); border-radius: 15px 15px 11px 11px; box-shadow: 0 -3px 8px rgba(73,46,37,.12); text-align: center; }.card-name { width: 100%; font: 900 .78rem/.95 var(--font-display); letter-spacing: .025em; text-transform: uppercase; }.card-rule { width: 100%; min-height: 28px; margin-top: .22rem; display: flex; flex-direction: column; align-items: center; justify-content: center; }.card-rule-kicker { font-size: .48rem; font-weight: 900; line-height: 1; letter-spacing: .04em; }.card-rule-main { margin-top: .12rem; font: 900 .82rem/.95 var(--font-display); white-space: nowrap; }.game-card[data-card-type^="drink_"] .card-rule-main { font-size: .64rem; letter-spacing: -.01em; }.game-card[data-card-type="adoption_pet"] .card-rule-main { font-size: .72rem; }.card-ladder { width: 100%; display: grid; gap: 2px; font: 900 .55rem/1 var(--font-display); }.card-ladder > span { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; }.card-ladder b { color: #786367; font-size: .46rem; }.card-ladder strong { color: #b84f4f; font-size: .62rem; }.card-check { position: absolute; z-index: 3; top: 6px; right: 6px; width: 26px; height: 26px; display: none; place-items: center; color: white; background: var(--mint-dark); border: 2px solid white; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,.25); }.card-check .ui-icon { width: 14px; }.game-card.is-selected .card-check { display: grid; }
.game-card.is-compact { width: 67px; min-width: 67px; height: 94px; min-height: 94px; padding: .18rem; border-radius: 9px; box-shadow: 0 3px 0 #50363b; }.game-card.is-compact .card-picture { height: 100%; aspect-ratio: auto; border-radius: 6px; }.game-card.is-compact .card-info, .game-card.is-compact .card-value-badge { display: none; }
.card-back { position: relative; width: 67px; min-width: 67px; height: 94px; display: grid; place-items: center; color: white; background: #64aa9f; border: 2px solid var(--ink); border-radius: 8px; box-shadow: 0 3px 0 var(--ink); overflow: hidden; }.card-back::before { content: ''; position: absolute; inset: 5px; border: 1px dashed rgba(255,255,255,.65); border-radius: 5px; }.card-back-pattern .ui-icon { width: 27px; height: 27px; }.card-back strong { position: absolute; right: 3px; bottom: 3px; width: 20px; height: 20px; display: grid; place-items: center; color: var(--ink); background: #fff8ed; border: 1px solid var(--ink); border-radius: 50%; font-size: .65rem; }

.game-dialog { width: min(calc(100% - 1.25rem), 720px); max-height: min(90dvh, 820px); padding: 0; color: var(--ink); background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius-lg); box-shadow: 8px 9px 0 var(--ink), 0 24px 70px rgba(50,32,29,.35); overflow: hidden; }.game-dialog::backdrop { background: rgba(62,43,40,.55); backdrop-filter: blur(3px); }.dialog-header { padding: 1rem 1rem .8rem; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); }.dialog-header .eyebrow { margin-bottom: .25rem; }.dialog-header h2 { margin: 0; font-size: clamp(1.5rem, 6vw, 2.2rem); }.dialog-header p:last-child { margin: .3rem 0 0; }.dialog-body { max-height: 60dvh; padding: 1rem; overflow-y: auto; }.dialog-footer { padding: .8rem 1rem 1rem; display: flex; justify-content: flex-end; gap: .6rem; background: #faf4e9; border-top: 1px solid var(--line); }.rules-steps { margin: 0 0 1.2rem; padding: 0; display: grid; gap: .6rem; list-style: none; }.rules-steps li { display: flex; gap: .7rem; align-items: center; }.rules-steps li > span { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; color: white; background: var(--peach-dark); border: 2px solid var(--ink); border-radius: 50%; font: 700 1.05rem var(--font-display); }.rules-steps strong { font-family: var(--font-display); }.rules-steps p { margin: 0; font-size: .8rem; }.rules-body h3 { margin: 1rem 0 .7rem; }.rules-grid { display: grid; gap: .55rem; }.rules-grid article { padding: .7rem; display: flex; align-items: center; gap: .65rem; background: #fbf7ef; border: 1px solid var(--line); border-radius: 14px; }.rules-grid strong { font-size: .9rem; }.rules-grid p { margin: 0; font-size: .72rem; }.rule-swatch { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border: 1.5px solid var(--ink); border-radius: 12px; }.swatch-cookie { background: #f6be94; }.swatch-drink { background: #a8ddd4; }.swatch-guest { background: #bac8ec; }.swatch-adopt { background: #badfbb; }.rule-note { margin-top: 1rem; padding: .8rem; display: flex; gap: .6rem; background: #fff1ca; border-radius: 14px; }.rule-note .ui-icon { color: #b87723; }.rule-note p { margin: 0; color: #665341; font-size: .8rem; font-weight: 700; }
.result-dialog { position: relative; }.result-burst { position: absolute; right: 85px; top: 15px; color: var(--butter); font-size: 2rem; transform: rotate(14deg); }.winner-card { padding: .8rem; display: flex; align-items: center; gap: .7rem; color: var(--ink); background: #fff0ca; border: 1.5px solid #e4bd61; border-radius: 16px; }.winner-card div { display: grid; }.winner-card small { color: #8a6b36; font-size: .65rem; font-weight: 800; text-transform: uppercase; }.winner-card b { margin-left: auto; display: flex; align-items: center; gap: .2rem; color: var(--red); }.winner-card b .ui-icon { fill: currentColor; }.score-breakdown, .ranking-list { margin-top: .8rem; display: grid; gap: .4rem; }.score-row, .ranking-row { min-height: 46px; padding: .55rem .7rem; display: flex; align-items: center; gap: .6rem; background: #fbf7ef; border-radius: 12px; }.score-row span:last-child, .ranking-row b { margin-left: auto; font-weight: 800; }.ranking-row.is-you { background: #e0f1ec; border: 1px solid #b6d9d0; }.podium { min-height: 150px; display: flex; align-items: end; justify-content: center; gap: .4rem; }.podium-place { width: 30%; display: grid; place-items: center; }.podium-place .avatar { margin-bottom: .3rem; }.podium-step { width: 100%; min-height: 60px; padding: .5rem .2rem; display: grid; place-items: center; background: #f2d57e; border: 1.5px solid var(--ink); border-radius: 10px 10px 0 0; text-align: center; }.podium-place:nth-child(1) .podium-step { min-height: 85px; background: #f2c96c; }.podium-place:nth-child(3) .podium-step { min-height: 48px; background: #e4b395; }
.score-breakdown > div, .ranking-list > div { min-height: 46px; padding: .55rem .7rem; display: flex; align-items: center; gap: .6rem; background: #fbf7ef; border-radius: 12px; }
.score-breakdown > div strong, .ranking-list > div b { margin-left: auto; font-weight: 800; }
.ranking-list > div > small { margin-left: auto; color: var(--muted); font-size: .68rem; }
.podium-place { min-height: 74px; padding: .55rem .25rem; align-content: center; background: #f2d57e; border: 1.5px solid var(--ink); border-radius: 10px 10px 0 0; text-align: center; }
.podium-place:nth-child(1) { min-height: 104px; background: #f2c96c; }.podium-place:nth-child(3) { min-height: 60px; background: #e4b395; }
.podium-place > span { width: 25px; height: 25px; display: grid; place-items: center; color: white; background: var(--ink); border-radius: 50%; font-weight: 800; }.podium-place strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.podium-place b { color: var(--red); font-size: .75rem; }.podium-place b .ui-icon { width: 11px; fill: currentColor; }
.confetti i { position: absolute; width: 8px; height: 16px; top: -20px; background: var(--peach); animation: confetti 2.6s ease-out infinite; }.confetti i:nth-child(1) { left: 10%; }.confetti i:nth-child(2) { left: 27%; background: var(--mint); animation-delay: -.7s; }.confetti i:nth-child(3) { left: 52%; background: var(--butter); animation-delay: -1.2s; }.confetti i:nth-child(4) { left: 75%; background: var(--lavender); animation-delay: -.3s; }.confetti i:nth-child(5) { left: 91%; background: var(--blue); animation-delay: -1.7s; }
.dialog-fallback { position: fixed; inset: 5vh auto auto 50%; z-index: 100; transform: translateX(-50%); }.has-dialog::after { content: ''; position: fixed; inset: 0; z-index: 90; background: rgba(62,43,40,.55); }

.toast-region { position: fixed; z-index: 200; left: .75rem; right: .75rem; bottom: calc(.75rem + env(safe-area-inset-bottom)); pointer-events: none; }.toast { max-width: 420px; min-height: 52px; margin-left: auto; padding: .6rem .65rem; display: flex; align-items: center; gap: .6rem; color: var(--ink); background: white; border: 2px solid var(--ink); border-radius: 15px; box-shadow: 0 5px 0 var(--ink), var(--shadow); opacity: 0; transform: translateY(16px); transition: opacity .2s, transform .2s; pointer-events: auto; }.toast.is-visible { opacity: 1; transform: none; }.toast p { margin: 0; flex: 1; color: inherit; font-size: .82rem; font-weight: 700; }.toast button { width: 44px; padding: 0; display: grid; place-items: center; background: transparent; border: 0; }.toast-icon { width: 34px; height: 34px; display: grid; place-items: center; color: #356f65; background: #dff0eb; border-radius: 11px; }.toast-error .toast-icon { color: #9d3d3d; background: #fae0dd; }.toast-success .toast-icon { color: #356f65; }

@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes steam { 0%,100% { opacity: .2; transform: translateY(10px) rotate(12deg) scale(.8); } 50% { opacity: .9; transform: translateY(-8px) rotate(-8deg) scale(1); } }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(76,155,141,0); } 100% { box-shadow: 0 0 0 0 rgba(76,155,141,0); } }
@keyframes dots { 0%,60%,100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes confetti { 0% { transform: translateY(0) rotate(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(280px) rotate(380deg); opacity: 0; } }

@media (min-width: 700px) {
  .topbar { min-height: 78px; }
  .screen { min-height: calc(100dvh - 78px); }
  .home-screen { grid-template-columns: 1.05fr .95fr; }
  .hero-scene { min-height: 470px; }
  .hero-cat, .hero-bunny { bottom: 91px; width: 150px; height: 160px; }.hero-table { bottom: 28px; height: 92px; }.hero-cup { bottom: 97px; }.steam { top: 152px; }
  .panel-screen { padding: 1.5rem; }
  .mode-grid { grid-template-columns: 1fr 42px 1fr; align-items: stretch; }.mode-divider { display: grid; place-items: center; position: relative; }.mode-divider::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px dashed var(--line); }.mode-divider span { position: relative; z-index: 1; padding: .35rem 0; color: var(--muted); background: var(--paper); font-size: .7rem; font-weight: 800; }.mode-card { padding: 1.35rem; }
  .lobby-seats { grid-template-columns: repeat(2, 1fr); }.lobby-footer { grid-template-columns: 1fr auto; align-items: center; }.lobby-footer > p { justify-content: flex-start; }.lobby-actions { grid-template-columns: auto auto; }
  .game-screen { padding: .8rem 1rem 0; }.game-hud { grid-template-columns: auto 1fr auto; }.turn-status { grid-column: 2; grid-row: 1; justify-self: center; min-width: 220px; }.opponents { gap: .8rem; }.opponent { min-width: 155px; }.table-center { min-height: 285px; }.table-pattern { height: 275px; }.your-tableau { left: 6%; right: 6%; }.tableau-cards { min-height: 125px; }.hand-dock { margin-inline: -1rem; padding: .85rem 1.2rem calc(.9rem + env(safe-area-inset-bottom)); }.hand { min-height: 245px; margin-inline: -1.2rem; padding-inline: max(1.2rem, calc((100vw - 1100px) / 2)); justify-content: flex-start; }.hand-actions { grid-template-columns: 1fr auto; align-items: center; }.hand-actions .primary-button { min-width: 180px; }
  .game-card { width: 150px; min-width: 150px; min-height: 226px; }.card-name { font-size: .73rem; }
  .rules-grid { grid-template-columns: 1fr 1fr; }
  .dialog-header, .dialog-body { padding: 1.25rem 1.4rem; }.dialog-footer { padding: 1rem 1.4rem 1.25rem; }
}

@media (min-width: 1100px) {
  .panel-screen { align-items: center; padding-bottom: 4rem; }.game-screen { padding-inline: 1.5rem; }.opponents { margin-top: .9rem; }.table-center { min-height: 320px; }.table-pattern { height: 310px; }.your-tableau { left: 12%; right: 12%; }.hand-dock { margin-inline: -1.5rem; }.hand { justify-content: center; overflow: visible; }.game-card { width: 158px; min-width: 158px; min-height: 236px; }.hand .game-card { margin-left: -20px; transform: rotate(var(--fan-angle, 0deg)) translateY(var(--fan-y, 0)); }.hand .game-card:first-child { margin-left: 0; }.hand .game-card:nth-child(1) { --fan-angle: -3deg; --fan-y: 4px; }.hand .game-card:nth-child(2) { --fan-angle: -2deg; --fan-y: 1px; }.hand .game-card:nth-last-child(2) { --fan-angle: 2deg; --fan-y: 1px; }.hand .game-card:nth-last-child(1) { --fan-angle: 3deg; --fan-y: 4px; }.hand .game-card:hover { transform: translateY(-15px) rotate(0); z-index: 3; }.hand .game-card.is-selected { transform: translateY(-18px) rotate(0); z-index: 4; }
}

@media (max-width: 520px) {
  .rules-button span:last-child { display: none; }.rules-button { width: 44px; padding: 0; }.panel-heading { align-items: flex-start; }.heading-icon { width: 52px; height: 52px; }.room-code-card { align-items: stretch; }.room-code-card .soft-button { padding-inline: .55rem; }.dialog-footer { display: grid; grid-template-columns: 1fr 1fr; }.dialog-footer > :only-child { grid-column: 1 / -1; }.dialog-footer button { padding-inline: .55rem; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .topbar { min-height: 52px; padding-block: .25rem; }.brand-mark { width: 38px; height: 38px; }.screen { min-height: calc(100dvh - 52px); }.home-screen { padding-top: .7rem; grid-template-columns: 1.15fr .85fr; }.hero-copy h1 { margin-bottom: .4rem; font-size: clamp(2.1rem, 7vw, 3.3rem); }.hero-lead { margin-bottom: .7rem; font-size: .86rem; }.quick-facts { margin-top: .75rem; }.hero-scene { min-height: 285px; transform: scale(.78); transform-origin: center; }.panel-screen { padding: .5rem; }.panel-card { padding: .7rem 1rem; }.panel-heading { margin: .4rem 0 .7rem; }.heading-icon { display: none; }.panel-heading h1 { font-size: 1.5rem; }.mode-card { padding: .8rem; }.mode-card h2 { font-size: 1.15rem; margin: .2rem 0; }.mode-card > p, .privacy-note { display: none; }.mode-icon { width: 37px; height: 37px; }.form-stack { gap: .35rem; } input, select { min-height: 44px; padding-block: .45rem; }.connection-settings { margin-top: .5rem; }
  .game-screen { padding-top: .3rem; }.game-hud { position: absolute; top: .25rem; left: .35rem; right: .35rem; }.opponents { position: absolute; top: 48px; left: .3rem; right: 48%; min-height: 65px; margin: 0; justify-content: flex-start; }.opponent { min-width: 120px; padding: .3rem; }.mini-hand { display: none; }.table-center { position: absolute; inset: 102px 48% 0 0; min-height: 0; }.table-pattern, .deck-area { display: none; }.your-tableau { inset: .2rem; }.tableau-cards { min-height: calc(100% - 25px); }.hand-dock { position: absolute; top: 48px; right: 0; bottom: 0; left: 52%; margin: 0; padding: .45rem .55rem; border-top: 0; border-left: 2px solid var(--ink); border-radius: 18px 0 0 0; overflow: hidden; }.hand-heading .eyebrow, .hand-actions p { display: none; }.hand-heading h2 { font-size: .9rem; }.hand { min-height: calc(100% - 88px); height: calc(100% - 88px); margin: .2rem -.55rem; padding: .2rem .55rem .5rem; align-items: center; }.hand-actions { display: block; }.hand-actions .primary-button { width: 100%; min-height: 42px; }.game-card { width: 112px; min-width: 112px; min-height: 167px; }.card-name { font-size: .55rem; }.card-top { min-height: 27px; grid-template-columns: 20px 1fr; }.card-type-icon { width: 19px; height: 19px; }.card-bottom { min-height: 23px; }.game-dialog { max-height: 94dvh; }.dialog-body { max-height: 52dvh; }
}

@media (prefers-contrast: more) {
  :root { --muted: #59494a; --line: #9d8880; }.panel-card, .game-card, .game-dialog { border-width: 3px; }.eyebrow { color: #9d4237; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
/* Programmatic screen-heading focus aids screen readers without drawing a giant box. */
.screen h1[tabindex="-1"]:focus { outline: none; }

/* Keep native dialogs centered in the viewport even when the game page is scrolled. */
.game-dialog,
.game-dialog.result-dialog { position: fixed; inset: 0; margin: auto; }

/* Premium motion and Party-mode polish. */
.variant-control { grid-template-columns: 1fr 1fr; }
.variant-control label span { padding-inline: .55rem; }
.party-menu-field { padding: .75rem; background: linear-gradient(135deg, #fff2cf, #f8e5f0); border: 1px solid #e8c68d; border-radius: 15px; }
.party-menu-field label { display: block; margin-bottom: .35rem; }
.party-rules-note { margin-top: .7rem; padding: .8rem; background: linear-gradient(135deg, #e4f4ef, #eee8fa); border: 1px solid #bddbd1; border-radius: 14px; }
.party-rules-note p { margin: .2rem 0 0; font-size: .78rem; }

.primary-button { position: relative; isolation: isolate; overflow: hidden; box-shadow: 0 4px 0 #6f3735, 0 12px 24px rgba(136,61,55,.18); transition: translate .18s ease, box-shadow .18s ease, filter .18s ease; }
.primary-button::after { content: ''; position: absolute; z-index: -1; inset: -100% -30%; background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.38) 48%, transparent 58%); translate: -60% 0; transition: translate .55s ease; }
.primary-button:hover::after { translate: 60% 0; }.primary-button:active { translate: 0 3px; box-shadow: 0 1px 0 #6f3735, 0 6px 13px rgba(136,61,55,.16); }
.soft-button, .secondary-button, .icon-button { transition: translate .16s ease, box-shadow .16s ease, background-color .16s ease; }
.soft-button:active, .secondary-button:active, .icon-button:active { translate: 0 2px; }

.game-card { isolation: isolate; animation: card-deal .48s cubic-bezier(.2,.85,.25,1.15) both; animation-delay: calc(var(--card-index, 0) * 38ms); will-change: transform, translate; }
.game-card::after { content: ''; position: absolute; z-index: 2; inset: -40% -80%; pointer-events: none; background: linear-gradient(110deg, transparent 40%, rgba(255,255,255,.33) 49%, transparent 58%); translate: -45% 0; rotate: 8deg; transition: translate .65s ease; }
.game-card:not(:disabled):hover::after, .game-card.is-selected::after { translate: 48% 0; }
.game-card.is-selected { animation: selected-glow 1.8s ease-in-out infinite; }
.game-card.is-compact { animation-name: card-land; animation-duration: .4s; }
.game-card.is-compact.is-selected { outline: 3px solid var(--mint-dark); outline-offset: 2px; }
.game-card.is-flipped { --card-accent: #65aa9f; background: #65aa9f; }
.game-card.is-flipped .card-picture { background: repeating-linear-gradient(45deg,#65aa9f 0 12px,#78bbb0 12px 24px); }
.game-card.is-flipped .card-picture::after { content: '♥'; position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.88); font: 900 1.6rem var(--font-display); }
.game-card.is-flipped .card-art-image { opacity: 0; }.game-card.is-flipped .card-info { display: none; }

.game-card[data-card-type="cone_race"] { --card-accent: #ef8f75; }
.game-card[data-card-type^="tray_race_"] { --card-accent: #8499dc; }
.game-card[data-card-type="caramel_twist"] { --card-accent: #dfa24a; }
.game-card[data-card-type="cheesecake"] { --card-accent: #8fcfbd; }
.game-card[data-card-type^="sandwich_"] { --card-accent: #b79ad7; }
.game-card[data-card-type="shared_sprinkles"] { --card-accent: #b8d847; }
.game-card[data-card-type="soup_special"] { --card-accent: #d68da4; }
.game-card[data-card-type="loyalty_card"] { --card-accent: #3fa9a2; }
.game-card[data-card-type="tea_pot"] { --card-accent: #8ebbd6; }
.game-card[data-card-type="menu_card"] { --card-accent: #efbb48; }
.game-card[data-card-type="silver_spoon"] { --card-accent: #e88d6d; }
.game-card[data-card-type="special_order"] { --card-accent: #a687c7; }
.game-card[data-card-type="takeout_box"] { --card-accent: #efaa83; }
.game-card[data-card-type="icecream_cake"] { --card-accent: #62c5c4; }
.game-card[data-card-type="fruit_basket"] { --card-accent: #9fc953; }
.game-card[data-card-type^="tray_race_"] .card-rule-main,
.game-card[data-card-type^="sandwich_"] .card-rule-main,
.game-card[data-card-type="shared_sprinkles"] .card-rule-main,
.game-card[data-card-type="fruit_basket"] .card-rule-main { font-size: .53rem; white-space: normal; }
.game-card[data-card-type="fruit_basket"] .card-rule-kicker { font-size: .42rem; }
.card-ladder > span { grid-template-columns: repeat(var(--ladder-cols, 5), 1fr); }
.game-card[data-card-type="fruit_basket"] .card-ladder { font-size: .51rem; }
.game-card[data-card-type="fruit_basket"] .card-ladder b { font-size: .43rem; }
.game-card[data-card-type="fruit_basket"] .card-ladder strong { font-size: .57rem; }

.bonus-control { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.bonus-control select { min-height: 42px; width: min(230px, 100%); padding-block: .45rem; }
.soft-button.is-active { color: #245e55; background: #d8eee8; box-shadow: 0 0 0 2px #62a99b inset; }

.menu-choice-dialog { width: min(calc(100% - 1rem), 780px); }
.menu-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; justify-items: center; }
.menu-options .game-card { width: 145px; min-width: 145px; }
.menu-choice-dialog[open] { animation: dialog-pop .35s cubic-bezier(.2,.9,.2,1.1); }
.menu-choice-dialog::backdrop { animation: backdrop-in .25s ease both; }

.deck-stack { animation: deck-breathe 3s ease-in-out infinite; }
.turn-status .ui-icon { animation: tiny-sparkle 1.7s ease-in-out infinite; }
.score-chip strong { transition: scale .25s cubic-bezier(.2,.9,.2,1.2); }
.confetti i { filter: drop-shadow(0 2px 1px rgba(70,45,40,.18)); }
.result-dialog[open] { animation: dialog-pop .38s cubic-bezier(.2,.9,.2,1.12); }

@keyframes card-deal { from { opacity: 0; translate: 0 24px; scale: .94; filter: blur(3px); } to { opacity: 1; translate: 0 0; scale: 1; filter: none; } }
@keyframes card-land { from { opacity: 0; translate: 24px -12px; rotate: 5deg; scale: .82; } to { opacity: 1; translate: 0 0; rotate: 0; scale: 1; } }
@keyframes selected-glow { 0%,100% { filter: drop-shadow(0 0 0 rgba(87,160,146,0)); } 50% { filter: drop-shadow(0 0 8px rgba(87,160,146,.5)); } }
@keyframes dialog-pop { from { opacity: 0; scale: .92; translate: 0 12px; } to { opacity: 1; scale: 1; translate: 0 0; } }
@keyframes backdrop-in { from { background: rgba(62,43,40,0); backdrop-filter: blur(0); } }
@keyframes deck-breathe { 0%,100% { translate: 0 0; rotate: -1deg; } 50% { translate: 0 -4px; rotate: 1deg; } }
@keyframes tiny-sparkle { 0%,100% { scale: 1; rotate: 0; } 50% { scale: 1.13; rotate: 8deg; } }

@media (min-width: 700px) {
  .menu-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .variant-control { grid-template-columns: 1fr; }
  .menu-options .game-card { width: 135px; min-width: 135px; }
  .bonus-control { display: grid; grid-template-columns: 1fr; }
  .opponents { min-height: 72px; margin-block: .55rem; }
  .table-center { min-height: 175px; }
  .table-pattern { height: 165px; }
  .tableau-cards { min-height: 78px; }
}

/* Stable hand rendering: animate only genuinely new cards, never a selection repaint. */
.game-card { animation: none; will-change: auto; }
.game-card.is-dealing { animation: card-deal .42s cubic-bezier(.2,.85,.25,1.12) both; animation-delay: calc(var(--card-index, 0) * 24ms); }
.game-card.is-selected { animation: selected-glow 1.8s ease-in-out infinite; }
.game-card.is-compact { animation: none; }
.game-card.is-compact.is-landing { animation: card-land .34s cubic-bezier(.2,.85,.25,1.08) both; animation-delay: calc(var(--card-index, 0) * 22ms); }

/* Larger, more legible cards and a more substantial bottom tray. */
.hand-dock { background: linear-gradient(180deg, rgba(255,253,247,.99), rgba(255,247,232,.99)); border-top-width: 3px; box-shadow: 0 -15px 38px rgba(63,42,36,.2); }
.hand { min-height: 242px; }
.game-card:not(.is-compact) { width: 150px; min-width: 150px; min-height: 226px; }
.card-info { min-height: 74px; padding: .48rem .44rem .42rem; }
.card-name { font-size: .84rem; line-height: .98; }
.card-rule { min-height: 32px; margin-top: .28rem; }
.card-rule-kicker { font-size: .54rem; }
.card-rule-main { font-size: .9rem; }
.card-ladder { font-size: .62rem; }
.card-ladder b { font-size: .52rem; }
.card-ladder strong { font-size: .7rem; }
.game-card[data-card-type^="drink_"] .card-rule-main { font-size: .7rem; }
.game-card[data-card-type="adoption_pet"] .card-rule-main { font-size: .78rem; }
.game-card[data-card-type^="tray_race_"] .card-rule-main,
.game-card[data-card-type="shared_sprinkles"] .card-rule-main { font-size: .59rem; }
.game-card[data-card-type="fruit_basket"] .card-rule-kicker { font-size: .47rem; }
.game-card[data-card-type="fruit_basket"] .card-ladder b { font-size: .47rem; }
.game-card[data-card-type="fruit_basket"] .card-ladder strong { font-size: .64rem; }

@media (min-width: 700px) {
  .hand { min-height: 270px; }
  .game-card:not(.is-compact) { width: 158px; min-width: 158px; min-height: 244px; }
  .card-name { font-size: .87rem; }
}

@media (min-width: 1100px) {
  .game-card:not(.is-compact) { width: clamp(136px, 10.8vw, 156px); min-width: clamp(136px, 10.8vw, 156px); min-height: 240px; }
  .hand .game-card { margin-left: -26px; }
  .hand .game-card:first-child { margin-left: 0; }
  .card-name { font-size: .91rem; }
  .card-rule-main { font-size: .96rem; }
}

@media (min-width: 700px) and (max-height: 820px) {
  .opponents { min-height: 72px; margin-top: .25rem; }
  .table-center { min-height: 150px; }
  .table-pattern { height: 145px; }
  .your-tableau { top: 72px; }
  .tableau-cards { min-height: 72px; }
  .hand-dock { margin-top: .25rem; padding-top: .65rem; padding-bottom: .65rem; }
  .hand { min-height: 228px; margin-top: .25rem; padding-bottom: .35rem; }
  .game-card:not(.is-compact) { min-height: 218px; }
  .card-info { min-height: 66px; }
  .hand-actions { position: absolute; right: 1.2rem; bottom: .55rem; left: 1.2rem; }
  .hand-dock { padding-bottom: 3.65rem; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .game-card:not(.is-compact) { width: 112px; min-width: 112px; min-height: 167px; }
  .card-info { min-height: 54px; padding: .3rem; }
  .card-name { font-size: .58rem; }
  .card-rule { min-height: 24px; margin-top: .15rem; }
  .card-rule-kicker { font-size: .4rem; }
  .card-rule-main { font-size: .63rem; }
}

/* The shared tabletop stays airy; the player's café now forms a shelf above the hand. */
.table-center {
  min-height: clamp(92px, 15vh, 145px);
  isolation: isolate;
}
.table-pattern {
  width: min(88vw, 880px);
  height: clamp(88px, 14vh, 138px);
  background:
    radial-gradient(ellipse at center, rgba(255,244,216,.22) 0 24%, transparent 25%),
    repeating-radial-gradient(ellipse at center, transparent 0 23px, rgba(91,61,51,.035) 24px 25px);
  border: 1.5px solid rgba(83,57,47,.18);
  box-shadow: inset 0 0 34px rgba(255,250,231,.15), 0 10px 25px rgba(93,58,42,.08);
}
.table-pattern::before,
.table-pattern::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 54px;
  height: 54px;
  border: 1.5px dashed rgba(83,57,47,.16);
  border-radius: 50%;
  translate: 0 -50%;
  box-shadow: inset 0 0 0 8px rgba(255,248,225,.07);
}
.table-pattern::before { left: 9%; }
.table-pattern::after { right: 9%; }
.deck-area {
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -48%);
}
.deck-area p {
  margin: .5rem -.8rem 0;
  padding: .22rem .55rem;
  justify-content: center;
  background: rgba(255,247,229,.54);
  border: 1px solid rgba(83,57,47,.12);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.your-tableau.tableau-shelf {
  position: relative;
  z-index: 6;
  inset: auto;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
  margin: -1.8rem .05rem 0;
  padding: .58rem .68rem .68rem;
  background:
    linear-gradient(180deg, rgba(255,250,235,.86), rgba(236,211,176,.91)),
    repeating-linear-gradient(90deg, transparent 0 60px, rgba(102,64,43,.035) 61px 62px);
  border: 1.5px solid rgba(78,59,62,.54);
  border-bottom-width: 3px;
  border-radius: 19px 19px 14px 14px;
  box-shadow: 0 7px 0 rgba(103,69,52,.2), 0 14px 25px rgba(72,44,35,.13), inset 0 1px rgba(255,255,255,.66);
}
.tableau-heading {
  min-height: 38px;
  align-items: center;
  gap: .7rem;
}
.tableau-title-group { min-width: 0; }
.tableau-title-group .eyebrow { margin: 0 0 .08rem; font-size: .52rem; }
.tableau-heading h2 { color: var(--ink); font-size: .9rem; }
.tableau-tools { display: flex; align-items: center; justify-content: flex-end; gap: .55rem; }
.tableau-tools #tableau-score {
  padding: .28rem .52rem;
  color: #765b4f;
  background: rgba(255,250,240,.72);
  border: 1px solid rgba(78,59,62,.15);
  border-radius: 999px;
  white-space: nowrap;
}
.card-guide-button { min-height: 36px; padding: .35rem .6rem; font-size: .7rem; }
.tableau-cards {
  min-height: 105px;
  margin-top: .32rem;
  padding: .42rem .5rem .55rem;
  align-items: end;
  background: rgba(255,252,242,.33);
  border-style: solid;
  border-color: rgba(78,59,62,.22);
  box-shadow: inset 0 7px 14px rgba(95,61,44,.055);
}
.tableau-cards .game-card.is-compact { cursor: zoom-in; }
.tableau-cards .game-card.is-compact:focus-visible {
  outline: 3px solid rgba(76,155,141,.75);
  outline-offset: 3px;
}
.tableau-shelf + .hand-dock { margin-top: .55rem; }

/* Full-card portal avoids clipping inside the horizontally scrolling café shelf. */
.tableau-preview {
  position: fixed;
  z-index: 180;
  width: 166px;
  pointer-events: none;
  filter: drop-shadow(0 20px 22px rgba(55,34,30,.26));
  animation: preview-pop .16s cubic-bezier(.2,.8,.25,1.1) both;
}
.tableau-preview .game-card,
.tableau-preview .game-card:not(.is-compact) {
  width: 166px;
  min-width: 166px;
  min-height: 250px;
  box-shadow: 0 7px 0 #50363b, 0 20px 36px rgba(63,39,33,.24);
}
.tableau-preview .game-card:hover { transform: none; }
@keyframes preview-pop { from { opacity: 0; scale: .9; translate: 0 8px; } }

/* Contextual catalogue: only cards that can appear in the current menu. */
.card-guide-dialog { width: min(calc(100% - 1.25rem), 1040px); }
.card-guide-body { max-height: 68dvh; background: linear-gradient(180deg, #fffdf8, #fbf3e6); }
.card-guide-groups { display: grid; gap: 1.25rem; }
.card-guide-group h3 {
  margin: 0 0 .65rem;
  padding-bottom: .42rem;
  color: #735950;
  border-bottom: 1px dashed #d9c3ae;
  font-size: .98rem;
  letter-spacing: .035em;
}
.card-guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.card-guide-item {
  min-width: 0;
  padding: .62rem;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: center;
  gap: .75rem;
  background: rgba(255,255,255,.78);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(91,61,52,.06);
}
.card-guide-item .game-card,
.card-guide-item .game-card:not(.is-compact) {
  width: 108px;
  min-width: 108px;
  min-height: 166px;
  padding: .24rem;
  border-radius: 13px;
  box-shadow: 0 3px 0 #50363b, 0 7px 12px rgba(78,59,62,.13);
  pointer-events: none;
}
.card-guide-item .card-info { min-height: 55px; margin-top: -7px; padding: .26rem; }
.card-guide-item .card-name { font-size: .62rem; }
.card-guide-item .card-rule { min-height: 23px; margin-top: .14rem; }
.card-guide-item .card-rule-kicker { font-size: .38rem; }
.card-guide-item .card-rule-main { font-size: .63rem; }
.card-guide-item .card-ladder b { font-size: .37rem; }
.card-guide-item .card-ladder strong { font-size: .49rem; }
.card-guide-item .game-card[data-card-type^="drink_"] .card-rule-main,
.card-guide-item .game-card[data-card-type^="tray_race_"] .card-rule-main,
.card-guide-item .game-card[data-card-type="shared_sprinkles"] .card-rule-main { font-size: .45rem; }
.card-guide-copy strong { display: block; margin-bottom: .28rem; font: 900 .9rem/1.05 var(--font-display); }
.card-guide-copy p { margin: 0; font-size: .72rem; line-height: 1.38; }

@media (min-width: 700px) {
  .table-center { min-height: clamp(105px, 16vh, 175px); }
  .table-pattern { height: clamp(100px, 15vh, 165px); }
  .your-tableau.tableau-shelf { width: min(94%, 1120px); margin: -2.15rem auto 0; padding-inline: .85rem; }
  .tableau-cards { min-height: 112px; gap: .35rem; }
  .tableau-heading h2 { font-size: 1rem; }
}

@media (min-width: 1100px) {
  .table-center { min-height: clamp(120px, 18vh, 195px); }
  .table-pattern { height: clamp(112px, 17vh, 185px); }
  .your-tableau.tableau-shelf { width: min(88%, 1180px); }
  .card-guide-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 699px) {
  .card-guide-grid { grid-template-columns: 1fr; }
  .card-guide-button span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .card-guide-button { width: 38px; padding: 0; }
  .tableau-tools { gap: .35rem; }
  .tableau-tools #tableau-score { font-size: .58rem; }
}

@media (max-width: 430px) {
  .your-tableau.tableau-shelf { margin-top: -1.35rem; padding-inline: .5rem; }
  .tableau-cards { margin-inline: -.08rem; }
  .card-guide-item { grid-template-columns: 92px minmax(0, 1fr); gap: .6rem; }
  .card-guide-item .game-card,
  .card-guide-item .game-card:not(.is-compact) { width: 92px; min-width: 92px; min-height: 142px; }
  .card-guide-item .card-info { min-height: 49px; }
  .card-guide-item .card-name { font-size: .53rem; }
  .card-guide-copy strong { font-size: .82rem; }
  .card-guide-copy p { font-size: .68rem; }
}

@media (min-width: 700px) and (max-height: 820px) {
  .your-tableau.tableau-shelf { top: auto; margin-top: -2rem; }
  .table-center { min-height: 110px; }
  .table-pattern { height: 104px; }
  .tableau-cards { min-height: 104px; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .table-center { display: none; }
  .your-tableau.tableau-shelf {
    position: absolute;
    inset: 116px 48% .3rem .3rem;
    width: auto;
    margin: 0;
    padding: .4rem .45rem;
    overflow: hidden;
  }
  .tableau-heading { min-height: 32px; }
  .tableau-title-group .eyebrow { display: none; }
  .tableau-cards { height: calc(100% - 36px); min-height: 0; margin-top: .2rem; }
  .tableau-preview { width: 118px; }
  .tableau-preview .game-card,
  .tableau-preview .game-card:not(.is-compact) { width: 118px; min-width: 118px; min-height: 176px; }
  .card-guide-dialog { max-height: 96dvh; }
  .card-guide-body { max-height: 56dvh; }
}
