.card-table {
  display: grid;
  gap: 18px;
}
.card-zone {
  border: 1px solid #d7dee8;
  border-radius: 6px;
  background: #fff;
}
.card-zone-header {
  align-items: center;
  border-bottom: 1px solid #e8edf3;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 12px;
}
.card-zone-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}
.card-zone-count {
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.card-zone-cards {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 112px;
  padding: 12px;
}
.card-zone-draw .card-zone-cards {
  align-items: flex-start;
}
.card-zone-empty {
  color: #777;
  margin: 0;
}
.card-item {
  align-items: center;
  aspect-ratio: 5 / 7;
  border: 1px solid #c7d0dc;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(31, 41, 55, 0.12);
  display: inline-flex;
  flex: 0 0 72px;
  font-weight: 700;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  position: relative;
  text-align: center;
}
.card-visible {
  background: #fff;
  color: #1f2937;
}
.card-action {
  cursor: pointer;
  padding: 0;
}
.card-action:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.card-action:hover {
  border-color: #7c8ea6;
}
.card-hidden {
  background: #1f5f7a;
  border-color: #17495d;
}
.card-back-pattern {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16) 25%, transparent 25%) 0 0 / 12px 12px, linear-gradient(225deg, rgba(255, 255, 255, 0.16) 25%, transparent 25%) 0 0 / 12px 12px, #1f5f7a;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-radius: 4px;
  bottom: 8px;
  left: 8px;
  position: absolute;
  right: 8px;
  top: 8px;
}
.card-unknown {
  background: #f3f4f6;
  border-style: dashed;
  color: #6b7280;
}
.card-center {
  font-size: 18px;
  line-height: 1.1;
  max-width: 90%;
  overflow-wrap: anywhere;
}
.card-center-suit {
  font-size: 30px;
}
.card-corner {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  line-height: 1;
  position: absolute;
}
.card-corner-top {
  left: 6px;
  top: 6px;
}
.card-corner-bottom {
  bottom: 6px;
  right: 6px;
  transform: rotate(180deg);
}
.card-suit-red {
  color: #b42318;
}
.card-suit-black {
  color: #111827;
}
.card-suit-neutral {
  color: #425466;
}
.card-item.is-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2), 0 2px 6px rgba(31, 41, 55, 0.12);
}
.card-item.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.card-item.is-pending {
  border-color: #946200;
}
.card-item.is-invalid {
  border-color: #b42318;
}
.card-draw-stack {
  height: 112px;
  min-width: 72px;
  position: relative;
}
.card-draw-stack-count-2 {
  min-width: 84px;
}
.card-draw-stack-count-3 {
  min-width: 96px;
}
.card-stack-card {
  left: 0;
  position: absolute;
  top: 0;
  width: 72px;
}
.card-stack-position-1 {
  left: 12px;
  top: 4px;
}
.card-stack-position-2 {
  left: 24px;
  top: 8px;
}
.card-draw-stack-count {
  background: rgba(17, 24, 39, 0.76);
  border-radius: 999px;
  bottom: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  left: 8px;
  overflow: hidden;
  padding: 2px 7px;
  position: absolute;
  right: 8px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  z-index: 4;
}
@media (max-width: 767px) {
  .card-item {
    flex-basis: 60px;
  }
  .card-draw-stack {
    height: 96px;
    min-width: 60px;
  }
  .card-stack-card {
    width: 60px;
  }
  .card-draw-stack-count-2 {
    min-width: 70px;
  }
  .card-draw-stack-count-3 {
    min-width: 80px;
  }
  .card-center {
    font-size: 15px;
  }
  .card-center-suit {
    font-size: 26px;
  }
  .card-stack-position-1 {
    left: 10px;
  }
  .card-stack-position-2 {
    left: 20px;
  }
}
.cribbage-page {
  background: #f3f5f0;
}
.cribbage-shell {
  color: #24302c;
  padding: 80px 0 40px;
}
.cribbage-header,
.cribbage-table-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}
.cribbage-header {
  display: block;
}
.cribbage-header h1,
.cribbage-table-header h1 {
  font-size: 34px;
  font-weight: 700;
  margin: 0 0 4px;
}
.cribbage-header p,
.cribbage-table-header p {
  color: #5f6d68;
  margin: 0;
}
.cribbage-table-header .cribbage-room-code {
  color: #3b4843;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 3px;
  text-transform: uppercase;
}
.cribbage-room-code span {
  background: #ffffff;
  border: 1px solid #c7d0ca;
  border-radius: 4px;
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
}
.cribbage-share-link {
  align-items: center;
  display: flex;
  gap: 8px;
  max-width: 520px;
  min-width: 320px;
}
.cribbage-share-link .form-control {
  background: #ffffff;
  cursor: text;
  min-width: 0;
}
.cribbage-panel,
.cribbage-board,
.cribbage-discard-advice,
.cribbage-pegging-advice,
.cribbage-log {
  background: #ffffff;
  border: 1px solid #d9dfd8;
  border-radius: 6px;
  margin-bottom: 16px;
  padding: 16px;
}
.cribbage-panel h2,
.cribbage-discard-advice h2,
.cribbage-pegging-advice h2,
.cribbage-log h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px;
}
.cribbage-panel label {
  color: #4e5b56;
  font-size: 13px;
  margin-top: 8px;
}
.cribbage-panel .btn {
  margin-top: 14px;
}
.cribbage-config-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-top: 6px;
}
.cribbage-new-game-config {
  max-width: 360px;
}
.cribbage-new-game-config label {
  color: #4e5b56;
  font-size: 13px;
}
.cribbage-status {
  color: #6a3732;
  min-height: 20px;
}
.cribbage-resume .cribbage-panel h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 6px;
}
.cribbage-resume .cribbage-panel p {
  color: #5f6d68;
  margin: 0;
}
.cribbage-empty-state {
  color: #67736e;
  margin: 0;
}
.cribbage-seats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}
.cribbage-seat {
  background: #ffffff;
  border: 1px solid #d9dfd8;
  border-radius: 6px;
  overflow: hidden;
  padding: 16px;
  position: relative;
}
.cribbage-seat.has-skunk {
  min-height: 112px;
  padding-right: 196px;
}
.cribbage-seat.is-winner {
  border-color: #23744f;
  box-shadow: inset 0 0 0 3px #23744f;
}
.cribbage-seat.is-dealer {
  border-color: #23744f;
}
.cribbage-seat-name {
  color: #4e5b56;
  font-size: 13px;
  margin-bottom: 6px;
}
.cribbage-seat-badge {
  background: #e6f2ec;
  border: 1px solid #a5d0ba;
  border-radius: 999px;
  color: #1f6848;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  margin-right: 6px;
  padding: 3px 8px;
}
.cribbage-seat-badge.is-winner {
  background: #23744f;
  border-color: #23744f;
  color: #ffffff;
}
.cribbage-seat-badge.is-loss {
  background: #f7e7e2;
  border-color: #d89b8c;
  color: #8a3a2d;
}
.cribbage-seat-badge.is-skunk {
  background: #252b28;
  border-color: #252b28;
  color: #f4f0df;
}
.cribbage-seat-score-row {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}
.cribbage-seat-score {
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
}
.cribbage-skunk-markers {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 15px;
  pointer-events: none;
  position: absolute;
  right: 6px;
  bottom: 8px;
  z-index: 1;
}
.cribbage-skunk-marker {
  display: block;
  height: auto;
  object-fit: contain;
  width: auto;
}
.cribbage-game-over {
  background: #f6fbf8;
  border: 2px solid #23744f;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px #a5d0ba;
  margin-bottom: 16px;
  padding: 18px;
}
.cribbage-game-over-label {
  color: #23744f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}
.cribbage-game-over h2 {
  color: #1e2824;
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 6px;
}
#cribbageFinalScore,
.cribbage-new-game-status {
  color: #4e5b56;
  margin: 0 0 10px;
}
.cribbage-new-game-status {
  font-size: 13px;
}
.cribbage-log ol {
  list-style: none;
  margin: 0;
  max-height: 420px;
  overflow-y: auto;
  padding: 0 4px 0 0;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}
.cribbage-log li {
  border: 1px solid #edf0ed;
  border-radius: 6px;
  margin-top: 8px;
  padding: 10px;
}
.cribbage-log li:first-child {
  margin-top: 0;
}
.cribbage-log-entry.is-hand {
  background: #eaf4ff;
  border-color: #cfe2f3;
}
.cribbage-log-entry.is-crib {
  background: #fff2cc;
  border-color: #f1d99b;
}
.cribbage-log-entry.is-pegging {
  background: #eadcf8;
  border-color: #d9c2e9;
}
.cribbage-log-entry.is-discard {
  background: #fce5cd;
  border-color: #f4c7a1;
}
.cribbage-log-entry.is-hint {
  background: #fde7e3;
  border-color: #e5a49a;
}
.cribbage-log-entry.is-deal,
.cribbage-log-entry.is-cut {
  background: #e2f0d9;
  border-color: #c8dfb8;
}
.cribbage-log-entry.is-lobby,
.cribbage-log-entry.is-round {
  background: #f8fbf7;
}
.cribbage-log-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 5px;
}
.cribbage-log-phase,
.cribbage-log-player,
.cribbage-log-card {
  border-radius: 4px;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  padding: 2px 7px;
}
.cribbage-log-phase {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(36, 48, 44, 0.12);
  color: #33413d;
  text-transform: uppercase;
}
.cribbage-log-player {
  background: #d9ead3;
  border: 1px solid #b6d7a8;
  color: #1f3924;
}
.cribbage-log-title {
  color: #1f2d28;
  font-weight: 700;
}
.cribbage-log-body {
  color: #4e5b56;
  font-size: 13px;
  margin-top: 5px;
}
.cribbage-log-detail,
.cribbage-log-cards {
  margin-top: 3px;
}
.cribbage-log-detail-label {
  color: #33413d;
  font-weight: 700;
}
.cribbage-log-card {
  background: #ffffff;
  border: 1px solid rgba(36, 48, 44, 0.16);
  color: #24302c;
  margin-left: 5px;
}
.cribbage-discard-summary,
.cribbage-analysis-summary {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.cribbage-discard-label,
.cribbage-discard-cards,
.cribbage-discard-stat,
.cribbage-analysis-label,
.cribbage-analysis-cards,
.cribbage-analysis-stat {
  border-radius: 4px;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  padding: 3px 8px;
}
.cribbage-discard-label,
.cribbage-analysis-label {
  background: #23744f;
  color: #ffffff;
}
.cribbage-discard-cards,
.cribbage-analysis-cards {
  background: #ffffff;
  border: 1px solid rgba(36, 48, 44, 0.16);
  color: #24302c;
}
.cribbage-discard-stat,
.cribbage-analysis-stat {
  background: #eef5f1;
  border: 1px solid #c7d7ce;
  color: #33413d;
}
.cribbage-discard-table,
.cribbage-analysis-table {
  margin: 0;
  width: 100%;
}
.cribbage-discard-table th,
.cribbage-discard-table td,
.cribbage-analysis-table th,
.cribbage-analysis-table td {
  border-top: 1px solid #edf0ed;
  font-size: 13px;
  padding: 6px 8px;
  text-align: left;
}
.cribbage-discard-table th,
.cribbage-analysis-table th {
  color: #4e5b56;
  font-size: 12px;
  text-transform: uppercase;
}
.cribbage-discard-table tr.is-best td,
.cribbage-analysis-table tr.is-best td {
  background: #f3faf6;
  color: #1f6848;
  font-weight: 700;
}
.cribbage-board h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 8px;
}
.cribbage-zone-owner {
  color: #23744f;
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-top: 3px;
}
.cribbage-shared {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 16px;
}
.cribbage-hands {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.cribbage-zone {
  border: 1px solid #edf0ed;
  border-radius: 6px;
  min-height: 112px;
  padding: 12px;
}
.cribbage-zone.is-turn {
  background: #fff7ed;
  border-color: #b45309;
  box-shadow: inset 0 0 0 2px #b45309;
}
.cribbage-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cribbage-cards.is-hand-sortable {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  padding-top: 8px;
  touch-action: pan-x;
}
.cribbage-cards.is-hand-sortable .card-item {
  cursor: grab;
  user-select: none;
}
.cribbage-cards.is-hand-sortable .card-item.is-dragging {
  cursor: grabbing;
  transition: none;
}
.cribbage-cards.is-hand-sortable.is-reordering .card-item:not(.is-dragging) {
  opacity: 0.72;
}
.cribbage-cut-list {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
}
.cribbage-cut-row {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  max-width: 100%;
}
.cribbage-cut-row .cribbage-cards {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  min-width: 72px;
}
.cribbage-cut-name {
  color: #4e5b56;
  flex: 0 1 auto;
  font-size: 13px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.cribbage-cards .card-item {
  transition: box-shadow 140ms ease, transform 140ms ease;
}
.cribbage-cards .card-item.is-selected {
  transform: translateY(-8px);
}
.cribbage-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.cribbage-actions [hidden] {
  display: none !important;
}
.cribbage-hint-button {
  background: #b42318;
  border-color: #8f1d15;
  color: #ffffff;
}
.cribbage-hint-button:hover,
.cribbage-hint-button:focus {
  background: #971b12;
  border-color: #73140f;
  color: #ffffff;
}
.cribbage-hint-button[disabled],
.cribbage-hint-button[disabled]:hover,
.cribbage-hint-button[disabled]:focus {
  background: #c66a62;
  border-color: #b65b53;
  color: #ffffff;
}
.cribbage-count {
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 10px;
}
.cribbage-count-note {
  color: #4e5b56;
  margin: 0 0 10px;
}
.cribbage-played {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
@media (max-width: 767px) {
  .cribbage-seats {
    grid-template-columns: 1fr;
  }
  .cribbage-shared,
  .cribbage-hands {
    grid-template-columns: 1fr;
  }
  .cribbage-table-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .cribbage-share-link {
    align-items: stretch;
    flex-direction: column;
    max-width: none;
    min-width: 0;
    width: 100%;
  }
  .cribbage-config-grid {
    grid-template-columns: 1fr;
  }
}

