:root {
  --bg: #efe6d6;
  --surface: rgba(255, 250, 241, 0.86);
  --ink: #23180f;
  --muted: #6d5848;
  --accent: #0d5c4d;
  --gold: #d5a64d;
  --danger: #9a3f36;
  --line: rgba(35, 24, 15, 0.12);
  --shadow: 0 22px 50px rgba(63, 39, 19, 0.16);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.55), transparent 32%),
    linear-gradient(140deg, #f5e8d2 0%, #d9c0a2 45%, #e8d8c7 100%);
}

body.modal-open {
  overflow: hidden;
  height: 100dvh;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.board-shell {
  display: none;
}

body.view-lobby .lobby-panel {
  display: block;
}

body.view-lobby .board-shell {
  display: none;
}

body.view-game .lobby-panel {
  display: none;
}

body.view-game .board-shell {
  display: block;
}

.topbar,
.scoreboard-card,
.sidebar-card,
.felt,
.setup-card {
  backdrop-filter: blur(12px);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 20px 24px;
  border-radius: var(--radius);
}

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

h1,
h2,
.felt-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.pill,
.turn-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.toggle-chip input {
  accent-color: var(--accent);
}

.board-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(280px, 0.8fr);
  gap: 20px;
  margin-top: 20px;
}

.lobby-panel {
  display: block;
  margin-top: 22px;
}

.lobby-hero,
.game-card {
  backdrop-filter: blur(12px);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: var(--shadow);
}

.lobby-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 24px;
  padding: 32px;
  border-radius: 32px;
  overflow: hidden;
  animation: lobby-breathe 9s ease-in-out infinite;
}

.lobby-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 255, 255, 0.28), transparent 26%),
    radial-gradient(circle at 78% 18%, rgba(255, 221, 164, 0.22), transparent 24%),
    linear-gradient(135deg, rgba(13, 92, 77, 0.12), rgba(213, 166, 77, 0.14));
  pointer-events: none;
}

.lobby-copy,
.lobby-tableau {
  position: relative;
  z-index: 1;
}

.lobby-copy h2 {
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  line-height: 0.98;
}

.lobby-lead {
  max-width: 58ch;
  margin: 18px 0 0;
  font-size: 1.12rem;
  line-height: 1.65;
  color: #4e3a2b;
}

.lobby-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}

.lobby-actions .primary-button,
.lobby-actions .ghost-button,
.game-card .primary-button,
.game-card .ghost-button {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.lobby-tableau {
  position: relative;
  min-height: 360px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.14), transparent 28%),
    linear-gradient(145deg, #125f51, #0d4c40 62%, #093730);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.lobby-tableau::before {
  content: "";
  position: absolute;
  inset: -12% auto -12% -28%;
  width: 48%;
  background: linear-gradient(90deg, transparent, rgba(255, 245, 214, 0.2), transparent);
  transform: rotate(8deg);
  animation: tableau-sheen 7s linear infinite;
}

.lobby-tableau::after {
  content: "";
  position: absolute;
  inset: auto 7% 9% 7%;
  height: 28%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.26), rgba(0, 0, 0, 0.02) 65%, transparent 74%);
  filter: blur(10px);
}

.barrel {
  position: absolute;
  bottom: 56px;
  width: 128px;
  height: 164px;
  border-radius: 30px;
  background:
    linear-gradient(90deg, #63391d, #8d572c 18%, #b87a3d 50%, #8f592e 82%, #5f351c),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(0, 0, 0, 0.18));
  box-shadow:
    inset 0 0 0 4px rgba(255, 225, 166, 0.18),
    inset 0 20px 20px rgba(255, 255, 255, 0.12),
    0 22px 26px rgba(8, 5, 3, 0.26);
}

.barrel::before,
.barrel::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #cfa453, #7a5620);
  box-shadow: 0 0 0 2px rgba(56, 30, 9, 0.18);
}

.barrel::before {
  top: 26px;
}

.barrel::after {
  bottom: 28px;
}

.barrel-left {
  left: 58px;
  transform: rotate(-8deg);
}

.barrel-right {
  right: 62px;
  width: 110px;
  height: 144px;
  transform: rotate(10deg);
}

.lobby-die {
  position: absolute;
  width: 118px;
  object-fit: contain;
  filter: drop-shadow(0 18px 22px rgba(7, 4, 3, 0.32));
  animation: lobby-float 4.6s ease-in-out infinite;
  transition: transform 220ms ease, filter 220ms ease;
}

.lobby-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(26px);
  opacity: 0.42;
}

.lobby-glow-left {
  top: 24px;
  left: 22px;
  width: 132px;
  height: 132px;
  background: rgba(255, 226, 170, 0.34);
}

.lobby-glow-right {
  right: 36px;
  bottom: 48px;
  width: 172px;
  height: 132px;
  background: rgba(245, 207, 135, 0.26);
}

.table-chip {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.table-chip-live {
  top: 18px;
  right: 20px;
  background: rgba(255, 249, 239, 0.82);
  color: #0d5c4d;
}

.table-chip-premium {
  left: 18px;
  bottom: 16px;
  background: rgba(213, 166, 77, 0.2);
  color: #fff0d3;
}

.lobby-die-a { top: 34px; left: 34px; transform: rotate(-14deg); }
.lobby-die-k { top: 48px; left: 176px; width: 126px; transform: rotate(10deg); animation-delay: -1.2s; }
.lobby-die-q { top: 164px; left: 118px; width: 136px; transform: rotate(-8deg); animation-delay: -2.2s; }
.lobby-die-j { bottom: 72px; left: 250px; width: 116px; transform: rotate(6deg); animation-delay: -1.8s; }
.lobby-die-r { top: 92px; right: 128px; width: 112px; transform: rotate(16deg); animation-delay: -0.7s; }
.lobby-die-n { bottom: 58px; right: 34px; width: 124px; transform: rotate(-12deg); animation-delay: -2.8s; }

@keyframes lobby-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}

@keyframes tableau-sheen {
  0% { transform: translateX(0) rotate(8deg); opacity: 0; }
  12% { opacity: 1; }
  48% { opacity: 0.9; }
  100% { transform: translateX(360%) rotate(8deg); opacity: 0; }
}

@keyframes lobby-breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.lobby-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.game-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border-radius: 28px;
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease,
    background 220ms ease;
}

.game-card.featured {
  background:
    radial-gradient(circle at top right, rgba(255, 223, 163, 0.3), transparent 24%),
    linear-gradient(145deg, rgba(255, 251, 243, 0.94), rgba(247, 225, 182, 0.86));
}

.game-card h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
}

.game-card p {
  margin: 0;
  line-height: 1.6;
  color: #4e3c2e;
}

.game-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 4px;
}

.game-status {
  display: inline-flex;
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.game-status.available {
  background: rgba(13, 92, 77, 0.12);
  color: var(--accent);
}

.game-status.planned {
  background: rgba(213, 166, 77, 0.18);
  color: #8b611c;
}

.game-meta {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: #5a4635;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.status-strip > div,
.summary-list > div {
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 249, 239, 0.78);
  border: 1px solid var(--line);
}

.status-strip > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 88px;
}

.label,
dt,
.felt-subtitle,
.zone-header span,
.help-list,
  #phase-progress {
    color: var(--muted);
  }

.status-strip .label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-strip strong {
  display: block;
  font-size: 1.45rem;
  line-height: 1.15;
  font-weight: 800;
  color: var(--ink);
}

.felt {
  position: relative;
  padding: 22px;
  border-radius: 32px;
}

.roll-video-overlay {
  display: none;
}

.roll-video-overlay.visible {
  opacity: 1;
}

.roll-video {
  width: min(440px, 72%);
  max-height: 260px;
  border-radius: 24px;
  object-fit: contain;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
}

.felt-header,
.zone-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.felt-header {
  margin-bottom: 20px;
}

.felt-title {
  font-size: 1.6rem;
}

.message-banner {
  margin: 10px 0 0;
  padding: 14px 18px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(248, 211, 140, 0.24), rgba(255, 249, 239, 0.82));
  border: 1px solid rgba(213, 166, 77, 0.28);
  box-shadow: 0 10px 24px rgba(213, 166, 77, 0.12);
  color: #5c4022;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
}

.message-banner.chinos-spotlight {
  padding: 18px 22px;
  font-size: 1.3rem;
  background:
    linear-gradient(135deg, rgba(255, 224, 155, 0.4), rgba(255, 248, 231, 0.95));
  border-color: rgba(213, 166, 77, 0.5);
  box-shadow: 0 16px 28px rgba(213, 166, 77, 0.2);
}

.dice-zone,
.actions-panel,
.options-panel {
  padding: 18px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
    linear-gradient(135deg, #0f6a58, #0b4c40);
  color: #f4ecdf;
}

.reserved-zone,
.options-panel,
.actions-panel {
  margin-top: 16px;
}

.assistant-panel {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(255, 249, 239, 0.72);
  border: 1px solid rgba(35, 24, 15, 0.08);
}

.ai-approval-panel {
  display: none;
  border: 1px solid rgba(213, 166, 77, 0.35);
  box-shadow: 0 10px 24px rgba(213, 166, 77, 0.12);
}

.ai-approval-panel.visible {
  display: block;
}

.assistant-message {
  margin: 12px 0 0;
  font-size: 1rem;
  line-height: 1.45;
}

.debug-panel {
  margin-top: 16px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(35, 24, 15, 0.08);
  border: 1px dashed rgba(35, 24, 15, 0.16);
}

.debug-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  position: relative;
  z-index: 2;
}

.debug-actions .secondary-button,
.debug-actions .ghost-button {
  min-height: 42px;
  cursor: pointer;
  pointer-events: auto;
}

.debug-actions .secondary-button {
  background: linear-gradient(145deg, #f8d38c, #d3a246);
  border: 0;
  color: #3b2910;
  font-weight: 700;
}

.debug-actions .ghost-button {
  background: rgba(255, 255, 255, 0.92);
  color: #2b1d12;
  border: 1px solid rgba(35, 24, 15, 0.12);
}

.debug-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.debug-item {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(35, 24, 15, 0.08);
}

.debug-item strong {
  display: block;
  margin-bottom: 6px;
}

.debug-item code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.85rem;
  color: #4d3929;
  white-space: pre-wrap;
  word-break: break-word;
}

.debug-dump {
  width: 100%;
  min-height: 220px;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(35, 24, 15, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: #3b2a1a;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.45;
  resize: vertical;
}

.dice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 14px;
  min-height: 150px;
  margin-top: 14px;
}

.die {
  position: relative;
  min-height: 132px;
  border: 0;
  border-radius: 22px;
  background: linear-gradient(145deg, #fbf0d8, #f8dfb2);
  color: #392519;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    0 10px 18px rgba(15, 11, 6, 0.18);
  cursor: pointer;
  transform-origin: center center;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.die.selected {
  outline: 3px solid #d73a35;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    0 10px 18px rgba(15, 11, 6, 0.18),
    0 0 0 3px rgba(215, 58, 53, 0.22);
  transform: translateY(-3px);
}

.die.selected::after {
  content: "SELECCIÓN";
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #d73a35;
  color: #fff8f7;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  pointer-events: none;
}

.die.reserved {
  cursor: default;
  border: 3px solid #d73a35;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    0 10px 18px rgba(15, 11, 6, 0.18),
    0 0 0 2px rgba(215, 58, 53, 0.25);
}

.die.rolling {
  animation: none;
}

.die.reserving {
  animation: die-reserve 360ms ease;
}

.die.scored {
  animation: die-score 520ms ease;
}

.die.locked,
.die:disabled,
.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled,
.option-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.die.rolling,
.die.rolling:disabled {
  opacity: 1;
  cursor: default;
}

.die.locked {
  filter: grayscale(0.25);
  background: linear-gradient(145deg, #ddd6c9, #c9bea9);
}

.die-art-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 92px;
  margin-top: 0;
  overflow: hidden;
}

.die-roll-media-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 92px;
  overflow: hidden;
  background: linear-gradient(145deg, #fbf0d8, #f8dfb2);
  border-radius: 16px;
}

.die-roll-media {
  width: 220px;
  height: 156px;
  object-fit: cover;
  object-position: center center;
  transform: scale(1.08);
  border-radius: 16px;
  background: transparent;
  mix-blend-mode: normal;
  filter: none;
}

.die-art {
  width: 156px;
  height: 118px;
  object-fit: contain;
  transform: scale(1.22);
  transform-origin: center center;
  filter: drop-shadow(0 6px 10px rgba(57, 37, 25, 0.16));
}

.die-face {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  margin-top: 10px;
}

.die-label {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: rgba(57, 37, 25, 0.75);
}

.die-note {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(154, 63, 54, 0.88);
}

.die-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(13, 92, 77, 0.12);
  font-size: 0.72rem;
  font-weight: 700;
}

.die-badge.reserved-badge {
  background: #d73a35;
  color: #fff8f7;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

@keyframes die-reserve {
  0% { transform: scale(1); }
  40% { transform: scale(1.08) translateY(-6px); }
  100% { transform: scale(1); }
}

@keyframes die-score {
  0% { transform: scale(1); box-shadow: 0 10px 18px rgba(15, 11, 6, 0.18); }
  40% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(213, 166, 77, 0.16); }
  100% { transform: scale(1); box-shadow: 0 10px 18px rgba(15, 11, 6, 0.18); }
}

.actions-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.utility-panel {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-top: 12px;
}

.secondary-button.utility-button {
  min-width: 170px;
  background: linear-gradient(145deg, rgba(248, 211, 140, 0.96), rgba(227, 183, 95, 0.92));
  color: #3b2910;
  border: 1px solid rgba(163, 110, 31, 0.22);
  box-shadow: 0 12px 22px rgba(123, 79, 18, 0.14);
  font-weight: 800;
}

.secondary-button.utility-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(123, 79, 18, 0.22);
  filter: saturate(1.04) brightness(1.02);
}

.secondary-button.utility-button:disabled {
  opacity: 0.65;
  color: rgba(59, 41, 16, 0.72);
  background: linear-gradient(145deg, rgba(248, 211, 140, 0.42), rgba(227, 183, 95, 0.36));
  border: 1px solid rgba(163, 110, 31, 0.12);
}

.primary-button,
.secondary-button,
.ghost-button,
.option-button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 16px;
  border: 0;
}

.primary-button {
  background: linear-gradient(145deg, #f8d38c, #d3a246);
  color: #3b2910;
  font-weight: 700;
}

.secondary-button {
  background: rgba(255, 249, 239, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #fff6e8;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.ghost-button.copy-code-button {
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.ghost-button.copy-code-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(63, 39, 19, 0.16);
  background: rgba(255, 255, 255, 0.96);
}

.ghost-button.copy-code-button.copied {
  background: linear-gradient(145deg, rgba(248, 211, 140, 0.96), rgba(227, 183, 95, 0.92));
  color: #3b2910;
  box-shadow: 0 14px 26px rgba(180, 125, 29, 0.24);
}

body.view-lobby .lobby-hero:hover {
  box-shadow: 0 28px 64px rgba(63, 39, 19, 0.2);
}

body.view-lobby .game-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 62px rgba(63, 39, 19, 0.2);
  border-color: rgba(213, 166, 77, 0.34);
}

body.view-lobby .lobby-actions .primary-button:hover:not(:disabled),
body.view-lobby .game-card .primary-button:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 18px 30px rgba(180, 125, 29, 0.34);
  filter: saturate(1.05) brightness(1.02);
}

body.view-lobby .lobby-actions .ghost-button:hover:not(:disabled),
body.view-lobby .game-card .ghost-button:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 16px 28px rgba(63, 39, 19, 0.14);
  background: rgba(255, 255, 255, 0.92);
}

body.view-lobby .lobby-actions .primary-button:focus-visible,
body.view-lobby .lobby-actions .ghost-button:focus-visible,
body.view-lobby .game-card .primary-button:focus-visible,
body.view-lobby .game-card .ghost-button:focus-visible {
  outline: 3px solid rgba(213, 166, 77, 0.5);
  outline-offset: 3px;
}

body.view-lobby .lobby-tableau:hover .lobby-die {
  filter: drop-shadow(0 24px 30px rgba(7, 4, 3, 0.38));
}

body.view-lobby .lobby-tableau:hover .lobby-die-a { transform: rotate(-14deg) translateY(-4px); }
body.view-lobby .lobby-tableau:hover .lobby-die-k { transform: rotate(10deg) translateY(-6px); }
body.view-lobby .lobby-tableau:hover .lobby-die-q { transform: rotate(-8deg) translateY(-5px); }
body.view-lobby .lobby-tableau:hover .lobby-die-j { transform: rotate(6deg) translateY(-5px); }
body.view-lobby .lobby-tableau:hover .lobby-die-r { transform: rotate(16deg) translateY(-6px); }
body.view-lobby .lobby-tableau:hover .lobby-die-n { transform: rotate(-12deg) translateY(-4px); }

.button-suggested {
  box-shadow:
    0 0 0 4px rgba(213, 166, 77, 0.46),
    0 0 22px rgba(248, 211, 140, 0.58);
  transform: translateY(-2px) scale(1.02);
  animation: suggested-pulse 1.15s ease-in-out infinite;
}

@keyframes suggested-pulse {
  0% {
    box-shadow:
      0 0 0 4px rgba(213, 166, 77, 0.46),
      0 0 10px rgba(248, 211, 140, 0.32);
  }
  50% {
    box-shadow:
      0 0 0 6px rgba(213, 166, 77, 0.24),
      0 0 26px rgba(248, 211, 140, 0.72);
  }
  100% {
    box-shadow:
      0 0 0 4px rgba(213, 166, 77, 0.46),
      0 0 10px rgba(248, 211, 140, 0.32);
  }
}

.score-options {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.option-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  background: rgba(255, 249, 239, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff6e8;
}

.sidebar {
  display: grid;
  gap: 20px;
}

.sidebar-card,
.scoreboard-card {
  padding: 20px;
  border-radius: 26px;
}

.summary-list {
  margin: 16px 0 0;
  display: grid;
  gap: 12px;
}

.summary-list dt {
  margin-bottom: 6px;
  font-size: 0.82rem;
}

.summary-list dd {
  margin: 0;
  font-weight: 700;
}

.help-list {
  margin: 14px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  line-height: 1.45;
}

.setup-online-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.online-room-panel {
  display: none;
  width: min(1120px, calc(100vw - 48px));
  margin: 24px auto 0;
}

.online-room-panel.visible {
  display: block;
}

.online-room-card {
  padding: 24px;
  border-radius: 30px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 18px;
}

.online-room-lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.online-room-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.online-room-players {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.online-room-player {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255, 248, 235, 0.98);
  border: 1px solid rgba(184, 136, 59, 0.18);
}

.online-room-player.host {
  border-color: rgba(184, 136, 59, 0.38);
}

.online-room-player-name {
  font-weight: 800;
  color: #2f2118;
}

.online-room-player-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.online-room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.online-chat-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 248, 235, 0.92);
  border: 1px solid rgba(184, 136, 59, 0.2);
}

.online-chat-card h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
}

.online-chat-messages {
  max-height: 180px;
  overflow-y: auto;
  border-radius: 14px;
  border: 1px solid rgba(113, 79, 47, 0.18);
  background: rgba(255, 255, 255, 0.78);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.chat-empty {
  color: #6f5b49;
  font-size: 0.92rem;
}

.chat-line {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 252, 245, 0.94);
}

.chat-line.mine {
  background: rgba(235, 255, 240, 0.96);
  border: 1px solid rgba(74, 150, 86, 0.25);
}

.chat-line-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
  color: #745e49;
}

.chat-line-author {
  font-weight: 700;
  color: #3d2c1c;
}

.chat-line-text {
  margin: 0;
  color: #2e2218;
  line-height: 1.35;
  word-break: break-word;
}

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

.online-chat-form input {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(113, 79, 47, 0.24);
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.94);
}

.online-chat-form button {
  min-height: 42px;
  padding: 0 16px;
}

.game-chat-card[hidden] {
  display: none !important;
}

.scoreboard-card {
  margin-top: 20px;
}

.bottom-ranking {
  display: grid;
  gap: 14px;
  padding-top: 6px;
  border-top: 1px solid rgba(113, 79, 47, 0.12);
}

.bottom-ranking-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.bottom-ranking-item {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 248, 235, 0.98), rgba(250, 237, 209, 0.95));
  border: 1px solid rgba(184, 136, 59, 0.18);
  box-shadow: 0 10px 26px rgba(54, 33, 15, 0.08);
}

.bottom-ranking-item.leading {
  border-color: rgba(184, 136, 59, 0.4);
  box-shadow: 0 14px 32px rgba(184, 136, 59, 0.18);
}

.bottom-ranking-item.active {
  outline: 2px solid rgba(184, 136, 59, 0.28);
  outline-offset: 2px;
}

.bottom-ranking-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bottom-ranking-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #2f2118;
}

.bottom-ranking-position {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(184, 136, 59, 0.14);
  color: #704727;
  font-weight: 800;
}

.bottom-ranking-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.winner-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(19, 12, 8, 0.5);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  z-index: 30;
}

.winner-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.winner-card {
  width: min(680px, calc(100vw - 40px));
  padding: 42px 36px;
  border-radius: 34px;
  text-align: center;
  color: #2d1d12;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.68), transparent 35%),
    linear-gradient(145deg, #fff8e8, #f2d18e 48%, #e1b357 100%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 30px 80px rgba(28, 18, 10, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.winner-kicker {
  margin: 0;
  font-size: clamp(1.6rem, 2vw + 1rem, 2.4rem);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #7a4c14;
}

.winner-name {
  margin: 18px 0 10px;
  font-size: clamp(3rem, 5vw + 1rem, 5.6rem);
  line-height: 0.95;
  color: #1d3e34;
  text-shadow: 0 8px 24px rgba(255, 255, 255, 0.38);
}

.winner-score {
  margin: 0;
  font-size: clamp(1.4rem, 2vw + 0.8rem, 2.2rem);
  font-weight: 700;
  color: #4e2f18;
}

.winner-restart-btn {
  margin-top: 26px;
  min-width: 220px;
  min-height: 54px;
  font-size: 1.08rem;
  box-shadow: 0 14px 28px rgba(123, 79, 18, 0.22);
}

.scoreboard-wrap {
  overflow-x: auto;
}

.round-results-panel {
  display: none;
  margin: 14px 0 18px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(13, 92, 77, 0.08);
  border: 1px solid rgba(13, 92, 77, 0.12);
}

.round-results-panel.visible {
  display: grid;
  gap: 10px;
}

.round-results-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a642f;
}

.round-results-list {
  display: grid;
  gap: 8px;
}

.round-result-item {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(35, 24, 15, 0.08);
  color: #2d1f12;
}

.round-result-item.leading {
  background: rgba(213, 166, 77, 0.18);
  border-color: rgba(213, 166, 77, 0.38);
  box-shadow: inset 0 0 0 1px rgba(255, 245, 214, 0.5);
}

.round-result-item strong {
  color: #0d5c4d;
}

.round-results-summary {
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 248, 232, 0.94), rgba(242, 209, 142, 0.78));
  border: 1px solid rgba(213, 166, 77, 0.28);
  color: #3b2411;
  box-shadow: 0 10px 24px rgba(123, 79, 18, 0.12);
}

.round-results-summary strong {
  color: #8a4f12;
}

.scoreboard {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  background: rgba(255, 250, 241, 0.65);
  min-width: 780px;
}

.scoreboard th,
.scoreboard td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.scoreboard th:first-child,
.scoreboard td:first-child {
  text-align: left;
  font-weight: 700;
}

.scoreboard .active-column {
  background: rgba(13, 92, 77, 0.08);
}

.scoreboard .forced-target {
  background: rgba(213, 166, 77, 0.15);
}

.scoreboard .chichis-corner,
.scoreboard .chichis-player-head,
.scoreboard .chichis-subhead,
.scoreboard .chichis-row-label,
.scoreboard .chichis-value,
.scoreboard .chichis-cell {
  border: 1px solid rgba(59, 41, 16, 0.28);
}

.scoreboard .chichis-corner,
.scoreboard .chichis-player-head,
.scoreboard .chichis-subhead {
  background: rgba(255, 247, 232, 0.92);
}

.scoreboard .chichis-player-head {
  min-width: 124px;
}

.scoreboard .chichis-player-short {
  font-size: 0.96rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.scoreboard .chichis-subhead {
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-align: center !important;
}

.scoreboard .chichis-row-label,
.scoreboard .chichis-value {
  font-weight: 900;
  white-space: nowrap;
  background: rgba(255, 252, 245, 0.88);
}

.scoreboard .chichis-value {
  text-align: center;
}

.scoreboard .chichis-cell {
  min-width: 64px;
  background: rgba(255, 255, 255, 0.7);
}

.scoreboard .chichis-cell .scorechip {
  min-width: 40px;
}

.scoreboard .chichis-total-row th,
.scoreboard .chichis-total-row td {
  background: rgba(213, 166, 77, 0.12);
}

.scoreboard .chichis-grand-total-row th,
.scoreboard .chichis-grand-total-row td {
  background: rgba(13, 92, 77, 0.12);
}

.scoreboard .grand-total-cell .scorechip {
  min-width: 54px;
  font-weight: 900;
}

.scorebox {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.scorechip {
  min-width: 34px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(35, 24, 15, 0.06);
}

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

.scoreboard .chichis-cell .scorechip.pinched {
  background: rgba(191, 69, 69, 0.16);
  color: #8d1f1f;
  border: 1px solid rgba(191, 69, 69, 0.24);
  font-weight: 800;
}

.scoreboard .chichis-cell .scorechip.covered {
  background: rgba(43, 138, 92, 0.18);
  color: #12663f;
  border: 1px solid rgba(43, 138, 92, 0.24);
  font-weight: 800;
}

.score-race-list {
  display: grid;
  gap: 12px;
}

.score-race-item {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(35, 24, 15, 0.08);
}

.score-race-item.active {
  background: rgba(13, 92, 77, 0.12);
  border-color: rgba(13, 92, 77, 0.22);
}

.score-race-item-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.score-race-name {
  font-weight: 800;
  color: #2d1f12;
}

.score-race-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.setup-dialog {
  border: 0;
  padding: 0;
  background: transparent;
}

.setup-dialog,
.setup-dialog:not([open]) {
  display: none;
}

.setup-dialog[open],
.setup-dialog.is-open {
  display: grid;
  place-items: start center;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  min-height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  z-index: 40;
  background: rgba(22, 15, 11, 0.42);
  backdrop-filter: blur(6px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 14px 12px max(14px, env(safe-area-inset-bottom));
}

.setup-dialog::backdrop {
  background: rgba(22, 15, 11, 0.42);
}

.setup-card {
  width: min(760px, calc(100vw - 24px));
  position: relative;
  border-radius: 30px;
  padding: 28px;
  max-height: calc(100dvh - 28px);
  overflow-y: scroll;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #b9873f rgba(49, 33, 20, 0.12);
}

.setup-card::-webkit-scrollbar {
  width: 10px;
}

.setup-card::-webkit-scrollbar-track {
  background: rgba(49, 33, 20, 0.12);
  border-radius: 999px;
}

.setup-card::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #d7b06a, #b9873f);
  border-radius: 999px;
  border: 2px solid rgba(255, 248, 238, 0.7);
}

.setup-card::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #e4bf7c, #c08f47);
}

.dialog-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #5b4532;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(52, 31, 16, 0.12);
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.setup-target {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.setup-grid label {
  display: grid;
  gap: 8px;
}

.player-slot {
  align-content: start;
}

.setup-grid input,
.setup-grid select {
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.setup-error {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--danger);
  font-weight: 700;
}

.setup-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(244, 242, 233, 0), rgba(244, 242, 233, 0.94) 28%, rgba(244, 242, 233, 1) 100%);
  padding-top: 12px;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 92px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  color: rgba(255, 246, 232, 0.78);
}

.chinos-seat {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 243, 214, 0.96), rgba(250, 226, 170, 0.9));
  border: 1px solid rgba(173, 120, 33, 0.28);
  color: #3b2b20;
  min-height: 170px;
}

.chinos-seat.current {
  background: linear-gradient(180deg, rgba(208, 255, 220, 0.96), rgba(160, 230, 170, 0.9));
  box-shadow: 0 0 0 3px rgba(64, 156, 90, 0.5);
}

.chinos-seat.revealed {
  animation: chinos-reveal 0.6s ease-out;
}

.chinos-seat.retired {
  opacity: 0.75;
}

.chinos-seat.loser {
  box-shadow: 0 0 0 3px rgba(180, 64, 64, 0.28);
}

.chinos-seat-head,
.chinos-seat-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.chinos-coins {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  min-height: 96px;
}

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

.mosca-op-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chinos-action-panel button {
  border: none;
  padding: 6px 0;
  border-radius: 999px;
  background: rgba(24, 88, 78, 0.18);
  color: #1f3c32;
  font-weight: 700;
  cursor: pointer;
}

.chinos-action-panel button:hover {
  background: rgba(24, 88, 78, 0.28);
}

.mosca-op-panel button {
  padding: 11px 0;
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.mosca-op-add {
  background: linear-gradient(145deg, #7fd59f, #55af79) !important;
  color: #123a27 !important;
}

.mosca-op-add:hover {
  background: linear-gradient(145deg, #8ce1aa, #64be87) !important;
}

.mosca-op-sub {
  background: linear-gradient(145deg, #f2b0a5, #dc8478) !important;
  color: #541f17 !important;
}

.mosca-op-sub:hover {
  background: linear-gradient(145deg, #f8beb3, #e7968a) !important;
}

.chinos-seed-action {
  display: flex;
  justify-content: center;
}

.chinos-seed-action button {
  min-width: 180px;
  padding: 10px 18px;
  font-size: 0.98rem;
  font-weight: 800;
  background: linear-gradient(145deg, #f8d38c, #d3a246);
  color: #3b2910;
  box-shadow: 0 12px 24px rgba(123, 79, 18, 0.2);
}

.chinos-main-action {
  width: 100%;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 800;
  border-radius: 16px;
  margin-bottom: 14px;
}

.mosca-target-action {
  margin-bottom: 8px;
}

.chinos-coins span {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, #ffe08c, #d49a1f 70%, #8a5c06);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.5);
}

.chinos-coin-image {
  width: 86px;
  height: 86px;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(76, 51, 8, 0.22));
  animation: coin-pop 0.45s ease-out;
}

.chinos-seed-roll {
  position: relative;
  width: 140px;
  height: 110px;
  display: grid;
  place-items: center;
}

.chinos-seed-roll .die-roll-media {
  width: 140px;
  height: 110px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 10px 20px rgba(40, 22, 8, 0.2);
}

.mosca-roll-media-wrap {
  width: 152px;
  height: 116px;
  border-radius: 18px;
  overflow: hidden;
  background: #08110f;
  display: grid;
  place-items: center;
}

.mosca-roll-media-wrap .die-roll-media {
  width: 152px;
  height: 116px;
  object-fit: cover;
  border-radius: 18px;
}

.chinos-seed-face {
  position: absolute;
  bottom: 6px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(13, 92, 77, 0.16);
  color: #1f3c32;
  font-weight: 800;
  font-size: 0.78rem;
}

.chinos-seed-final {
  width: 92px;
  height: 92px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #fbf0d8, #f8dfb2);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55), 0 12px 22px rgba(15, 11, 6, 0.18);
  font-size: 2.2rem;
  font-weight: 900;
  color: #2f2118;
  letter-spacing: 0.04em;
}

.mosca-target-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(11, 68, 58, 0.32);
  margin-bottom: 12px;
}

.mosca-target-main {
  display: flex;
  gap: 14px;
  align-items: center;
}

.mosca-target-main-vertical {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}

.mosca-fly-image {
  width: 154px;
  height: 154px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.28));
}

.mosca-fly-media-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mosca-fly-fallback {
  width: 120px;
  height: 120px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 8px 16px rgba(10, 8, 4, 0.22);
}

.mosca-target-big {
  font-size: 1.55rem !important;
  line-height: 1.1;
  color: #fff3d1;
  text-shadow: 0 2px 8px rgba(24, 12, 4, 0.35);
}

.mosca-target-copy {
  display: grid;
  gap: 4px;
  color: #f7f4ea;
}

.mosca-target-copy-centered {
  justify-items: center;
  text-align: center;
}

.mosca-target-copy strong {
  font-size: 1.12rem;
  letter-spacing: 0.01em;
}

.mosca-target-copy span {
  color: rgba(247, 244, 234, 0.88);
}

.mosca-target-dice-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.mosca-target-die {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 72px;
}

.mosca-target-die-art {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.24));
}

.mosca-target-die-face {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(145deg, #fbf0d8, #f8dfb2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 4px 10px rgba(18, 9, 2, 0.24);
  color: #2f2118;
  font-weight: 900;
  font-size: 1.35rem;
}

.mosca-target-die-meta {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(247, 244, 234, 0.92);
}

.mosca-target-faces {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mosca-target-faces .scorechip {
  background: rgba(255, 255, 255, 0.18);
  color: #fff5e6;
}

.mosca-next-round-box {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: rgba(7, 64, 55, 0.32);
  color: #f8f0df;
}

.mosca-ready-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.mosca-ready-item {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff5e6;
  display: grid;
  gap: 4px;
}

.mosca-ready-item .secondary-button {
  margin-top: 6px;
  min-height: 38px;
}

.mosca-target-roll {
  width: 118px;
  height: 92px;
}

.mosca-target-roll .die-roll-media {
  width: 118px;
  height: 92px;
}

.mosca-face-wrap {
  min-height: 126px;
}

.mosca-face-wrap .die-art-wrap {
  width: auto;
  min-height: 0;
  margin: 0;
  overflow: visible;
}

.mosca-face-wrap .die-art {
  width: 146px;
  height: 110px;
  transform: none;
  transform-origin: center center;
}

.mosca-face-wrap .die-label {
  display: none;
}

.mosca-face-wrap .die-roll-media-wrap {
  width: 156px;
  min-height: 116px;
  flex: 0 0 auto;
}

.mosca-face-wrap .die-roll-media {
  width: 156px;
  height: 116px;
  transform: none;
  object-fit: cover;
}

.chinos-pouch {
  width: 46px;
  height: 42px;
  border-radius: 18px 18px 16px 16px;
  background: linear-gradient(180deg, #7c4f1c, #5a360f);
  position: relative;
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.12), 0 8px 12px rgba(41, 24, 5, 0.28);
}

.chinos-pouch::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 8px;
  right: 8px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #c09a45, #e4c06b);
}

.chinos-pouch::after {
  content: "";
  position: absolute;
  top: -2px;
  left: 50%;
  width: 10px;
  height: 10px;
  background: #d7b15f;
  border-radius: 50%;
  transform: translateX(-50%);
}

.chinos-coins.hidden span {
  background: rgba(31, 98, 85, 0.22);
  color: #1f6255;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.chinos-coins .empty {
  background: rgba(31, 98, 85, 0.14);
  color: #1f6255;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.chinos-bid-row {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 248, 236, 0.92);
  color: #3b2b20;
  border: 1px solid rgba(173, 120, 33, 0.2);
}

@keyframes coin-pop {
  0% {
    transform: scale(0.7) rotate(-6deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.08) rotate(3deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

@keyframes chinos-reveal {
  0% {
    transform: translateY(6px);
    opacity: 0.6;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 1100px) {
  .lobby-hero,
  .board-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 780px) {
  .app-shell {
    width: min(100% - 20px, 1380px);
    padding-top: 12px;
  }

  .topbar,
  .lobby-actions,
  .felt-header,
  .zone-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .lobby-grid,
  .status-strip {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .setup-grid,
  .setup-online-grid {
    grid-template-columns: 1fr;
  }

  .setup-dialog[open],
  .setup-dialog.is-open {
    place-items: stretch;
    padding: 0;
  }

  .setup-card {
    width: 100vw;
    max-width: 100vw;
    height: 100svh;
    min-height: 100svh;
    max-height: 100svh;
    margin: 0;
    padding: 20px 14px calc(16px + env(safe-area-inset-bottom));
    border-radius: 0;
    overflow-y: scroll;
    scrollbar-width: auto;
  }

  .dialog-close-btn {
    top: 10px;
    right: 10px;
  }

  .setup-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .setup-actions .ghost-button,
  .setup-actions .primary-button {
    width: 100%;
  }

  .online-chat-form {
    grid-template-columns: 1fr;
  }

  .online-chat-form button {
    width: 100%;
  }

  .lobby-tableau {
    min-height: 300px;
  }

  .lobby-die {
    width: 96px;
  }

  .barrel-right {
    right: 34px;
  }
}
