* {
  box-sizing: border-box;
}
html {
  color-scheme: light;
}
body {
  margin: 0;
  background: #f8f7f1;
  color: #1b3635;
  font:
    16px/1.45 "Segoe UI",
    Arial,
    sans-serif;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #d59126;
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.48;
  cursor: default;
}
header {
  background: #fffef8;
  border-bottom: 1px solid #dcded3;
}
.navwrap,
main {
  width: min(1360px, 93%);
  margin: auto;
}
.navwrap {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 6%;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font:
    bold 23px Georgia,
    serif;
  letter-spacing: -0.8px;
  text-decoration: none;
  color: #193c38;
  white-space: nowrap;
}
.brand img {
  width: 39px;
}
nav,
.utilities,
.heading,
.tablecontrols,
.tablecontrols > div,
.paneltitle,
.dealrow,
.mode,
.peakhead,
footer,
footer span,
.live {
  display: flex;
  align-items: center;
}
nav {
  height: 100%;
  gap: 25px;
}
nav button,
.iconbtn,
footer button {
  background: none;
  border: 0;
}
nav button,
.primary,
.tablecontrols button,
.outline,
.guide button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
nav button {
  height: 100%;
  padding: 0 2px;
  color: #566660;
  font-weight: 600;
  font-size: 14px;
}
nav .selected {
  border-bottom: 3px solid #27564c;
  padding-top: 3px;
  color: #234b43;
}
.utilities {
  margin-left: auto;
  gap: 8px;
}
.iconbtn {
  width: 44px;
  height: 44px;
  border: 1px solid #d3d7ca;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
svg.ico {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 1.65;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.heading {
  justify-content: space-between;
  margin: 24px 0 20px;
}
.eyebrow,
.pilelabel {
  font-weight: 700;
  letter-spacing: 2.3px;
  font-size: 11px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #647368;
}
.dash {
  width: 24px;
  height: 2px;
  background: #b88945;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3,
.metrics strong {
  font-family: Georgia, "Times New Roman", serif;
}
h1 {
  font-size: clamp(34px, 4.1vw, 64px);
  font-weight: 500;
  letter-spacing: -2.9px;
  line-height: 1.15;
  margin-top: 7px;
}
.primary,
.outline,
.guide button {
  padding: 11px 17px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 650;
  min-height: 44px;
}
.primary {
  background: #1c4c44;
  border: 1px solid #1c4c44;
  color: white;
}
.primary:hover {
  background: #286155;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(235px, 24%);
  gap: 23px;
  align-items: start;
}
.game {
  border-radius: 16px;
  overflow: hidden;
  background: #103c3e;
  box-shadow: 0 5px 15px #2138291b;
  border: 1px solid #123e3e;
}
.felt {
  position: relative;
  isolation: isolate;
  padding: 18px 0 30px;
  background: radial-gradient(ellipse at 50% 48%, #245556, #103c3e 83%);
}
.land {
  z-index: -1;
  background: url(assets/alpine.svg) center top/100% auto no-repeat;
  position: absolute;
  inset: 0;
  mask-image: linear-gradient(#000 0%, #000 30%, transparent 80%);
}
.dealrow {
  margin: 0 20px;
  justify-content: space-between;
  color: #fff7de;
  font-size: 12px;
  letter-spacing: 0.6px;
}
.dealrow > span {
  background: #143e40d6;
  border: 1px solid #8aa29a55;
  border-radius: 20px;
  padding: 5px 11px;
}
.live {
  gap: 7px;
}
.live b {
  background: #b6d3a1;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
#tableau {
  position: relative;
  width: 91%;
  max-width: 948px;
  margin: 26px auto 17px;
  container-type: inline-size;
  aspect-ratio: 10/3.48;
}
.card {
  border-radius: 6px;
  overflow: hidden;
  padding: 0;
  aspect-ratio: 5/7;
  box-shadow: 0 3px 6px #07191855;
}
.tablecard {
  position: absolute;
  width: 9.64%;
  height: auto;
  left: calc(var(--x) * 10% + 0.18%);
  top: calc(var(--row) * 20%);
}
.back {
  background: #a34c3c url(assets/back.svg) center/100% 100%;
  border: 2px solid #f4d5ad;
}
.face {
  background: #fffcf2;
  color: #183631;
  border: 1px solid #e4dbc9;
  container-type: inline-size;
}
.red {
  color: #b33f35;
}
.index,
.br {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  font:
    600 29cqw/0.94 Georgia,
    serif;
  left: 7%;
  top: 5%;
}
.index small,
.br small {
  font: normal 16cqw/1 Georgia;
}
.br {
  left: auto;
  top: auto;
  bottom: 5%;
  right: 7%;
  transform: rotate(180deg);
}
.centerpip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 53cqw/1 Georgia;
}
.court .centerpip {
  font-size: 43cqw;
}
.playable {
  transform: translateY(-5px);
  outline: 3px solid #ecc575;
  box-shadow: 0 5px 12px #082523;
}
.tablecard.face:hover {
  filter: brightness(1.045);
}
.piles {
  display: flex;
  gap: 22px;
  justify-content: center;
  text-align: center;
  margin-top: 23px;
}
.piles > div {
  display: grid;
  justify-items: center;
  gap: 12px;
}
.pile {
  width: clamp(67px, 6.8vw, 106px);
  position: relative;
}
.pile.back {
  box-shadow:
    2px 2px #d5c4a4,
    3px 4px #693f34,
    4px 6px #d5c4a4;
}
.pile.empty {
  background: transparent;
  border: 1px dashed #a6bcaf;
  box-shadow: none;
}
.pilelabel {
  color: #d0dcd1;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 1.4px;
}
.pilelabel b {
  border: 1px solid #718b7f;
  border-radius: 8px;
  padding: 0 5px;
  font-size: 10px;
}
.tablecontrols {
  background: #0e3334;
  color: #ecf1e4;
  border-top: 1px solid #66887955;
  padding: 11px 19px;
  justify-content: space-between;
}
.tablecontrols > div {
  gap: 8px;
}
.tablecontrols button {
  min-height: 42px;
  padding: 8px 13px;
  background: #ffffff08;
  border: 1px solid #6a8b805e;
  border-radius: 7px;
  color: inherit;
  font-size: 14px;
}
.tablecontrols button:hover,
.iconbtn:hover {
  background: #98ad9720;
}
aside {
  display: grid;
  gap: 18px;
}
.panel {
  background: #fffef9;
  border: 1px solid #dcdfd4;
  border-radius: 14px;
  padding: 22px;
}
.paneltitle {
  gap: 10px;
  color: #2d5147;
}
.paneltitle .ico {
  color: #977743;
}
.panel h2 {
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.7px;
}
.metrics {
  display: flex;
  padding: 21px 0;
  border-bottom: 1px solid #dce0d5;
}
.metrics > div {
  width: 50%;
}
.metrics > div + div {
  border-left: 1px solid #dddfd4;
  padding-left: 20px;
}
.metrics label,
.peakhead label,
.mode {
  font-size: 13px;
  color: #596960;
}
.metrics strong {
  display: block;
  font-weight: 500;
  font-size: 38px;
  line-height: 1.18;
}
.metrics small {
  font: 16px Georgia;
  color: #8b9587;
}
.peakhead,
.mode {
  justify-content: space-between;
}
.peakhead {
  margin: 17px 0 8px;
}
.peakhead b {
  font-size: 13px;
}
#peaks {
  display: flex;
  gap: 7px;
}
.peak {
  flex: 1;
  border-radius: 6px;
  background: #eef1e7;
  border: 1px solid #dde3d6;
  display: grid;
  place-items: center;
  height: 38px;
  color: #869784;
}
.peak.done {
  background: #245746;
  color: white;
}
.peak .ico {
  width: 36px;
  height: 26px;
}
.mode {
  border-top: 1px solid #dce0d5;
  padding-top: 14px;
  margin-top: 18px;
}
.mode b {
  text-transform: capitalize;
  font-weight: 600;
  color: #3f5347;
}
.guide {
  background: #f1f1e6;
}
.guide p,
dialog p {
  font-size: 14px;
  line-height: 1.6;
  color: #4e6057;
  margin: 12px 0;
}
.guide button,
.outline {
  background: #fffef7;
  border: 1px solid #c8cdbf;
  color: #294c3d;
}
.guide button {
  width: 100%;
  margin-top: 8px;
}
.lesson {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px 0 6px;
}
.mini {
  background: #fffdf5;
  border: 1px solid #c9c8b8;
  border-radius: 5px;
  width: 38px;
  height: 51px;
  font: 600 22px/1 Georgia;
  display: grid;
  place-content: center;
  text-align: center;
  box-shadow: 0 2px 3px #263c2c11;
}
.mini small {
  font-size: 16px;
}
.mini.center {
  transform: translateY(-4px);
  border-color: #b79a5e;
  background: #fdf7dc;
}
.guideStep {
  font-size: 12px;
  color: #69776c;
}
.guide .skip {
  border: 0;
  background: transparent;
  font-size: 12px;
  margin: 0;
  padding: 4px;
  min-height: 32px;
}
.tutrow {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.tutrow button {
  width: auto;
}
.tutrow .target,
.hinted {
  outline: 3px solid #f0b546;
  outline-offset: 2px;
}
footer {
  justify-content: space-between;
  color: #748076;
  font-size: 12px;
  border-top: 1px solid #d8ddcf;
  margin: 23px 0;
  padding: 14px 0;
}
footer span {
  gap: 7px;
}
footer button {
  color: inherit;
  font-size: 12px;
}
#message {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 20px;
  background: #fcf4dc;
  color: #243d35;
  max-width: 98%;
  width: max-content;
  font-size: 13px;
  pointer-events: none;
}
#message:not(:empty) {
  padding: 5px 12px;
}
dialog {
  width: min(420px, 92vw);
  max-height: 88dvh;
  color: #233c33;
  border: 1px solid #d9dace;
  border-radius: 16px;
  background: #fffdf6;
  padding: 26px;
  box-shadow: 0 20px 85px #071e2450;
}
dialog::backdrop {
  background: #102d2bd0;
}
dialog h2 {
  font-weight: 500;
  font-size: 31px;
  letter-spacing: -1px;
  padding-right: 30px;
}
dialog .close {
  position: absolute;
  right: 13px;
  top: 13px;
  border: 0;
  background: none;
  font-size: 24px;
  width: 40px;
  height: 40px;
}
dialog form,
dialog .buttons {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
dialog label,
.statline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
dialog input:not([type="checkbox"]),
dialog select {
  border: 1px solid #bcc8bc;
  padding: 8px;
  border-radius: 5px;
  background: #fffdf8;
  width: 55%;
}
dialog input[type="checkbox"] {
  accent-color: #255547;
  width: 19px;
  height: 19px;
}
.statline {
  padding: 10px 0;
  border-bottom: 1px solid #dee4d7;
}
.shake {
  animation: shake 0.12s linear;
}
.flip {
  animation: flip 0.18s ease-out;
}
@keyframes shake {
  25%,
  75% {
    translate: 4px;
  }
  50% {
    translate: -4px;
  }
}
@keyframes flip {
  from {
    scale: 0.1 1;
  }
}
.large .index,
.large .br {
  font-size: 40cqw;
}
.hc .felt,
.hc .tablecontrols {
  background: black;
}
.hc .land {
  display: none;
}
.hc .face {
  background: white;
  color: black;
}
.hc .red {
  color: #a00000;
}
.hc .playable {
  outline: 4px solid #ffea00;
}
.hc .back {
  filter: grayscale(1);
}
.reduced * {
  animation: none !important;
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
  }
}
@media (min-width: 1550px) {
  .felt {
    padding-bottom: 38px;
  }
  #tableau {
    margin-top: 48px;
  }
}
@media (max-width: 950px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 14px;
  }
  .panel {
    padding: 16px;
  }
  .navwrap {
    gap: 5%;
  }
  nav {
    gap: 12px;
  }
  #tableau {
    width: 96%;
  }
  .brand {
    font-size: 20px;
  }
  .heading {
    margin: 25px 0 20px;
  }
}
@media (max-width: 760px) {
  .navwrap,
  main {
    width: 95%;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  aside {
    grid-template-columns: 1fr 1fr;
  }
  .navwrap {
    height: 58px;
    gap: 12px;
  }
  .brand {
    font-size: 18px;
    gap: 6px;
  }
  .brand img {
    width: 32px;
  }
  nav {
    gap: 4px;
  }
  nav button {
    font-size: 12px;
  }
  nav .ico {
    display: none;
  }
  .utilities {
    gap: 4px;
  }
  .iconbtn {
    height: 39px;
    width: 39px;
  }
  .heading {
    margin: 22px 0 18px;
  }
  h1 {
    letter-spacing: -1.7px;
  }
  .eyebrow {
    font-size: 9px;
  }
  .primary {
    padding: 9px 12px;
  }
  .felt {
    padding: 13px 0 23px;
  }
  #tableau {
    width: 99%;
    margin-top: 32px;
  }
  .piles {
    margin-top: 22px;
  }
  .dealrow {
    margin: 0 12px;
  }
}
@media (max-width: 540px) {
  header .navwrap {
    flex-wrap: wrap;
    gap: 0;
    height: auto;
    padding-top: 8px;
  }
  nav {
    order: 3;
    width: 100%;
    height: 40px;
    justify-content: space-around;
  }
  nav .ico {
    display: inline-block;
    width: 15px;
  }
  .heading {
    align-items: end;
  }
  .heading .primary {
    font-size: 12px;
    padding: 8px;
    gap: 4px;
  }
  .heading .primary .ico {
    width: 14px;
  }
  h1 {
    font-size: 31px;
  }
  .card {
    border-radius: 4px;
  }
  .back {
    border-width: 1px;
  }
  .panel {
    padding: 13px;
  }
  .panel h2 {
    font-size: 19px;
  }
  .paneltitle {
    gap: 6px;
  }
  aside {
    gap: 9px;
  }
  .metrics strong {
    font-size: 28px;
  }
  .metrics {
    padding: 13px 0;
  }
  .peak {
    height: 31px;
  }
  .peak .ico {
    width: 26px;
  }
  .guide p {
    font-size: 13px;
  }
  .lesson {
    gap: 4px;
  }
  .mini {
    width: 30px;
    height: 41px;
  }
  .guide button {
    font-size: 12px;
  }
  .tablecontrols {
    padding: 8px 10px;
  }
  .playable {
    outline-width: 2px;
    transform: translateY(-4px);
  }
  .piles {
    gap: 14px;
  }
  .tablecontrols button {
    min-height: 44px;
  }
  #tableau {
    margin-top: 27px;
  }
  .brand {
    font-size: 20px;
  }
  .utilities .iconbtn {
    width: 44px;
    height: 44px;
  }
}
@keyframes drawCue {
  50% { outline: 3px solid #f2c971; outline-offset: 2px; }
}
.draw-cue { animation: drawCue 2s infinite; }
@media (max-width: 540px) {
  .tablecard .index { font-size: 42cqw; }
  .tablecard .br { display: none; }
  .tablecard .centerpip { inset: 25% 0 0; }
  .large .tablecard .index { font-size: 54cqw; }
}
