:root {
  color-scheme: dark;
  --navy: #102437;
  --felt: #18374f;
  --ivory: #f6efdc;
  --gold: #d9b971;
  --muted: #9fb0bc;
  --line: #ffffff22;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #102437;
  color: var(--ivory);
  font:
    14px Arial,
    Helvetica,
    sans-serif;
  background-image: radial-gradient(
    ellipse at 50% 30%,
    #1a3a51,
    transparent 65%
  );
}
button,
a {
  touch-action: manipulation;
}
button {
  font: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #f6cd78;
  outline-offset: 4px;
}
main {
  max-width: 1050px;
  padding: 32px 44px 25px;
  margin: auto;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--gold);
  margin: 0;
}
h1 {
  font:
    60px/1 Georgia,
    serif;
  letter-spacing: -2px;
  margin: 9px 0 0;
}
h1 span {
  font: 32px Georgia;
  color: var(--gold);
  display: inline-block;
  margin-left: 18px;
  transform: rotate(-12deg);
}
.intro {
  font:
    16px Georgia,
    serif;
  color: var(--muted);
  margin: 12px 0 0;
}
.rules-link {
  color: var(--ivory);
  font-size: 12px;
  text-decoration: none;
  border-bottom: 1px solid #ffffff44;
  padding-bottom: 9px;
}
.rules-link span {
  margin-left: 16px;
  color: var(--gold);
}
.contract-bar {
  display: flex;
  border: 1px solid #a9b7bf36;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  padding: 20px 27px;
  align-items: center;
  gap: 30px;
  background: #0b2030aa;
}
.contract {
  border-right: 1px solid var(--line);
  padding-right: 30px;
  min-width: 120px;
}
.contract strong {
  font:
    40px Georgia,
    serif;
  display: block;
  margin-top: 3px;
}
.deal-info h2 {
  font:
    23px Georgia,
    serif;
  margin: 7px 0 0;
}
.deal-info .eyebrow {
  color: var(--muted);
}
.score {
  margin-left: auto;
  text-align: right;
}
.score strong {
  display: block;
  font: 34px Georgia;
  margin-top: 7px;
}
.score small {
  font: 15px Arial;
  color: var(--muted);
  margin-left: 6px;
}
.table {
  position: relative;
  border: 1px solid #99adba5c;
  border-radius: 0 0 24px 24px;
  background: radial-gradient(ellipse at 50% 30%, #254a60, #153349);
  padding: 22px 29px 20px;
  box-shadow:
    inset 0 0 0 6px #ffffff03,
    0 15px 40px #0003;
}
.table:before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 8px;
  border: 1px solid #d2ba7d22;
  border-radius: 0 0 18px 18px;
}
.dummy-head,
.south-head {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 10px;
  letter-spacing: 1.5px;
  position: relative;
}
.dummy-head small,
.south-head small {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.3px;
  margin-left: 8px;
}
.seat-dot {
  border: 1px solid #cab77d66;
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  font: 12px Georgia;
  flex: none;
  color: var(--gold);
}
.turn-badge {
  margin-left: auto;
  background: #dcbf77;
  color: #183347;
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 1px;
  padding: 6px 9px;
  border-radius: 3px;
}
.turn-badge:empty {
  display: none;
}
.dummy {
  min-height: 97px;
  padding: 10px 0 0;
}
.dummy-hidden {
  border: 1px dashed #a5b8c04d;
  border-radius: 6px;
  text-align: center;
  color: #b8c7cc;
  padding: 27px 8px;
  font: 14px Georgia;
  letter-spacing: 0.3px;
}
.dummy-suits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 710px;
  margin: auto;
}
.suit-row {
  border-right: 1px solid #ffffff18;
  padding-right: 10px;
}
.suit-row:last-child {
  border-right: 0;
  padding-right: 0;
}
.suit-name {
  font-size: 10px;
  letter-spacing: 0.5px;
  color: #b9c5ca;
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 7px;
}
.suit-name b {
  font-size: 17px;
  color: #f0e6cf;
}
.suit-name.red b {
  color: #f09a8d;
}
.suit-name .trump-tag {
  font-size: 7px;
  color: var(--gold);
  margin-left: auto;
  letter-spacing: 0.5px;
}
.rank-cards {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.rank-chip {
  border: 1px solid transparent;
  border-radius: 4px;
  background: #e4ddca;
  box-shadow: 0 3px 0 #0a2132;
  color: #253d4e;
  min-width: 32px;
  height: 37px;
  font: bold 19px Georgia;
  padding: 0 5px;
}
.rank-chip.red {
  color: #a02f35;
}
.rank-chip:disabled {
  opacity: 0.6;
}
.rank-chip.playable {
  background: #fff8e7;
  border-color: #e8cf8b;
  box-shadow:
    0 2px 0 #091c29,
    0 0 0 1px #d7b76866;
}
.rank-chip.playable:hover {
  transform: translateY(-4px);
  outline: 2px solid var(--gold);
}
.trick-stage {
  height: 245px;
  position: relative;
  max-width: 750px;
  margin: 10px auto 0;
}
.opponent {
  position: absolute;
  top: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  letter-spacing: 1.5px;
}
.opponent.west {
  left: 10px;
}
.opponent.east {
  right: 10px;
}
.opponent small {
  font-size: 9px;
  letter-spacing: 0;
  color: #b4c2c9;
}
.card-back {
  width: 32px;
  height: 43px;
  border-radius: 3px;
  border: 2px solid #bda876;
  background: repeating-linear-gradient(
    45deg,
    #264b68 0 3px,
    #ad956155 3px 4px
  );
  box-shadow:
    3px 2px 0 #1d364a,
    4px 3px 0 #baa67355;
}
.compass {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid #d0b3721c;
  width: 175px;
  height: 175px;
  border-radius: 50%;
  text-align: center;
  padding: 10px;
  color: #cfb57430;
  font: 10px Georgia;
}
.compass div {
  font: 91px/125px Georgia;
}
.trick {
  position: absolute;
  inset: 0;
}
.played-card {
  position: absolute;
  width: 61px;
  height: 87px;
  filter: drop-shadow(0 4px 5px #0004);
}
.played-card.N {
  left: calc(50% - 30px);
  top: 1px;
}
.played-card.S {
  left: calc(50% - 30px);
  bottom: 23px;
}
.played-card.W {
  left: calc(50% - 108px);
  top: 76px;
  transform: rotate(-7deg);
}
.played-card.E {
  right: calc(50% - 108px);
  top: 76px;
  transform: rotate(7deg);
}
.played-card.winner {
  filter: drop-shadow(0 0 5px #dfbd66);
}
.trick-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.5px;
}
.table-action {
  min-height: 63px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  border-top: 1px solid #d8bb7533;
  border-bottom: 1px solid #d8bb7533;
  margin: 8px 0 16px;
  padding: 11px 0;
  position: relative;
}
.table-action p {
  font: 17px Georgia;
  margin: 0;
  color: #ede6d7;
  max-width: 420px;
}
.primary {
  background: #ddbd76;
  color: #1b3549;
  border: 1px solid #f1d598;
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
}
.primary span {
  margin-left: 20px;
}
.primary:disabled {
  opacity: 0.65;
}
.primary[hidden] {
  display: none;
}
.south-hand {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 7px;
  max-width: 780px;
  margin: 15px auto 0;
  min-height: 85px;
  align-items: start;
}
.playing-card {
  border: 0;
  border-radius: 5px;
  background: transparent;
  padding: 0;
  aspect-ratio: 60/90;
  min-width: 0;
  filter: drop-shadow(0 3px 2px #0004);
  transition:
    transform 0.15s,
    opacity 0.15s;
}
.playing-card svg {
  width: 100%;
  display: block;
}
.playing-card:disabled {
  opacity: 0.58;
}
.playing-card.playable {
  outline: 1px solid #dfbe7366;
  outline-offset: 2px;
}
.playing-card.playable:hover {
  transform: translateY(-8px);
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.hand-tip {
  color: #b6c4cb;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.2px;
  margin: 13px 0 0;
  min-height: 12px;
}
.trick-ledger {
  display: flex;
  align-items: center;
  gap: 19px;
  margin: 22px 0;
}
.trick-ledger > .eyebrow {
  color: var(--muted);
}
#ledger {
  display: flex;
  gap: 6px;
  flex: 1;
}
.trick-dot {
  display: grid;
  place-items: center;
  font-size: 9px;
  width: 24px;
  height: 24px;
  border: 1px solid #7c8e984d;
  border-radius: 50%;
  color: #82959f;
}
.trick-dot.ours {
  background: #d4b778;
  color: #142a3d;
  border-color: #d4b778;
}
.trick-dot.theirs {
  background: #647f90;
  color: var(--ivory);
  border-color: #647f90;
}
.ledger-key {
  font-size: 9px;
  color: #afbec6;
  white-space: nowrap;
}
.ledger-key i {
  display: inline-block;
  border-radius: 50%;
  width: 5px;
  height: 5px;
  background: var(--gold);
  margin: 0 4px 2px 10px;
}
.ledger-key i.theirs {
  background: #647f90;
}
.result {
  background: var(--ivory);
  color: #173147;
  padding: 25px 28px;
  border-radius: 5px;
  position: relative;
  margin: 25px 0;
}
.result > .eyebrow,
.result .eyebrow {
  color: #8b6832;
}
.result h2 {
  font: 31px Georgia;
  margin: 8px 0 12px;
}
.result p {
  font-size: 13px;
  line-height: 1.65;
  max-width: 660px;
  margin: 0 50px 0 0;
}
.result-seal {
  position: absolute;
  right: 26px;
  top: 20px;
  font: 56px Georgia;
  color: #b99a58;
}
.all-hands {
  margin: 18px 0 0 !important;
  border-color: #17314733 !important;
}
.all-hands summary {
  font-size: 14px !important;
  padding: 12px 0 !important;
}
#all-hands {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  font-size: 12px;
  padding-bottom: 12px;
}
#all-hands h3 {
  margin: 3px 0 7px;
  font-size: 11px;
  letter-spacing: 1px;
}
#all-hands p {
  font-family: Georgia;
  line-height: 1.8;
  word-spacing: 3px;
  font-size: 14px;
  margin: 0;
}
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 10px 0 29px;
}
.actions button {
  color: var(--ivory);
  border: 1px solid #8fa2ad66;
  background: #102a3d;
  padding: 12px 18px;
  border-radius: 4px;
  font-size: 11px;
}
.actions button:last-of-type {
  border-color: #d3b67666;
  color: var(--gold);
}
.actions button span {
  margin-left: 25px;
}
.actions > span {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
}
details#rules {
  border-top: 1px solid #748b9866;
  border-bottom: 1px solid #748b9866;
  margin-top: 25px;
}
summary {
  cursor: pointer;
  padding: 20px 0;
  font: 20px Georgia;
}
summary span {
  font: 11px Arial;
  color: var(--muted);
  margin-left: 14px;
}
.rules-copy {
  max-width: 800px;
  color: #bdcbd1;
  font-size: 13px;
  line-height: 1.7;
  padding-bottom: 10px;
}
.rules-copy strong {
  color: var(--ivory);
}
.rules-copy p {
  margin: 0 0 14px;
}
footer {
  font-size: 8px;
  letter-spacing: 1.3px;
  color: #8fa3af;
  display: flex;
  justify-content: space-between;
  margin-top: 23px;
}
@media (max-width: 760px) {
  main {
    padding: 24px;
  }
  .contract-bar {
    gap: 20px;
    padding: 17px;
  }
  .contract {
    padding-right: 20px;
    min-width: 105px;
  }
  .deal-info h2 {
    font-size: 20px;
  }
  .table {
    padding: 17px 20px;
  }
  .dummy-suits {
    gap: 7px;
  }
  .rank-chip {
    min-width: 29px;
    padding: 0 4px;
  }
  .trick-ledger {
    gap: 10px;
  }
  .ledger-key {
    display: none;
  }
  .south-hand {
    gap: 5px;
  }
  .table-action {
    gap: 13px;
  }
  .table-action p {
    font-size: 15px;
  }
  .actions > span {
    font-size: 9px;
  }
}
@media (max-width: 520px) {
  main {
    padding: 19px 12px;
  }
  header {
    margin-bottom: 21px;
    align-items: flex-start;
  }
  h1 {
    font-size: 49px;
  }
  .eyebrow {
    font-size: 8px;
    letter-spacing: 1.5px;
  }
  .intro {
    font: 13px/1.5 Georgia;
    max-width: 225px;
    margin-top: 10px;
  }
  .rules-link {
    font-size: 10px;
    margin-top: 16px;
  }
  .rules-link span {
    margin-left: 5px;
  }
  .contract-bar {
    gap: 14px;
    padding: 14px 13px;
  }
  .contract {
    min-width: 72px;
    padding-right: 14px;
  }
  .contract strong {
    font-size: 33px;
  }
  .contract .eyebrow {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .deal-info h2 {
    font-size: 17px;
    max-width: 140px;
    margin-top: 7px;
  }
  .deal-info .eyebrow {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .score > .eyebrow {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .score strong {
    font-size: 26px;
    margin-top: 7px;
  }
  .score small {
    font-size: 11px;
    margin-left: 3px;
  }
  .table {
    padding: 14px 13px 15px;
    border-radius: 0 0 15px 15px;
  }
  .table:before {
    inset: 5px;
    border-radius: 0 0 10px 10px;
  }
  .dummy-head,
  .south-head {
    font-size: 9px;
    letter-spacing: 1px;
    gap: 7px;
  }
  .dummy-head small,
  .south-head small {
    font-size: 9px;
    margin-left: 5px;
  }
  .seat-dot {
    width: 21px;
    height: 21px;
    font-size: 11px;
  }
  .turn-badge {
    padding: 5px 6px;
    font-size: 7px;
    letter-spacing: 0.6px;
  }
  .dummy {
    min-height: 112px;
    padding-top: 12px;
  }
  .dummy-suits {
    gap: 7px;
  }
  .suit-row {
    padding-right: 5px;
  }
  .suit-name {
    font-size: 8px;
    gap: 3px;
    margin-bottom: 6px;
  }
  .suit-name b {
    font-size: 15px;
  }
  .suit-name .trump-tag {
    font-size: 0;
  }
  .suit-name .trump-tag:after {
    content: "★";
    font-size: 10px;
  }
  .rank-cards {
    gap: 4px;
  }
  .rank-chip {
    min-width: 28px;
    height: 32px;
    padding: 0 3px;
    font-size: 18px;
  }
  .dummy-hidden {
    padding: 35px 8px;
    font-size: 12px;
  }
  .trick-stage {
    height: 207px;
    margin-top: 2px;
  }
  .opponent {
    top: 55px;
    gap: 5px;
    font-size: 7px;
  }
  .opponent.west {
    left: 0;
  }
  .opponent.east {
    right: 0;
  }
  .opponent small {
    font-size: 8px;
  }
  .card-back {
    width: 24px;
    height: 34px;
  }
  .compass {
    width: 140px;
    height: 140px;
    padding: 7px;
    font-size: 9px;
  }
  .compass div {
    font-size: 70px;
    line-height: 104px;
  }
  .played-card {
    width: 48px;
    height: 72px;
  }
  .played-card.N {
    left: calc(50% - 24px);
    top: 0;
  }
  .played-card.S {
    left: calc(50% - 24px);
    bottom: 22px;
  }
  .played-card.W {
    left: calc(50% - 83px);
    top: 61px;
  }
  .played-card.E {
    right: calc(50% - 83px);
    top: 61px;
  }
  .trick-caption {
    font-size: 8px;
  }
  .table-action {
    min-height: 59px;
    margin: 6px 0 13px;
    flex-wrap: wrap;
    padding: 10px 2px;
    gap: 9px;
  }
  .table-action p {
    font-size: 14px;
    text-align: center;
  }
  .primary {
    padding: 10px 13px;
    font-size: 11px;
  }
  .south-hand {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 7px;
    min-height: 136px;
    margin-top: 12px;
  }
  .playing-card {
    max-width: 55px;
  }
  .playing-card svg {
    min-height: 54px;
  }
  .hand-tip {
    font-size: 9px;
    line-height: 1.5;
    margin-top: 9px;
  }
  .trick-ledger {
    flex-wrap: wrap;
    margin: 19px 0 15px;
    gap: 9px;
  }
  .trick-ledger > .eyebrow {
    width: 100%;
    font-size: 7px;
  }
  .trick-dot {
    width: 20px;
    height: 20px;
    font-size: 8px;
  }
  #ledger {
    gap: 5px;
    justify-content: space-between;
  }
  .actions {
    flex-wrap: wrap;
    margin-bottom: 20px;
  }
  .actions button {
    padding: 11px 12px;
    font-size: 10px;
    flex: 1;
  }
  .actions > span {
    margin-left: 0;
    font-size: 9px;
    width: 100%;
    margin-top: 3px;
    text-align: center;
  }
  .result {
    padding: 21px 16px;
    margin: 20px 0;
  }
  .result h2 {
    font-size: 26px;
    padding-right: 20px;
  }
  .result p {
    margin: 0;
    font-size: 12px;
  }
  .result-seal {
    font-size: 35px;
    top: 17px;
    right: 17px;
  }
  .all-hands {
    margin-top: 15px !important;
  }
  #all-hands {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  #all-hands p {
    font-size: 13px;
  }
  .rules-copy {
    font-size: 12px;
  }
  summary {
    font-size: 18px;
    padding: 17px 0;
  }
  summary span {
    display: block;
    margin: 6px 0 0 15px;
    font-size: 10px;
  }
  footer {
    font-size: 7px;
    letter-spacing: 0.7px;
    gap: 20px;
    line-height: 1.6;
  }
  footer span {
    text-align: right;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
