/* Games tab — queen court purple/gold animations */
.games-shelf {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.games-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.games-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 1rem 1.05rem;
  background:
    linear-gradient(145deg, rgba(92, 77, 122, 0.22), rgba(18, 16, 26, 0.4)),
    var(--panel);
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}
.games-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 40%, rgba(143, 122, 72, 0.08), transparent 60%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
  pointer-events: none;
}
.games-card:hover {
  transform: translateY(-2px);
  border-color: rgba(143, 122, 72, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
.games-card:hover::before { transform: translateX(120%); }
.games-card:active { transform: scale(0.99); }
.games-card.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.25);
}
.games-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.games-card h3 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.games-card .lede {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.games-badge {
  flex: 0 0 auto;
  min-width: 2.6rem;
  text-align: center;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(92, 77, 122, 0.55);
  border: 1px solid rgba(168, 150, 210, 0.35);
  color: #ddd4ec;
}
.games-badge.done {
  background: rgba(143, 122, 72, 0.35);
  border-color: rgba(168, 150, 90, 0.55);
  color: #e8d9a8;
}
.games-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
}
.games-empty h3 { color: var(--queen); margin: 0 0 0.5rem; }

.games-stage {
  display: none;
  margin-top: 0.75rem;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.games-stage.open { display: block; animation: gamesFadeIn 0.35s ease; }
/* Contain outcome panels on phones without clipping Lines tiles */
#stage-dice,
#stage-wheel,
#stage-blackjack {
  overflow-x: clip;
  max-width: 100%;
  min-width: 0;
}
#stage-wheel .wof-wrap,
#stage-dice {
  overflow-x: clip;
}
@keyframes gamesFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.games-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  min-width: 0;
}
.games-stage-header h3 {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Wheel — spin → disc → legend → result → Jade */
.wof-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: clip;
}
.wof-controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  width: 100%;
  max-width: min(420px, 100%);
  margin: 0 auto;
  min-width: 0;
  box-sizing: border-box;
}
.wof-spin-btn {
  width: 100%;
  min-height: 3rem;
  margin-top: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  touch-action: manipulation;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.wof-spin-btn:disabled {
  box-shadow: none;
}
/* Clip 3D tilt / drop-shadow / larger wedge type so perspective never widens the page */
.wof-stage {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  overflow: hidden;
  overflow-x: clip;
  box-sizing: border-box;
  /* room for pointer above the disc without layout spill */
  padding: 0.35rem 0.5rem 0.55rem;
}
.wof-wheel-frame {
  position: relative;
  width: min(320px, calc(100% - 4px));
  max-width: 100%;
  aspect-ratio: 1;
  height: auto;
  margin: 0 auto;
  padding: 12px;
  box-sizing: border-box;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.42));
  perspective: 720px;
  transform: rotateX(10deg);
  transform-style: preserve-3d;
}
@media (min-width: 720px) {
  .wof-wheel-frame {
    width: min(420px, 100%);
    transform: rotateX(14deg);
    padding: 14px;
  }
}
.wof-pointer {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  width: 30px;
  height: 38px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.55));
  pointer-events: none;
}
.wof-pointer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #f5e8c0, #c4a86a 52%, #5a4528 100%);
  border: 1.5px solid rgba(255, 244, 210, 0.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2px 3px rgba(0, 0, 0, 0.35),
    0 2px 4px rgba(0, 0, 0, 0.35);
}
.wof-pointer-tip {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 24px solid #c4a86a;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}
.wof-pointer-tip::after {
  content: "";
  position: absolute;
  top: -24px;
  left: -9px;
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 18px solid #f0e0b0;
}
.wof-rim {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #eed9a8 0%, #c4a86a 26%, #7a6238 55%, #2e2416 100%);
  box-shadow:
    0 0 0 2px rgba(40, 30, 18, 0.6),
    inset 0 2px 4px rgba(255, 255, 255, 0.4),
    inset 0 -4px 8px rgba(0, 0, 0, 0.5),
    0 6px 14px rgba(0, 0, 0, 0.35);
  z-index: 0;
  pointer-events: none;
}
.wof-rim::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    repeating-conic-gradient(
      from 0deg,
      rgba(255, 244, 210, 0.14) 0deg 4deg,
      transparent 4deg 12deg
    );
  opacity: 0.55;
  pointer-events: none;
}
.wof-rim::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255, 236, 190, 0.32);
  box-shadow: inset 0 0 0 3px rgba(30, 22, 40, 0.6);
}
.wof-wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(230, 210, 160, 0.35);
  box-shadow:
    inset 0 0 36px rgba(0, 0, 0, 0.55),
    inset 0 8px 18px rgba(255, 255, 255, 0.06),
    inset 0 -10px 20px rgba(0, 0, 0, 0.35);
  transition: transform 8.8s cubic-bezier(0.12, 0.88, 0.02, 1);
  position: relative;
  overflow: hidden;
  z-index: 1;
  contain: paint;
}
.wof-wheel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.18), transparent 42%),
    radial-gradient(circle at 70% 78%, rgba(0, 0, 0, 0.35), transparent 50%);
  pointer-events: none;
  z-index: 2;
}
.wof-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #f2e4b8 0%, #c4a86a 38%, #5c4d7a 72%, #2a2438 100%);
  border: 2px solid rgba(240, 224, 180, 0.55);
  z-index: 3;
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.5),
    inset 0 2px 3px rgba(255, 255, 255, 0.4),
    inset 0 -3px 5px rgba(0, 0, 0, 0.35);
}
.wof-hub::after {
  content: "";
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #2a2438, #12101a 80%);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.15);
}
/* On-wedge labels: fixed % width (never max-content) so they cannot widen layout */
.wof-label {
  position: absolute;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  width: 30%;
  max-width: 30%;
  box-sizing: border-box;
  padding: 0.1rem 0.14rem;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.08;
  color: #fffaf0;
  text-align: center;
  text-shadow:
    0 0 3px rgba(0, 0, 0, 1),
    0 1px 2px rgba(0, 0, 0, 0.95),
    0 0 8px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.wof-label-line {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.wof-label.wof-label-roomy {
  font-size: 1.22rem;
  width: 36%;
  max-width: 36%;
  line-height: 1.1;
}
.wof-label.wof-label-mid {
  font-size: 1.05rem;
  width: 32%;
  max-width: 32%;
}
.wof-label.wof-label-dense {
  font-size: 0.82rem;
  width: 28%;
  max-width: 28%;
}
/* Phones: larger on-wedge labels, still clipped inside the disc; legend secondary */
@media (max-width: 520px) {
  .wof-label,
  .wof-label.wof-label-dense,
  .wof-label.wof-label-mobile {
    display: flex;
    font-size: 0.78rem;
    width: 30%;
    max-width: 30%;
    padding: 0.06rem 0.08rem;
    letter-spacing: 0;
    line-height: 1.06;
  }
  .wof-label.wof-label-roomy {
    font-size: 0.95rem;
    width: 34%;
    max-width: 34%;
  }
  .wof-label.wof-label-mid {
    font-size: 0.88rem;
    width: 32%;
    max-width: 32%;
  }
  .wof-hub {
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
  }
  .wof-hub::after {
    inset: 12px;
  }
  .wof-legend {
    opacity: 0.78;
    padding: 0.4rem 0.5rem;
    gap: 0.22rem;
  }
  .wof-legend-item {
    font-size: 0.72rem;
    font-weight: 500;
  }
}
.wof-legend {
  width: 100%;
  max-width: min(420px, 100%);
  min-width: 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(143, 122, 72, 0.35);
  background:
    linear-gradient(160deg, rgba(92, 77, 122, 0.28), rgba(18, 16, 26, 0.55));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  box-sizing: border-box;
}
@media (min-width: 520px) {
  .wof-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem 0.65rem;
  }
}
.wof-legend-item {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #f0e8d8;
  line-height: 1.3;
  min-width: 0;
  max-width: 100%;
  padding: 0.2rem 0.3rem;
  border-radius: 0.4rem;
  box-sizing: border-box;
  transition: background 0.25s ease, color 0.25s ease;
}
.wof-legend-item.is-winner {
  background: rgba(196, 168, 106, 0.22);
  color: #fff6d8;
  box-shadow: inset 0 0 0 1px rgba(196, 168, 106, 0.45);
}
.wof-legend-item > span:last-child {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.wof-legend-swatch {
  flex: 0 0 auto;
  width: 0.8rem;
  height: 0.8rem;
  margin-top: 0.18rem;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.25),
    0 1px 2px rgba(0, 0, 0, 0.25);
}
.wof-quota {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  max-width: 100%;
  padding: 0 0.15rem;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-sizing: border-box;
  line-height: 1.35;
}
.wof-result {
  display: none;
  width: 100%;
  max-width: min(420px, 100%);
  min-width: 0;
  margin: 0 auto;
  padding: 0.65rem 0.75rem;
  text-align: center;
  color: var(--accent);
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-sizing: border-box;
  border-radius: 0.7rem;
  border: 1px solid rgba(143, 122, 72, 0.4);
  background:
    linear-gradient(160deg, rgba(143, 122, 72, 0.18), rgba(18, 16, 26, 0.5));
  animation: wofResultIn 0.45s ease;
}
.wof-result.is-visible {
  display: block;
}
.wof-result-label {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  color: #f0e0b0;
  letter-spacing: 0.02em;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.wof-result-meta {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #c8b8a0;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.wof-result.is-spinning .wof-result-label {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}
@keyframes wofResultIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes gamesPulse {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Dice — physical 3D cubes with pip faces */
.dice-arena {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1.25rem 0 0.75rem;
  flex-wrap: wrap;
  perspective: 520px;
}
.dice-col { text-align: center; }
.dice-col .who {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.die {
  --die-size: 76px;
  --die-half: 38px;
  width: var(--die-size);
  height: var(--die-size);
  margin: 0 auto;
  perspective: 420px;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.38));
}
@media (max-width: 420px) {
  .die {
    --die-size: 64px;
    --die-half: 32px;
  }
  .dice-arena { gap: 1.35rem; }
}
.die-cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.22, 0.9, 0.28, 1);
  /* slight idle tilt so the cube reads as 3D even at rest */
  transform: rotateX(-18deg) rotateY(28deg) rotateZ(0deg);
}
.die[data-value="1"] .die-cube { transform: rotateX(-18deg) rotateY(28deg); }
.die[data-value="2"] .die-cube { transform: rotateX(-18deg) rotateY(-62deg); }
.die[data-value="3"] .die-cube { transform: rotateX(-108deg) rotateY(28deg); }
.die[data-value="4"] .die-cube { transform: rotateX(72deg) rotateY(28deg); }
.die[data-value="5"] .die-cube { transform: rotateX(-18deg) rotateY(118deg); }
.die[data-value="6"] .die-cube { transform: rotateX(-18deg) rotateY(208deg); }
.die-face {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  border-radius: 12px;
  background:
    radial-gradient(circle at 28% 24%, #ffffff 0%, #f4efe4 42%, #e4dccb 100%);
  border: 1.5px solid rgba(90, 78, 58, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -2px 4px rgba(70, 55, 30, 0.12);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 12%;
  gap: 6%;
  backface-visibility: hidden;
}
.die-face--1 { transform: rotateY(0deg) translateZ(var(--die-half)); }
.die-face--2 { transform: rotateY(90deg) translateZ(var(--die-half)); }
.die-face--3 { transform: rotateX(90deg) translateZ(var(--die-half)); }
.die-face--4 { transform: rotateX(-90deg) translateZ(var(--die-half)); }
.die-face--5 { transform: rotateY(-90deg) translateZ(var(--die-half)); }
.die-face--6 { transform: rotateY(180deg) translateZ(var(--die-half)); }
.die-face .pip {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #4a4458 0%, #1a1524 70%, #0c0a12 100%);
  box-shadow: 0 1px 1px rgba(255, 255, 255, 0.25);
  align-self: center;
  justify-self: center;
}
/* Classic pip layouts on a 3×3 grid */
.die-face--1 .pip:nth-child(1) { grid-area: 2 / 2; }
.die-face--2 .pip:nth-child(1) { grid-area: 1 / 3; }
.die-face--2 .pip:nth-child(2) { grid-area: 3 / 1; }
.die-face--3 .pip:nth-child(1) { grid-area: 1 / 3; }
.die-face--3 .pip:nth-child(2) { grid-area: 2 / 2; }
.die-face--3 .pip:nth-child(3) { grid-area: 3 / 1; }
.die-face--4 .pip:nth-child(1) { grid-area: 1 / 1; }
.die-face--4 .pip:nth-child(2) { grid-area: 1 / 3; }
.die-face--4 .pip:nth-child(3) { grid-area: 3 / 1; }
.die-face--4 .pip:nth-child(4) { grid-area: 3 / 3; }
.die-face--5 .pip:nth-child(1) { grid-area: 1 / 1; }
.die-face--5 .pip:nth-child(2) { grid-area: 1 / 3; }
.die-face--5 .pip:nth-child(3) { grid-area: 2 / 2; }
.die-face--5 .pip:nth-child(4) { grid-area: 3 / 1; }
.die-face--5 .pip:nth-child(5) { grid-area: 3 / 3; }
.die-face--6 .pip:nth-child(1) { grid-area: 1 / 1; }
.die-face--6 .pip:nth-child(2) { grid-area: 1 / 3; }
.die-face--6 .pip:nth-child(3) { grid-area: 2 / 1; }
.die-face--6 .pip:nth-child(4) { grid-area: 2 / 3; }
.die-face--6 .pip:nth-child(5) { grid-area: 3 / 1; }
.die-face--6 .pip:nth-child(6) { grid-area: 3 / 3; }
.die.rolling .die-cube {
  transition: none;
  animation: dieTumble 0.7s linear infinite;
}
@keyframes dieTumble {
  0% { transform: rotateX(12deg) rotateY(20deg) rotateZ(0deg); }
  25% { transform: rotateX(110deg) rotateY(-80deg) rotateZ(40deg); }
  50% { transform: rotateX(-60deg) rotateY(160deg) rotateZ(-25deg); }
  75% { transform: rotateX(200deg) rotateY(-40deg) rotateZ(70deg); }
  100% { transform: rotateX(372deg) rotateY(380deg) rotateZ(0deg); }
}
.dice-result {
  text-align: center;
  margin-top: 0.5rem;
  color: var(--ink);
  font-weight: 600;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0 0.35rem;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

/* Blackjack */
.bj-table {
  border-radius: 0.85rem;
  padding: 1rem;
  background:
    radial-gradient(ellipse at center, rgba(40, 70, 45, 0.45), rgba(18, 16, 26, 0.7));
  border: 1px solid rgba(143, 122, 72, 0.25);
}
.bj-row {
  margin-bottom: 0.85rem;
}
.bj-row .label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.bj-cards {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  min-height: 7rem;
  align-items: flex-end;
}
.bj-card {
  position: relative;
  width: 4.55rem;
  height: 6.4rem;
  border-radius: 0.45rem;
  padding: 0.22rem 0.28rem;
  box-sizing: border-box;
  background:
    linear-gradient(180deg, #fbf7ee 0%, #e9dfcc 100%);
  color: #1a1624;
  display: grid;
  grid-template-rows: auto 1fr auto;
  font-weight: 700;
  box-shadow:
    0 4px 12px rgba(0,0,0,0.4),
    inset 0 0 0 1px rgba(92, 77, 122, 0.18);
  border: 1px solid rgba(196, 168, 106, 0.45);
  animation: cardDeal 0.35s ease both;
}
.bj-card.red { color: #a12d3a; }
.bj-card.black { color: #1c1728; }
.bj-corner {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  font-size: 0.78rem;
  letter-spacing: -0.02em;
}
.bj-corner.tl { justify-self: start; }
.bj-corner.br {
  justify-self: end;
  transform: rotate(180deg);
}
.bj-rank { font-weight: 800; }
.bj-suit { font-size: 0.72rem; }
.bj-pip {
  place-self: center;
  font-size: 2.05rem;
  line-height: 1;
  filter: drop-shadow(0 1px 0 rgba(255,255,255,0.35));
}
.bj-card.back {
  background:
    linear-gradient(145deg, rgba(196, 168, 106, 0.25), transparent 42%),
    repeating-linear-gradient(
      135deg,
      #3d3358 0 7px,
      #2a2238 7px 14px
    );
  color: #c4b8d8;
  border: 2px solid rgba(196, 168, 106, 0.55);
  display: grid;
  place-items: center;
  padding: 0.35rem;
}
.bj-back-pattern {
  width: 78%;
  height: 82%;
  border-radius: 0.28rem;
  border: 1px solid rgba(196, 168, 106, 0.45);
  background:
    radial-gradient(circle at 50% 50%, rgba(196, 168, 106, 0.35), transparent 55%),
    repeating-linear-gradient(
      45deg,
      rgba(92, 77, 122, 0.0) 0 5px,
      rgba(168, 150, 210, 0.28) 5px 6px
    );
}
@keyframes cardDeal {
  from { opacity: 0; transform: translateY(-18px) rotate(-8deg); }
  to { opacity: 1; transform: translateY(0) rotate(0); }
}
.bj-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}
.bj-result {
  margin-top: 0.65rem;
  text-align: center;
  font-weight: 600;
  color: var(--accent);
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#linesMount {
  margin-top: 0.5rem;
  min-height: 8rem;
}

/* Lines writing session — hide shelf chrome, let tiles fill the viewport */
body.lines-build-active {
  overflow: hidden;
  overscroll-behavior: none;
}

#view-games.active.lines-stage-open {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: none;
  padding-top: 0.55rem;
  padding-bottom: 0.45rem;
}

#view-games.lines-stage-open > .games-shelf {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 0;
  padding: 0.55rem 0.7rem 0.45rem;
}

#view-games.lines-stage-open > .games-shelf.stack-gap > * + * {
  margin-top: 0;
}

#view-games.lines-stage-open .games-shelf-intro,
#view-games.lines-stage-open #gamesMeta,
#view-games.lines-stage-open #gamesBanner,
#view-games.lines-stage-open .prefs-row,
#view-games.lines-stage-open #gamesEmpty,
#view-games.lines-stage-open #gamesCards {
  display: none !important;
}

#view-games.lines-stage-open #stage-lines.open {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin-top: 0;
  animation: none;
}

#view-games.lines-stage-open #stage-lines .games-stage-header {
  flex-shrink: 0;
  margin-bottom: 0.3rem;
  min-height: 2rem;
}

#view-games.lines-stage-open #stage-lines .games-stage-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

#view-games.lines-stage-open #linesMount {
  flex: 1;
  min-height: 0;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#view-games.lines-stage-open #linesJade {
  flex-shrink: 0;
  margin: 0.45rem auto 0.35rem;
  max-height: 28vh;
  overflow-y: auto;
}

#view-games.lines-stage-open #linesMount .writing-host {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}
.games-lock-banner {
  border: 1px solid rgba(181, 106, 92, 0.4);
  background: rgba(181, 106, 92, 0.12);
  color: #e8c4bc;
  border-radius: 0.65rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}
.games-freeze-banner {
  border: 1px solid rgba(143, 122, 72, 0.45);
  background: rgba(143, 122, 72, 0.12);
  color: #e8d9a8;
  border-radius: 0.65rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}
.games-jade-voice {
  /* Never use vw widths here — parent .view already pads; vw ignored that and overflowed */
  width: 100%;
  max-width: min(420px, 100%);
  min-width: 0;
  margin: 0.15rem auto 0;
  padding: 0.65rem 0.75rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(168, 150, 210, 0.4);
  background:
    linear-gradient(145deg, rgba(92, 77, 122, 0.38), rgba(18, 16, 26, 0.58));
  color: #f0e8d8;
  font-size: 0.9rem;
  line-height: 1.4;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow-x: hidden;
  animation: gamesFadeIn 0.35s ease;
}
@media (max-width: 420px) {
  .games-jade-voice {
    font-size: 0.86rem;
    padding: 0.55rem 0.65rem;
  }
}
#wofJade.games-jade-voice,
#diceJade.games-jade-voice {
  width: 100%;
  max-width: min(420px, 100%);
}
.games-jade-voice .who {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c4a86a;
  margin-bottom: 0.3rem;
  font-weight: 700;
}
.games-jade-voice > div:not(.who) {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}
.bj-table .games-jade-voice {
  width: auto;
  max-width: 100%;
}
