@charset "UTF-8";

:root {
  color-scheme: light;
  --felt: #f5f0e7;
  --felt-deep: #ebe4d8;
  --ink: #25374e;
  --muted: #6f7b8b;
  --gold: #426b91;
  --gold-deep: #233b5b;
  --paper: #fffdf7;
  --card-w: 78px;
  --card-h: 112px;
  font-family: "Pretendard", "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
body { background: #e9e4dc; color: var(--ink); display: grid; place-items: center; }
button, input, select { font: inherit; }
button, a { touch-action: manipulation; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #3b6d99; outline-offset: 4px;
}
button:disabled { cursor: default; }
button[hidden], [hidden] { display: none !important; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app {
  isolation: isolate;
  position: relative;
  width: min(100vw, 750px);
  height: min(100dvh, 750px);
  height: min(100svh, 750px);
  display: grid;
  grid-template-rows: 66px minmax(0, 1fr) 202px calc(76px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  background: #fff9f0;
  border: 1px solid #dedfd5;
  box-shadow: 0 18px 60px #687c711c;
  container-type: inline-size;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 23px 9px; z-index: 3;
}
.topbar-left, .topbar-right, .topbar-actions, .brand { display: flex; align-items: center; gap: 10px; }
.brand { gap: 9px; }
.brand-mark { color: var(--gold); width: 24px; height: 29px; }
.brand-name, .topbar h1 { margin: 0; color: #f8f2e3; font-size: 19px; font-weight: 650; letter-spacing: -.04em; }
.brand-subtitle, .brand small { font-family: Georgia, serif; font-size: 10px; letter-spacing: .18em; color: var(--gold); }
.topbar .back-link { display: flex; align-items: center; justify-content: center; min-width: 38px; min-height: 38px; border-radius: 50%; text-decoration: none; }
.icon-btn {
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #afc4b432; border-radius: 50%; color: #e3e7dc;
  background: #ffffff06; cursor: pointer; flex-shrink: 0;
}
.icon-btn:hover, .back-link:hover { background: #ffffff10; }
.icon-btn svg, .back-link svg { width: 19px; height: 19px; }
.room-tag, .mode-tag {
  border: 1px solid #bbd1bd2b; border-radius: 20px; color: #cbd7c9;
  font-size: 11px; line-height: 1; padding: 6px 10px; white-space: nowrap;
}

.table { position: relative; min-height: 0; margin: 0 22px; }
.camp-scene {
  position: absolute; inset: 0 -22px; z-index: 0; pointer-events: none;
  background: #e6eddf url("./campsite-pastel.webp?v=20261120-onecard8") center 45% / cover no-repeat;
}
.camp-scene::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, #fff9ee0a, transparent 35%, #fff3e510);
}
.direction-orbit {
  position: absolute; inset: 2px -12px; z-index: 1; pointer-events: none;
  contain: layout style;
}
.direction-orbit *, .direction-orbit *::before, .direction-orbit *::after { pointer-events: none; }
.direction-orbit:not([data-ready="true"]) { visibility: hidden; }
.orbit-surface {
  position: absolute; inset: 18px; width: calc(100% - 36px); height: calc(100% - 36px);
  overflow: visible; fill: none; stroke-linecap: round;
}
.orbit-marker { transform-box: view-box; transform-origin: 50% 50%; will-change: transform; }
.orbit-halo { stroke: #f1dda4; stroke-width: 14; opacity: .22; }
.orbit-edge { stroke: #618476; stroke-width: 8.5; opacity: .6; }
.orbit-ribbon { stroke: #fff1cb; stroke-width: 5.5; opacity: .5; }
.orbit-front { stroke: #fff6dc; stroke-width: 5.5; opacity: .4; }
.orbit-tip { stroke: #fffdf2; stroke-width: 5.5; opacity: .85; }
.direction-orbit[data-state="reduced"] { opacity: .85; }
.direction-orbit:not([data-state="running"]) .orbit-marker { will-change: auto; }
.opponents { position: absolute; inset: 0; }
.seat {
  position: absolute; width: 90px; text-align: center; z-index: 2;
  transform: translateX(-50%); transition: opacity .2s; color: var(--muted);
}
.seat[data-position="top-left"] { top: 3%; left: 31%; }
.seat[data-position="top-right"] { top: 3%; left: 69%; }
.seat[data-position="top"], .seat[data-position="center"] { top: 3%; left: 50%; }
.seat[data-position="left"] { top: 45%; left: 8%; }
.seat[data-position="right"] { top: 45%; left: 92%; }
.avatar {
  width: 43px; height: 43px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center;
  color: #e9dfc6; font-size: 16px; font-weight: 600; background: #345449;
  border: 1px solid #b4c4a93d; outline: 0 solid #dfc98e00; outline-offset: 4px;
  box-shadow: 0 3px 9px #081c1733; transition: border-color .2s, outline-color .2s;
}
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.seat.is-current .avatar { border-color: #e6cb85; outline: 2px solid #e6cb85; }
.seat.is-current .seat-name { color: #fae6b8; }
.seat-name { display: block; max-width: 88px; margin: 0 auto; font-size: 12px; font-weight: 550; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-count { display: inline-block; font-size: 10px; line-height: 1.8; color: #b3c4b8; }
.seat-fan { position: relative; width: 58px; height: 31px; margin: 5px auto 0; }
.seat-fan .playing-card { position: absolute; left: 50%; top: 0; --card-w: 25px; --card-h: 36px; transform: translateX(-50%) rotate(var(--angle, 0deg)); transform-origin: 50% 130%; box-shadow: 0 1px 1px #0c1917, 0 3px 5px #0003; }
.seat.is-away { opacity: .5; }
.seat.is-inactive { opacity: .45; }
.seat.is-bot .avatar { color: #dccda4; background: #2a493b; font-size: 11px; letter-spacing: .04em; }
.seat.has-one .seat-count { color: #f3d5a0; font-weight: 650; }
.seat-fan .playing-card:nth-child(1) { --angle: -17deg; }
.seat-fan .playing-card:nth-child(2) { --angle: 0deg; }
.seat-fan .playing-card:nth-child(3) { --angle: 17deg; }
.onecard-badge { display: inline-flex; padding: 3px 6px; border-radius: 6px; background: #e4c487; color: #263c31; font-size: 9px; font-weight: 800; letter-spacing: .02em; }
.seat .onecard-badge { position: absolute; left: 50%; top: -8px; transform: translateX(12px) rotate(7deg); white-space: nowrap; }
.center-piles { position: absolute; left: 50%; top: 55%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 33px; z-index: 3; }
.pile { position: relative; width: var(--card-w); height: var(--card-h); flex: none; perspective: 850px; }
.pile.stock { cursor: pointer; }
.pile.stock::before, .pile.stock::after {
  content: ""; position: absolute; inset: 0; background: #d6d0b9; border: 1px solid #dfd7c4;
  border-radius: 7px; box-shadow: 0 3px 5px #05150f44; transform: translate(2px, 4px) rotate(-4deg);
}
.pile.stock::after { transform: translate(1px, 2px) rotate(-2deg); }
.pile.stock > .playing-card, .pile.stock > button { position: relative; z-index: 1; }
.pile.discard > .playing-card { transform: rotate(6deg); }
.pile-label { position: absolute; top: calc(100% + 13px); left: 50%; transform: translateX(-50%); white-space: nowrap; color: #b7c8b9; font-size: 11px; }
.stock .pile-label { color: #e4d4ad; }
.table-status {
  position: absolute; left: 15%; right: 15%; bottom: 2%; min-height: 42px; z-index: 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  text-align: center; font-size: 13px; color: #f0ead7; line-height: 1.45;
}
.table-status strong { font-size: 15px; font-weight: 650; }
.table-status small, .status-detail { font-size: 11px; color: var(--muted); }
.turn-indicator, .suit-indicator { display: inline-flex; align-items: center; gap: 5px; color: var(--gold); }
.suit-indicator { padding: 4px 10px; border: 1px solid #c7bc9138; border-radius: 20px; font-size: 11px; }
.suit-indicator svg { width: 14px; height: 14px; }
.attack-badge { background: #724e38; border: 1px solid #d3b37955; border-radius: 15px; padding: 4px 10px; color: #f9e1b5; font-size: 11px; }
.connection-status { font-size: 11px; color: #d2ba83; }

.hand-area {
  --hand-head-h: 46px;
  position: relative; min-width: 0; padding: 0 24px; z-index: 5;
  background: linear-gradient(180deg, #fffaf2, #f5eee6); border-top: 1px solid #e7e1d6;
}
.hand-meta {
  height: var(--hand-head-h); display: flex; align-items: center; justify-content: space-between;
  gap: 8px; color: #3c5169; font-size: 12px;
}
.hand-meta strong { font-weight: 600; }
.hand-meta small, .hand-count { color: #6e7d8d; font-size: 11px; }
.hand-sort { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.hand-sort button {
  min-width: 58px; min-height: 44px; padding: 7px 8px; border: 1px solid #ccd4da; border-radius: 10px;
  color: #526a70; background: #fffdf7; font-size: 11px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.hand-sort button[aria-pressed="true"] { background: #496c71; border-color: #496c71; color: #fffdf6; }
.hand-sort button:disabled { opacity: .5; cursor: default; }
.hand-scroll {
  position: absolute; top: var(--hand-head-h); bottom: 18px; left: 0; right: 0;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; touch-action: pan-x;
  scrollbar-width: none; scroll-padding-inline: 32px; -webkit-overflow-scrolling: touch; cursor: grab;
}
.hand-scroll::-webkit-scrollbar { display: none; }
.hand-scroll:focus-visible { outline: 2px solid #7894ab; outline-offset: -2px; }
.hand-scroll.is-dragging, .hand-scroll.is-dragging .hand-card { cursor: grabbing; }
.hand-scroll.is-motion-locked { overflow-x: hidden; touch-action: none; cursor: default; }
.hand {
  position: relative; width: 100%; min-width: 100%; height: 100%; perspective: 1100px;
}
.hand .hand-card, .hand > .playing-card {
  position: absolute; left: calc(50% - var(--card-w) / 2); top: 0;
  transform: translate3d(var(--x, 0px), var(--y, 0px), 0) rotate(var(--angle, 0deg));
  transform-origin: 50% 100%; cursor: pointer;
  transition: transform 220ms cubic-bezier(.2,.7,.3,1), box-shadow .2s;
}
.hand .playing-card.is-playable {
  box-shadow: 0 1px 0 #fffaf0, 0 2px 0 #beb5a6, 0 0 0 2px #355d81, 0 9px 15px #24364b30;
}
.hand .playing-card.is-selected, .hand .playing-card:focus-visible {
  transform: translate3d(var(--x, 0px), calc(var(--y, 0px) - 8px), 10px) rotate(var(--angle, 0deg));
  z-index: 50 !important; outline-offset: 3px;
}
@media (hover: hover) {
  .hand .playing-card.is-playable:hover {
    transform: translate3d(var(--x, 0px), calc(var(--y, 0px) - 8px), 8px) rotate(var(--angle, 0deg));
    z-index: 50 !important;
  }
}
.hand .hand-card:disabled { pointer-events: none; cursor: inherit; }
.hand .playing-card.is-dim, .hand .playing-card.is-unplayable { --face-dim: .12; }
.hand-empty { text-align: center; color: #738294; font-size: 12px; padding-top: 50px; }

.controls {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 9px 25px calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 6;
}
.btn {
  min-height: 43px; border-radius: 12px; padding: 10px 18px; font-size: 13px; font-weight: 600;
  border: 1px solid #f3f0dd36; color: #f3efdf; background: #ffffff09;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none;
  cursor: pointer; transition: background .16s, transform .16s; white-space: nowrap;
}
.btn:not(:disabled):active { transform: translateY(1px); }
.btn:not(:disabled):hover { background-color: #ffffff15; }
.btn:disabled { opacity: .42; }
.btn-primary { color: #263d31; border-color: #e9d7aa; background: #e1c58d; box-shadow: inset 0 1px 0 #fff6, 0 3px 8px #051a1440; }
.btn-primary:not(:disabled):hover { background: #ead3a1; }
.btn-secondary { background: #2b4d41; color: #f2ead9; border-color: #9eb39955; }
.btn-quiet { background: transparent; border-color: transparent; color: #c7d1c3; }
.btn-danger { border-color: #bc8c7755; color: #f1c3b0; }
.btn-full { width: 100%; }
.controls .btn { min-width: 122px; }
.btn-onecard { min-width: 112px; border-color: #d8be8155; color: #e5cd99; letter-spacing: .02em; }
.btn-onecard.is-armed, .btn-onecard[aria-pressed="true"] { background: #e2c789; color: #294235; border-color: #ebd6a0; }
.btn svg { width: 18px; height: 18px; flex: none; }
.controls-note { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font-size: 10px; color: #afc0ad; pointer-events: none; }

/* Four-color paper cards: static artwork, compositor-only motion. */
.playing-card {
  --face-dim: 0; --card-tone: #233b5b; --card-deep: #1f3550; --card-symbol: #fffdf7;
  position: relative; display: block; flex: none; width: var(--card-w); height: var(--card-h);
  margin: 0; padding: 0; overflow: visible; border: 0; border-radius: calc(var(--card-w) * .105);
  background: #d5cfc4; color: var(--card-deep); text-align: left; transform-style: preserve-3d;
  box-shadow: 0 1px 0 #fffdf5, 0 2px 0 #c6bfb1, 0 3px 0 #f5efe3, 0 4px 0 #bdb5a8, 0 9px 17px #26334429;
  -webkit-user-select: none; user-select: none; backface-visibility: hidden;
}
.playing-card[data-color="blue"] { --card-tone: #4078b9; --card-deep: #285c96; }
.playing-card[data-color="red"] { --card-tone: #d25a55; --card-deep: #b43f3e; }
.playing-card[data-color="yellow"] { --card-tone: #e9b94d; --card-deep: #896019; --card-symbol: #473c25; }
.playing-card[data-color="green"] { --card-tone: #438e72; --card-deep: #2d7057; }
.playing-card[data-color="wild"] { --card-tone: #263f5f; --card-deep: #263f5f; }
.playing-card.is-small { --card-w: 28px; --card-h: 40px; }
.card-face, .card-back {
  position: absolute; inset: 0; border: 1px solid #fffef9; border-radius: inherit; overflow: hidden;
  background: linear-gradient(130deg, #fffef9, #f7f1e6); backface-visibility: hidden; pointer-events: none;
}
.card-face::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: #273950;
  opacity: var(--face-dim); pointer-events: none;
}
.card-field {
  position: absolute; inset: calc(var(--card-w) * .047); border-radius: calc(var(--card-w) * .066);
  background-color: var(--card-tone);
  background-image: linear-gradient(125deg, #ffffff20, #ffffff00 42%, #1e293818),
    repeating-linear-gradient(0deg, #ffffff05 0, #ffffff05 1px, transparent 1px, transparent 3px);
  box-shadow: inset 0 1px 0 #ffffff70, inset 0 -1px 0 #162a4120;
}
.card-medallion {
  position: absolute; width: 63%; height: 68%; left: 18.5%; top: 16%;
  border: 1px solid #ffffffc9; border-radius: 48%; transform: rotate(21deg);
  background: linear-gradient(135deg, #fffef8, #f5efdf);
  box-shadow: 0 1px 2px #1d2d411f, inset 1px 1px 0 #fff;
}
.card-center {
  position: absolute; inset: 21% 16%; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: calc(var(--card-w) * .035); color: var(--card-deep);
}
.card-value {
  display: block; font-family: "Arial Rounded MT Bold", "Arial", sans-serif; font-size: calc(var(--card-w) * .59);
  font-weight: 900; line-height: 1; letter-spacing: -.06em; font-variant-numeric: lining-nums;
  text-shadow: 0 1px 0 #ffffffdc;
}
.playing-card[data-kind="attack"] .card-value { font-size: calc(var(--card-w) * .47); letter-spacing: -.08em; }
.card-action-icon { display: block; width: calc(var(--card-w) * .48); height: calc(var(--card-w) * .48); overflow: visible; }
.card-action-label { font-size: calc(var(--card-w) * .118); font-weight: 750; line-height: 1; letter-spacing: -.06em; white-space: nowrap; }
.card-center .card-palette { display: block; width: calc(var(--card-w) * .26); height: calc(var(--card-w) * .26); }
.card-corner {
  position: absolute; top: 7%; left: 8%; display: flex; flex-direction: column; align-items: center;
  width: 22%; gap: calc(var(--card-w) * .022); color: var(--card-symbol);
}
.card-corner.bottom { top: auto; left: auto; bottom: 7%; right: 8%; transform: rotate(180deg); }
.card-rank {
  font-family: "Arial Rounded MT Bold", "Arial", sans-serif; font-size: calc(var(--card-w) * .225);
  font-weight: 900; line-height: .96; letter-spacing: -.06em; font-variant-numeric: lining-nums;
}
.card-corner-icon { display: block; width: calc(var(--card-w) * .19); height: calc(var(--card-w) * .19); }
.card-color-mark { display: block; width: calc(var(--card-w) * .105); height: calc(var(--card-w) * .105); }
.card-corner-palette { display: block; width: calc(var(--card-w) * .13); height: calc(var(--card-w) * .13); }
.suit { display: block; width: 100%; height: 100%; fill: currentColor; overflow: visible; }
.card-back {
  border: calc(var(--card-w) * .047) solid #fffaf0;
  background: linear-gradient(135deg, #304d71, #1f3553); box-shadow: inset 0 1px 0 #71849b;
}
.card-back::before {
  content: ""; position: absolute; inset: 5%; border: 1px solid #ffffff24; border-radius: 5%;
  background: repeating-linear-gradient(135deg, #ffffff04 0, #ffffff04 1px, transparent 1px, transparent 7px);
}
.card-back-emblem {
  position: absolute; left: 50%; top: 39%; width: 55%; aspect-ratio: 1; display: grid; place-items: center;
  transform: translate(-50%, -50%) rotate(-8deg); border: 1px solid #ffffff96; border-radius: 24%;
  background: linear-gradient(135deg, #fffdf7, #eee8dc); box-shadow: 0 2px 4px #0c1c3333;
}
.card-back-palette { width: 74%; height: 74%; }
.card-back-title {
  position: absolute; top: 69%; left: 0; right: 0; color: #fffaf0; text-align: center;
  font-size: calc(var(--card-w) * .16); font-weight: 750; letter-spacing: -.04em; line-height: 1;
}
.is-small .card-back::before { border: 0; }
.is-small .card-back-emblem { top: 49%; width: 56%; }
.is-small .card-back-title { display: none; }
.is-back .card-face { visibility: hidden; }
.playing-card:not(.is-back) .card-back { visibility: hidden; }
.flying-card { position: fixed !important; left: 0; top: 0; z-index: 100; margin: 0; pointer-events: none; transition: none !important; will-change: transform; transform-origin: 50% 50%; }
#motion-layer, .motion-layer { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; contain: layout style; }
.toast { position: absolute; z-index: 100; left: 50%; top: 72px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 40px); border-radius: 13px; padding: 11px 17px; background: #f3eddb; box-shadow: 0 7px 22px #061a1555; color: #284235; text-align: center; font-size: 13px; line-height: 1.5; pointer-events: none; }

.overlay {
  position: absolute; inset: 65px 0 0; z-index: 20; display: grid; place-items: center;
  padding: 18px 28px 40px; background: #14382f;
}
.overlay.welcome { background: #f6f7f0; }
.dialog { position: relative; width: min(100%, 365px); text-align: center; }
.eyebrow { font: 11px/1.4 Georgia, serif; letter-spacing: .22em; color: #cbb681; margin: 0 0 10px; }
.dialog h1, .dialog h2 { margin: 0; font-size: 34px; font-weight: 600; letter-spacing: -.06em; color: #fff4db; line-height: 1.2; }
.dialog h3 { font-size: 19px; margin: 0 0 12px; }
.dialog-description, .dialog > p { font-size: 13px; color: #bccbbd; line-height: 1.65; margin: 12px 0 18px; }
.dialog > .eyebrow { margin-bottom: 10px; color: #cbb681; }
.hero-cards { position: relative; height: 177px; width: 210px; margin: 17px auto 12px; perspective: 1000px; }
.hero-cards .playing-card { position: absolute; top: 23px; left: 66px; --card-w: 81px; --card-h: 118px; box-shadow: 0 1px 0 #e0dbcb, 0 2px 0 #bcb5a4, 0 3px 0 #e0dbcb, 0 14px 22px #061e1755; }
.hero-cards .playing-card:nth-child(1) { transform: translate(-37px, 10px) rotate(-19deg) rotateY(5deg); }
.hero-cards .playing-card:nth-child(2) { transform: translate(30px, 9px) rotate(17deg) rotateY(-7deg); }
.hero-cards .playing-card:nth-child(3) { transform: translate(-3px, -4px) rotate(-2deg) rotateY(-6deg); }
.mode-actions { display: grid; gap: 10px; }
.mode-actions .btn { min-height: 49px; font-size: 14px; }
.mode-actions .btn small { margin-left: auto; font-size: 11px; opacity: .7; font-weight: 400; }
.welcome-note { margin: 16px 0 0 !important; color: #a6bba9 !important; font-size: 11px !important; }
.dialog-footer { margin-top: 15px; display: flex; gap: 8px; justify-content: center; }
.dialog-footer .btn { min-height: 38px; font-size: 12px; }
.segmented { display: flex; gap: 5px; padding: 4px; border: 1px solid #b3c6ac30; border-radius: 12px; background: #0e2a233b; }
.segmented button { flex: 1; border: 0; border-radius: 8px; color: #bacbbd; background: transparent; min-height: 35px; cursor: pointer; }
.segmented button[aria-pressed="true"], .segmented button.is-selected { color: #293f32; background: #e0c38a; }
.field { display: grid; gap: 8px; text-align: left; margin: 16px 0; }
.field label, .field-label { font-size: 12px; color: #ccd7c9; }
.field input, .field select, input.room-input { width: 100%; min-height: 47px; padding: 10px 13px; border: 1px solid #adc3ac55; border-radius: 10px; color: #f5efdc; background: #092a2144; font-size: 16px; }
.field input::placeholder { color: #819d8d; }
.field input.room-code, input.room-input { font-family: ui-monospace, monospace; letter-spacing: .22em; text-align: center; text-transform: uppercase; }
.room-code-display { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px 8px; margin: 18px 0; border: 1px dashed #c4b9805c; border-radius: 12px; }
.room-code-display strong { font: 600 24px/1.1 ui-monospace, monospace; letter-spacing: .13em; color: #f1d69d; }
.lobby-players { display: grid; gap: 8px; margin: 18px 0; padding: 0; list-style: none; text-align: left; }
.lobby-player { display: flex; align-items: center; gap: 12px; border: 1px solid #afc3aa25; padding: 9px 13px; border-radius: 12px; background: #ffffff03; color: #e0e8d9; font-size: 13px; }
.lobby-player .avatar { width: 30px; height: 30px; margin: 0; font-size: 12px; flex-shrink: 0; }
.lobby-player small { margin-left: auto; color: #c6b98f; font-size: 10px; }
.lobby-player.is-empty { border-style: dashed; color: #9fb5a3; }
.lobby-player.is-empty .avatar { opacity: .35; }
.inline-error { min-height: 19px; color: #f0bea9; font-size: 12px; line-height: 1.5; margin: 9px 0; }
.inline-note { color: #a9bfad; font-size: 11px; line-height: 1.5; }

dialog.sheet {
  width: min(calc(100vw - 32px), 400px); max-height: min(86dvh, 630px); padding: 25px;
  border: 1px solid #ded3b4; border-radius: 21px; color: #284336; background: #faf6eb;
  overflow: auto; overscroll-behavior: contain; box-shadow: 0 20px 80px #03181088;
  scrollbar-width: thin; scrollbar-color: #c3b99a transparent; color-scheme: light;
}
dialog.sheet::backdrop { background: #061c16a6; }
.sheet h2 { margin: 0 0 12px; font-size: 23px; font-weight: 650; letter-spacing: -.04em; }
.sheet p { color: #66715e; font-size: 13px; line-height: 1.7; }
.sheet .sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sheet .sheet-head h2 { margin: 0; }
.sheet .icon-btn { border-color: #405d3d22; color: #52624d; background: transparent; }
.sheet .btn { color: #31503b; border-color: #72836655; }
.sheet .btn-primary { background: #274e3f; color: #fbf4e0; border-color: #274e3f; }
.sheet .btn-primary:not(:disabled):hover { background: #365e4d; }
.sheet .btn-secondary { background: #f1ecde; }
.sheet .btn-danger { color: #aa4f3b; border-color: #b4705344; }
.sheet .btn-full { margin-top: 10px; }
.sheet .dialog-footer { margin-top: 18px; }
.sheet .dialog-footer .btn { flex: 1; }
.rules-list { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 13px; }
.rules-list li { display: grid; grid-template-columns: 63px 1fr; align-items: start; gap: 12px; font-size: 12px; line-height: 1.65; color: #5b6b58; }
.rules-list li strong { color: #294b36; font-size: 13px; }
.rule-card { display: inline-flex; min-width: 26px; padding: 2px 6px; border: 1px solid #d7ccb0; border-radius: 5px; background: #fffdf6; color: #4c644c; font-family: Georgia, serif; justify-content: center; }
.suit-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 20px 0 8px; }
.suit-choice { aspect-ratio: 1; border-radius: 13px; border: 1px solid #d7cbb0; background: #fffdf5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: #2a4435; cursor: pointer; }
.suit-choice svg { width: 26px; height: 30px; }
.suit-choice span { font-size: 10px; }
.suit-choice.card-red { color: #b33f43; }
.suit-choice:hover { background: #efe6d2; }
.result-emblem { margin: 0 auto 18px; width: 76px; height: 76px; display: grid; place-items: center; border: 1px solid #c6ae7355; border-radius: 50%; color: #c3a460; background: #ede5cd; }
.result-emblem svg { width: 39px; height: 39px; }
.result-summary { font-size: 13px; color: #62745d; line-height: 1.7; text-align: center; }
.result-rank { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #c3b99b40; font-size: 13px; }

/* Screen markup: compact entry, lobby and controls share the same table. */
.topbar .back-link { width: auto; min-width: 69px; gap: 3px; border: 0; border-radius: 9px; font-size: 11px; }
.topbar .back-link svg { width: 18px; height: 18px; }
.topbar .brand { flex-direction: column; gap: 2px; align-items: center; }
.topbar #game-record-mode { color: #596f82; font-size: 10px; line-height: 1.1; white-space: nowrap; }
.topbar .brand .eyebrow { margin: 0; font-size: 8px; line-height: 1.3; letter-spacing: .17em; white-space: nowrap; }
.icon-btn svg path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
button.pile { border: 0; padding: 0; background: transparent; color: inherit; font: inherit; overflow: visible; }
.pile-card { display: block; position: relative; z-index: 1; width: var(--card-w); height: var(--card-h); }
.pile.discard .pile-card .playing-card { transform: rotate(6deg); }
.pile-label b { padding-left: 4px; font-weight: 500; font-size: 10px; color: #d0d8c5; }
.direction { color: #acbfae; font-size: 10px; }
.my-name { display: inline-flex; align-items: center; gap: 5px; flex: 0 1 auto; min-width: 0; max-width: 30%; white-space: nowrap; }
.my-name #my-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: #d8bf81; }
#my-count { flex: none; color: #adc0ad; font-size: 10px; }
.hand-meta #turn-label { flex: 1; text-align: center; font-size: 12px; line-height: 1.3; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { position: absolute; bottom: 3px; left: 15px; right: 15px; margin: 0; min-height: 16px; font-size: 11px; line-height: 1.4; text-align: center; color: #afc2ad; pointer-events: none; }
.controls .rules-button { position: absolute; left: 24px; font-family: Georgia, serif; font-size: 16px; width: 32px; height: 32px; color: #bfcbb9; }
.rules-button span { display: none; }
.onecard-button[aria-pressed="true"] { background: #f2dc9f; box-shadow: 0 0 0 2px #e5c98155; }
.connection { position: absolute; z-index: 90; left: 50%; top: 64px; transform: translateX(-50%); margin: 0; max-width: calc(100% - 35px); padding: 6px 13px; border-radius: 20px; background: #eff0d4; color: #36523b; font-size: 11px; text-align: center; }
.turn-timer { position: absolute; bottom: 0; left: 34%; right: 34%; height: 2px; border-radius: 3px; overflow: hidden; background: #bad0b91c; }
.turn-timer span { display: block; width: 100%; height: 100%; background: #d3bd83; transform-origin: left center; }
.entry-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
.entry-actions .btn { display: flex; min-height: 48px; justify-content: space-between; font-size: 14px; padding: 12px 19px; }
.entry-actions .btn span { font-size: 11px; font-weight: 400; opacity: .75; }
.text-btn { border: 0; background: transparent; color: #d6d5b7; min-height: 32px; padding: 5px 8px; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: #b7c19d50; font-size: 11px; cursor: pointer; }
.text-btn:hover { color: #f8e8b9; }
.resume-button { margin-top: 9px; color: #e1cb94; }
.lobby-card { width: min(100%, 365px); }
.lobby-card h2 { font-size: 27px; }
#create-room, #start-room, #login-link { width: 100%; min-height: 46px; }
.entry-divider { display: flex; align-items: center; gap: 12px; color: #9fb79e; font-size: 10px; margin: 18px 0; }
.entry-divider::before, .entry-divider::after { content: ""; height: 1px; background: #adc5a329; flex: 1; }
#join-form { text-align: left; }
#join-form label { display: block; font-size: 12px; color: #c6d2bd; margin-bottom: 9px; }
.join-row { display: flex; gap: 8px; }
.join-row input { min-width: 0; width: 100%; border: 1px solid #adc3ac55; border-radius: 10px; background: #0a2c2355; padding: 10px 12px; color: #f6efd7; font: 16px/1.2 ui-monospace, monospace; letter-spacing: .15em; text-transform: uppercase; }
.join-row input::placeholder { font-family: inherit; font-size: 12px; letter-spacing: .03em; color: #91ac96; }
.join-row .btn { flex: none; }
.small-note { color: #aec2a9; font-size: 11px; line-height: 1.6; }
.room-code-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px; margin: 16px 0; border: 1px dashed #c4b9805c; border-radius: 12px; }
.room-code-row > div { text-align: left; }
.room-code-row .small-note { display: block; font-size: 10px; margin-bottom: 4px; }
#room-code-display { font: 600 22px/1.2 ui-monospace, monospace; letter-spacing: .12em; color: #f1d69d; }
.room-code-row .btn { font-size: 11px; min-height: 38px; padding: 8px 11px; }
.room-players { padding: 0; margin: 13px 0; list-style: none; text-align: left; display: grid; gap: 7px; }
.room-players li { display: flex; align-items: center; gap: 10px; padding: 9px 13px; border: 1px solid #b8c9a62b; border-radius: 10px; min-height: 43px; color: #dbe5d3; font-size: 13px; background: #ffffff03; }
.room-players li small { margin-left: auto; font-size: 10px; color: #c7b98b; }
.room-players li > small { flex: none; }
.room-players li > span:not(.avatar):not(.seat-tag) { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-players li.is-empty, .room-players li.empty { border-style: dashed; color: #91ab94; }
.room-players .avatar { margin: 0; width: 28px; height: 28px; font-size: 11px; }
.room-players .player-label { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 2px; }
.room-players .player-label > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-players .player-label .bot-seat-note { margin-left: 0; font-size: 10px; color: #acbea4; }
.room-players .is-bot { border-style: dashed; }
.room-players .is-bot .avatar { font-size: 10px; letter-spacing: .04em; color: #e0ce9e; background: #284b3d; }
.seat-tag { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 25px; padding: 3px 6px; border: 1px solid #c7b37a5c; border-radius: 6px; font-size: 9px; font-weight: 650; line-height: 1.3; }
.ai-tag { color: #dec894; background: #c7ad6d0d; }
.sheet-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 13px; }
.sheet-header h2 { margin: 0; }
.sheet-header .icon-btn { width: 31px; height: 31px; font-size: 22px; font-weight: 400; }
.sheet-body { font-size: 13px; line-height: 1.7; }
.sheet-body .text-btn { color: #52674c; }
.sheet-body .small-note { color: #68785f; }
.sheet-body > .btn { display: flex; width: 100%; margin-top: 10px; }
.sheet-body > .text-btn { display: block; width: 100%; margin-top: 8px; }
.my-turn #turn-label { color: #f0d795; }
.sound-toggle.is-muted, #sound-toggle.is-muted { opacity: .5; }
.rule-row { display: grid; grid-template-columns: 87px 1fr; gap: 12px; font-size: 12px; line-height: 1.65; color: #5b6b58; }
.rule-row strong { color: #294b36; font-size: 12px; font-weight: 650; }
.suit-choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0 4px; }
.suit-choice .suit-symbol { font: 32px/1 Georgia, serif; }
.suit-choice.suit-H, .suit-choice.suit-D { color: #b33f43; }
.dialog-actions { display: flex; gap: 9px; margin-top: 20px; }
.dialog-actions > .btn { flex: 1; }
.result-mark { width: 67px; height: 67px; border-radius: 50%; display: grid; place-items: center; margin: 20px auto 14px; color: #ac8c4f; background: #eee5cb; font: 37px Georgia, serif; border: 1px solid #c7af7555; }
.sheet-body .result-copy { text-align: center; }
.result-players { margin: 19px 0; }
.result-players > div { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px; border-bottom: 1px solid #bdb18a33; color: #5a7053; font-size: 13px; }
.result-players strong { font-weight: 550; }

@media (max-width: 520px) {
  :root { --card-w: 69px; --card-h: 100px; }
  .app { border: 0; grid-template-rows: 58px minmax(0, 1fr) 188px calc(71px + env(safe-area-inset-bottom, 0px)); }
  .topbar { padding: 10px 15px 6px; gap: 5px; }
  .topbar-left, .topbar-right, .topbar-actions { gap: 7px; }
  .brand-name, .topbar h1 { font-size: 17px; }
  .brand { gap: 7px; }
  .brand-subtitle, .brand small { display: none; }
  .room-tag, .mode-tag { font-size: 10px; padding: 6px 8px; }
  .icon-btn { width: 35px; height: 35px; }
  .table { margin: 0 13px; }
  .seat { width: 66px; }
  .seat[data-position="top-left"] { left: 30%; }
  .seat[data-position="top-right"] { left: 70%; }
  .seat[data-position="left"] { top: 44%; left: 10%; }
  .seat[data-position="right"] { top: 44%; left: 90%; }
  .avatar { width: 36px; height: 36px; font-size: 13px; margin-bottom: 5px; }
  .seat-name { max-width: 66px; font-size: 11px; }
  .seat-count { font-size: 10px; }
  .seat-fan { margin-top: 3px; }
  .center-piles { gap: 22px; top: 55%; }
  .table-status { bottom: 3%; left: 5%; right: 5%; font-size: 12px; }
  .table-status strong { font-size: 14px; }
  .table-status small { font-size: 10px; }
  .hand-area { --hand-head-h: 44px; padding: 0 12px; }
  .hand-meta { font-size: 11px; }
  .camp-scene { left: -13px; right: -13px; }
  .direction-orbit { left: -5px; right: -5px; }
  .controls { gap: 8px; padding: 6px 18px calc(13px + env(safe-area-inset-bottom, 0px)); }
  .controls .btn { min-width: 110px; min-height: 43px; padding: 10px 14px; font-size: 12px; }
  .overlay { inset: 58px 0 0; padding: 16px 30px 32px; }
  .hero-cards { margin-top: 15px; margin-bottom: 7px; }
  .dialog h1, .dialog h2 { font-size: 30px; }
  .dialog-description, .dialog > p { font-size: 12px; }
  .mode-actions .btn { min-height: 47px; font-size: 13px; }
  .lobby-players { gap: 6px; margin: 12px 0; }
  .lobby-player { padding: 8px 11px; }
  .toast { top: 63px; font-size: 12px; padding: 10px 14px; }
  .controls .rules-button { left: 18px; width: 29px; height: 29px; }
  .hand-meta #turn-label { font-size: 11px; }
  .status { bottom: 2px; font-size: 10px; }
  .entry-actions .btn { min-height: 46px; font-size: 13px; }
  .entry-actions .btn span { font-size: 10px; }
  #room-code-display { font-size: 19px; }
  .room-code-row { padding: 11px; gap: 8px; }
  .room-code-row .btn { padding-left: 8px; padding-right: 8px; }
  .connection { top: 57px; }
}
@media (max-height: 640px) {
  .app { grid-template-rows: 53px minmax(0, 1fr) 174px calc(63px + env(safe-area-inset-bottom, 0px)); }
  :root { --card-w: 61px; --card-h: 88px; }
  .topbar { padding-top: 7px; padding-bottom: 5px; }
  .seat .avatar { width: 30px; height: 30px; margin-bottom: 3px; }
  .seat-fan { display: none; }
  .seat[data-position="left"], .seat[data-position="right"] { top: 43%; }
  .center-piles { top: 56%; }
  .pile-label { top: calc(100% + 7px); font-size: 10px; }
  .table-status { bottom: 0; min-height: 31px; font-size: 11px; gap: 3px; }
  .table-status strong { font-size: 12px; }
  .hand-area { --hand-head-h: 44px; }
  .controls { padding-top: 5px; padding-bottom: calc(11px + env(safe-area-inset-bottom, 0px)); }
  .controls .btn { min-height: 44px; }
  .overlay { inset: 53px 0 0; padding-top: 10px; padding-bottom: 20px; }
  .hero-cards { height: 130px; margin: 8px auto 0; }
  .hero-cards .playing-card { --card-w: 67px; --card-h: 97px; top: 13px; left: 72px; }
  .dialog h1, .dialog h2 { font-size: 27px; }
  .dialog > p { margin-top: 8px; margin-bottom: 12px; }
  .mode-actions { gap: 8px; }
  .mode-actions .btn { min-height: 42px; }
  .welcome-note { margin-top: 10px !important; }
  .room-code-display { margin: 10px 0; padding: 12px 8px; }
  .lobby-player { padding: 6px 10px; }
  .lobby-player .avatar { width: 26px; height: 26px; }
  .entry-actions { gap: 8px; }
  .entry-actions .btn { min-height: 41px; padding-top: 9px; padding-bottom: 9px; }
  .status { font-size: 9px; bottom: 0; }
  .room-players { gap: 5px; margin: 8px 0; }
  .room-players li { min-height: 36px; padding: 6px 10px; }
  .room-code-row { margin: 11px 0; padding: 9px 11px; }
}
@media (max-width: 360px) {
  .topbar { padding-left: 12px; padding-right: 12px; }
  .topbar-left, .topbar-right, .topbar-actions { gap: 5px; }
  .brand-name, .topbar h1 { font-size: 16px; }
  .center-piles { gap: 17px; }
  .seat[data-position="left"] { left: 9%; }
  .seat[data-position="right"] { left: 91%; }
  .controls .btn { min-width: 102px; padding-left: 12px; padding-right: 12px; }
  .overlay { padding-left: 24px; padding-right: 24px; }
}
@media (max-height: 560px) and (min-width: 600px) {
  /* Keep the camping scene and pile labels legible on a short screen. */
  .camp-scene { background-position: center 45%; }
  .seat[data-position="top-left"] { left: 22%; }
  .seat[data-position="top-right"] { left: 78%; }
  .table-status {
    left: calc(50% + var(--card-w) + 24px); right: auto; top: 56%; bottom: auto;
    width: 92px; min-height: 0; transform: translateY(-50%);
  }
}
@media (max-height: 430px) and (min-width: 600px) {
  .app { grid-template-rows: 48px minmax(0, 1fr) 154px calc(54px + env(safe-area-inset-bottom, 0px)); }
  :root { --card-w: 47px; --card-h: 68px; }
  .topbar { padding: 6px 18px; }
  .hand-area { --hand-head-h: 44px; }
  .hand-meta { font-size: 10px; }
  .controls { padding: 5px 10px calc(5px + env(safe-area-inset-bottom, 0px)); }
  .controls .btn { min-height: 44px; padding: 6px 15px; }
  .seat { width: 80px; }
  .seat .avatar { width: 25px; height: 25px; font-size: 11px; }
  .seat-name { font-size: 10px; }
  .seat-count { font-size: 9px; }
  .seat[data-position="top-left"] { top: 5%; left: min(22%, calc(50% - 192px)); }
  .seat[data-position="top-right"] { top: 5%; left: max(78%, calc(50% + 192px)); }
  .table-status { top: 45%; bottom: auto; min-height: 20px; }
  .center-piles { top: 45%; }
  .pile-label { display: none; }
  .overlay { inset: 48px 0 0; padding: 8px 25px 16px; }
  .welcome .dialog { width: 470px; display: grid; grid-template-columns: 180px 1fr; grid-template-rows: auto auto auto auto; column-gap: 27px; align-items: center; }
  .welcome .eyebrow { grid-column: 2; margin: 0; font-size: 9px; }
  .welcome h1, .welcome h2 { grid-column: 2; font-size: 25px; }
  .welcome .dialog-description { grid-column: 2; margin: 4px 0 8px; font-size: 10px; }
  .welcome .hero-cards { grid-column: 1; grid-row: 1 / span 5; width: 180px; margin: 0; }
  .welcome .hero-cards .playing-card { left: 55px; }
  .welcome .mode-actions { grid-column: 2; gap: 7px; }
  .welcome .mode-actions .btn { min-height: 37px; padding-top: 7px; padding-bottom: 7px; }
  .welcome .welcome-note { grid-column: 2; font-size: 9px !important; margin-top: 6px !important; }
  .welcome .entry-actions { grid-column: 2; gap: 7px; }
  .welcome .entry-actions .btn { min-height: 35px; padding-top: 7px; padding-bottom: 7px; }
  .welcome .welcome-copy { grid-column: 2; margin: 4px 0 8px; font-size: 10px; }
  .status { bottom: 0; }
}
@media (max-width: 520px) and (min-height: 561px) {
  .camp-scene {
    background-image: url("./campsite-pastel-portrait.webp?v=20261120-onecard8");
    background-position: center 54%;
  }
}
/* Warm ivory and sage frame the painted campsite without dimming the cards. */
.topbar { background: #fffaf2; border-bottom: 1px solid #dfdfd380; }
.brand-name, .topbar h1 { color: #263d59; font-weight: 750; }
.icon-btn { border-color: #d6ddd5; color: #49666e; background: #fffdf8; }
.icon-btn:hover, .back-link:hover { background: #eaf0e8; }
.avatar { color: #405f68; background: #fffdf8; border-color: #d6ded5; box-shadow: 0 3px 8px #526f591a; outline-color: transparent; }
.seat.is-bot .avatar { color: #506e67; background: #e9f0e5; }
.seat.is-current .avatar { color: #fffdf7; background: #486b68; border-color: #486b68; outline-color: #9cb6a8; }
.seat-name {
  padding: 2px 5px; border-radius: 7px; color: #40596a; background: #fffdf5f2;
  box-shadow: 0 1px 5px #63765e1c;
}
.seat.is-current .seat-name { color: #fffdf5; background: #486b68; font-weight: 750; }
.seat-count { margin-top: 2px; padding: 0 5px; border-radius: 5px; color: #506367; background: #fffdf0e8; }
.seat.has-one .seat-count { color: #855044; background: #f8e2d8; }
.seat-fan .playing-card { box-shadow: 0 1px 0 #b9b2a6, 0 3px 5px #25354b29; }
.onecard-badge { background: #d75d55; color: #fff; }
.pile.stock::before, .pile.stock::after { background: #e8e0d2; border-color: #f7f2e8; box-shadow: 0 3px 5px #29374a26; }
.center-piles::before {
  content: ""; position: absolute; inset: -14px -16px -29px; z-index: -1;
  border: 1px solid #e7d5b9; border-radius: 12px;
  background: repeating-linear-gradient(90deg, transparent 0, transparent 22px, #b69b7714 22px, #b69b7714 23px),
    linear-gradient(145deg, #fff5e3, #e8d5b8);
  box-shadow: 0 4px 0 #c4ac8d, 0 8px 14px #64735c26, inset 0 1px 0 #fffdfa;
  pointer-events: none;
}
.pile-label, .pile-label b { color: #5b4e40; }
.stock .pile-label { color: #473f36; font-weight: 600; }
.table-status { color: #324a65; }
.suit-indicator { background: #fffdf8; border-color: #d3d9df; color: #344f6e; font-weight: 650; }
.suit-indicator[data-suit="S"] { color: #285c96; background: #eaf1f8; border-color: #c6d8e9; }
.suit-indicator[data-suit="H"] { color: #ae3f3c; background: #faedeb; border-color: #edc9c4; }
.suit-indicator[data-suit="D"] { color: #866016; background: #fbf1d5; border-color: #e8d39b; }
.suit-indicator[data-suit="C"] { color: #2b6d54; background: #e9f3ec; border-color: #bfd9c9; }
.direction { padding: 1px 6px; border-radius: 5px; color: #506367; background: #fffdf0ed; }
.attack-badge { color: #ac453a; background: #f9e9e1; border-color: #e5c7ba; }
.my-turn #turn-label { color: #244d77; }
.my-dot { background: #3c719a; }
#my-count, .status { color: #6e7d8d; }
.hand-empty, .controls-note { color: #738294; }
.controls { background: #fffaf2; border-top: 1px solid #e4e0d6; }
.btn { color: #405e68; background: #fffdf7; border-color: #d0dcd7; }
.btn:not(:disabled):hover { background-color: #eaf0e8; }
.btn-primary { color: #fffdf7; background: #496c71; border-color: #496c71; box-shadow: inset 0 1px 0 #ffffff20, 0 3px 7px #4d6a591c; }
.btn-primary:not(:disabled):hover { background: #3b5d62; }
.btn-secondary { color: #405e68; background: #fffdf8; border-color: #ccd8d2; }
.btn-quiet { color: #5a7086; background: transparent; border-color: transparent; }
.btn-danger { color: #b24c44; border-color: #dcbab1; }
.controls .rules-button { color: #61768c; }
.onecard-button[aria-pressed="true"] { color: #fff; background: #496c71; border-color: #496c71; box-shadow: 0 0 0 2px #496c7130; }
.connection { color: #385778; background: #eef3f6; border: 1px solid #c8d5df; }
.turn-timer { background: #d5dce2; }
.turn-timer span { background: #567da1; }
.toast { color: #314d6a; background: #fffdf7; box-shadow: 0 7px 22px #293a5024; border: 1px solid #dce1e4; }
dialog.sheet { border-color: #d8dddF; color: #2b425d; background: #fffdf7; box-shadow: 0 20px 80px #23394f35; }
dialog.sheet::backdrop { background: #25384c7a; }
.sheet h2 { color: #263e59; }
.sheet p, .sheet-body .small-note { color: #6b7b8b; }
.sheet .btn { color: #38536d; border-color: #cbd5dd; }
.sheet .btn-primary { background: #294766; color: #fffdf7; border-color: #294766; }
.sheet .btn-primary:not(:disabled):hover { background: #355b7d; }
.sheet .btn-secondary { background: #edf1f3; }
.suit-choice { border-color: #cdd6df; color: #385a7c; background: #f8f8f3; }
.suit-choice.suit-S { color: #285c96; background: #eaf1f8; border-color: #a9c5e0; }
.suit-choice.suit-H { color: #ae3f3c; background: #faedeb; border-color: #e1b1aa; }
.suit-choice.suit-D { color: #866016; background: #fbf1d5; border-color: #dcc07b; }
.suit-choice.suit-C { color: #2b6d54; background: #e9f3ec; border-color: #a6cbb5; }
.suit-choice:hover { outline: 2px solid currentColor; outline-offset: 2px; }
.suit-choice .suit-symbol { font-family: "Arial", sans-serif; }
.rule-row { color: #687b8e; }
.rule-row strong { color: #2d4b69; }
.rule-card { color: #38536d; background: #f4f5f2; border-color: #d4dce1; font-family: inherit; }
@media (max-height: 430px) and (min-width: 600px) {
  .card-action-label { display: none; }
}
/* The shared multiplayer entrance owns setup; the campsite owns only play. */
body.onecard-page[data-mp-entry="true"] {
  display: flex; flex-direction: column; height: 100dvh; min-height: 0 !important;
  overflow: hidden !important;
}
.onecard-page > .mp-entry-bar { width: 100%; }
.onecard-page .mp-entry-back { text-decoration: none; }
body.onecard-page[data-mp-entry="true"] #setup {
  flex: 1 1 0; min-height: 0 !important; overflow: hidden !important;
}
.onecard-page #setup > .game-entry { min-height: 0; max-height: 100%; }
.onecard-page #entry { display: flex; flex-direction: column; }
.onecard-page #entry:has([data-entry-panel="opponent"]:not([hidden])) { height: 100%; }
.onecard-page .entry-heading { flex: none; }
.onecard-page .entry-controls { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.onecard-page .entry-controls > .seg, .onecard-page .entry-rules { flex: none; }
.onecard-page [data-entry-panel="opponent"] { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.onecard-page #online-room-host { display: flex; flex: 1; min-height: 0; }
.onecard-page #online-account-note { flex: none; margin-top: 8px; }
.onecard-page #setup .entry-rules { margin-top: 12px; }
.onecard-page #setup .arcade-rooms {
  --ink: var(--entry-ink); --ink-2: var(--entry-muted); --line: var(--entry-line);
  --surface: #fff; --surface-2: #fbfcf9; --accent-soft: var(--entry-soft);
  display: grid; flex: 1; min-width: 0; min-height: 0; grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto auto minmax(0, 1fr); gap: 8px;
  margin: 8px 0 0; padding: 0; border: 0; border-radius: 0; background: transparent; text-align: left;
}
.onecard-page #setup .arcade-rooms-head { grid-column: 1 / -1; grid-row: 1; margin: 0; }
.onecard-page #setup .arcade-rooms-head h3 { font-size: 17px; }
.onecard-page #setup .arcade-rooms-head p { display: none; }
.onecard-page #setup .arcade-room-filters { grid-column: 1; grid-row: 2; grid-template-columns: minmax(0, 1fr); margin: 0; }
.onecard-page #setup [data-room-filter] { display: none; }
.onecard-page #setup .arcade-room-filters input { min-height: 44px; padding: 8px 10px; font-size: 12px; }
.onecard-page #setup .arcade-room-retry {
  grid-column: 2; grid-row: 2; min-height: 44px; margin: 0; padding: 8px;
  border: 1px solid var(--entry-line); border-radius: 12px; background: var(--entry-soft);
  color: var(--entry-muted); font-size: 11px; text-decoration: none; white-space: nowrap;
}
.onecard-page #setup .arcade-room-issue { grid-column: 1 / -1; grid-row: 3; margin: 0; }
.onecard-page #setup [data-room-list] {
  grid-column: 1 / -1; grid-row: 4; min-height: 0; max-height: none; margin: 0;
  overflow: auto; overscroll-behavior: contain; align-content: start; scrollbar-width: thin;
}
.onecard-page #setup .arcade-room-card { grid-template-columns: 35px minmax(0, 1fr) auto; gap: 7px; padding: 10px 7px; }
.onecard-page #setup .arcade-room-copy h4 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 13px; }
.onecard-page #setup .arcade-room-copy p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onecard-page #setup .arcade-rooms .btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin: 0; padding: 8px 10px;
  border: 1px solid var(--entry-line); border-radius: 12px; background: var(--entry-soft);
  color: var(--entry-ink); box-shadow: none; font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.5;
}
.onecard-page #setup .arcade-rooms .btn.pri { background: var(--entry-accent); border-color: var(--entry-accent); color: #fff; }
.onecard-page #setup .arcade-rooms .btn:not(:disabled):hover { background: #e0eddf; }
.onecard-page #setup .arcade-rooms .btn.pri:not(:disabled):hover { background: #245643; }
.onecard-page #setup .arcade-room-empty { padding: 14px 4px; font-size: 12px; }
.onecard-page #lobby { display: flex; flex-direction: column; }
.onecard-page #lobby :is(.lobby-heading, .room-code-row, .lobby-controls) { flex: none; }
.onecard-page #lobby .lobby-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.onecard-page #lobby .lobby-controls > p { grid-column: 1 / -1; }
.onecard-page #lobby .lobby-controls > button { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.onecard-page #lobby .ge-copy { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onecard-page #lobby .room-code-row {
  padding: 0; margin: 12px 0; border: 0; border-radius: 0; min-width: 0; text-align: left;
}
.onecard-page #lobby .room-code-row > .small-note { min-width: 0; color: var(--entry-muted); font-size: 11px; }
.onecard-page #lobby #room-code-display { display: block; margin-top: 3px; color: var(--entry-accent); font-size: 18px; letter-spacing: .03em; }
.onecard-page #lobby #copy-invite { flex: none; width: auto; min-height: 44px; margin: 0; padding: 8px 10px; font-size: 12px; }
.onecard-page #lobby .room-players { min-height: 0; gap: 6px; margin: 12px 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.onecard-page #lobby .room-players li { min-height: 42px; padding: 6px 10px; border-color: var(--entry-line); background: #fbfcf9; color: var(--entry-ink); }
.onecard-page #lobby .room-players li small, .onecard-page #lobby .bot-seat-note { color: var(--entry-muted); }
.onecard-page #lobby .room-players .avatar { flex: none; color: var(--entry-accent); background: var(--entry-soft); border-color: var(--entry-line); }
.onecard-page #lobby .room-players .player-label { flex-direction: row; align-items: center; gap: 6px; }
.onecard-page #lobby .room-players .player-label .bot-seat-note { flex: none; font-size: 9px; }
.onecard-page #lobby .ai-tag { border-color: #cbd9c7; background: var(--entry-soft); color: #516b45; }
.onecard-page #lobby .inline-error { color: #a94232; }
.onecard-page .sheet .arcade-room-form { text-align: left; }
.onecard-page .sheet .arcade-room-form :is(input, select) {
  width: 100%; min-height: 44px; border: 1px solid #dfe6dd; border-radius: 12px; padding: 9px 12px;
  background: #fff; color: #223a30; font-size: 13px;
}
.onecard-page .sheet :is(.mhead, .mfoot) { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.onecard-page .sheet .mhead h3 { margin: 0; }
.onecard-page .sheet .arcade-room-form .field { margin: 14px 0; font-size: 12px; color: #667467; }
.onecard-page .sheet .btn.pri { color: #fff; background: #2a644e; border-color: #2a644e; }
@media (max-height: 640px) {
  .onecard-page #lobby .ge-copy { margin-top: 4px !important; margin-bottom: 8px !important; }
  .onecard-page #lobby .room-code-row { margin: 8px 0; }
  .onecard-page #lobby .room-players { margin: 8px 0; gap: 5px; }
  .onecard-page #lobby .room-players li { min-height: 38px; padding: 4px 9px; }
  .onecard-page #lobby #lobby-note { margin-top: 8px; }
}
@media (max-height: 560px) and (min-width: 600px) {
  body.onecard-page[data-mp-entry="true"] #setup { padding: 12px 16px !important; }
  .onecard-page #setup > .game-entry { display: grid; max-width: 620px !important; grid-template-columns: 200px minmax(0, 1fr); column-gap: 24px; }
  .onecard-page #entry .entry-heading { grid-column: 1; grid-row: 1; align-self: center; }
  .onecard-page #entry .entry-controls { display: contents; }
  .onecard-page #entry .seg { grid-column: 1; grid-row: 2; margin: 8px 0; }
  .onecard-page #entry [data-entry-panel] { grid-column: 2; grid-row: 1 / span 3; min-width: 0; }
  .onecard-page #entry [data-entry-panel="computer"] { align-self: center; }
  .onecard-page #entry .entry-rules { grid-column: 1; grid-row: 3; margin: 0; }
  .onecard-page #lobby { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .onecard-page #lobby .lobby-heading { grid-column: 1; grid-row: 1; }
  .onecard-page #lobby .room-code-row { grid-column: 1; grid-row: 2; }
  .onecard-page #lobby .room-players { grid-column: 2; grid-row: 1 / span 3; align-self: center; margin: 0; }
  .onecard-page #lobby .lobby-controls { grid-column: 1; grid-row: 3; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .onecard-page #lobby .lobby-controls > p { grid-column: 1 / -1; margin: 0; }
  .onecard-page #lobby .lobby-controls > button { min-width: 0; margin: 0; padding: 9px 8px; font-size: 13px; }
}
/* Results share the same component as the other arcade games. */
dialog.sheet.game-result-dialog { width: min(430px, calc(100vw - 24px)); max-width: 430px; max-height: calc(100dvh - 32px); }
.game-result-dialog .sheet-header { display: none; }
.game-result-dialog .sheet-body { line-height: 1.5; }
.game-result-card .result-players { margin: 12px 0 0; }
.game-result-card .result-players > div { padding: 6px 3px; font-size: 12px; }
.game-result-card .result-players > div > span:first-child { min-width: 0; padding-right: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-result-card .result-players > div > strong { flex: none; }
@media (max-height: 430px) and (min-width: 600px) {
  dialog.sheet.game-result-dialog { width: min(620px, calc(100vw - 32px)); max-width: 620px; }
  .game-result-dialog .game-result-card { max-width: none; padding: 16px 20px; }
  .game-result-dialog .game-result-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
  .game-result-dialog .game-result-icon { grid-column: 1; grid-row: 1; }
  .game-result-dialog .game-result-title { grid-column: 1; grid-row: 2; }
  .game-result-dialog .game-result-metric { grid-column: 1; grid-row: 3; font-size: 16px; }
  .game-result-dialog .game-result-encouragement { grid-column: 1; grid-row: 4; font-size: 12px; }
  .game-result-dialog .game-result-extra { grid-column: 2; grid-row: 1 / span 4; margin-top: 0; }
  .game-result-dialog .game-result-card .result-players { margin: 0; }
  .game-result-dialog .game-result-actions { grid-column: 1 / -1; grid-row: 5; margin-top: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media(max-width:600px){.onecard-page #setup .arcade-room-card{grid-template-columns:36px minmax(0,1fr)}}
