:root {
  color-scheme: dark;
  --ink: #f4f0d9;
  --pale: #cae9a4;
  --line: #b9d4b240;
  --dim: #b8c7b6;
  --red: #ef785b;
  --blue: #83b6e5;
  --green: #83c4a9;
  --yellow: #edc96c;
  --bg: #102724;
  font:
    16px/1.6 'Segoe UI',
    'PingFang SC',
    'Microsoft YaHei',
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100svh;
  color: var(--ink);
  background: radial-gradient(ellipse at 24% 45%, #25473b 0, transparent 50%), var(--bg);
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #ffdf8a;
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
header,
main {
  width: min(1160px, calc(100% - 80px));
  margin: auto;
}
header {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.home {
  font-size: 18px;
  font-weight: 650;
  font-style: italic;
}
.quiet,
.subtle,
.text-button,
.hand-actions button,
.x {
  background: transparent;
  border: 0;
}
.quiet,
.hand-actions button {
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 7px 16px;
  font-size: 14px;
}
.quiet span {
  margin-left: 0.6em;
}
.quiet:hover,
.hand-actions button:hover {
  background: #ffffff13;
}
.subtle,
.text-button {
  color: var(--dim);
  padding: 9px;
  font-size: 14px;
}
.entry {
  min-height: min(760px, calc(100svh - 74px));
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 9%;
  padding: 54px 4% 76px;
}
.intro {
  text-align: center;
}
.fan {
  width: 285px;
  height: 204px;
  margin: 0 auto 4px;
  position: relative;
}
.card,
.card-back {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  aspect-ratio: 0.694;
  border-radius: 11px;
  border: 3px solid var(--ink);
  overflow: hidden;
  box-shadow: 0 4px 0 #04161242;
  font-family: 'Arial', sans-serif;
  font-style: normal;
}
.card {
  background: var(--c);
  color: #172824;
}
.red {
  --c: var(--red);
}
.yellow {
  --c: var(--yellow);
}
.green {
  --c: var(--green);
}
.blue {
  --c: var(--blue);
}
.wild {
  --c: conic-gradient(from -35deg, #83b6e5 0 25%, #83c4a9 0 50%, #edc96c 0 75%, #ef785b 0);
}
.card:before,
.card-back:before,
.card-back:after {
  content: '';
  position: absolute;
  inset: 11% 5%;
  z-index: -1;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  transform: rotate(24deg);
}
.card:before {
  background: #fff5d755;
  color: #17342870;
}
.card b {
  font-size: var(--symbol, 45px);
  font-style: italic;
  font-weight: 900;
  letter-spacing: -0.1em;
  line-height: 1;
  padding-right: 0.1em;
}
.card small,
.card em {
  position: absolute;
  font-style: normal;
  font-weight: bold;
  font-size: 11px;
}
.card small {
  top: 3px;
  left: 5px;
}
.card em {
  bottom: 4px;
  right: 5px;
  font-size: 10px;
}
.fan .card {
  position: absolute;
  width: 124px;
  --symbol: 79px;
  left: 80px;
  bottom: 8px;
  transform-origin: 50% 94%;
}
.fan .card:first-child {
  transform: translateX(-50px) rotate(-26deg);
}
.fan .card:nth-child(2) {
  transform: translateY(-9px) rotate(-4deg);
}
.fan .card:last-child {
  transform: translateX(50px) rotate(19deg);
}
.intro h1 {
  font:
    italic 900 clamp(88px, 10vw, 150px) / 0.85 Arial,
    sans-serif;
  letter-spacing: -0.105em;
  margin: 12px 0 24px;
}
.intro h1 span {
  color: var(--pale);
}
.intro p {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
  letter-spacing: 0.08em;
  color: var(--dim);
  font-size: 15px;
}
.intro p i {
  width: 24px;
  height: 1px;
  background: var(--dim);
}
.entry-panel {
  padding: 30px;
  border: 1px solid var(--line);
  background: #142e29c4;
  border-radius: 14px;
  display: grid;
  gap: 16px;
}
h2 {
  font-size: 23px;
  letter-spacing: 0.025em;
  margin: 0 0 8px;
}
.entry-panel label {
  font-size: 13px;
  color: var(--dim);
  display: grid;
  gap: 6px;
}
.entry-panel input {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #102520;
  color: var(--ink);
  padding: 11px 12px;
}
.primary {
  background: var(--pale);
  color: #162820;
  border: 0;
  border-radius: 7px;
  padding: 12px 21px;
  font-weight: 700;
}
.primary span {
  float: right;
}
.primary:disabled {
  opacity: 0.44;
}
.primary:not(:disabled):hover {
  background: #ddf8bb;
}
.text-button {
  justify-self: center;
}
#room {
  padding: 32px 0 40px;
}
.room-head,
.room-tools,
.hand-title,
.hand-actions,
.confirm-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.room-head,
.hand-title {
  justify-content: space-between;
}
.overline {
  font: italic 900 22px/0.95 Arial;
  color: var(--pale);
  margin: 0 0 7px;
}
.room-head h1 {
  font-size: clamp(24px, 3.4vw, 43px);
  line-height: 1.16;
  margin: 0;
}
.room-tools {
  flex-wrap: wrap;
}
.lobby-code {
  color: var(--dim);
  margin: 23px 0;
}
.lobby-code strong {
  letter-spacing: 0.14em;
  font: 600 20px monospace;
  color: var(--ink);
  margin-left: 10px;
}
.players {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 19px 0;
}
.players li {
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: 99px;
  border: 1px solid var(--line);
  padding: 6px 12px;
  font-size: 13px;
}
.players li.active {
  background: var(--pale);
  color: #18312b;
}
.players small {
  opacity: 0.8;
}
.seat-icon {
  border-radius: 50%;
  width: 9px;
  height: 9px;
  background: var(--dot);
}
.kick {
  border: 0;
  background: transparent;
  padding: 2px 4px;
  color: inherit;
}
.waiting,
.result {
  display: grid;
  justify-items: center;
  gap: 15px;
  text-align: center;
  padding: 46px 16px;
  border-block: 1px solid var(--line);
}
.waiting .card-back {
  width: 83px;
  transform: rotate(-10deg);
}
.waiting p {
  margin: 0;
  color: var(--dim);
  font-size: 14px;
}
.card-back {
  width: 100%;
  background: repeating-linear-gradient(125deg, #243f37 0 2px, #19382f 2px 7px);
  color: var(--pale);
}
.card-back:after {
  inset: 18% 11%;
  transform: rotate(26deg);
}
.card-back b {
  font: italic 900 24px Arial;
  letter-spacing: -0.09em;
  transform: rotate(-18deg);
}
.felt {
  background: radial-gradient(ellipse at 50% 35%, #335949 0, #193e32 64%);
  border: 1px solid var(--line);
  border-radius: clamp(17px, 4vw, 48px);
  display: grid;
  place-content: center;
  padding: 25px 18px 20px;
  min-height: 250px;
  box-shadow: inset 0 0 0 6px #1b332c88;
}
.piles {
  display: flex;
  justify-content: center;
  gap: 25px;
  align-items: start;
}
.stock,
.discard {
  width: 83px;
  text-align: center;
}
.stock {
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink);
}
.stock:enabled .card-back {
  box-shadow:
    3px 3px 0 #b4cfad,
    6px 6px 0 #172c26;
}
.stock:disabled {
  opacity: 0.63;
}
.discard .card {
  width: 100%;
}
.piles small {
  font-size: 12px;
}
.table-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 10px;
  margin-top: 13px;
}
.table-status strong {
  font-size: 17px;
}
.table-status small {
  width: 100%;
  text-align: center;
  color: var(--dim);
}
.hand-title {
  margin: 22px 0 10px;
  flex-wrap: wrap;
}
.hand-title h2 {
  margin: 0;
  font-size: 18px;
}
.hand-title h2 span {
  font: 14px monospace;
  color: var(--dim);
}
.hand-actions {
  font-size: 13px;
  gap: 8px;
}
.hand-actions input {
  accent-color: var(--pale);
}
.hand {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 6px;
  padding: 5px 0;
}
.hand .card {
  width: clamp(51px, 6.1vw, 84px);
  transition: transform 0.15s;
}
.hand .card:disabled {
  filter: saturate(0.6) brightness(0.81);
}
.hand .card:enabled:hover,
.hand .card:focus-visible {
  transform: translateY(-5px);
}
.result {
  padding: 32px 10px;
}
.notice {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  margin: 0;
  background: #f4f0d9;
  color: #173128;
  padding: 8px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 18px #071b18;
  max-width: min(90%, 650px);
  width: max-content;
  font-size: 14px;
}
.notice:empty {
  display: none;
}
dialog {
  max-width: min(480px, calc(100% - 32px));
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #19322c;
  color: var(--ink);
}
dialog::backdrop {
  background: #061611b8;
}
dialog li,
dialog p {
  color: #ccd8ca;
  font-size: 14px;
}
dialog ul {
  padding-left: 18px;
}
dialog .x {
  position: absolute;
  right: 10px;
  top: 6px;
  font-size: 25px;
}
#colors {
  display: flex;
  gap: 8px;
}
#colors button {
  background: var(--c);
  color: #152a22;
  border: 0;
  border-radius: 5px;
  padding: 10px 14px;
}
@media (max-width: 700px) {
  header,
  main {
    width: calc(100% - 32px);
  }
  header {
    height: 52px;
  }
  .entry {
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 23px;
    padding: 30px 0 40px;
  }
  .intro {
    width: 100%;
  }
  .fan {
    height: 115px;
    width: 180px;
  }
  .fan .card {
    width: 73px;
    left: 54px;
    bottom: 2px;
    --symbol: 45px;
  }
  .fan .card:first-child {
    transform: translateX(-28px) rotate(-25deg);
  }
  .fan .card:last-child {
    transform: translateX(27px) rotate(22deg);
  }
  .intro h1 {
    font-size: 73px;
    margin: 7px 0 10px;
  }
  .intro p {
    font-size: 13px;
  }
  .entry-panel {
    padding: 20px;
    width: min(100%, 410px);
    gap: 12px;
  }
  #room {
    padding-top: 22px;
  }
  .room-head {
    align-items: start;
  }
  .room-tools {
    gap: 1px;
    justify-content: end;
  }
  .room-tools .quiet,
  .subtle {
    font-size: 12px;
    padding: 6px 10px;
  }
  .overline {
    font-size: 18px;
  }
  .players {
    margin: 13px 0;
    gap: 5px;
  }
  .players li {
    font-size: 12px;
    padding: 4px 8px;
  }
  .felt {
    min-height: 192px;
    padding: 17px 12px 13px;
  }
  .stock,
  .discard {
    width: 62px;
  }
  .card-back b {
    font-size: 20px;
  }
  .card {
    border-width: 2px;
    border-radius: 7px;
  }
  .hand .card {
    width: clamp(46px, 13.7vw, 64px);
    --symbol: 31px;
  }
  .hand {
    gap: 4px;
  }
  .hand-title {
    margin-top: 16px;
  }
  .waiting {
    padding-block: 30px;
  }
  .card em {
    font-size: 9px;
  }
  .hand .card small {
    font-size: 10px;
  }
  .table-status {
    margin-top: 9px;
  }
  .room-head h1 {
    font-size: 25px;
  }
  .room-tools .subtle {
    padding-inline: 5px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

#active-color {
  display: block;
  white-space: nowrap;
  font-size: 11px;
}
