:root {
  color-scheme: dark;
}
.entry-screen {
  min-height: 100dvh;
  background: repeating-conic-gradient(
    from 14deg at 15% 110%,
    #36755c 0deg 16deg,
    #2d6b54 18deg 35deg,
    #326f57 38deg 55deg
  );
  padding: clamp(18px, 4vw, 54px);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.entry-shell {
  width: min(960px, 100%);
}
.entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.entry-head h1 {
  font:
    900 28px ui-monospace,
    monospace;
  letter-spacing: 2px;
  margin: 0;
  text-shadow: 2px 3px #163e30;
}
.entry-head p {
  margin: 4px 0;
  color: #e1dfc5;
  font-size: 13px;
}
.entry-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.paper-panel {
  background: #30483f;
  border: 3px solid #bfc7a1;
  border-radius: 5px;
  padding: 22px;
  box-shadow: 0 6px #193b2e;
}
.paper-panel h2 {
  margin: 0 0 18px;
  font-size: 20px;
  color: #f3b958;
}
.paper-panel p {
  font-size: 13px;
  color: #d9dfc9;
}
.login-panel {
  width: min(380px, 100%);
  margin: 8vh auto 0;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 13px;
}
.field input,
.field select,
.inline-input {
  font: inherit;
  background: #203b31;
  color: #fff3df;
  border: 1px solid #8d9d80;
  border-radius: 4px;
  padding: 11px;
  min-width: 0;
  width: 100%;
  font-size: 16px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.primary-button,
.secondary-button,
.danger-button {
  border: 0;
  border-radius: 4px;
  padding: 11px 15px;
  font: 750 14px system-ui;
  min-height: 44px;
  color: #fff3df;
  background: #009dff;
  box-shadow: 0 4px #08649b;
}
.primary-button {
  background: #fda200;
  box-shadow: 0 4px #a76612;
  color: #fff3df;
  text-shadow: 1px 2px #a76612;
}
.danger-button {
  background: #fe5f55;
  box-shadow: 0 4px #a63d36;
}
.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.wide-button {
  width: 100%;
}
.muted-copy {
  color: #d0d9bd;
  font-size: 12px;
}
.error-message {
  color: #ffd1c5;
  font-size: 13px;
  min-height: 20px;
}
.active-rooms {
  margin-top: 28px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.active-room {
  padding: 12px 18px;
  border: 1px solid #7e9b7d;
  border-radius: 4px;
  background: #315d45;
  color: #fff3df;
  font: inherit;
  text-align: left;
}
.active-room strong {
  display: block;
  color: #f3b958;
}
.wallet-large {
  font:
    900 24px ui-monospace,
    monospace;
  color: #f3b958;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #102a22ba;
}
.app-modal {
  background: #374244;
  border: 4px solid #e2d6b6;
  border-radius: 5px;
  padding: 20px;
  max-width: min(680px, 96vw);
  max-height: 88dvh;
  overflow: auto;
  width: 100%;
  box-shadow: 0 8px #183c2d;
  color: #fff3df;
}
.app-modal h2 {
  margin: 0 0 16px;
  font-size: 20px;
}
.modal-close {
  float: right;
  border: 0;
  background: transparent;
  color: #fff3df;
  font-size: 23px;
  min-width: 36px;
  min-height: 36px;
}
.app-modal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.app-modal td,
.app-modal th {
  padding: 10px 6px;
  text-align: left;
  border-bottom: 1px solid #75857955;
}
.table-wrap {
  overflow-x: auto;
}
.stat-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.stat-row strong {
  display: block;
  font: 850 24px ui-monospace;
  color: #f3b958;
}
.history-profit {
  color: #85dbaf;
}
.history-loss {
  color: #ffa89f;
}
.balance-chart {
  width: 100%;
  height: 150px;
}
.balance-chart text {
  font: 11px system-ui;
  fill: #e5e3cd;
}
#notifications {
  position: fixed;
  left: 50%;
  top: 48px;
  translate: -50% 0;
  z-index: 150;
  max-width: 90vw;
  pointer-events: none;
}
#notifications:not(:empty) {
  background: #374244;
  color: #fff3df;
  border-radius: 4px;
  box-shadow: 0 4px #163c2d;
  padding: 9px 16px;
  font-size: 13px;
}
.waiting-banner {
  position: absolute;
  left: 50%;
  top: 46%;
  translate: -50% -50%;
  text-align: center;
  width: min(340px, 64%);
  z-index: 3;
}
.waiting-banner h2 {
  font-size: 22px;
  color: #f3b958;
  margin: 0 0 10px;
}
.waiting-banner p {
  font-size: 12px;
  color: #dce0ca;
  margin: 6px 0;
}
.waiting-banner strong {
  font: 900 25px ui-monospace;
}
.connection-badge {
  font-size: 11px;
  color: #e4dac0;
  white-space: nowrap;
}
.connection-badge.offline {
  color: #ffad9e;
}
.seat.acting .portrait {
  outline: 2px solid #f3b958;
  outline-offset: 3px;
}
.seat.waiting-seat {
  opacity: 0.65;
}
.quick .icon-button {
  font-size: 15px;
}
.round-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.game-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.game-menu .secondary-button {
  width: 100%;
}
.coach-mode {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-top: 14px;
}
.rule-list {
  padding-left: 18px;
  font-size: 13px;
}
.rule-list li {
  margin: 10px 0;
}
.chips-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
}
.chips-swatch {
  display: inline-block;
  width: 15px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  box-shadow: 0 3px #15382b;
}
.fx-layer {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
}
.flying-pile {
  position: absolute;
  pointer-events: none;
  transform-origin: center;
}
.flying-pile svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.seat-revealed {
  display: flex;
  position: absolute;
  left: 72px;
  top: 14px;
  gap: 2px;
  transform: rotate(7deg);
}
.seat-revealed .playing {
  width: 25px;
  height: 36px;
  font-size: 12px;
  padding: 2px 3px;
}
.seat-revealed .playing b {
  font-size: 14px;
}
.revealed-view .seat:last-child .seat-revealed {
  left: auto;
  right: 72px;
}
.hand-tags button {
  min-height: 24px;
}
.playing.card-focused {
  translate: 0 -10px;
}
.empty-pile[aria-hidden="true"] {
  pointer-events: none;
}
.reduced-motion * {
  animation: none !important;
  transition: none !important;
}
.thinking-gesture .portrait {
  animation: ponder 1s steps(5, end) infinite;
}
@keyframes ponder {
  50% {
    rotate: -5deg;
    translate: 0 -2px;
  }
}
.room-result {
  margin-top: 12px;
  color: #f3b958;
  font-size: 15px;
  font-weight: 800;
}
.portrait-select {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.portrait-select button {
  font-size: 32px;
  padding: 8px;
  border: 3px solid #cfceb1;
  background: #4f6367;
  border-radius: 4px;
}
.avatar-label {
  font-size: 12px;
  color: #dbe0c9;
}
.room-waiters {
  position: absolute;
  right: 16px;
  top: 8px;
  font-size: 11px;
  color: #d2dcbf;
}
.control-note {
  font-size: 11px;
  color: #dcdfc3;
  display: block;
  margin: 5px 0;
}
.chip-camera text {
  display: none;
}
.pot-cluster {
  white-space: nowrap;
}
.quick {
  z-index: 8;
}
.app-modal input:focus-visible,
.app-modal select:focus-visible,
.field input:focus-visible,
.field select:focus-visible {
  outline: 3px solid #f3b958;
  outline-offset: 2px;
}
@media (max-width: 650px) {
  .entry-grid {
    grid-template-columns: 1fr;
  }
  .entry-head h1 {
    font-size: 23px;
  }
  .paper-panel {
    padding: 18px;
  }
  .entry-actions {
    width: 100%;
  }
  .app-modal {
    padding: 16px;
  }
  .field-row {
    gap: 8px;
  }
  .login-panel {
    margin-top: 4vh;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  .waiting-banner {
    top: 43%;
  }
  .waiting-banner h2 {
    font-size: 17px;
  }
  .waiting-banner p {
    font-size: 11px;
  }
  .seat-revealed {
    left: 58px;
  }
  .revealed-view .seat:last-child .seat-revealed {
    right: 58px;
  }
  .seat-revealed .playing {
    width: 18px;
    height: 27px;
    font-size: 10px;
  }
  .seat-revealed .playing b {
    font-size: 11px;
  }
  .connection-badge {
    font-size: 10px;
  }
  .controls .action {
    min-height: 49px;
  }
  .hand-tags button {
    min-height: 20px;
  }
  .crowded .seat .portrait {
    width: 40px;
    height: 43px;
    font-size: 26px;
  }
  .crowded .seat {
    width: 75px;
  }
  .crowded .seat .name,
  .crowded .seat .stack {
    font-size: 9px;
  }
  .crowded .seat .backs {
    left: 55px;
    top: 15px;
  }
  .crowded .seat:last-child .backs {
    right: 55px;
  }
  .crowded .seat .action-tag {
    font-size: 8px;
    left: 54px;
  }
  .crowded .seat:last-child .action-tag {
    right: 54px;
  }
  .app-modal {
    max-height: 92dvh;
  }
  .pot-cluster {
    gap: 6px;
  }
}
#game[data-status="waiting"] .center {
  visibility: hidden;
}
.action-money {
  white-space: nowrap;
}
.pot-cluster > .pot {
  line-height: 1.3;
}

/* Every edge seat mirrors its cards and status inward, including 7–9 player tables. */
.seat.seat-right .backs {
  left: auto;
  right: 76px;
  transform: rotate(-13deg);
}
.seat.seat-right .action-tag {
  left: auto;
  right: 75px;
}
@media (min-width: 1100px) {
  .seat.seat-right .backs,
  .seat.seat-right .action-tag {
    right: 106px;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  .seat.seat-right .backs {
    right: 67px;
  }
  .seat.seat-right .action-tag {
    right: 65px;
  }
  .crowded .seat.seat-right .backs {
    left: auto;
    right: 55px;
  }
  .crowded .seat.seat-right .action-tag {
    left: auto;
    right: 54px;
  }
}

.performance {
  background: #203b31;
  border-radius: 5px;
  padding: 18px;
  margin-top: 24px;
  box-shadow: 0 4px #17372b;
}
.performance-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}
.performance-head p {
  margin: 0 0 6px;
  color: #c6d2bc;
  font-size: 12px;
}
.performance-value,
.empty-performance > strong {
  font:
    800 clamp(26px, 5vw, 38px) ui-monospace,
    monospace;
  letter-spacing: -1px;
  color: #4bc292;
}
.performance.negative .performance-value {
  color: #fe5f55;
}
.performance-detail {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
}
.performance-time,
.performance-foot {
  color: #afc2ac;
  font-size: 11px;
}
.performance .balance-chart {
  display: block;
  height: auto;
  max-height: 230px;
  touch-action: pan-y;
}
.performance-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.performance-scrubber {
  width: 100%;
  height: 18px;
  accent-color: #4bc292;
  cursor: pointer;
}
.performance.negative .performance-scrubber {
  accent-color: #fe5f55;
}
@media (max-width: 500px) {
  .performance {
    padding: 12px;
  }
  .performance-head {
    align-items: flex-start;
  }
  .performance-detail {
    font-size: 10px;
    max-width: 50%;
  }
  .performance-foot {
    font-size: 10px;
  }
}

[hidden] {
  display: none !important;
}
.history-oil {
  display: block;
  color: #c9c6a6;
  font-size: 10px;
  margin-top: 3px;
}
.oil-result {
  color: #f3b958 !important;
}

.playing.reveal-hidden > span,
.playing.reveal-hidden > b {
  visibility: hidden;
}
.playing.reveal-hidden:after,
.duel-back:after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 2px solid #fff3df;
  border-radius: 2px;
  background: repeating-conic-gradient(#fe5f55 0 25%, #a63d36 0 50%) 0 0/7px 7px;
}
.duel-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #102f277a;
  pointer-events: auto;
}
.duel-stage {
  width: min(600px, 88vw);
  padding: 18px 24px 12px;
  background: #2c4b40;
  border: 3px solid #e2d6b6;
  border-radius: 5px;
  box-shadow:
    0 7px #173a2c,
    0 0 80px #153a30b3;
  text-align: center;
}
.duel-stage h2 {
  color: #f3b958;
  font-size: 22px;
  letter-spacing: 6px;
  margin: 0 0 16px;
  text-shadow: 2px 3px #19372b;
}
.duel-versus {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
}
.duel-cards {
  display: flex;
  gap: 7px;
  justify-content: center;
  perspective: 600px;
}
.duel-name {
  font-size: 14px;
  font-weight: 750;
  margin-bottom: 12px;
}
.duel-vs {
  font:
    900 24px ui-monospace,
    monospace;
  color: #fda200;
  text-shadow: 2px 3px #a76612;
}
.duel-result {
  display: block;
  height: 27px;
  margin-top: 10px;
  font-size: 22px;
}
.duel-won .duel-result {
  color: #f3b958;
  text-shadow: 1px 2px #a76612;
}
.duel-lost .duel-result {
  color: #a7b6a0;
}
.duel-lost .duel-cards {
  opacity: 0.55;
  filter: saturate(0.5);
}
.duel-caption {
  font-size: 11px;
  color: #d1dbc3;
  margin: 8px 0 0;
}
#game[data-status="settled"] .waiting-banner {
  top: 35%;
  pointer-events: none;
}
@media (max-height: 500px) and (orientation: landscape) {
  .duel-stage {
    width: min(480px, 85vw);
    padding: 10px 18px 7px;
  }
  .duel-stage h2 {
    font-size: 16px;
    margin-bottom: 8px;
  }
  .duel-stage .playing {
    width: 43px;
    height: 60px;
    font-size: 22px;
  }
  .duel-stage .playing b {
    font-size: 25px;
  }
  .duel-name {
    font-size: 11px;
    margin-bottom: 7px;
  }
  .duel-result {
    font-size: 18px;
    height: 20px;
    margin-top: 5px;
  }
  .duel-versus {
    gap: 12px;
  }
  .duel-caption {
    font-size: 10px;
    margin-top: 5px;
  }
}

.settlement-overlay {
  position: absolute;
  inset: 0;
  z-index: 11;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: #18382d45;
}
.settlement-score {
  width: min(380px, 72vw);
  padding: 18px 22px;
  background: #2f4840;
  border: 3px solid #e2d6b6;
  border-radius: 5px;
  box-shadow:
    0 7px #193b2e,
    4px 10px #13392d80;
  transform: rotate(-1deg);
}
.score-winner {
  font-size: 16px;
  font-weight: 850;
  color: #f3b958;
  text-align: center;
  margin-bottom: 14px;
}
.score-winner b {
  display: inline-block;
  background: #fda200;
  color: #fff3df;
  border-radius: 3px;
  padding: 2px 7px;
  box-shadow: 0 3px #a76612;
}
.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin: 10px 0;
  color: #dfe6cd;
}
.score-row strong {
  display: inline-block;
  font:
    900 25px ui-monospace,
    monospace;
  color: #f3b958;
  text-shadow: 2px 3px #203a30;
  opacity: 0;
}
.oil-score strong {
  color: #009dff;
}
.score-divider {
  height: 3px;
  background: #bfc7a133;
  margin: 12px 0;
}
.score-net {
  font-size: 12px;
  text-align: center;
  color: #d9dfc9;
}
.score-net strong {
  display: block;
  font:
    950 clamp(28px, 6vw, 42px) ui-monospace,
    monospace;
  letter-spacing: -1px;
  text-shadow: 2px 4px #1b3c30;
  opacity: 0;
}
.score-net.profit strong {
  color: #4bc292;
}
.score-net.loss strong {
  color: #fe5f55;
}
@media (max-height: 500px) and (orientation: landscape) {
  .settlement-score {
    width: 300px;
    padding: 12px 18px;
  }
  .score-winner {
    font-size: 13px;
    margin-bottom: 8px;
  }
  .score-row {
    font-size: 11px;
    margin: 6px 0;
  }
  .score-row strong {
    font-size: 22px;
  }
  .score-divider {
    margin: 8px 0;
  }
  .score-net strong {
    font-size: 32px;
  }
}

.top > .room:nth-child(2) {
  max-width: clamp(70px, 18vw, 260px);
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top .wordmark,
.top .tiny,
.top .game-switch {
  flex-shrink: 0;
}
.top > .room:not(:nth-child(2)) {
  white-space: nowrap;
  flex-shrink: 0;
}
.seat .name,
.self .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.stack,
.owner-total {
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.duel-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.duel-side {
  min-width: 0;
}
.presets button {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.score-winner {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.waiting-banner .room-result {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.primary-button:active,
.secondary-button:active,
.danger-button:active {
  translate: 0 3px;
  box-shadow: 0 1px #193b2e;
}
.performance.long-pnl .performance-head {
  flex-direction: column;
  align-items: flex-start;
}
.performance.long-pnl .performance-value {
  font-size: 22px;
}
.performance.long-pnl .performance-detail {
  text-align: left;
  max-width: 100%;
}
@media (max-width: 740px) {
  .connection-badge {
    font-size: 0;
    width: 8px;
    flex-shrink: 0;
  }
  .connection-badge:before {
    content: "●";
    font-size: 9px;
    color: #4bc292;
  }
  .connection-badge.offline:before {
    color: #fe5f55;
  }
  .top > .room:nth-child(2) {
    max-width: 100px;
  }
}

.controls .action strong {
  display: block;
  max-width: 100%;
  white-space: nowrap;
}

.hero .self {
  width: 88px;
  min-width: 0;
  flex: 0 0 88px;
  text-align: center;
}
@media (max-height: 500px) and (orientation: landscape) {
  .hero .self {
    width: 64px;
    flex-basis: 64px;
  }
}

.turn {
  gap: 8px;
}
.turn > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.turn .timer {
  flex-shrink: 0;
  white-space: nowrap;
}

/* One card geometry across board, hand, backs, duels and small showdown cards. */
.playing,
.back {
  aspect-ratio: 5/7;
  height: auto !important;
  flex-shrink: 0;
  min-height: 0;
}

.coach-draws {
  margin: 12px 0;
  padding: 12px;
  background: #174f45;
  border-radius: 6px;
  box-shadow: 0 4px #123d36;
}
.coach-draw {
  margin: 12px 0;
}
.coach-draw strong {
  color: #fda200;
  font-size: 14px;
}
.draw-cards {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.draw-cards .playing {
  width: 36px;
  height: auto !important;
  aspect-ratio: 5/7;
  font-size: 17px;
  padding: 4px;
  transform: rotate(-3deg);
}
.draw-cards .playing:nth-child(even) {
  transform: rotate(3deg);
}
.draw-cards .playing b {
  font-size: 19px;
}
.draw-more,
.coach-draws small {
  font-size: 12px;
  line-height: 1.5;
}

/* All product screens share the landscape, single-screen game shell. */
html,
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
.entry-screen {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  justify-content: center;
  padding: clamp(12px, 2vh, 28px) max(16px, env(safe-area-inset-left));
}
.entry-shell {
  width: min(1100px, 100%);
  min-height: 0;
}
.entry-head {
  flex-wrap: nowrap;
  margin-bottom: 16px;
}
.entry-grid {
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.entry-actions {
  width: auto;
  flex-wrap: nowrap;
}
.entry-screen:has(.login-panel) .entry-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 36px;
  max-width: 850px;
}
.login-panel {
  margin: 0;
  width: 100%;
}
.active-rooms {
  margin-top: 10px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.active-room {
  flex: 0 1 180px;
  min-width: 0;
  padding: 7px 10px;
  font-size: 11px;
}
.active-room strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-modal {
  max-width: min(860px, 96vw);
  max-height: calc(100dvh - 16px);
  overflow: hidden;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
}
.app-modal > h2 {
  margin: 0 45px 10px 0;
  flex-shrink: 0;
}
.modal-close {
  position: absolute;
  right: 12px;
  top: 8px;
}
.app-modal {
  position: relative;
}
.modal-content {
  min-height: 0;
  overflow: hidden;
}
.modal-pager,
.list-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 8px;
  flex-shrink: 0;
}
.modal-pager button,
.list-pager button {
  border: 0;
  border-radius: 3px;
  color: #fff3df;
  background: #247d9a;
  padding: 6px 12px;
  box-shadow: 0 3px #163d44;
  min-height: 30px;
}
.modal-pager button:disabled,
.list-pager button:disabled {
  opacity: 0.35;
}
.modal-pager span,
.list-pager span {
  font-size: 12px;
}
.feedback-options {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 12px 0;
  align-items: center;
}
.feedback-options label {
  font-size: 13px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.feedback-options small {
  flex-basis: 100%;
  color: #bfceb1;
  font-size: 11px;
}
.feedback-options input {
  accent-color: #fda200;
}
.landscape-gate {
  display: none;
}
@media (orientation: portrait) {
  #app,
  .modal-backdrop,
  #notifications {
    display: none !important;
  }
  .landscape-gate {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: #2d6b54;
    color: #fff3df;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
  }
  .landscape-gate > span {
    font-size: 70px;
    color: #fda200;
  }
  .landscape-gate strong {
    font-size: 22px;
  }
  .landscape-gate p {
    font-size: 13px;
  }
}
@media (orientation: landscape) and (max-height: 540px) {
  .entry-screen {
    padding: 8px max(14px, env(safe-area-inset-left));
  }
  .entry-head {
    margin-bottom: 8px;
    gap: 8px;
  }
  .entry-head h1 {
    font-size: 20px;
  }
  .entry-head p {
    font-size: 11px;
    margin: 2px 0;
  }
  .entry-actions {
    gap: 6px;
  }
  .entry-actions button {
    padding: 5px 9px;
    font-size: 11px;
    min-height: 32px;
  }
  .wallet-large {
    font-size: 19px;
  }
  .paper-panel {
    padding: 10px 14px;
    border-width: 2px;
  }
  .paper-panel h2 {
    font-size: 16px;
    margin-bottom: 8px;
  }
  .paper-panel p {
    font-size: 11px;
    margin: 6px 0;
  }
  .field {
    font-size: 11px;
    gap: 3px;
    margin-bottom: 6px;
  }
  .field input,
  .field select,
  .inline-input {
    padding: 6px 8px;
    font-size: 16px;
    height: 34px;
  }
  .field-row {
    gap: 8px;
  }
  .primary-button,
  .secondary-button,
  .danger-button {
    min-height: 34px;
    padding: 6px 11px;
    font-size: 12px;
  }
  .error-message {
    font-size: 11px;
    min-height: 14px;
  }
  .entry-grid {
    gap: 12px;
  }
  .entry-screen:has(.login-panel) .entry-shell {
    gap: 24px;
  }
  .app-modal h2 {
    font-size: 17px;
  }
  .app-modal h3 {
    font-size: 14px;
    margin: 8px 0;
  }
  .app-modal p {
    font-size: 12px;
    margin: 7px 0;
  }
  .app-modal td,
  .app-modal th {
    padding: 7px 6px;
    font-size: 11px;
  }
  .stat-row {
    margin: 6px 0;
  }
  .stat-row strong {
    font-size: 17px;
  }
  .performance {
    padding: 9px 12px;
    margin: 8px 0;
  }
  .performance .balance-chart {
    height: 95px;
  }
  .performance-value {
    font-size: 24px;
  }
  .performance-head {
    gap: 8px;
  }
  .performance-detail {
    font-size: 11px;
  }
  .performance-foot {
    font-size: 10px;
  }
  .performance-scrubber {
    margin: 2px 0;
  }
  .game-menu {
    gap: 8px;
  }
}
@media (orientation: landscape) and (max-height: 540px) {
  .entry-head {
    margin-bottom: 6px;
  }
  .entry-grid .field input,
  .entry-grid .field select {
    height: 30px;
    padding: 4px 8px;
  }
  .entry-grid .field {
    margin-bottom: 4px;
    gap: 2px;
  }
  .entry-grid .paper-panel {
    padding: 8px 12px;
  }
  .entry-grid .paper-panel h2 {
    margin-bottom: 5px;
  }
  .entry-grid .paper-panel p {
    margin: 4px 0;
  }
  .entry-grid .error-message:empty {
    min-height: 4px;
  }
  .active-rooms {
    margin-top: 6px;
  }
}
.entry-head > div:first-child {
  min-width: 0;
}
.entry-head p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.entry-actions {
  flex-shrink: 0;
}
@media (orientation: landscape) and (max-height: 540px) {
  .active-room {
    padding: 4px 8px;
    line-height: 13px;
    font-size: 10px;
  }
  .entry-grid .field {
    margin-bottom: 3px;
  }
  .entry-grid .paper-panel h2 {
    margin-bottom: 4px;
  }
}
.room-page-button {
  background: #30483f;
  color: #fda200;
  border: 0;
  font-size: 24px;
  min-width: 32px;
  border-radius: 3px;
  flex-shrink: 0;
}
.room-page-button:disabled {
  opacity: 0.3;
}
:root {
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
/* Safe areas remain symmetric in behavior when the island changes sides. */
#game .top {
  height: calc(43px + var(--safe-top));
  padding-left: calc(14px + var(--safe-left));
  padding-right: calc(14px + var(--safe-right));
  padding-top: calc(4px + var(--safe-top));
}
#game .scene {
  top: calc(43px + var(--safe-top));
  left: var(--safe-left);
  right: var(--safe-right);
  bottom: var(--safe-bottom);
}
.entry-screen {
  padding-left: calc(14px + var(--safe-left));
  padding-right: calc(14px + var(--safe-right));
  padding-top: max(8px, var(--safe-top));
  padding-bottom: max(8px, var(--safe-bottom));
}
.modal-backdrop {
  padding: calc(8px + var(--safe-top)) calc(12px + var(--safe-right))
    calc(8px + var(--safe-bottom)) calc(12px + var(--safe-left));
}
.app-modal {
  max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 16px);
  max-width: min(
    860px,
    calc(100vw - var(--safe-left) - var(--safe-right) - 24px)
  );
}
#notifications {
  top: calc(48px + var(--safe-top));
  max-width: calc(100vw - var(--safe-left) - var(--safe-right) - 24px);
}
#audio-unlock {
  position: fixed;
  top: calc(50px + var(--safe-top));
  left: 50%;
  translate: -50% 0;
  z-index: 90;
  background: #fda200;
  color: #243a34;
  border: 2px solid #ffe2a1;
  border-radius: 4px;
  padding: 7px 12px;
  box-shadow: 0 4px #a76612;
  font-weight: 800;
}
@media (orientation: portrait) {
  #audio-unlock {
    display: none;
  }
}
@media (orientation: landscape) and (max-height: 350px) {
  .entry-head p {
    display: none;
  }
  .entry-head {
    min-height: 32px;
  }
  .entry-grid .field input,
  .entry-grid .field select {
    height: 28px;
  }
  .entry-grid .paper-panel p {
    line-height: 1.2;
  }
  .entry-grid .primary-button,
  .entry-grid .secondary-button {
    min-height: 30px;
  }
}
@media (orientation: landscape) and (max-height: 430px) {
  .coach-draws {
    padding: 6px 8px;
    margin: 5px 0;
  }
  .coach-draws h3 {
    margin: 3px 0;
  }
  .coach-draw {
    margin: 6px 0;
  }
  .coach-draw strong {
    font-size: 12px;
  }
  .draw-cards {
    gap: 5px;
    margin: 5px 0;
  }
  .draw-cards .playing {
    width: 25px;
    padding: 2px;
    font-size: 12px;
  }
  .draw-cards .playing b {
    font-size: 13px;
  }
  .coach-draws small,
  .draw-more {
    font-size: 10px;
  }
  .coach-mode {
    margin-top: 7px;
  }
}
.persistent-settlement {
  pointer-events: auto;
  background: #16362bd9;
  z-index: 25;
}
.final-score {
  width: min(720px, 96%);
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px 16px;
  padding: 14px;
  transform: none;
  max-height: calc(100% - 12px);
}
.final-summary h2 {
  font-size: 20px;
  color: #fda200;
  margin: 0 0 10px;
}
.final-summary p {
  margin: 7px 0;
  font-size: 12px;
}
.final-summary small {
  display: block;
  font-size: 10px;
  color: #cbd2bd;
  margin-top: 10px;
}
.final-self {
  font:
    900 26px ui-monospace,
    monospace;
}
.result-players {
  display: grid;
  gap: 7px;
  align-content: center;
  min-width: 0;
}
.result-players.many-results {
  grid-template-columns: 1fr 1fr;
}
.result-player {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  background: #233e34;
  border-radius: 3px;
  padding: 5px 6px;
  min-width: 0;
}
.result-avatar {
  font-size: 23px;
}
.result-name {
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff3df;
}
.result-player strong {
  font:
    800 12px ui-monospace,
    monospace;
  white-space: nowrap;
}
.result-player.profit,
.final-self.profit {
  color: #85dbaf;
}
.result-player.loss,
.final-self.loss {
  color: #fe5f55;
}
.settlement-actions {
  grid-column: 1/-1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}
.settlement-actions > span {
  font-size: 11px;
  color: #d0d9bd;
}
.score-winner {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (orientation: landscape) and (max-height: 430px) {
  .final-score {
    gap: 8px 12px;
    padding: 10px 12px;
    grid-template-columns: 165px minmax(0, 1fr);
  }
  .result-player {
    padding: 3px 5px;
  }
  .result-players {
    gap: 5px;
  }
  .result-avatar {
    font-size: 20px;
  }
  .final-summary h2 {
    font-size: 18px;
    margin-bottom: 8px;
  }
}
.identity-button {
  background: none;
  color: inherit;
  border: 0;
  padding: 0;
  font: inherit;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wallet-button {
  background: none;
  border: 0;
  padding: 0;
  color: #f3b958;
  cursor: pointer;
}
.profile-avatars {
  display: block;
  gap: 10px;
  border: 0;
  padding: 0;
  margin: 12px 0;
}
.profile-avatars legend {
  font-size: 12px;
  margin-bottom: 8px;
}
.profile-avatars label input {
  position: absolute;
  opacity: 0;
}
.profile-avatars label span {
  display: block;
  padding: 4px;
  border: 2px solid transparent;
  border-radius: 4px;
  font-size: 28px;
  background: #244c3c;
}
.profile-avatars input:checked + span {
  border-color: #fda200;
  box-shadow: 0 3px #a76612;
}
.profile-avatars input:focus-visible + span {
  outline: 3px solid #ffe1a0;
}
@keyframes thinking-dot {
  50% {
    opacity: 0.3;
    translate: 0 -2px;
  }
}
.rule-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.rule-tabs button {
  background: #24594e;
  color: #fff3df;
  border: 0;
  padding: 6px 10px;
  font-size: 12px;
  min-height: 30px;
  border-radius: 3px;
  box-shadow: 0 3px #153e34;
}
.rule-tabs .selected {
  background: #fda200;
  color: #243a34;
  box-shadow: 0 3px #a76612;
}
.rank-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.rank-example {
  background: #25473a;
  border-radius: 4px;
  padding: 6px 8px;
  min-width: 0;
}
.rank-example > strong {
  display: block;
  font-size: 12px;
  color: #fda200;
}
.rank-example em {
  font-style: normal;
  color: #b2bfa9;
  font-size: 10px;
}
.rank-example small {
  font-size: 10px;
  color: #d1d8c5;
}
.rule-cards {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 7px 0;
}
.rule-cards .playing {
  width: 25px;
  height: auto !important;
  aspect-ratio: 5/7;
  padding: 2px;
  font-size: 12px;
  flex-shrink: 0;
}
.rule-cards .playing b {
  font-size: 14px;
}
.rule-cards .playing:nth-child(odd) {
  transform: rotate(-3deg);
}
.rule-cards .playing:nth-child(even) {
  transform: rotate(2deg);
}
.rule-order,
.rule-note {
  font-size: 11px !important;
  line-height: 1.4;
  margin: 6px 0 !important;
  color: #cbd2bd;
}
.quick-rules p {
  font-size: 12px;
  line-height: 1.6;
  margin: 10px 0;
}
.quick-rules b {
  color: #fda200;
}
.special-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 6px;
  background: #25473a;
}
.special-rule > strong {
  color: #fda200;
  font-size: 24px;
}
.special-rule b {
  font-size: 11px;
}
@media (orientation: landscape) and (max-height: 430px) {
  .rank-guide {
    gap: 5px;
  }
  .rank-example {
    padding: 4px 7px;
  }
  .rule-cards {
    margin: 5px 0;
  }
  .quick-rules p {
    margin: 6px 0;
  }
}
#profile-form > button + button {
  margin-left: 10px;
}
.auto-wealth {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  color: #f3b958;
  font:
    800 16px ui-monospace,
    monospace;
}
.auto-wealth small {
  font: 11px system-ui;
  color: #cbd2bd;
}
.controls.is-your-turn {
  outline: 2px solid #fda200;
  outline-offset: 7px;
  border-radius: 4px;
  box-shadow: 0 0 22px #fda20045;
}
.controls.is-your-turn .turn {
  background: #fda200;
  color: #213d32;
  padding: 5px 7px;
  border-radius: 3px;
  font-weight: 900;
  font-size: 13px;
}
.controls.is-your-turn .timer {
  color: #213d32;
  font-size: 10px;
}
.raise-scale {
  display: flex;
  justify-content: space-between;
  margin: 3px 0 10px;
  font:
    700 11px ui-monospace,
    monospace;
  color: #f3b958;
}
.popover:has(#raise-slider) {
  top: 8px;
  bottom: auto;
  max-height: calc(100% - 16px);
}
.popover:has(#raise-slider) .amount {
  font-size: 24px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.controls.is-your-turn {
  outline-offset: -2px;
}
.controls.is-your-turn .turn {
  padding: 2px 7px;
  line-height: 16px;
  font-size: 12px;
}
/* Guidance points to the real table, without a full-screen blocker or long generated prose. */
#tutorial-layer {
  position: absolute;
  inset: 0;
  z-index: 35;
  pointer-events: none;
}
.guide-focus {
  outline: 3px solid #fda200 !important;
  outline-offset: 4px;
  border-radius: 4px;
  box-shadow: 0 0 0 7px #fda20025;
}
.tutorial-caption {
  position: absolute;
  width: min(260px, calc(100% - 16px));
  padding: 10px 12px;
  background: #314b42;
  border: 2px solid #fff3df;
  border-radius: 4px;
  box-shadow: 0 5px #17392e;
  pointer-events: auto;
  color: #fff3df;
}
.tutorial-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.tutorial-heading small {
  color: #d2d8bf;
  font-size: 10px;
}
.tutorial-heading button {
  color: #fff3df;
  border: 0;
  background: none;
  font-size: 20px;
  width: 24px;
  height: 24px;
  padding: 0;
}
.tutorial-caption > strong {
  color: #fda200;
  font-size: 14px;
}
.tutorial-caption p {
  font-size: 12px;
  line-height: 1.55;
  margin: 7px 0;
}
.tutorial-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 9px;
}
.tutorial-actions button {
  color: #fff3df;
  background: #246d85;
  border: 0;
  border-radius: 3px;
  box-shadow: 0 3px #163f46;
  min-height: 30px;
  padding: 5px 9px;
  font-size: 11px;
}
.tutorial-actions .primary-step {
  background: #fda200;
  color: #243c32;
  box-shadow: 0 3px #a76612;
  font-weight: 800;
}
.tutorial-actions button:disabled {
  opacity: 0.3;
}
.deal-guide {
  display: flex;
  gap: 5px;
  margin: 8px 0;
}
.deal-step {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: 5px 2px;
  border: 1px solid #b2bfa74a;
  border-radius: 3px;
  background: #244337;
}
.deal-step + .deal-step:before {
  content: "›";
  position: absolute;
  translate: -7px 3px;
  color: #fda200;
  font-weight: 900;
}
.deal-step.current {
  border-color: #fda200;
  background: #4b5c3a;
}
.deal-step small {
  display: block;
  font-size: 9px;
  margin-top: 5px;
  white-space: nowrap;
}
.deal-backs {
  display: flex;
  justify-content: center;
  gap: 2px;
}
.guide-card-back {
  display: inline-block;
  width: 13px;
  aspect-ratio: 5/7;
  background: repeating-conic-gradient(#fe5f55 0 25%, #a63d36 0 50%) 0 0/5px 5px;
  border: 1px solid #fff3df;
  border-radius: 1px;
  box-shadow: 0 2px #c6bea2;
}
.tutorial-caption .guide-note {
  font-size: 10px;
  color: #cbd3bc;
  line-height: 1.4;
  margin: 5px 0;
}
.settlement-help {
  font-size: 10px !important;
  color: #f3d78d;
  line-height: 1.5;
}
.tutorial-caption .coach-draws {
  padding: 0;
  margin: 5px 0;
  background: none;
  box-shadow: none;
}
.tutorial-caption .coach-draws h3 {
  display: none;
}
.tutorial-caption .coach-draw {
  margin: 7px 0;
}
.tutorial-caption .coach-draw strong {
  font-size: 11px;
}
@media (orientation: landscape) and (max-height: 360px) {
  .tutorial-caption {
    width: 250px;
    padding: 8px 10px;
  }
  .tutorial-caption p {
    font-size: 11px;
    margin: 5px 0;
  }
  .tutorial-actions {
    margin-top: 5px;
  }
}
.tutorial-rule-link {
  background: none;
  color: #f3d18a;
  border: 0;
  border-bottom: 1px dashed #f3d18a;
  padding: 3px 0;
  font-size: 11px;
}
.tutorial-caption.has-draws {
  padding: 8px 10px;
  width: 246px;
}
.tutorial-caption.has-draws .tutorial-heading {
  margin-bottom: 2px;
}
.tutorial-caption.has-draws > strong {
  font-size: 13px;
}
.tutorial-caption.has-draws .coach-draw {
  display: block;
  width: 100%;
  padding: 4px 5px;
  margin: 4px 0;
  border: 1px solid #789276;
  border-radius: 3px;
  color: #fff3df;
  background: #244337;
  text-align: left;
}
.tutorial-caption.has-draws .coach-draw strong {
  font-size: 10px;
  line-height: 12px;
}
.tutorial-caption.has-draws .draw-cards {
  gap: 2px;
  margin: 4px 0 0;
}
.tutorial-caption.has-draws .playing {
  width: 15px;
  padding: 1px;
  font-size: 8px;
  box-shadow: 0 2px #c4bda0;
}
.tutorial-caption.has-draws .playing b {
  font-size: 9px;
}
.tutorial-caption.has-draws .draw-more {
  font-size: 9px;
}
.tutorial-caption.has-draws .guide-note {
  font-size: 9px;
  line-height: 1.3;
  margin: 4px 0;
}
.tutorial-caption.has-draws .tutorial-actions {
  margin-top: 5px;
}
.draw-card-focused {
  outline: 2px solid #fda200;
  outline-offset: 2px;
  box-shadow: 0 0 12px #fda20088 !important;
}
.tutorial-caption.has-draws .playing {
  width: 20px;
  font-size: 10px;
}
.tutorial-caption.has-draws .playing b {
  font-size: 11px;
}
.tutorial-caption.has-draws .coach-draw[aria-pressed="true"] {
  border-color: #fda200;
  box-shadow: 0 0 0 1px #fda200;
}
.tutorial-caption.has-draws {
  padding: 6px 10px;
}
.tutorial-caption.has-draws .coach-draw {
  padding: 3px 5px;
}
.tutorial-caption .guide-word {
  white-space: nowrap;
  color: #ffd47f;
  font-weight: 700;
}

/* Local blind labels share their colors with the two compact explanation rows. */
.guide-blind-small,
.blind-guide-row.small {
  --blind-color: #fda200;
}
.guide-blind-big,
.blind-guide-row.big {
  --blind-color: #009dce;
}
.portrait.guide-blind-small,
.portrait.guide-blind-big {
  outline: 2px solid var(--blind-color);
  outline-offset: 3px;
}
.portrait[data-blind-role]::after {
  content: attr(data-blind-role);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--blind-color);
  color: #fff3df;
  font-size: 11px;
  line-height: 17px;
  font-weight: 900;
  text-shadow: 0 1px #17392e;
  letter-spacing: 1px;
}
.blind-guide {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}
.blind-guide-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
}
.blind-role {
  background: var(--blind-color);
  padding: 2px 5px;
  border-radius: 2px;
  white-space: nowrap;
}
.blind-player {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.blind-guide-row strong {
  flex: none;
  color: #ffcb72;
}

.raise-adjust {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.raise-adjust input[type="range"] {
  flex: 1;
  min-width: 0;
  width: 0;
  margin: 0;
}
.raise-step {
  flex: 0 0 44px;
  height: 44px;
  border: 0;
  border-radius: 3px;
  background: #009dce;
  color: #fff3df;
  box-shadow: 0 3px #174f63;
  font-size: 25px;
  font-weight: 900;
  touch-action: manipulation;
}
.raise-step:disabled {
  opacity: 0.35;
  box-shadow: none;
}
.raise-step:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px #174f63;
}
.raise-step:focus-visible {
  outline: 2px solid #fda200;
  outline-offset: 3px;
}

/* Action/think state belongs to the avatar; optional dialogue gets its own space. */
.decision-badge {
  position: absolute;
  top: -9px;
  left: calc(100% - 12px);
  z-index: 9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: max-content;
  max-width: min(120px, 18vw);
  padding: 4px 6px;
  border: 1px solid #ffe1a0;
  border-radius: 3px;
  background: #fda200;
  color: #243a34;
  box-shadow: 0 3px #a76612;
  font: 850 10px/1.2 system-ui;
  white-space: nowrap;
  text-shadow: none;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.decision-badge::after {
  content: none !important;
}
.decision-badge.is-thinking {
  background: #246d85;
  color: #fff3df;
  border-color: #80c5d5;
  box-shadow: 0 3px #173f4b;
}
.thinking-dots {
  display: inline-flex;
  gap: 2px;
}
.thinking-dots i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  animation: thinking-dot 1s steps(3, end) infinite;
}
.thinking-dots i:nth-child(2) {
  animation-delay: 0.16s;
}
.thinking-dots i:nth-child(3) {
  animation-delay: 0.32s;
}
.portrait .vision-badge {
  position: absolute;
  left: -6px;
  bottom: -4px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px;
  border: 1px solid #fff3df;
  border-radius: 2px;
  background: #08649b;
  color: #fff3df;
  box-shadow: 0 2px #173f4b;
  font: 800 9px/1.2 system-ui;
  white-space: nowrap;
  text-shadow: none;
}
.is-seen .vision-badge {
  background: #fda200;
  color: #243a34;
}
.vision-badge .vision-icon {
  width: 10px;
  height: 7px;
  margin: 0;
}
.controls {
  padding: 8px 8px 14px;
  border: 2px solid transparent;
  border-radius: 5px;
}
.controls.is-your-turn {
  outline: none;
  border-color: #fda200;
  background: #244b3de8;
  box-shadow: 0 4px #173a2c;
}
.controls .turn,
.controls .turn * {
  text-shadow: none;
}
.controls.is-your-turn .turn {
  padding: 3px 6px;
  line-height: 18px;
  margin-bottom: 8px;
}
.controls .actions {
  padding-bottom: 0;
}
.popover:has(#raise-slider) {
  max-height: calc(100% - 24px);
}
.table-phase {
  flex-shrink: 0;
  color: #ffcf78;
  padding: 3px 5px;
  background: #214b3c;
  border-radius: 3px;
  font: 750 10px/1.2 system-ui;
  white-space: nowrap;
  text-shadow: none;
}
.persistent-comparison .primary-button {
  margin-top: 10px;
  min-width: 110px;
  min-height: 38px;
}
.duel-stage {
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  padding-bottom: 16px;
}
.duel-stage .duel-result {
  height: auto;
  min-height: 23px;
  font-size: 15px;
}
@media (max-height: 500px) and (orientation: landscape) {
  .controls {
    padding: 6px 6px 12px;
  }
  .controls .action {
    font-size: 15px;
  }
  .top {
    gap: 7px;
  }
  .top .room:nth-child(2) {
    max-width: 100px;
  }
  .table-phase {
    font-size: 9px;
  }
  .duel-stage {
    padding: 10px 16px 15px;
  }
}

.duel-name small {
  display: block;
  color: #c6d5bf;
  font-size: 9px;
  font-weight: 500;
  margin-bottom: 3px;
}
/* Leave space for the AI marker at the opposite bottom corner. */
.portrait:has(> .badge) .vision-badge {
  left: -14px;
}
/* Final hands use the same card geometry at a smaller scale. */
.final-hand-cards {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding-bottom: 3px;
}
.final-hand-cards .playing {
  width: 28px;
  height: auto !important;
  aspect-ratio: 5/7;
  font-size: 14px;
  line-height: 1;
  padding: 2px 3px;
  border-radius: 3px;
  box-shadow: 0 2px #b8b3a2;
}
.final-hand-cards .playing b {
  font-size: 16px;
}
.final-hand-label {
  display: inline-block;
  max-width: 100%;
  color: #ffcd79;
  font: 800 11px/1.3 system-ui;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.showdown-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #12372de8;
  pointer-events: auto;
}
.showdown-stage {
  width: min(840px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  padding: 12px 14px 18px;
  border: 3px solid #e2d6b6;
  border-radius: 5px;
  background: #2c4b40;
  box-shadow: 0 6px #173a2c;
}
.showdown-stage > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.showdown-stage h2 {
  margin: 0;
  color: #fda200;
  font-size: 18px;
}
.showdown-stage header > span {
  color: #d9dfc6;
  font-size: 10px;
}
.showdown-players {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.showdown-players.dense {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.showdown-player {
  min-width: 0;
  padding: 6px;
  border: 2px solid #7c9c8050;
  border-radius: 3px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  background: #234337;
}
.showdown-name {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  font-size: 11px;
}
.showdown-name > span {
  font-size: 19px;
  line-height: 20px;
}
.showdown-name strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.showdown-player .final-hand-cards {
  grid-column: 1/-1;
}
.showdown-award {
  font-size: 9px;
  color: #a7bdad;
}
.showdown-player.won {
  border-color: #fda200;
  background: #63502b;
  box-shadow: 0 2px #a76612;
}
.showdown-player.won .showdown-award {
  color: #ffcf78;
  font-weight: 900;
}
.showdown-verdict {
  margin-top: 10px;
}
.pot-explanation > strong {
  font:
    800 12px ui-monospace,
    monospace;
  color: #fda200;
}
.pot-explanation p {
  font-size: 12px;
  line-height: 1.4;
  color: #fff3df;
  margin: 5px 0 0;
}
.pot-winners {
  display: block;
  font-size: 10px;
  line-height: 1.3;
  color: #d7e3bf;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 3px 0;
}
.result-pot-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}
.result-pot-tabs button {
  background: #246d85;
  border: 0;
  padding: 4px 8px;
  border-radius: 2px;
  font-size: 10px;
  color: #fff3df;
}
.result-pot-tabs button.selected {
  background: #fda200;
  color: #243a34;
}
.result-pot-choice {
  display: none;
}
.final-summary .result-pot-tabs {
  display: none;
}
.final-summary .result-pot-choice {
  display: block;
  font-size: 10px;
  color: #cbd2bd;
  margin: 7px 0;
}
.result-pot-choice select {
  display: block;
  max-width: 100%;
  width: 100%;
  background: #213e34;
  color: #fff3df;
  border: 1px solid #93aa8c;
  border-radius: 3px;
  padding: 4px;
  font-size: 11px;
}
.final-summary .pot-explanation {
  margin-top: 12px;
}
.final-summary .pot-explanation p {
  font-size: 11px;
}
.final-summary .pot-explanation .pot-winners {
  margin-top: 3px;
}
.result-list {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
}
.result-players {
  align-content: center;
}
.result-player {
  border: 1px solid transparent;
}
.result-player[data-pot-winner="true"] {
  border-color: #fda200;
}
.result-hand {
  grid-column: 1/-1;
  min-width: 0;
  text-align: center;
}
.result-hand .final-hand-label {
  font-size: 10px;
  line-height: 13px;
  display: block;
  margin: 2px 0;
}
.result-hand .final-hand-cards {
  gap: 3px;
}
.result-hand .final-hand-cards .playing {
  width: 19px;
  padding: 1px 2px;
  font-size: 10px;
  border-radius: 2px;
}
.result-hand .final-hand-cards .playing b {
  font-size: 11px;
}
.result-pages {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 10px;
}
.result-pages button {
  border: 0;
  border-radius: 2px;
  background: #246d85;
  padding: 4px 7px;
  color: #fff3df;
  font-size: 10px;
}
.result-pages button:disabled {
  opacity: 0.35;
}
.settlement-actions {
  flex-wrap: wrap;
  gap: 8px;
}
@media (max-height: 500px) and (orientation: landscape) {
  .showdown-stage {
    padding: 9px 11px 15px;
  }
  .showdown-stage > header {
    margin-bottom: 7px;
  }
  .showdown-stage h2 {
    font-size: 16px;
  }
  .showdown-player {
    padding: 4px 5px;
    gap: 3px;
  }
  .dense .showdown-player {
    padding: 3px 4px;
    gap: 2px;
  }
  .dense .showdown-name {
    font-size: 10px;
  }
  .dense .showdown-name > span {
    font-size: 14px;
    line-height: 14px;
  }
  .dense .final-hand-cards {
    gap: 2px;
  }
  .dense .final-hand-cards .playing {
    width: 18px;
    font-size: 9px;
    padding: 1px 2px;
    border-radius: 2px;
  }
  .dense .final-hand-cards .playing b {
    font-size: 10px;
  }
  .dense .final-hand-label {
    font-size: 9px;
    line-height: 11px;
  }
  .dense .showdown-award {
    font-size: 8px;
  }
  .showdown-verdict {
    margin-top: 7px;
  }
  .showdown-verdict .pot-explanation p {
    font-size: 11px;
  }
  .final-score {
    grid-template-columns: 150px minmax(0, 1fr);
  }
  .final-summary p {
    margin: 4px 0;
  }
  .final-summary .pot-explanation {
    margin-top: 8px;
  }
  .settlement-actions button {
    min-height: 30px;
    padding: 5px 9px;
    font-size: 11px;
  }
}
.result-list-heading {
  color: #dfdfc5;
  font: 750 10px/1.2 system-ui;
  text-align: center;
}
/* Keep six result rows, pagination and button shadows inside a landscape screen. */
.result-player {
  row-gap: 3px;
  grid-template-columns: 20px minmax(0, 1fr) auto;
}
.result-avatar {
  font-size: 18px;
  line-height: 18px;
}
.result-hand {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
}
.result-hand .final-hand-label {
  margin: 0;
  text-align: left;
  white-space: normal;
  line-height: 11px;
}
.result-hand .final-hand-cards {
  margin: 0;
  justify-content: flex-end;
}
.result-list {
  min-height: 0;
}
.showdown-verdict .pot-explanation {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 4px 10px;
}
.showdown-verdict .pot-winners {
  margin: 0;
  min-width: 0;
}
.showdown-verdict .pot-explanation p {
  grid-column: 1/-1;
  margin: 0;
  line-height: 1.35;
}
.showdown-verdict .result-pot-tabs {
  grid-column: 1/-1;
  margin: 0;
}
@media (max-height: 500px) and (orientation: landscape) {
  .showdown-players.dense {
    gap: 4px;
  }
  .dense .showdown-player {
    padding: 2px 4px;
    row-gap: 1px;
  }
  .dense .showdown-name,
  .dense .showdown-name > span {
    line-height: 12px;
  }
  .showdown-stage:has(.dense) .result-pot-tabs {
    display: none;
  }
  .showdown-stage:has(.dense) .result-pot-choice {
    display: block;
    font-size: 0;
    margin: 0;
  }
  .showdown-stage:has(.dense)
    .pot-explanation:has(.result-pot-choice)
    > strong {
    display: none;
  }
}
.spacious-results .result-hand {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 10px;
}
.spacious-results .result-hand .final-hand-label {
  white-space: nowrap;
}
.spacious-results .result-hand .playing {
  width: 25px;
  font-size: 12px;
  padding: 2px 3px;
}
.spacious-results .result-hand .playing b {
  font-size: 14px;
}
.final-summary .net-label {
  margin: 4px 0;
  font-size: 11px;
  line-height: 14px;
}
@media (max-height: 500px) and (orientation: landscape) {
  .showdown-stage:has(.dense) {
    padding-top: 8px;
    padding-bottom: 12px;
  }
  .showdown-stage:has(.dense) > header {
    margin-bottom: 5px;
  }
  .showdown-stage:has(.dense) h2 {
    font-size: 15px;
    line-height: 18px;
  }
  .showdown-players.dense {
    gap: 3px;
  }
  .dense .final-hand-cards {
    padding-bottom: 2px;
  }
}
.result-pool-role {
  display: block;
  color: #c7d4be;
  font-size: 8px;
  font-weight: 500;
  line-height: 9px;
  white-space: nowrap;
}
.controls.has-blind-raise .actions {
  gap: 6px;
}
.controls.has-blind-raise .action {
  padding-left: 4px;
  padding-right: 4px;
  font-size: 14px;
  min-width: 0;
}
/* Compact amount-first betting panel, with just two edge shortcuts. */
.popover.raise-popover {
  width: 310px;
  padding: 15px;
  display: grid;
  gap: 14px;
}
.raise-title {
  padding-right: 24px;
  font-size: 13px;
  line-height: 18px;
}
.popover.raise-popover .amount {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  column-gap: 10px;
  font-size: 30px;
  line-height: 36px;
}
.raise-popover .amount small {
  font-size: 11px;
  color: #d6d2b7;
}
.raise-popover .raise-adjust {
  margin: 0;
  gap: 10px;
  align-items: flex-start;
}
.raise-track {
  flex: 1;
  min-width: 0;
  padding-top: 6px;
}
.raise-adjust .raise-track input[type="range"] {
  display: block;
  width: 100%;
  height: 20px;
}
.raise-popover .raise-scale {
  margin: 4px 0 0;
  font-size: 10px;
  line-height: 12px;
}
.raise-popover .raise-step {
  flex-basis: 44px;
  height: 44px;
}
.raise-popover .raise-presets {
  margin: 0;
  gap: 10px;
}
.raise-popover .raise-presets button {
  min-height: 44px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 3px #243334;
}
.raise-popover .raise-presets button.selected {
  background: #fda200;
  color: #243a34;
  box-shadow: 0 3px #a56516;
}
.raise-popover .raise-presets button:focus-visible {
  outline: 2px solid #fff3df;
  outline-offset: 3px;
}
.raise-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #d6d2b733;
  padding-top: 12px;
  padding-bottom: 3px;
}
.raise-payment {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}
.raise-payment span {
  font-size: 10px;
  color: #d6d2b7;
}
.raise-payment strong {
  font:
    800 16px ui-monospace,
    monospace;
  color: #f3b958;
  overflow-wrap: anywhere;
}
.raise-footer .confirm {
  width: auto;
  flex: 0 0 54%;
  min-height: 44px;
}
@media (max-height: 420px) and (orientation: landscape) {
  .popover.raise-popover {
    width: 280px;
    padding: 12px;
    gap: 11px;
  }
  .popover.raise-popover .amount {
    font-size: 27px;
    line-height: 32px;
  }
}
.raise-popover > .close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  margin: 0;
}
.raise-adjust .raise-track input[type="range"] {
  accent-color: #fda200;
}

.portrait-select {
  display: block;
}
.avatar-group {
  margin: 12px 0 18px;
}
.avatar-group h3 {
  margin: 0 0 8px;
  font-size: 14px;
}
.avatar-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.portrait-select button[aria-pressed="true"] {
  border-color: #fda200;
}

/* Existing dialogue must not replay its entry animation after a table snapshot. */
#game .speech {
  animation: none;
}
.dialogue-rail {
  display: none;
}
@media (max-height: 500px) and (orientation: landscape) {
  #game.compact-dialogue .scene {
    top: calc(81px + var(--safe-top));
  }
  #game.compact-dialogue .dialogue-rail {
    position: absolute;
    top: calc(43px + var(--safe-top));
    left: calc(8px + var(--safe-left));
    right: calc(8px + var(--safe-right));
    height: 34px;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    z-index: 8;
  }
  #game .dialogue-rail .speech {
    position: static;
    flex: 0 0 auto;
    max-width: none;
    width: auto;
    margin: 0;
    padding: 5px 9px;
    font-size: 11px;
    line-height: 16px;
    white-space: nowrap;
    transform: none;
    translate: none;
    box-shadow: none;
  }
  #game .dialogue-rail .speech::after {
    display: none;
  }
}

/* A comparison owns its card geometry; table card sizes must not overflow it. */
.duel-overlay {
  padding: 6px;
}
#game .duel-stage {
  width: min(820px, 100%);
  max-width: 100%;
  max-height: 100%;
  overflow: auto;
  padding: 16px 20px;
}
.duel-versus {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
}
.duel-side {
  min-width: 0;
}
.duel-name {
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.duel-name small {
  display: block;
  margin-bottom: 3px;
  font-size: 10px;
  color: #d1dbc3;
}
#game .duel-stage .playing {
  flex: 0 0 auto;
  width: clamp(38px, 7vw, 82px);
  height: auto;
  aspect-ratio: 7 / 10;
  font-size: clamp(20px, 3vw, 36px);
}
#game .duel-stage .playing b {
  font-size: clamp(24px, 3.6vw, 42px);
}
#game[data-game="zjh"] .pot-cluster {
  top: 43%;
}
#game[data-game="zjh"] .center > .phase {
  top: 57%;
  left: 50%;
}
@media (max-height: 500px) and (orientation: landscape) {
  #game .duel-stage {
    width: min(620px, 100%);
    padding: 10px 12px;
  }
  #game .duel-stage .playing {
    width: clamp(34px, 6.5vw, 52px);
    padding: 3px 5px;
    font-size: 22px;
  }
  #game .duel-stage .playing b {
    font-size: 26px;
  }
  .duel-versus {
    gap: 8px;
  }
  .duel-cards {
    gap: 5px;
  }
  .duel-name {
    margin-bottom: 6px;
  }
  #game[data-game="zjh"] .pot-cluster {
    top: 12%;
  }
  #game[data-game="zjh"] .center > .phase {
    top: 30%;
  }
}

/* Seen ZJH actions stay together, with comparison at the far right. */
.controls.has-compare .actions {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr 0.9fr 1.1fr;
  gap: 6px;
}
.controls.has-compare .action {
  min-width: 0;
  padding-left: 4px;
  padding-right: 4px;
  font-size: 17px;
}
.controls .compare-action {
  background: #70529a;
  box-shadow: 0 6px #45335f;
  text-shadow: 1px 2px #45335f;
}
@media (max-height: 500px) and (orientation: landscape) {
  .controls.has-compare .action {
    font-size: 14px;
  }
}

.popover.compare-popover {
  max-height: calc(100% - 180px);
  overflow: auto;
}
.compare-popover .presets {
  display: grid;
  grid-template-columns: 1fr;
}
@media (max-height: 500px) and (orientation: landscape) {
  .popover.compare-popover {
    max-height: calc(100% - 112px);
  }
}
