:root {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 17px;
  color: #1f352d;
  font-synthesis: none;
  --ink: #1f352d;
  --green: #256a52;
  --green-2: #1c5341;
  --gold: #e9b93f;
  --paper: #fffdf6;
  --muted: #6f7f77;
  --line: rgba(31, 53, 45, 0.12);
  --red: #c9483c;
  --glass: rgba(255, 253, 246, 0.9);
  --shadow: 0 18px 50px rgba(15, 50, 60, 0.28), 0 2px 6px rgba(15, 50, 60, 0.18);
  --r: 20px;
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #8cc8ee;
  overscroll-behavior: none;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#stage:active {
  cursor: grabbing;
}
#fx-overlay,
#app,
#card-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#app > *,
#app .front > * {
  pointer-events: auto;
}
#app .front {
  pointer-events: none;
}
#fx-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(8, 40, 60, 0.28) 100%);
}
.no-3d #stage {
  display: none;
}
.no-3d body,
body.no-3d {
  background: linear-gradient(#3f8fd6, #d6eef5);
}
body.no-3d::after {
  content: "这台设备的浏览器不支持 3D 画面，请换用较新的 Chrome、Safari 或 Edge。";
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 14px;
  background: rgba(22, 45, 38, 0.9);
  color: #fff;
  font-size: 0.9rem;
  z-index: 40;
}

/* ------------------------------------------------------------ primitives */
.glass {
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.btn {
  border: 0;
  border-radius: 14px;
  padding: 11px 18px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s, box-shadow 0.12s, background 0.15s, opacity 0.15s;
  background: #eef1e8;
}
.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}
.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}
.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.btn.primary {
  color: #fffdf3;
  background: linear-gradient(180deg, #2f8566, var(--green-2));
  box-shadow: 0 4px 0 #123a2d, 0 10px 22px rgba(18, 58, 45, 0.35);
}
.btn.primary:active:not(:disabled) {
  box-shadow: 0 1px 0 #123a2d;
  transform: translateY(3px);
}
.btn.secondary {
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--line), 0 3px 0 rgba(31, 53, 45, 0.12);
}
.btn.ghost {
  background: rgba(255, 255, 255, 0.55);
  font-weight: 600;
}
.btn.big {
  font-size: 1.15rem;
  padding: 15px 30px;
  border-radius: 18px;
}
.btn.tiny {
  padding: 3px 10px;
  font-size: 0.8rem;
}
.btn.danger {
  color: var(--red);
}
.btn.primary.danger {
  color: #fff;
  background: linear-gradient(180deg, #d9584b, #a8362c);
  box-shadow: 0 4px 0 #6f1f18;
}
.btn.link {
  background: none;
  padding: 0 4px;
  text-decoration: underline;
  font-weight: 600;
}
.btn.x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  background: rgba(31, 53, 45, 0.08);
  z-index: 2;
}
.ic {
  width: 1em;
  height: 1em;
  vertical-align: -0.12em;
}
.face {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #fff, color-mix(in srgb, var(--player, #cfe3da) 55%, #fff));
  box-shadow: 0 0 0 3px var(--player, #cfe3da);
  object-fit: cover;
  flex: none;
  user-select: none;
}
.note,
.empty-note {
  color: var(--muted);
  font-size: 0.85rem;
}
.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.chip {
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.7);
}
.chip.live::before,
.chip.off::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  background: #3fae6d;
}
.chip.off::before {
  background: #d98b2b;
  animation: pulse 1s infinite;
}

/* ------------------------------------------------------------ top bar */
.top,
#top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) 18px 0;
  pointer-events: none;
}
.top > * {
  pointer-events: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  padding: 7px 16px 7px 8px;
  border-radius: 999px;
  background: var(--glass);
  box-shadow: 0 6px 20px rgba(15, 50, 60, 0.2);
}
.brand i {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M32 14 12 32h6v18h28V32h6z' fill='%23f6c948'/%3E%3C/svg%3E") center/78% no-repeat;
}
.brand small {
  display: block;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--muted);
}
.top nav {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 5px;
  border-radius: 999px;
  background: var(--glass);
  box-shadow: 0 6px 20px rgba(15, 50, 60, 0.2);
}
.top nav .btn {
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.85rem;
  background: transparent;
}
.top nav .btn:hover {
  background: rgba(31, 53, 45, 0.08);
}

/* ------------------------------------------------------------ landing & lobby */
.front {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 84px 5vw 24px;
}
.hero {
  width: min(500px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 34px 34px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: rise 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.hero.lobby {
  width: min(600px, 100%);
  animation: none;
  padding: 26px 28px 22px;
  gap: 11px;
}
.lobby .seats,
.lobby .cast {
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.lobby .seat,
.lobby .cast button {
  padding: 8px 2px;
}
.lobby .seat .face,
.lobby .seat .empty {
  width: 40px;
  height: 40px;
}
.lobby .cast button .face {
  width: 52px;
  height: 52px;
}
.lobby .seat strong,
.lobby .cast strong {
  font-size: 0.76rem;
}
.eyebrow {
  align-self: flex-start;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--green);
  background: rgba(37, 106, 82, 0.12);
  padding: 5px 12px;
  border-radius: 999px;
}
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -1px;
}
.hero.lobby h1 {
  font-size: 2rem;
}
.hero h2 {
  font-size: 1.05rem;
  margin-top: 6px;
}
.hero > p {
  color: #47594f;
  line-height: 1.7;
}
form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #47594f;
  margin-top: 6px;
}
label.check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 600;
}
input:not([type="checkbox"]),
select {
  width: 100%;
  padding: 13px 15px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: #fff;
  font-size: 1rem;
}
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}
form .btn.big {
  margin-top: 10px;
}
.resume {
  font-weight: 700;
  color: var(--green);
  text-decoration: underline;
}
.invite {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 16px;
  border-radius: 16px;
  background: rgba(37, 106, 82, 0.1);
}
.invite b {
  font-family: ui-monospace, monospace;
  letter-spacing: 2px;
}
.seats,
.cast {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.seat,
.cast button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 2px dashed var(--line);
  text-align: center;
  min-width: 0;
}
.seat.on {
  border: 2px solid var(--player);
  background: #fff;
}
.seat strong,
.cast strong {
  font-size: 0.9rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.seat small,
.cast small {
  font-size: 0.72rem;
  color: var(--muted);
}
.seat .empty {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  font-style: normal;
  color: var(--muted);
  font-size: 1.4rem;
}
.cast button {
  border-style: solid;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.cast button .face {
  width: 62px;
  height: 62px;
  box-shadow: none;
  background: none;
}
.cast button:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(15, 50, 60, 0.18);
}
.cast button[aria-pressed="true"] {
  border-color: var(--green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 106, 82, 0.2);
}
.cast button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ------------------------------------------------------------ players */
.players {
  position: absolute;
  left: 16px;
  top: 74px;
  width: 268px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pcard {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px 9px 9px;
  border-radius: 18px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 6px 18px rgba(15, 50, 60, 0.18);
  border: 2px solid transparent;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.pcard.active {
  border-color: var(--player);
  transform: translateX(8px) scale(1.03);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--player) 45%, transparent);
}
.pcard.out {
  opacity: 0.5;
  filter: grayscale(0.8);
}
.pmain {
  min-width: 0;
  flex: 1;
}
.pmain strong {
  display: block;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pmain em {
  font-style: normal;
  font-size: 0.68rem;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 6px;
  color: #fff;
  background: var(--player);
}
.pmain small {
  color: var(--muted);
  font-size: 0.72rem;
}
.dots {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 3px;
  min-height: 8px;
}
.dots i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
}
.dots i.m {
  opacity: 0.35;
}
.pcash {
  text-align: right;
}
.pcash b {
  display: block;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s, transform 0.2s;
}
.pcash b.up {
  color: #1f9a55;
  transform: scale(1.12);
}
.pcash b.down {
  color: var(--red);
  transform: scale(1.12);
}
.pcash small {
  font-size: 0.68rem;
  color: var(--muted);
}

/* ------------------------------------------------------------ side panel */
.side {
  position: absolute;
  right: 16px;
  top: 74px;
  bottom: 16px;
  width: 304px;
  display: flex;
  flex-direction: column;
  padding: 10px;
  overflow: hidden;
}
.tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(31, 53, 45, 0.07);
}
.btn.tab {
  flex: 1;
  padding: 8px;
  border-radius: 11px;
  background: none;
  font-size: 0.9rem;
}
.btn.tab.on {
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 50, 60, 0.12);
}
.assets,
.log {
  flex: 1;
  overflow: auto;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}
.side .empty-note {
  padding: 18px 8px;
}
.asset {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 13px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s;
}
.asset:hover {
  transform: translateX(-3px);
}
.asset.m {
  opacity: 0.6;
}
.asset .bar {
  width: 8px;
  align-self: stretch;
  border-radius: 4px;
  background: var(--group);
}
.asset .an {
  flex: 1;
  min-width: 0;
}
.asset strong {
  display: block;
  font-size: 0.92rem;
}
.asset small {
  color: var(--muted);
  font-size: 0.74rem;
}
.prog {
  display: flex;
  gap: 3px;
}
.prog i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(31, 53, 45, 0.15);
}
.prog i.on {
  background: var(--group);
}
.log p {
  font-size: 0.84rem;
  line-height: 1.5;
  padding: 7px 10px;
  border-radius: 10px;
  color: #47594f;
}
.log p.new {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
}
.stock {
  padding: 8px 6px 2px;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}

/* ------------------------------------------------------------ dock */
.dock-slot {
  position: absolute;
  left: 300px;
  right: 336px;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  pointer-events: none !important;
}
.dock {
  pointer-events: auto;
  width: min(640px, 100%);
  padding: 14px 18px 12px;
  border-radius: 24px;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: var(--shadow);
  border: 2px solid rgba(255, 255, 255, 0.7);
  animation: rise 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.dock.mine {
  border-color: var(--gold);
  box-shadow: var(--shadow), 0 0 0 5px rgba(233, 185, 63, 0.25);
}
.dock.showing {
  width: auto;
  padding: 10px 22px 10px 12px;
  border-radius: 999px;
}
.dhead {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dhead > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.dhead b {
  display: block;
  font-size: 1.12rem;
}
.dhead span {
  color: #47594f;
  font-size: 0.88rem;
}
.timer {
  text-align: right;
  min-width: 64px;
}
.timer b {
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
}
.timer i {
  display: block;
  height: 5px;
  margin-top: 4px;
  border-radius: 3px;
  background: rgba(31, 53, 45, 0.12);
  overflow: hidden;
}
.timer u {
  display: block;
  height: 100%;
  background: var(--gold);
  transition: width 0.2s linear;
}
.dact {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}
.dact .btn.big {
  flex: 1;
  min-width: 150px;
}
.dact .btn.ghost:last-child {
  margin-left: auto;
}
.waiting {
  flex: 1;
  color: var(--muted);
  font-weight: 600;
}
.waiting::after {
  content: "";
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: dots 1.4s steps(4) infinite;
}
.dfoot {
  margin-top: 9px;
  font-size: 0.76rem;
  color: var(--muted);
}
.mobile-bar {
  display: none;
}

/* ------------------------------------------------------------ auction */
#auction-slot {
  position: absolute;
  left: 300px;
  right: 336px;
  bottom: 190px;
  display: flex;
  justify-content: center;
  pointer-events: none !important;
}
.auction {
  pointer-events: auto;
  width: min(520px, 100%);
  padding: 16px 18px;
  border-top: 8px solid var(--group);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: rise 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.auction header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.auction h2 {
  font-size: 1.35rem;
}
.auction small {
  color: var(--muted);
}
.aclock {
  text-align: right;
}
.aclock b {
  display: block;
  font-size: 1.5rem;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}
.bill {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.bill span {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(31, 53, 45, 0.06);
  font-size: 0.74rem;
  color: #47594f;
}
.bill b {
  display: block;
  font-size: 1.1rem;
  color: var(--ink);
}
.bill b.hi {
  color: #b9831c;
  font-size: 1.3rem;
}
.lead {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
}
.lead .face {
  width: 36px;
  height: 36px;
}
.bidrow {
  display: flex;
  gap: 6px;
}
.bidrow input {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 1.1rem;
}
.whos {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.8rem;
  color: #47594f;
}
.whos .gone {
  color: var(--muted);
  text-decoration: line-through;
}
.bids {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
}
.bids li {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(31, 53, 45, 0.06);
}
.bids b {
  margin-left: 5px;
  color: var(--ink);
}

/* ------------------------------------------------------------ banner, floaters, toast */
#banner {
  position: fixed;
  top: 88px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-14px) scale(0.96);
  transition: opacity 0.25s, transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.4);
  z-index: 5;
}
#banner.show {
  opacity: 1;
  transform: none;
}
.banner-card {
  max-width: min(520px, 86vw);
  padding: 12px 26px;
  border-radius: 20px;
  text-align: center;
  background: rgba(22, 45, 38, 0.9);
  color: #fffdf3;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}
.banner-card strong {
  display: block;
  font-size: 1.3rem;
  letter-spacing: 0.5px;
}
.banner-card span {
  font-size: 0.9rem;
  opacity: 0.88;
  line-height: 1.5;
}
.banner-card.good {
  background: rgba(27, 110, 72, 0.93);
}
.banner-card.bad {
  background: rgba(150, 48, 40, 0.93);
}
.banner-card.gold {
  background: linear-gradient(135deg, rgba(196, 140, 28, 0.96), rgba(233, 185, 63, 0.96));
  color: #2b1d00;
}
.floater {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 900;
  font-size: 1.5rem;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 0 12px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  animation: floatUp 1.8s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}
.floater.good {
  color: #9dffb9;
}
.floater.bad {
  color: #ffb1a6;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 210px;
  transform: translate(-50%, 20px);
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(22, 45, 38, 0.92);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
  z-index: 30;
  max-width: 90vw;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ------------------------------------------------------------ chance / chest card */
#card-layer {
  display: grid;
  place-items: center;
  perspective: 1200px;
  z-index: 6;
}
.card3d {
  width: min(330px, 76vw);
  aspect-ratio: 5 / 3.3;
  animation: cardIn 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.card3d.leave {
  animation: cardOut 0.36s ease-in forwards;
}
.card3d .inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: flip 0.7s 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.card3d .back,
.card3d .frontf {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px;
  text-align: center;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
  border: 6px solid #fffdf3;
}
.card3d .back {
  color: #fffdf3;
  background: repeating-linear-gradient(45deg, #ef8a3a, #ef8a3a 14px, #e77d2c 14px, #e77d2c 28px);
}
.card3d.chest .back {
  background: repeating-linear-gradient(45deg, #3d83c4, #3d83c4 14px, #3476b3 14px, #3476b3 28px);
}
.card3d .back i {
  font-style: normal;
  font-size: 4.4rem;
  font-weight: 900;
  line-height: 1;
}
.card3d .back b {
  letter-spacing: 6px;
}
.card3d .frontf {
  transform: rotateY(180deg);
  background: #fffdf3;
}
.card3d .frontf small {
  font-weight: 800;
  letter-spacing: 4px;
  color: #e77d2c;
}
.card3d.chest .frontf small {
  color: #3476b3;
}
.card3d .frontf p {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.45;
}
.card3d .frontf span {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ------------------------------------------------------------ modals */
.backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(12, 36, 44, 0.42);
  backdrop-filter: blur(4px);
  z-index: 20;
  animation: fade 0.2s both;
}
.modal {
  position: relative;
  width: min(480px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
  padding: 28px 26px 24px;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: rise 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
}
.modal.wide {
  width: min(820px, 100%);
}
.modal h2 {
  font-size: 1.45rem;
  padding-right: 40px;
}
.modal .assets {
  max-height: 46vh;
}
.modal .asset {
  box-shadow: inset 0 0 0 1px var(--line);
}
.rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}
.rules section {
  padding: 14px;
  border-radius: 14px;
  background: rgba(37, 106, 82, 0.07);
}
.rules h3 {
  font-size: 1rem;
  margin-bottom: 5px;
}
.rules p {
  font-size: 0.86rem;
  line-height: 1.65;
  color: #47594f;
}
.modal.deed-modal {
  padding: 0;
  width: min(400px, 100%);
}
.deed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 22px;
}
.deed > *:not(.dh) {
  margin: 0 22px;
}
.dh {
  padding: 26px 22px 18px;
  background: var(--group);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  border-radius: 18px 18px 0 0;
}
.dh small {
  font-weight: 700;
  letter-spacing: 3px;
  opacity: 0.92;
}
.dh h2 {
  font-size: 1.8rem;
}
.downer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #47594f;
}
.downer b {
  margin-left: auto;
  color: var(--ink);
}
.downer em {
  font-style: normal;
  font-size: 0.74rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: #5b6470;
  color: #fff;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--ink);
}
.tag .face {
  width: 30px;
  height: 30px;
  box-shadow: 0 0 0 2px var(--player);
}
.rents div {
  display: flex;
  justify-content: space-between;
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 0.92rem;
}
.rents div:nth-child(odd) {
  background: rgba(31, 53, 45, 0.045);
}
.rents div.on {
  background: var(--group);
  color: #fff;
  font-weight: 800;
}
.special {
  line-height: 1.7;
  color: #47594f;
}
.dctl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.dctl .btn {
  padding: 11px 8px;
  font-size: 0.9rem;
}
.reason {
  font-size: 0.82rem;
  color: #a2622a;
}
.tcols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tcols section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(31, 53, 45, 0.05);
  min-width: 0;
}
.tcols h3 {
  font-size: 0.95rem;
}
.tprop {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink);
}
.tprop i {
  width: 6px;
  height: 18px;
  border-radius: 3px;
  background: var(--group);
}
.tprop em {
  font-style: normal;
  font-size: 0.7rem;
  color: var(--muted);
}
.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  border-left: 6px solid var(--group);
  background: #fff;
  font-weight: 700;
  font-size: 0.86rem;
}
.gain {
  color: #1f9a55;
}
.loss {
  color: var(--red);
}
.ohead {
  display: flex;
  align-items: center;
  gap: 12px;
}
.rank {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.rank div {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-radius: 14px;
  background: rgba(31, 53, 45, 0.05);
}
.rank div.win {
  background: linear-gradient(135deg, #f8e3a0, #f3cf6a);
  font-weight: 800;
}
.rank b {
  width: 22px;
  font-size: 1.1rem;
}
.rank span {
  flex: 1;
}
.rank .face {
  width: 38px;
  height: 38px;
}
h2.crown::before {
  content: "♛ ";
  color: var(--gold);
}

/* ------------------------------------------------------------ motion */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.97);
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}
@keyframes dots {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75% {
    content: "...";
  }
}
@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translate(-50%, -20%) scale(0.5);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -70%) scale(1.25);
  }
  30% {
    transform: translate(-50%, -80%) scale(1);
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -190%) scale(1);
  }
}
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(60vh) rotate(-14deg) scale(0.5);
  }
}
@keyframes cardOut {
  to {
    opacity: 0;
    transform: translateY(-30vh) scale(0.7);
  }
}
@keyframes flip {
  to {
    transform: rotateY(180deg);
  }
}

/* ------------------------------------------------------------ phones & narrow windows */
@media (max-width: 979px) {
  :root {
    font-size: 16px;
  }
  .brand small,
  .brand span {
    display: none;
  }
  .brand {
    padding: 6px;
  }
  .top {
    padding-left: 10px;
    padding-right: 10px;
  }
  .top nav .btn {
    padding: 6px 8px;
    font-size: 0.76rem;
  }
  .top nav .chip {
    font-size: 0;
    padding: 6px 4px 6px 8px;
    background: none;
  }
  .players {
    left: 0;
    right: 0;
    top: 62px;
    width: auto;
    flex-direction: row;
    overflow-x: auto;
    padding: 4px 10px 10px;
    scrollbar-width: none;
  }
  .pcard {
    flex: none;
    padding: 6px 10px 6px 6px;
    gap: 7px;
  }
  .pcard.active {
    transform: translateY(3px) scale(1.02);
  }
  .pcard .face {
    width: 36px;
    height: 36px;
  }
  .pmain small,
  .pcash small,
  .dots {
    display: none;
  }
  .pmain strong {
    max-width: 84px;
  }
  .side {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    height: 62vh;
    z-index: 12;
    transform: translateY(110%);
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  }
  .side.open {
    transform: none;
  }
  .dock-slot,
  #auction-slot {
    left: 8px;
    right: 8px;
  }
  .dock {
    padding: 12px 14px 10px;
  }
  .dact .btn.big {
    min-width: 0;
    padding: 14px 16px;
  }
  #auction-slot {
    bottom: 200px;
  }
  .mobile-bar {
    display: block;
    position: absolute;
    right: 10px;
    top: 128px;
    z-index: 13;
  }
  .mobile-bar .btn {
    background: var(--glass);
    box-shadow: 0 4px 14px rgba(15, 50, 60, 0.2);
    font-size: 0.8rem;
    padding: 8px 12px;
  }
  .front {
    align-items: flex-end;
    padding: 0;
  }
  .hero,
  .hero.lobby {
    width: 100%;
    max-height: 62vh;
    border-radius: 26px 26px 0 0;
    padding: 22px 20px calc(18px + env(safe-area-inset-bottom));
    gap: 10px;
  }
  .hero h1 {
    font-size: 1.9rem;
  }
  .hero h1 br {
    display: none;
  }
  .lobby .seats,
  .lobby .cast {
    grid-template-columns: repeat(3, 1fr);
  }
  #banner {
    top: 122px;
  }
  .banner-card strong {
    font-size: 1.1rem;
  }
  .tcols {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
