:root {
  --bg: #090a0b;
  --panel: #151619;
  --line: #32343a;
  --ink: #f1eee5;
  --muted: #aaa49a;
  --gold: #d5ad4c;
  --felt: #123c2b;
  --bad: #804046;
  --good: #247f65;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at 50% 0, #1a1e22, var(--bg) 55%);
  color: var(--ink);
  font: 16px system-ui, sans-serif;
}

header {
  max-width: 960px;
  margin: auto;
  padding: 22px;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
}

header a {
  color: var(--gold);
  text-decoration: none;
}

h1 {
  margin: 0;
  font: 700 34px Georgia, serif;
}

h1 b {
  color: var(--gold);
}

h2 {
  margin-top: 0;
}

main {
  max-width: 900px;
  padding: 10px 18px 70px;
  margin: auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  margin: 18px auto;
  max-width: 650px;
}

.notice {
  max-width: 760px;
  margin: 8px auto 14px;
  padding: 12px 14px;
  border: 1px solid #a85e66;
  border-radius: 10px;
  background: #351a1e;
  color: #ffd9dc;
}

.notice.success {
  border-color: #3f9d80;
  background: #102d25;
  color: #c9f5e7;
}

.notice.info {
  border-color: #8d7438;
  background: #2a2415;
  color: #f4dfaa;
}

input,
button {
  min-height: 44px;
  font: inherit;
  border-radius: 9px;
  padding: 10px 12px;
}

input {
  min-width: 0;
  width: 100%;
  background: #0d0e10;
  border: 1px solid var(--line);
  color: var(--ink);
}

button {
  background: var(--gold);
  color: #1c1608;
  border: 0;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  opacity: 0.42;
  cursor: default;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
code:focus-visible {
  outline: 3px solid #fff3bd;
  outline-offset: 3px;
}

form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}

.field {
  display: grid;
  flex: 1 1 180px;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

details {
  margin-top: 16px;
  color: var(--muted);
}

details form {
  margin-top: 10px;
}

#recovery:not([hidden]) {
  margin-top: 18px;
  display: grid;
  gap: 9px;
}

code {
  width: fit-content;
  font-size: 24px;
  color: var(--gold);
  letter-spacing: 2px;
  user-select: all;
}

.matchbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: var(--muted);
}

.danger {
  background: var(--bad);
  color: #fff;
}

.table {
  height: 440px;
  border: 12px solid #20170d;
  border-radius: 48%;
  background: radial-gradient(ellipse at center, #1c6849, var(--felt) 65%, #092216);
  position: relative;
  box-shadow: 0 0 0 3px #4b351a, inset 0 0 80px #0008;
}

.seat {
  position: absolute;
  left: 50%;
  min-width: 180px;
  text-align: center;
  transform: translateX(-50%);
}

.seat strong,
.seat span {
  display: block;
}

.seat > span {
  color: var(--gold);
  margin: 5px;
}

.bot {
  top: 22px;
}

.hero {
  bottom: 22px;
}

.cards {
  min-height: 57px;
  display: flex;
  justify-content: center;
  gap: 6px;
  font-size: 32px;
}

.card {
  display: grid;
  place-items: center;
  width: 42px;
  height: 57px;
  background: #fbf8ef;
  border-radius: 6px;
  color: #111;
  font: 800 18px Georgia, serif;
  box-shadow: 0 2px 5px #0008;
}

.heart {
  color: #c22;
}

.middle {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 320px;
  text-align: center;
  transform: translate(-50%, -50%);
}

.board {
  margin-bottom: 12px;
}

.middle #pot {
  display: inline-block;
  padding: 7px;
  background: #0006;
  border: 1px solid #d5ad4c55;
  border-radius: 20px;
}

.middle #message {
  min-height: 24px;
  margin-top: 14px;
  color: var(--gold);
}

.controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 18px 0;
}

.controls > button {
  min-width: 100px;
}

.raise-control:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  background: var(--panel);
  border-radius: 9px;
}

.raise-control label {
  white-space: nowrap;
}

#raise {
  min-height: 30px;
  padding: 0;
  accent-color: var(--gold);
}

#raise-value {
  min-width: 4ch;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

#next-hand {
  display: block;
  margin: 0 auto 14px;
}

.history {
  max-height: 170px;
  overflow: auto;
  color: var(--muted);
  font-size: 13px;
}

.history div {
  padding: 6px;
  border-bottom: 1px solid #ffffff11;
}

.score-panel {
  max-width: 760px;
}

.bmp-row {
  padding: 13px;
  background: #1e1910;
  border: 1px solid #d5ad4c66;
  border-radius: 10px;
  color: var(--gold);
}

ol {
  padding-left: 26px;
}

li {
  padding: 8px;
  border-bottom: 1px solid #ffffff11;
  color: var(--muted);
}

li b {
  color: var(--ink);
}

@media (max-width: 600px) {
  header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 14px;
    padding: 15px 18px;
  }

  header h1 {
    grid-column: 1 / -1;
    grid-row: 1;
    font-size: 25px;
    text-align: center;
  }

  header a,
  #connection {
    grid-row: 2;
  }

  .panel {
    padding: 18px;
  }

  .matchbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .matchbar button {
    width: 100%;
  }

  .table {
    height: 440px;
    padding: 16px 8px;
    display: grid;
    grid-template-rows: minmax(92px, auto) 1fr minmax(92px, auto);
    align-items: center;
    justify-items: center;
    border-radius: 35%;
  }

  .seat,
  .middle {
    position: static;
    left: auto;
    min-width: 0;
    width: 100%;
    transform: none;
  }

  .bot {
    grid-row: 1;
  }

  .middle {
    grid-row: 2;
  }

  .hero {
    grid-row: 3;
  }

  .cards {
    min-height: 50px;
    font-size: 28px;
  }

  .card {
    width: 34px;
    height: 50px;
    font-size: 15px;
  }

  .middle #message {
    padding: 0 12px;
  }

  .raise-control:not([hidden]) {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(70px, 1fr) auto auto;
  }
}

@media (max-width: 430px) {
  form > button {
    width: 100%;
  }
}
