/* The game scene sets the light and colour around each playing surface. */
.fv {
  --fv-ink: #fff4dc;
  --fv-gutter: clamp(10px, 2.4vw, 26px);
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  margin-inline: auto;
  padding: var(--fv-gutter) max(var(--fv-gutter), env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(var(--fv-gutter), env(safe-area-inset-left));
  color: var(--fv-ink);
  background: #12231f;
  color-scheme: dark;
  font-family: "DM Sans", "Helvetica Neue", Arial, "PingFang SC", sans-serif;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
.fv::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, #081712cf, #12251f96 24%, #0a1c19cf 76%, #0c1a17), var(--scene) center 44% / cover no-repeat;
}
.fv > * { min-width: 0; }
.fv :is(button, select, input) { font: inherit; }
.fv button { touch-action: manipulation; }
.fv button:focus-visible, .fv select:focus-visible { outline: 3px solid #fff0ba; outline-offset: 2px; z-index: 3; }
.fv-head, .fv-menu, .fv-board, .fv-log, .fv-result { width: min(100%, 900px); margin-inline: auto; }
.fv-head {
  display: flex;
  align-items: center;
  gap: clamp(5px, 1.2vw, 15px);
  padding: 0 0 clamp(10px, 1.8vw, 18px);
}
.fv-head :is(h1, h2, h3, strong) {
  flex: 1;
  min-width: 0;
  font: 500 clamp(21px, 3.6vw, 36px)/1.1 "Baskervville", Georgia, serif;
  color: #fff4d8;
  overflow-wrap: anywhere;
  letter-spacing: -.035em;
  text-shadow: 0 2px 9px #03120d;
}
.fv-head > :is(div, header) { flex: 1; min-width: 0; }
.fv-head small { display: block; font-size: .74rem; color: #ebd7ad; }
.fv-head > button, .fv-button {
  display: inline-flex; justify-content: center; align-items: center;
  min-height: 44px; min-width: 44px; max-width: 100%;
  padding: 8px 15px; border: 1px solid #728170; border-radius: 9px;
  color: #f6edda; background: #273d34;
  font-weight: 650; text-align: center; line-height: 1.2;
  transition: transform 100ms ease, background-color 130ms ease, border-color 130ms ease;
}
.fv-head > button { padding: 8px 11px; background: #10221fe8; border-color: #657567; }
.fv .fv-button.primary { background: linear-gradient(150deg, #ffdf9e, #e4b670); color: #2a2116; border-color: #ffdf9e; }
.fv .fv-button.quiet { background: #162b25; color: #dddfd0; border-color: #536858; }
.fv .fv-button:disabled { cursor: default; opacity: .54; }
.fv button:enabled:active { transform: translateY(1px); }
.fv-menu {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #81785b; border-radius: 17px;
  background: linear-gradient(135deg, #26392f, #11231f);
  box-shadow: 0 15px 36px #020d0d66;
}
.fv-cover { display: block; width: 100%; height: 100%; min-height: 210px; object-fit: cover; object-position: center; }
.fv-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fv-mode-copy { min-width: 0; align-self: center; padding: clamp(16px, 3.2vw, 34px); }
.fv-mode-copy h2 { font-size: clamp(27px, 4vw, 42px); line-height: 1.12; margin: 0 0 8px; color: #fff4d7; text-wrap: balance; }
.fv-mode-copy p { color: #dbdfd1; font-size: .96rem; line-height: 1.52; margin-bottom: 12px; }
.fv-menu > .fv-actions { grid-column: 1 / -1; padding: 0 var(--fv-gutter) var(--fv-gutter); }
.fv-mode-copy label { color: #e6dcc4; }
.fv select { background: #12241e; border: 1px solid #76826b; color: #fff4db; border-radius: 7px; }
.fv-board {
  display: grid; justify-items: stretch; align-content: start; gap: clamp(9px, 1.5vw, 15px);
  padding: clamp(9px, 2vw, 21px); border: 1px solid #81755a; border-radius: 15px;
  background: linear-gradient(160deg, #172e28ed, #10211eed);
  box-shadow: 0 12px 34px #06120c66;
}
.fv-board > * { min-width: 0; }
.fv-seats { display: flex; align-items: stretch; gap: 6px; }
.fv-seats > span { display: grid; flex: 1 1 0; align-content: center; min-width: 0; min-height: 45px; padding: 5px 9px; background: #12241f; color: #dfdfcd; border: 1px solid #4a5f51; border-radius: 8px; line-height: 1.12; }
.fv-seats > span > :is(small,b) { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fv-seats small { color: #b9cabd; font-size: .72rem; }
.fv-seats b { margin-block: 2px; font-size: .9rem; }
.fv-seats .me { border-color: #92a898; }
.fv-seats .turn { box-shadow: inset 3px 0 #ffd78a; border-color: #bc9c65; background: #2e3e2c; color: #ffedb8; }
.fv-felt {
  position: relative; display: grid; align-content: center; justify-items: center; gap: 10px;
  min-height: clamp(120px, 19vw, 168px); padding: 14px clamp(7px, 2vw, 20px);
  overflow: hidden; border-radius: 12px; border: 1px solid #60715d;
  background: radial-gradient(ellipse at 50% 35%, #355b47, #254635 64%, #163328);
  box-shadow: inset 0 1px 12px #0a1d1866;
}
.fv-felt > small { color: #eaddbc; font-weight: 650; letter-spacing: .015em; text-align: center; }
.fv-felt > strong { color: #faedc9; font: 500 clamp(18px, 3vw, 27px)/1.15 Georgia, serif; }
.fv-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; }
.fv-mode-copy .fv-actions { justify-content: flex-start; }
.fv-hand, .fv-trick, .fv-kitty, .fv-bottom-cards, .fv-melds { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 3px; }
.fv-hand { padding: 9px 0 1px; row-gap: 11px; }
.fv-card, .fv-tile {
  display: inline-flex; flex: none; flex-direction: column; align-items: center; justify-content: space-evenly;
  width: 39px; min-width: 0; height: 57px; min-height: 0; padding: 2px; user-select: none;
  color: #232722; border: 1px solid #b7a987; border-radius: 5px;
  background: linear-gradient(135deg, #fffdf1, #f2e9cd); box-shadow: 0 2px 4px #02150d66;
  font-family: Georgia, "Songti SC", serif; line-height: 1;
}
.fv-card > b, .fv-tile > b { font-size: 20px; }
.fv-card > i, .fv-tile > i { font-style: normal; font-size: 16px; }
.fv-card.is-red, .fv-tile.suit-0, .fv-tile.suit-3 { color: #a3302d; }
.fv-tile.suit-1 { color: #25447b; }
.fv-tile.suit-2 { color: #186247; }
.fv-hand > :is(button.fv-card,button.fv-tile) { transition: transform 120ms ease, box-shadow 120ms ease; }
.fv .fv-hand .selected { transform: translateY(-7px); border-color: #ffde81; background: #fff0bd; box-shadow: 0 0 0 2px #eebd55, 0 6px 6px #081c174f; }
.fv-kitty i { width: 29px; height: 40px; border-radius: 3px; border: 2px solid #d3be87; background: repeating-linear-gradient(40deg,#753328 0 2px,#8b5742 2px 4px); box-shadow: 0 2px 3px #18221a; }
.fv-trick { gap: 2px; }
.fv-trick .fv-card { width: 30px; height: 40px; }
.fv-trick .fv-card b { font-size: 16px; }
.fv-trick .fv-card i { font-size: 12px; }
.fv-bottom-cards { gap: 3px; color: #e2d8b8; font-size: .76rem; }
.fv-bottom-cards .fv-card, .fv-melds .fv-tile, .fv-rivers .fv-tile { width: 22px; height: 27px; border-radius: 3px; box-shadow: none; padding: 1px; }
.fv-bottom-cards b, .fv-melds b, .fv-rivers b { font-size: 12px; }
.fv-bottom-cards i, .fv-melds i, .fv-rivers i { font-size: 10px; }
.fv-tile { border-color: #bbba9d; box-shadow: inset 0 -4px #77a38b, 0 2px 3px #09231b99; padding-bottom: 5px; }
.fv-rivers { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: min(100%, 640px); gap: 5px 9px; }
.fv-rivers > div { min-width: 0; text-align: center; padding: 4px 2px; border-radius: 5px; background: #10271e77; }
.fv-rivers small { display: block; font-size: .67rem; color: #e1e1c7; overflow-wrap: anywhere; }
.fv-rivers > div > span, .fv-melds > span { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2px; }
.fv-rivers > div > span { min-height: 27px; }
.fv-melds { gap: 8px; }
.fv-melds:empty { display: none; }
.fv-log { padding: 6px 2px; color: #dedcc9; font-size: .82rem; line-height: 1.4; overflow-wrap: anywhere; }
.fv-result { color: #ffedb8; padding: 14px; border: 1px solid #bd9b5d; border-radius: 10px; background: linear-gradient(120deg,#443d23,#24372b); text-align: center; }

/* Each button straddles an intersection. Stop the interior files at the river. */
.fv-chess {
  display: grid; grid-template: repeat(10,minmax(0,1fr)) / repeat(9,minmax(0,1fr));
  position: relative; isolation: isolate; width: min(100%, 432px); aspect-ratio: 9 / 10; justify-self: center;
  border: 2px solid #724524; outline: 1px solid #b99259; border-radius: 6px; overflow: hidden;
  background: repeating-linear-gradient(1deg, transparent 0 17px, #8a512210 18px, transparent 21px), linear-gradient(105deg, #d79c5b, #f5d397 43%, #e6b16b);
  box-shadow: 0 4px 9px #07170f66; container-type: inline-size;
}
.fv-chess::before, .fv-chess::after {
  content: ""; position: absolute; left: 38.888889%; width: 22.222222%; height: 20%; pointer-events: none; z-index: -1;
  background: linear-gradient(to top right,transparent 49.45%,#80562d 49.65% 50.35%,transparent 50.55%), linear-gradient(to bottom right,transparent 49.45%,#80562d 49.65% 50.35%,transparent 50.55%);
}
.fv-chess::before { top: 5%; } .fv-chess::after { bottom: 5%; }
.fv-chess > button {
  --left: 0%; --right: 100%; --top: 0%; --bottom: 100%;
  position: relative; display: grid; place-items: center; width: 100%; height: 100%; min-height: 0; min-width: 0; padding: 0; border-radius: 0;
  background: linear-gradient(to right, transparent var(--left), #80562d var(--left) var(--right), transparent var(--right)) center / 100% 1px no-repeat, linear-gradient(to bottom, transparent var(--top), #80562d var(--top) var(--bottom), transparent var(--bottom)) center / 1px 100% no-repeat;
}
.fv-chess > button:disabled { opacity: 1; }
.fv-chess > button:nth-child(9n+1) { --left: 50%; }
.fv-chess > button:nth-child(9n) { --right: 50%; }
.fv-chess > button:nth-child(-n+9), .fv-chess > button:nth-child(n+47):nth-child(-n+53) { --top: 50%; }
.fv-chess > button:nth-last-child(-n+9), .fv-chess > button:nth-child(n+38):nth-child(-n+44) { --bottom: 50%; }
.fv-chess button > span {
  width: 85%; height: 85%; display: grid; place-items: center; z-index: 1; margin-bottom: 2%;
  border: 2px solid #885e33; border-radius: 50%; color: #242720;
  background: radial-gradient(circle at 40% 30%, #ffebba, #eac487 64%, #c69660);
  box-shadow: inset 0 0 0 1px #f8e0aa, inset 0 0 0 2px #ad8b58, 0 2px 1px #6b411e;
  font: 700 clamp(16px, 5.8cqi, 27px)/1 Georgia, "Songti SC", "SimSun", serif;
}
.fv-chess .red > span { color: #9f3023; }
.fv-chess .selected > span { background: #ffe8a1; box-shadow: 0 0 0 2px #316b62, inset 0 0 0 2px #e1b971; }
.fv-chess .last { box-shadow: inset 0 0 0 2px #916944a1; border-radius: 10%; }
.fv-chess .legal::after { content: ""; position: absolute; z-index: 2; width: 22%; aspect-ratio: 1; border-radius: 50%; background: #19715e; outline: 1px solid #f9e8b6; }
.fv-chess .legal:has(span)::after { width: 86%; background: transparent; border: 3px solid #237966; outline: 0; }
.fv .fv-chess > button:active { transform: none; }

.fv-links {
  position: relative; display: grid; width: min(100%, 540px); margin-inline: auto; justify-content: center;
  background: linear-gradient(140deg,#284a3b,#142c23); border: 1px solid #688166; border-radius: 9px; isolation: isolate;
}
.fv-links > button {
  display: grid; place-items: center; aspect-ratio: 1; min-width: 0; min-height: 0; padding: 0; margin: 2px;
  color: #25402e; font-size: clamp(19px,5.3vw,34px); line-height: 1;
  border: 1px solid #ccc39b; border-radius: 17%; background: linear-gradient(155deg,#fff7d9,#e0cb9b);
  box-shadow: inset 0 -3px #b79c6c, 0 2px 2px #122a1d77;
}
.fv-links > .empty, .fv-links > .blocked { border: 0; box-shadow: none; }
.fv-links > .empty { background: transparent; }
.fv-links > .blocked { background: repeating-linear-gradient(145deg,#3f5140 0 8px,#465b47 8px 13px); }
.fv-links > .selected, .fv-links > .hint { background: #fff0ba; border-color: #ffdb80; box-shadow: inset 0 0 0 2px #d19b31, 0 0 0 1px #ffe2a0; }
.fv-path { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 4; }
.fv-path :is(path,polyline,line) { fill: none; stroke: #ffe890; stroke-width: 3px; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }

.fv-pool { position: relative; width: min(100%,740px); margin-inline: auto; }
.fv-pool canvas { display: block; width: 100%; height: auto; touch-action: none; border-radius: 12px; box-shadow: 0 4px 12px #061711a8; }
.fv-board :is(input[type="range"],input[type="number"]) { min-width: 0; accent-color: #edc881; }
.fv-board input[type="range"] { width: min(100%,340px); min-height: 34px; padding: 0; background: transparent; border: 0; }
.fv-chase-grid {
  position: relative; isolation: isolate; display: grid; grid-template: repeat(11,minmax(0,1fr)) / repeat(15,minmax(0,1fr));
  width: min(100%,610px); margin-inline: auto; aspect-ratio: 15/11; border: 2px solid #9d8762; border-radius: 8px; overflow: hidden;
  background: #344551; box-shadow: 0 4px 13px #06142577; container-type: inline-size; touch-action: manipulation;
}
.fv-chase-grid > :is(.wall,.floor,.gate,.key) { position: relative; min-width: 0; min-height: 0; padding: 0; }
.fv-chase-grid .floor { background: linear-gradient(150deg, #546275, #424f61 80%); box-shadow: inset 1px 1px #70839335; }
.fv-chase-grid .wall { background: repeating-linear-gradient(0deg,#423d4b 0 1px,#745447 1px 5px,#855e4d 5px 7px); border-top: 2px solid #9e7660; box-shadow: inset 2px 0 #614a44, 1px 2px 1px #28363d; }
.fv-chase-grid .gate { background: repeating-linear-gradient(90deg,#1e5c58 0 18%,#66a48b 18% 25%); box-shadow: inset 0 0 0 2px #a6d6ab; }
.fv-chase-grid .key { color: #ffe6a3; background: radial-gradient(#917943,#4d5966); }
.fv-actor { display: grid; place-items: center; color: white; border-radius: 50%; font-weight: 800; line-height: 1; text-shadow: 0 1px #293a3c; z-index: 2; pointer-events: none; }
.fv-actor.hunter { background: #287d8b; border: 2px solid #bbe5ed; }
.fv-actor.runner { background: #bf612c; border: 2px solid #ffdf9d; }
.fv-dpad { display: grid; grid-template-columns: repeat(3,minmax(0,50px)); justify-content: center; gap: 4px; }
.fv-dpad > button { min-width: 0; padding: 3px; font-size: 18px; font-weight: 700; }
.fv-dpad > button:first-of-type { grid-column: 2; }
.fv-dpad > button:nth-of-type(2) { grid-column: 1; }
.fv-hero, .fv-tactic {
  border: 1px solid #8b795b; border-radius: 8px; padding: 8px 10px; color: #f9ebcf;
  background: linear-gradient(140deg,#574334,#302d28); min-width: 0; overflow-wrap: anywhere;
}
.fv-hero.current { border-color: #f1c97a; box-shadow: inset 0 0 0 1px #dbaf66; }
.fv-tactic { background: linear-gradient(120deg,#eee0b6,#cab48a); color: #342a20; box-shadow: 0 2px 3px #03130d66; }
.fv-tactic.selected { outline: 2px solid #ffcf78; outline-offset: 1px; }
@media (hover:hover) and (pointer:fine) {
  .fv :is(.fv-button,.fv-head > button):enabled:hover { border-color: #edca86; filter: brightness(1.10); }
  .fv-hand button:enabled:hover { box-shadow: 0 0 0 2px #e1bc72, 0 3px 6px #081c1759; }
  .fv-chess > button:enabled:hover { box-shadow: inset 0 0 0 1px #835d36; }
  .fv-links button:enabled:not(.empty):hover { outline: 2px solid #f9db81; outline-offset: -3px; }
}
@media (max-width:630px) {
  .fv-menu { grid-template-columns: 1fr; }
  .fv-cover { min-height: 0; aspect-ratio: 2.35; height: auto; max-height: 235px; }
  .fv-mode-copy { padding: 16px; }
  .fv-seats { gap: 3px; }
  .fv-seats > span { padding: 5px; }
  .fv-head > button, .fv-actions .fv-button { padding-inline: 10px; }
  .fv-rivers { gap: 4px; }
  .fv-rivers .fv-tile { width: 16px; height: 22px; }
  .fv-rivers .fv-tile > b { font-size: 10px; }
  .fv-rivers .fv-tile > i { font-size: 8px; }
}
@media (max-width:420px) {
  .fv { --fv-gutter: 7px; }
  .fv-board { padding: 8px; gap: 8px; }
  .fv-head { gap: 4px; }
  .fv-head > button { padding-inline: 7px; font-size: .83rem; }
  .fv-seats b { font-size: .8rem; }
  .fv-seats small { font-size: .66rem; }
  .fv-hand { gap: 8px 3px; }
  .fv-hand .fv-card, .fv-hand .fv-tile { width: clamp(29px, calc((100% - 21px) / 8), 40px); height: 49px; }
  .fv-hand :is(.fv-card,.fv-tile) > b { font-size: 18px; }
  .fv-felt { min-height: 98px; padding: 8px 3px; gap: 7px; }
  .fv-links > button { margin: 1px; }
}
@media (orientation:landscape) and (max-height:550px) {
  .fv { --fv-gutter: 7px; }
  .fv-board { padding: 8px; gap: 7px; }
  .fv-head { padding-bottom: 6px; }
  .fv-cover { max-height: 230px; }
  .fv-felt { min-height: 78px; gap: 6px; padding-block: 6px; }
  .fv-chess { width: min(100%,66svh); }
  .fv-chase-grid { width: min(100%,100svh); }
  .fv-pool { width: min(100%,135svh); }
}
@media (prefers-reduced-motion:reduce) {
  .fv *, .fv *::before, .fv *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* The SVG has one extra cell around each side for routes around the garden. */
.fv-map-head, .fv-tip { text-align: center; color: #f1ddb3; font-size: .86rem; }
.fv-link-wrap { position: relative; isolation: isolate; width: min(100%, 470px); margin-inline: auto; aspect-ratio: calc((var(--w) + 2) / (var(--h) + 2)); }
.fv-link-wrap .fv-links { position: absolute; inset: calc(100% / (var(--h) + 2)) calc(100% / (var(--w) + 2)); width: auto; margin: 0; border: 0; grid-auto-rows: minmax(0,1fr); }
.fv-link-wrap .fv-links > button { aspect-ratio: auto; }
.fv-path { filter: drop-shadow(0 0 2px #f2b654); }
.fv-links > button:disabled { opacity: 1; }
.fv-links > .blocked { color: #b4d19b; }
.fv-links > .hint { outline: 2px dashed #513b24; outline-offset: -5px; }
.fv-hero-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.fv-hero { display: grid; grid-template-columns: auto 1fr; align-content: center; align-items: center; column-gap: 9px; }
.fv-hero > i { grid-row: span 3; font-size: 25px; color: #edd5a1; font-style: normal; }
.fv-hero > b { font-family: Georgia, serif; line-height: 1.18; font-size: 1.08rem; }
.fv-hero > span { color: #ffd0ad; font-size: .83rem; }
.fv-hero > small { font-size: .7rem; color: #e1d0b8; }
.fv .fv-felt.hero { margin: 0; min-height: 100px; border-radius: 10px; background: radial-gradient(ellipse at 50% 100%,#634d39,#332d27); }
.fv .fv-felt.hero::after { content: none; }
.fv-tactic { display: grid; justify-items: center; align-content: center; gap: 4px; width: clamp(54px, 11vw, 82px); min-height: 65px; padding: 5px; }
.fv-tactic > i { font: 500 23px/1.1 Georgia,serif; color: #76422c; }
.fv-tactic > b { font-size: .8rem; line-height: 1.1; }
.fv-hand.tactics { row-gap: 7px; }
@media (max-width:420px) {
  .fv-hero { padding: 7px; column-gap: 5px; }
  .fv-hero > i { font-size: 20px; }
  .fv-hero > b { font-size: .9rem; }
}
@media (orientation:landscape) and (max-height:550px) {
  .fv-link-wrap { width: min(100%, 83svh); }
}
.fv-chess > button:nth-child(39)::before,
.fv-chess > button:nth-child(43)::before {
  position: absolute; top: 100%; left: 50%; transform: translate(-50%,-50%); z-index: 0;
  color: #81532c; font: 600 clamp(10px,3.7cqi,17px)/1 Georgia,"Songti SC",serif;
  letter-spacing: .14em; white-space: nowrap; pointer-events: none;
}
.fv-chess > button:nth-child(39)::before { content: "楚河"; }
.fv-chess > button:nth-child(43)::before { content: "漢界"; }
.fv .pool-controls { align-items: center; }
.pool-controls label { display: flex; align-items: center; gap: 6px; color: #efddae; padding-inline: 5px; }
.fv .pool-controls input[type="range"] { width: clamp(60px,14vw,140px); }
.fv-chase-grid > .fv-actor {
  position: absolute; width: 5.4%; aspect-ratio: 1; transform: translate(-50%,-50%);
  font: 700 clamp(9px,3.3cqi,20px)/1 Georgia,serif; box-shadow: 0 2px 3px #0f1d2d9c;
  transition: left 115ms ease-out, top 115ms ease-out;
}
.fv-actor.me { outline: 1px dashed #fff1c5; outline-offset: 1px; }
.fv-chase-grid > i { font-style: normal; }
.fv-chase-grid .gate { display: grid; place-items: center; color: #ebffd2; }
.fv-chase-grid .key { font-size: 0; }
.fv-chase-grid .key::before, .fv-chase-grid .key::after { content: ""; position: absolute; pointer-events: none; }
.fv-chase-grid .key::before { width: 34%; aspect-ratio: 1; top: 17%; left: 21%; border: max(2px,.45cqi) solid #ffe295; border-radius: 50%; }
.fv-chase-grid .key::after { width: 33%; height: 15%; top: 49%; left: 47%; background: #ffe295; border-radius: 1px; transform: rotate(45deg); box-shadow: .34cqi .65cqi 0 -.12cqi #ffe295; }
.fv-dpad .dash { grid-column: 1 / -1; font-size: .88rem; }
@media (min-width:600px) and (max-height:550px) and (orientation:landscape) {
  .fv-board:has(> .fv-chase-grid), .fv-board:has(> .fv-link-wrap), .fv-board:has(> .fv-chess) { grid-template-columns: minmax(0,1fr) minmax(160px,.48fr); align-items: center; }
  .fv-board > :is(.fv-chase-grid,.fv-link-wrap,.fv-chess) { grid-column: 1; grid-row: 1 / span 3; }
  .fv-board:has(> .fv-chase-grid) > :not(.fv-chase-grid), .fv-board:has(> .fv-link-wrap) > :not(.fv-link-wrap), .fv-board:has(> .fv-chess) > :not(.fv-chess) { grid-column: 2; }
  .fv-chase-grid { width: min(100%, 98svh); }
  .fv-link-wrap { width: min(100%,76svh); }
}
/* The cover is an original triptych. Its three woodcut portraits also identify the players. */
.fv-hero[data-hero] > i {
  width: clamp(30px,6vw,57px); height: clamp(39px,7vw,64px); border-radius: 5px; border: 1px solid #bea57d;
  background-image: var(--scene); background-repeat: no-repeat; background-size: auto 330%;
  font-size: 0; box-shadow: 0 2px 3px #281c1199;
}
.fv-hero[data-hero="0"] > i { background-position: 23% 37%; }
.fv-hero[data-hero="1"] > i { background-position: 49% 34%; }
.fv-hero[data-hero="2"] > i { background-position: 77% 42%; }
.fv-chase-grid {
  background: linear-gradient(150deg,#152b3dc9,#18283bcc), var(--scene) center / cover;
}
.fv-chase-grid .floor { background: linear-gradient(150deg,#617285f5,#48586bf5 85%); }
.fv-chase-grid .wall { background: repeating-linear-gradient(0deg,#774934 0 1px,#976446 1px 4px,#ac7953 4px 6px); }
.fv-chase-grid > .fv-actor {
  width: 6.1%; background-image: var(--scene); background-repeat: no-repeat;
  border-width: 1.5px; font-size: 0;
}
.fv-chase-grid > .fv-actor.runner { background-size: 760% auto; background-position: 70% 7%; border-color: #ffcc72; }
.fv-chase-grid > .fv-actor.hunter { background-size: 1420% auto; background-position: 16% 27%; border-color: #b1f1eb; }
@media (min-width:600px) and (max-height:550px) and (orientation:landscape) {
  .fv-board:has(> .fv-pool) { grid-template-columns: minmax(0,1fr) minmax(185px,.48fr); align-items: center; }
  .fv-board > .fv-pool { grid-column: 1; grid-row: 1 / span 3; }
  .fv-board:has(> .fv-pool) > :not(.fv-pool) { grid-column: 2; }
  .fv-board .pool-controls label { justify-content: center; }
}
.fv-mode-copy .fv-actions { margin-top: 15px; }
.fv-head > .sound-toggle { border-radius: 50%; padding: 0; }
.fv-guide { color: #d9dfce; font-size: .88rem; }
.fv-guide summary { display: list-item; padding: 11px 8px; min-height: 44px; font-weight: 650; cursor: pointer; color: #e6d9b7; }
.fv-guide summary:focus-visible { outline: 3px solid #ffe5a6; outline-offset: 2px; border-radius: 5px; }
.fv-guide[open] { flex: 1 1 100%; text-align: left; border-top: 1px solid #4e6454; }
.fv-guide[open] p { padding: 0 8px 8px; line-height: 1.5; }
.fv-board > .fv-actions:has(.fv-guide) { border-top: 1px solid #4c6051; padding-top: 7px; }
.fv-board > .fv-actions:has(.fv-guide) > .fv-button { border-color: transparent; background: transparent; color: #dce0d1; }
.fv-result { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 7px; }
.fv-result > strong, .fv-result > span { flex: 1 1 100%; }
.fv-result > strong { font: 500 clamp(23px,4vw,34px)/1.1 Georgia,serif; }
.fv-result > span { color: #f3e1be; font-size: .93rem; }
.fv-log:empty { display: none; }
.fv-log:not(:empty) { margin-top: 6px; padding: 7px 11px; border-radius: 6px; background: #11241ed9; }
/* Keep the new practice option in the existing room toolbar's normal flow. */
#roomBar:has(> .fv-practice-entry) {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 5px 8px; padding: 5px max(8px,env(safe-area-inset-right)) 5px max(8px,env(safe-area-inset-left));
  border-bottom: 1px solid #46584b; background: #13251f;
}
#roomBar:has(> .fv-practice-entry) > :is(.rb-entries,.room-toolbar,.room-disclosure) { width: auto; margin: 0; }
#roomBar:has(> .fv-practice-entry) > .room-disclosure { flex: 1 1 250px; }
.fv-practice-entry {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; max-width: 100%; padding: 8px 14px; border: 1px solid #d4b175; border-radius: 10px;
  background: #3c3c2a; color: #ffe1a1; font-size: .88rem; line-height: 1.2; font-weight: 700;
}
.fv-practice-entry::after { content: '›'; font: 20px/1 Georgia,serif; }
.fv-practice-entry:enabled:active { background: #51472b; }
.fv-practice-entry:focus-visible { outline: 3px solid #ffe5a6; outline-offset: 2px; }
.fv-menu:has([data-fv="start"]) .fv-mode-copy h2 { display: none; }
@media (min-width:600px) and (max-height:550px) and (orientation:landscape) {
  .fv-board > .fv-pool { grid-row: 1 / span 5; }
  .fv-board:is([data-game="21"],[data-game="22"],[data-game="23"]) {
    grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); align-items: center;
  }
  .fv-board:is([data-game="21"],[data-game="22"],[data-game="23"]) > .fv-map-head { grid-column: 2; grid-row: 1; }
  .fv-board > :is(.fv-seats,.fv-hero-row):has(+ .fv-felt) { grid-column: 1; grid-row: 1; }
  .fv-board > .fv-felt { grid-column: 1; grid-row: 2 / span 3; align-self: stretch; }
  .fv-board > .fv-hand { grid-column: 2; grid-row: 2; }
  .fv-board:is([data-game="21"],[data-game="22"],[data-game="23"]) > .fv-tip { grid-column: 2; grid-row: 3; }
  .fv-board:is([data-game="21"],[data-game="22"],[data-game="23"]) > .fv-actions:not(:has(.fv-guide)) { grid-column: 2; grid-row: 4; }
  .fv-board > .fv-melds { grid-column: 1; grid-row: 5; }
  .fv-board:is([data-game="21"],[data-game="22"],[data-game="23"]) > .fv-actions:has(.fv-guide), .fv-board > .fv-result { grid-column: 1 / -1; }
  .fv-menu { grid-template-columns: minmax(0,1fr) minmax(0,1.25fr); }
  .fv-menu .fv-cover { min-height: 150px; height: 100%; }
}
/* Keep the room visible through the table edge, with a quiet centre behind the cards. */
.fv-board[data-game] {
  background: linear-gradient(130deg,#152c24ed 0%,#11271ee5 43%,#12251bcc 100%), var(--scene) center 54% / cover no-repeat;
}
.fv-board .fv-felt {
  isolation: isolate;
  background: repeating-linear-gradient(118deg,transparent 0 2px,#a7c4a209 2px 3px), radial-gradient(ellipse at 47% 26%,#40624a,#2a4a39 60%,#1d372b);
  box-shadow: inset 0 0 0 3px #243c2faa, inset 0 0 0 4px #d4b78047, inset 0 2px 15px #12241bb3;
}
.fv-felt::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--scene) center 52% / cover no-repeat; opacity: .44;
  -webkit-mask-image: linear-gradient(95deg,#000 0%,transparent 37%,transparent 67%,#000 100%);
  mask-image: linear-gradient(95deg,#000 0%,transparent 37%,transparent 67%,#000 100%);
}
.fv .fv-felt.hero { background: radial-gradient(ellipse at 48% 8%,#765739,#4e3c2c 60%,#382d27); }
.fv-board .fv-felt.mj { background: radial-gradient(ellipse at 45% 28%,#356854,#204a3c 74%,#163a2e); }
.fv-felt > :is(small,strong), .fv-bottom-cards { text-shadow: 0 1px 2px #152519; }
.fv-board .fv-felt.hero::before { opacity: .55; }

@keyframes fv-deal { from { transform: translateY(8px) rotate(-3deg); opacity: .45; } to { transform: none; opacity: 1; } }
@keyframes fv-play { from { transform: translateY(8px) scale(.92); opacity: .52; } to { transform: none; opacity: 1; } }
@keyframes fv-piece { from { transform: translateY(-4px) scale(1.10); } to { transform: none; } }
@keyframes fv-claim { 35% { box-shadow: inset 0 0 0 2px #f9cd7b, inset 0 0 22px #b69b4270; } }
@keyframes fv-ink { from { transform: translateY(3px); color: #fff9db; text-shadow: 0 0 7px #e8b968; } to { transform: none; } }
@keyframes fv-path { from { opacity: .25; } 45% { opacity: 1; filter: drop-shadow(0 0 4px #ffe3a3); } to { opacity: 1; } }
@keyframes fv-result { from { transform: translateY(7px); opacity: .6; } to { transform: none; opacity: 1; } }
.fv-board:is([data-fx="deal"],[data-fx="start"]) .fv-hand > :not(.selected),
.fv-board[data-fx="deal"] .fv-kitty > i { animation: fv-deal 200ms cubic-bezier(.2,.8,.3,1) backwards; }
.fv-board:is([data-fx="deal"],[data-fx="start"]) .fv-hand > :nth-child(3n+2) { animation-delay: 20ms; }
.fv-board:is([data-fx="deal"],[data-fx="start"]) .fv-hand > :nth-child(3n) { animation-delay: 36ms; }
.fv-board:is([data-fx="play"],[data-fx="straight"],[data-fx="bomb"],[data-fx="rocket"]) .fv-trick { animation: fv-play 170ms cubic-bezier(.22,.82,.32,1); }
.fv-board:is([data-fx="move"],[data-fx="capture"],[data-fx="check"]) .fv-chess .last > span { animation: fv-piece 155ms ease-out; }
.fv-board:is([data-fx="pong"],[data-fx="chow"],[data-fx="kong"],[data-fx="hu"],[data-fx="bomb"],[data-fx="rocket"]) .fv-felt { animation: fv-claim 285ms ease-out; }
.fv-board[data-fx="discard"][data-fx-seat="0"] .fv-rivers > :nth-child(1) .fv-tile:last-child,
.fv-board[data-fx="discard"][data-fx-seat="1"] .fv-rivers > :nth-child(2) .fv-tile:last-child,
.fv-board[data-fx="discard"][data-fx-seat="2"] .fv-rivers > :nth-child(3) .fv-tile:last-child,
.fv-board[data-fx="discard"][data-fx-seat="3"] .fv-rivers > :nth-child(4) .fv-tile:last-child { animation: fv-play 150ms ease-out; }
.fv-board:is([data-fx="attack"],[data-fx="heal"],[data-fx="dodge"],[data-fx="skill"],[data-fx="drawCard"]) .fv-felt > strong { animation: fv-ink 200ms ease-out; }
.fv-board:is([data-fx="match"],[data-fx="combo"]) .fv-path { animation: fv-path 240ms ease-out; }
.fv-board[data-fx] .fv-result { animation: fv-result 210ms ease-out; }

.fv-hand .fv-drawn { border-top: 3px solid #50ae9f; box-shadow: 0 3px 5px #092a2166; }
.fv .mj-tray { color: #efdeb9; max-width: 100%; }
.fv .mj-tray summary { cursor: pointer; }
.fv .mj-tray > div { margin-block: 9px; display: grid; gap: 4px; }
.fv .mj-tray .fv-melds { flex-wrap: wrap; justify-content: flex-start; }

/* The room horizon and the foreground playing surface have separate artwork. */
.fv[data-room-theme] {
  --frame: #6d5c3d; --edge: #e5bd79; --table: #172b25; --table-deep:#101e1b;
  background: #15251e;
}
.fv[data-room-theme="21"] { --frame:#8b6039; --edge:#efc17f; --table:#3c3024; --table-deep:#211e1a; }
.fv[data-room-theme="22"] { --frame:#637b57; --edge:#c7dfae; --table:#214638; --table-deep:#122820; }
.fv[data-room-theme="18"] { --frame:#877356; --edge:#e6cf9d; --table:#333b31; --table-deep:#1c2823; }
.fv[data-room-theme="23"] { --frame:#886849; --edge:#f5c786; --table:#493229; --table-deep:#251d20; }
.fv[data-room-theme="14"] { --frame:#7b8867; --edge:#cae6ba; --table:#304639; --table-deep:#162c28; }
.fv[data-room-theme="24"] { --frame:#776b56; --edge:#c1e2d0; --table:#1b3537; --table-deep:#122527; }
.fv[data-room-theme="25"] { --frame:#75607a; --edge:#ffcf87; --table:#313146; --table-deep:#1e2132; }
.fv[data-room-theme]::before {
  background: linear-gradient(180deg,#07100e19 0%,#11191326 35%,#0b1714a6 100%), var(--room-art) center 40% / cover no-repeat;
}
.fv[data-room-theme] .fv-head {
  min-height: clamp(76px,12svh,125px); align-items: flex-start;
  padding: 2px 0 14px;
}
.fv-head h1 { margin:0; align-self:center; text-shadow:0 2px 4px #09130e,0 0 16px #08110d; }
.fv-head > div { align-self:flex-start; padding-top:8px; }
.fv[data-room-theme] .fv-board[data-game] {
  border-color:var(--frame);
  background: linear-gradient(118deg, color-mix(in srgb,var(--table) 95%, transparent),color-mix(in srgb,var(--table-deep) 91%, transparent)),var(--room-art) center 72% / cover;
  box-shadow:inset 0 0 0 1px #fff3d313,0 6px 0 #0e1719a6,0 15px 36px #09130f69;
}
.fv[data-room-theme] .fv-felt {
  overflow:visible; border:2px solid var(--frame); border-radius:17px;
  box-shadow:inset 0 0 0 2px #171e17,inset 0 0 0 3px #d1c59b48,inset 0 4px 16px #1520189e,0 3px 1px #0b1817;
}
.fv[data-room-theme] .fv-felt::before { border-radius:inherit; opacity:.32; }
.fv-seats > span { position:relative; grid-template-columns: auto minmax(0,1fr); column-gap:6px; }
.fv-seats > span > small,.fv-seats > span > b { grid-column:2; }
.fv-seats > span.turn { border-color:var(--edge); }
.fv-seat-face {
  grid-row:1 / 3; grid-column:1; display:block; width:clamp(29px,4.3vw,47px); aspect-ratio:1;
  align-self:center; border-radius:50%; border:1px solid #cba77780; background-color:#17433f;
  background-image:url('/scenes/festival-players.webp'); background-size:300% 300%; background-position:0 var(--row);
  overflow:hidden; box-shadow:0 2px 3px #020c0b55;
}
.fv-seat-face:is(.member,.me) { background-image:none; }
.fv-seat-face img { width:100%;height:100%;object-fit:cover; }
.fv-selection-readout { min-height:20px; text-align:center; font-size:.85rem; color:#f3dfb4; }
.fv-board[data-game="21"] .fv-trick { isolation:isolate; }
.fv-board[data-game="21"] .fv-trick .fv-card { box-shadow:1px 2px 2px #14221a80; }
.fv-board[data-game="22"] .fv-rivers > div { border:1px solid #c1e9be20; }
.fv-chess > button.suggested::after {
  content:""; position:absolute; inset:17%; border:3px dashed #2a7247; border-radius:50%; pointer-events:none; z-index:3;
}
.fv-chess > button.threatened > span { box-shadow:0 0 0 3px #ae372b,0 0 0 5px #f4c179; }
.fv[data-room-theme="18"] .fv-chess { box-shadow:0 0 0 3px #58422e,0 0 0 5px #af9162,0 9px 12px #0b151b8c; margin:4px auto; }
.fv-hero { position:relative; }
.fv-hero .fv-vitals em { color:#fab5a5; font-style:normal; }
.fv-hero .fv-vitals em.lost { color:#b99c91; }
.fv-tactic[data-type] { border-top:3px solid var(--suit,#ad6a39); }
.fv-tactic[data-type="attack"] { --suit:#ad4835; }
.fv-tactic[data-type="heal"] { --suit:#3d8468; }
.fv-tactic[data-type="dodge"] { --suit:#43738d; }
.fv-tactic[data-type="duel"] { --suit:#8c5986; }
.fv-hand .fv-tactic.counter { box-shadow:0 0 0 2px #99d9cd,0 2px 7px #5abbb260; }
.fv-impact { display:block; position:absolute; z-index:4; inset:50% auto auto 50%; width:min(82%,70px); aspect-ratio:1;
 border-radius:50%; pointer-events:none; border:2px solid var(--halo,#ffcf79); box-shadow:0 0 0 5px #fff2,inset 0 0 9px var(--halo,#ffcf79); }
.fv-impact.ember { --halo:#ff9e78; }
.fv-impact.jade { --halo:#a0e8ca; }

@media (prefers-reduced-motion:no-preference) {
 @keyframes fv-seat-play { 0%{background-position-x:0} 18%,72%{background-position-x:50%} 100%{background-position-x:0} }
 @keyframes fv-seat-cheer { 0%{background-position-x:0} 20%,84%{background-position-x:100%} 100%{background-position-x:0} }
 @keyframes fv-seat-lean { 0%,100%{transform:none} 40%{transform:translateY(-2px) rotate(-4deg)} }
 @keyframes fv-hero-forward { 0%,100%{transform:none} 38%{transform:translateX(var(--step,5px)) rotate(3deg) scale(1.07)} }
 @keyframes fv-hero-dodge { 0%,100%{transform:none} 45%{transform:translateX(var(--retreat,-7px)) rotate(-7deg)} }
 @keyframes fv-hero-flare { 0%,100%{filter:none} 40%{filter:brightness(1.3) drop-shadow(0 0 4px #efb960)} }
 .fv-board[data-fx-seat="0"] [data-seat="0"],.fv-board[data-fx-seat="1"] [data-seat="1"],
 .fv-board[data-fx-seat="2"] [data-seat="2"],.fv-board[data-fx-seat="3"] [data-seat="3"] { --act:fv-seat-play; --cheer:fv-seat-cheer; --lean:fv-seat-lean; --forward:fv-hero-forward; --dodge:fv-hero-dodge; --flare:fv-hero-flare; }
 .fv-board[data-fx-seat] .fv-seat-face.npc { animation:var(--act,none) 420ms steps(1,end); }
 .fv-board:is([data-fx="win"],[data-fx="bomb"],[data-fx="rocket"],[data-fx="kong"]) .fv-seat-face.npc { animation:var(--cheer,none) 520ms steps(1,end); }
 .fv-board[data-fx-seat] .fv-seat-face:not(.npc) img { animation:var(--lean,none) 250ms ease-out; }
 .fv-hero[data-seat="1"] { --step:-5px; --retreat:7px; }
 .fv-board[data-cue="attack"] .fv-hero i { animation:var(--forward,none) 240ms ease-out; }
 .fv-board[data-cue="dodge"] .fv-hero i { animation:var(--dodge,none) 280ms ease-out; }
 .fv-board:is([data-cue="skill"],[data-cue="heal"],[data-cue="drawCard"]) .fv-hero i { animation:var(--flare,none) 330ms ease-out; }
}
@media (max-width:530px) {
 .fv-seats > span { column-gap:4px; padding:4px; }
 .fv-board[data-game="22"] .fv-seats > span { grid-template-columns:1fr; justify-items:center; text-align:center; }
 .fv-board[data-game="22"] .fv-seats > span > * { grid-column:1; grid-row:auto; }
}
@media (orientation:landscape) and (max-height:550px) {
 .fv[data-room-theme] .fv-head { min-height:48px; padding-bottom:5px; }
 .fv-board .fv-selection-readout { grid-column:2; }
}

.ca-shell[data-game="14"] { --classic-room:url('/scenes/festival-room-14.webp'); }
.ca-shell[data-game="18"] { --classic-room:url('/scenes/festival-room-18.webp'); }
.ca-shell:is([data-game="14"],[data-game="18"]) {
 background:linear-gradient(145deg,#101f18bc,#12281c9e 68%,#162620d6),var(--classic-room) center/cover;
}
.ca-shell:is([data-game="14"],[data-game="18"]) .ca-well {
 background:linear-gradient(120deg,#1e3424a8,#1d3123ba),var(--classic-room) center/cover;
}
