/* Jeopardy-style quiz board player. Same table look as the scatter sheet and card set players. */

/* 1. Tokens */

.lh-player {
  --table: #fff6e9;
  --dots: rgba(214, 160, 90, 0.20);
  --ink: #241f33;
  --title: #3a3550;
  --muted: #8a8199;
  --icon: #7d7590;
  --icon-hover: #241f33;
  --edge: #f0dfc6;
  --focus: rgba(124, 92, 255, 0.45);
  --font: "Nunito", sans-serif;
  --game: "Barlow Condensed", "Arial Narrow", sans-serif;
  --white: #fff;
  --blue: #7c5cff;
  --blue-edge: #5a3ddb;
  --radius: 14px;
  --radius-tile: 8px;
  --radius-pill: 999px;
  --shadow-card: 0 18px 40px rgba(60, 30, 10, 0.22);
  --bar-h: 44px;
  --scores-h: 90px;
  --c1: #ff6b4a;
  --c1-edge: #d4452a;
  --c2: #17b3a3;
  --c2-edge: #0e857a;
  --c3: #7c5cff;
  --c3-edge: #5a3ddb;
  --c4: #ffa41b;
  --c4-edge: #d07d00;
  --c5: #2f97ff;
  --c5-edge: #1a6fd1;
  --c6: #ff4f96;
  --c6-edge: #d12e72;
  --tie: #3a3550;
  --tie-edge: #241f33;
  --t1: #e8412e;
  --t1-edge: #b02b1c;
  --t2: #0f9c8e;
  --t2-edge: #08736a;
  --t3: #6a46f0;
  --t3-edge: #4b2cc2;
  --t4: #e88a00;
  --t4-edge: #b26900;
}

html,
body.page-jeopardy {
  height: 100%;
}

body.page-jeopardy {
  overflow: hidden;
  margin: 0;
  background: #fff6e9;
}

.lh-player {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--table);
  background-image: radial-gradient(var(--dots) 1.4px, transparent 1.6px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
}

.lh-player *,
.lh-player *::before,
.lh-player *::after {
  box-sizing: border-box;
}

.lh-player [hidden] {
  display: none !important;
}

.lh-player button {
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
}

.lh-player button:hover,
.lh-player button:disabled {
  background: transparent;
  color: inherit;
  box-shadow: none;
  transform: none;
}

.lh-player button:focus,
.lh-player a:focus,
.lh-player input:focus {
  outline: none;
}

.lh-player button:focus-visible,
.lh-player a:focus-visible {
  box-shadow: 0 0 0 3px var(--focus);
}

/* 2. Top bar */

.lh-player .lh-bar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr) minmax(0, 1fr);
  align-items: center;
  height: var(--bar-h);
  min-height: var(--bar-h);
  padding: 0 6px;
  background: var(--table);
  border-bottom: 2px solid var(--edge);
}

.lh-player .lh-home {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--icon);
  text-decoration: none;
}

.lh-player .lh-home:hover {
  color: var(--icon-hover);
  background: transparent;
}

.lh-player .lh-home svg,
.lh-player .lh-icon svg,
.lh-player .jp-close svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lh-player .lh-title {
  margin: 0;
  padding: 0 8px;
  min-width: 0;
  color: var(--title);
  font-family: var(--game);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lh-player .lh-tools {
  justify-self: end;
  display: flex;
  align-items: center;
}

.lh-player .lh-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--icon);
}

.lh-player .lh-icon:hover {
  color: var(--icon-hover);
}

.lh-player .lh-icon:disabled {
  opacity: 0.35;
  color: var(--icon);
  cursor: default;
}

.lh-player [data-tip] {
  position: relative;
}

.lh-player [data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% - 2px);
  left: 50%;
  padding: 4px 7px;
  border-radius: 4px;
  background: #4d473d;
  color: #fff;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px);
  z-index: 30;
}

.lh-player .lh-tools [data-tip]:last-child::after {
  left: auto;
  right: 0;
  transform: translate(0, 4px);
}

.lh-player [data-tip]:hover::after {
  opacity: 1;
}

.lh-player .lh-icon:disabled:hover::after {
  opacity: 0;
}

/* 3. Stage and board */

.lh-player .jp-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  padding: clamp(10px, 2vh, 22px) clamp(10px, 2vw, 28px) 6px;
}

.lh-player .jp-note {
  margin: 15vh auto 0;
  color: var(--muted);
  font-size: 20px;
  text-align: center;
}

.lh-player .jp-board {
  display: grid;
  grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr));
  grid-template-rows: clamp(52px, 10vh, 104px) repeat(var(--rows, 5), minmax(0, 1fr));
  gap: clamp(6px, 1.2vh, 14px) clamp(6px, 1vw, 14px);
  width: 100%;
  max-width: 1680px;
  height: 100%;
  margin: 0 auto;
}

.lh-player .jp-cat {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: 6px 8px;
  border-radius: var(--radius-tile);
  background: var(--ink);
  box-shadow: inset 0 -5px 0 var(--col, var(--c1));
  color: #fff;
  font-family: var(--game);
  font-size: var(--cat-size, 24px);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.05;
  text-align: center;
  overflow: hidden;
  overflow-wrap: normal;
}

.lh-player .jp-cat span {
  display: block;
  max-height: 100%;
}

.lh-player .jp-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: calc(100% - 6px);
  border-radius: var(--radius-tile);
  background: var(--col, var(--c1));
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 48%);
  color: #fff;
  font-family: var(--game);
  font-size: clamp(26px, min(6.4vh, 4.4vw), 72px);
  font-weight: 800;
  letter-spacing: 0.01em;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.18);
  box-shadow: 0 6px 0 var(--col-edge, var(--c1-edge)), 0 10px 16px rgba(60, 30, 10, 0.16);
  transition: transform 110ms ease, box-shadow 110ms ease, background-color 200ms ease, opacity 200ms ease, filter 120ms ease;
}

.lh-player .jp-tile:hover {
  background-color: var(--col, var(--c1));
  color: #fff;
  filter: brightness(1.07) saturate(1.05);
  transform: translateY(-3px);
  box-shadow: 0 9px 0 var(--col-edge, var(--c1-edge)), 0 16px 22px rgba(60, 30, 10, 0.2);
}

.lh-player .jp-tile:active {
  transform: translateY(5px);
  box-shadow: 0 1px 0 var(--col-edge, var(--c1-edge)), 0 3px 6px rgba(60, 30, 10, 0.16);
}

.lh-player .jp-tile:focus-visible {
  box-shadow: 0 6px 0 var(--col-edge, var(--c1-edge)), 0 0 0 4px var(--focus);
}

.lh-player .jp-tile .jp-pic {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.85);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Claimed: the tile sinks into the board and gets a team stamp. */
.lh-player .jp-tile.is-won {
  transform: translateY(6px);
  background: #fff;
  background-image: none;
  color: var(--team);
  text-shadow: none;
  box-shadow: inset 0 0 0 4px var(--team);
  cursor: default;
  filter: none;
}

.lh-player .jp-tile.is-won:hover {
  background: #fff;
  color: var(--team);
  filter: none;
  transform: translateY(6px);
  box-shadow: inset 0 0 0 4px var(--team);
}

.lh-player .jp-tile.is-won .jp-tile-pts {
  font-size: 0.4em;
  font-weight: 700;
  opacity: 0.7;
}

.lh-player .jp-tile .jp-tile-team {
  max-width: 90%;
  padding: 3px 12px 4px;
  border-radius: 4px;
  background: var(--team);
  color: #fff;
  font-size: clamp(15px, min(2.6vh, 1.7vw), 26px);
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: rotate(-3deg);
}

.lh-player .jp-tile.is-gone {
  transform: translateY(6px);
  background: rgba(255, 255, 255, 0.5);
  background-image: none;
  color: #c9bba6;
  text-shadow: none;
  box-shadow: inset 0 0 0 2px #ecdcc4;
  cursor: default;
  filter: none;
}

.lh-player .jp-tile.is-gone:hover {
  background: rgba(255, 255, 255, 0.5);
  color: #c9bba6;
  filter: none;
  transform: translateY(6px);
  box-shadow: inset 0 0 0 2px #ecdcc4;
}

.lh-player .jp-tile.is-gone .jp-tile-pts {
  font-size: 0.6em;
  text-decoration: line-through;
  text-decoration-thickness: 0.08em;
}

.lh-player .jp-tile.is-just {
  animation: jp-stamp 460ms cubic-bezier(.2, 1.6, .4, 1);
}

@keyframes jp-stamp {
  0% { transform: translateY(6px) scale(1.18) rotate(-2deg); }
  100% { transform: translateY(6px) scale(1) rotate(0); }
}

.lh-player .jp-slot {
  min-height: 0;
}

/* 4. Scores */

.lh-player .jp-scores {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: clamp(8px, 1.4vw, 18px);
  height: var(--scores-h);
  min-height: var(--scores-h);
  padding: 10px clamp(10px, 2vw, 28px) 18px;
}

.lh-player .jp-score {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 0 1 300px;
  padding: 0 20px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--team);
  color: #fff;
  box-shadow: 0 5px 0 var(--team-edge), 0 8px 14px rgba(60, 30, 10, 0.14);
}

.lh-player .jp-score-name {
  flex: 1 1 auto;
  min-width: 0;
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--game);
  font-size: clamp(18px, 2.8vh, 26px);
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lh-player .jp-score-num {
  flex: none;
  color: #fff;
  font-family: var(--game);
  font-size: clamp(30px, 5vh, 48px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}

.lh-player .jp-score.is-bump .jp-score-num {
  animation: jp-bump 600ms cubic-bezier(.2, 1.6, .4, 1);
}

@keyframes jp-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* 5. Layers (question, panels) */

.lh-player .jp-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 2vh, 22px) clamp(10px, 2vw, 28px) 6px;
  background: rgba(255, 246, 233, 0.86);
  animation: jp-fade 180ms ease;
}

@keyframes jp-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lh-player .jp-qcard {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1180px, 100%);
  height: 100%;
  padding: clamp(16px, 3vh, 34px) clamp(18px, 3vw, 48px) clamp(16px, 2.6vh, 28px);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 8px 0 rgba(36, 31, 51, 0.12), var(--shadow-card);
  animation: jp-flip 320ms cubic-bezier(.2, 1.3, .4, 1);
}

@keyframes jp-flip {
  from { transform: perspective(900px) rotateX(-14deg) scale(0.9); opacity: 0.4; }
  to { transform: none; opacity: 1; }
}

@keyframes jp-rise {
  from { transform: translateY(10px) scale(0.98); }
  to { transform: none; }
}

.lh-player .jp-close {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--icon);
}

.lh-player .jp-close { color: rgba(255, 255, 255, 0.9); }

.lh-player .jp-close:hover {
  color: #fff;
  background: rgba(0, 0, 0, 0.12);
}

.lh-player .jp-close[data-tip]::after {
  left: auto;
  right: 0;
  transform: translate(0, 4px);
}

.lh-player .jp-qmeta {
  margin: calc(-1 * clamp(16px, 3vh, 34px)) calc(-1 * clamp(18px, 3vw, 48px)) 0;
  padding: 12px 56px 13px;
  border-radius: 16px 16px 0 0;
  background: var(--col, var(--c1));
  box-shadow: inset 0 -5px 0 var(--col-edge, var(--c1-edge));
  color: #fff;
  font-family: var(--game);
  font-size: clamp(22px, 3.6vh, 34px);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}

.lh-player .jp-qmeta .jp-qpts {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 800;
}

.lh-player .jp-qbody {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.2vh, 24px);
  padding: clamp(8px, 2vh, 20px) 0;
  overflow: hidden;
}

.lh-player .jp-qimg {
  display: block;
  flex: 0 1 auto;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  object-fit: contain;
}

.lh-player .jp-qtext {
  flex: none;
  max-width: 30ch;
  margin: 0;
  color: var(--ink);
  font-size: var(--q-size, 56px);
  font-weight: 800;
  line-height: 1.18;
  text-align: center;
  overflow-wrap: anywhere;
}

.lh-player .jp-qtext.is-wide {
  max-width: 40ch;
}

.lh-player .jp-answer {
  flex: none;
  max-width: 100%;
  margin: 0;
  padding: 10px 26px;
  border-radius: 14px;
  background: #fff3c4;
  box-shadow: inset 0 0 0 3px #ffd84d;
  color: #241f33;
  font-size: var(--a-size, 40px);
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
  animation: jp-rise 220ms ease;
}

.lh-player .jp-qfoot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 1.8vh, 18px);
}

.lh-player .jp-reveal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 28px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  box-shadow: inset 0 0 0 2px #d9d3e6;
}

.lh-player .jp-reveal:hover {
  color: var(--ink);
  background: #f6f3fb;
  box-shadow: inset 0 0 0 2px #b9afcf;
}

.lh-player .jp-award {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  width: 100%;
  padding-top: clamp(10px, 1.8vh, 18px);
  border-top: 2px dashed #efe6d8;
}

.lh-player .jp-award-label {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

.lh-player .jp-award-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.lh-player .jp-teambtn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  max-width: 300px;
  padding: 0 24px;
  border-radius: 10px;
  font-family: var(--game) !important;
  font-size: 24px !important;
  letter-spacing: 0.01em;
  background: var(--team);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 4px 0 var(--team-edge);
}

.lh-player .jp-teambtn:hover {
  background: var(--team);
  color: #fff;
  box-shadow: 0 4px 0 var(--team-edge);
  filter: brightness(1.06);
}

.lh-player .jp-teambtn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--team-edge);
}

.lh-player .jp-teambtn .jp-tb-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lh-player .jp-teambtn .jp-tb-pts {
  flex: none;
  opacity: 0.85;
  font-weight: 900;
}

.lh-player .jp-nobody,
.lh-player .jp-textbtn {
  height: 44px;
  padding: 0 14px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 700;
}

.lh-player .jp-nobody:hover,
.lh-player .jp-textbtn:hover {
  color: var(--title);
  text-decoration: underline;
}

/* 6. Panels (teams, resume, confirm, end) */

.lh-player .jp-panel {
  width: min(460px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 28px 28px 22px;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-card);
  text-align: center;
  animation: jp-rise 220ms ease;
}

.lh-player .jp-panel-title {
  margin: 0 0 18px;
  color: var(--ink);
  font-family: var(--game);
  font-size: 32px;
  font-weight: 800;
  line-height: 1.15;
}

.lh-player .jp-panel-copy,
.lh-player .jp-panel-note {
  margin: -6px 0 20px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.35;
}

.lh-player .jp-panel-note {
  margin: 4px 0 0;
  font-size: 15px;
}

.lh-player .jp-instructions {
  margin: -8px 0 18px;
  color: var(--title);
}

.lh-player .jp-seg {
  display: flex;
  margin: 0 0 18px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: #f2eee6;
}

.lh-player .jp-seg button {
  flex: 1 1 0;
  height: 40px;
  border-radius: var(--radius-pill);
  color: var(--title);
  font-size: 16px;
  font-weight: 800;
}

.lh-player .jp-seg button:hover {
  color: var(--ink);
}

.lh-player .jp-seg button[aria-pressed="true"],
.lh-player .jp-seg button[aria-pressed="true"]:hover {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(60, 45, 20, 0.16);
}

.lh-player .jp-names {
  display: grid;
  gap: 10px;
}

.lh-player .jp-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lh-player .jp-name::before {
  content: "";
  flex: 0 0 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--team);
}

.lh-player .jp-name input {
  flex: 1 1 auto;
  min-width: 0;
  height: 46px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #d8d0c2;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  font-weight: 700;
}

.lh-player .jp-name input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--focus);
}

.lh-player .jp-panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  margin-top: 22px;
}

.lh-player .pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  padding: 0 36px;
  border-radius: var(--radius-pill);
  background: var(--blue);
  color: var(--white);
  font-family: var(--font);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 4px 0 var(--blue-edge);
}

.lh-player .pill-btn:hover {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 4px 0 var(--blue-edge);
}

.lh-player .pill-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--blue-edge);
}

.lh-player .jp-end {
  width: min(520px, 100%);
}

.lh-player .jp-end-title {
  margin: 0 0 18px;
  color: var(--ink);
  font-family: var(--game);
  font-size: clamp(38px, 6.5vh, 56px);
  font-weight: 800;
  line-height: 1.1;
}

.lh-player .jp-end-scores {
  margin: 0;
  padding: 0;
  list-style: none;
}

.lh-player .jp-end-scores li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
  padding: 10px 16px;
  border-radius: 12px;
  background: #f7f4ee;
  font-size: 20px;
  font-weight: 800;
  text-align: left;
}

.lh-player .jp-end-scores li::before {
  content: "";
  flex: 0 0 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--team);
}

.lh-player .jp-end-scores .jp-es-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lh-player .jp-end-scores .jp-es-num {
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.lh-player .jp-end-scores li.is-top {
  background: #fff3c4;
  box-shadow: inset 0 0 0 3px #ffd84d;
}

/* Confetti */
.lh-player .jp-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.lh-player .jp-confetti i {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 16px;
  border-radius: 2px;
  opacity: 0;
  animation: jp-fall var(--d, 2s) cubic-bezier(.25, .6, .5, 1) var(--delay, 0s) forwards;
}

@keyframes jp-fall {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  100% { opacity: 0.9; transform: translate(var(--x, 0), 105vh) rotate(var(--r, 360deg)); }
}

/* 7. Small screens (desktop first; phones still work) */

@media (max-width: 640px) {
  .lh-player {
    --scores-h: 64px;
  }
  .lh-player .lh-bar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .lh-player .lh-title {
    font-size: 15px;
  }
  .lh-player .lh-tools .lh-icon {
    width: 36px;
  }
  .lh-player .jp-board {
    grid-template-rows: clamp(48px, 9vh, 80px) repeat(var(--rows, 5), minmax(0, 1fr));
  }
  .lh-player .jp-score {
    gap: 8px;
    padding-right: 10px;
  }
  .lh-player .jp-teambtn {
    height: 46px;
    padding: 0 16px;
    font-size: 16px;
  }
}

/* Sound button: waves when on, a cross when off */
.lh-player .jp-sound .jp-sound-off { display: none; }
.lh-player .jp-sound.is-off .jp-sound-on { display: none; }
.lh-player .jp-sound.is-off .jp-sound-off { display: inline; }
