/* src/styles/app.css */
.board-overlay {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  touch-action: none;
  inset: 0;
}

.board-region {
  position: absolute;
}

.board-info-rail {
  display: contents;
}

.board-discard-blur-layer {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  backdrop-filter: blur(3px) saturate(.92);
  -webkit-backdrop-filter: blur(3px) saturate(.92);
  background: #ffffff05;
  inset: 0;
}

.board-turn-prompt {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  display: grid;
  box-sizing: border-box;
  color: var(--color-text-primary, #17171c);
  background: #f8f9fbed;
  border: 1px solid #15151b29;
  border-radius: 10px;
  gap: 3px;
  width: -moz-fit-content;
  width: fit-content;
  max-width: min(360px, 100vw - 24px);
  padding: 9px 12px;
  top: 12px;
  left: 12px;
  box-shadow: 0 8px 24px #1212191a;
}

.board-turn-prompt-status {
  color: var(--text-muted, #696a76);
  text-transform: uppercase;
  font-size: .73rem;
  font-weight: 700;
  line-height: 1;
}

.board-turn-prompt-main {
  display: inline-flex;
  align-items:  center;
  gap: 8px;
  min-width: 0;
}

.board-turn-prompt-icon {
  box-sizing: border-box;
  display: inline-flex;
  color: #3c77d5;
  overflow: visible;
  justify-content: center;
  align-items:  center;
  width: 1.2rem;
  min-width: 1.2rem;
  height: 1.2rem;
  font-size: 1rem;
  line-height: 1;
}

.board-turn-prompt-icon[data-icon-kind="asset"] {
  color: inherit;
  background: #0f172ab8;
  border: 1px solid #0f172a57;
  border-radius: 7px;
  padding: 3px;
  box-shadow: inset 0 0 0 1px #f8fafc14, 0 1px 4px #0f172a29;
}

.board-turn-prompt-icon[data-icon-marker="settlement"] {
  width: 1.62rem;
  min-width: 1.62rem;
  height: 1.62rem;
}

.board-turn-prompt-icon[data-icon-marker="road"] {
  width: 2.5rem;
  min-width: 2.5rem;
  height: 1.44rem;
}

.board-turn-prompt-icon-image {
  display: block;
  object-fit: contain;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

.board-turn-prompt-instruction {
  overflow-wrap: anywhere;
  min-width: 0;
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.15;
}

.board-region-top-left {
  width: min(360px, 100vw - 24px);
  top: 82px;
  left: 12px;
}

.board-region-top-right {
  width: min(360px, 100vw - 24px);
  top: 12px;
  right: 12px;
}

.board-region-bottom-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, 100vw - 24px);
  bottom: 12px;
  left: 12px;
}

.board-region-bottom-right {
  width: min(320px, 100vw - 24px);
  bottom: 12px;
  right: 12px;
}

.board-region-popover-layer {
  pointer-events: none;
  z-index: 3;
  inset: 0;
}

.board-panel, .board-hand, .board-actions {
  pointer-events: auto;
  box-sizing: border-box;
  border: 1px solid var(--color-border-secondary, #15151b2e);
  color: var(--color-text-primary, #17171c);
  background: #f8f9fbeb;
}

.board-panel, .board-hand {
  padding: 8px;
}

.board-panel-header, .board-hand-header {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  gap: 8px;
}

.board-svg text.board-label-hot {
  fill: var(--board-hot-fill);
}

.board-robber {
  pointer-events: none;
}

.board-panel-title, .board-hand-title, .board-hand-section-title {
  font: inherit;
  margin: 0;
  font-weight: 600;
}

.board-panel-mobile-icon, .board-panel-alert-badge {
  display: none;
}

.board-panel-toggle, .board-action {
  font: inherit;
  cursor: pointer;
}

.board-panel-toggle {
  position: relative;
  color: inherit;
  cursor: pointer;
  background: none;
  border: 1px solid #0000;
  border-radius: 999px;
  width: 30px;
  height: 30px;
  padding: 0;
  transition: border-color .18s, background-color .18s, color .18s;
}

.board-panel-toggle-icon {
  position: absolute;
  width: 18px;
  height: 18px;
  transition: transform .18s cubic-bezier(.2,.8,.2,1);
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%)rotate(45deg)scale(1);
}

.board-panel-toggle-icon:before, .board-panel-toggle-icon:after {
  content: "";
  position: absolute;
  background: currentColor;
  border-radius: 999px;
  width: 18px;
  height: 2px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.board-panel-toggle-icon:after {
  transform: translate(-50%, -50%)rotate(90deg);
}

.board-panel-toggle[aria-expanded="false"] {
  border-color: var(--color-border-secondary, #15151b2e);
  background: #ffffffd1;
}

.board-panel-toggle[aria-expanded="false"] .board-panel-toggle-icon {
  transform: translate(-50%, -50%)rotate(0)scale(.5);
}

.board-visually-hidden {
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
}

.board-icon-image {
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  width: 100%;
  height: 100%;
}

.board-svg-icon {
  display: block;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  pointer-events: none;
  user-select: none;
  width: 100%;
  height: 100%;
}

.board-ui-icon {
  display: block;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  flex: none;
  width: 1em;
  height: 1em;
}

.board-inline-icon {
  display: inline-flex;
  vertical-align: -.15rem;
  justify-content: center;
  align-items:  center;
  width: .95rem;
  height: .95rem;
  margin: 0 .05rem;
}

.board-panel[data-collapsed="true"] .board-panel-body {
  display: none;
}

.board-list, .board-pill-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.board-list-item + .board-list-item, .board-pill + .board-pill, .board-hand-section + .board-hand-section {
  margin-top: 4px;
}

.board-list-item[data-log-item-state="new"] {
  animation: board-log-item-highlight 5s ease-out forwards;
  border-radius: 8px;
}

.board-summary-table {
  border-collapse: collapse;
  text-align: left;
  margin: 8px 0 0;
}

.board-summary-table th, .board-summary-table td {
  padding: 0 8px 0 0;
  font-weight: normal;
}

.board-summary-table th:not(:first-child), .board-summary-table td:not(.board-player-label) {
  text-align: right;
}

.board-summary-table th {
  font-weight: 600;
}

.board-summary-heading-icon {
  color: var(--text-muted, #696a76);
  width: .95rem;
  height: .95rem;
  margin: 0 auto;
}

.board-player-label {
  font-weight: 600;
}

[data-template="player-summary-line"][data-seat="0"] [data-field="player-label"] {
  color: var(--player-0);
}

[data-template="player-summary-line"][data-seat="1"] [data-field="player-label"] {
  color: var(--player-1);
}

[data-template="player-summary-line"][data-seat="2"] [data-field="player-label"] {
  color: var(--player-2);
}

[data-template="player-summary-line"][data-seat="3"] [data-field="player-label"] {
  color: var(--player-3);
}

.board-empty-state[hidden] {
  display: none;
}

.board-panel[data-panel-kind="trade"] {
  padding: 8px 0 0;
}

.board-panel[data-panel-kind="trade"] .board-panel-header {
  padding: 0 8px 8px;
}

.board-panel[data-panel-kind="trade"] .board-panel-title {
  display: flex;
  align-items:  center;
  gap: 8px;
}

.board-panel[data-panel-kind="trade"] .board-panel-body {
  padding: 0 8px 8px;
}

.board-panel[data-panel-kind="trade"] [data-list="trade"] {
  margin: 0;
}

.board-panel[data-panel-kind="trade"] .board-empty-state {
  margin: 8px 0 0;
}

.trade-panel-count {
  display: inline-flex;
  color: var(--color-info, #3c77d5);
  background: #3c77d524;
  border-radius: 999px;
  justify-content: center;
  align-items:  center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 .35rem;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1;
}

.trade-panel-count[hidden] {
  display: none;
}

.trade-list-item {
  padding: 8px 0;
  transition: opacity .16s, transform .16s;
}

.trade-list-item + .trade-list-item {
  border-top: .5px solid var(--color-border-tertiary, #15151b1f);
  margin-top: 0;
}

.trade-list-item[data-removing="true"] {
  opacity: 0;
  pointer-events: none;
  transform: translateX(8px);
}

.trade-list-item[data-trade-direction="unactionable"] {
  position: relative;
  background: #4f5a6a12;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px #4f5a6a1a;
}

.trade-list-item[data-trade-direction="unactionable"]:after {
  content: "";
  position: absolute;
  pointer-events: none;
  background: #f8f9fb7a;
  border-radius: 7px;
  inset: 4px 0;
}

.trade-list-item[data-trade-direction="unactionable"] .trade-row {
  opacity: .64;
  filter: grayscale(.85) saturate(.55);
}

.trade-row {
  display: flex;
  align-items:  center;
  gap: 8px;
  min-width: 0;
}

.trade-player-tag {
  display: inline-flex;
  color: var(--color-text-primary, #17171c);
  background: #4f5a6a24;
  border-radius: 999px;
  flex: none;
  justify-content: center;
  align-items:  center;
  height: 1.5rem;
  padding: 0 .55rem;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1;
}

.trade-player-tag--local {
  color: var(--color-info, #3c77d5);
  background: #3c77d529;
}

.trade-side {
  display: inline-flex;
  align-items:  center;
  gap: 6px;
  min-width: 0;
}

.trade-side-label {
  display: inline-flex;
  color: var(--text-muted, #696a76);
  text-transform: uppercase;
  flex-direction: column;
  flex: none;
  justify-content: center;
  align-items:  center;
  gap: 1px;
  min-width: 1.65rem;
}

.trade-side-label-top, .trade-side-label-bottom {
  letter-spacing: .08em;
  font-size: .54rem;
  font-weight: 700;
  line-height: 1;
}

.resource-stack-groups {
  display: inline-flex;
  align-items:  center;
  gap: 6px;
  min-width: 0;
}

.resource-stack {
  position: relative;
  display: inline-flex;
  align-items:  center;
}

.resource-stack-chip {
  display: inline-flex;
  box-sizing: border-box;
  border: 1.5px solid var(--trade-chip-border, #ffffffeb);
  border-radius: 6px;
  flex: none;
  justify-content: center;
  align-items:  center;
  width: 30px;
  height: 30px;
  font-size: 1rem;
  line-height: 1;
  box-shadow: 0 3px 8px #16191f1f;
}

.resource-stack-chip > .board-icon-image {
  width: 23px;
  height: 23px;
}

.resource-stack-chip + .resource-stack-chip {
  margin-left: -14px;
}

.resource-stack-chip--wood, .resource-stack-chip[data-resource-name="wood"] {
  background: #6d9d5b;
}

.resource-stack-chip--brick, .resource-stack-chip[data-resource-name="brick"] {
  background: #d0856d;
}

.resource-stack-chip--sheep, .resource-stack-chip[data-resource-name="sheep"] {
  background: #a8c96a;
}

.resource-stack-chip--wheat, .resource-stack-chip[data-resource-name="wheat"] {
  background: #e4c25d;
}

.resource-stack-chip--ore, .resource-stack-chip[data-resource-name="ore"] {
  background: #8b97a4;
}

.resource-stack-count {
  position: absolute;
  color: #fff;
  text-align: center;
  background: #15151beb;
  border-radius: 999px;
  min-width: .95rem;
  height: .95rem;
  padding: 0 .25rem;
  font-size: .6rem;
  font-weight: 700;
  line-height: .95rem;
  bottom: -3px;
  left: -2px;
}

.resource-stack-empty {
  color: var(--text-muted, #696a76);
  font-size: .78rem;
  line-height: 1;
}

.trade-swap-arrow {
  display: inline-flex;
  color: var(--text-muted, #696a76);
  flex: none;
  justify-content: center;
  align-items:  center;
  width: 1rem;
  height: 1rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.trade-actions, .trade-responses {
  display: inline-flex;
  flex: none;
  align-items:  center;
  gap: 6px;
  margin-left: auto;
}

.trade-responses {
  gap: 4px;
}

.trade-action-button {
  display: inline-flex;
  border: 1px solid var(--color-border-secondary, #15151b2e);
  color: var(--color-text-primary, #17171c);
  cursor: pointer;
  background: #ffffffd6;
  border-radius: 999px;
  justify-content: center;
  align-items:  center;
  width: 28px;
  height: 28px;
  padding: 0;
  transition: border-color .16s, box-shadow .16s, transform .16s, background-color .16s;
}

.trade-action-button--accept {
  color: #fff;
  background: #1d9e75;
  border-color: #1d9e75;
}

.trade-action-button[aria-pressed="true"] {
  box-shadow: inset 0 0 0 1px #ffffff52;
}

.trade-action-button[disabled] {
  opacity: .45;
  cursor: not-allowed;
}

.trade-action-button svg {
  width: 15px;
  height: 15px;
}

.trade-response-shell {
  --trade-response-color: #4f5a6a;
  --trade-response-border: #4f5a6a47;
  --trade-response-fill: #4f5a6a1f;
  --trade-response-glow: #4f5a6a73;
  position: relative;
  display: inline-flex;
  flex: none;
}

.trade-response-pill {
  position: relative;
  display: inline-flex;
  box-sizing: border-box;
  color: var(--trade-response-color);
  appearance: none;
  -webkit-appearance: none;
  background: #ffffffe0;
  border: 0;
  border-radius: 999px;
  justify-content: center;
  align-items:  center;
  width: 32px;
  height: 28px;
  padding: 0 6px;
  transition: border-color .16s, box-shadow .16s, background-color .16s, filter .16s, opacity .16s;
  font-size: .73rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: inset 0 0 0 1px #15151b14;
}

button.trade-response-pill {
  cursor: pointer;
}

.trade-response-label {
  position: relative;
  z-index: 1;
  letter-spacing: 0;
}

.trade-response-outline {
  position: absolute;
  pointer-events: none;
  overflow: visible;
  width: 100%;
  height: 100%;
  inset: 0;
}

.trade-response-outline-path {
  fill: none;
  stroke: var(--trade-response-color);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 26 106;
  filter: drop-shadow(0 0 3px var(--trade-response-glow));
  opacity: .98;
  animation: trade-response-orbit 1.55s linear infinite;
}

.trade-response-shell:not([data-status="pending"]) .trade-response-outline {
  display: none;
}

.trade-response-shell[data-status="pending"] .trade-response-pill {
  background: var(--trade-response-fill);
  box-shadow: inset 0 0 0 1px var(--trade-response-border);
}

.trade-response-shell[data-status="pending"] .trade-response-label {
  opacity: .9;
}

.trade-response-shell[data-status="accepted"] .trade-response-pill {
  background-color: var(--trade-response-color);
  box-shadow: none;
  color: #fff;
}

.trade-response-shell[data-status="accepted"][data-interactive="true"] .trade-response-pill {
  animation: trade-response-glow 2s ease-in-out infinite;
}

.trade-response-shell[data-status="accepted"][data-interactive="true"] .trade-response-pill:hover {
  filter: brightness(1.1);
}

.trade-response-shell[data-status="rejected"] .trade-response-pill {
  border: 1.5px solid var(--trade-response-color);
  box-shadow: none;
  opacity: .34;
  background: none;
}

.trade-response-shell[data-status="rejected"] .trade-response-label {
  text-decoration: line-through;
}

.trade-action-button:focus-visible {
  outline: 2px solid #3c77d56b;
  outline-offset: 2px;
}

.trade-response-pill:focus-visible {
  outline: 2px solid #3c77d56b;
  outline-offset: 2px;
}

.board-popover {
  position: fixed;
  overflow: auto;
  box-sizing: border-box;
  color: #1f1b17;
  pointer-events: auto;
  background: #fff;
  border: 1px solid #d4d2ca;
  border-radius: 12px;
  width: min(340px, 100vw - 24px);
  max-height: min(72vh, 560px);
  padding: 14px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
  box-shadow: 0 18px 32px #29251f24;
}

.board-popover[hidden] {
  display: none;
}

.discard-dialog-modal {
  position: fixed;
  z-index: 4;
  display: flex;
  pointer-events: none;
  justify-content: center;
  align-items:  center;
  padding: 12px;
  inset: 0;
}

.discard-dialog-panel {
  position: relative;
  pointer-events: auto;
  max-height: min(80vh, 640px);
}

.discard-dialog-heading {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.discard-dialog-copy, .discard-dialog-count {
  margin: 0;
}

.discard-dialog-copy {
  color: #5f584d;
  font-size: .9rem;
  line-height: 1.4;
}

.discard-dialog-count {
  color: #6b583f;
  white-space: nowrap;
  background: #f1e6d4;
  border-radius: 999px;
  flex: none;
  align-self:  flex-start;
  padding: 6px 10px;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1;
}

.resource-select-panel {
  width: min(560px, 100vw - 24px);
}

.board-popover-header, .board-popover-footer, .resource-select-header, .resource-select-actions {
  display: flex;
  align-items:  center;
  gap: 10px;
}

.board-popover-header, .resource-select-header {
  justify-content: space-between;
}

.board-popover-title, .resource-select-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.board-popover-close, .resource-select-close {
  color: #58524a;
  font: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 999px;
  width: 30px;
  height: 30px;
  padding: 0;
  transition: background-color .12s, color .12s;
  font-size: 1.2rem;
  line-height: 1;
}

.board-popover-close:hover, .resource-select-close:hover {
  color: #1f1b17;
  background: #352f2714;
}

.board-popover-body, .resource-select-section + .resource-select-section, .resource-select-divider, .resource-select-actions {
  margin-top: 12px;
}

.board-popover-body {
  display: grid;
  gap: 12px;
}

.board-popover-label {
  color: #5f584d;
  margin: 0 0 8px;
  font-size: .83rem;
  font-weight: 700;
  line-height: 1.2;
}

.board-popover-resource-grid, .board-popover-player-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.board-popover-selection-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
}

.board-popover-resource-button, .board-popover-resource-chip, .board-popover-player-button, .board-popover-button, .board-popover-close, .resource-select-add-button, .resource-select-chip, .resource-select-button, .resource-select-close {
  -webkit-tap-highlight-color: transparent;
}

.board-popover-resource-button, .board-popover-resource-chip {
  display: inline-flex;
  background: var(--resource-select-bg, #f3ead7);
  color: #1f1b17;
  font: inherit;
  cursor: pointer;
  border: 1px solid #4a413638;
  border-radius: 12px;
  justify-content: flex-start;
  align-items:  center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 12px;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}

.board-popover-resource-button:hover:not(:disabled), .board-popover-resource-chip:hover:not(:disabled), .board-popover-player-button:hover:not(:disabled), .board-popover-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.board-popover-resource-button[data-selected="true"], .board-popover-resource-chip {
  border-color: var(--resource-select-accent, #5a564e);
  box-shadow: 0 8px 18px #201c181f;
}

.board-popover-resource-button:disabled, .board-popover-button:disabled {
  opacity: .46;
  cursor: not-allowed;
  transform: none;
}

.board-popover-player-button {
  display: inline-flex;
  color: #1f1b17;
  font: inherit;
  cursor: pointer;
  background: #fffaf3;
  border: 1px solid #4a413638;
  border-radius: 12px;
  align-items:  center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}

.board-popover-player-button[data-selected="true"] {
  border-color: var(--board-popover-player-color, #3c77d5);
  box-shadow: inset 0 0 0 1px var(--board-popover-player-color, #3c77d5);
}

.board-popover-player-swatch {
  background: var(--board-popover-player-color, #3c77d5);
  border-radius: 999px;
  width: 10px;
  height: 10px;
  box-shadow: 0 0 0 2px #ffffffbf;
}

.board-popover-resource-emoji {
  display: inline-flex;
  justify-content: center;
  align-items:  center;
  width: 20px;
  height: 20px;
}

.board-popover-footer {
  justify-content: flex-end;
  margin-top: 12px;
}

.board-popover-button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 10px;
  min-height: 36px;
  padding: 0 14px;
  transition: opacity .12s, transform .12s, filter .12s;
  font-size: .87rem;
  font-weight: 700;
  line-height: 1;
}

.board-popover-button--primary {
  color: #fff;
  background: #2f2f2b;
}

.resource-select-label {
  color: #5f584d;
  margin: 0 0 8px;
  font-size: .83rem;
  font-weight: 700;
  line-height: 1.2;
}

.resource-select-strip {
  display: flex;
  flex-wrap: wrap;
  align-items:  flex-start;
  gap: 10px 12px;
}

.resource-select-group {
  display: inline-flex;
  align-items:  center;
  min-width: 0;
}

.resource-select-chip-stack {
  display: inline-flex;
  overflow: visible;
  align-items:  center;
  min-width: 0;
  padding-right: 6px;
}

.resource-select-add-button, .resource-select-chip {
  position: relative;
  display: inline-flex;
  box-sizing: border-box;
  font: inherit;
  border-radius: 12px;
  justify-content: center;
  align-items:  center;
  width: 42px;
  height: 42px;
  line-height: 1;
}

.resource-select-add-button {
  color: #1f1b17;
  opacity: .56;
  cursor: pointer;
  background: #fff;
  border: 1.5px dashed #4a41365c;
  flex: none;
  transition: opacity .12s, border-color .12s, background-color .12s, transform .12s;
}

.resource-select-add-button:hover:not(:disabled) {
  opacity: .96;
  background: #faf8f4;
  border-color: #4a413694;
  transform: translateY(-1px);
}

.resource-select-add-button:disabled {
  cursor: not-allowed;
}

.resource-select-add-button[data-state="unavailable"] {
  opacity: .24;
}

.resource-select-add-button[data-state="exhausted"] {
  opacity: .18;
}

.resource-select-add-button[data-state="exhausted"]:after {
  content: "";
  position: absolute;
  transform-origin: center;
  border-top: 2px solid #38302880;
  inset: 10px 8px;
  transform: rotate(-34deg);
}

.resource-select-emoji {
  display: inline-flex;
  justify-content: center;
  align-items:  center;
  width: 22px;
  height: 22px;
}

.resource-select-chip {
  background: var(--resource-select-bg, #e5dfd2);
  color: #1b1815;
  cursor: pointer;
  overflow: visible;
  animation: resource-select-chip-in .1s ease-out;
  border: 2px solid #fff;
  flex: none;
  box-shadow: 0 6px 14px #201c1824;
}

.resource-select-chip + .resource-select-chip {
  margin-left: -22px;
}

.resource-select-chip-remove-badge {
  position: absolute;
  z-index: 5;
  display: inline-flex;
  color: #fff;
  background: #7a7b80;
  border-radius: 999px;
  justify-content: center;
  align-items:  center;
  width: 16px;
  height: 16px;
  font-size: .67rem;
  font-weight: 700;
  line-height: 1;
  top: -5px;
  right: -5px;
  box-shadow: 0 1px 3px #1a181433;
}

.resource-select-chip-count-badge {
  position: absolute;
  z-index: 4;
  display: inline-flex;
  background: var(--resource-select-accent, #5a564e);
  color: #fff;
  border-radius: 999px;
  justify-content: center;
  align-items:  center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  font-size: .68rem;
  font-weight: 700;
  line-height: 1;
  bottom: -5px;
  left: -4px;
}

.resource-select-chip-count-badge[hidden] {
  display: none;
}

.resource-select-divider {
  display: flex;
  color: #8f877c;
  align-items:  center;
  gap: 10px;
}

.resource-select-divider-line {
  background: #7d746738;
  flex: auto;
  height: 1px;
}

.resource-select-divider-icon {
  display: inline-flex;
  flex: none;
  justify-content: center;
  align-items:  center;
  width: 1rem;
  height: 1rem;
  font-size: .95rem;
  line-height: 1;
}

.resource-select-actions {
  justify-content: flex-end;
}

.discard-dialog-actions {
  margin-top: 16px;
}

.resource-select-actions-spacer {
  flex: auto;
}

.resource-select-button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 10px;
  min-height: 36px;
  padding: 0 14px;
  transition: opacity .12s, transform .12s, filter .12s;
  font-size: .87rem;
  font-weight: 700;
  line-height: 1;
}

.resource-select-button:hover:not(:disabled) {
  filter: brightness(.98);
  transform: translateY(-1px);
}

.resource-select-button:disabled {
  opacity: .46;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

.resource-select-button--secondary {
  color: #6d5840;
  background: #e8dcc9;
}

.resource-select-button--primary {
  color: #fff;
  background: #2f2f2b;
}

.resource-select-button--accent {
  color: #fff;
  background: #3e8b56;
}

.resource-select-add-button[data-resource-name="ore"], .resource-select-chip[data-resource-name="ore"], .board-popover-resource-button[data-resource-name="ore"], .board-popover-resource-chip[data-resource-name="ore"] {
  --resource-select-bg: #d3d1c7;
  --resource-select-accent: #7b7568;
}

.resource-select-add-button[data-resource-name="sheep"], .resource-select-chip[data-resource-name="sheep"], .board-popover-resource-button[data-resource-name="sheep"], .board-popover-resource-chip[data-resource-name="sheep"] {
  --resource-select-bg: #9fe1cb;
  --resource-select-accent: #2f8d72;
}

.resource-select-add-button[data-resource-name="brick"], .resource-select-chip[data-resource-name="brick"], .board-popover-resource-button[data-resource-name="brick"], .board-popover-resource-chip[data-resource-name="brick"] {
  --resource-select-bg: #f0997b;
  --resource-select-accent: #b45f42;
}

.resource-select-add-button[data-resource-name="wood"], .resource-select-chip[data-resource-name="wood"], .board-popover-resource-button[data-resource-name="wood"], .board-popover-resource-chip[data-resource-name="wood"] {
  --resource-select-bg: #c0dd97;
  --resource-select-accent: #61853e;
}

.resource-select-add-button[data-resource-name="wheat"], .resource-select-chip[data-resource-name="wheat"], .board-popover-resource-button[data-resource-name="wheat"], .board-popover-resource-chip[data-resource-name="wheat"] {
  --resource-select-bg: #fac775;
  --resource-select-accent: #bc8621;
}

.board-popover-resource-button:focus-visible {
  outline: 2px solid #3c77d56b;
  outline-offset: 2px;
}

.board-popover-resource-chip:focus-visible {
  outline: 2px solid #3c77d56b;
  outline-offset: 2px;
}

.board-popover-player-button:focus-visible {
  outline: 2px solid #3c77d56b;
  outline-offset: 2px;
}

.board-popover-button:focus-visible {
  outline: 2px solid #3c77d56b;
  outline-offset: 2px;
}

.board-popover-close:focus-visible {
  outline: 2px solid #3c77d56b;
  outline-offset: 2px;
}

.resource-select-add-button:focus-visible {
  outline: 2px solid #3c77d56b;
  outline-offset: 2px;
}

.resource-select-chip:focus-visible {
  outline: 2px solid #3c77d56b;
  outline-offset: 2px;
}

.resource-select-button:focus-visible {
  outline: 2px solid #3c77d56b;
  outline-offset: 2px;
}

.resource-select-close:focus-visible {
  outline: 2px solid #3c77d56b;
  outline-offset: 2px;
}

@keyframes static-trade-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes trade-response-orbit {
  from {
    stroke-dashoffset: 0;
  }

  to {
    stroke-dashoffset: -132;
  }
}

@keyframes trade-response-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 var(--trade-response-glow);
  }

  50% {
    box-shadow: 0 0 10px 3px var(--trade-response-glow);
  }
}

@keyframes resource-select-chip-in {
  from {
    transform: scale(.3);
  }

  to {
    transform: scale(1);
  }
}

@keyframes board-log-item-highlight {
  0%, 18% {
    background: #f8cc6f6b;
  }

  100% {
    background: none;
  }
}

.board-panel[data-panel-kind="chat"][data-collapsed="false"] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(360px, 100vw - 24px);
  max-height: clamp(220px, 36vh, 360px);
}

.board-panel[data-panel-kind="chat"][data-collapsed="false"] > .board-panel-body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  pointer-events: auto;
  gap: 8px;
  min-height: 0;
}

.board-log-tabs {
  display: inline-flex;
  background: #15151b12;
  border-radius: 10px;
  justify-self: start;
  align-items:  center;
  padding: 3px;
}

.board-log-tab {
  color: var(--text-muted, #696a76);
  font: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 7px;
  min-height: 28px;
  padding: 0 10px;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1;
}

.board-log-tab[aria-selected="true"] {
  color: var(--color-text-primary, #17171c);
  background: #fff;
  box-shadow: 0 1px 3px #0f172a1f;
}

.board-panel[data-panel-kind="chat"][data-log-mode="chat"] [data-log-mode-panel="history"], .board-panel[data-panel-kind="chat"][data-log-mode="history"] [data-log-mode-panel="chat"] {
  display: none;
}

.chat-messages, .board-log-history-panel > .board-panel-body {
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.board-log-history-panel {
  color: inherit;
  pointer-events: auto;
  background: none;
  border: 0;
  min-height: 0;
}

.board-log-history-header {
  display: none;
}

.board-log-history-panel .board-list {
  margin-top: 0;
}

.chat-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items:  start;
  gap: 8px;
}

.chat-compose-input, .chat-compose-submit {
  border-radius: 8px;
  min-height: 36px;
}

.chat-compose-input {
  color: #0f172a;
  background: #fff;
  border: 1px solid #cbd5e1;
  width: 100%;
  padding: 8px 10px;
}

.chat-compose-input[aria-invalid="true"] {
  border-color: #b42318;
}

.chat-compose-submit {
  color: #0f172a;
  cursor: pointer;
  background: #fff;
  border: 1px solid #cbd5e1;
  padding: 8px 12px;
}

.chat-compose-submit:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.chat-compose-status {
  grid-column: 1 / -1;
  color: #b42318;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.chat-compose-input:focus-visible {
  outline: 2px solid #3c77d56b;
  outline-offset: 2px;
}

.chat-compose-submit:focus-visible {
  outline: 2px solid #3c77d56b;
  outline-offset: 2px;
}

@media (min-width: 901px) {
  .board-panel[data-panel-kind="chat"][data-collapsed="false"] {
    max-height: clamp(200px, 32vh, 340px);
  }
}

.board-hand {
  --player-hand-chip-size: 40px;
  --player-hand-chip-overlap: -26px;
  --player-hand-chip-icon-size: 28px;
  position: absolute;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  width: -moz-fit-content;
  width: fit-content;
  max-width: calc(100vw - 24px);
  padding: 8px 10px;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 6px 18px #0f172a14;
}

.board-hand-row {
  display: flex;
  align-items:  center;
  min-width: 0;
}

.board-hand-group {
  min-width: 0;
}

.board-hand-group[hidden] {
  display: none;
}

.board-hand-chip-list {
  display: flex;
  list-style: none;
  align-items:  center;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.board-hand-divider {
  background: #d0d0d0;
  flex: none;
  width: 1px;
  height: 24px;
  margin: 0 10px;
}

.board-hand-divider[hidden] {
  display: none;
}

.board-hand-empty-state {
  color: var(--text-muted);
  margin: 0;
  font-size: 13px;
}

.player-hand-chip {
  position: relative;
  display: flex;
  width: var(--player-hand-chip-size);
  height: var(--player-hand-chip-size);
  box-sizing: border-box;
  cursor: default;
  user-select: none;
  border: 1.5px solid #0000001a;
  border-radius: 8px;
  flex: none;
  justify-content: center;
  align-items:  center;
  transition: transform .12s, box-shadow .12s;
  line-height: 1;
  transform: translateY(0);
}

.player-hand-chip[data-stack="same-kind"] {
  margin-left: var(--player-hand-chip-overlap);
}

.player-hand-chip[data-stack="new-kind"] {
  margin-left: 4px;
}

.player-hand-chip[data-interactive="true"] {
  cursor: pointer;
  outline: none;
  transition: transform .12s, box-shadow .12s;
}

.player-hand-chip[data-interactive="true"]:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 18px #0f172a29;
}

.player-hand-chip[data-interactive="true"]:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 10px 18px #0f172a29;
}

.player-hand-chip[data-disabled="true"]:after {
  content: "";
  position: absolute;
  border-radius: inherit;
  background: #ffffffa6;
  inset: 0;
}

.player-hand-chip[data-resource-name="ore"] {
  background: #8b97a4;
}

.player-hand-chip[data-resource-name="wheat"] {
  background: #e4c25d;
}

.player-hand-chip[data-resource-name="sheep"] {
  background: #a8c96a;
}

.player-hand-chip[data-resource-name="brick"] {
  background: #d0856d;
}

.player-hand-chip[data-resource-name="wood"] {
  background: #6d9d5b;
}

.player-hand-chip[data-dev-card-kind="knight"] {
  background: #8a5578;
}

.player-hand-chip[data-dev-card-kind="road_building"] {
  background: #9a7040;
}

.player-hand-chip[data-dev-card-kind="year_of_plenty"] {
  background: #3e8a7a;
}

.player-hand-chip[data-dev-card-kind="monopoly"] {
  background: #9a4040;
}

.player-hand-chip[data-dev-card-kind="vp"] {
  background: #b89828;
}

.player-hand-chip[data-dev-card-kind] {
  color: #17171c;
}

.player-hand-chip-emoji {
  position: relative;
  z-index: 1;
  width: var(--player-hand-chip-icon-size);
  height: var(--player-hand-chip-icon-size);
  display: inline-flex;
  justify-content: center;
  align-items:  center;
}

.board-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-radius: 10px;
  gap: 8px;
  padding: 8px;
  box-shadow: 0 6px 18px #0f172a14;
}

.board-action {
  display: inline-flex;
  color: var(--color-text-primary, #17171c);
  background: #ffffffdb;
  border: 1px solid #15151b2e;
  border-radius: 8px;
  justify-content: center;
  align-items:  center;
  gap: 7px;
  min-height: 38px;
  padding: 0 12px;
  transition: background-color .16s, border-color .16s, box-shadow .16s, opacity .16s, transform .16s;
  line-height: 1;
}

.board-action-icon, .board-action-roll {
  flex: none;
  line-height: 1;
}

.board-action-icon {
  display: inline-flex;
  justify-content: center;
  align-items:  center;
  width: 1.05rem;
  height: 1.05rem;
  font-size: .95rem;
}

.board-action-roll {
  text-align: center;
  min-width: 1.3em;
  font-weight: 800;
}

.board-action-label {
  overflow-wrap: anywhere;
  min-width: 0;
}

.board-action[data-ui-state="disabled"] {
  opacity: .5;
  cursor: not-allowed;
}

.board-action[data-ui-state="emphasized"] {
  color: #fff;
  background: #3c77d5;
  border-width: 2px;
  border-color: #3c77d5d1;
  font-weight: 700;
  box-shadow: 0 10px 24px #3c77d547;
}

.board-static-marker {
  pointer-events: none;
}

.board-svg[data-current-player="0"] .board-static-marker[data-player="0"] path, .board-svg[data-current-player="1"] .board-static-marker[data-player="1"] path, .board-svg[data-current-player="2"] .board-static-marker[data-player="2"] path, .board-svg[data-current-player="3"] .board-static-marker[data-player="3"] path {
  animation: board-static-marker-glow 2.4s ease-in-out infinite;
}

.board-action-target {
  cursor: pointer;
  opacity: .94;
  outline: none;
}

.board-action-target-backdrop {
  fill: #f8fafc00;
  stroke: none;
  pointer-events: all;
}

.board-action-target-road-image, .board-action-target-settlement-image {
  pointer-events: none;
}

.board-action-target-static-outline {
  fill: #f8fafc24;
  stroke: #0f172aa8;
  stroke-width: 2.35;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.board-action-target-animated-outline {
  fill: none;
  stroke: #f8fafc;
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: 16 84;
  stroke-dashoffset: 0;
  animation: board-action-target-trace 1.55s linear infinite;
  filter: drop-shadow(0 0 4px #f8fafcb3);
  pointer-events: none;
}

.board-action-target--robber .board-action-target-static-outline {
  fill: #a82a1a29;
  stroke: #6f180fd1;
}

.board-action-target--robber .board-action-target-animated-outline {
  stroke: #fff4f0;
  animation-duration: 1.2s;
}

.board-action-target:hover {
  opacity: 1;
}

.board-action-target:focus-visible {
  opacity: 1;
}

.board-action-target:hover .board-action-target-backdrop {
  fill: #f8fafc33;
}

.board-action-target:focus-visible .board-action-target-backdrop {
  fill: #f8fafc33;
}

@keyframes board-action-target-trace {
  from {
    stroke-dashoffset: 0;
  }

  to {
    stroke-dashoffset: -100;
  }
}

@keyframes board-static-marker-glow {
  0%, 100% {
    filter: drop-shadow(0 0 4px #f8fafce6) drop-shadow(0 0 10px #f8fafca6);
  }

  50% {
    filter: drop-shadow(0 0 8px #f8fafc) drop-shadow(0 0 18px #f8fafcd9) drop-shadow(0 0 28px #f8fafc8c);
  }
}

@media (prefers-reduced-motion: reduce) {
  .trade-response-shell[data-status="pending"] .trade-response-outline-path, .trade-response-shell[data-status="accepted"][data-interactive="true"] .trade-response-pill, .board-action-target-animated-outline {
    animation: none;
  }

  .trade-response-shell[data-status="pending"] .trade-response-outline-path, .board-action-target-animated-outline {
    stroke-dasharray: none;
  }
}

@media (max-width: 900px) {
  .board-turn-prompt {
    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    border-radius: 9px;
    max-width: min(245px, 100vw - 96px);
    padding: 8px 10px;
  }

  .board-turn-prompt-status {
    font-size: .66rem;
  }

  .board-turn-prompt-instruction {
    font-size: .86rem;
  }

  .board-info-rail {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    z-index: 2;
    display: flex;
    pointer-events: none;
    flex-direction: column;
    align-items:  flex-end;
    gap: 8px;
    width: min(340px, 100vw - 24px);
  }

  .board-info-rail > .board-region {
    position: relative;
    pointer-events: none;
    width: auto;
    max-width: 100%;
    inset: auto;
  }

  .board-region-top-left {
    order: 1;
  }

  .board-region-bottom-left {
    display: block;
    order: 2;
  }

  .board-region-top-right {
    order: 3;
  }

  .board-info-rail .board-panel {
    pointer-events: auto;
    box-shadow: 0 10px 24px #1212191f;
  }

  .board-info-rail .board-panel[data-collapsed="true"] {
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
    background: #f8f9fbed;
    border-radius: 12px;
    width: 58px;
    height: 54px;
    padding: 0;
  }

  .board-info-rail .board-panel[data-collapsed="true"] .board-panel-header {
    box-sizing: border-box;
    justify-content: center;
    gap: 0;
    width: 100%;
    height: 100%;
    padding: 0;
  }

  .board-info-rail .board-panel[data-collapsed="true"] .board-panel-title {
    display: grid;
    color: var(--color-text-primary, #17171c);
    text-align: center;
    place-items:  center;
    gap: 1px;
    font-size: .6rem;
    line-height: 1;
  }

  .board-info-rail .board-panel[data-collapsed="false"] {
    border-radius: 12px;
    width: min(340px, 100vw - 24px);
    max-height: min(56vh, 460px);
  }

  .board-info-rail .board-panel[data-collapsed="false"] .board-panel-body {
    min-height: 0;
  }

  .board-info-rail .board-panel[data-panel-kind="player-summary"][data-collapsed="false"], .board-info-rail .board-panel[data-panel-kind="trade"][data-collapsed="false"] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .board-region-top-left .board-panel[data-collapsed="false"] {
    margin-top: 76px;
  }

  .board-info-rail .board-panel[data-panel-kind="player-summary"][data-collapsed="false"] .board-panel-body, .board-info-rail .board-panel[data-panel-kind="trade"][data-collapsed="false"] .board-panel-body {
    overflow-y: auto;
    overflow-x: hidden;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }

  .board-panel-mobile-icon {
    display: inline-flex;
    justify-content: center;
    align-items:  center;
    width: 1.25rem;
    height: 1.25rem;
    font-size: 1.05rem;
    line-height: 1;
  }

  .board-info-rail .board-panel[data-collapsed="true"] .board-panel-mobile-icon {
    width: 36px;
    height: 36px;
    font-size: 36px;
  }

  .board-info-rail .board-panel[data-collapsed="true"] .board-panel-title-text {
    display: none;
  }

  .board-info-rail .board-panel[data-collapsed="true"] .trade-panel-count {
    position: absolute;
    top: 4px;
    right: 4px;
  }

  .board-panel-alert-badge {
    position: absolute;
    display: inline-flex;
    color: #fff;
    background: #d93f32;
    border-radius: 999px;
    justify-content: center;
    align-items:  center;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    font-size: .65rem;
    font-weight: 800;
    line-height: 1;
    top: 4px;
    right: 4px;
  }

  .board-panel-alert-badge[hidden] {
    display: none;
  }

  .board-panel[data-has-unread="true"][data-collapsed="true"] {
    border-color: #d93f329e;
    box-shadow: 0 0 0 3px #d93f321f, 0 10px 24px #1212191f;
  }

  .board-info-rail .board-panel[data-collapsed="true"] .board-panel-toggle {
    position: absolute;
    border-radius: inherit;
    background: none;
    border: 0;
    width: auto;
    height: auto;
    inset: 0;
  }

  .board-info-rail .board-panel[data-collapsed="true"] .board-panel-toggle-icon {
    display: none;
  }

  .board-hand {
    left: max(12px, env(safe-area-inset-left));
    right: auto;
    bottom: max(12px, env(safe-area-inset-bottom));
    max-width: calc(100vw - 148px - env(safe-area-inset-left)  - env(safe-area-inset-right));
    transform: none;
    box-shadow: 0 10px 24px #1212191f;
  }

  .board-region-bottom-right {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 2;
    width: auto;
  }

  .board-actions {
    grid-template-columns: minmax(0, 1fr);
    box-shadow: none;
    background: none;
    border: 0;
    width: auto;
    padding: 0;
  }

  .board-action {
    background: #f8f9fbf0;
    border-radius: 12px;
    justify-content: center;
    min-width: 112px;
    min-height: 46px;
    padding: 0 12px;
    font-size: .87rem;
    box-shadow: 0 8px 20px #1212191f;
  }

  .board-action[data-ui-state="disabled"], .board-action[data-action-kind="trade"] {
    display: none;
  }

  .board-action[data-ui-state="emphasized"] {
    min-height: 52px;
    box-shadow: 0 12px 28px #3c77d552;
  }

  .trade-row {
    gap: 6px;
  }

  .trade-chip {
    width: 28px;
    height: 28px;
  }

  .trade-chip + .trade-chip {
    margin-left: -12px;
  }

  .board-popover {
    width: min(360px, 100vw - 24px);
    max-height: min(60vh, 520px);
    padding: 12px;
  }

  .board-popover-resource-grid, .board-popover-player-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .resource-select-actions {
    flex-wrap: wrap;
  }

  .resource-select-actions-spacer {
    display: none;
  }

  .resource-select-button {
    flex: calc(50% - 5px);
  }

  .resource-select-button--secondary {
    flex-basis: 100%;
  }
}

@media (max-width: 480px) {
  .board-hand {
    --player-hand-chip-size: 36px;
    --player-hand-chip-overlap: -22px;
    --player-hand-chip-icon-size: 25px;
    padding: 6px 8px;
  }

  .board-hand-row {
    flex-wrap: wrap;
    row-gap: 8px;
  }
}
