:root {
  color-scheme: dark;
  --felt: #123f34;
  --felt-dark: #07110f;
  --rail: #6b3f2a;
  --paper: #f5ead6;
  --tile: #fff7e9;
  --tile-edge: #cab88e;
  --ink: #16221f;
  --muted: #aab8ae;
  --panel: #16201d;
  --panel-2: #202b26;
  --line: rgba(255, 255, 255, 0.14);
  --soft-line: rgba(255, 242, 205, 0.1);
  --accent: #d9473f;
  --gold: #d4a84f;
  --green: #35a87b;
  --hud-glass: rgba(28, 42, 34, 0.9);
  --hud-glow: rgba(255, 225, 164, 0.34);
  --wood-shadow: rgba(21, 9, 5, 0.72);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(115deg, rgba(255, 214, 145, 0.07), transparent 24%, transparent 70%, rgba(255, 183, 105, 0.05)),
    linear-gradient(180deg, rgba(255, 229, 172, 0.12), transparent 18%, rgba(0, 0, 0, 0.2) 76%, rgba(0, 0, 0, 0.64)),
    linear-gradient(90deg, rgba(2, 7, 6, 0.5), rgba(2, 7, 6, 0.04) 36%, rgba(2, 7, 6, 0.04) 64%, rgba(2, 7, 6, 0.52)),
    linear-gradient(0deg, rgba(20, 10, 6, 0.32), transparent 31%),
    url("/assets/mahj-club-room-bg-premium.png") center / cover fixed,
    linear-gradient(135deg, #06110f 0%, #101914 52%, #211814 100%);
  color: #f7f2e7;
  overflow: hidden;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
}

body::before {
  z-index: -2;
  background:
    linear-gradient(28deg, transparent 0 41%, rgba(255, 221, 155, 0.045) 42%, transparent 58%),
    linear-gradient(332deg, transparent 0 45%, rgba(255, 193, 113, 0.034) 46%, transparent 62%),
    linear-gradient(100deg, rgba(255, 214, 145, 0.08), transparent 28%, transparent 70%, rgba(255, 196, 112, 0.06)),
    linear-gradient(180deg, rgba(255, 214, 145, 0.055), transparent 23%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.22), transparent 23%, transparent 77%, rgba(0, 0, 0, 0.24));
  mix-blend-mode: soft-light;
}

body::after {
  z-index: -1;
  background:
    repeating-linear-gradient(17deg, rgba(255, 232, 178, 0.012) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(90deg, rgba(255, 232, 178, 0.018) 0 1px, transparent 1px 38px),
    linear-gradient(90deg, rgba(255, 226, 166, 0.02), transparent 12%, transparent 88%, rgba(255, 226, 166, 0.018)),
    linear-gradient(180deg, transparent 0 54%, rgba(0, 0, 0, 0.24) 100%);
  opacity: 0.34;
}

body.is-reduced-motion *,
body.is-reduced-motion *::before,
body.is-reduced-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-duration: 0.01ms !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(248px, 14.2vw, 270px);
  height: 100vh;
  gap: 10px;
  padding: 14px;
}

.table-shell {
  position: relative;
  min-width: 0;
  border: 1px solid rgba(248, 217, 157, 0.24);
  background:
    radial-gradient(ellipse at 50% 22%, rgba(255, 224, 165, 0.065), transparent 31%),
    linear-gradient(115deg, rgba(255, 213, 143, 0.04), transparent 28%, transparent 74%, rgba(255, 183, 105, 0.032)),
    linear-gradient(180deg, rgba(255, 233, 184, 0.064), transparent 15%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.3), transparent 28%),
    linear-gradient(90deg, rgba(255, 225, 164, 0.036), transparent 16%, transparent 84%, rgba(255, 225, 164, 0.03)),
    rgba(7, 17, 15, 0.3);
  box-shadow:
    0 42px 120px rgba(0, 0, 0, 0.66),
    0 0 0 1px rgba(255, 241, 199, 0.035),
    inset 0 1px 0 rgba(255, 241, 199, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.38);
  border-radius: 8px;
  overflow: hidden;
}

.table-shell::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(24deg, transparent 0 42%, rgba(255, 224, 165, 0.038) 43%, transparent 58%),
    linear-gradient(330deg, transparent 0 50%, rgba(255, 193, 113, 0.026) 51%, transparent 68%),
    linear-gradient(102deg, transparent 0 16%, rgba(255, 239, 194, 0.05) 16.4%, transparent 25%),
    linear-gradient(257deg, transparent 0 71%, rgba(255, 205, 137, 0.044) 71.4%, transparent 82%),
    linear-gradient(0deg, rgba(255, 236, 190, 0.055), transparent 29%),
    linear-gradient(180deg, rgba(255, 224, 165, 0.038), transparent 22%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.06), transparent 19%, transparent 81%, rgba(0, 0, 0, 0.08));
  pointer-events: none;
  content: "";
}

.table-shell::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.2), transparent 16%, transparent 84%, rgba(0, 0, 0, 0.22)),
    linear-gradient(180deg, rgba(255, 226, 158, 0.05), transparent 24%, rgba(0, 0, 0, 0.12));
  pointer-events: none;
  content: "";
}

#game-container {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#game-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.table-action-dock {
  position: absolute;
  left: 50%;
  bottom: clamp(132px, 17vh, 174px);
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: min(650px, calc(100% - 34px));
  min-height: 58px;
  padding: 10px;
  border: 1px solid rgba(212, 168, 79, 0.32);
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(255, 231, 178, 0.09), transparent 54%),
    linear-gradient(180deg, rgba(255, 236, 195, 0.065), transparent 52%),
    rgba(8, 18, 16, 0.76);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 236, 180, 0.035),
    inset 0 1px 0 rgba(255, 245, 220, 0.105);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.table-action-dock[hidden] {
  display: none;
}

.table-action-state {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.table-action-state strong,
.table-action-state span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-action-state strong {
  color: #fff6e5;
  font-size: 13px;
}

.table-action-state span {
  color: #d8cba8;
  font-size: 12px;
}

.table-action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

.table-action-buttons button {
  min-height: 34px;
  padding-inline: 12px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

.opponent-draw-ghost {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  width: var(--ghost-w);
  height: var(--ghost-h);
  pointer-events: none;
  transform: translate3d(var(--ghost-x), var(--ghost-y), 0) rotate(var(--ghost-rotate));
  transform-origin: center;
}

.opponent-draw-ghost-card {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(32, 17, 12, 0.72);
  border-radius: 8%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), transparent 38%),
    #e7ddc8;
  box-shadow:
    inset -3px -4px 0 rgba(0, 0, 0, 0.15),
    0 11px 18px rgba(0, 0, 0, 0.24);
  animation: opponent-draw-ghost-card 150ms ease-out forwards;
}

.opponent-draw-ghost-card::before,
.opponent-draw-ghost-card::after {
  position: absolute;
  border-radius: 10%;
  content: "";
}

.opponent-draw-ghost-card::before {
  inset: 17%;
  background: rgba(22, 79, 67, 0.96);
}

.opponent-draw-ghost-card::after {
  inset: 28%;
  border: max(1px, calc(var(--ghost-w) * 0.045)) solid rgba(212, 168, 79, 0.7);
  background: transparent;
}

.discard-flight {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 7;
  width: var(--flight-w);
  height: var(--flight-h);
  pointer-events: none;
  transform: translate3d(var(--from-x), var(--from-y), 0) scale(0.78) rotate(var(--from-rotate));
  transform-origin: center;
  animation: discard-flight-move 240ms cubic-bezier(0.2, 0.76, 0.18, 1) forwards;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.36));
}

.discard-flight-card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: discard-flight-flip 240ms cubic-bezier(0.26, 0.74, 0.26, 1) forwards;
}

.discard-flight-front,
.discard-flight-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
}

.discard-flight-front.tile-chip {
  grid-template-rows: 12% minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 8%;
  border-radius: 8%;
  box-shadow:
    inset 0 -7px 0 rgba(95, 89, 77, 0.12),
    0 0 0 3px rgba(212, 168, 79, 0.24);
}

.discard-flight-front .tile-chip-index {
  font-size: max(4px, calc(var(--flight-w) * 0.11));
}

.discard-flight-front .tile-chip-glyph-face {
  width: 68%;
  height: 72%;
}

.discard-flight-back {
  border: 1px solid rgba(32, 17, 12, 0.72);
  border-radius: 8%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), transparent 38%),
    repeating-linear-gradient(90deg, rgba(212, 168, 79, 0.14) 0 4px, transparent 4px 9px),
    #4d2d1e;
  box-shadow:
    inset -4px -5px 0 rgba(0, 0, 0, 0.2),
    inset 4px 4px 0 rgba(255, 255, 255, 0.06);
  transform: rotateY(180deg);
}

.win-celebration-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  overflow: hidden;
  pointer-events: none;
}

.win-celebration-overlay::before {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at var(--winner-x) var(--winner-y), rgba(255, 232, 168, 0.22), transparent 18%),
    radial-gradient(ellipse at 50% 36%, rgba(255, 232, 168, 0.13), transparent 34%),
    linear-gradient(180deg, rgba(255, 236, 195, 0.06), transparent 42%, rgba(0, 0, 0, 0.08));
  animation: win-overlay-fade 1850ms ease-out forwards;
  content: "";
}

.win-banner {
  position: absolute;
  left: 50%;
  top: clamp(50px, 14vh, 138px);
  display: grid;
  min-width: min(520px, calc(100% - 42px));
  max-width: min(620px, calc(100% - 34px));
  padding: 13px 18px 14px;
  border: 1px solid rgba(255, 232, 168, 0.5);
  border-radius: 10px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 246, 216, 0.18), transparent 62%),
    linear-gradient(180deg, rgba(60, 44, 27, 0.92), rgba(15, 26, 21, 0.84));
  box-shadow:
    0 24px 54px rgba(0, 0, 0, 0.42),
    0 0 42px rgba(212, 168, 79, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  text-align: center;
  transform: translateX(-50%) translateY(-12px) scale(0.96);
  animation: win-banner-in 1850ms cubic-bezier(0.18, 0.78, 0.18, 1) forwards;
  backdrop-filter: blur(13px);
}

.win-banner strong {
  color: #fff4d4;
  font-size: clamp(30px, 5vw, 56px);
  font-weight: 900;
  line-height: 0.95;
  text-shadow:
    0 2px 0 rgba(82, 47, 25, 0.6),
    0 0 28px rgba(255, 232, 168, 0.42);
}

.win-banner span {
  margin-top: 7px;
  overflow: hidden;
  color: #f2d391;
  font-size: clamp(12px, 1.6vw, 16px);
  font-weight: 800;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.win-score-pop {
  position: absolute;
  z-index: 2;
  min-width: 58px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 232, 168, 0.64);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 246, 216, 0.22), rgba(212, 168, 79, 0.12)),
    rgba(20, 31, 25, 0.82);
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.36),
    0 0 28px rgba(212, 168, 79, 0.3);
  color: #ffe8a8;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  transform: translate(-50%, -50%) scale(0.72);
  animation: win-score-pop 1480ms cubic-bezier(0.18, 0.82, 0.2, 1) 240ms forwards;
}

.win-chip-flight {
  position: absolute;
  left: var(--from-x);
  top: var(--from-y);
  z-index: 1;
  display: grid;
  place-items: center;
  width: 50px;
  height: 24px;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.72) rotate(-7deg);
  animation: win-chip-flight 1180ms cubic-bezier(0.2, 0.75, 0.22, 1) forwards;
  filter: drop-shadow(0 12px 12px rgba(0, 0, 0, 0.34));
}

.win-score-stick {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 18px;
  padding: 0 8px;
  border: 1px solid rgba(255, 239, 188, 0.72);
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(255, 239, 188, 0.8), rgba(212, 168, 79, 0.92), rgba(255, 239, 188, 0.74));
  color: #392817;
  font-size: 11px;
  font-weight: 900;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    inset 0 -2px 0 rgba(84, 48, 24, 0.16);
}

.discard-landing-glow {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  width: var(--landing-w);
  height: var(--landing-h);
  border: 2px solid rgba(242, 208, 126, 0.72);
  border-radius: 9%;
  background: radial-gradient(circle, rgba(242, 208, 126, 0.18), transparent 68%);
  box-shadow:
    0 0 18px rgba(242, 208, 126, 0.34),
    0 10px 18px rgba(0, 0, 0, 0.22);
  pointer-events: none;
  transform: translate3d(var(--landing-x), var(--landing-y), 0) scale(0.86);
  animation: discard-landing-glow 320ms ease-out forwards;
}

.exposure-landing-pulse {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  width: var(--exposure-w);
  height: var(--exposure-h);
  border: 2px solid rgba(242, 208, 126, 0.72);
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(255, 246, 209, 0.14), transparent 58%),
    radial-gradient(circle, rgba(242, 208, 126, 0.18), transparent 70%);
  box-shadow:
    0 0 22px rgba(242, 208, 126, 0.32),
    0 12px 20px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  transform: translate3d(var(--exposure-x), var(--exposure-y), 0) scale(0.92);
  animation: exposure-landing-pulse 340ms ease-out forwards;
}

@keyframes opponent-draw-ghost-card {
  0% {
    opacity: 0;
    transform: translateY(5px) scale(0.76);
  }

  58% {
    opacity: 1;
    transform: translateY(-2px) scale(1.05);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes discard-flight-move {
  0% {
    transform: translate3d(var(--from-x), var(--from-y), 0) scale(0.78) rotate(var(--from-rotate));
  }

  56% {
    transform: translate3d(var(--mid-x), var(--mid-y), 0) scale(0.94) rotate(3deg);
  }

  82% {
    transform: translate3d(var(--to-x), calc(var(--to-y) - 7px), 0) scale(1.04) rotate(0deg);
  }

  100% {
    transform: translate3d(var(--to-x), var(--to-y), 0) scale(1) rotate(0deg);
  }
}

@keyframes discard-flight-flip {
  0%,
  38% {
    transform: rotateY(180deg);
  }

  72%,
  100% {
    transform: rotateY(0deg);
  }
}

@keyframes discard-landing-glow {
  0% {
    opacity: 0;
    transform: translate3d(var(--landing-x), calc(var(--landing-y) - 7px), 0) scale(0.86);
  }

  35% {
    opacity: 1;
    transform: translate3d(var(--landing-x), var(--landing-y), 0) scale(1.08);
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--landing-x), var(--landing-y), 0) scale(1.18);
  }
}

@keyframes win-overlay-fade {
  0% {
    opacity: 0;
  }

  12%,
  72% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes win-banner-in {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-18px) scale(0.92);
  }

  16% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1.02);
  }

  58% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px) scale(0.98);
  }
}

@keyframes win-score-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(8px) scale(0.72);
  }

  18% {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(-14px) scale(1.08);
  }

  68% {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(-22px) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(-32px) scale(0.92);
  }
}

@keyframes win-chip-flight {
  0% {
    left: var(--from-x);
    top: var(--from-y);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72) rotate(-8deg);
  }

  16% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.02) rotate(5deg);
  }

  70% {
    left: var(--to-x);
    top: var(--to-y);
    opacity: 1;
    transform: translate(-50%, -50%) translateY(-11px) scale(1) rotate(0deg);
  }

  86% {
    left: var(--to-x);
    top: var(--to-y);
    opacity: 0.92;
    transform: translate(-50%, -50%) translateY(2px) scale(0.92) rotate(0deg);
  }

  100% {
    left: var(--to-x);
    top: var(--to-y);
    opacity: 0;
    transform: translate(-50%, -50%) translateY(0) scale(0.78) rotate(0deg);
  }
}

@keyframes exposure-landing-pulse {
  0% {
    opacity: 0;
    transform: translate3d(var(--exposure-x), calc(var(--exposure-y) - 6px), 0) scale(0.92);
  }

  34% {
    opacity: 1;
    transform: translate3d(var(--exposure-x), var(--exposure-y), 0) scale(1.04);
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--exposure-x), var(--exposure-y), 0) scale(1.1);
  }
}

.hud {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 4px;
  container-type: inline-size;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(248, 217, 157, 0.2);
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 18% 0%, var(--hud-glow), transparent 32%),
    linear-gradient(118deg, rgba(255, 225, 164, 0.064), transparent 27%),
    linear-gradient(180deg, rgba(255, 238, 198, 0.04), transparent 16%),
    linear-gradient(90deg, rgba(255, 232, 178, 0.03), transparent 22%),
    var(--hud-glass);
  box-shadow:
    -12px 20px 44px rgba(0, 0, 0, 0.2),
    inset 1px 0 0 rgba(255, 232, 178, 0.18),
    inset 0 1px 0 rgba(255, 246, 218, 0.18);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  backdrop-filter: blur(14px) saturate(1.08);
}

.hud::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(255, 232, 178, 0.1), transparent 15%),
    linear-gradient(180deg, rgba(255, 236, 195, 0.06), transparent 24%),
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.1));
  pointer-events: none;
  content: "";
}

.hud::after {
  position: absolute;
  inset: 12px auto 12px 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(212, 168, 79, 0.28), transparent);
  pointer-events: none;
  content: "";
}

.hud-top,
.section-header,
.status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hud-top {
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 5px 3px 7px;
  border: 0;
  border-bottom: 1px solid rgba(255, 242, 205, 0.022);
  border-radius: 8px;
  background:
    linear-gradient(130deg, rgba(255, 236, 195, 0.026), transparent 38%),
    rgba(0, 0, 0, 0.018);
  box-shadow: none;
}

.hud-top > div:first-child {
  min-width: 0;
}

.hud-top .eyebrow {
  color: rgba(234, 223, 203, 0.72);
}

.hud-top h1 {
  color: #fff7e9;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.42);
}

.hud-actions {
  display: grid;
  align-items: center;
  flex: 1 1 100%;
  flex-wrap: wrap;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  justify-content: flex-start;
  gap: 4px;
  min-width: 0;
}

.hud-actions .icon-button {
  min-width: 0;
  overflow: hidden;
  min-height: 25px;
  padding: 4px 4px;
  border-color: rgba(255, 242, 205, 0.16);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 52%),
    linear-gradient(90deg, rgba(212, 168, 79, 0.09), transparent 74%),
    rgba(255, 255, 255, 0.05);
  color: rgba(255, 244, 217, 0.94);
  font-size: 9.5px;
  text-overflow: ellipsis;
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 218, 0.18),
    0 4px 10px rgba(0, 0, 0, 0.16);
}

.hud-actions .icon-button:hover,
.hud-actions .icon-button:focus-visible {
  border-color: rgba(242, 208, 126, 0.54);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 58%),
    rgba(212, 168, 79, 0.13);
  color: #fff7e9;
}

.card-header {
  align-items: flex-start;
}

.card-header-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: start;
}

.card-tools {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 6px;
  max-width: 230px;
}

.card-tools[hidden] {
  display: none;
}

.card-tools select,
.card-tools button {
  min-height: 30px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.status-strip {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr) minmax(70px, 0.8fr) minmax(54px, auto);
  align-items: center;
  justify-content: flex-start;
  min-height: 38px;
  padding: 6px;
  border: 1px solid rgba(255, 242, 205, 0.026);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.016), rgba(255, 255, 255, 0.004)),
    rgba(0, 0, 0, 0.018);
  color: #eadfcb;
  font-size: 12px;
  gap: 5px;
  overflow: hidden;
  white-space: nowrap;
}

.status-strip span {
  min-width: 0;
  overflow: hidden;
  padding: 3px 5px;
  border: 1px solid rgba(255, 242, 205, 0.026);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.008);
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-strip #phase-label {
  grid-column: 1 / -1;
  padding: 0 2px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff7e9;
  font-size: 13px;
  font-weight: 800;
}

.status-strip .timer-label {
  justify-self: stretch;
  white-space: nowrap;
}

.timer-label {
  min-width: 44px;
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  text-align: center;
}

.timer-label.is-warning {
  border-color: rgba(212, 168, 79, 0.55);
  background: rgba(212, 168, 79, 0.14);
  color: #f1d391;
}

.timer-label.is-urgent {
  border-color: rgba(217, 71, 63, 0.7);
  background: rgba(217, 71, 63, 0.18);
  color: #ffcbc8;
}

.status-strip .connection-label {
  justify-self: stretch;
  white-space: nowrap;
}

.connection-label {
  min-width: 72px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #eadfcb;
  text-align: center;
}

.connection-label.is-online {
  border-color: rgba(53, 168, 123, 0.55);
  background: rgba(53, 168, 123, 0.15);
  color: #bcebd8;
}

.connection-label.is-reconnecting {
  border-color: rgba(212, 168, 79, 0.62);
  background: rgba(212, 168, 79, 0.14);
  color: #f1d391;
}

.profile-strip {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-height: 32px;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
}

.profile-strip:hover span,
.profile-strip:focus-visible span {
  border-color: rgba(212, 168, 79, 0.45);
}

.profile-strip span {
  min-width: 0;
  overflow: hidden;
  padding: 7px 8px;
  border: 1px solid rgba(255, 242, 205, 0.04);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.052);
  color: #d8e2d8;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scoreboard {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  min-height: 0;
}

.table-info-panel {
  display: grid;
  flex: 0 0 auto;
  gap: 6px;
}

.table-info-panel > summary.section-header {
  min-height: 34px;
}

.score-seat {
  display: grid;
  grid-template-areas:
    "avatar copy score"
    "rank badges score";
  grid-template-columns: 24px minmax(86px, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 48px;
  padding: 5px 7px;
  border: 1px solid rgba(255, 242, 205, 0.032);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.026), rgba(255, 255, 255, 0.008)),
    rgba(0, 0, 0, 0.038);
  color: #d8e2d8;
}

.score-seat.is-active {
  border-color: rgba(212, 168, 79, 0.72);
  background: rgba(212, 168, 79, 0.105);
}

.score-seat.is-winner {
  border-color: rgba(255, 232, 168, 0.66);
  background:
    radial-gradient(ellipse at 22% 22%, rgba(255, 232, 168, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(212, 168, 79, 0.12), rgba(53, 168, 123, 0.055)),
    rgba(0, 0, 0, 0.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 218, 0.12),
    0 0 20px rgba(212, 168, 79, 0.16);
}

.score-seat.is-leader {
  background: rgba(53, 168, 123, 0.075);
}

.score-seat.is-out {
  color: var(--muted);
}

.score-rank {
  grid-area: rank;
  color: #f1d391;
  font-size: 12px;
  font-weight: 900;
}

.score-avatar {
  display: grid;
  grid-area: avatar;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: #fff7e9;
  font-size: 11px;
  font-weight: 700;
}

.score-copy {
  display: grid;
  grid-area: copy;
  gap: 2px;
  min-width: 0;
}

.score-name {
  min-width: 0;
  overflow: hidden;
  color: #fff6e5;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-detail {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-badges {
  display: flex;
  flex-wrap: wrap;
  grid-area: badges;
  justify-content: flex-start;
  gap: 3px;
  min-width: 0;
  overflow: hidden;
}

.score-badge {
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #eadfcb;
  font-size: 10px;
  line-height: 1;
}

.score-value {
  grid-area: score;
  min-width: 24px;
  color: #fff7e9;
  font-size: 13px;
  text-align: right;
}

.action-panel {
  display: grid;
  flex: 0 0 auto;
  gap: 8px;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(242, 208, 126, 0.058);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(242, 208, 126, 0.038), transparent 34%),
    linear-gradient(180deg, rgba(255, 246, 220, 0.018), transparent 38%),
    rgba(7, 14, 12, 0.03);
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 195, 0.06),
    0 10px 22px rgba(0, 0, 0, 0.07);
  transition:
    max-height 160ms ease,
    opacity 160ms ease;
}

.action-panel > * {
  min-width: 0;
}

.action-panel p {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 242, 205, 0.1);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.08);
  color: #efe5ce;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

body.is-action-panel-docked .hud .action-panel {
  max-height: 48px;
  padding: 6px 7px;
  border-color: rgba(255, 242, 205, 0.042);
  background: rgba(0, 0, 0, 0.024);
  box-shadow: none;
  opacity: 0.3;
  overflow: hidden;
}

@media (min-width: 561px) {
  body.is-action-panel-docked .hud {
    background:
      radial-gradient(ellipse at 18% 0%, rgba(255, 236, 195, 0.09), transparent 33%),
      linear-gradient(118deg, rgba(255, 225, 164, 0.095), transparent 30%),
      linear-gradient(180deg, rgba(255, 247, 224, 0.035), transparent 36%),
      rgba(9, 17, 14, 0.64);
  }

  body.is-action-panel-docked .hud-top {
    padding: 5px 6px;
    border-color: rgba(255, 242, 205, 0.022);
    background:
      linear-gradient(130deg, rgba(255, 236, 195, 0.026), transparent 38%),
      rgba(0, 0, 0, 0.032);
    box-shadow: none;
  }

  body.is-action-panel-docked .hud-actions .icon-button {
    min-height: 24px;
    border-color: rgba(255, 242, 205, 0.1);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 54%),
      rgba(255, 255, 255, 0.034);
    color: rgba(255, 240, 204, 0.94);
  }

  body.is-action-panel-docked .status-strip {
    min-height: 34px;
    border-color: rgba(255, 242, 205, 0.03);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent 58%),
      rgba(0, 0, 0, 0.028);
  }

  body.is-action-panel-docked .status-strip span {
    border-color: rgba(255, 242, 205, 0.018);
    background: rgba(255, 255, 255, 0.006);
  }
}

body.is-action-panel-docked .hud .action-panel > :not(p):not(.player-search-status):not(.table-invite-panel) {
  display: none;
}

body.is-action-panel-docked .hud .action-panel p,
body.is-action-panel-docked .hud .action-panel .player-search-status {
  padding: 4px 7px;
  border-color: rgba(255, 242, 205, 0.055);
  background: transparent;
  color: rgba(214, 203, 181, 0.82);
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.is-action-panel-docked .hud .table-invite-panel {
  padding: 7px;
  border-color: rgba(53, 168, 123, 0.14);
  background: rgba(53, 168, 123, 0.04);
}

.action-panel .player-search-status {
  padding: 8px 10px;
  border: 1px solid rgba(53, 168, 123, 0.28);
  border-radius: 6px;
  background: rgba(53, 168, 123, 0.1);
  color: #e9f7ef;
}

.coach-panel {
  display: grid;
  flex: 0 0 auto;
  gap: 4px;
  padding: 9px;
  border: 1px solid rgba(212, 168, 79, 0.18);
  border-radius: 8px;
  background: rgba(212, 168, 79, 0.058);
}

.coach-panel[hidden] {
  display: none;
}

.coach-panel.is-success {
  border-color: rgba(53, 168, 123, 0.42);
  background: rgba(53, 168, 123, 0.1);
}

.coach-panel.is-warning {
  border-color: rgba(217, 71, 63, 0.42);
  background: rgba(217, 71, 63, 0.1);
}

.coach-kicker {
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.coach-panel strong {
  color: #fff6e5;
  font-size: 13px;
}

.coach-panel p {
  margin: 0;
  color: #eadfcb;
  font-size: 12px;
  line-height: 1.35;
}

.table-invite-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(53, 168, 123, 0.28);
  border-radius: 6px;
  background: rgba(53, 168, 123, 0.065);
}

.table-invite-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.table-invite-copy span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.table-invite-copy strong {
  overflow: hidden;
  color: #fff7e9;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-invite-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.table-invite-actions .small-button {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selected-tiles-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.16);
}

.selected-tiles-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.selected-tiles-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.selected-tiles-list .history-tile {
  justify-self: start;
}

.tile-action-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(212, 168, 79, 0.28);
  border-radius: 6px;
  background: rgba(212, 168, 79, 0.09);
}

.tile-action-panel > button {
  width: 100%;
}

.tile-action-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.tile-action-copy > span {
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.tile-action-copy > strong {
  min-width: 0;
  overflow: hidden;
  color: #fff7e9;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-action-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 4px;
  min-width: 0;
}

.tile-action-list .history-tile {
  justify-self: start;
}

.hand-result-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(212, 168, 79, 0.36);
  border-radius: 6px;
  background: rgba(212, 168, 79, 0.1);
}

.hand-result-panel.is-win {
  border-color: rgba(255, 232, 168, 0.44);
  background:
    radial-gradient(ellipse at 18% 0%, rgba(255, 232, 168, 0.13), transparent 56%),
    linear-gradient(180deg, rgba(212, 168, 79, 0.12), rgba(0, 0, 0, 0.08)),
    rgba(16, 29, 24, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 218, 0.12),
    0 12px 24px rgba(0, 0, 0, 0.16);
}

.hand-result-header {
  display: grid;
  gap: 4px;
}

.hand-result-header span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.hand-result-header strong {
  color: #fff6e5;
  font-size: 16px;
}

.hand-result-header p,
.hand-result-settlement {
  margin: 0;
  color: #d8e2d8;
  font-size: 12px;
  line-height: 1.35;
}

.winning-hand-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-top: 4px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 232, 168, 0.25);
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(212, 168, 79, 0.16), rgba(53, 168, 123, 0.06)),
    rgba(0, 0, 0, 0.1);
}

.winning-hand-summary span {
  color: #ffe8a8;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.winning-hand-summary strong {
  overflow: hidden;
  color: #fff7e9;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.winning-hand-summary em {
  color: #ffe8a8;
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.hand-result-rows {
  display: grid;
  gap: 6px;
}

.hand-result-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.hand-result-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.45fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.14);
}

.hand-result-row span {
  color: var(--muted);
  font-size: 11px;
}

.hand-result-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #fff7e9;
  font-size: 12px;
}

.panel-section {
  padding: 0;
  border: 1px solid rgba(255, 242, 205, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 236, 195, 0.04), transparent 52%),
    rgba(255, 255, 255, 0.02);
  min-height: 0;
  overflow: hidden;
}

.panel-section > summary.section-header {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto 10px;
  align-items: center;
  justify-content: stretch;
  min-height: 35px;
  padding: 7px 8px;
  cursor: pointer;
  gap: 8px;
  list-style: none;
  color: #f7ecd2;
  opacity: 1;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.panel-section > summary.section-header::-webkit-details-marker {
  display: none;
}

.panel-section > summary.section-header::before {
  grid-column: 1;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(212, 168, 79, 0.48);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 236, 195, 0.16), rgba(212, 168, 79, 0.045)),
    rgba(0, 0, 0, 0.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 218, 0.24),
    0 4px 9px rgba(0, 0, 0, 0.14);
  content: "";
}

.panel-section > summary.section-header::after {
  grid-column: 4;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(242, 208, 126, 0.78);
  border-bottom: 2px solid rgba(242, 208, 126, 0.78);
  content: "";
  transform: rotate(-45deg);
  transition: transform 150ms ease;
}

.panel-section > summary.section-header .eyebrow {
  grid-column: 2;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: rgba(255, 244, 217, 0.9);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-section > summary.section-header > .event-count,
.panel-section > summary.section-header > .small-button,
.panel-section > summary.section-header > .review-tools,
.panel-section > summary.section-header > .card-header-actions {
  grid-column: 3;
}

.table-info-panel > summary.section-header::before {
  background:
    linear-gradient(90deg, transparent 35%, rgba(212, 168, 79, 0.64) 35% 44%, transparent 44%),
    linear-gradient(180deg, rgba(255, 236, 195, 0.15), rgba(0, 0, 0, 0.11));
}

.public-table-panel > summary.section-header::before {
  background:
    repeating-linear-gradient(90deg, rgba(53, 168, 123, 0.72) 0 2px, transparent 2px 5px),
    rgba(0, 0, 0, 0.12);
}

.chat-panel > summary.section-header::before {
  border-radius: 999px;
}

.review-panel > summary.section-header::before {
  background:
    repeating-linear-gradient(180deg, rgba(212, 168, 79, 0.72) 0 2px, transparent 2px 5px),
    rgba(0, 0, 0, 0.12);
}

.recommendations-panel > summary.section-header::before {
  background:
    linear-gradient(135deg, transparent 0 38%, rgba(53, 168, 123, 0.74) 38% 52%, transparent 52%),
    linear-gradient(45deg, transparent 0 38%, rgba(53, 168, 123, 0.74) 38% 52%, transparent 52%),
    rgba(0, 0, 0, 0.12);
}

.card-panel > summary.section-header::before {
  background:
    linear-gradient(90deg, rgba(212, 168, 79, 0.66) 0 3px, transparent 3px),
    linear-gradient(180deg, rgba(255, 236, 195, 0.15), rgba(0, 0, 0, 0.12));
}

.panel-section[open] > summary.section-header::after {
  transform: rotate(45deg);
}

.panel-section[open] {
  padding-bottom: 7px;
  border-color: rgba(242, 208, 126, 0.065);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.012), rgba(255, 255, 255, 0.003)),
    rgba(0, 0, 0, 0.034);
}

.panel-section:not([open]) {
  border-color: rgba(242, 208, 126, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 246, 218, 0.036), rgba(0, 0, 0, 0.018) 72%),
    linear-gradient(90deg, rgba(242, 208, 126, 0.038), transparent 46%),
    rgba(19, 32, 27, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 218, 0.11),
    inset 0 -1px 0 rgba(0, 0, 0, 0.32),
    0 6px 12px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 236, 195, 0.025);
  opacity: 1;
}

.panel-section:not([open]) > summary.section-header {
  min-height: 30px;
  padding: 5px 9px;
  background:
    linear-gradient(180deg, rgba(255, 246, 218, 0.032), transparent 70%),
    rgba(255, 255, 255, 0.006);
  color: #f6ecd3;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18);
}

.panel-section:not([open]) > summary.section-header::before {
  border-color: rgba(255, 224, 145, 0.44);
  background:
    linear-gradient(180deg, rgba(255, 231, 160, 0.13), rgba(212, 168, 79, 0.07)),
    rgba(15, 27, 23, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 218, 0.14),
    0 0 0 1px rgba(255, 236, 195, 0.028),
    0 4px 9px rgba(0, 0, 0, 0.2);
}

.panel-section:not([open]) > summary.section-header::after {
  border-color: rgba(255, 224, 145, 0.76);
}

.panel-section:not([open]) > summary.section-header .eyebrow {
  color: #f9efd3;
  font-weight: 800;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.42);
}

.panel-section:not([open]) > summary.section-header > .event-count,
.panel-section:not([open]) > summary.section-header > .small-button,
.panel-section:not([open]) > summary.section-header > .review-tools,
.panel-section:not([open]) > summary.section-header > .card-header-actions {
  color: #f3e6c5;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.34);
}

.panel-section:not([open]):hover,
.panel-section:not([open]):focus-within {
  border-color: rgba(255, 226, 150, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 246, 218, 0.05), rgba(0, 0, 0, 0.014) 72%),
    linear-gradient(90deg, rgba(242, 208, 126, 0.06), transparent 48%),
    rgba(24, 39, 33, 0.94);
  opacity: 1;
}

.panel-section > summary.section-header:focus-visible {
  outline: 2px solid rgba(242, 208, 126, 0.62);
  outline-offset: -2px;
}

body.is-action-panel-docked .hud .panel-section:not([open]) {
  border-color: rgba(242, 208, 126, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 246, 218, 0.034), rgba(0, 0, 0, 0.016) 72%),
    linear-gradient(90deg, rgba(242, 208, 126, 0.034), transparent 48%),
    rgba(18, 31, 26, 0.92);
  opacity: 1;
}

.panel-section > :not(summary) {
  margin-inline: 12px;
}

.public-table-panel {
  display: block;
  flex: 0 0 auto;
  max-height: 164px;
  overflow: hidden;
}

.recommendations-panel {
  flex: 0 0 auto;
  max-height: 172px;
  overflow: auto;
}

.review-panel {
  flex: 0 0 auto;
  max-height: 132px;
  overflow: auto;
}

.chat-panel {
  display: block;
  flex: 0 0 auto;
  max-height: 132px;
  overflow: hidden;
}

.chat-panel .section-header {
  min-width: 0;
}

.card-panel {
  flex: 0 0 auto;
  min-height: 40px;
  overflow: auto;
}

.card-panel[open] {
  flex: 1 1 auto;
}

.recommendations,
.event-log,
.card-hands,
.open-tables {
  display: grid;
  gap: 8px;
}

.discard-history,
.exposure-history {
  display: grid;
  gap: 6px;
  min-height: 0;
  overflow: auto;
}

.discard-history {
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  max-height: 58px;
}

.exposure-history {
  max-height: 54px;
}

.open-tables {
  max-height: 420px;
  overflow: auto;
}

.recommendation,
.event-row,
.card-hand,
.open-table {
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.095);
}

.recommendation {
  display: grid;
  gap: 6px;
}

.recommendation.is-followed {
  border-color: rgba(53, 168, 123, 0.42);
  background: rgba(53, 168, 123, 0.11);
}

.recommendation-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.recommendation-copy {
  min-width: 0;
}

.recommendation-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.recommendation-badge {
  display: inline-grid;
  place-items: center;
  margin-left: 4px;
  padding: 2px 5px;
  border: 1px solid rgba(53, 168, 123, 0.36);
  border-radius: 999px;
  color: #9fe3bf;
  font-size: 9px;
  line-height: 1;
  vertical-align: 1px;
}

.discard-history-row,
.exposure-history-row,
.public-history-empty {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid rgba(255, 255, 255, 0.042);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.052);
}

.discard-history-row {
  display: grid;
  grid-template-columns: auto minmax(28px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.discard-history-row.is-latest-claim {
  border-color: rgba(242, 208, 126, 0.66);
  background: rgba(212, 168, 79, 0.13);
  box-shadow: inset 0 0 0 1px rgba(242, 208, 126, 0.16);
}

.discard-history-row.is-arriving {
  opacity: 0.72;
}

.discard-history-row.is-latest-claim .history-tile {
  box-shadow:
    0 0 0 2px rgba(242, 208, 126, 0.28),
    0 8px 14px rgba(0, 0, 0, 0.22);
}

.exposure-history-row {
  display: grid;
  grid-template-columns: minmax(80px, 0.45fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.history-order,
.history-source,
.public-history-empty {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.history-source {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-tile {
  justify-self: center;
}

.exposure-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.tile-chip {
  position: relative;
  display: grid;
  grid-template-rows: 8px minmax(28px, 1fr);
  width: 40px;
  min-width: 40px;
  height: 53px;
  padding: 4px;
  border: 1px solid rgba(202, 184, 142, 0.9);
  border-radius: 5px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.58), transparent 28%),
    radial-gradient(ellipse at 38% 16%, rgba(255, 255, 255, 0.62), transparent 30%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.28), transparent 18%, transparent 82%, rgba(104, 74, 43, 0.1)),
    linear-gradient(180deg, #fffef9 0%, #f9ecd4 64%, #e5c797 100%);
  box-shadow:
    inset -5px -8px 0 rgba(141, 108, 67, 0.25),
    inset 4px 0 0 rgba(255, 255, 255, 0.18),
    inset 2px 2px 0 rgba(255, 255, 255, 0.42),
    inset 0 0 0 2px rgba(255, 245, 220, 0.36),
    0 8px 14px rgba(0, 0, 0, 0.22);
  color: #15221e;
  line-height: 1;
  overflow: hidden;
}

.tile-chip::before,
.tile-chip::after {
  position: absolute;
  pointer-events: none;
  content: "";
}

.tile-chip::before {
  inset: auto 7% 4% 10%;
  height: 10%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(99, 70, 42, 0.18), rgba(255, 255, 255, 0.12) 42%, rgba(99, 70, 42, 0.24));
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.18);
}

.tile-chip::after {
  inset: 6% 10% auto 13%;
  height: 9%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.08));
}

.tile-chip-index {
  align-self: start;
  color: rgba(95, 89, 77, 0.2);
  font-size: 3.5px;
  font-weight: 700;
  line-height: 1;
  text-align: left;
}

.tile-chip-face {
  display: grid;
  place-items: center;
  min-width: 0;
  color: #15221e;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  overflow-wrap: anywhere;
  text-align: center;
}

.tile-chip-dot,
.tile-chip-dragon-white {
  color: #276aa8;
}

.tile-chip-bam,
.tile-chip-dragon-green {
  color: #1f7a4b;
}

.tile-chip-crak,
.tile-chip-dragon-red,
.tile-chip-joker {
  color: #b52b26;
}

.tile-chip-flower {
  color: #9a4770;
}

.tile-chip-glyph-face {
  width: 30px;
  height: 37px;
  justify-self: center;
  align-self: center;
}

.tile-glyph-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.card-hand {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 54px;
}

.card-hand.is-winning-hand {
  border-color: rgba(255, 232, 168, 0.48);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255, 232, 168, 0.13), transparent 58%),
    linear-gradient(90deg, rgba(212, 168, 79, 0.12), rgba(53, 168, 123, 0.045)),
    rgba(255, 255, 255, 0.03);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 218, 0.12),
    0 0 18px rgba(212, 168, 79, 0.12);
}

.card-hand-copy {
  min-width: 0;
}

.event-row {
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 8px;
}

.event-count,
.event-row span {
  color: var(--muted);
  font-size: 12px;
}

.review-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.recommendation strong,
.event-row strong,
.card-hand strong {
  display: block;
  margin-bottom: 3px;
  color: #fff6e5;
  font-size: 13px;
}

.event-row strong {
  margin-bottom: 0;
  font-weight: 600;
}

.recommendation span,
.card-hand span,
.open-table span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.card-hand-copy strong,
.card-hand-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-hand-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.card-hand-chips span {
  padding: 4px 6px;
  border: 1px solid rgba(212, 168, 79, 0.28);
  border-radius: 999px;
  color: #f1d391;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.card-hand-chips .winning-hand-chip {
  border-color: rgba(255, 232, 168, 0.55);
  background: rgba(212, 168, 79, 0.14);
  color: #ffe8a8;
}

.chat-log {
  display: grid;
  gap: 6px;
  max-height: 84px;
  overflow: auto;
}

.chat-row,
.chat-empty {
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.15);
}

.chat-row {
  display: grid;
  gap: 3px;
}

.chat-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.chat-row strong {
  overflow: hidden;
  color: #fff6e5;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-row span,
.chat-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.chat-report {
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.chat-report:disabled {
  cursor: default;
  opacity: 0.6;
}

.chat-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.chat-entry input {
  min-height: 30px;
}

.primary-button,
.secondary-button,
.small-button,
.icon-button {
  min-height: 36px;
  border: 1px solid rgba(255, 242, 205, 0.08);
  border-radius: 6px;
  padding: 8px 12px;
  color: #fff9ed;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 48%),
    #31423c;
  box-shadow: inset 0 1px 0 rgba(255, 246, 218, 0.05);
}

.primary-button {
  border-color: rgba(255, 231, 180, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 48%),
    var(--accent);
  color: white;
  font-weight: 700;
}

.secondary-button:hover,
.small-button:hover,
.icon-button:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.primary-button:disabled,
.secondary-button:disabled,
.small-button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.small-button,
.icon-button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
  white-space: nowrap;
}

.start-panel {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 10, 9, 0.62);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.start-panel.hidden {
  display: none;
}

.start-content {
  display: grid;
  gap: 12px;
  width: min(420px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(22, 32, 29, 0.98);
  box-shadow: var(--shadow);
}

.entry-tools {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.name-label {
  color: var(--muted);
  font-size: 12px;
}

.current-table-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(212, 168, 79, 0.38);
  border-radius: 6px;
  background: rgba(212, 168, 79, 0.1);
}

.current-table-panel[hidden] {
  display: none;
}

.entry-invite-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(53, 168, 123, 0.4);
  border-radius: 6px;
  background: rgba(53, 168, 123, 0.1);
}

.entry-invite-panel[hidden] {
  display: none;
}

.practice-progress-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(53, 168, 123, 0.36);
  border-radius: 6px;
  background: rgba(53, 168, 123, 0.1);
}

.practice-progress-panel[hidden] {
  display: none;
}

.practice-progress-panel strong,
.practice-progress-panel span,
.entry-invite-panel strong,
.entry-invite-panel span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.practice-progress-panel strong {
  color: #fff6e5;
  font-size: 13px;
}

.practice-progress-panel span,
.entry-invite-panel span {
  color: var(--muted);
  font-size: 12px;
}

.entry-invite-panel strong {
  color: #fff6e5;
  font-size: 13px;
}

.current-table-panel strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #fff6e5;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-table-share,
.current-table-fill {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  margin-top: 8px;
}

.current-table-fill {
  grid-template-columns: minmax(0, 1fr) auto;
}

.current-table-share span,
.current-table-fill span {
  display: grid;
  place-items: center start;
  min-width: 0;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.16);
  color: #fff7e9;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.current-table-fill span {
  color: var(--muted);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

.current-table-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.entry-invite-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.current-table-actions button {
  min-height: 32px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 8px 10px;
  background: #101a17;
  color: #fff7e9;
}

textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.35;
}

.start-actions,
.join-row,
.custom-card-entry {
  display: grid;
  gap: 8px;
}

.start-actions {
  grid-template-columns: repeat(2, 1fr);
}

.start-actions .primary-button {
  grid-column: 1 / -1;
}

.entry-card-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.entry-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.entry-preview-item {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.entry-preview-kicker {
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.entry-preview strong {
  min-width: 0;
  overflow: hidden;
  color: #fff6e5;
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#entry-card-detail,
#entry-pace-detail,
#entry-level-detail {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.join-row {
  grid-template-columns: 1fr auto;
}

.advanced-room-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.12);
}

.advanced-room-panel[open] {
  gap: 12px;
}

.advanced-room-panel:not([open]) > :not(summary) {
  display: none;
}

.advanced-room-panel summary {
  min-height: 34px;
  cursor: pointer;
  color: #eadfcb;
  font-size: 13px;
  font-weight: 700;
  list-style-position: inside;
}

.advanced-room-panel summary::marker {
  color: var(--gold);
}

.account-panel {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.12);
}

.account-panel summary {
  min-height: 30px;
  cursor: pointer;
  color: #eadfcb;
  font-size: 13px;
  font-weight: 700;
  list-style-position: inside;
}

.account-panel summary::marker {
  color: var(--gold);
}

.account-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  padding-top: 8px;
}

.account-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 8px;
}

.danger-button {
  border-color: rgba(217, 71, 63, 0.55);
  color: #ffd8d3;
}

.advanced-room-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.custom-card-entry {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.custom-card-entry button {
  min-width: 116px;
}

.custom-card-actions {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
}

.custom-card-preview {
  display: grid;
  gap: 6px;
  min-height: 38px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.14);
}

.custom-card-preview strong {
  color: #fff6e5;
  font-size: 12px;
  line-height: 1.25;
}

.custom-card-preview.is-ready {
  border-color: rgba(47, 125, 107, 0.6);
}

.custom-card-preview.is-error {
  border-color: rgba(217, 71, 63, 0.7);
}

.custom-card-preview.is-error strong {
  color: #ffb4ae;
}

.custom-card-preview.is-empty span,
.custom-card-more {
  color: var(--muted);
  font-size: 12px;
}

.custom-card-preview-row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 8px;
  align-items: baseline;
}

.custom-card-preview-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-card-preview-row span:first-child {
  color: #eadfcb;
  font-weight: 700;
}

.lobby-summary {
  display: grid;
  gap: 3px;
  min-height: 48px;
  padding: 9px 10px;
  border: 1px solid rgba(212, 168, 79, 0.28);
  border-radius: 6px;
  background: rgba(212, 168, 79, 0.08);
}

.lobby-summary span:first-child {
  color: #fff6e5;
  font-size: 13px;
  font-weight: 700;
}

.lobby-summary span:last-child {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.lobby-summary .small-button {
  justify-self: start;
  margin-top: 2px;
}

.lobby-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 6px;
}

.lobby-filter {
  min-width: 0;
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 6px 7px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.14);
  color: #d8e2d8;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-filter.is-active {
  border-color: rgba(212, 168, 79, 0.72);
  background: rgba(212, 168, 79, 0.14);
  color: #fff6e5;
}

.open-table {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px auto;
  align-items: center;
  gap: 12px;
  min-height: 106px;
  padding: 10px;
  overflow: hidden;
  border-color: rgba(255, 242, 205, 0.09);
  background:
    radial-gradient(ellipse at 76% 18%, rgba(212, 168, 79, 0.09), transparent 34%),
    linear-gradient(126deg, rgba(255, 247, 233, 0.045), transparent 38%),
    rgba(0, 0, 0, 0.12);
  text-align: left;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.open-table::before {
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(53, 168, 123, 0.04), transparent 36%);
  pointer-events: none;
  content: "";
}

.open-table.is-entry-match {
  border-color: rgba(53, 168, 123, 0.58);
  background:
    radial-gradient(ellipse at 76% 18%, rgba(53, 168, 123, 0.16), transparent 34%),
    linear-gradient(126deg, rgba(255, 247, 233, 0.05), transparent 38%),
    rgba(0, 0, 0, 0.12);
}

.open-table[data-momentum="active"] {
  border-color: rgba(53, 168, 123, 0.46);
}

.open-table:where(:hover, :focus-visible):not(:disabled) {
  border-color: rgba(212, 168, 79, 0.58);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(212, 168, 79, 0.1);
  transform: translateY(-1px);
}

.open-table-body {
  position: relative;
  z-index: 1;
  display: block;
  min-width: 0;
}

.open-table-title-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.open-table strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #fff6e5;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.open-table-code {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  color: #eadfcb;
  font-size: 10px;
  line-height: 1;
}

.open-table-meta {
  display: block;
  margin-top: 3px;
}

.open-table-activity {
  display: block;
  min-width: 0;
  margin-top: 3px;
  overflow: hidden;
  color: #c7d7cb;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.open-table-preview {
  position: relative;
  z-index: 1;
  display: block;
  width: 116px;
  height: 70px;
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.25));
}

.open-table-mini-felt {
  position: absolute;
  z-index: 1;
  inset: 11px 14px 9px;
  border: 2px solid rgba(120, 78, 45, 0.92);
  border-radius: 9px;
  background:
    linear-gradient(90deg, transparent 48%, rgba(255, 242, 205, 0.09) 49%, transparent 51%),
    linear-gradient(0deg, transparent 48%, rgba(255, 242, 205, 0.09) 49%, transparent 51%),
    #0c5a47;
  box-shadow:
    inset 0 0 0 2px rgba(212, 168, 79, 0.18),
    inset 0 -8px 14px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(32, 17, 12, 0.68);
  transform: perspective(80px) rotateX(10deg);
}

.open-table-mini-rack {
  position: absolute;
  z-index: 2;
  border: 1px solid rgba(55, 27, 16, 0.9);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(255, 222, 158, 0.3), transparent 48%),
    linear-gradient(90deg, #7a482f, #3d2317 52%, #8b5636);
  box-shadow:
    0 5px 9px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 228, 174, 0.18);
}

.open-table-mini-rack::before {
  position: absolute;
  inset: 1px;
  border-radius: 3px;
  background:
    repeating-linear-gradient(90deg, #efe8d7 0 5px, #0f6b53 5px 8px, #efe8d7 8px 9px);
  box-shadow: inset 0 -2px 2px rgba(0, 0, 0, 0.18);
  content: "";
}

.open-table-mini-rack[data-seat-index="0"],
.open-table-mini-rack[data-seat-index="2"] {
  left: 37px;
  width: 42px;
  height: 8px;
}

.open-table-mini-rack[data-seat-index="0"] {
  bottom: 8px;
}

.open-table-mini-rack[data-seat-index="2"] {
  top: 8px;
}

.open-table-mini-rack[data-seat-index="1"],
.open-table-mini-rack[data-seat-index="3"] {
  top: 24px;
  width: 8px;
  height: 34px;
}

.open-table-mini-rack[data-seat-index="1"] {
  right: 10px;
}

.open-table-mini-rack[data-seat-index="3"] {
  left: 10px;
}

.open-table-mini-rack[data-seat-index="1"]::before,
.open-table-mini-rack[data-seat-index="3"]::before {
  background:
    repeating-linear-gradient(0deg, #efe8d7 0 5px, #0f6b53 5px 8px, #efe8d7 8px 9px);
}

.open-table-mini-discard {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 15px;
  height: 19px;
  border: 1px solid rgba(70, 44, 24, 0.5);
  border-radius: 3px;
  background:
    radial-gradient(circle at 50% 42%, rgba(39, 106, 168, 0.58) 0 2px, transparent 3px),
    radial-gradient(circle at 42% 56%, rgba(181, 43, 38, 0.52) 0 2px, transparent 3px),
    linear-gradient(180deg, #fff8ea, #eadcc1);
  box-shadow:
    0 5px 8px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transform: translate(-50%, -50%) rotate(-4deg);
}

.open-table-mini-discard[data-momentum="active"] {
  box-shadow:
    0 0 0 3px rgba(53, 168, 123, 0.16),
    0 5px 8px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.open-table-mini-felt::before,
.open-table-mini-felt::after {
  position: absolute;
  left: 14px;
  right: 14px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 247, 233, 0.76);
  box-shadow:
    10px 0 0 rgba(255, 247, 233, 0.55),
    20px 0 0 rgba(255, 247, 233, 0.45);
  content: "";
}

.open-table-mini-felt::before {
  top: 4px;
}

.open-table-mini-felt::after {
  bottom: 4px;
}

.open-seat-strip {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: block;
  pointer-events: none;
}

.open-seat-dot {
  position: absolute;
  display: grid;
  place-items: center;
  width: 25px;
  height: 23px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #fff7e9;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  box-shadow:
    0 5px 10px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.open-seat-dot[data-seat-index="0"] {
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
}

.open-seat-dot[data-seat-index="1"] {
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
}

.open-seat-dot[data-seat-index="2"] {
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

.open-seat-dot[data-seat-index="3"] {
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
}

.open-table-join {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 68px;
  min-height: 42px;
  place-items: center;
  padding: 6px 10px;
  border: 1px solid rgba(255, 242, 205, 0.12);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 247, 233, 0.08), transparent 58%),
    rgba(53, 168, 123, 0.16);
  color: #fff7e9;
  text-align: center;
  font-weight: 700;
  line-height: 1.05;
}

.open-table-join small {
  display: block;
  max-width: 54px;
  overflow: hidden;
  color: rgba(234, 223, 203, 0.72);
  font-size: 8px;
  font-weight: 700;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.open-table-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  max-height: 42px;
  overflow: hidden;
}

.open-table-chip {
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(212, 168, 79, 0.1);
  color: #eadfcb;
  font-size: 10px;
  line-height: 1;
}

.open-table-chip.is-match {
  background: rgba(53, 168, 123, 0.24);
  color: #d9fff0;
  font-weight: 800;
}

.open-table-empty {
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.15);
  color: var(--muted);
  font-size: 12px;
}

.teacher-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.teacher-hand-select {
  min-height: 36px;
}

.replay-panel,
.share-panel,
.install-panel,
.settings-panel,
.progress-panel,
.card-guide-panel {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 10, 9, 0.58);
  backdrop-filter: blur(5px);
  z-index: 12;
}

.replay-panel[hidden],
.share-panel[hidden],
.install-panel[hidden],
.settings-panel[hidden],
.progress-panel[hidden],
.card-guide-panel[hidden] {
  display: none;
}

.replay-sheet,
.share-sheet,
.install-sheet,
.settings-sheet,
.progress-sheet,
.card-guide-sheet {
  display: grid;
  gap: 12px;
  width: min(520px, 100%);
  max-height: min(680px, calc(100vh - 36px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(22, 32, 29, 0.98);
  box-shadow: var(--shadow);
}

.replay-sheet h2,
.share-sheet h2,
.install-sheet h2,
.settings-sheet h2,
.progress-sheet h2,
.card-guide-sheet h2 {
  margin: 0;
  color: #fff6e5;
  font-size: 18px;
  letter-spacing: 0;
}

.replay-actions {
  display: grid;
  grid-template-columns: auto auto;
  gap: 6px;
}

.install-detail {
  margin: 0;
  color: #d8e2d8;
  font-size: 13px;
  line-height: 1.4;
}

.install-actions {
  display: flex;
  justify-content: flex-end;
}

.card-guide-sheet {
  width: min(660px, 100%);
}

.progress-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.progress-metric {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.progress-metric span {
  color: var(--muted);
  font-size: 11px;
}

.progress-metric strong {
  overflow: hidden;
  color: #fff6e5;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-card-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.progress-card-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 68px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
}

.progress-meter {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.progress-meter::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold));
  content: "";
}

.progress-card-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.progress-card-copy strong,
.progress-card-copy span,
.progress-card-copy em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-card-copy strong {
  color: #fff6e5;
  font-size: 13px;
}

.progress-card-copy span,
.progress-card-copy em,
.progress-empty {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.progress-tier {
  padding: 5px 7px;
  border: 1px solid rgba(212, 168, 79, 0.34);
  border-radius: 999px;
  color: #f1d391;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.card-guide-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.card-guide-stat,
.card-guide-rule,
.card-guide-hand,
.card-guide-empty {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.card-guide-stat {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px;
}

.card-guide-stat span {
  color: var(--muted);
  font-size: 11px;
}

.card-guide-stat strong {
  overflow: hidden;
  color: #fff6e5;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-guide-rules,
.card-guide-key,
.card-guide-hands {
  display: grid;
  gap: 8px;
}

.card-guide-search {
  display: grid;
  gap: 6px;
}

.card-guide-search span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.card-guide-search input {
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font: inherit;
}

.card-guide-key {
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
}

.card-guide-key-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  min-height: 56px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
}

.card-guide-key-item.has-multiple-tiles {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.card-guide-key-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.card-guide-key-tiles .history-tile {
  justify-self: start;
}

.card-guide-key-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.card-guide-key-copy strong,
.card-guide-key-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-guide-key-copy strong {
  color: #fff6e5;
  font-size: 12px;
}

.card-guide-key-copy span {
  color: var(--muted);
  font-size: 11px;
}

.card-guide-hands {
  max-height: 330px;
  overflow: auto;
}

.card-guide-rule {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  min-height: 36px;
  padding: 8px 10px;
}

.card-guide-rule span {
  color: var(--gold);
  font-weight: 900;
}

.card-guide-rule strong {
  color: #eadfcb;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.card-guide-hand {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: start;
  min-height: 62px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.14);
}

.card-guide-hand.is-followed {
  border-color: rgba(53, 168, 123, 0.42);
  background: rgba(53, 168, 123, 0.1);
}

.card-guide-hand-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.card-guide-hand-copy strong,
.card-guide-hand-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-guide-hand-copy strong {
  color: #fff6e5;
  font-size: 13px;
}

.card-guide-hand-copy span,
.card-guide-empty {
  color: var(--muted);
  font-size: 12px;
}

.card-guide-hand-shape {
  display: flex;
  max-width: 100%;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.card-guide-hand-shape[hidden] {
  display: none;
}

.card-guide-shape-group {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  min-width: 116px;
  max-width: 176px;
  padding: 4px 6px;
  border: 1px solid rgba(212, 168, 79, 0.24);
  border-radius: 7px;
  background: rgba(255, 247, 233, 0.07);
}

.card-guide-shape-group.is-natural {
  border-color: rgba(217, 71, 63, 0.32);
}

.card-guide-shape-group strong {
  color: var(--gold);
  font-size: 10px;
}

.card-guide-shape-group em {
  display: grid;
  place-items: center;
  width: 22px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  background: #fff7e9;
  color: #15221e;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.card-guide-shape-tile {
  width: 30px;
  min-width: 30px;
  height: 40px;
  padding: 3px;
  grid-template-rows: 7px minmax(20px, 1fr);
}

.card-guide-shape-tile .tile-chip-index {
  font-size: 4px;
}

.card-guide-shape-tile .tile-chip-face {
  font-size: 8px;
}

.card-guide-shape-group b {
  overflow: hidden;
  color: #eadfcb;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-guide-hand-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.card-guide-hand-chips span {
  padding: 4px 6px;
  border: 1px solid rgba(212, 168, 79, 0.28);
  border-radius: 999px;
  color: #f1d391;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.card-guide-hand-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.card-guide-follow-label {
  display: inline-grid;
  place-items: center;
  min-height: 30px;
  padding: 4px 7px;
  border: 1px solid rgba(53, 168, 123, 0.36);
  border-radius: 999px;
  color: #9fe3bf;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.card-guide-empty {
  padding: 10px;
}

.settings-options {
  display: grid;
  gap: 8px;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.settings-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.settings-row strong {
  color: #fff6e5;
  font-size: 13px;
}

.settings-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.settings-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--gold);
}

.settings-action-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.settings-action-row button {
  align-self: center;
  min-width: 112px;
}

.share-link,
#share-link,
#install-link {
  font-size: 13px;
}

.share-code-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.share-code-row span:first-child {
  padding: 5px 8px;
  border: 1px solid rgba(212, 168, 79, 0.4);
  border-radius: 6px;
  color: #fff6e5;
  font-size: 12px;
  font-weight: 800;
}

.share-code-row span:last-child {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.replay-events {
  display: grid;
  gap: 7px;
  overflow: auto;
  padding-right: 2px;
}

.replay-row {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.16);
}

.replay-row span {
  color: var(--muted);
  font-size: 12px;
}

.replay-row strong {
  color: #fff6e5;
  font-size: 13px;
  font-weight: 600;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(24px);
  max-width: min(420px, calc(100vw - 24px));
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff7e9;
  color: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 150ms ease,
    transform 150ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@container (max-width: 380px) {
  .hud-actions .icon-button {
    flex-basis: calc(50% - 4px);
  }

  .score-seat {
    grid-template-columns: 22px minmax(74px, 1fr) auto;
    padding-inline: 7px;
  }

  .score-detail {
    display: none;
  }
}

@media (max-width: 900px) {
  html,
  body {
    overflow: auto;
    overflow-x: hidden;
  }

  body {
    max-width: 100vw;
  }

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(460px, 60vh) auto;
    width: 100%;
    max-width: 100vw;
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
  }

  .hud {
    max-height: none;
    overflow: visible;
    border-color: rgba(248, 217, 157, 0.18);
  }

  .action-panel {
    position: sticky;
    top: 8px;
    z-index: 8;
    padding: 8px;
    border: 1px solid rgba(212, 168, 79, 0.34);
    border-radius: 8px;
    background: rgba(22, 32, 29, 0.96);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
  }

  .recommendations-panel,
  .chat-panel,
  .public-table-panel,
  .card-panel {
    max-height: none;
  }

  .chat-log {
    max-height: 160px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 8px;
    gap: 8px;
    grid-template-rows: minmax(460px, 62vh) auto;
  }

  .table-shell,
  .hud {
    width: 100%;
    max-width: calc(100vw - 16px);
  }

  .table-action-dock {
    right: 8px;
    left: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    grid-template-columns: minmax(82px, 98px) minmax(0, 1fr);
    gap: 6px;
    width: auto;
    max-height: 64px;
    min-height: 0;
    padding: 6px;
    overflow: hidden;
    border-color: rgba(212, 168, 79, 0.38);
    background:
      linear-gradient(180deg, rgba(255, 236, 195, 0.05), transparent 52%),
      rgba(10, 22, 19, 0.92);
    transform: none;
  }

  .table-action-state {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
  }

  .table-action-state strong {
    flex: 0 1 auto;
    max-width: none;
    font-size: 10px;
  }

  .table-action-state span {
    flex: 1 1 auto;
    max-width: none;
    font-size: 10px;
  }

  .table-action-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
    gap: 5px;
  }

  .table-action-buttons button {
    width: 100%;
    min-width: 0;
    min-height: 30px;
    padding-inline: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
  }

  .win-banner {
    top: 20px;
    min-width: min(330px, calc(100% - 32px));
    padding: 9px 12px 10px;
  }

  .win-banner strong {
    font-size: clamp(26px, 9vw, 36px);
  }

  .win-banner span {
    margin-top: 5px;
    font-size: 10px;
  }

  .win-score-pop {
    min-width: 48px;
    padding: 6px 9px;
    font-size: 14px;
  }

  .win-chip-flight {
    width: 42px;
    height: 20px;
  }

  .win-score-stick {
    min-width: 34px;
    height: 16px;
    padding-inline: 6px;
    font-size: 9px;
  }

  .hud {
    gap: 0;
    padding: 3px;
    border-radius: 8px 8px 0 0;
    border-color: rgba(248, 217, 157, 0.052);
    background:
      radial-gradient(ellipse at 19% 0%, rgba(255, 229, 174, 0.052), transparent 45%),
      radial-gradient(ellipse at 88% 8%, rgba(212, 168, 79, 0.026), transparent 38%),
      radial-gradient(ellipse at 50% 120%, rgba(142, 86, 49, 0.024), transparent 59%),
      linear-gradient(112deg, rgba(134, 78, 45, 0.03), transparent 54%),
      linear-gradient(180deg, rgba(255, 239, 204, 0.034), rgba(255, 236, 195, 0.006) 43%, transparent 100%),
      linear-gradient(90deg, rgba(115, 68, 41, 0.014), transparent 26%, transparent 74%, rgba(115, 68, 41, 0.012)),
      rgba(82, 70, 48, 0.012);
    box-shadow:
      inset 0 1px 0 rgba(255, 246, 218, 0.036),
      inset 0 -1px 0 rgba(0, 0, 0, 0.008),
      0 -1px 6px rgba(0, 0, 0, 0.01),
      0 -1px 5px rgba(212, 168, 79, 0.012);
    backdrop-filter: blur(6px) saturate(1.03);
  }

  .hud::before {
    background:
      linear-gradient(180deg, rgba(255, 236, 195, 0.022), transparent 31%),
      linear-gradient(105deg, rgba(212, 168, 79, 0.014), transparent 41%),
      linear-gradient(275deg, rgba(126, 76, 43, 0.014), transparent 58%),
      repeating-linear-gradient(0deg, rgba(255, 236, 195, 0.004) 0 1px, transparent 1px 34px);
    opacity: 0.24;
  }

  .hud::after {
    inset: 0 10px auto;
    width: auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(242, 208, 126, 0.1), transparent);
  }

  .table-info-panel {
    max-height: 48vh;
    overflow-y: auto;
    scrollbar-gutter: stable;
  }

  .table-info-panel:not([open]) {
    max-height: none;
    overflow: visible;
  }

  .table-info-panel > summary.section-header {
    min-height: 34px;
    padding-block: 5px;
  }

  .hud-top {
    align-items: center;
    padding: 1px 1px 2px;
    border-bottom-color: rgba(255, 242, 205, 0.014);
    background:
      radial-gradient(ellipse at 15% 0%, rgba(255, 236, 195, 0.018), transparent 56%),
      linear-gradient(180deg, rgba(255, 236, 195, 0.01), transparent 82%),
      linear-gradient(90deg, rgba(212, 168, 79, 0.006), transparent 68%),
      linear-gradient(115deg, rgba(115, 68, 41, 0.014), transparent 53%),
      rgba(55, 44, 31, 0.004);
  }

  .hud-top .eyebrow {
    margin-bottom: 1px;
    color: rgba(255, 244, 217, 0.76);
    font-size: 9.5px;
    font-weight: 650;
  }

  .hud-top h1 {
    font-size: 15.5px;
    line-height: 1.05;
  }

  .hud-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    flex: 1 1 100%;
    gap: 3px;
  }

  .hud-actions .icon-button {
    flex-basis: auto;
    min-height: 20px;
    padding-inline: 3px;
    border-color: rgba(255, 242, 205, 0.066);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 55%),
      linear-gradient(90deg, rgba(212, 168, 79, 0.022), transparent 74%),
      rgba(255, 255, 255, 0.016);
    font-size: 9px;
    box-shadow:
      inset 0 1px 0 rgba(255, 246, 218, 0.07),
      0 1px 4px rgba(0, 0, 0, 0.055);
  }

  .hud-actions .icon-button:hover,
  .hud-actions .icon-button:focus-visible {
    border-color: rgba(242, 208, 126, 0.42);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.115), transparent 58%),
      rgba(212, 168, 79, 0.082);
  }

  .status-strip {
    display: grid;
    grid-template-columns: minmax(58px, 1.12fr) minmax(54px, 0.88fr) minmax(58px, 1fr) minmax(34px, 0.58fr) minmax(34px, 0.58fr) minmax(54px, 0.9fr);
    align-items: center;
    min-height: 20px;
    padding: 1px 4px;
    gap: 3px;
    overflow: hidden;
    white-space: nowrap;
    border-color: rgba(255, 242, 205, 0.026);
    background:
      radial-gradient(ellipse at 14% 50%, rgba(255, 236, 195, 0.016), transparent 55%),
      linear-gradient(180deg, rgba(255, 236, 195, 0.008), transparent 72%),
      linear-gradient(90deg, rgba(212, 168, 79, 0.006), transparent 66%),
      rgba(48, 41, 29, 0.022);
  }

  .status-strip span {
    min-width: 0;
    overflow: hidden;
    overflow-wrap: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 8.5px;
  }

  .status-strip #phase-label {
    grid-column: auto;
    padding: 2px 4px;
    border: 1px solid rgba(255, 242, 205, 0.052);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.014);
    font-size: 9px;
    font-weight: 700;
  }

  .status-strip .connection-label,
  .status-strip .timer-label {
    justify-self: auto;
    min-width: 0;
    padding-inline: 5px;
  }

  .action-panel {
    display: none;
    order: -1;
    gap: 6px;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
  }

  body.is-hand-complete .action-panel {
    display: grid;
    order: 0;
    max-height: none;
    overflow: visible;
  }

  body.is-hand-complete.is-action-panel-docked .hud .action-panel {
    max-height: none;
    padding: 7px;
    border-color: rgba(255, 232, 168, 0.16);
    background:
      radial-gradient(ellipse at 18% 0%, rgba(255, 232, 168, 0.06), transparent 56%),
      rgba(7, 14, 12, 0.18);
    box-shadow:
      inset 0 1px 0 rgba(255, 236, 195, 0.06),
      0 10px 20px rgba(0, 0, 0, 0.08);
    opacity: 1;
    overflow: visible;
  }

  body.is-hand-complete.is-action-panel-docked .hud .action-panel > .hand-result-panel {
    display: grid;
  }

  .panel-section > summary.section-header {
    min-height: 31px;
    padding: 5px 7px;
  }

  .panel-section:not([open]) {
    border-color: rgba(242, 208, 126, 0.048);
    background:
      radial-gradient(ellipse at 8% 50%, rgba(242, 208, 126, 0.018), transparent 48%),
      radial-gradient(ellipse at 100% 0%, rgba(255, 236, 195, 0.009), transparent 44%),
      linear-gradient(180deg, rgba(255, 246, 218, 0.014), rgba(255, 229, 174, 0.003) 42%, transparent 78%),
      linear-gradient(90deg, rgba(212, 168, 79, 0.008), transparent 56%),
      linear-gradient(115deg, rgba(119, 72, 44, 0.018), transparent 52%),
      rgba(42, 43, 32, 0.034);
    box-shadow:
      inset 0 1px 0 rgba(255, 246, 218, 0.02),
      inset 0 -1px 0 rgba(0, 0, 0, 0.012),
      0 1px 2px rgba(0, 0, 0, 0.008);
    opacity: 1;
  }

  body.is-action-panel-docked .hud .panel-section:not([open]) {
    border-color: rgba(242, 208, 126, 0.048);
    background:
      radial-gradient(ellipse at 8% 50%, rgba(242, 208, 126, 0.016), transparent 48%),
      radial-gradient(ellipse at 100% 0%, rgba(255, 236, 195, 0.008), transparent 44%),
      linear-gradient(180deg, rgba(255, 246, 218, 0.013), rgba(255, 229, 174, 0.003) 42%, transparent 78%),
      linear-gradient(90deg, rgba(212, 168, 79, 0.007), transparent 56%),
      linear-gradient(115deg, rgba(119, 72, 44, 0.017), transparent 52%),
      rgba(42, 43, 32, 0.032);
    opacity: 1;
  }

  .panel-section:not([open]) > summary.section-header {
    min-height: 27px;
    padding-block: 1px;
    background:
      linear-gradient(180deg, rgba(255, 246, 218, 0.013), transparent 76%),
      linear-gradient(90deg, rgba(242, 208, 126, 0.008), transparent 69%),
      rgba(255, 255, 255, 0.001);
    opacity: 1;
  }

  .panel-section:not([open]) > summary.section-header .eyebrow {
    font-size: 10.5px;
    font-weight: 760;
  }

  .panel-section:not([open]) > summary.section-header > .event-count,
  .panel-section:not([open]) > summary.section-header > .small-button,
  .panel-section:not([open]) > summary.section-header > .review-tools,
  .panel-section:not([open]) > summary.section-header > .card-header-actions {
    font-size: 10.5px;
  }

  .panel-section:not([open]) > summary.section-header > .small-button {
    min-height: 26px;
    padding: 3px 8px;
    font-size: 11px;
  }

  .panel-section > summary.section-header::before {
    width: 16px;
    height: 16px;
    border-color: rgba(212, 168, 79, 0.22);
    background:
      linear-gradient(180deg, rgba(255, 236, 195, 0.056), rgba(212, 168, 79, 0.016)),
      rgba(0, 0, 0, 0.018);
    box-shadow:
      inset 0 1px 0 rgba(255, 246, 218, 0.072),
      0 1px 3px rgba(0, 0, 0, 0.045);
  }

  .panel-section:not([open]) > summary.section-header::before {
    border-color: rgba(255, 224, 145, 0.19);
    background:
      linear-gradient(180deg, rgba(255, 231, 160, 0.046), rgba(212, 168, 79, 0.018)),
      rgba(15, 27, 23, 0.19);
    box-shadow:
      inset 0 1px 0 rgba(255, 246, 218, 0.046),
      0 1px 3px rgba(0, 0, 0, 0.045);
  }

  .panel-section > summary.section-header::after {
    border-color: rgba(242, 208, 126, 0.58);
  }

  .panel-section > :not(summary) {
    margin-inline: 9px;
  }

  body.is-teacher-table .action-panel {
    display: grid;
    position: relative;
    top: auto;
    z-index: 1;
    order: 0;
    max-height: none;
    overflow: visible;
    padding: 7px;
    border-color: rgba(212, 168, 79, 0.18);
    background:
      linear-gradient(180deg, rgba(255, 236, 195, 0.045), transparent 62%),
      rgba(8, 17, 15, 0.72);
    box-shadow:
      inset 0 1px 0 rgba(255, 246, 218, 0.06),
      0 8px 18px rgba(0, 0, 0, 0.16);
  }

  body.is-teacher-table .action-panel > :not(.teacher-controls):not(p):not(.player-search-status) {
    display: none;
  }

  body.is-teacher-table .teacher-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  body.is-teacher-table .teacher-controls > button {
    min-width: 0;
    min-height: 30px;
    padding-inline: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
  }

  body.is-teacher-table .teacher-hand-select {
    grid-column: 1 / -1;
    min-height: 32px;
    font-size: 12px;
  }

  .tile-action-panel > button {
    order: -1;
    width: 100%;
  }

  h1 {
    font-size: 20px;
  }

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

  .start-actions .primary-button {
    grid-column: auto;
  }

  .entry-preview {
    grid-template-columns: 1fr;
  }

  .progress-summary,
  .progress-card-row,
  .card-guide-summary,
  .recommendation-header,
  .card-hand,
  .card-guide-hand,
  .tile-action-panel,
  .exposure-history-row {
    grid-template-columns: 1fr;
  }

  .entry-card-row,
  .card-header-actions {
    grid-template-columns: 1fr;
  }

  .card-guide-hand-chips {
    justify-content: flex-start;
  }

  .card-guide-hand-actions {
    justify-content: flex-start;
  }

  .recommendation-actions {
    justify-content: flex-start;
  }

  .card-hand-chips {
    justify-content: flex-start;
  }

  .advanced-room-actions {
    grid-template-columns: 1fr;
  }

  .custom-card-entry {
    grid-template-columns: 1fr;
  }

  .custom-card-actions {
    grid-template-columns: 1fr;
  }

  .custom-card-preview-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .account-entry {
    grid-template-columns: 1fr;
  }

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

  .current-table-panel,
  .entry-invite-panel,
  .practice-progress-panel,
  .current-table-share,
  .current-table-fill,
  .current-table-actions,
  .entry-invite-actions,
  .table-invite-panel,
  .table-invite-actions,
  .replay-actions,
  .hand-result-actions,
  .selected-tiles-panel {
    grid-template-columns: 1fr;
  }

  .profile-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scoreboard {
    grid-template-columns: minmax(0, 1fr);
  }

  .open-table {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto 72px;
    align-items: start;
    row-gap: 10px;
    min-height: 214px;
    padding-bottom: 12px;
  }

  .open-table-body {
    grid-column: 1;
    grid-row: 1;
    padding-right: 6px;
  }

  .open-table-preview {
    position: relative;
    right: auto;
    bottom: auto;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
    width: min(146px, 44vw);
    height: 66px;
    margin: 0;
  }

  .open-table-mini-felt {
    inset: 9px 14px 7px;
  }

  .open-seat-dot {
    width: 22px;
    height: 20px;
    font-size: 8px;
  }

  .open-table-join {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    min-width: 72px;
  }

  .open-table-join small {
    max-width: 48px;
  }

  .open-table-chips {
    max-width: none;
    max-height: none;
  }
}
