:root {
  color-scheme: dark;
  --bg: #091f1b;
  --panel: #12372e;
  --line: #bda27142;
  --gold: #dec189;
  --ink: #f4efdd;
  --muted: #b7c7b8;
  --red: #9d3533;
  --serif: Georgia, "Times New Roman", serif;
  font:
    16px/1.45 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% -15%, #214736 0, transparent 55%), var(--bg);
}
main {
  max-width: 840px;
  margin: auto;
  padding: calc(env(safe-area-inset-top) + 24px) max(18px, env(safe-area-inset-right))
    calc(26px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3,
.game-tile strong {
  font-family: var(--serif);
  font-weight: 400;
}
button,
select,
input {
  font: inherit;
}
button,
select,
.file-label {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button {
  color: inherit;
}
button:disabled {
  cursor: default;
  opacity: 0.4;
}
button:focus-visible,
select:focus-visible,
input:focus-visible,
.file-label:focus-within {
  outline: 3px solid #ffe1a2;
  outline-offset: 3px;
}
button:active:enabled {
  filter: brightness(1.12);
}
p,
small {
  color: var(--muted);
}
.brand,
.table-head,
.sheet-head,
.section-head,
.zone-title,
.table-meta,
.runbar,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.brand {
  justify-content: flex-start;
  margin-bottom: 24px;
}
.brand img {
  border-radius: 11px;
}
.brand .icon {
  margin-left: auto;
}
.eyebrow,
.metric span,
.house-line,
.table-meta,
.offline,
footer > span {
  font-size: 0.66rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.brand .eyebrow {
  font-size: 0.6rem;
}
.brand h1 {
  font-size: clamp(1.65rem, 5vw, 2.65rem);
  line-height: 1.15;
}
button,
.quiet,
.file-label,
select {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #12352d;
}
.quiet,
.primary,
.file-label,
select {
  min-height: 43px;
  padding: 9px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 580;
}
.primary {
  background: var(--gold);
  color: #18271d;
  border: 1px solid #f4d79a;
}
.icon {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  font-size: 1.12rem;
  background: #193a30;
}
.feature {
  isolation: isolate;
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 4.5vw, 38px);
  border-radius: 21px;
  border: 1px solid #bdaa706e;
  background:
    radial-gradient(ellipse at 80% 36%, #3b6043 0, transparent 46%),
    linear-gradient(110deg, #183a2a, #214a35 70%, #193629);
  box-shadow: 0 12px 28px #04181155;
}
.feature:before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid #d5bc7b26;
  border-radius: 15px;
  z-index: -1;
}
.feature-copy {
  position: relative;
  z-index: 1;
  max-width: 57%;
}
.feature h2 {
  font-size: clamp(2.5rem, 8.8vw, 4.6rem);
  line-height: 0.93;
  letter-spacing: -0.045em;
  margin: 12px 0;
}
.feature p {
  font-size: 0.86rem;
  color: #d4dcc9;
}
.feature-actions {
  display: flex;
  gap: 8px;
  margin-top: 19px;
}
.fan {
  position: absolute;
  right: 10%;
  top: 48%;
  width: clamp(58px, 13vw, 98px);
  transform: translateY(-50%);
  aspect-ratio: 0.705;
}
.fan .card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  box-shadow: 1px 6px 12px #00130970;
}
.fan .card:nth-child(1) {
  transform: translate(-43%, 6%) rotate(-23deg);
}
.fan .card:nth-child(2) {
  transform: translate(-5%, -7%) rotate(-5deg);
}
.fan .card:nth-child(3) {
  transform: translate(35%, 4%) rotate(16deg);
}
.section-head {
  margin: 27px 0 12px;
}
.section-head h2 {
  font-size: 1.55rem;
}
.section-head .quiet,
footer .quiet {
  min-height: 34px;
  padding: 4px 9px;
  font-size: 0.79rem;
  background: transparent;
}
.games {
  display: grid;
  gap: 9px;
}
.game-tile {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  padding: 14px 17px;
  border-radius: 15px;
  background: linear-gradient(100deg, #183d30, #102e27);
  min-height: 78px;
}
.game-tile i {
  margin-left: auto;
  color: var(--gold);
  font-style: normal;
}
.game-tile strong,
.game-tile small {
  display: block;
}
.game-tile strong {
  font-size: 1.35rem;
}
.game-tile small {
  font-size: 0.81rem;
}
.tile-mark {
  height: 46px;
  width: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  outline: 1px solid #c4ad7822;
  outline-offset: -4px;
  border-radius: 8px;
  color: var(--gold);
  background: #123026;
  font: 1.6rem var(--serif);
}
.mark-hearts {
  color: #f3b8a5;
  background: #492e2a;
}
.mark-euchre {
  background: #333927;
}
.upcoming {
  margin: 24px 0;
}
.upcoming h2 {
  font-size: 1.12rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.upcoming div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.upcoming span {
  padding: 5px 9px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: #afbcac;
  font-size: 0.78rem;
}
footer {
  border-top: 1px solid var(--line);
  padding-top: 13px;
}
footer > span,
.offline {
  color: #bfd2ad;
  letter-spacing: 0.06em;
}
.table-head {
  margin-bottom: 15px;
}
.table-head h1 {
  font-size: clamp(1.45rem, 5vw, 2.25rem);
  text-align: center;
}
.table-head .icon {
  font-size: 0.85rem;
}
.metrics,
.record-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 7px;
}
.metric {
  padding: 8px 9px;
  background: #ffffff06;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
}
.metric span {
  display: block;
  font-size: 0.59rem;
  letter-spacing: 0.09em;
  color: var(--muted);
}
.metric strong {
  display: block;
  font: 1.35rem/1.25 var(--serif);
  font-variant-numeric: tabular-nums;
}
.runbar {
  margin: 14px 0;
  color: var(--muted);
  font-size: 0.72rem;
}
.runs {
  display: flex;
  gap: 3px;
}
.runs span {
  display: grid;
  place-items: center;
  width: 17px;
  height: 23px;
  border: 1px dashed #cbb17a55;
  border-radius: 3px;
  color: #c7b88c85;
  font: 11px var(--serif);
}
.runs .filled {
  border-style: solid;
  color: var(--gold);
}
.card,
.empty-card {
  position: relative;
  display: inline-flex;
  vertical-align: top;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: clamp(43px, 11vw, 64px);
  aspect-ratio: 0.705;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  border-radius: 6%;
  font-family: var(--serif);
  border: 1px solid #c6c3b0;
  box-shadow: 0 2px 4px #001c1644;
  text-align: left;
  padding: 0;
}
.face {
  color: #18281f;
  background: linear-gradient(130deg, #fffcf0, #ede7d5);
}
.red {
  color: var(--red);
}
.card b,
.card small {
  position: absolute;
  left: 6%;
  top: 2%;
  font-size: clamp(11px, 2.8vw, 17px);
  font-weight: 650;
  line-height: 1;
  color: inherit;
}
.card i,
.empty-card {
  font-style: normal;
  font-size: clamp(20px, 4.4vw, 32px);
}
.card small {
  top: auto;
  bottom: 3%;
  left: auto;
  right: 5%;
  transform: rotate(180deg);
  font-size: 0.68rem;
}
.fan .card i {
  font-size: clamp(25px, 7vw, 50px);
}
.back {
  color: #bdac79;
  border-color: #9d905d;
  background-color: #24483b;
  background-image:
    repeating-linear-gradient(45deg, transparent 0 5px, #d3cb8f22 5px 6px),
    repeating-linear-gradient(-45deg, transparent 0 5px, #d3cb8f22 5px 6px);
}
.back:after {
  content: "";
  position: absolute;
  inset: 4%;
  border: 1px solid #c1ad7280;
  border-radius: 4%;
}
.back i {
  font-size: 14px;
}
.card.selected,
.card.hinted {
  box-shadow: 0 0 0 3px #eac274;
  z-index: 1;
}
.card.hinted {
  outline: 2px dashed #97591d;
  outline-offset: -3px;
}
.empty-card {
  border: 1px dashed var(--line);
  background: #081e1850;
  color: #bca37266;
}
.board {
  --step: clamp(16px, 3.8vh, 24px);
  --fold: 7px;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 3px;
  margin: 0 -11px;
  align-items: start;
  min-height: clamp(205px, 40vh, 380px);
  padding-bottom: 7px;
}
.stack {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
}
.stack .card,
.stack .slot {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  align-self: start;
}
.stack .slot {
  aspect-ratio: 0.705;
  border: 1px dashed #c9b17c60;
  color: #c9b17c90;
  padding: 0;
  font-size: 0.75rem;
}
.stack .card {
  margin-top: calc(var(--layer) * var(--step) - var(--down) * (var(--step) - var(--fold)));
  touch-action: none;
  z-index: auto;
}
.stack .face b {
  font-size: clamp(9px, 2.6vw, 16px);
  left: 4%;
}
.stack .face small {
  display: none;
}
.stack .face i {
  font-size: clamp(15px, 4.5vw, 30px);
}
.stack.target,
.stack.drop-target {
  outline: 2px dashed var(--gold);
  outline-offset: 1px;
  border-radius: 4px;
}
.stack .selected {
  border: 2px solid #d1974e;
  background: #ffeab2;
}
.controls,
.bet-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 14px 0 0;
}
.message,
.bids,
.result p {
  font-size: 0.83rem;
  text-align: center;
  margin: 10px auto 0;
}
.message:empty,
.bids:empty {
  display: none;
}
.felt-table {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: radial-gradient(ellipse at center, #28503a, #15392e 75%);
  box-shadow:
    inset 0 0 0 5px #ffffff03,
    inset 0 0 0 6px #b9ac7622;
}
.blackjack {
  margin-top: 13px;
  padding: 17px;
}
.zone-title h2,
.bj-hand > h2 {
  font-size: 1.12rem;
}
.zone-title span,
.bj-hand p,
.bids {
  font-size: 0.78rem;
  color: var(--muted);
}
.card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
  min-height: 62px;
  margin: 8px auto;
}
.house-line {
  font-size: 0.57rem;
  letter-spacing: 0.07em;
  text-align: center;
  padding: 10px 0;
  border-block: 1px solid var(--line);
  color: #c8b783;
}
.house-line span {
  margin: 0 4px;
}
.hands {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  position: relative;
}
.bj-hand {
  flex: 0 0 100%;
  padding: 11px 2px 0;
  scroll-snap-align: start;
}
.bj-hand.active .zone-title {
  color: #ffdb95;
}
.bj-hand p {
  text-align: center;
  text-transform: capitalize;
}
.bet-controls label,
.filters label {
  color: var(--muted);
  font-size: 0.85rem;
}
.table-meta {
  margin: 12px 1px 8px;
  letter-spacing: 0.055em;
}
.broken {
  color: #ffb7ad;
}
.trick-table {
  display: grid;
  grid-template-columns: minmax(42px, 1fr) minmax(0, 4fr) minmax(42px, 1fr);
  grid-template-rows: auto minmax(96px, 1fr) auto;
  padding: 12px 9px;
  align-items: center;
  min-height: 180px;
}
.seat {
  text-align: center;
  font-size: 0.78rem;
}
.seat small,
.upcard small,
.played small {
  font-size: 0.64rem;
  display: block;
}
.seat-2 {
  grid-column: 1/-1;
  grid-row: 1;
}
.seat-1 {
  grid-row: 2;
  grid-column: 1;
}
.seat-3 {
  grid-row: 2;
  grid-column: 3;
}
.turn > span {
  color: #ffdc9c;
  border-bottom: 1px solid #b9ab77;
}
.trick-center {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-align: center;
}
.trick-center .card {
  width: clamp(31px, 8vw, 52px);
}
.trick-center .card small {
  display: none;
}
.center-note,
.trick-detail {
  font-size: 0.76rem;
  color: var(--muted);
  text-align: center;
}
.trick-detail {
  grid-row: 3;
  grid-column: 1/-1;
}
.hand-title {
  margin: 15px 0 9px;
  align-items: baseline;
}
.hand-title span {
  text-align: right;
}
.human-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
}
.human-hand .card {
  width: clamp(38px, 9.6vw, 58px);
}
.human-hand .card:disabled {
  opacity: 0.57;
}
.human-hand .card.selected {
  transform: translateY(-4px);
}
.human-hand .card small {
  font-size: 0.55rem;
}
.alone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 0.84rem;
  margin-top: 14px;
}
.result {
  background: #d3b98011;
  border-radius: 10px;
  text-align: center;
  padding: 10px;
}
.result p {
  margin: 4px auto;
}
.result h3 {
  font-size: 1.1rem;
}
dialog {
  background: #102d25;
  color: var(--ink);
  border: 1px solid #8a805b;
  border-radius: 20px;
  max-width: min(440px, calc(100vw - 24px));
  width: 100%;
  max-height: 85dvh;
  padding: 21px;
  box-shadow: 0 18px 80px #0007;
}
dialog::backdrop {
  background: #02100dc9;
}
.sheet-head {
  margin-bottom: 16px;
}
.sheet-head h2 {
  font-size: 1.6rem;
}
.sheet-head .icon {
  font-size: 1.4rem;
}
.setting,
.filters label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
}
.setting {
  min-height: 48px;
  border-bottom: 1px solid var(--line);
}
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--gold);
}
dialog section {
  padding: 16px 0 3px;
}
dialog p {
  font-size: 0.9rem;
  line-height: 1.6;
}
dialog p + p {
  margin-top: 8px;
}
dialog h3 {
  margin-bottom: 5px;
  font-size: 1.22rem;
}
dialog .controls {
  justify-content: flex-start;
}
.offline {
  margin-top: 14px;
}
.file-label {
  position: relative;
}
.file-label input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  cursor: pointer;
}
.choices,
.menu {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.choices button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  padding: 15px;
}
.choices .chosen {
  border-color: var(--gold);
}
.choices small {
  font-size: 0.77rem;
}
.record-grid {
  grid-auto-flow: row;
  grid-template-columns: repeat(2, 1fr);
  margin-top: 12px;
}
.record-grid .metric {
  text-align: left;
  padding: 10px 13px;
}
.record-grid .metric span {
  margin-bottom: 5px;
}
.loading {
  text-align: center;
  margin: 15vh auto;
}
.loading img {
  border-radius: 14px;
}
.loading p {
  margin: 12px;
}
#notice:not(:empty) {
  position: fixed;
  z-index: 10;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--gold);
  background: #162c22;
  color: var(--ink);
  width: max-content;
  max-width: 90vw;
  font-size: 0.85rem;
}
@media (min-width: 650px) {
  main {
    padding-inline: 32px;
  }
  .games {
    grid-template-columns: repeat(3, 1fr);
  }
  .game-tile {
    display: grid;
    grid-template-columns: 1fr auto;
    row-gap: 10px;
  }
  .tile-mark {
    grid-column: 1;
  }
  .game-tile > span:nth-child(2) {
    grid-row: 2;
    grid-column: 1/-1;
  }
  .game-tile i {
    grid-row: 1;
    grid-column: 2;
  }
  .board {
    gap: 5px;
    margin: 0;
  }
  .trick-table {
    min-height: 235px;
  }
  .human-hand .card {
    width: clamp(40px, 6.5vw, 60px);
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  main {
    padding-top: 8px;
  }
  .table-head {
    margin-bottom: 5px;
  }
  .metric {
    padding: 3px;
  }
  .runbar,
  .table-meta {
    margin: 5px 0;
  }
  .board {
    --step: 13px;
    --fold: 4px;
    min-height: 130px;
  }
  .card,
  .empty-card {
    width: 40px;
  }
  .trick-table {
    min-height: 130px;
    grid-template-rows: auto minmax(58px, 1fr) auto;
  }
  .trick-center .card {
    width: 33px;
  }
  .human-hand .card {
    width: 35px;
  }
  .blackjack .card-row {
    min-height: 40px;
  }
  .hand-title {
    margin: 7px 0;
  }
  .hands .bj-hand {
    padding-top: 4px;
  }
  .controls {
    margin-top: 8px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .played.enter,
  .dealer .enter {
    animation: arrive 0.24s ease-out;
  }
  .played.from-1 {
    --dx: -40px;
  }
  .played.from-3 {
    --dx: 40px;
  }
  .played.from-2 {
    --dy: -28px;
  }
  .played.from-0 {
    --dy: 28px;
  }
  .dealer .flip {
    animation: flip 0.32s ease-out;
  }
  .broken {
    animation: pulse 0.45s ease-out;
  }
  @keyframes arrive {
    from {
      opacity: 0;
      transform: translate(var(--dx, 0), var(--dy, 12px));
    }
  }
  @keyframes flip {
    from {
      transform: rotateY(85deg);
    }
  }
  @keyframes pulse {
    from {
      opacity: 0.35;
    }
  }
}
