:root {
  color-scheme: dark;
  --bg: #101d1b;
  --panel: #172623;
  --line: #34433e;
  --text: #edf1e8;
  --muted: #a4b4a9;
  --accent: #d1dfa9;
  --profit: #b5dca7;
  --loss: #ecad9e;
  font:
    16px "IBM Plex Sans",
    sans-serif;
  background: var(--bg);
  color: var(--text);
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
button,
input {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 10px 17px;
  border-radius: 6px;
  min-height: 44px;
  cursor: pointer;
  transition:
    background 0.16s,
    transform 0.16s;
}
button:hover {
  background: #2c4037;
}
button:active {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
a {
  color: inherit;
  text-decoration: none;
}
.primary {
  background: var(--accent);
  color: #17221a;
  border-color: var(--accent);
}
.primary:hover {
  background: #e2ebc9;
}
.poker-shell {
  max-width: 1120px;
  margin: auto;
  padding: 0 40px 70px;
}
.poker-header {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 86px;
  border-bottom: 1px solid var(--line);
}
.home-link {
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
}
.edit-actions {
  display: flex;
  gap: 9px;
}
.edit-actions button {
  font-size: 13px;
}
.poker-heading {
  padding: 40px 0 28px;
}
h1,
h2 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  letter-spacing: -0.045em;
}
h1 {
  font-size: clamp(30px, 4vw, 46px);
  margin: 0 0 18px;
}
.poker-rules {
  display: flex;
  gap: 10px 24px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.view-tabs {
  display: flex;
  gap: 30px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.view-tabs button {
  border: 0;
  border-radius: 0;
  background: none;
  padding: 14px 0;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.view-tabs button[aria-pressed="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.view-tabs button span {
  margin-left: 6px;
  font-size: 12px;
  color: var(--muted);
}
.poker-status {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.poker-status:empty {
  display: none;
}
.poker-status.error,
[data-code-error] {
  color: var(--loss);
}
.leaderboard {
  padding: 0;
  margin: 0;
  list-style: none;
}
.leaderboard li {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--line);
}
.leaderboard li:first-child {
  background: #26382b;
}
.rank {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.player-name {
  font-size: 18px;
  font-weight: 500;
}
.money {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.profit {
  color: var(--profit);
}
.loss {
  color: var(--loss);
}
[data-history] {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 28px;
}
.game-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 600px;
  overflow: auto;
  padding-right: 8px;
}
.game-nav button {
  text-align: left;
  background: none;
  border-color: transparent;
  flex-shrink: 0;
  font-size: 14px;
}
.game-nav button[aria-current="true"] {
  background: var(--accent);
  color: #17221a;
}
.game-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.game-head h2 {
  margin: 0;
  font-size: 26px;
}
.game-actions {
  display: flex;
  gap: 8px;
}
.game-actions button {
  font-size: 12px;
}
.danger {
  color: var(--loss);
}
.scores {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.scores th {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  text-align: right;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
}
.scores th:first-child {
  width: 25%;
  text-align: left;
}
.scores td {
  padding: 18px 8px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.scores td:first-child {
  text-align: left;
  overflow-wrap: anywhere;
  font-weight: 500;
}
.scores .money {
  font-size: 15px;
}
.scores .rank {
  margin-right: 10px;
}
.game-order {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
}
.game-order input {
  width: 76px;
}
input {
  display: block;
  width: 100%;
  min-width: 0;
  border: 1px solid #526257;
  border-radius: 5px;
  background: #0e1917;
  color: var(--text);
  padding: 10px;
  font-size: 16px;
  min-height: 44px;
  margin-top: 6px;
}
input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.scores input {
  text-align: right;
}
.scores td:first-child input {
  text-align: left;
}
.remove-player {
  padding: 5px 0;
  min-height: 30px;
  font-size: 11px;
  background: none;
  border: 0;
  color: var(--loss);
}
.empty {
  color: var(--muted);
  font-size: 14px;
}
dialog {
  width: min(400px, calc(100% - 32px));
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
}
dialog::backdrop {
  background: #030c0ac9;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
  gap: 16px;
}
.dialog-heading h2 {
  font-size: 24px;
  margin: 0;
}
.dialog-heading button {
  padding: 8px 12px;
  font-size: 12px;
}
dialog label {
  font-size: 14px;
}
dialog .primary {
  width: 100%;
  margin-top: 12px;
}
@media (max-width: 700px) {
  .poker-shell {
    padding: 0 18px 45px;
  }
  .poker-header {
    min-height: 72px;
  }
  .poker-heading {
    padding-top: 30px;
  }
  .poker-rules {
    gap: 6px 16px;
  }
  .poker-rules span:last-child {
    width: 100%;
  }
  .edit-actions {
    gap: 6px;
  }
  .edit-actions button {
    padding: 8px 10px;
    font-size: 12px;
  }
  .home-link {
    font-size: 14px;
  }
  .leaderboard li {
    padding: 16px 8px;
    grid-template-columns: 25px 1fr auto;
    gap: 10px;
  }
  .player-name {
    font-size: 17px;
  }
  [data-history] {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .game-nav {
    flex-direction: row;
    max-height: none;
    overflow-x: auto;
    padding: 0 0 10px;
  }
  .game-nav button {
    padding: 9px 13px;
  }
  .scores thead {
    display: none;
  }
  .scores,
  .scores tbody {
    display: block;
  }
  .scores tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--line);
    padding: 18px 0;
    gap: 14px 8px;
  }
  .scores td {
    display: block;
    padding: 0;
    border: 0;
    font-size: 15px;
  }
  .scores td:first-child {
    grid-column: 1/-1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 17px;
  }
  .scores td:not(:first-child):before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    color: var(--muted);
    margin-bottom: 7px;
  }
  .scores td:not(:first-child) {
    text-align: left;
  }
  .scores .money {
    font-size: 16px;
  }
  .scores input {
    text-align: left;
    padding: 8px;
    width: 100%;
  }
  .scores td:first-child input {
    max-width: 75%;
  }
  .scores .remove-player {
    margin-left: 12px;
  }
  .game-head {
    margin-bottom: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
[data-history] > * {
  min-width: 0;
}
