/* Size the table from its own width so phones and desktops share a single layout. */
body.portrait-game {
  --felt: #0a4438;
  --navy: #101e2a;
  --brass: #b99b60;
  --ivory: #f6e6bc;
  --coral: #f06d58;
  --mint: #66d7ab;
  box-sizing: border-box;
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--ivory);
  background-color: #081a1b;
  background-image:
    radial-gradient(ellipse at 48% 36%, #24443b 0%, #112d29 44%, transparent 76%),
    repeating-linear-gradient(135deg, #ffffff03 0 1px, transparent 1px 5px);
  font-family: Pixel, Georgia, serif;
}
.portrait-game *, .portrait-game *::before, .portrait-game *::after { box-sizing: border-box; }
.portrait-game::before, .portrait-game::after { display: none; }
.portrait-game .portrait-shell {
  container-type: inline-size;
  position: relative;
  isolation: isolate;
  width: min(100%, max(365px, 56.25svh), 550px);
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: clip;
  color: var(--ivory);
  border: 3px solid #111b23;
  border-radius: 2px;
  background: #101e26;
  box-shadow: 0 0 0 1px #ad966357, 0 14px 64px #04100fc9;
}
.portrait-game .portrait-shell > header {
  position: relative;
  inset: auto;
  z-index: 2;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(40px, 1fr) auto minmax(40px, 1fr);
  align-items: center;
  width: 100%;
  min-height: clamp(52px, 15cqi, 78px);
  height: auto;
  margin: 0;
  padding: 5px 3.2%;
  color: var(--ivory);
  border: 0;
  border-bottom: 2px solid #bc9859;
  background: linear-gradient(#2d3e49 0 4%, #1e303c 5% 12%, #152632 67%, #182933 93%, #0e1b24 94%);
  box-shadow: inset 0 1px #63717a, 0 3px #0a2624;
}
.portrait-game header .logo {
  position: static;
  grid-column: 2;
  display: flex;
  align-items: baseline;
  justify-content: center;
  width: auto;
  margin: 0;
  padding: 1px 0 4px;
  color: #f8ebc6;
  font-family: Pixel, Impact, sans-serif;
  font-size: clamp(26px, 8.2cqi, 45px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.085em;
  text-decoration: none;
  white-space: nowrap;
  text-shadow: 0 2px #c5ad82, 2px 4px #563929, 0 5px #07171f;
  transform: none;
  filter: none;
}
.portrait-game header .logo span { color: #ef7866; text-shadow: 0 2px #ae4b42, 2px 4px #633b34, 0 5px #07171f; }
.portrait-game header .logo small, .portrait-game header .local { display: none; }
.portrait-game header nav { position: static; grid-column: 3; justify-self: end; display: flex; gap: 0; }
.portrait-game .settings-toggle {
  display: grid;
  place-items: center;
  width: clamp(40px, 10cqi, 50px);
  height: clamp(40px, 10cqi, 50px);
  min-width: 0;
  margin: 0;
  padding: 0;
  background: #243642;
  color: #c7b68a;
  border: 2px solid #0e1d28;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px #63717a, inset 0 -3px #1a2933, 0 2px #08181f;
  font-size: clamp(23px, 6cqi, 33px);
  line-height: 1;
  text-shadow: 1px 2px #101c20;
}
.portrait-game .arena {
  position: relative;
  isolation: isolate;
  min-width: 0;
  width: 100%;
  max-width: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--ivory);
  background-color: var(--felt);
  background-image:
    radial-gradient(ellipse at 50% 46%, #17614c61, transparent 73%),
    linear-gradient(90deg, #021f2369, transparent 9%, transparent 91%, #021f2369),
    repeating-linear-gradient(0deg, #092f2f35 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, #9cbf8f09 0 1px, transparent 1px 4px),
    repeating-linear-gradient(45deg, #c8d7ab05 0 2px, transparent 2px 8px);
  box-shadow: inset 2px 0 #57726780, inset -2px 0 #243a38;
}
.portrait-game .table {
  position: relative;
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  justify-content: space-between;
  gap: 0;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  margin: 0;
  padding: 3.5cqi 4.5cqi 0;
  overflow: visible;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.portrait-game .table::before, .portrait-game .table::after { display: none; }
.portrait-game .seat {
  position: relative;
  inset: auto;
  min-width: 0;
  min-height: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}
.portrait-game .bot-seat {
  display: grid;
  grid-template-columns: minmax(0, 1.13fr) minmax(0, 1fr);
  grid-template-areas: "profile backs" "cards cards" "total total";
  grid-template-rows: auto minmax(24cqi, auto) auto;
  align-items: center;
  justify-items: center;
  row-gap: 1.15cqi;
}
.portrait-game .bot-profile {
  grid-area: profile;
  justify-self: start;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 2.2cqi;
  align-items: center;
  justify-content: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0;
  color: #efdcad;
  text-align: left;
}
.portrait-game .rival-avatar {
  grid-column: 1;
  grid-row: 1 / span 3;
  display: block;
  width: clamp(66px, 20.5cqi, 107px);
  height: clamp(66px, 20.5cqi, 107px);
  object-fit: cover;
  image-rendering: pixelated;
  border: 2px solid #111e25;
  border-radius: 3px;
  background: #293b46;
  box-shadow: 0 0 0 1px #ac8d56, inset 0 0 0 1px #ceb987, 1px 3px #062726;
}
.portrait-game #bot-name, .portrait-game .bot-profile > div { min-width: 0; }
.portrait-game #bot-name {
  display: block;
  width: max-content;
  max-width: 100%;
  padding: .8cqi 1cqi;
  border: 1px solid #867654;
  border-radius: 2px;
  background: #243738;
  color: #f9df9e;
  box-shadow: inset 0 1px #b3a17a24, 0 2px #0a2e2b;
  font-size: clamp(9px,2.95cqi,15px);
  line-height: 1.4;
  overflow-wrap: anywhere;
  text-shadow: 1px 2px #192923;
}
.portrait-game #bot-status { display: block; margin-top: 1px; color: #c6d7bd; font-size: max(7px,1.7cqi); line-height: 1.65; }
.portrait-game .match-tally, .portrait-game .match-mini {
  color: #e9d8af;
  font-size: max(7px, 1.8cqi);
  line-height: 1.65;
}
.portrait-game #bot-hand {
  grid-area: backs;
  position: static;
  inset: auto;
  display: flex;
  justify-content: center;
  justify-self: center;
  align-items: center;
  gap: 0;
  width: 100%;
  height: auto;
  min-height: 18cqi;
  margin: 0;
  padding: 0;
  transform: none;
}
.portrait-game #bot-hand .back {
  position: relative;
  flex: 0 0 auto;
  width: clamp(39px, 12.2cqi, 65px);
  height: auto;
  aspect-ratio: .70;
  margin: 0;
  padding: 0;
  border: max(2px, .55cqi) solid #f1d3a5;
  border-radius: 3px;
  background-color: #a94642;
  background-image: repeating-conic-gradient(from 45deg, #bb5249 0 25%, #682d3a 0 50%);
  background-size: 8px 10px;
  box-shadow: inset 0 0 0 1px #492a31, inset 0 0 0 3px #d79275, 1px 3px #082c29;
  transform: none;
}
.portrait-game #bot-hand > :first-child:not(:last-child) { transform: translateY(.7cqi) rotate(-9deg); }
.portrait-game #bot-hand > :last-child:not(:first-child) { transform: translateY(.7cqi) rotate(9deg); }
.portrait-game #bot-hand > :nth-child(2):not(:last-child) { z-index: 1; }
.portrait-game #bot-hand > :not(:first-child) { margin-left: -.75cqi; }
.portrait-game #bot-hand .back::before {
  content: "";
  position: absolute;
  inset: 20% 18%;
  width: auto; height: auto;
  border: 1px solid #ebad8a;
  background: transparent;
  transform: none;
}
.portrait-game #bot-hand .back::after {
  content: "♦";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: auto;
  height: auto;
  color: #f4c29c;
  font: bold clamp(12px, 3.8cqi, 20px)/1 Georgia, serif;
  text-shadow: 1px 1px #6c3038;
  transform: none;
}
.portrait-game .player-seat { display: grid; justify-items: center; align-content: start; gap: 1.25cqi; }
.portrait-game #bot-table { grid-area: cards; align-self: end; }
.portrait-game #bot-total { grid-area: total; }
.portrait-game .cards.played {
  position: relative;
  inset: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 24cqi;
  height: auto;
  margin: 0;
  padding: 0 1cqi 1cqi;
  gap: clamp(3px, 1.2cqi, 7px);
  flex-wrap: wrap;
}
.portrait-game .cards.played:empty::before {
  content: "♢";
  display: grid;
  place-items: center;
  width: 16cqi;
  height: 22cqi;
  border: 1px dashed #abbd964a;
  border-radius: 4px;
  color: #b1c49e38;
  font: clamp(15px, 5cqi, 27px)/1 Georgia,serif;
}
.portrait-game :is(#bot-table,#player-table,#player-hand,#bot-hand) .card {
  position: relative;
  inset: auto;
  flex: 0 0 auto;
  display: block;
  min-width: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: max(2px, .5cqi) solid #3f3c32;
  border-radius: clamp(4px, 1.3cqi, 7px);
  color: #29323a;
  background: linear-gradient(135deg,#fff2ce 0%,#f5e3bc 70%,#ead4a5 100%);
  box-shadow: inset 0 0 0 1px #fff5d6, inset -2px -2px #d4bd98, 1px 3px 0 #082c29;
  text-shadow: none;
  opacity: 1;
  filter: none;
  overflow: hidden;
  transform: none;
}
.portrait-game :is(#bot-table,#player-table) .card { width: 16.5cqi; height: 23.1cqi; }
.portrait-game :is(#bot-table,#player-table):has(.card:nth-child(6)) { justify-content: center; gap: 0; }
.portrait-game :is(#bot-table,#player-table):has(.card:nth-child(6)) .card + .card { margin-left: -4.2cqi; }
.portrait-game :is(#bot-table,#player-table):has(.card:nth-child(8)) .card + .card { margin-left: -8.2cqi; }
.portrait-game :is(#bot-table,#player-table,#player-hand,#bot-hand) .card.red { color: #b64338; }
.portrait-game :is(#bot-table,#player-table,#player-hand,#bot-hand) .card .corner {
  position: absolute;
  top: 4%;
  left: 6%;
  display: block;
  margin: 0;
  color: inherit;
  font-family: Pixel, Georgia, serif;
  font-size: clamp(9px, 2.9cqi, 15px);
  line-height: 1.05;
  text-align: center;
  text-shadow: none;
}
.portrait-game :is(#bot-table,#player-table,#player-hand,#bot-hand) .card .corner small {
  display: block;
  margin: 1px 0 0;
  font: bold .82em/1 Georgia,serif;
  color: inherit;
}
.portrait-game :is(#bot-table,#player-table,#player-hand,#bot-hand) .card .corner.bottom {
  inset: auto 6% 4% auto;
  transform: rotate(180deg);
}
.portrait-game .card canvas { image-rendering: pixelated; }
.portrait-game #bot-hand .revealed-card { width: clamp(39px,12.2cqi,65px); height: auto; aspect-ratio: .70; }
.portrait-game #bot-hand .revealed-card .corner { font-size: clamp(6px,1.8cqi,10px); }
.portrait-game :is(#bot-total,#player-total) {
  position: static;
  justify-self: center;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .8cqi;
  min-width: 20.5cqi;
  min-height: max(24px,6.1cqi);
  width: max-content;
  margin: 0;
  padding: 1.15cqi 2.6cqi 1.25cqi;
  border: 1px solid #638171;
  border-radius: 3px;
  background: #163f36;
  box-shadow: inset 0 1px #78928133, 0 2px #052b28;
  color: #f4e7c0;
  text-align: center;
  font-size: max(12px, 3.25cqi);
  line-height: 1;
  text-shadow: 1px 2px #20392e;
}
.portrait-game :is(#bot-total,#player-total) small { color: #c7caab; font-size: .68em; font-weight: normal; }
.portrait-game :is(#bot-total,#player-total).bust { background: #753d36; color: #ffdbb1; }
.portrait-game .table-center {
  position: relative;
  inset: auto;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  align-items: center;
  justify-content: stretch;
  column-gap: 2cqi;
  width: 100%;
  min-height: 10.8cqi;
  margin: 1.9cqi 0;
  padding: 0;
  opacity: 1;
  pointer-events: none;
}
.portrait-game .table-center::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg,transparent,#c8a968 8%,#c8a968 92%,transparent);
  box-shadow: 0 1px #082d2b;
}
.portrait-game .table-center > :not(.center-chip) {
  position: relative;
  inset: auto;
  width: max-content;
  max-width: 100%;
  padding: 1.4cqi 1.7cqi;
  background: #103c32;
  border: 1px solid #9e8e5a;
  border-radius: 2px;
  box-shadow: 0 2px #082d2a;
  color: #e5d4a6;
  font-size: max(7px,1.85cqi);
  font-weight: normal;
  line-height: 1.35;
  white-space: nowrap;
  text-shadow: 0 1px #102d28;
}
.portrait-game .table-center > :first-child { justify-self: start; }
.portrait-game .table-center > :last-child { justify-self: end; }
.portrait-game .table-center #pot { color: #fbd581; }
.portrait-game .table-center .center-chip {
  position: relative;
  inset: auto;
  display: grid;
  place-items: center;
  grid-column: 2;
  justify-self: center;
  width: 7.9cqi; height: 7.9cqi;
  padding: 0;
  border: .45cqi solid #614329;
  border-radius: 50%;
  background: repeating-conic-gradient(#e1c085 0deg 23deg,#934b40 23deg 45deg);
  box-shadow: 0 0 0 1px #d4b470, 0 3px #553d2b;
  transform: none;
  color: #f1d19a;
}
.portrait-game .center-chip::before {
  content: "";
  position: absolute;
  inset: 15%;
  display: block;
  width: auto; height: auto;
  border: 1px solid #e5bd77;
  border-radius: 50%;
  background: #753f35;
  box-shadow: 0 0 0 1px #965d45;
  transform: none;
}
.portrait-game .center-chip::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 22% 24% 24%;
  display: block;
  width: auto; height: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  opacity: 1;
  background: #ffdf9a;
  clip-path: polygon(50% 0,58% 10%,91% 43%,100% 55%,100% 67%,90% 78%,77% 78%,58% 69%,63% 87%,74% 100%,26% 100%,37% 87%,42% 69%,23% 78%,10% 78%,0 67%,0 55%,9% 43%,42% 10%);
  box-shadow: none;
  transform: none;
}
.portrait-game .center-chip > span { display: none; }
.portrait-game .player-seat { min-height: 27cqi; }
.portrait-game .player-seat .seat-title { justify-content: center; }
.portrait-game .seat-title > span { padding: 0; background: transparent; box-shadow: none; }
.portrait-game .seat-title small { margin: 0; }
.portrait-game .hand-area {
  position: relative;
  inset: auto;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  height: auto;
  min-width: 0;
  margin: 0;
  padding: 1.9cqi 0 1.2cqi;
  border: 0;
  background: none;
  box-shadow: none;
}
.portrait-game .hand-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1cqi 2cqi;
  width: 100%;
  margin: 0;
  padding: 0 1cqi;
  color: #c4d0b2;
  font-size: max(6px,1.55cqi);
  line-height: 1.5;
  text-shadow: 1px 1px #153d32;
}
.portrait-game .hand-caption > :first-child { color: #ead7a4; letter-spacing: .05em; }
.portrait-game .hand-controls {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0,1fr) max-content;
  align-items: center;
  gap: 1.8cqi;
  min-width: 0;
  padding: 3.8cqi 0 3cqi;
}
.portrait-game #player-hand {
  position: relative;
  inset: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  align-self: stretch;
  gap: 0;
  min-width: 0;
  min-height: 33.8cqi;
  height: auto;
  width: 100%;
  margin: 0;
  padding: 0 1.1cqi;
  overflow: visible;
}
.portrait-game #player-hand .card {
  --fan-angle: 0deg;
  z-index: 1;
  width: 22.4cqi;
  height: 31.36cqi;
  margin: 0 -.75cqi;
  transform-origin: 50% 90%;
  transform: rotate(var(--fan-angle));
  transition: transform .17s ease-out, outline-color .15s ease-out, box-shadow .15s ease-out;
  outline: 2px solid transparent;
  outline-offset: 1px;
  touch-action: manipulation;
}
.portrait-game #player-hand .card .corner { font-size: clamp(13px,4.15cqi,23px); }
.portrait-game #player-hand .card:first-child:not(:last-child) { --fan-angle: -8deg; }
.portrait-game #player-hand .card:last-child:not(:first-child) { --fan-angle: 8deg; }
.portrait-game #player-hand .card:nth-child(2):not(:last-child) { z-index: 2; }
.portrait-game #player-hand .card.selected, .portrait-game #player-hand .card[aria-pressed="true"] {
  z-index: 3;
  outline: max(2px,.7cqi) solid #eebc58;
  box-shadow: 0 2px 0 1px #8d6937, 1px 6px 0 #092c27, 0 0 10px #e9b24743;
  transform: translateY(-1.8cqi) rotate(var(--fan-angle));
}
@media (hover: hover) and (pointer: fine) {
  .portrait-game #player-hand .card:not(:disabled):hover {
    z-index: 4;
    transform: translateY(-2.3cqi) rotate(var(--fan-angle));
  }
}
.portrait-game #player-abilities {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16cqi;
  margin: 0;
}
.portrait-game #player-abilities .ability-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1cqi;
  width: 16cqi;
  min-width: 44px;
  height: auto;
  min-height: 19cqi;
  padding: 1.3cqi .6cqi;
  border: 2px solid #958065;
  border-radius: 4px;
  background: linear-gradient(150deg,#35414b,#222e3a 70%);
  box-shadow: inset 0 0 0 1px #54606a, 0 3px #072d29;
  text-align: center;
  transform: none;
}
.portrait-game #player-abilities .ability-card .ability-art { font-size: 5.8cqi; line-height: 1; }
.portrait-game #player-abilities .ability-card small { display: none; }
.portrait-game #player-abilities .ability-card b { font-size: max(7px,1.68cqi); line-height: 1.55; overflow-wrap: anywhere; }
.portrait-game #player-abilities .ability-eye .ability-art {
  display: grid;
  position: relative;
  place-items: center;
  width: 10.8cqi;
  height: 10.8cqi;
  margin: 0 auto;
  border: 2px solid #d3ad69;
  border-radius: 32%;
  background: radial-gradient(circle at 45% 40%,#a878ba,#694b85 53%,#3e335c 81%);
  box-shadow: inset 0 0 0 1px #392e4b,inset 0 0 0 3px #b699b5,0 2px #121f2a;
  font-size: 0;
}
.portrait-game #player-abilities .ability-eye .ability-art::before {
  content: "";
  position: absolute;
  inset: 27% 9%;
  background: #f3d6a4;
  clip-path: polygon(0 50%,16% 24%,35% 6%,50% 0,65% 6%,84% 24%,100% 50%,84% 76%,65% 94%,50% 100%,35% 94%,16% 76%);
}
.portrait-game #player-abilities .ability-eye .ability-art::after {
  content: "";
  position: absolute;
  width: 29%;
  height: 36%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 32%,#fbedcc 0 10%,transparent 12%),radial-gradient(circle,#2c253e 0 34%,#9171a9 37% 65%,#392c4d 68%);
}
.portrait-game .ability-card.used::after { inset: auto 0 .5cqi; padding: 1px 0; font-size: max(4px,1cqi); transform: none; }
.portrait-game .actions {
  position: relative;
  inset: auto;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0,1.23fr) minmax(0,1fr) minmax(0,1fr);
  gap: clamp(5px,1.75cqi,9px);
  width: 100%;
  height: auto;
  margin: 0;
  padding: clamp(6px,1.8cqi,10px) clamp(3px,.9cqi,5px) .4cqi;
  border-top: 1px solid #a78f545c;
  background: transparent;
}
.portrait-game .actions .action {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .85cqi;
  width: 100%;
  min-width: 0;
  min-height: max(44px,12.5cqi);
  height: auto;
  margin: 0;
  padding: 1.1cqi .4cqi;
  overflow: hidden;
  border: 2px solid #1b3031;
  border-radius: 5px;
  color: #1b3633;
  background: var(--btn);
  box-shadow: inset 0 2px var(--lit), inset 0 -4px var(--shade), 0 3px #0c2429;
  font-family: Pixel, monospace;
  font-weight: normal;
  font-size: clamp(10px,3.05cqi,16px);
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 1px #fff7;
  touch-action: manipulation;
  transform: none;
}
.portrait-game .actions #play { --btn:#62d3a8; --lit:#bbefba; --shade:#399071; }
.portrait-game .actions #swap { --btn:#eb7963; --lit:#ffc99c; --shade:#af5147; color:#482b2c; }
.portrait-game .actions #stand { --btn:#e0ac55; --lit:#f5d89a; --shade:#a77a3d; color:#493720; }
.portrait-game .actions .action small {
  margin: 0;
  color: currentColor;
  font-size: max(5px,1.4cqi);
  font-weight: normal;
  line-height: 1.4;
  letter-spacing: .015em;
  opacity: .82;
}
.portrait-game .actions .action:not(:disabled):active { transform: translateY(2px); box-shadow: inset 0 1px var(--lit), inset 0 -2px var(--shade), 0 1px #0c2429; }
.portrait-game .actions .action:disabled { opacity: .65; filter: saturate(.58); cursor: default; }
.portrait-game #message { min-height: 1.5em; height: auto; margin: 1.35cqi 0 0; padding: 0; text-align: center; font-size: max(6px,1.5cqi); line-height: 1.5; color:#c6d5b9; }
.portrait-game .actions .action:focus-visible, .portrait-game .settings-toggle:focus-visible, .portrait-game .ability-card:focus-visible { outline: 2px solid #fff2c3; outline-offset: 2px; }
.portrait-game #player-hand .card:focus-visible { outline: 3px solid #fff2c3; outline-offset: 1px; }
.portrait-game #flow { opacity: .2; }
.portrait-game header .logo { animation: none; }
.portrait-game .card .suit { display: none; }
.portrait-game .card canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.portrait-game .table-center { isolation: isolate; }
.portrait-game #bot-abilities { display: flex; align-items: center; justify-content: flex-start; margin: 0; }
.portrait-game #bot-abilities .ability-card {
  position: relative;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  width: auto;
  min-height: 0;
  height: auto;
  gap: 1cqi;
  max-width: 100%;
  margin: 0;
  padding: .65cqi .9cqi;
  background: #1b3636;
  border: 1px solid #6f8471;
  border-radius: 2px;
  box-shadow: none;
  text-shadow: none;
  transform: none;
}
.portrait-game #bot-abilities .ability-card small { display: none; }
.portrait-game #bot-abilities .ability-card b { font-size: max(5px,1.2cqi); line-height: 1.6; }
.portrait-game #bot-abilities .ability-art { font-size: max(8px,2cqi); line-height: 1; }
.portrait-game #bot-abilities .ability-card.used::after { display: none; }
.portrait-game #result { z-index: 9; }
.portrait-game .card .corner { z-index: 1; }
@media (min-width: 650px) {
  body.portrait-game { display: grid; place-items: start center; }
  .portrait-game .portrait-shell {
    width: min(100%,52svh,550px);
    min-height: min(100svh,980px);
  }
}
@media (max-width: 650px) {
  .portrait-game .portrait-shell { width: min(100%,max(365px,61svh)); }
}
.portrait-game .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
@media (pointer: coarse), (max-width: 650px) {
  .portrait-game .actions :is(#play,#stand) small { display: none; }
  .portrait-game .actions #swap small { font-size: max(6px,1.6cqi); line-height: 1.2; }
}
@media (max-width: 370px), (max-height: 680px) {
  .portrait-game .portrait-shell > header { min-height: max(47px,12cqi); }
  .portrait-game .table { padding-top: 2.5cqi; }
  .portrait-game .bot-seat { row-gap: .8cqi; }
  .portrait-game .player-seat { min-height: 25cqi; gap: 1cqi; }
  .portrait-game .table-center { min-height: 8.3cqi; margin-block: .75cqi; }
  .portrait-game .actions { padding-top: 2cqi; }
  .portrait-game #message { margin-top: 1cqi; }
  .portrait-game .hand-controls { padding-block: 3.2cqi 2.4cqi; }
  .portrait-game .hand-caption { gap: .5cqi; }
}
/* Preserve the full-size hit targets and keep the table inside a short phone screen. */
@media (max-width: 650px) and (max-height: 680px) {
  .portrait-game .bot-seat { grid-template-rows: auto minmax(20.8cqi,auto) auto; }
  .portrait-game .player-seat { min-height: 0; }
  .portrait-game .cards.played { min-height: 20.8cqi; }
  .portrait-game :is(#bot-table,#player-table) .card { width: 14.6cqi; height: 20.45cqi; }
  .portrait-game .cards.played:empty::before { width: 14.2cqi; height: 19.9cqi; }
  .portrait-game .table-center { min-height: max(25px,7.4cqi); }
  .portrait-game .table-center .center-chip { width: 7.2cqi; height: 7.2cqi; }
  .portrait-game .hand-controls { padding-block: 2.6cqi 1.4cqi; }
  .portrait-game #player-hand { min-height: 31cqi; }
  .portrait-game #player-hand .card { width: 21.2cqi; height: 29.68cqi; }
  .portrait-game .actions .action { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .portrait-game #player-hand .card { transition: none; }
}
.portrait-game .portrait-shell .hand-area .actions #swap small {
  font: 700 10px/1.05 system-ui, sans-serif;
  font-size: 10px !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: .4px;
  color: #3e2120;
  text-shadow: none;
  opacity: 1;
}

