/* ==========================================================================
   Tenfold — styles
   ========================================================================== */

:root {
  --bg0: #060a17;
  --bg1: #0d1532;
  --bg2: #1c2b62;
  --panel: rgba(255, 255, 255, 0.055);
  --panel-2: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.12);
  --text: #eef1ff;
  --muted: #a5addb;
  --accent: #ffcf5c;
  --accent-2: #8796ff;
  --good: #2fd08f;
  --bad: #ff6b6b;

  --r: #f0473b;
  --b: #2f7ff0;
  --g: #14a874;
  --y: #e9a20f;

  --paper: #fffaf1;
  --paper-2: #f1e8d8;

  --cw-hand: clamp(50px, min(13.6vw, 12.4dvh), 98px);
  --cw-sm: clamp(30px, min(7.4vw, 6.2dvh), 50px);
  --cw-mini: clamp(26px, min(6.6vw, 5.4dvh), 40px);
  --cw-pile: clamp(52px, min(14vw, 11dvh), 96px);

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.25, 1.3, 0.4, 1);

  color-scheme: dark;
  font-family: 'Outfit', ui-rounded, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(103, 125, 255, 0.28), transparent 60%),
    radial-gradient(900px 600px at 100% 110%, rgba(255, 120, 90, 0.12), transparent 60%),
    radial-gradient(900px 600px at 0% 100%, rgba(40, 200, 150, 0.1), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg0));
  background-attachment: fixed;
  overscroll-behavior: none;
}

body[data-screen='game'] {
  overflow: hidden;
  position: fixed;
  inset: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

body.is-dragging,
body.is-dragging * {
  cursor: grabbing !important;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.muted {
  color: var(--muted);
}

.screen-enter {
  animation: fadeUp 0.35s var(--ease-out);
}

/* ------------------------------------------------------------------ buttons */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.1;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 0.12s,
    background 0.15s,
    box-shadow 0.15s,
    opacity 0.15s;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.15);
}
.btn:active {
  transform: scale(0.97);
}
.btn.primary {
  background: linear-gradient(180deg, #ffd978, #f4b22c);
  color: #2b1d00;
  border-color: transparent;
  box-shadow:
    0 6px 18px rgba(244, 178, 44, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.btn.primary:hover {
  background: linear-gradient(180deg, #ffe08f, #f7bb3d);
}
.btn.ghost {
  background: transparent;
}
.btn.ghost:hover {
  background: var(--panel-2);
}
.btn.danger {
  background: rgba(255, 107, 107, 0.14);
  border-color: rgba(255, 107, 107, 0.45);
  color: #ffc0c0;
}
.btn.big {
  width: 100%;
  min-height: 52px;
  font-size: 17px;
  padding: 14px 22px;
  border-radius: 14px;
}
.btn.sm {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 10px;
}
.btn.xs {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12.5px;
  border-radius: 9px;
}
.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.btn.ready {
  animation: readyPulse 1.5s ease-in-out infinite;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  flex: none;
  transition: background 0.15s;
}
.icon-btn:hover {
  background: var(--panel-2);
}
.icon-btn.sm {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 12px;
  color: var(--muted);
}

.burger,
.burger::before,
.burger::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  position: relative;
}
.burger::before,
.burger::after {
  content: '';
  position: absolute;
  left: 0;
}
.burger::before {
  top: -6px;
}
.burger::after {
  top: 6px;
}

.link-btn {
  display: block;
  margin: 14px auto 0;
  padding: 6px 10px;
  border: 0;
  background: none;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover {
  color: var(--text);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tag.gold {
  background: rgba(255, 207, 92, 0.16);
  color: var(--accent);
}

.dots {
  display: inline-flex;
  gap: 3px;
  margin-left: 6px;
  vertical-align: middle;
}
.dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  animation: dot 1.2s infinite ease-in-out;
}
.dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.dots i:nth-child(3) {
  animation-delay: 0.3s;
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035));
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.panel.narrow {
  width: min(400px, 100%);
  padding: 24px;
  text-align: center;
}

.avatar {
  --hue: 230;
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(145deg, hsl(var(--hue) 85% 64%), hsl(var(--hue) 70% 44%));
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  box-shadow:
    inset 0 -2px 0 rgba(0, 0, 0, 0.18),
    0 2px 6px rgba(0, 0, 0, 0.3);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}
.avatar.xs {
  width: 20px;
  height: 20px;
  font-size: 10px;
}
.avatar.ghost {
  background: rgba(255, 255, 255, 0.07);
  box-shadow: none;
}

/* -------------------------------------------------------------------- cards */

.card {
  --cw: var(--cw-hand);
  --ink: #1f2440;
  position: relative;
  flex: none;
  width: var(--cw);
  aspect-ratio: 5 / 7;
  border-radius: calc(var(--cw) * 0.12);
  background: linear-gradient(160deg, var(--paper) 0%, var(--paper-2) 100%);
  color: var(--ink);
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 0 0 1px rgba(0, 0, 0, 0.1),
    0 calc(var(--cw) * 0.04) calc(var(--cw) * 0.1) rgba(0, 0, 0, 0.35);
  transition:
    translate 0.2s var(--ease-out),
    box-shadow 0.2s,
    opacity 0.2s,
    filter 0.2s;
}
.card.sm {
  --cw: var(--cw-sm);
}
.card.mini {
  --cw: var(--cw-mini);
}
.card.pile-card {
  --cw: var(--cw-pile);
}

.c-r {
  --ink: var(--r);
}
.c-b {
  --ink: var(--b);
}
.c-g {
  --ink: var(--g);
}
.c-y {
  --ink: var(--y);
}

.card.num::before {
  content: '';
  position: absolute;
  inset: calc(var(--cw) * 0.055);
  border-radius: calc(var(--cw) * 0.08);
  border: max(1px, calc(var(--cw) * 0.02)) solid var(--ink);
  opacity: 0.32;
}
.card.num::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 46%;
  width: calc(var(--cw) * 0.78);
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--ink) 16%, transparent) 0 60%, transparent 61%);
}

.pip {
  position: absolute;
  inset: 0 0 8% 0;
  z-index: 1;
  display: grid;
  place-items: center;
  font-size: calc(var(--cw) * 0.6);
  font-weight: 900;
  letter-spacing: -0.05em;
  color: var(--ink);
  text-shadow: 0 calc(var(--cw) * 0.02) 0 rgba(0, 0, 0, 0.1);
}
.card.wide .pip {
  font-size: calc(var(--cw) * 0.48);
}
.suit-mark {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 12%;
  translate: -50% 0;
  font-size: calc(var(--cw) * 0.13);
  color: var(--ink);
  opacity: 0.6;
}
.corner {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--cw) * 0.01);
  font-size: calc(var(--cw) * 0.19);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.corner i {
  font-style: normal;
  font-size: 0.6em;
}
.corner.tl {
  top: calc(var(--cw) * 0.085);
  left: calc(var(--cw) * 0.1);
}
.corner.br {
  right: calc(var(--cw) * 0.1);
  bottom: calc(var(--cw) * 0.085);
  rotate: 180deg;
}

.card.sm .corner.br,
.card.mini .corner.br,
.card.sm .suit-mark,
.card.mini .suit-mark,
.card.mini .corner.tl {
  display: none;
}
.card.sm .corner.tl {
  font-size: calc(var(--cw) * 0.24);
  top: calc(var(--cw) * 0.08);
  left: calc(var(--cw) * 0.08);
}
.card.sm .pip,
.card.mini .pip {
  inset: 0;
}

/* Wild */
.card.wild {
  --ink: #fff;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.12), transparent 60%),
    linear-gradient(160deg, #2c3166, #12153a);
  color: #fff;
}
.wild-ring {
  position: absolute;
  left: 50%;
  top: 45%;
  width: calc(var(--cw) * 0.64);
  aspect-ratio: 1;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(from 45deg, var(--r) 0 25%, var(--y) 0 50%, var(--g) 0 75%, var(--b) 0);
  box-shadow: 0 0 calc(var(--cw) * 0.14) rgba(255, 255, 255, 0.22);
}
.wild-star {
  display: grid;
  place-items: center;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #181c45;
  font-size: calc(var(--cw) * 0.28);
  color: #fff;
}
.face-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 9%;
  text-align: center;
  font-size: calc(var(--cw) * 0.12);
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding-left: 0.2em;
}
.card.wild .corner,
.card.skip .corner {
  color: #fff;
  font-size: calc(var(--cw) * 0.15);
  opacity: 0.85;
}
.card.sm .face-label,
.card.mini .face-label,
.card.mini .corner {
  display: none;
}
.card.sm .wild-ring,
.card.mini .wild-ring,
.card.sm .skip-mark,
.card.mini .skip-mark {
  top: 50%;
}
.as-value {
  position: absolute;
  z-index: 3;
  top: calc(var(--cw) * 0.06);
  left: calc(var(--cw) * 0.06);
  padding: 0.1em 0.3em;
  border-radius: 999px;
  background: #fff;
  color: #181c45;
  font-size: calc(var(--cw) * 0.22);
  font-weight: 900;
}
.card.wild:has(.as-value) .corner.tl {
  display: none;
}

/* Skip */
.card.skip {
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 107, 107, 0.18), transparent 60%),
    linear-gradient(160deg, #3b3f5e, #1b1e35);
  color: #fff;
}
.skip-mark {
  position: absolute;
  left: 50%;
  top: 45%;
  width: calc(var(--cw) * 0.52);
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  border: calc(var(--cw) * 0.07) solid #ff6b6b;
  box-shadow: 0 0 calc(var(--cw) * 0.12) rgba(255, 107, 107, 0.4);
}
.skip-mark::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: calc(var(--cw) * 0.07);
  translate: -50% -50%;
  rotate: -45deg;
  border-radius: 99px;
  background: #ff6b6b;
}

/* Back */
.card.back {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.06) 0 4px, transparent 4px 9px),
    radial-gradient(circle at 50% 40%, #4357c9, #1c2570 72%);
  border: calc(var(--cw) * 0.055) solid var(--paper);
}
.back-mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: calc(var(--cw) * 0.32);
  font-weight: 900;
  letter-spacing: -0.04em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}
.back-mark::before {
  content: '';
  position: absolute;
  width: 64%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: max(1.5px, calc(var(--cw) * 0.03)) solid rgba(255, 207, 92, 0.55);
  background: rgba(10, 14, 50, 0.35);
}
.back-mark {
  isolation: isolate;
}
.back-mark::before {
  z-index: -1;
}

.card.empty-slot {
  background: rgba(255, 255, 255, 0.03);
  border: 2px dashed rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

/* Brand fan */
.brand-fan {
  display: flex;
  justify-content: center;
  height: 104px;
  margin-bottom: 10px;
}
.brand-fan .card {
  --cw: 66px;
  margin: 0 -12px;
  animation: float 5s ease-in-out infinite;
}
.brand-fan .card:nth-child(1) {
  rotate: -14deg;
  translate: 0 10px;
}
.brand-fan .card:nth-child(2) {
  z-index: 1;
  animation-delay: -1.6s;
}
.brand-fan .card:nth-child(3) {
  rotate: 14deg;
  translate: 0 10px;
  animation-delay: -3.2s;
}

/* --------------------------------------------------------------------- home */

.center-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.loader {
  text-align: center;
  color: var(--muted);
}

.home {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
}
.home-card {
  width: min(420px, 100%);
  padding: 28px 24px 16px;
}
.brand {
  text-align: center;
}
.logo {
  margin: 0;
  font-size: 46px;
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1;
}
.logo span {
  color: var(--accent);
}
.logo.small {
  font-size: 22px;
}
.tagline {
  margin: 8px auto 22px;
  max-width: 30ch;
  color: var(--muted);
  line-height: 1.4;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.field input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}
.field input:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(135, 150, 255, 0.25);
}
.code-input {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.4em;
  font-weight: 800 !important;
  padding-left: calc(14px + 0.4em) !important;
}
.join-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 14px;
  border-radius: 16px;
  transition: background 0.2s;
}
.join-box.invited {
  padding: 12px;
  background: rgba(135, 150, 255, 0.12);
  border: 1px solid rgba(135, 150, 255, 0.4);
}
.or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.or::before,
.or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.footnote {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  opacity: 0.8;
}

/* -------------------------------------------------------------------- lobby */

.lobby {
  max-width: 540px;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
}
.lobby-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lobby-panel {
  padding: 22px 20px;
}
.invite {
  text-align: center;
  padding-bottom: 18px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.room-code {
  display: block;
  margin: 2px auto 10px;
  padding: 0 0 0 0.2em;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: clamp(44px, 14vw, 64px);
  font-weight: 900;
  letter-spacing: 0.2em;
  cursor: pointer;
  text-shadow: 0 4px 24px rgba(255, 207, 92, 0.3);
}
.invite-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 10px;
  font-size: 16px;
}
.section-title .count {
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}
.seats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.seat {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  animation: fadeUp 0.3s var(--ease-out);
}
.seat.empty {
  background: transparent;
  border: 1px dashed var(--line);
  color: var(--muted);
  opacity: 0.6;
  animation: none;
}
.seat.offline {
  opacity: 0.55;
}
.seat-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.seat-name em {
  color: var(--muted);
  font-style: normal;
  font-weight: 500;
}
.lobby-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  margin-top: 18px;
}
.lobby-actions .btn.big {
  width: auto;
}
.setting {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
}
.setting-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.setting-text span {
  color: var(--muted);
  font-size: 12.5px;
}
.seats + .section-title {
  margin-top: 18px;
}
.hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.waiting {
  margin: 18px 0 0;
  color: var(--muted);
  text-align: center;
}

/* --------------------------------------------------------------------- game */

.game {
  position: relative;
  height: 100dvh;
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas: 'top' 'players' 'table' 'me';
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}

.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 6px;
}
.topbar-mid {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
}
.room-pill,
.hand-pill,
.goal-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.room-pill {
  color: var(--accent);
  letter-spacing: 0.14em;
}
.goal-pill {
  min-width: 0;
  overflow: hidden;
}
.goal-pill b {
  color: var(--text);
}
.goal-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.players-strip {
  grid-area: players;
  position: relative;
  display: flex;
  gap: 8px;
  padding: 4px 10px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.players-strip::-webkit-scrollbar {
  display: none;
}
.players-strip > :first-child {
  margin-left: auto;
}
.players-strip > :last-child {
  margin-right: auto;
}

.pchip {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  transition:
    background 0.3s,
    border-color 0.3s,
    box-shadow 0.3s,
    opacity 0.3s;
}
.pchip.me {
  background: rgba(135, 150, 255, 0.12);
}
.pchip.turn {
  border-color: rgba(255, 207, 92, 0.85);
  background: linear-gradient(90deg, rgba(255, 207, 92, 0.2), rgba(255, 207, 92, 0.06));
  box-shadow:
    0 0 0 3px rgba(255, 207, 92, 0.14),
    0 6px 20px rgba(255, 207, 92, 0.12);
}
.pchip.turn .avatar {
  animation: turnRing 1.6s ease-out infinite;
}
.pchip.offline,
.pchip.out {
  opacity: 0.55;
}
.pinfo {
  min-width: 0;
}
.pname {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 13ch;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.dealer {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: #151a3d;
  font-size: 9px;
  font-weight: 900;
  flex: none;
}
.pmeta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.pstage {
  color: var(--text);
}
.pstage.done {
  color: var(--good);
}
.pscore small {
  margin-left: 2px;
  font-size: 0.85em;
  opacity: 0.7;
}
.mini-back {
  display: inline-block;
  width: 8px;
  height: 11px;
  margin-right: 3px;
  border: 1px solid var(--paper);
  border-radius: 2px;
  background: #3a4bb8;
  vertical-align: -1px;
}
.pskip {
  position: absolute;
  top: -5px;
  left: 22px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bad);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  animation: pop 0.35s var(--ease-spring);
}
.poff {
  position: absolute;
  bottom: -6px;
  left: 50%;
  translate: -50% 0;
  padding: 1px 6px;
  border-radius: 999px;
  background: #2a3157;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Table */
.table {
  grid-area: table;
  min-height: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 0 10px;
}
.piles {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}
.pile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 0;
  border-radius: 16px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s;
}
.pile:hover {
  background: rgba(255, 255, 255, 0.04);
}
.pile-stack {
  position: relative;
  display: grid;
}
.pile-stack > .card {
  grid-area: 1 / 1;
}
.deck .card {
  box-shadow:
    1.5px 1.5px 0 #d8cfbf,
    3px 3px 0 #b5ac9c,
    4.5px 4.5px 0 #8d8676,
    0 10px 20px rgba(0, 0, 0, 0.45);
}
.discard .under {
  rotate: -8deg;
  filter: brightness(0.82);
}
.discard .top {
  rotate: 4deg;
}
.discard .top.arriving {
  opacity: 0;
}
.pile.glow .pile-stack > .card:last-of-type {
  animation: pileGlow 1.6s ease-in-out infinite;
}
.pile.accepting .pile-stack::after,
.pile.drop-ok .pile-stack::after {
  content: '';
  position: absolute;
  inset: -7px;
  border: 2px dashed rgba(255, 207, 92, 0.6);
  border-radius: calc(var(--cw-pile) * 0.16);
  pointer-events: none;
}
.pile.drop-hover .pile-stack::after {
  border-style: solid;
  border-color: var(--accent);
  background: rgba(255, 207, 92, 0.15);
}
.pile.drop-hover .pile-stack {
  scale: 1.06;
  transition: scale 0.15s;
}
.no-take {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2a3157;
  border: 1px solid var(--line);
  color: var(--bad);
  font-size: 11px;
  font-weight: 900;
}
.pile-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pile-label b {
  color: var(--text);
  margin-left: 2px;
}

/* Board */
.board {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(110, 135, 255, 0.16), transparent 70%),
    rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 2px 30px rgba(0, 0, 0, 0.25);
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.board-empty {
  margin: auto;
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  opacity: 0.8;
}
.board-empty p {
  margin: 6px 0 0;
}
.board-empty-art {
  display: flex;
  justify-content: center;
  opacity: 0.5;
}
.board-empty-art .card:first-child {
  rotate: -10deg;
  margin-right: -10px;
}
.board-empty-art .card:last-child {
  rotate: 8deg;
}
.owner-block {
  padding: 7px 8px 8px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.16);
  animation: fadeUp 0.35s var(--ease-out);
}
.owner-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.owner-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.group {
  padding: 6px 8px 8px;
  border: 1.5px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  transition:
    background 0.2s,
    border-color 0.2s,
    scale 0.15s;
}
.group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.group-title .plus {
  color: var(--good);
}
.group-cards {
  display: flex;
}
.group-cards .card + .card {
  margin-left: calc(var(--cw-sm) * -0.5);
}
.group.hittable,
.group.drop-ok {
  border-color: rgba(47, 208, 143, 0.75);
  background: rgba(47, 208, 143, 0.1);
  cursor: pointer;
}
.group.hittable {
  animation: breathe 1.6s ease-in-out infinite;
}
.group.drop-hover {
  border-color: var(--good);
  background: rgba(47, 208, 143, 0.24);
  scale: 1.04;
}

/* My area */
.me {
  grid-area: me;
  position: relative;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
}
.me::before {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  top: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.4s;
}
.game.my-turn .me::before {
  opacity: 0.9;
}

.stage-panel {
  max-width: 860px;
  margin: 0 auto 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}
.stage-panel[hidden] {
  display: none;
}
.stage-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}
.stage-badge {
  flex: none;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: #2b1d00;
  font-size: 12px;
  font-weight: 800;
}
.stage-goal {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.stage-actions {
  display: flex;
  gap: 6px;
  flex: none;
}
.slots {
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
  gap: 8px;
}
.slots.n2 {
  --cols: 2;
}
.slot {
  min-width: 0;
  padding: 5px 7px 6px;
  border: 1.5px dashed rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s,
    scale 0.15s;
}
.slot.armed {
  border-color: var(--accent-2);
  background: rgba(135, 150, 255, 0.09);
}
.slot.valid {
  border-style: solid;
  border-color: var(--good);
  background: rgba(47, 208, 143, 0.1);
}
.slot.invalid {
  border-color: var(--bad);
  background: rgba(255, 107, 107, 0.08);
}
.slot.drop-ok {
  border-color: var(--accent-2);
}
.slot.drop-hover {
  background: rgba(135, 150, 255, 0.22);
  scale: 1.02;
}
.slot-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.slot.valid .slot-count {
  color: var(--good);
}
.slot.invalid .slot-count {
  color: var(--bad);
}
.slot-cards {
  display: flex;
  align-items: center;
  min-height: calc(var(--cw-mini) * 1.4);
  overflow: hidden;
}
.slot-cards .card {
  cursor: grab;
  touch-action: none;
  animation: popIn 0.25s var(--ease-spring);
}
.slot-cards .card + .card {
  margin-left: calc(var(--cw-mini) * -0.28);
}
.slot-hint {
  color: rgba(255, 255, 255, 0.38);
  font-size: 12px;
  line-height: 1.25;
}
.stage-panel.done {
  border-color: rgba(47, 208, 143, 0.4);
  background: rgba(47, 208, 143, 0.08);
}
.stage-done {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  line-height: 1.3;
}
.stage-done b {
  display: block;
  font-size: 14px;
}
.stage-done span {
  color: var(--muted);
}
.stage-done .check {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--good);
  color: #062a1b;
  font-weight: 900;
}

.me-bar {
  max-width: 860px;
  min-height: 36px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
}
.status-line {
  flex: 1 1 180px;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.status-line.mine {
  color: var(--accent);
  font-weight: 700;
}
.status-line.warn {
  color: #ffb3b3;
}
.tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.seg {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}
.seg button {
  min-height: 28px;
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.seg button.on {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
}
.color-dots {
  display: inline-flex;
  gap: 2px;
}
.color-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.color-dots .c-r {
  background: var(--r);
}
.color-dots .c-b {
  background: var(--b);
}
.color-dots .c-g {
  background: var(--g);
}
.color-dots .c-y {
  background: var(--y);
}

/* Hand */
.hand-wrap {
  padding-top: calc(var(--cw-hand) * 0.24);
}
.hand {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: calc(var(--cw-hand) * 1.4);
  border-radius: 14px;
  transition: background 0.2s;
}
.hand > .card + .card {
  margin-left: var(--step, 6px);
}
.hand > .card {
  cursor: grab;
  touch-action: none;
}
.hand > .card.selected {
  translate: 0 calc(var(--cw) * -0.22);
  box-shadow:
    0 0 0 2.5px var(--accent),
    0 0 22px rgba(255, 207, 92, 0.45),
    0 calc(var(--cw) * 0.1) calc(var(--cw) * 0.2) rgba(0, 0, 0, 0.45);
}
.hand > .card.can-hit:not(.selected) {
  box-shadow:
    0 0 0 2px rgba(47, 208, 143, 0.85),
    0 calc(var(--cw) * 0.04) calc(var(--cw) * 0.1) rgba(0, 0, 0, 0.35);
}
.hand > .card.is-new:not(.selected) {
  box-shadow:
    0 0 0 2px var(--accent-2),
    0 0 18px rgba(135, 150, 255, 0.55),
    0 calc(var(--cw) * 0.04) calc(var(--cw) * 0.1) rgba(0, 0, 0, 0.35);
}
@media (hover: hover) and (pointer: fine) {
  .hand > .card:hover {
    translate: 0 calc(var(--cw) * -0.08);
  }
  .hand > .card.selected:hover {
    translate: 0 calc(var(--cw) * -0.25);
  }
}
.hand.is-empty::before {
  content: attr(data-empty);
  align-self: center;
  color: var(--muted);
  font-size: 13px;
}
.hand.drop-hover {
  background: rgba(255, 255, 255, 0.03);
}
.card.drag-src {
  opacity: 0.25;
}
.drag-ghost {
  position: fixed !important;
  z-index: 1000;
  pointer-events: none;
  translate: none !important;
  transition: none !important;
  box-shadow:
    0 0 0 2px var(--accent),
    0 22px 40px rgba(0, 0, 0, 0.55) !important;
}

/* Results / overlays */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(4, 7, 18, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.results-overlay {
  animation: fadeIn 0.35s 0.55s both;
}
#modal {
  display: none;
}
#modal.show {
  display: grid;
  z-index: 700;
  animation: fadeIn 0.18s;
}
#modal.show .sheet {
  animation: sheetIn 0.32s var(--ease-spring);
}
.sheet {
  width: min(480px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, #1c2754, #111836);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  overscroll-behavior: contain;
}
.sheet.enter {
  animation: sheetIn 0.5s 0.6s var(--ease-spring) both;
}
.sheet h2 {
  margin: 0 0 4px;
  font-size: 24px;
  letter-spacing: -0.01em;
}
.sheet h3 {
  margin: 18px 0 8px;
  font-size: 15px;
}
.sheet .muted {
  margin: 0;
}
.results h2,
.results > .muted {
  text-align: center;
}
.trophy {
  font-size: 58px;
  text-align: center;
  animation: pop 0.6s 0.8s var(--ease-spring) both;
}
.res-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0 6px;
  padding: 0;
  list-style: none;
}
.res-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
}
.res-row.me {
  box-shadow: inset 0 0 0 1px rgba(135, 150, 255, 0.5);
}
.res-row.winner {
  background: linear-gradient(90deg, rgba(255, 207, 92, 0.24), rgba(255, 207, 92, 0.05));
  box-shadow: inset 0 0 0 1px rgba(255, 207, 92, 0.5);
}
.rank {
  width: 18px;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}
.res-main {
  flex: 1;
  min-width: 0;
}
.res-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}
.res-stage {
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 600;
}
.res-stage.ok {
  color: var(--good);
}
.res-stage.no {
  color: #ffb3b3;
}
.final .res-stage {
  color: var(--muted);
}
.res-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 6px;
}
.res-cards .card {
  --cw: 24px;
}
.res-pts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: none;
}
.res-pts .plus {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.res-pts .total {
  font-size: 19px;
  font-weight: 800;
}
.res-pts small {
  margin-left: 2px;
  color: var(--muted);
  font-size: 0.6em;
}
.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.sheet-actions .btn {
  flex: 1 1 140px;
}
.sheet-actions .waiting {
  flex: 1 1 100%;
  margin: 4px 0;
}
.peek-bar {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 500;
  translate: -50% 0;
  animation: fadeUp 0.3s var(--ease-out);
}
.peek-bar .btn {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.rules p {
  margin: 0 0 10px;
  color: #d3d8f2;
  font-size: 14.5px;
  line-height: 1.5;
}
.rules b {
  color: var(--text);
}
.stage-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.stage-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 13.5px;
}
.stage-list span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #2b1d00;
  font-size: 12px;
  font-weight: 900;
  flex: none;
}
.menu-list,
.skip-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.skip-target {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
  text-align: left;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.skip-target:hover {
  border-color: var(--bad);
  background: rgba(255, 107, 107, 0.12);
}
.skip-target small {
  display: block;
  color: var(--muted);
}

/* Toasts, connection banner, FX */
#toasts {
  position: fixed;
  left: 50%;
  top: calc(10px + env(safe-area-inset-top));
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: min(92vw, 440px);
  translate: -50% 0;
  pointer-events: none;
}
.toast {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(22, 28, 62, 0.94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  animation: toastIn 0.3s var(--ease-spring);
  transition:
    opacity 0.3s,
    translate 0.3s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.toast.success {
  border-color: rgba(47, 208, 143, 0.6);
}
.toast.error {
  border-color: rgba(255, 107, 107, 0.65);
}
.toast.warn {
  border-color: rgba(255, 207, 92, 0.6);
}
.toast.out {
  opacity: 0;
  translate: 0 -8px;
}
#conn {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 950;
  padding: 8px 16px;
  border-radius: 999px;
  background: #4a1f2a;
  border: 1px solid rgba(255, 107, 107, 0.5);
  color: #ffd0d0;
  font-size: 13px;
  font-weight: 700;
  translate: -50% 160%;
  opacity: 0;
  transition:
    translate 0.3s var(--ease-out),
    opacity 0.3s;
  pointer-events: none;
}
#conn.show {
  translate: -50% 0;
  opacity: 1;
}
#fx {
  position: fixed;
  inset: 0;
  z-index: 800;
  overflow: hidden;
  pointer-events: none;
}
.flying {
  position: absolute !important;
  left: 0;
  top: 0;
  rotate: none !important;
  will-change: transform;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.5) !important;
}
.spark {
  position: absolute;
  left: 0;
  top: 0;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}
.confetti {
  position: absolute;
  top: -20px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  animation: fall linear forwards;
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 700px) {
  .goal-pill {
    display: none;
  }
}

@media (max-width: 420px) {
  .topbar {
    gap: 6px;
  }
  .pchip {
    gap: 6px;
    padding-right: 9px;
  }
  .avatar {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }
  .pname {
    max-width: 9ch;
    font-size: 12.5px;
  }
  .pmeta {
    gap: 6px;
    font-size: 11px;
  }
  .stage-goal {
    display: none;
  }
  .stage-head {
    justify-content: space-between;
  }
  .table {
    gap: 8px;
  }
}

@media (max-width: 560px) {
  .overlay {
    align-items: end;
    padding: 0;
  }
  .sheet {
    width: 100%;
    max-height: 92dvh;
    border-radius: 24px 24px 0 0;
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
  }
}

@media (min-width: 900px) and (min-height: 680px) {
  .topbar {
    padding: 12px 18px 8px;
  }
  .players-strip {
    padding: 4px 18px 12px;
    gap: 10px;
  }
  .table {
    padding: 0 18px;
    gap: 16px;
  }
  .piles {
    gap: 14px;
    padding: 0 6px;
  }
  .board {
    padding: 14px;
    gap: 12px;
  }
  .me {
    padding: 10px 18px calc(12px + env(safe-area-inset-bottom));
  }
  .pchip {
    padding: 6px 14px 6px 6px;
  }
  .avatar {
    width: 38px;
    height: 38px;
  }
  .pname {
    font-size: 14px;
  }
  .pmeta {
    font-size: 12px;
  }
  .owner-groups {
    gap: 10px;
  }
}

/* Short landscape screens (phones turned sideways) */
@media (max-height: 540px) and (orientation: landscape) {
  :root {
    --cw-hand: clamp(44px, 14dvh, 70px);
    --cw-sm: clamp(26px, 8dvh, 40px);
    --cw-mini: clamp(22px, 6.5dvh, 32px);
    --cw-pile: clamp(44px, 13dvh, 66px);
  }
  .game {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: 'top players' 'table table' 'me me';
  }
  .topbar {
    padding: 6px 4px 4px 10px;
  }
  .topbar-mid {
    display: none;
  }
  .players-strip {
    padding: 6px 10px 6px;
  }
  .pchip {
    padding-top: 3px;
    padding-bottom: 3px;
  }
  .avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  .piles {
    flex-direction: row;
    align-items: center;
  }
  .pile-label {
    display: none;
  }
  .me {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr);
    grid-template-areas: 'stage bar' 'stage hand';
    column-gap: 12px;
    align-items: end;
    padding-top: 4px;
  }
  .stage-panel {
    grid-area: stage;
    align-self: stretch;
    margin: 0;
    padding: 6px;
  }
  .stage-goal {
    display: none;
  }
  .slots {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 4px;
  }
  .me-bar {
    grid-area: bar;
    width: 100%;
    min-height: 30px;
  }
  .hand-wrap {
    grid-area: hand;
    padding-top: calc(var(--cw-hand) * 0.2);
  }
}

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

/* --------------------------------------------------------------- keyframes */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
@keyframes sheetIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.97);
  }
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
  }
}
@keyframes pop {
  from {
    transform: scale(0.3);
    opacity: 0;
  }
}
@keyframes popIn {
  from {
    transform: scale(0.7);
    opacity: 0;
  }
}
@keyframes float {
  50% {
    transform: translateY(-6px);
  }
}
@keyframes dot {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}
@keyframes turnRing {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 207, 92, 0.7);
  }
  100% {
    box-shadow: 0 0 0 10px rgba(255, 207, 92, 0);
  }
}
@keyframes pileGlow {
  0%,
  100% {
    box-shadow:
      0 0 0 2px rgba(255, 207, 92, 0.9),
      0 0 14px rgba(255, 207, 92, 0.35),
      0 10px 20px rgba(0, 0, 0, 0.45);
  }
  50% {
    box-shadow:
      0 0 0 3px rgba(255, 207, 92, 1),
      0 0 28px rgba(255, 207, 92, 0.6),
      0 10px 20px rgba(0, 0, 0, 0.45);
  }
}
@keyframes breathe {
  50% {
    box-shadow: 0 0 0 4px rgba(47, 208, 143, 0.15);
  }
}
@keyframes readyPulse {
  50% {
    box-shadow:
      0 0 0 5px rgba(255, 207, 92, 0.25),
      0 6px 18px rgba(244, 178, 44, 0.35);
  }
}
@keyframes fall {
  to {
    transform: translate(var(--drift, 0), 110vh) rotate(760deg);
  }
}
