.loven-page {
  max-width: 76rem;
  padding-block: clamp(2rem, 5vw, 4rem);
}
.loven-intro {
  margin-bottom: 1.6rem;
}
.loven-intro h1 {
  margin: 0.1rem 0 0.4rem;
  font-size: clamp(2.7rem, 6vw, 4.5rem);
}
.loven-intro p {
  margin: 0.4rem 0;
}
.loven-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #666;
}
.loven-table {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  background: #102f2b;
  color: #f4eee0;
  box-shadow: 0 12px 40px #102f2b20;
}
#loven-stage {
  width: 100%;
}
#loven-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.loven-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.5rem 1rem;
}
.loven-controls button {
  font: inherit;
  font-weight: 600;
  padding: 0.7rem 1.2rem;
  border: 1px solid #a4b4a9;
  border-radius: 999px;
  background: #f2ecde;
  color: #15352e;
  cursor: pointer;
}
.loven-controls button:disabled {
  opacity: 0.45;
  cursor: default;
}
.loven-controls button:focus-visible,
.loven-hand button:focus-visible {
  outline: 3px solid #f2c36b;
  outline-offset: 4px;
}
#loven-status {
  text-align: center;
  font-size: 0.9rem;
  color: #d4dfd5;
  min-height: 1.5em;
  margin: 0.6rem 1rem;
}
.loven-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  padding: 0 1rem 1.2rem;
}
.loven-hand button {
  font: inherit;
  font-size: 0.85rem;
  color: #e5ecdf;
  background: transparent;
  border: 1px solid #66847b;
  border-radius: 0.4rem;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}
.loven-hand button[aria-pressed='true'] {
  background: #e8c884;
  color: #17372e;
  border-color: #e8c884;
}
.loven-note {
  color: #666;
  font-size: 0.85rem;
  text-align: center;
  margin: 1rem 0;
}
.loven-credits {
  font-size: 0.8rem;
  color: #666;
  margin-top: 1.7rem;
}
.loven-credits summary {
  cursor: pointer;
}
.loven-lobby {
  background: #fff;
  border: 1px solid #d7ded8;
  border-radius: 1rem;
  padding: clamp(1rem, 3vw, 2rem);
  margin-bottom: 1.5rem;
}
.loven-lobby h2 {
  margin-top: 0;
}
.loven-lobby label {
  display: block;
  margin: 0.65rem 0 0.3rem;
}
.loven-lobby label span {
  font-size: 0.8rem;
  color: #666;
}
.loven-lobby input[type='text'],
.loven-lobby select {
  font: inherit;
  padding: 0.6rem;
  max-width: 100%;
  width: 20rem;
  border: 1px solid #9cac9e;
  border-radius: 0.4rem;
  background: white;
}
.loven-lobby button {
  font: inherit;
  border: 1px solid #9cac9e;
  border-radius: 0.4rem;
  padding: 0.5rem 0.8rem;
  background: #edf2ed;
  color: #15352e;
  cursor: pointer;
}
.loven-lobby button:disabled {
  opacity: 0.5;
  cursor: default;
}
.loven-lobby button:focus-visible,
.loven-lobby input:focus-visible,
.loven-lobby select:focus-visible {
  outline: 3px solid #aa782e;
  outline-offset: 3px;
}
.loven-check {
  font-size: 0.85rem;
}
.loven-check input {
  margin-right: 0.3rem;
}
.loven-preferences {
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0e6e0;
}
#loven-room {
  padding-top: 1rem;
}
.loven-game-row,
.loven-seat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid #e0e6e0;
}
.loven-seat {
  border-left: 4px solid #638fb5;
  padding-left: 0.7rem;
}
.loven-seat[data-color='red'] {
  border-left-color: #be655d;
}
.loven-seat[data-color='green'] {
  border-left-color: #628e67;
}
.loven-seat[data-color='teal'] {
  border-left-color: #52c6be;
}
.loven-seat[data-color='purple'] {
  border-left-color: #9571aa;
}
.loven-lobby-actions {
  display: flex;
  gap: 0.6rem;
  margin: 1rem 0;
}
[hidden] {
  display: none !important;
}
@media (max-width: 40rem) {
  #loven-stage {
    aspect-ratio: 1.15;
  }
  .loven-controls button {
    padding: 0.65rem 0.85rem;
  }
}

.loven-seat button,
.loven-seat select,
.loven-game-row button {
  flex-shrink: 0;
  white-space: nowrap;
}
.loven-seat span,
.loven-game-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.loven-seat-table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
}
.loven-seat-table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
}
.loven-seat-table th {
  padding: 0.65rem 0.7rem;
  font-size: 0.8rem;
  color: #53655a;
  font-weight: 600;
}
.loven-seat-table .loven-seat {
  display: table-row;
  border-left: 0;
}
.loven-seat-table td {
  padding: 0.8rem 0.7rem;
  border-bottom: 1px solid #e0e6e0;
}
.loven-seat-table td:first-child {
  border-left: 4px solid #638fb5;
  overflow-wrap: anywhere;
}
.loven-seat[data-color='red'] td:first-child {
  border-left-color: #be655d;
}
.loven-seat[data-color='green'] td:first-child {
  border-left-color: #628e67;
}
.loven-seat[data-color='teal'] td:first-child {
  border-left-color: #52c6be;
}
.loven-seat[data-color='purple'] td:first-child {
  border-left-color: #9571aa;
}
.loven-seat-table td:nth-child(2),
.loven-seat-table th:nth-child(2) {
  text-align: center;
}
.loven-seat-table input[type='radio'] {
  accent-color: #315c45;
  width: 1.15rem;
  height: 1.15rem;
}
.loven-seat-table td:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.loven-seat-table select {
  width: auto;
  min-width: 0;
}
.loven-lobby-actions {
  flex-wrap: wrap;
}
.loven-bot-note {
  color: #666;
  font-size: 0.85rem;
}
.loven-game-header p {
  font-size: 0.85rem;
}
#loven-game-seats {
  display: flex;
  flex-wrap: wrap;
}
.loven-game-player {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
}
.loven-game-player button {
  font: inherit;
  padding: 0.3rem 0.5rem;
  border: 1px solid #739083;
  border-radius: 0.4rem;
  background: #e5ecdf;
  color: #15352e;
  cursor: pointer;
}
.loven-game-player button:disabled {
  opacity: 0.5;
  cursor: default;
}
@media (max-width: 40rem) {
  .loven-seat-table th,
  .loven-seat-table td {
    padding: 0.6rem 0.4rem;
  }
  .loven-seat-table td:first-child {
    min-width: 5rem;
  }
  .loven-seat-table button {
    font-size: 0.8rem;
    padding: 0.45rem 0.5rem;
  }
}

/* Compact game chrome: player names replace the prototype's status text rows. */
.loven-game-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.loven-game-header h2 {
  margin: 0.2rem 0;
  font:
    600 1.05rem/1.3 Arial,
    sans-serif;
  max-width: 24rem;
  overflow-wrap: anywhere;
}
#loven-game-info {
  font-size: 0.75rem;
  color: #b9cabb;
}
.loven-game-actions {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
}
.loven-game-actions button {
  font: inherit;
  font-size: 0.8rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid #66847b;
  border-radius: 0.4rem;
  color: #e5ecdf;
  background: transparent;
  cursor: pointer;
}
.loven-game-actions button:focus-visible {
  outline: 3px solid #f2c36b;
  outline-offset: 3px;
}
#loven-game-seats {
  order: 3;
  flex-basis: 100%;
  gap: 0.5rem;
}
.loven-game-player {
  background: #ffffff09;
  border: 1px solid #73908340;
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
}
.loven-game-player::before {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  background: #638fb5;
  border-radius: 50%;
}
.loven-game-player[data-color='red']::before {
  background: #be655d;
}
.loven-game-player[data-color='green']::before {
  background: #628e67;
}
.loven-game-player[data-color='teal']::before {
  background: #52c6be;
}
.loven-game-player[data-color='purple']::before {
  background: #9571aa;
}
#loven-game-expiry {
  order: 4;
  flex-basis: 100%;
  margin: 0;
}
/* Economy table: the log is a separate HTML panel, never part of the canvas. */
.loven-game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17rem;
  gap: 1rem;
}
.loven-log {
  background: #fff;
  border: 1px solid #d7ded8;
  border-radius: 1rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}
.loven-log h2 {
  font-size: 1rem;
  margin: 0.2rem 0 1rem;
}
.loven-log-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.loven-log-heading h2 {
  margin: 0;
}
.loven-log-heading button {
  font: inherit;
  font-size: 0.75rem;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
}
#loven-log-entries {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  flex: 1;
}
#loven-log-entries li {
  padding: 0.65rem 0;
  border-top: 1px solid #e0e6e0;
  font-size: 0.8rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
#loven-log-entries .loven-log-round,
#loven-log-entries .loven-log-turn {
  padding: 0;
  border: 0;
}
.loven-log-list {
  list-style: none;
  margin: 0 0 0.4rem 0.5rem;
  padding: 0 0 0 0.65rem;
  border-left: 1px solid #d7ded8;
}
.loven-log-round > details > summary {
  padding: 0.55rem 0.5rem;
  background: #edf2ed;
  border-radius: 0.35rem;
  font-weight: 700;
  margin: 0.25rem 0;
}
.loven-log-turn > details > summary {
  padding: 0.45rem 0.2rem;
  font-weight: 600;
}
#loven-log-entries summary {
  cursor: pointer;
}
#loven-log-entries summary:focus-visible {
  outline: 2px solid #aa782e;
  outline-offset: -2px;
  border-radius: 0.3rem;
}
.loven-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.loven-sr-only:focus-within,
button.loven-sr-only:focus {
  width: auto !important;
  height: auto !important;
  clip: auto !important;
  margin: 0.5rem !important;
  padding: 0.5rem !important;
  background: #fff;
  color: #15352e;
  z-index: 50;
}
.is-playing > .loven-note,
.is-playing > .loven-credits {
  display: none;
}
@media (max-width: 65rem) {
  .loven-game-layout {
    grid-template-columns: minmax(0, 1fr) 13rem;
  }
}
@media (max-width: 48rem) {
  .loven-game-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .loven-log {
    max-height: 16rem;
  }
  .loven-game-header {
    padding: 0.75rem;
  }
  .loven-game-actions {
    flex-wrap: wrap;
  }
}

.loven-game-layout {
  align-items: start;
}
.loven-log {
  min-width: 0;
  height: var(--loven-table-height, 35rem);
  box-sizing: border-box;
}
#loven-log-entries {
  min-height: 0;
  max-height: none;
}
@media (max-width: 48rem) {
  .loven-log {
    height: 16rem;
  }
  #loven-stage {
    aspect-ratio: 600 / 840;
  }
}

.loven-page.is-playing {
  width: calc(100% - 3rem);
}
@media (max-width: 48rem) {
  .loven-page.is-playing {
    width: calc(100% - 2rem);
  }
}
/* Labels are real DOM text in screen pixels; board expansion never scales them. */
#loven-stage {
  position: relative;
}
#loven-labels {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.loven-board-label {
  position: absolute;
  transform: translate(-50%, -50%);
  font:
    13px/1.35 Arial,
    sans-serif;
  color: #e5eddf;
  text-align: center;
  white-space: nowrap;
}
.loven-player-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.loven-player-badge strong {
  color: var(--player-color);
  font-size: 14px;
}
.loven-player-badge span {
  color: #ceddce;
  font-size: 12px;
}
.loven-board-label button {
  pointer-events: auto;
  font: inherit;
  font-size: 12px;
  border: 1px solid #e1c27e;
  border-radius: 0.35rem;
  padding: 0.25rem 0.5rem;
  background: #173d32;
  color: #f2dcaa;
  cursor: pointer;
}
.loven-board-label.is-target {
  pointer-events: auto;
  cursor: pointer;
}
.loven-player-badge.is-target > strong,
.loven-player-badge.is-linked > strong {
  background: #e3c36e30;
  box-shadow: 0 0 0 2px #e3c36e;
  border-radius: 0.15rem;
}
.loven-deck-label {
  font-size: 12px;
}
.loven-hud {
  background: #153b32;
  border: 1px solid #698b76;
  border-radius: 0.7rem;
  color: #f4eedf;
}
.loven-hud div {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.loven-hud span {
  font:
    13px Arial,
    sans-serif;
}
.loven-hud strong {
  font:
    700 22px Arial,
    sans-serif;
}
.loven-page.is-playing {
  max-width: 96rem;
  padding-bottom: 6rem;
}
#loven-action-panel {
  flex-wrap: wrap;
  gap: 0.5rem;
  border-top: 1px solid #72927d55;
  color: #f1e9d9;
}
#loven-action-panel p {
  flex-basis: 100%;
  font-size: 0.9rem;
}
#loven-action-panel button {
  font-size: 0.9rem;
  border: 1px solid #91aa91;
  border-radius: 0.4rem;
  background: #e1e9d9;
  color: #16382e;
  cursor: pointer;
}
@media (max-width: 48rem) {
  .loven-hud {
    gap: 0.7rem;
    padding: 0.6rem;
  }
  .loven-hud div {
    gap: 0.4rem;
  }
  .loven-hud strong {
    font-size: 18px;
  }
  .loven-player-badge span {
    max-width: 130px;
    white-space: normal;
    font-size: 11px;
  }
  .loven-player-badge strong {
    font-size: 12px;
  }
}

.loven-player-badge {
  transform: translate(-50%, 0);
}
.loven-player-badge strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.loven-player-badge span {
  max-width: 100%;
  white-space: normal;
}

.loven-discard {
  margin-top: 1rem;
  font-size: 0.875rem;
}
.loven-discard summary {
  cursor: pointer;
}
#loven-discard-cards {
  padding-top: 0.5rem;
  overflow-wrap: anywhere;
}

#loven-action-panel {
  display: block;
}
#loven-action-panel h3 {
  font-size: 0.95rem;
}
.loven-moves {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.loven-moves button {
  text-align: left;
  font-size: 0.85rem;
}
.loven-move-context {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.loven-moves button.is-linked {
  outline: 3px solid #ffe3a1;
  outline-offset: 2px;
}
.loven-moves button.is-selected {
  border-color: #e3c36e;
}
/* Compact, replaceable stat symbols; text alternatives remain available. */
.loven-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  white-space: nowrap;
  color: #e4eddf;
}
.loven-stat img {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.loven-stat strong {
  font:
    600 13px/1.2 Arial,
    sans-serif;
  color: inherit;
}
.loven-stat-gold {
  color: #efce75;
}
.loven-board-stats,
.loven-deck-label {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.7rem;
}
#loven-stage[data-mobile='true'] .loven-deck-label {
  flex-direction: column;
  gap: 0.3rem;
  transform: translate(-50%, 0);
}
.loven-player-badge .loven-board-stats span {
  white-space: nowrap;
}
.loven-player-badge .loven-stat strong {
  font-size: 12px;
  color: inherit;
}
#loven-perspective-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
}
#loven-perspective {
  font: inherit;
  padding: 0.35rem 0.5rem;
  color: #eef0df;
  background: #173d32;
  border: 1px solid #66847b;
  border-radius: 0.4rem;
  max-width: 12rem;
}
.loven-dice-tray {
  position: absolute;
  z-index: 8;
  left: 50%;
  width: min(478px, calc(100% - 24px));
  background: #12392eee;
  border: 1px solid #c9ae6d99;
  border-radius: 1rem;
  box-shadow: 0 10px 32px #0004;
  pointer-events: none;
  overflow: hidden;
}
#loven-dice-canvas {
  width: 100%;
  height: 210px;
}
#loven-dice-canvas canvas {
  width: 100%;
  height: 100%;
  display: block;
}
#loven-dice-result {
  padding: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: center;
  color: #f5edda;
  font:
    12px/1.4 Arial,
    sans-serif;
}
.loven-roll-result {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.loven-die-face {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  vertical-align: middle;
}
.loven-dice-tray[data-mode='static'] #loven-dice-canvas {
  display: none;
}
.loven-dice-tray[data-mode='static'] .loven-die-face {
  width: 42px;
  height: 42px;
}
.loven-log-dice {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  width: fit-content;
  margin: 0 0 0.35rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid #c4d0c3;
  border-radius: 0.5rem;
  background: #edf1e8;
  color: #183a30;
  cursor: pointer;
  font:
    12px Arial,
    sans-serif;
}
.loven-log-dice .loven-die-face {
  width: 23px;
  height: 23px;
}
.loven-log-dice:focus-visible {
  outline: 3px solid #aa782e;
  outline-offset: 2px;
}
@media (max-width: 48rem) {
  .loven-board-stats {
    gap: 0.4rem;
  }
  .loven-board-stats .loven-stat {
    gap: 0.15rem;
  }
  .loven-board-stats .loven-stat img {
    width: 14px;
    height: 14px;
  }
  .loven-player-badge .loven-stat strong {
    font-size: 11px;
  }
  .loven-hud {
    gap: 0.65rem;
  }
  .loven-hud .loven-stat strong {
    font-size: 18px;
  }
  #loven-dice-canvas {
    height: 180px;
  }
}

.loven-moves button .loven-stat {
  margin-left: 0.4rem;
  color: #775514;
  vertical-align: middle;
}
.loven-moves button .loven-stat img {
  filter: brightness(0.78);
}

/* Compact table, with the owner's stats anchored alongside their own rows. */
#loven-stage {
  aspect-ratio: 1000 / 520;
  touch-action: pan-y pinch-zoom;
}
.loven-page.is-playing {
  padding-block: 0.75rem 1.5rem;
}
.loven-game-header {
  padding: 0.65rem 1rem 0.3rem;
  gap: 0.4rem 0.75rem;
}
.loven-game-actions {
  align-items: center;
}
.loven-auto-ready {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font:
    12px Arial,
    sans-serif;
  white-space: nowrap;
  cursor: pointer;
}
.loven-auto-ready input {
  accent-color: #e1c27e;
  width: 1rem;
  height: 1rem;
}
.loven-auto-help {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 50;
  width: 18rem;
  max-width: calc(100vw - 2rem);
  padding: 0.65rem 0.8rem;
  border: 1px solid #789283;
  border-radius: 0.4rem;
  background: #10271f;
  color: #edf4ee;
  white-space: normal;
  line-height: 1.5;
  pointer-events: none;
  visibility: hidden;
}

.loven-review {
  margin: 1.5rem 0;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid #547461;
  border-radius: 1rem;
  background: #153b32;
  color: #edf4ee;
}
.loven-review h2,
.loven-review h3 {
  color: #edf4ee;
  margin: 0;
}
.loven-review h3 {
  font-size: 0.95rem;
}
.loven-review p {
  color: #c2d7ca;
}
.loven-review-toolbar,
.loven-review-navigation,
.loven-review-legend,
.loven-replay-cards {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.loven-review-toolbar h2 {
  margin-right: auto;
}
.loven-review button {
  padding: 0.5rem 0.75rem;
  border: 1px solid #8aa68f;
  border-radius: 0.4rem;
  background: #edf2ed;
  color: #15352e;
  cursor: pointer;
  font: inherit;
}
.loven-review button:disabled {
  opacity: 0.5;
  cursor: default;
}
.loven-review-navigation input {
  width: 100%;
  accent-color: #b8cf84;
}
.loven-review-navigation span {
  font-size: 0.9rem;
}
.loven-review-note {
  font-size: 0.85rem;
}
.loven-review > a,
.loven-replay-link {
  display: block;
  margin-top: 0.6rem;
  overflow-wrap: anywhere;
  color: #c9e6b2;
}
.loven-review-legend {
  margin: 1rem 0;
  gap: 1rem;
}
.loven-review-legend span {
  border-left: 4px solid var(--replay-color);
  padding-left: 0.5rem;
}
.loven-review-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.loven-review-charts > div {
  min-width: 0;
  position: relative;
}
.loven-review-charts svg {
  display: block;
  width: 100%;
  touch-action: pan-y;
  cursor: crosshair;
}
.loven-review-charts text {
  fill: #c2d7ca;
  font:
    11px Arial,
    sans-serif;
}
.loven-review-grid {
  stroke: #456455;
  stroke-width: 1;
}
.loven-review-cursor {
  stroke: #eadb9b;
  stroke-width: 2;
  pointer-events: none;
}
.loven-replay-player {
  padding: 1rem 0;
  border-top: 1px solid #456455;
  border-left: 3px solid var(--replay-color);
  padding-left: 0.8rem;
}
.loven-replay-player p {
  margin: 0.4rem 0;
  font-size: 0.85rem;
}
.loven-replay-cards {
  margin: 0.5rem 0;
  gap: 0.35rem;
}
.loven-replay-cards > span:first-child:not(.loven-replay-card) {
  min-width: 3rem;
  color: #b9cabb;
  font-size: 0.8rem;
}
.loven-replay-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 3.2rem;
  border-radius: 0.35rem;
  background: #fcfcf4;
  color: #182e25;
  font:
    600 0.95rem Georgia,
    serif;
}
.loven-replay-card.red {
  color: #ab343c;
}
.loven-replay-card.flipped {
  opacity: 0.5;
}
.loven-replay-card.attack-unready {
  background: #bfc3ba;
}
.loven-replay-card.aimed {
  box-shadow:
    inset 0 0 0 2px var(--aim-color),
    inset 0 0 8px 3px var(--aim-color);
}
@media (max-width: 40rem) {
  .loven-review-charts {
    grid-template-columns: 1fr;
  }
}
.loven-auto-ready:hover .loven-auto-help,
.loven-auto-ready input:focus-visible ~ .loven-auto-help {
  visibility: visible;
}
@media (max-width: 40rem) {
  .loven-auto-help {
    position: fixed;
    top: auto;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    width: auto;
  }
}
.loven-hud {
  position: absolute;
  left: auto;
  right: 76%;
  bottom: 21.15%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.5rem 0.6rem;
  box-shadow: none;
  z-index: 6;
}
.loven-hud .loven-stat {
  gap: 0.3rem;
}
.loven-hud .loven-stat strong {
  font-size: 15px;
}
.loven-hud .loven-stat img {
  width: 18px;
  height: 18px;
}
#loven-action-panel {
  padding: 0.5rem 0.75rem 0.65rem;
}
#loven-action-panel h3 {
  font:
    600 12px Arial,
    sans-serif;
  margin: 0 0 0.4rem;
  color: #c7d9c9;
}
#loven-action-panel p {
  font:
    12px/1.4 Arial,
    sans-serif;
  margin: 0 0 0.4rem;
}
#loven-action-panel button {
  font:
    12px/1.35 Arial,
    sans-serif;
  padding: 0.35rem 0.5rem;
}
.loven-moves,
.loven-target-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-height: 6.5rem;
  overflow-y: auto;
  padding: 3px;
  margin: -3px;
}
.loven-move-context {
  font:
    12px Arial,
    sans-serif;
  gap: 0.4rem;
  margin: 0.1rem 0 0.4rem;
}
.loven-target-options {
  border-left: 2px solid #e1c27e;
  padding: 0.35rem 0.5rem;
  margin: 0 0 0.5rem;
}
.loven-target-options button.is-linked {
  outline: 2px solid #ffe3a1;
  outline-offset: 1px;
}
.loven-player-badge.is-target {
  pointer-events: auto;
  cursor: pointer;
}
@media (max-width: 48rem) {
  #loven-stage {
    aspect-ratio: 600 / 680;
  }
  .loven-hud {
    padding: 0.4rem;
    gap: 0.3rem;
    right: 76%;
  }
  .loven-hud .loven-stat strong {
    font-size: 13px;
  }
  .loven-hud .loven-stat img {
    width: 16px;
    height: 16px;
  }
}

.loven-moves [data-move='BuyCard'] {
  margin-left: auto;
}

/* Quiet page-level connection status. */
.loven-network-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  margin: 1rem 0 0;
  font-size: 0.75rem;
  color: #617168;
  overflow-wrap: anywhere;
}
.loven-network-status::before {
  content: '';
  flex: 0 0 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #b58b38;
}
.loven-network-status[data-state='online']::before {
  background: #518764;
}
.loven-network-status[data-state='offline'] {
  color: #9a4536;
}

.loven-target-options [data-move='Sabotage'] {
  border-color: #b9524d;
}
.loven-target-options [data-move='Diplomacy'],
.loven-player-badge [data-move='Diplomacy'] {
  color: #135b33;
  background: #d7eddc;
  border-color: #4b9b66;
}

#loven-dice-context {
  margin: 0;
  padding: 0.8rem 0.9rem 0.25rem;
  color: #f5edda;
  text-align: center;
  font:
    600 14px/1.4 Arial,
    sans-serif;
}

/* Combat is presented from the roll's public event, before releasing its effects. */
.loven-dice-tray {
  transform: translate(-50%, -50%);
  top: 50%;
}
.loven-dice-tray[data-combat='true'] {
  width: min(588px, calc(100% - 24px));
}
#loven-combat-roll {
  padding: 0.7rem 0.85rem 0;
  font-family: Arial, sans-serif;
}
.loven-combat-scores {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
}
.loven-combat-side {
  padding: 0.55rem 0.35rem;
  border: 1px solid #b9c9bc45;
  border-radius: 0.7rem;
  text-align: center;
  transition:
    transform 0.35s,
    background 0.35s,
    border-color 0.35s,
    opacity 0.35s;
}
.loven-combat-name {
  display: block;
  color: var(--roll-color);
  font-size: 15px;
  overflow-wrap: anywhere;
}
.loven-combat-role {
  display: block;
  font-size: 11px;
  color: #d2dfd5;
  margin: 0.2rem 0 0.45rem;
}
.loven-combat-label {
  display: block;
  font-size: 10px;
  color: #d2dfd5;
  margin-bottom: 0.3rem;
}
.loven-combat-equation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
  font-size: 16px;
  white-space: nowrap;
}
.loven-combat-equation strong {
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  min-width: 1ch;
}
.loven-combat-die {
  display: inline-flex;
}
.loven-combat-die .loven-die-face {
  width: 30px;
  height: 30px;
}
.loven-combat-relation {
  align-self: end;
  padding-bottom: 1rem;
  text-align: center;
  font-size: 19px;
  color: #e5d5a3;
}
.loven-combat-verdict {
  margin: 0.6rem 0 0;
  min-height: 2.6em;
  text-align: center;
  font-size: 13px;
  line-height: 1.3;
  color: #f5edda;
}
.loven-combat-side.is-winner {
  border-color: var(--roll-color);
  background: #ffffff14;
  box-shadow: 0 0 14px color-mix(in srgb, var(--roll-color) 25%, transparent);
}
.loven-combat-side.is-loser {
  opacity: 0.65;
}
#loven-combat-roll[data-phase='adding'] .loven-combat-die {
  animation: loven-roll-add 0.7s ease-out;
}
#loven-combat-roll[data-phase='compared'] .is-winner .loven-combat-total {
  animation: loven-roll-win 0.65s ease-out;
}
.loven-die-face[data-rolling='true'] {
  animation: loven-roll-wait 0.6s ease-in-out infinite alternate;
}
.loven-dice-tray[data-combat='true'] #loven-dice-result {
  display: none;
}
@keyframes loven-roll-add {
  from {
    transform: translateY(12px) scale(1.3);
  }
  to {
    transform: translateY(0) scale(1);
  }
}
@keyframes loven-roll-win {
  50% {
    transform: scale(1.3);
    color: var(--roll-color);
  }
}
@keyframes loven-roll-wait {
  from {
    transform: rotate(-9deg);
  }
  to {
    transform: rotate(9deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .loven-combat-side {
    transition: none;
  }
  #loven-combat-roll *,
  .loven-die-face[data-rolling='true'] {
    animation: none !important;
  }
}

/* Selection prompt, cancel and targets share one wrapping row. */
.loven-move-context.loven-target-options {
  border: 0;
  padding: 3px;
  margin: 0.1rem -3px 0.4rem;
}

/* Touch inspection floats above the finger without taking pointer events. */
.loven-card-inspection {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  transform-origin: center;
  filter: drop-shadow(0 5px 9px #0009);
}
.loven-card-inspection canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}
#loven-stage canvas {
  touch-action: pan-y pinch-zoom !important;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

/* The final result appears only after the displayed game state has settled. */
.loven-victory-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: #071f1bbc;
}
.loven-victory-overlay[hidden] {
  display: none;
}
.loven-victory {
  position: relative;
  inset: auto;
  margin: 0;
  width: min(22rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  overflow: auto;
  padding: 1.75rem;
  border: 2px solid var(--victory-color, #e3c36e);
  border-radius: 1rem;
  background: #12372f;
  color: #e5eddf;
  text-align: center;
  box-shadow: 0 16px 60px #0006;
}
.loven-victory-symbol {
  display: block;
  font-size: 4rem;
  line-height: 1;
  color: var(--victory-color, #e3c36e);
}
.loven-victory h2 {
  margin: 0.75rem 0;
  color: var(--victory-color, #e3c36e);
  overflow-wrap: anywhere;
}
.loven-victory p {
  margin: 0 0 1.25rem;
}
.loven-victory-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
}
.loven-victory button {
  border: 1px solid #91aa91;
  border-radius: 0.4rem;
  padding: 0.55rem 0.8rem;
  background: #e1e9d9;
  color: #16382e;
  cursor: pointer;
  font: inherit;
}
.loven-victory button:focus-visible {
  outline: 3px solid #e3c36e;
  outline-offset: 3px;
}

/* Review remains available after the live table has finished. */
.is-playing:not(.is-reviewing) > .loven-credits,
.is-playing > .loven-review-loader {
  display: none;
}
.is-playing.is-reviewing > .loven-credits {
  display: block;
}
.is-reviewing #loven-action-panel {
  display: none;
}
.loven-review-loader {
  margin-top: 1.7rem;
  font-size: 0.8rem;
  color: #666;
}
.loven-review-loader summary,
.loven-review-more summary {
  cursor: pointer;
}
.loven-review-loader form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 1rem 0;
}
.loven-review-loader input[type='url'] {
  flex: 1 1 18rem;
  min-width: 0;
}
.loven-review-loader label {
  display: block;
}
.loven-review-more {
  margin: 1rem 0;
}
.loven-review-more[open] > summary {
  margin-bottom: 1rem;
}
.loven-review-players {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
}
.loven-replay-player {
  min-width: 0;
}
.loven-review-navigation small {
  margin-left: auto;
  color: #c2d7ca;
}
.loven-replay-cards > span:first-child:not(.loven-replay-card) {
  flex: 0 0 100%;
}
#loven-auto-end {
  font: inherit;
  padding: 0.2rem 0.4rem;
}
#loven-auto-end-state {
  margin-left: 0.3rem;
  font-size: 0.8em;
  opacity: 0.85;
}
#loven-auto-end[data-mode='1'] {
  border-color: #b8cf84;
  background: #31533e;
}
#loven-auto-end[data-mode='2'] {
  border-color: #eadb9b;
  background: #5e5432;
}
.loven-auto-ready button:focus-visible ~ .loven-auto-help {
  visibility: visible;
  opacity: 1;
}

.loven-panel-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid #d7ded8;
  margin: -0.25rem 0 0.75rem;
  flex-shrink: 0;
}
.loven-panel-tabs button {
  position: relative;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #53665e;
  padding: 0.45rem 0.65rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.loven-panel-tabs button[aria-selected='true'] {
  border-bottom-color: #245b48;
  color: #183c30;
  font-weight: 700;
}
.loven-chat-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #c52f35;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}
.loven-log-panel,
.loven-chat-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.loven-chat-filter,
#loven-chat-name-label {
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}
#loven-chat-entries {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
  overscroll-behavior: contain;
}
#loven-chat-entries li {
  margin: 0.35rem 0;
  padding: 0.5rem 0.6rem;
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--chat-color) 25%, white);
  color: #24362d;
  font-size: 0.8rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
#loven-chat-entries strong,
#loven-chat-entries span {
  display: block;
}
#loven-chat-entries span {
  white-space: pre-wrap;
}
#loven-chat-entries strong {
  font-size: 0.72rem;
  margin-bottom: 0.15rem;
}
#loven-chat-form textarea,
#loven-chat-name {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #b8c8bf;
  border-radius: 0.4rem;
  padding: 0.4rem;
  font: inherit;
  font-size: 0.8rem;
}
#loven-chat-form textarea {
  resize: none;
  display: block;
}
.loven-chat-send {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.35rem;
}
.loven-chat-send small {
  color: #657369;
  font-size: 0.7rem;
}
.loven-chat-send button {
  border: 1px solid #b8c8bf;
  border-radius: 0.4rem;
  background: #edf3ee;
  color: #183c30;
  padding: 0.3rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
#loven-chat-status,
#loven-chat-empty {
  font-size: 0.75rem;
  margin: 0.35rem 0;
}
#loven-chat-status:empty {
  display: none;
}
.loven-log [hidden] {
  display: none !important;
}
@media (max-width: 48rem) {
  .loven-log:has(#loven-chat-tab[aria-selected='true']) {
    height: 24rem;
    max-height: 24rem;
  }
}

.loven-replay-card:not(.is-general) + .loven-replay-card.is-general {
  margin-left: 0.4rem;
}
.loven-review-charts h3 {
  padding: 0.25rem 0;
}
.loven-review-win-label {
  display: inline-block;
  cursor: help;
}
.loven-review-estimate-help {
  position: absolute;
  left: 0;
  top: 2rem;
  z-index: 2;
  width: max-content;
  max-width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid #789283;
  border-radius: 0.4rem;
  background: #10271f;
  color: #edf4ee;
  font-size: 0.8rem;
  line-height: 1.5;
  pointer-events: none;
  visibility: hidden;
}
.loven-review-win-label:hover + .loven-review-estimate-help,
.loven-review-win-label:focus + .loven-review-estimate-help {
  visibility: visible;
}
