/* The whole match sits on the illustrated V8 play surface. */
.shell:has(.pt-live) {
  height: 100dvh;
  min-height: 510px;
  max-width: none;
  margin: 0;
  overflow: hidden;
  background: #1e3027;
}
.shell:has(.pt-live)::before,
.shell:has(.pt-live)::after { display: none; }

.pt-live {
  --ivory: #fff1cc;
  --parchment: #ede0b9;
  --gold-edge: #d0ad73;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --shadow-wood: #201813;
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  color: var(--ivory);
  background:
    radial-gradient(ellipse at 50% 43%, #0d322814 18%, #151c15a8 100%),
    var(--arenaV8, var(--boardV6)) center / 100% 100% no-repeat,
    #2b584e;
}

.pt-live button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  font-family: var(--serif);
}
.pt-live button:focus-visible { outline: 2px solid #fff0a4; outline-offset: 3px; z-index: 6; }
.pt-live button:disabled { cursor: default; opacity: .55; }
.live-board {
  height: 100%;
  display: grid;
  grid-template-rows: 50px minmax(0, 1fr) 53px clamp(90px, 16vh, 158px);
}

.live-header {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1fr);
  align-items: center;
  padding: 0 clamp(9px, 3.8vw, 56px);
  background: linear-gradient(180deg, #28271bed, #19281eea);
  box-shadow: 0 1px 0 #a88e5c8c, 0 4px 11px #13180fb1;
}
.live-brand {
  display: flex;
  align-items: center;
  justify-self: start;
  gap: 10px;
  background: transparent;
  border: 0;
  color: var(--parchment);
  padding: 0;
  text-align: left;
}
.live-brand img { display: block; width: clamp(65px, 8vw, 105px); height: auto; }
.live-brand span { font: 700 15px var(--serif); padding-left: 10px; border-left: 1px solid #aa9368a6; white-space: nowrap; }
.live-heading { display: flex; align-items: baseline; gap: 12px; white-space: nowrap; }
.live-heading b { font: 700 17px var(--serif); }
.live-heading small { color: #d3c9aa; font: 12px var(--serif); }
.live-header-actions { justify-self: end; display: flex; gap: 6px; }
.live-header-actions button {
  min-width: 49px;
  min-height: 40px;
  padding: 3px 6px;
  border: 1px solid #a18962a6;
  border-radius: 4px;
  background: #24392fd4;
  color: #f4e1b6;
  font-size: 13px;
}
.live-stage {
  --x-edge: clamp(12px, 4.45vw, 112px);
  position: relative;
  min-height: 0;
  margin: 5px var(--x-edge) 4px;
}
.live-cloth {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 1fr 1.1fr 52px 1.1fr 1fr;
  place-items: center;
  padding: 7px clamp(20px, 5.7vw, 95px);
  border: 1px solid #d0b37a7d;
  border-radius: 36% 36% 17% 17% / 3.8% 3.8% 3.6% 3.6%;
  background: radial-gradient(ellipse at center, #315a4330, #152b2063 73%, #1522199e);
  box-shadow: 0 0 0 2px #302d20bb, 0 0 0 4px #a48b5259, inset 0 0 0 3px #c0ab7224, inset 0 0 60px #131e1282;
}
.live-center-line {
  position: relative;
  display: block;
  width: 88%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #c7b2797d 22%, #f2dd9f91 50%, #ab955f83 78%, transparent);
  box-shadow: 0 1px 0 #26312896;
}
.live-center-line::before {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  top: 50%;
  left: 50%;
  border: 3px double #ab9964;
  outline: 1px solid #c8ae6f;
  background: #344e40;
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: 0 0 0 4px #2a3930;
}
.live-seat {
  position: relative;
  display: flex;
  align-items: center;
  align-self: center;
  justify-content: center;
}
.live-seat-label, .live-seat-tools { position: absolute; min-width: max-content; }
.live-seat-label { right: calc(100% + 19px); text-align: right; }
.live-seat-tools { left: calc(100% + 18px); text-align: center; }
.live-seat-label strong {
  display: block;
  color: #f8e9c6;
  font: 700 clamp(16px, 2.65vh, 29px)/1.05 var(--serif);
  text-shadow: 0 1px 2px #342318, 0 2px 6px #181f18;
}
.live-seat-label small {
  display: inline-block;
  max-width: clamp(72px, 25vw, 153px);
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 6px;
  margin-top: 4px;
  vertical-align: top;
  border: 1px solid #c0a16891;
  border-radius: 2px;
  background: #354a37;
  color: #eee1bd;
  font: 11px var(--serif);
}
.live-seat-foe .live-seat-label small { background: #704235; }
.live-chief {
  position: relative;
  isolation: isolate;
  width: clamp(62px, 9vh, 100px);
  aspect-ratio: 1.12;
  padding: 4px;
  border: 2px solid #eacf92;
  border-radius: 49% 49% 20% 20% / 57% 57% 27% 27%;
  background: linear-gradient(120deg, #725733, #e3c581 25%, #8f7040 72%, #c8a77d);
  box-shadow: 0 0 0 2px #52412b, 0 0 0 4px #a78a55, 0 5px 0 3px #4d3723, 0 10px 12px #121c13;
}
.live-chief-face, .live-unit-face, .live-card-face {
  position: absolute;
  inset: 3px;
  display: block;
  background: var(--live-art, var(--backV6)) center 22% / cover no-repeat, #9e8054;
  border: 1px solid #6f5232;
  pointer-events: none;
}
.live-chief-face { inset: 4px; border-radius: inherit; }
.live-plinth {
  position: absolute;
  z-index: -1;
  left: -10%;
  bottom: -8%;
  width: 120%;
  height: 25%;
  border-radius: 50% / 42%;
  border: 1px solid #b58e59;
  background: linear-gradient(#d0ae71, #8d6940 18%, #553824 50%, #9b7146 80%, #483724);
  box-shadow: 0 4px 0 #3b3023, 0 8px 10px #131b17b8;
}
.live-hp, .live-attack, .live-fee {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 1px solid #f0d28d;
  border-radius: 45%;
  color: #fff3d9;
  font: 700 clamp(13px, 2.4vh, 24px)/1 Georgia, serif;
  text-shadow: 0 1px 1px #5d3229;
  background: radial-gradient(ellipse at 35% 25%, #ba6246, #843a2e 64%, #51271f);
  box-shadow: 0 2px 0 #4f3623, 0 3px 7px #171813b5;
  aspect-ratio: 1;
}
.live-chief > .live-hp { right: -8px; bottom: -4px; width: clamp(23px, 3.8vh, 40px); border-width: 2px; }
.live-armor, .live-speech-hint {
  position: absolute;
  z-index: 2;
  color: #f3e5be;
  border: 1px solid #e2bb75;
  border-radius: 5px;
  background: #375c59;
  font: 700 10px var(--serif);
}
.live-armor { min-width: 25px; padding: 2px; left: -8px; bottom: 0; }
.live-speech-hint { right: -7px; top: -4px; padding: 0 4px; color: #4a3625; background: #ecd5a3; font: 900 10px/11px Georgia, serif; }
.live-speech-muted { color: #3a352b; background: linear-gradient(135deg, #e1d3b2 45%, #813d2a 46% 54%, #e1d3b2 55%); }

.live-chief-skill {
  display: grid;
  gap: 4px;
  justify-items: center;
  min-width: 50px;
  min-height: 46px;
  border: 0;
  padding: 0 2px;
  color: var(--parchment);
  background: transparent;
}
.live-chief-skill i {
  display: grid;
  place-items: center;
  width: clamp(29px, 4.5vh, 43px);
  aspect-ratio: 1;
  border: 3px double #d9b672;
  border-radius: 50%;
  font: 700 clamp(17px, 2.7vh, 25px) Georgia, serif;
  background: radial-gradient(circle at 35% 25%, #80987e, #486352 50%, #254233 78%);
  color: #e6dabd;
  box-shadow: 0 3px 0 #3c352a, 0 6px 7px #15201bab;
}
.live-chief-skill span { color: #e7d7af; font: 600 11px var(--serif); }
.live-power-ready i { background: radial-gradient(circle at 35% 25%, #b8d09e, #52896c 42%, #285840 76%); color: #fff5d1; box-shadow: 0 3px 0 #3c352a, 0 0 13px #a3d9839c; }
.live-foe-hand { display: block; position: relative; width: clamp(29px, 5.2vw, 56px); height: clamp(22px, 4.5vh, 42px); }
.live-foe-hand i {
  position: absolute;
  top: 0;
  left: 21%;
  width: 48%;
  height: 90%;
  border: 1px solid #b79c68;
  border-radius: 3px;
  background: var(--backV6) center / cover;
  box-shadow: 0 2px 3px #161d15;
  transform-origin: 50% 100%;
}
.live-foe-hand i:first-child { transform: translateX(-30%) rotate(-15deg); }
.live-foe-hand i:last-child { transform: translateX(34%) rotate(15deg); }
.live-foe-hand b, .live-deck b {
  z-index: 1;
  position: absolute;
  bottom: -8px;
  right: 0;
  min-width: 21px;
  padding: 1px 4px;
  text-align: center;
  border: 1px solid #b3955c;
  border-radius: 4px;
  color: #f0e4c3;
  background: #223b2d;
  font: 700 13px Georgia, serif;
}

.live-row-mount { width: 100%; min-width: 0; }
.live-seat-mount { justify-self: center; }
.live-formation {
  --unit-max: clamp(52px, 10.6vh, 109px);
  --unit-gap: clamp(5px, 1.1vw, 17px);
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 7px;
}
.live-units {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 0;
  gap: var(--unit-gap);
}
.live-empty { display: flex; gap: 12px; }
.live-empty i {
  display: block;
  width: clamp(36px, 7vw, 64px);
  aspect-ratio: 1.15;
  border: 1px solid #cfbf8e2e;
  border-radius: 30% 30% 12% 12%;
  box-shadow: inset 0 0 9px #181f1644;
}
.live-unit {
  position: relative;
  isolation: isolate;
  width: var(--unit-max);
  max-width: calc((100% - clamp(30px, 7.2vw, 114px)) / 7);
  min-width: 0;
  flex: 0 1 var(--unit-max);
  aspect-ratio: .88;
  padding: 0;
  color: #372619;
  border: 2px solid #d3b67a;
  border-radius: 21% 21% 6% 6% / 13% 13% 6% 6%;
  background: linear-gradient(120deg, #dec687, #98744b 28%, #665039 60%, #9d764a);
  box-shadow: 0 3px 0 #8d6d44, 0 6px 0 #493721, 0 9px 10px #1320149f;
}
.live-unit-face { inset: 2px 2px 19%; border-radius: 18% 18% 3% 3% / 10% 10% 3% 3%; }
.live-unit b, .pt-live-card > b {
  position: absolute;
  bottom: 1px;
  left: 2px;
  right: 2px;
  overflow: hidden;
  padding: 1px;
  white-space: nowrap;
  text-shadow: 0 1px #f0deb3;
  font: 800 clamp(11px, 1.72vh, 19px)/1.05 var(--serif);
  background: linear-gradient(90deg, #bda37b, #f2dfb8 32% 72%, #ad9167);
  color: #392a1c;
}
.live-unit small {
  position: absolute;
  overflow: hidden;
  max-width: 90%;
  top: 2px;
  right: 1px;
  padding: 2px 3px;
  border: 1px solid #b7a36d;
  border-radius: 3px;
  background: #2c523e;
  color: #fff1c7;
  box-shadow: 0 1px 1px #1b291c;
  font: 600 9px var(--serif);
}
.live-unit .live-attack, .live-unit .live-hp { bottom: 16%; width: clamp(15px, 3.05vh, 30px); }
.live-unit .live-attack { left: -4px; background: linear-gradient(140deg, #c49c56, #80562c); }
.live-unit .live-hp { right: -4px; }
.live-unit.live-ready::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 1px solid #a6d19a;
  border-radius: inherit;
  box-shadow: 0 0 8px #b2f5a580;
  pointer-events: none;
}
.live-unit.live-source { transform: translateY(-5px); outline: 2px solid #ffdf85; outline-offset: 3px; }
.pt-live :is(.live-chief, .live-unit).live-target {
  z-index: 4;
  outline: 3px solid #ecab73;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px #6d302f, 0 0 17px #f6bc639c;
}
.live-unit.live-guard { border-color: #dacf9e; border-radius: 8% 8% 29% 29%; }
.live-wounded .live-hp { background: radial-gradient(circle at 30% 25%, #ce7663, #9b3029 71%, #531f1d); }
.live-placements {
  display: grid;
  grid-template-columns: repeat(var(--places), minmax(0, 1fr));
  width: min(100%, calc(var(--places) * (var(--unit-max) + var(--unit-gap))));
  gap: 4px;
}
.pt-live .live-slot-add {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 38px;
  padding: 0;
  border: 1px solid #d3bb7f;
  border-radius: 5px;
  background: linear-gradient(#40664d, #284936);
  color: #fff0c7;
  font-size: 17px;
  box-shadow: inset 0 1px #f1d99a42, 0 3px 4px #18291cba;
}
.pt-live .live-slot-add:hover { background: #56744d; }
.live-placements[data-count="1"] { min-width: 84px; }
.live-picking-position .live-empty { display: none; }

.live-actionbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-width: 0;
  padding-inline: clamp(13px, 6vw, 90px);
  background: linear-gradient(90deg, #152b20e0, #284737b8 45%, #15281de8);
  border-top: 1px solid #ac88526e;
}
.live-turn {
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}
.live-turn [data-live-clock], .live-dialog [data-live-clock] { font: 700 13px Georgia, serif; color: #eee0b9; }
.live-turn [data-live-clock] { min-width: 32px; text-align: center; font-variant-numeric: tabular-nums; }
.live-turn [data-live-clock]:empty, .live-dialog [data-live-clock]:empty { display: none; }
.live-turn .live-clock-soon, .live-dialog .live-clock-soon { color: #ffad87; }
.live-turn button, .live-dialog footer button, .live-loading button {
  min-height: 43px;
  padding: 5px 10px;
  color: #fff1c9;
  border: 1px solid #dbb87b;
  border-radius: 4px;
  font: 700 clamp(14px, 1.4vw, 18px) var(--serif);
  background: linear-gradient(115deg, #a75b40, #993e2d 48%, #762f25 83%, #9c5736);
  box-shadow: inset 0 0 0 2px #c4895c69, 0 2px 0 #513628;
  white-space: nowrap;
}
.live-turn button:hover:enabled, .live-dialog footer button:hover:enabled { filter: brightness(1.13); }
.live-turn [data-live=end] { min-width: 105px; }
.live-turn .live-extend { min-height: 37px; padding: 0 7px; border-color: #93825e; background: #344f42; font: 700 12px var(--serif); }
.live-turn button:disabled { opacity: .69; background: #524837; border-color: #bc9f6c; }
.pt-live[data-turn=own] .live-turn [data-live=end]:enabled { box-shadow: inset 0 1px #ffd6a17d, 0 0 0 2px #c4895c69, 0 2px 0 #513628, 0 0 10px #ee9b6b3b; }
.pt-live[aria-busy=true] :is(.live-turn, .live-placements) button { opacity: .68; cursor: wait; }

.live-prompt {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  width: max-content;
  max-width: calc(100% - 6px);
  padding: 4px 6px 4px 12px;
  border: 1px solid #c5a577;
  border-radius: 6px;
  background: linear-gradient(120deg, #1e3e32, #2d4c3b);
  color: #fff1c9;
  box-shadow: 0 3px 8px #132019ae;
  font: 700 13px var(--serif);
}
.live-prompt-copy { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.live-prompt-copy b { color: #efd592; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-prompt-copy span { white-space: nowrap; }
.live-prompt.live-error { background: #704235; }
.live-prompt button { flex: 0 0 auto; min-height: 35px; padding: 2px 8px; color: #f9e8c0; background: #354b3b; border: 1px solid #bda17a; border-radius: 4px; }
.live-prompt .live-card-confirm { background: #893f30; }

.live-shelf {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(45px, 7vw, 95px);
  gap: clamp(3px, 1vw, 14px);
  align-items: center;
  padding: 5px clamp(12px, 6vw, 90px) max(3px, env(safe-area-inset-bottom));
  border-top: 2px solid #ac8852;
  border-radius: 36% 36% 0 0 / 10% 10% 0 0;
  background: linear-gradient(180deg, #473a2bbd 0%, #292f23ec 6%, #27291ded 66%, #242318 100%);
  box-shadow: inset 0 3px #78634066, 0 -5px 8px #191d1477;
}
.live-resources { display: flex; gap: 7px; align-items: baseline; min-width: 0; font-family: var(--serif); }
.live-resources small { color: var(--parchment); font-size: 13px; white-space: nowrap; }
.live-resources strong { color: #f7ddb0; font: 700 clamp(20px, 2.8vw, 30px) Georgia, serif; white-space: nowrap; }
.live-resources strong i { font-weight: 400; color: #c29e6d; font-size: .65em; }
.live-gems { display: grid; grid-auto-flow: column; gap: 4px; margin: 1px 2px 0; }
.live-gems i { width: 6px; height: 6px; transform: rotate(45deg); border: 1px solid #ae9966; background: #293d33; }
.live-gems .live-gem-lit { background: linear-gradient(135deg, #e5dda5, #a6c598 49%, #4e835e); }
.live-deck { position: relative; justify-self: end; width: clamp(33px, 4.5vw, 62px); height: clamp(45px, 6.1vw, 77px); }
.live-deck i { position: absolute; inset: 0; transform: rotate(7deg); border: 2px solid #b3985d; border-radius: 4px; background: var(--backV6) center / cover; box-shadow: -2px 2px #413022, -5px 4px #7b6b4d, -7px 7px #493b2a, 0 6px 6px #1d2316; }
.live-deck b { bottom: 0; right: -5px; }
.live-hand {
  display: flex;
  align-items: flex-end;
  justify-content: safe center;
  gap: 3px;
  min-height: 0;
  height: 100%;
  padding: 5px 4px 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: #b0915e #22271b;
}
.pt-live-card {
  --width: clamp(62px, 9.2vh, 104px);
  position: relative;
  isolation: isolate;
  display: block;
  flex: 0 0 var(--width);
  width: var(--width);
  height: auto;
  max-height: 100%;
  aspect-ratio: .76;
  padding: 0;
  border: 2px solid #b79962;
  border-radius: 5px;
  background: linear-gradient(110deg, #ac926a, #ecdab4 34%, #e1cca1 76%, #b39763);
  box-shadow: 0 2px 0 #82613e, 0 4px 0 #4f3a28, 1px 5px 7px #131810bb;
}
.pt-live-card:not(.live-card-ready):not([data-live=mulligan-card]) .live-card-face { filter: saturate(.75); }
.live-card-face { inset: 2px 2px 22%; border-radius: 2px 2px 1px 1px; }
.pt-live-card > b { bottom: 1px; color: #35291c; font-size: clamp(12px, 1.65vh, 19px); line-height: 1.25; }
.live-fee { top: 0; left: 0; width: clamp(17px, 2.8vh, 28px); background: radial-gradient(ellipse at 37% 18%, #628b75, #356152, #234c41); }
.live-card-values {
  position: absolute;
  z-index: 2;
  right: 2px;
  bottom: 20%;
  padding: 1px 3px;
  color: #fff0c7;
  background: #533b2bea;
  font: 700 clamp(11px, 1.5vh, 15px)/1 Georgia;
  border: 1px solid #c2a775;
  border-radius: 3px;
}
.live-card-active, .pt-live-card:focus-visible { border-color: #e9d087; box-shadow: inset 0 0 0 2px #f2d790, 0 0 0 2px #e5c47d, 0 0 11px #f1cc869c; }
.live-card-ready::after { content: ""; position: absolute; inset: 0; border: 1px solid #c5d79a; border-radius: inherit; pointer-events: none; }
.live-card-ready:hover { filter: brightness(1.1); }

.live-overlay-layer { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.live-social-menu, .live-speech { position: absolute; }
.live-social-menu { pointer-events: auto; }
.live-speech {
  max-width: min(188px, 44vw);
  padding: 5px 10px 6px;
  color: #3b2d20;
  border: 2px solid #8c704a;
  border-radius: 11px 11px 11px 4px;
  background: linear-gradient(110deg, #fff0cd, #e7d0a4);
  box-shadow: 0 3px 6px #16251cb0;
}
.live-speech small { display: block; color: #795336; font: 650 10px -apple-system, sans-serif; }
.live-speech b { font: 750 15px/1.25 var(--serif); }
.live-social-foe {
  width: 245px;
  padding: 6px 7px 8px;
  color: #372b1d;
  background: linear-gradient(120deg, #eddfbf, #d5bd8c);
  border: 2px solid #9b8051;
  box-shadow: 0 0 0 1px #3b3224, 0 7px 15px #1019108c;
  border-radius: 9px 6px 9px 4px;
}
.live-social-foe header { display: flex; justify-content: space-between; align-items: center; color: #57402a; font: 650 16px var(--serif); }
.live-social-foe header button { width: 38px; height: 36px; border: 0; background: none; color: #57402a; font: 700 20px Georgia; }
.live-social-foe div { display: flex; gap: 3px; }
.live-social-foe div button { flex: 1 0 auto; min-height: 44px; border: 1px solid #775c3c; border-radius: 7px 6px 8px 5px; color: #f2e3b6; background: linear-gradient(#4c6c56, #283e31); font: 650 14px var(--serif); }
.live-social-wheel { width: 252px; height: 154px; isolation: isolate; }
.live-social-wheel::before {
  content: "";
  position: absolute;
  inset: 14px 29px 17px;
  z-index: -1;
  border-radius: 50%;
  filter: drop-shadow(0 4px 4px #17221eac);
  background: radial-gradient(ellipse, #283d33f7 27%, #203328d4 55%, #b09260bb 57%, #1f332bd9 60%, transparent 62%);
}
.live-social-wheel button {
  position: absolute;
  width: 76px;
  height: 44px;
  padding: 0;
  border: 1px solid #735836;
  border-radius: 40% 30% 37% 24% / 36% 32% 32% 33%;
  background: linear-gradient(155deg, #fff2cb, #ecd3a1 57%, #c5a376 95%);
  color: #473626;
  font: 750 16px var(--serif);
  box-shadow: inset 0 0 0 2px #e2c795, 0 0 0 1px #ae9161, 0 3px 2px #28291cd6;
}
.live-social-wheel button:hover:enabled { filter: brightness(1.11); }
.live-social-wheel [data-key=greet] { left: 39px; top: 4px; transform: rotate(-6deg); }
.live-social-wheel [data-key=thanks] { right: 39px; top: 4px; transform: rotate(6deg); }
.live-social-wheel [data-key=nice] { left: 4px; top: 55px; transform: rotate(-3deg); }
.live-social-wheel [data-key=wow] { right: 4px; top: 55px; transform: rotate(3deg); }
.live-social-wheel [data-key=oops] { left: 39px; bottom: 4px; transform: rotate(5deg); }
.live-social-wheel [data-key=challenge] { right: 39px; bottom: 4px; transform: rotate(-5deg); }
.live-social-wheel button[data-live=social-close] { left: 106px; top: 58px; width: 40px; height: 38px; border: 1px solid #ad8a55; border-radius: 50%; background: #34493c; color: #edd7a7; box-shadow: inset 0 0 0 2px #253a31, 0 1px 3px #142619; }

.live-dialog {
  width: min(550px, calc(100vw - 24px));
  max-height: min(85dvh, 720px);
  overflow: auto;
  margin: auto;
  padding: clamp(14px, 3vw, 24px);
  color: #34281b;
  border: 2px solid #ac8a54;
  border-radius: 8px;
  background: linear-gradient(125deg, #ead9b4, #f3e4c3 38%, #daca9e 100%);
  box-shadow: inset 0 0 0 2px #f1dfb6, 0 0 0 3px #564530, 0 16px 36px #0f160fd9;
  font: 15px/1.42 var(--serif);
}
.live-dialog::backdrop { background: #111a15ac; }
.live-dialog header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #c3aa76;
  padding-bottom: 4px;
}
.live-dialog h2 { margin: 0; font: 750 clamp(21px, 4.9vw, 34px)/1.2 var(--serif); }
.live-dialog [data-live-clock] { color: #5c472b; }
.live-dialog .live-clock-soon { color: #a03228; }
.live-dialog p { margin: 10px 0; }
.live-dialog footer, .live-loading > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 16px;
}
.live-dialog footer:empty { display: none; }
.live-dialog footer .live-quiet, .live-loading .live-quiet { border-color: #92734e; color: #ead8b6; background: linear-gradient(#4c6750, #2d4436); box-shadow: 0 2px 0 #333427; }
.live-dialog button:focus-visible { outline-color: #7b4a36; }
.live-dialog .live-dialog-error { margin-top: 8px; padding: 5px 8px; border-left: 3px solid #ab604b; background: #ead19f; color: #6a3026; }
.live-dialog-finish { max-width: 370px; text-align: center; }
.live-dialog-finish header, .live-dialog-finish footer { justify-content: center; }
.live-outcome-seal {
  display: grid;
  place-items: center;
  margin: 17px auto;
  width: 74px;
  height: 74px;
  transform: rotate(-8deg);
  border: 5px double #a74737;
  border-radius: 9px;
  color: #943b30;
  font: 800 47px var(--serif);
}
.live-mulligan-cards { display: flex; justify-content: center; gap: clamp(5px, 1.6vw, 12px); min-height: 0; padding: 2px 3px 8px; }
.live-mulligan-cards .pt-live-card { --width: min(113px, calc((100vw - 78px) / 4 - 4px)); flex-shrink: 1; margin-bottom: 12px; }
.live-mulligan-cards .pt-live-card small {
  position: absolute;
  z-index: 3;
  bottom: -13px;
  left: 14%;
  right: 14%;
  color: #fff2cd;
  border-radius: 3px;
  border: 1px solid #c7ad75;
  background: #365746;
  font: 650 12px/1.3 var(--serif);
}
.live-mulligan-cards .live-card-active small { background: #913e32; }
.live-detail-main { display:flex; align-items: flex-start; gap: 15px; padding-top: 12px; }
.live-detail-art {
  display: block;
  flex: 0 0 30%;
  max-width: 136px;
  aspect-ratio: .79;
  border: 3px double #a58b61;
  background: var(--live-art, var(--backV6)) center 20% / cover, #b79;
  box-shadow: 1px 2px 4px #58472394;
  border-radius: 4px;
}
.live-detail-copy { flex: 1 1 0; min-width: 0; }
.live-detail-copy .live-detail-stats { margin: 0 0 5px; color: #654329; font: 700 13px var(--serif); }
.live-detail-copy b { color: #423224; font-size: 17px; }
.live-detail-copy p { line-height: 1.55; margin: 5px 0 2px; }
.live-detail-copy small { display: block; margin-top: 6px; color: #654329; }
.live-choice-options, .live-menu-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(116px, 100%), 1fr)); gap: 8px; margin-top: 12px; }
.live-choice-options button, .live-menu-items button {
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid #a58b61;
  border-radius: 4px;
  background: #f3e6c4;
  color: #402e24;
  font: 700 15px var(--serif);
  overflow-wrap: anywhere;
}
.live-choice-options button[aria-pressed=true] { background: #3c614b; color: #faf0cd; border-color: #42563b; }
.live-log-list {
  max-height: min(50dvh, 420px);
  overflow: auto;
  padding: 0 0 0 18px;
  margin: 10px 0 0 5px;
  color: #463425;
}
.live-log-list li { margin: 0; padding: 5px 2px; border-bottom: 1px solid #c3aa76a8; }
.live-loading { display: grid; justify-items: center; align-content: center; gap: 10px; height: 100%; grid-row: 1 / -1; background: #23382cbb; font: 700 22px var(--serif); }
.live-loading img { width: 112px; }

@media (max-width: 760px) {
  .live-board { grid-template-rows: 48px minmax(0, 1fr) 52px clamp(92px, 15vh, 134px); }
  .live-header { grid-template-columns: max-content minmax(0, 1fr) max-content; column-gap: 5px; padding-inline: 6px; }
  .live-brand span { display: none; }
  .live-heading { min-width: 0; justify-content: center; gap: 7px; }
  .live-heading b { font-size: 15px; }
  .live-heading small { font-size: 10px; }
  .live-header-actions { gap: 5px; }
  .live-header-actions button { min-width: 44px; min-height: 40px; padding-inline: 5px; }
  .live-cloth { padding: 6px 7px; }
  .live-stage { --x-edge: 7px; margin-top: 5px; }
  .live-actionbar { padding-inline: 9px; }
  .live-turn { gap: 5px; }
  .live-turn button { min-height: 44px; padding: 2px 7px; font-size: 14px; }
  .live-turn [data-live=end] { min-width: 92px; }
  .live-turn .live-extend { padding-inline: 6px; }
  .live-seat-label { right: calc(100% + 15px); min-width: 0; width: max-content; max-width: max(71px, calc(50vw - 69px)); }
  .live-seat-label strong { overflow-wrap: anywhere; }
  .live-seat-tools { left: calc(100% + 15px); }
  .live-shelf { padding-inline: 6px; grid-template-columns: minmax(0, 1fr) 29px; gap: 2px; }
  .live-shelf .live-hand { gap: 2px; padding-inline: 3px; }
  .live-shelf .pt-live-card { --width: clamp(49px, 14.5vw, 82px); }
  .live-shelf .pt-live-card > b { font-size: clamp(10px, 2.9vw, 15px); }
  .live-resources small { font-size: 12px; }
  .live-resources strong { font-size: 20px; }
  .live-gems { grid-auto-flow: row; grid-template-columns: repeat(5, 5px); gap: 3px; }
  .live-gems i { width: 5px; height: 5px; }
  .live-deck { width: 24px; height: 35px; }
  .live-formation { --unit-max: clamp(40px, 15vw, 70px); --unit-gap: 5px; gap: 5px; }
  .live-unit { max-width: calc((100% - 30px) / 7); }
  .live-unit .live-hp, .live-unit .live-attack { width: clamp(14px, 3.3vw, 22px); font-size: clamp(10px, 3.2vw, 17px); }
  .live-unit b { font-family: -apple-system, "PingFang SC", sans-serif; font-size: clamp(9px, 2.6vw, 13px); }
  .live-unit.live-ready::after { inset: -2px; }
  .live-unit small { font-size: 8px; padding: 1px; right: 0; }
  .live-placements { gap: 3px; }
  .pt-live .live-slot-add { min-height: 39px; }
  .live-prompt { max-width: 100%; font-size: 12px; padding-left: 8px; gap: 4px; }
  .live-prompt-copy { gap: 5px; }
  .live-prompt button { padding-inline: 6px; min-height: 38px; }
  .live-dialog footer button { min-height: 44px; }
}
@media (max-width: 350px) {
  .live-turn button { font-size: 12px; }
  .live-unit { border-width: 1px; }
  .live-unit-face { inset: 1px 1px 23%; }
  .live-unit b { left: 1px; right: 1px; font-size: 8px; bottom: 0; }
  .live-heading { gap: 4px; }
  .live-heading b { font-size: 13px; }
  .live-chief-skill span { font-size: 10px; }
  .live-gems { display: none; }
  .live-prompt-copy b { max-width: 64px; }
}

.live-units:not(:has(.live-unit:nth-child(5), .live-slot-add)) .live-unit { max-width: var(--unit-max); }
.live-seat-tools{display:grid;justify-items:center;gap:3px}
.live-weapon,.live-traps{display:block;max-width:75px;padding:3px 4px;color:#f5ddb4;background:#362b20;border:1px solid #a78c63;border-radius:3px;font:600 11px/1.25 var(--serif)}
button.live-weapon:not(:disabled){background:#883d31;border-color:#e1c183}
button.live-weapon:disabled{opacity:.76}
.live-traps{padding:2px 4px;color:#e6c999;background:#2e3e34}

/* Direct manipulation on the jade board. Drag feedback is a separate layer
   so target and insertion highlights never shift the legal hit areas. */
.pt-live :is(.pt-live-card, .live-unit, .live-chief, .live-weapon) {
  -webkit-touch-callout: none;
  user-select: none;
}
.pt-live [data-live-drag="play"] { touch-action: pan-x; }
.pt-live [data-live-drag="attack"] { touch-action: none; }
@media (hover:hover) and (pointer:fine) {
  .pt-live [data-live-drag] { cursor: grab; }
  .pt-live.live-dragging :is(button, [data-live-drag]) { cursor: grabbing; }
}
.pt-live .is-drag-origin { opacity: .42; }
.pt-live .live-formation.live-drop-zone {
  border: 1px dashed #dec588ba;
  border-radius: 6px;
  background: #d1b56f18;
  outline: 2px solid #12281d94;
  outline-offset: 1px;
}
.pt-live :is(.live-slot-add, .live-unit, .live-chief).live-drop-hot {
  z-index: 6;
  outline: 2px solid #ffe2a3;
  outline-offset: 3px;
  box-shadow: inset 0 0 0 1px #f5d48c, 0 0 0 5px #8b5f32, 0 0 14px #dab36291;
}
.pt-live .live-slot-add.live-drop-hot { background: #55704f; }
.live-drag-ghost {
  position: fixed;
  z-index: 25;
  pointer-events: none;
  transform: translate(-50%, -59%);
  filter: drop-shadow(0 7px 5px #161d15c2);
}
.live-drag-ghost > * {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  transform: none;
  pointer-events: none;
}
.live-drag-ghost [aria-hidden="true"] { pointer-events: none; }
@media (pointer:coarse) {
  .live-drag-ghost { transform: translate(-50%, -72%); }
}

.live-quickpeek {
  position: fixed;
  z-index: 21;
  width: min(263px, calc(100vw - 16px));
  max-height: min(66dvh, 370px);
  overflow: hidden;
  padding: 8px 10px 10px;
  pointer-events: none;
  color: #30271c;
  background: linear-gradient(130deg, #f2e5c6, #dfc89c);
  border: 1px solid #b79059;
  border-left: 4px solid #904731;
  border-radius: 3px 6px 6px 3px;
  box-shadow: inset 0 0 0 1px #f9efce, 0 6px 20px #141c15ba;
  font: 500 13px/1.45 var(--serif);
}
.live-quickpeek-name {
  margin: 0;
  padding: 1px 0 5px;
  border-bottom: 1px solid #91694766;
  font: 750 19px/1.2 var(--serif);
}
.live-quickpeek .live-detail-main { gap: 9px; padding-top: 8px; }
.live-quickpeek .live-detail-art { flex: 0 0 58px; width: 58px; margin: 0; }
.live-quickpeek .live-detail-copy b { font-size: 14px; }
.live-quickpeek .live-detail-copy p { line-height: 1.4; }
.live-quickpeek .live-detail-stats { font-size: 12px; margin-bottom: 4px; }
.live-drag-ghost.live-drag-valid {
  filter: drop-shadow(0 5px 4px #12281db8) drop-shadow(0 0 5px #e3c38188);
}
.pt-live .live-formation.live-drop-zone.live-drop-hot { background:#e3c38130; }
