:root {
  color-scheme: dark;
  --ink: #f2e9d8;
  --muted: #a79d90;
  --faint: #6f6a65;
  --night: #070a0e;
  --panel: rgba(10, 14, 20, 0.82);
  --panel-solid: #10151d;
  --line: rgba(226, 195, 137, 0.19);
  --gold: #d7ae69;
  --gold-bright: #f3d79a;
  --wine: #8f263a;
  --wine-bright: #d0475e;
  --blue: #5db7d0;
  --green: #6dcc9c;
  --danger: #e2555f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  --card-ratio: 0.6667;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--night);
}

body {
  min-width: 320px;
  color: var(--ink);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(3, 6, 11, 0.2), rgba(3, 5, 8, 0.76)),
    url("assets/images/tavern-bg.webp") center / cover no-repeat;
  transform: scale(1.015);
}

.vignette {
  position: absolute;
  inset: -4%;
  background:
    radial-gradient(ellipse at 50% 54%, transparent 20%, rgba(4, 6, 9, 0.18) 55%, rgba(2, 3, 5, 0.84) 100%),
    linear-gradient(90deg, rgba(4, 6, 10, 0.55), transparent 23%, transparent 77%, rgba(4, 6, 10, 0.55));
}

.dust {
  position: absolute;
  inset: 0;
  opacity: 0.3;
  background-image:
    radial-gradient(circle at 15% 25%, rgba(255, 220, 153, 0.8) 0 1px, transparent 1.5px),
    radial-gradient(circle at 72% 15%, rgba(255, 220, 153, 0.6) 0 1px, transparent 1.5px),
    radial-gradient(circle at 58% 72%, rgba(255, 220, 153, 0.55) 0 1px, transparent 1.5px);
  background-size: 210px 180px, 260px 240px, 170px 220px;
  animation: dust-drift 28s linear infinite;
}

.dust-b {
  opacity: 0.18;
  transform: scale(1.4) rotate(12deg);
  animation-duration: 38s;
  animation-direction: reverse;
}

.app-shell {
  position: relative;
  z-index: 1;
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
}

.topbar {
  min-height: 74px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 22px;
  padding: 12px clamp(16px, 3vw, 46px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(6, 9, 14, 0.96), rgba(7, 10, 15, 0.78));
  box-shadow: 0 12px 42px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
  z-index: 20;
}

.brand {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark,
.dialog-crest {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(231, 196, 128, 0.58);
  background: radial-gradient(circle at 50% 30%, #8e6233, #312111 62%, #111116);
  box-shadow: inset 0 0 0 3px #121118, 0 0 28px rgba(215, 174, 105, 0.17);
  color: var(--gold-bright);
  font-family: Georgia, serif;
  font-size: 22px;
  border-radius: 50%;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
}

.brand-copy strong {
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.13em;
}

.brand-copy small,
.ledger-header small {
  margin-top: 5px;
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.22em;
}

.room-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 6px 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(2, 5, 9, 0.52);
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.connection-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b99054;
  box-shadow: 0 0 0 4px rgba(185, 144, 84, 0.12);
  animation: status-pulse 1.3s ease-in-out infinite;
}

.connection-pill[data-state="online"] {
  color: #ccebdc;
}

.connection-pill[data-state="online"] i {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(109, 204, 156, 0.12), 0 0 12px rgba(109, 204, 156, 0.45);
  animation: none;
}

.connection-pill[data-state="offline"] {
  color: #efafb4;
}

.connection-pill[data-state="offline"] i {
  background: var(--danger);
}

.player-count {
  display: flex;
  align-items: baseline;
  gap: 3px;
  padding-right: 4px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.player-count b {
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 16px;
}

.top-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button,
.text-button,
.name-button,
.ledger-tool {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(14, 18, 25, 0.68);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.icon-button:hover,
.text-button:hover,
.name-button:hover,
.ledger-tool:hover {
  border-color: rgba(215, 174, 105, 0.42);
  background: rgba(36, 31, 28, 0.78);
}

.icon-button:active,
.text-button:active,
.name-button:active,
.ledger-tool:active {
  transform: translateY(1px);
}

.icon-button {
  width: 40px;
  padding: 9px;
}

.icon-button svg,
.ledger-tool svg,
.name-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button .sound-off,
.icon-button[aria-pressed="false"] .sound-on {
  display: none;
}

.icon-button[aria-pressed="false"] .sound-off {
  display: block;
}

.text-button {
  padding: 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.name-button {
  max-width: 190px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px 4px 5px;
  color: var(--ink);
}

.name-button > span:nth-child(2) {
  max-width: 105px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.name-button svg {
  width: 14px;
  color: var(--faint);
}

.avatar-mini,
.player-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.15), transparent 30%),
    linear-gradient(145deg, #693342, #252330 60%, #131822);
  color: #f5d9b0;
  font-family: Georgia, "Noto Serif SC", serif;
  text-transform: uppercase;
}

.avatar-mini {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(215, 174, 105, 0.34);
}

.game-layout {
  width: min(1760px, 100%);
  margin: 0 auto;
  min-height: 0;
  flex: 1 1 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: clamp(12px, 1.5vw, 24px);
  padding: clamp(12px, 2vw, 28px) clamp(12px, 2.5vw, 40px) 12px;
  overflow: hidden;
}

.table-stage {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(clamp(190px, 30dvh, 260px), 1fr) auto;
  position: relative;
  overflow: hidden;
}

.players-strip {
  min-height: 92px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(122px, 1fr));
  align-items: start;
  gap: 8px;
  z-index: 4;
}

.player-seat {
  min-width: 0;
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(16, 20, 27, 0.9), rgba(8, 11, 16, 0.72));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  transition: transform 240ms ease, border-color 240ms ease, box-shadow 240ms ease, opacity 240ms ease;
  animation: seat-arrive 420ms both;
}

.player-seat.is-turn {
  border-color: rgba(243, 215, 154, 0.75);
  box-shadow: 0 0 0 1px rgba(215, 174, 105, 0.18), 0 0 28px rgba(215, 174, 105, 0.2);
  transform: translateY(4px);
}

.player-seat.is-self {
  background: linear-gradient(145deg, rgba(41, 29, 32, 0.92), rgba(11, 16, 23, 0.78));
}

.player-seat.is-offline,
.player-seat.is-eliminated {
  opacity: 0.48;
  filter: saturate(0.45);
}

.player-avatar {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(215, 174, 105, 0.34);
  box-shadow: inset 0 0 0 2px rgba(7, 10, 15, 0.8);
}

.player-seat.is-turn .player-avatar {
  animation: avatar-glow 1.8s ease-in-out infinite;
}

.player-info {
  min-width: 0;
}

.player-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.player-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 12px;
}

.crown {
  color: var(--gold);
  font-size: 11px;
}

.self-tag,
.waiting-tag {
  padding: 2px 5px;
  border-radius: 99px;
  background: rgba(93, 183, 208, 0.12);
  color: #9bd7e8;
  font-size: 8px;
  letter-spacing: 0.05em;
}

.waiting-tag {
  background: rgba(215, 174, 105, 0.12);
  color: var(--gold-bright);
}

.player-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-top: 6px;
}

.mini-hand {
  display: flex;
  align-items: center;
  min-width: 25px;
}

.mini-card {
  width: 10px;
  height: 15px;
  margin-left: -4px;
  border: 1px solid rgba(231, 205, 159, 0.38);
  border-radius: 2px;
  background: linear-gradient(135deg, #642b3c, #202333 60%, #0e131c);
  transform: rotate(var(--tilt, 0deg));
}

.mini-card:first-child {
  margin-left: 0;
}

.chambers {
  display: flex;
  gap: 2px;
}

.chamber-dot {
  width: 9px;
  height: 9px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 174, 105, 0.36);
  border-radius: 50%;
  background: rgba(4, 6, 9, 0.8);
  color: #b9afa4;
  font-size: 7px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}

.chamber-dot.used {
  border-color: rgba(189, 178, 163, 0.52);
  background: rgba(20, 22, 25, 0.9);
}

.chamber-dot.hit {
  border-color: rgba(241, 164, 99, 0.82);
  background: rgba(131, 39, 36, 0.88);
  color: #ffd3a3;
  box-shadow: 0 0 7px rgba(226, 85, 95, 0.6);
}

.kick-mini {
  position: absolute;
  top: -7px;
  right: -5px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(226, 85, 95, 0.38);
  border-radius: 50%;
  background: #1b1015;
  color: #eaa2a7;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 160ms ease, transform 160ms ease, background 160ms ease;
}

.player-seat:hover .kick-mini,
.kick-mini:focus-visible {
  opacity: 1;
  transform: scale(1);
}

.kick-mini:hover {
  background: #5b1d2a;
}

.table-zone {
  min-height: clamp(190px, 30dvh, 260px);
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 34px 18px 20px;
}

.table-zone::before {
  content: "";
  position: absolute;
  width: min(850px, 90%);
  height: 70%;
  top: 16%;
  border: 1px solid rgba(215, 174, 105, 0.14);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(89, 38, 32, 0.16), rgba(8, 12, 17, 0.05) 58%, transparent 72%);
  box-shadow: inset 0 0 75px rgba(0, 0, 0, 0.27);
  pointer-events: none;
}

.round-ribbon {
  position: absolute;
  top: 15px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 9px;
  transform: translateX(-50%);
  color: rgba(224, 215, 201, 0.7);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.round-ribbon i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold);
}

.turn-clock {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.88);
  transition: opacity 220ms ease, transform 220ms ease;
}

.turn-clock.is-visible {
  opacity: 1;
  transform: scale(1);
}

.turn-clock svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.clock-track,
.clock-progress {
  fill: none;
  stroke-width: 2.2;
}

.clock-track {
  stroke: rgba(255, 255, 255, 0.1);
}

.clock-progress {
  stroke: var(--gold-bright);
  stroke-linecap: round;
  stroke-dasharray: 113.1;
  stroke-dashoffset: 0;
  transition: stroke 180ms ease;
}

.turn-clock.is-urgent .clock-progress {
  stroke: var(--danger);
}

.turn-clock strong {
  font-family: Georgia, serif;
  font-size: 13px;
}

.target-card {
  position: absolute;
  left: clamp(8px, 4vw, 70px);
  top: 50%;
  width: 88px;
  aspect-ratio: 2 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 1px solid rgba(230, 207, 166, 0.5);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 28%),
    linear-gradient(160deg, #312a25, #12151d 58%, #2e1620);
  box-shadow: inset 0 0 0 4px rgba(8, 10, 15, 0.65), 0 18px 40px rgba(0, 0, 0, 0.34);
  transform: translateY(-50%) rotate(-3deg);
  transition: transform 300ms ease, box-shadow 300ms ease;
}

.target-card[data-rank="A"] {
  background: linear-gradient(160deg, #2a3137, #11151d 58%, #2f2b21);
}

.target-card[data-rank="K"] {
  background: linear-gradient(160deg, #4d222d, #13151d 58%, #3d2b1d);
}

.target-card[data-rank="Q"] {
  background: linear-gradient(160deg, #1d344a, #11151d 58%, #3e1c29);
}

.target-card.is-dealt {
  animation: target-flip 600ms ease both;
}

.target-kicker {
  color: var(--gold);
  font-size: 8px;
  letter-spacing: 0.15em;
}

.target-card strong {
  color: #f2dfbd;
  font-family: Georgia, serif;
  font-size: 43px;
  line-height: 1;
  text-shadow: 0 0 22px rgba(215, 174, 105, 0.24);
}

.target-card > span:last-child {
  color: var(--muted);
  font-size: 9px;
}

.pile-wrap {
  width: 124px;
  height: 148px;
  position: relative;
  transform: translateY(-4px);
}

.pile-card {
  position: absolute;
  width: 80px;
  aspect-ratio: 2 / 3;
  left: 22px;
  top: 3px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(223, 194, 142, 0.5);
  border-radius: 10px;
  background:
    repeating-linear-gradient(45deg, transparent 0 5px, rgba(215, 174, 105, 0.08) 5px 6px),
    radial-gradient(circle at center, #5a2537, #171c28 68%);
  box-shadow: inset 0 0 0 4px #11141d, 0 12px 34px rgba(0, 0, 0, 0.38);
}

.pile-card::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(236, 205, 147, 0.26);
  border-radius: 50%;
}

.pile-card-3 {
  transform: translate(-4px, 4px) rotate(-8deg);
  opacity: 0.45;
}

.pile-card-2 {
  transform: translate(5px, 2px) rotate(7deg);
  opacity: 0.65;
}

.pile-card-1 {
  transform: rotate(-1deg);
}

.pile-wrap.has-cards .pile-card-1 {
  animation: pile-breathe 2.8s ease-in-out infinite;
}

.pile-wrap.card-landed .pile-card-1 {
  animation: card-land 380ms cubic-bezier(0.2, 0.85, 0.3, 1.25);
}

.card-back-mark {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(231, 198, 134, 0.54);
  border-radius: 50%;
  color: #e0bb77;
  font-family: Georgia, serif;
  font-size: 18px;
  box-shadow: inset 0 0 0 3px rgba(10, 13, 19, 0.64);
}

.pile-count {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.turn-message {
  max-width: min(520px, 62vw);
  position: absolute;
  bottom: 23px;
  left: 50%;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  background: rgba(7, 10, 15, 0.58);
  color: #ded5c8;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(11px, 1vw, 13px);
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.turn-message.is-your-turn {
  border-color: rgba(215, 174, 105, 0.33);
  color: var(--gold-bright);
  box-shadow: 0 0 24px rgba(215, 174, 105, 0.12);
}

.last-claim {
  position: absolute;
  right: clamp(5px, 4vw, 64px);
  top: 50%;
  max-width: 145px;
  padding: 12px 14px;
  border-left: 2px solid var(--wine-bright);
  background: linear-gradient(90deg, rgba(57, 18, 28, 0.72), transparent);
  color: #d9c9c6;
  font-size: 11px;
  line-height: 1.55;
  transform: translateY(-50%);
}

.last-claim strong {
  display: block;
  color: #f3d9d4;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 13px;
}

.hand-dock {
  position: relative;
  padding: 14px clamp(12px, 2vw, 24px) 16px;
  border: 1px solid rgba(225, 194, 136, 0.15);
  border-radius: 22px 22px 12px 12px;
  background:
    linear-gradient(180deg, rgba(25, 23, 25, 0.7), rgba(7, 10, 15, 0.94)),
    radial-gradient(ellipse at 50% 0, rgba(124, 56, 40, 0.2), transparent 58%);
  box-shadow: 0 -12px 46px rgba(0, 0, 0, 0.27), var(--shadow);
  backdrop-filter: blur(14px);
  z-index: 5;
}

.hand-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.hand-heading > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.hand-heading span {
  color: #d8cebe;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 12px;
}

.hand-heading small {
  color: var(--faint);
  font-size: 9px;
}

.selection-count {
  font-family: inherit !important;
  color: var(--muted) !important;
  font-size: 10px !important;
}

.selection-count b {
  color: var(--gold-bright);
  font-size: 14px;
}

.hand {
  min-height: clamp(150px, 23vh, 218px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(5px, 1vw, 13px);
  padding: 5px 4px 2px;
  perspective: 1100px;
}

.empty-hand {
  align-self: center;
  padding: 16px 20px;
  border: 1px dashed rgba(215, 174, 105, 0.18);
  border-radius: 12px;
  color: var(--faint);
  font-size: 11px;
}

.playing-card,
.reveal-card {
  position: relative;
  width: clamp(94px, 9.5vw, 140px);
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid rgba(233, 215, 182, 0.74);
  border-radius: clamp(9px, 1vw, 14px);
  background: #171a20;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.42), inset 0 0 0 4px rgba(8, 10, 14, 0.72);
}

.playing-card {
  width: clamp(86px, min(9.5vw, 14dvh), 140px);
  padding: 0;
  cursor: pointer;
  transform-origin: bottom center;
  animation: deal-card 560ms cubic-bezier(0.18, 0.82, 0.25, 1.05) both;
  animation-delay: var(--deal-delay, 0ms);
  transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.playing-card.delay-1 { animation-delay: 70ms; }
.playing-card.delay-2 { animation-delay: 140ms; }
.playing-card.delay-3 { animation-delay: 210ms; }
.playing-card.delay-4 { animation-delay: 280ms; }
.playing-card.delay-5 { animation-delay: 350ms; }

.mini-card.tilt-0 { transform: rotate(-8deg); }
.mini-card.tilt-1 { transform: rotate(-4deg); }
.mini-card.tilt-2 { transform: rotate(0deg); }
.mini-card.tilt-3 { transform: rotate(4deg); }
.mini-card.tilt-4 { transform: rotate(8deg); }

.playing-card:hover:not(:disabled) {
  transform: translateY(-8px) rotateX(3deg);
  filter: brightness(1.06);
}

.playing-card.is-selected {
  border-color: var(--gold-bright);
  transform: translateY(-20px);
  box-shadow: 0 17px 38px rgba(0, 0, 0, 0.54), 0 0 0 2px rgba(215, 174, 105, 0.35), 0 0 26px rgba(215, 174, 105, 0.22);
}

.playing-card:disabled {
  cursor: default;
  filter: saturate(0.72) brightness(0.8);
}

.card-art {
  position: absolute;
  inset: 6px;
  overflow: hidden;
  border-radius: inherit;
  background-position: center 24%;
  background-size: cover;
}

.rank-a .card-art {
  background-image: linear-gradient(180deg, transparent 55%, rgba(9, 11, 15, 0.84)), url("assets/images/card-ace.webp");
}

.rank-k .card-art {
  background-image: linear-gradient(180deg, transparent 55%, rgba(9, 11, 15, 0.84)), url("assets/images/card-king.webp");
}

.rank-q .card-art {
  background-image: linear-gradient(180deg, transparent 55%, rgba(9, 11, 15, 0.84)), url("assets/images/card-queen.webp");
}

.rank-joker .card-art {
  background-image: linear-gradient(180deg, transparent 55%, rgba(9, 11, 15, 0.84)), url("assets/images/card-joker.webp");
}

.rank-joker {
  border-color: rgba(207, 181, 234, 0.88);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.42), inset 0 0 0 4px rgba(8, 10, 14, 0.72), 0 0 12px rgba(150, 109, 190, 0.15);
}

.rank-joker::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 3px;
  border: 1px solid rgba(190, 151, 221, 0.58);
  border-radius: inherit;
  box-shadow: inset 0 0 11px rgba(113, 203, 214, 0.17), inset 0 0 22px rgba(171, 105, 207, 0.12);
  pointer-events: none;
  animation: joker-edge-glow 3.8s ease-in-out infinite;
}

.rank-joker .card-corner strong {
  color: #f0dfff;
  font-size: clamp(14px, 1.45vw, 20px);
  letter-spacing: -0.08em;
}

.card-wild-badge {
  position: absolute;
  z-index: 4;
  top: 9px;
  right: 8px;
  padding: 3px 6px;
  border: 1px solid rgba(201, 170, 226, 0.54);
  border-radius: 99px;
  background: rgba(30, 20, 42, 0.76);
  color: #ead8f7;
  font-size: 7px;
  letter-spacing: 0.14em;
  text-shadow: 0 1px 3px #000;
  backdrop-filter: blur(4px);
}

.playing-card.rank-joker.is-truthy::after {
  display: none;
}

.card-art::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(220, 186, 124, 0.28);
  border-radius: inherit;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.28);
}

.card-corner {
  position: absolute;
  z-index: 2;
  top: 11px;
  left: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #f4e4c6;
  font-family: Georgia, serif;
  font-weight: 700;
  text-shadow: 0 1px 3px #000;
}

.card-corner strong {
  font-size: clamp(17px, 1.7vw, 23px);
  line-height: 1;
}

.card-corner small {
  color: var(--gold-bright);
  font-size: 9px;
}

.card-title {
  position: absolute;
  z-index: 2;
  left: 12px;
  right: 12px;
  bottom: 11px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  color: #efe1cb;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 5px #000;
}

.card-title i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.playing-card.is-truthy::after {
  content: "真牌";
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 9px;
  padding: 3px 5px;
  border: 1px solid rgba(109, 204, 156, 0.48);
  border-radius: 99px;
  background: rgba(9, 27, 23, 0.82);
  color: #9ee2bf;
  font-size: 7px;
  letter-spacing: 0.06em;
}

.action-bar {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 9px;
  margin-top: 9px;
}

.action-button {
  min-width: 150px;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 7px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  transition: transform 170ms ease, filter 170ms ease, opacity 170ms ease, box-shadow 170ms ease;
}

.action-button span {
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.action-button small {
  opacity: 0.64;
  font-size: 8px;
}

.action-button:not(:disabled):hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
}

.action-button:not(:disabled):active {
  transform: translateY(0);
}

.action-button:disabled {
  cursor: not-allowed;
  opacity: 0.36;
  filter: saturate(0.4);
}

.play-button {
  border-color: rgba(215, 174, 105, 0.33);
  background: linear-gradient(180deg, #6d4c28, #3c2817);
  color: #f4e0bb;
}

.liar-button {
  border-color: rgba(221, 94, 105, 0.48);
  background: linear-gradient(180deg, #81293a, #461620);
  color: #ffe2df;
}

.liar-button.is-forced:not(:disabled) {
  animation: liar-demand 1.2s ease-in-out infinite;
}

.start-button {
  border-color: rgba(93, 183, 208, 0.4);
  background: linear-gradient(180deg, #28586b, #17303c);
  color: #daf5fb;
}

.ledger {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(215, 174, 105, 0.16);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(16, 20, 27, 0.92), rgba(7, 10, 15, 0.9)),
    repeating-linear-gradient(0deg, transparent 0 29px, rgba(215, 174, 105, 0.03) 29px 30px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.ledger-header,
.ledger-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.ledger-header > div {
  display: flex;
  flex-direction: column;
}

.ledger-header span {
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.ledger-tool {
  width: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 7px;
}

.ledger-tool svg {
  width: 17px;
}

.event-log {
  min-height: 0;
  flex: 1;
  margin: 0;
  padding: 10px 14px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(215, 174, 105, 0.28) transparent;
}

.event-log::-webkit-scrollbar {
  width: 6px;
}

.event-log::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.025);
}

.event-log::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(215, 174, 105, 0.3);
}

.event-log::-webkit-scrollbar-thumb:hover {
  background: rgba(215, 174, 105, 0.5);
}

.event-log li {
  position: relative;
  padding: 9px 5px 9px 17px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #aaa197;
  font-size: 10px;
  line-height: 1.55;
  animation: log-enter 300ms ease both;
  content-visibility: auto;
  contain-intrinsic-size: 42px;
}

.event-log li::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #716c67;
}

.event-log li[data-tone="good"]::before {
  background: var(--green);
}

.event-log li[data-tone="danger"]::before {
  background: var(--danger);
}

.event-log li[data-tone="system"] {
  color: #dcc49a;
}

.event-log li[data-tone="system"]::before {
  background: var(--gold);
  box-shadow: 0 0 8px rgba(215, 174, 105, 0.52);
}

.event-log time {
  display: block;
  margin-top: 2px;
  color: #5f5d5b;
  font-size: 8px;
}

.event-log .log-empty {
  padding: 24px 6px;
  color: var(--faint);
  text-align: center;
}

.event-log .log-empty::before {
  display: none;
}

.ledger-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 0;
}

.host-badge {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.host-badge i {
  color: var(--gold);
  font-style: normal;
}

.host-badge span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-footer button {
  padding: 5px 8px;
  border: 0;
  background: transparent;
  color: #a77f82;
  font-size: 9px;
  cursor: pointer;
}

.ledger-footer button:hover {
  color: #efb2b6;
}

.disclaimer {
  padding: 0 20px 8px;
  color: rgba(188, 178, 166, 0.34);
  font-size: 8px;
  text-align: center;
  letter-spacing: 0.11em;
}

.cinematic-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
}

.cinematic-overlay[hidden],
.reveal-scene[hidden],
.roulette-scene[hidden],
.winner-scene[hidden] {
  display: none;
}

.cinematic-scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(20, 16, 20, 0.22), rgba(3, 5, 8, 0.91));
  backdrop-filter: blur(5px);
  animation: scrim-in 300ms ease both;
}

.reveal-scene,
.roulette-scene,
.winner-scene {
  position: relative;
  width: min(700px, 94vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: scene-rise 460ms cubic-bezier(0.18, 0.82, 0.25, 1.08) both;
}

.scene-eyebrow {
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.reveal-scene h2,
.roulette-scene h2,
.winner-scene h2 {
  margin: 8px 0 18px;
  color: #f4e6cf;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(27px, 5vw, 52px);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-shadow: 0 8px 30px #000;
}

.reveal-cards {
  min-height: 200px;
  display: flex;
  justify-content: center;
  gap: 12px;
  perspective: 1000px;
}

.reveal-card {
  width: clamp(105px, 17vw, 160px);
  animation: reveal-flip 720ms cubic-bezier(0.2, 0.75, 0.28, 1.15) both;
  animation-delay: var(--reveal-delay, 0ms);
}

.reveal-card.delay-1 { animation-delay: 130ms; }
.reveal-card.delay-2 { animation-delay: 260ms; }
.reveal-card.delay-3 { animation-delay: 390ms; }

.reveal-card.is-liar {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px rgba(226, 85, 95, 0.35), 0 18px 50px rgba(0, 0, 0, 0.58), 0 0 38px rgba(226, 85, 95, 0.24);
}

.reveal-card.is-truth {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(109, 204, 156, 0.26), 0 18px 50px rgba(0, 0, 0, 0.58), 0 0 35px rgba(109, 204, 156, 0.18);
}

.reveal-scene p,
.roulette-scene p,
.winner-scene p {
  max-width: 520px;
  margin: 20px 0 0;
  color: #c7bdb1;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(13px, 2vw, 17px);
}

.cylinder {
  --chamber-orbit: clamp(59px, 10.5vw, 93px);
  width: clamp(190px, 34vw, 300px);
  aspect-ratio: 1;
  position: relative;
  border: 8px solid #302a26;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #181a1d 0 15%, transparent 16%),
    radial-gradient(circle at 35% 28%, #68605a, #2a292a 42%, #121416 73%);
  box-shadow: inset 0 0 0 5px #0a0c0f, inset 0 0 32px #000, 0 20px 70px #000;
  animation: cylinder-spin 1.5s cubic-bezier(0.17, 0.75, 0.23, 1) both;
}

.cylinder i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 23%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 4px solid #111316;
  border-radius: 50%;
  background: radial-gradient(circle, #040506 0 40%, #1b1d1f 42% 70%, #34302c 72%);
  box-shadow: inset 0 4px 9px #000;
  color: #c6bbb0;
  font-family: Georgia, serif;
  font-size: clamp(25px, 5vw, 43px);
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 2px 5px #000;
  transform: translate(-50%, -50%) rotate(var(--slot-angle)) translateX(var(--chamber-orbit)) rotate(calc(-1 * var(--slot-angle)));
}

.cylinder i:nth-child(1) { --slot-angle: -90deg; }
.cylinder i:nth-child(2) { --slot-angle: -30deg; }
.cylinder i:nth-child(3) { --slot-angle: 30deg; }
.cylinder i:nth-child(4) { --slot-angle: 90deg; }
.cylinder i:nth-child(5) { --slot-angle: 150deg; }
.cylinder i:nth-child(6) { --slot-angle: 210deg; }

.cylinder i.used {
  border-color: #2a2929;
  background: radial-gradient(circle, #090a0c 0 45%, #202123 47% 70%, #393431 72%);
  color: rgba(215, 205, 193, 0.78);
}

.cylinder i.hit {
  border-color: #5d2e28;
  background: radial-gradient(circle, #351212 0 32%, #8e362b 35% 52%, #281b19 55% 71%, #47302b 73%);
  color: #ffd3a3;
  box-shadow: inset 0 4px 10px #100, 0 0 20px rgba(226, 85, 95, 0.55);
}

.cylinder b {
  position: absolute;
  width: 17%;
  aspect-ratio: 1;
  left: 41.5%;
  top: 41.5%;
  border: 2px solid rgba(215, 174, 105, 0.5);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #c49b5a, #49371f 65%, #19140d);
}

.roulette-scene.is-fired .cylinder {
  animation: gun-shock 480ms ease both;
  filter: sepia(0.5) brightness(1.25);
}

.roulette-scene.is-fired::after {
  content: "";
  position: fixed;
  inset: 0;
  background: #fff0d1;
  animation: muzzle-flash 650ms ease-out both;
}

.winner-crown {
  color: var(--gold-bright);
  font-size: clamp(70px, 15vw, 130px);
  line-height: 1;
  text-shadow: 0 0 45px rgba(215, 174, 105, 0.4), 0 15px 45px #000;
  animation: crown-float 2.2s ease-in-out infinite;
}

.winner-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 25px;
  width: min(100%, 500px);
  pointer-events: auto;
}

.winner-lobby-button,
.winner-admin-button,
.winner-restart-button {
  flex: 1 1 135px;
  min-width: 135px;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid rgba(215, 174, 105, 0.48);
  border-radius: 11px;
  color: #f5dfb9;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.38), inset 0 0 18px rgba(215, 174, 105, 0.08);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, filter 180ms ease;
}

.winner-restart-button {
  background: linear-gradient(180deg, rgba(112, 78, 41, 0.94), rgba(49, 34, 20, 0.96));
}

.winner-lobby-button {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(13, 17, 23, 0.9);
  color: var(--muted);
}

.winner-admin-button {
  border-color: rgba(190, 151, 221, 0.34);
  background: linear-gradient(180deg, rgba(62, 42, 75, 0.92), rgba(25, 21, 32, 0.96));
  color: #dbc7ea;
}

.winner-lobby-button:hover:not(:disabled),
.winner-admin-button:hover:not(:disabled),
.winner-restart-button:hover:not(:disabled) {
  border-color: rgba(243, 215, 154, 0.82);
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.game-dialog {
  width: min(500px, calc(100vw - 30px));
  padding: 0;
  border: 1px solid rgba(215, 174, 105, 0.34);
  border-radius: 20px;
  background:
    linear-gradient(160deg, rgba(28, 28, 33, 0.98), rgba(9, 12, 17, 0.99)),
    radial-gradient(circle at 50% 0, rgba(140, 66, 50, 0.24), transparent 50%);
  color: var(--ink);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.78), inset 0 0 0 4px rgba(5, 7, 10, 0.65);
}

.game-dialog::backdrop {
  background: rgba(3, 5, 8, 0.76);
  backdrop-filter: blur(8px);
}

.game-dialog[open] {
  animation: dialog-in 260ms cubic-bezier(0.2, 0.78, 0.28, 1.1) both;
}

.game-dialog form,
.game-dialog article {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px;
  text-align: center;
}

.dialog-crest {
  width: 54px;
  height: 54px;
  margin-bottom: 15px;
  font-size: 28px;
}

.dialog-kicker {
  margin: 0 0 6px !important;
  color: var(--gold) !important;
  font-size: 9px !important;
  letter-spacing: 0.25em;
}

.game-dialog h2 {
  margin: 0;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.07em;
}

.game-dialog p {
  margin: 12px 0 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.game-dialog label {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  text-align: left;
}

.game-dialog label span {
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.game-dialog input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid rgba(215, 174, 105, 0.2);
  border-radius: 10px;
  background: rgba(3, 6, 10, 0.72);
  color: var(--ink);
}

.dialog-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 9px;
  margin-top: 22px;
}

.dialog-actions.single {
  max-width: 240px;
  grid-template-columns: 1fr;
}

.dialog-actions.admin-actions {
  grid-template-columns: 0.72fr 1fr 1fr;
}

.dialog-actions button {
  min-height: 43px;
  border-radius: 10px;
  cursor: pointer;
}

.dialog-actions button:disabled,
.winner-lobby-button:disabled,
.winner-admin-button:disabled,
.winner-restart-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.45) brightness(0.62);
  opacity: 0.62;
}

.dialog-secondary {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.dialog-primary {
  border: 1px solid rgba(215, 174, 105, 0.36);
  background: linear-gradient(180deg, #704e29, #3c2917);
  color: #f5dfb9;
}

.dialog-danger {
  border: 1px solid rgba(226, 85, 95, 0.45);
  background: linear-gradient(180deg, #792838, #40151f);
  color: #ffe2df;
}

.rules-dialog {
  width: min(760px, calc(100vw - 30px));
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  text-align: left;
}

.rules-grid section {
  position: relative;
  padding: 17px 16px 15px 48px;
  border: 1px solid rgba(215, 174, 105, 0.12);
  border-radius: 12px;
  background: rgba(7, 10, 15, 0.52);
}

.rules-grid section > b {
  position: absolute;
  top: 17px;
  left: 15px;
  color: rgba(215, 174, 105, 0.6);
  font-family: Georgia, serif;
  font-size: 14px;
}

.rules-grid h3 {
  margin: 0 0 5px;
  color: #dfd1bb;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 13px;
}

.rules-grid p {
  margin: 0;
  color: #928b83;
  font-size: 10px;
  line-height: 1.55;
}

.rule-note {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  margin-top: 12px;
  padding: 13px 15px;
  border-left: 2px solid var(--blue);
  background: rgba(45, 107, 125, 0.1);
  color: #9baab0;
  font-size: 10px;
  text-align: left;
  line-height: 1.55;
}

.rule-note strong {
  color: #a5d8e7;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  width: min(330px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid rgba(215, 174, 105, 0.22);
  border-radius: 11px;
  background: rgba(12, 16, 22, 0.94);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5);
  color: #d9d0c4;
  font-size: 11px;
  animation: toast-in 260ms ease both;
  backdrop-filter: blur(10px);
}

.toast.is-error {
  border-color: rgba(226, 85, 95, 0.42);
  color: #f1b7bc;
}

.toast.is-leaving {
  animation: toast-out 220ms ease both;
}

@keyframes dust-drift {
  from { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(26px, -18px, 0); }
  to { transform: translate3d(0, -36px, 0); }
}

@keyframes status-pulse {
  50% { opacity: 0.42; transform: scale(0.78); }
}

@keyframes seat-arrive {
  from { opacity: 0; transform: translateY(-12px); }
}

@keyframes avatar-glow {
  50% { box-shadow: inset 0 0 0 2px rgba(7, 10, 15, 0.8), 0 0 20px rgba(215, 174, 105, 0.4); }
}

@keyframes target-flip {
  0% { transform: translateY(-50%) rotate(-3deg) rotateY(90deg); }
  100% { transform: translateY(-50%) rotate(-3deg) rotateY(0); }
}

@keyframes pile-breathe {
  50% { transform: translateY(-2px) rotate(-1deg); box-shadow: inset 0 0 0 4px #11141d, 0 17px 40px rgba(0, 0, 0, 0.46); }
}

@keyframes card-land {
  from { transform: translate(80px, -70px) rotate(17deg) scale(1.18); opacity: 0; }
  to { transform: rotate(-1deg); opacity: 1; }
}

@keyframes deal-card {
  from { opacity: 0; transform: translateY(-70px) rotateY(80deg) scale(0.75); }
}

@keyframes liar-demand {
  50% { box-shadow: 0 0 0 3px rgba(226, 85, 95, 0.2), 0 0 30px rgba(226, 85, 95, 0.32); }
}

@keyframes log-enter {
  from { opacity: 0; transform: translateX(8px); }
}

@keyframes joker-edge-glow {
  0%, 100% { opacity: 0.48; border-color: rgba(190, 151, 221, 0.5); }
  50% { opacity: 0.8; border-color: rgba(126, 203, 215, 0.64); }
}

@keyframes scrim-in {
  from { opacity: 0; }
}

@keyframes scene-rise {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
}

@keyframes reveal-flip {
  0% { opacity: 0; transform: rotateY(180deg) translateY(20px); }
  55% { opacity: 1; }
  100% { transform: rotateY(0) translateY(0); }
}

@keyframes cylinder-spin {
  from { transform: rotate(-420deg) scale(0.8); opacity: 0; }
  to { transform: rotate(0) scale(1); opacity: 1; }
}

@keyframes gun-shock {
  0% { transform: scale(1); }
  20% { transform: scale(1.25) rotate(-6deg); }
  45% { transform: scale(0.92) rotate(4deg); }
  100% { transform: scale(1); }
}

@keyframes muzzle-flash {
  0% { opacity: 0; }
  8% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes crown-float {
  50% { transform: translateY(-10px); filter: brightness(1.15); }
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(18px); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateX(18px); }
}

@media (max-width: 1100px) {
  .game-layout {
    grid-template-columns: minmax(0, 1fr) 235px;
  }

  .target-card {
    left: 15px;
    width: 76px;
  }

  .last-claim {
    right: 5px;
  }

  .players-strip {
    grid-template-columns: repeat(4, minmax(110px, 1fr));
  }
}

@media (max-width: 820px) {
  .app-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    min-height: 64px;
    padding: 9px 12px;
  }

  .brand-copy small,
  .room-meta,
  .text-button {
    display: none;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-copy strong {
    font-size: 15px;
  }

  .top-actions {
    grid-column: 2;
  }

  .name-button {
    max-width: 145px;
  }

  .game-layout {
    min-height: auto;
    flex: 1 0 auto;
    grid-template-columns: 1fr;
    padding: 8px;
    overflow: visible;
  }

  .table-stage {
    height: auto;
    min-height: calc(100dvh - 78px);
    grid-template-rows: auto minmax(235px, 1fr) auto;
    overflow: visible;
  }

  .players-strip {
    min-height: 72px;
    grid-template-columns: repeat(4, minmax(72px, 1fr));
    gap: 5px;
  }

  .player-seat {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 5px;
    padding: 6px;
    border-radius: 10px;
  }

  .player-avatar {
    width: 30px;
    height: 30px;
    font-size: 11px;
  }

  .player-name {
    font-size: 9px;
  }

  .self-tag,
  .waiting-tag,
  .mini-hand {
    display: none;
  }

  .player-stats {
    margin-top: 4px;
  }

  .chamber-dot {
    width: 5px;
    height: 5px;
    font-size: 5px;
  }

  .kick-mini {
    opacity: 1;
    transform: scale(0.8);
  }

  .table-zone {
    min-height: 235px;
    padding-inline: 0;
  }

  .table-zone::before {
    width: 98%;
  }

  .target-card {
    left: 5px;
    width: 62px;
    border-radius: 8px;
  }

  .target-card strong {
    font-size: 31px;
  }

  .target-kicker,
  .target-card > span:last-child {
    font-size: 6px;
  }

  .pile-wrap {
    transform: scale(0.82);
  }

  .last-claim {
    max-width: 92px;
    padding: 8px;
    font-size: 8px;
  }

  .last-claim strong {
    font-size: 9px;
  }

  .turn-message {
    max-width: 75vw;
    bottom: 12px;
    padding: 7px 11px;
    font-size: 10px;
  }

  .round-ribbon {
    top: 5px;
    font-size: 7px;
  }

  .turn-clock {
    top: -2px;
    right: 0;
    width: 46px;
    height: 46px;
  }

  .hand-dock {
    padding: 10px 8px 12px;
    border-radius: 16px 16px 8px 8px;
  }

  .hand-heading small {
    display: none;
  }

  .hand {
    min-height: clamp(132px, 22vh, 178px);
    gap: 3px;
  }

  .playing-card {
    width: min(18vw, 105px);
    border-radius: 8px;
  }

  .playing-card.is-selected {
    transform: translateY(-12px);
  }

  .card-art {
    inset: 4px;
  }

  .card-corner {
    top: 8px;
    left: 8px;
  }

  .card-corner strong {
    font-size: 15px;
  }

  .card-title {
    left: 8px;
    right: 8px;
    bottom: 7px;
    font-size: 7px;
  }

  .playing-card.is-truthy::after {
    display: none;
  }

  .action-button {
    min-width: 0;
    flex: 1;
    min-height: 44px;
    padding: 6px 8px;
  }

  .action-button span {
    font-size: 11px;
  }

  .ledger {
    height: auto;
    max-height: 210px;
  }

  .event-log {
    min-height: 80px;
  }

  .ledger-header,
  .ledger-footer {
    padding: 9px 12px;
  }

  .disclaimer {
    display: none;
  }
}

@media (max-width: 480px) {
  .brand-copy {
    display: none;
  }

  .players-strip {
    grid-template-columns: repeat(4, 1fr);
  }

  .player-seat {
    grid-template-columns: 25px minmax(0, 1fr);
    padding: 5px 3px;
  }

  .player-avatar {
    width: 25px;
    height: 25px;
  }

  .crown {
    display: none;
  }

  .hand {
    gap: 1px;
  }

  .playing-card {
    width: 18.2vw;
  }

  .rules-grid {
    grid-template-columns: 1fr;
  }

  .rules-dialog article {
    max-height: 88dvh;
    overflow: auto;
    padding: 22px 16px;
  }

  .game-dialog form {
    padding: 25px 20px;
  }

  .winner-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: min(100%, 300px);
    gap: 8px;
  }

  .winner-lobby-button,
  .winner-admin-button,
  .winner-restart-button {
    min-width: 0;
    padding-inline: 12px;
  }

  .winner-restart-button {
    grid-column: 1 / -1;
  }

  .dialog-actions.admin-actions {
    grid-template-columns: 1fr 1fr;
  }

  .dialog-actions.admin-actions .dialog-secondary {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .reveal-cards {
    gap: 5px;
  }

  .reveal-card {
    width: min(29vw, 130px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
