:root {
  font: clamp(15px, 2.2vmin, 21px) / 1.45 system-ui;
  color: #faf6e9;
  background: #103e34;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(ellipse at center, #25634d, #103e34 76%);
}
main {
  width: min(100%, 64rem);
  margin: auto;
  min-height: 100dvh;
  padding: clamp(12px, 3vmin, 32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  gap: 0.65rem;
  text-align: center;
}
h1,
h2,
h3,
p {
  margin: 0.25em;
}
h1,
h2 {
  font-family: Georgia, serif;
  font-weight: 500;
  color: #ffebbc;
}
h1 {
  font-size: clamp(2rem, 6vmin, 4rem);
}
button,
select {
  font: inherit;
  color: #fff7da;
  background: #234c40;
  border: 1px solid #b4a77d;
  border-radius: 0.45rem;
  padding: 0.45em 0.85em;
  cursor: pointer;
}
button:focus-visible,
select:focus-visible,
input:focus-visible,
.hint {
  outline: 3px solid #ffcf60;
  outline-offset: 2px;
}
button:hover:enabled {
  background-color: #37634f;
}
button:disabled {
  cursor: default;
}
section,
nav,
fieldset {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}
label {
  padding: 0.35rem;
}
fieldset {
  border: 0;
}
dialog {
  border: 1px solid #aa976c;
  border-radius: 1rem;
  background: #153f33;
  color: #faf6e9;
  text-align: center;
  padding: 1.5rem;
  max-width: 95vw;
}
dialog::backdrop {
  background: #071c15c9;
}
table {
  margin: 1em auto;
  border-collapse: collapse;
}
th,
td {
  padding: 0.4em;
  border-bottom: 1px solid #658573;
}
button.card {
  --w: clamp(38px, 8vw, 86px);
  width: var(--w);
  height: calc(var(--w) * 4 / 3);
  padding: 0;
  border: 0;
  background-image: url(assets/cards/60x80-en.png);
  background-size: 900% 400%;
  background-position: var(--small-pos);
  background-color: transparent;
  border-radius: 0.3em;
}
.hand {
  gap: 2px;
}
.hand .card:disabled {
  filter: brightness(0.78);
}
small {
  color: #d4ddcd;
}
.opponents {
  width: 100%;
  justify-content: space-around;
}
.trick {
  min-height: 4rem;
}
figure {
  margin: 0;
}
output {
  font-size: 1.2em;
  font-weight: bold;
}
#felt {
  position: fixed;
  inset: 0;
  z-index: -1;
  filter: brightness(0.66) saturate(0.82);
  pointer-events: none;
}
body {
  isolation: isolate;
}
main {
  padding-top: max(12px, var(--inset-top, 0px), env(safe-area-inset-top));
  padding-bottom: max(
    12px,
    var(--inset-bottom, 0px),
    env(safe-area-inset-bottom)
  );
}
.crest {
  width: 4.5rem;
  border-radius: 1rem;
  box-shadow: 0 3px 14px #071b1680;
}
form {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
}
fieldset {
  margin: 0;
  border: 1px solid #527262;
  border-radius: 0.6rem;
}
legend {
  padding-inline: 0.5rem;
}
output {
  padding: 0.5em;
}
.backs {
  display: flex;
  justify-content: center;
  min-height: 2.5rem;
  margin: 0.5rem 1rem;
}
.backs i {
  width: 2rem;
  height: 2.66rem;
  background: url(assets/cards/60x80-en.png) 100% 0 / 900% 400%;
  margin-left: -1.55rem;
}
.backs i:first-child {
  margin-left: 0;
}
dialog {
  box-shadow: 0 18px 70px #05160e8c;
}
h2 {
  line-height: 1.2;
}
@media (orientation: landscape) {
  button.card {
    background-image: url(assets/cards/180x270-english-en.png);
    background-size: 600% 600%;
    background-position: var(--large-pos);
    height: calc(var(--w) * 1.5);
    --w: clamp(40px, min(8vw, 12vh), 100px);
  }
}
@media (max-height: 550px) and (orientation: landscape) {
  main {
    gap: 0.12rem;
  }
  .backs {
    display: none;
  }
  dialog {
    padding: 0.75rem;
  }
  form {
    gap: 0.2rem;
  }
  .crest {
    width: 2rem;
  }
}
@media (max-width: 540px) {
  .hand {
    max-width: 100%;
    flex-wrap: nowrap;
  }
  .hand button.card {
    --w: clamp(44px, 12vw, 65px);
    margin-left: -5vw;
    flex-shrink: 0;
  }
  .hand button:first-child {
    margin-left: 0;
  }
  nav button {
    padding: 0.35em 0.55em;
  }
  th,
  td {
    padding: 0.2em;
  }
}
