:root {
  color-scheme: dark;
  --ink: #f3ecd9;
  --muted: #c0c9bd;
  --gold: #dfbd66;
  --green: #0a3d2e;
  --card-width: 76px;
  --card-height: 106px;
}
* {
  box-sizing: border-box;
}
html {
  min-width: 320px;
  background: #061710;
}
body {
  margin: 0;
  color: var(--ink);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    radial-gradient(ellipse at 50% 0, #174733 0, transparent 65%), #061710;
  min-height: 100svh;
}
button,
input,
select {
  font: inherit;
}
button,
select {
  min-height: 44px;
  cursor: pointer;
}
button {
  border: 1px solid #6a805d;
  border-radius: 10px;
  background: #183b2b;
  color: var(--ink);
  padding: 10px 15px;
  font-weight: 650;
  transition:
    background 0.15s,
    transform 0.15s,
    border-color 0.15s;
}
button:hover {
  background: #254d37;
  border-color: var(--gold);
}
button:active {
  transform: translateY(1px);
}
button:disabled {
  cursor: default;
  opacity: 0.45;
  transform: none;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #ffe0a0;
  outline-offset: 3px;
}
input,
select {
  border: 1px solid #78916b;
  background: #102d20;
  color: var(--ink);
  border-radius: 8px;
  padding: 8px;
  max-width: 100%;
}
a {
  color: var(--gold);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-family: Georgia, serif;
  font-size: clamp(26px, 4vw, 42px);
  letter-spacing: -0.03em;
  margin-bottom: 5px;
}
h2 {
  font-size: 22px;
}
p {
  line-height: 1.55;
}
.card-room {
  max-width: 1050px;
  margin: auto;
  padding: 26px 24px 32px;
}
.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.eyebrow {
  color: var(--gold);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 9px;
}
.room-header p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}
.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #102618;
}
.primary:hover {
  background: #f4d889;
}
.secondary {
  background: #0c291c;
}
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0;
}
.stat {
  flex: 1;
  min-width: 80px;
  border-top: 1px solid #59704c;
  padding: 10px 0;
  color: var(--muted);
  font-size: 12px;
}
.stat strong,
.stat b {
  display: block;
  color: var(--ink);
  font-size: 22px;
  margin-top: 3px;
}
.table {
  position: relative;
  border: 1px solid #749062;
  border-radius: 22px;
  background: radial-gradient(ellipse at 50% 0, #28543a, #103521 70%);
  box-shadow:
    inset 0 0 0 5px #071b12,
    inset 0 0 50px #02180e60,
    0 18px 50px #0004;
  padding: 26px;
  min-width: 0;
}
.playing-card {
  position: relative;
  display: inline-block;
  vertical-align: top;
  width: var(--card-width);
  height: var(--card-height);
  min-height: 0;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #ded6bf;
  background: linear-gradient(120deg, #fffdf3, #e8e4d7);
  box-shadow: 0 3px 6px #0005;
  color: #172a22;
  overflow: hidden;
  flex-shrink: 0;
  user-select: none;
}
.playing-card:hover {
  background: #fffdf2;
  transform: translateY(-2px);
  border-color: #dfbd66;
}
.playing-card:disabled {
  opacity: 1;
}
.playing-card.selected,
.playing-card[aria-pressed="true"] {
  outline: 3px solid #ffe0a0;
  outline-offset: 1px;
  transform: translateY(-4px);
}
.playing-card.hint,
.playing-card.legal {
  box-shadow:
    0 0 0 3px #83e5ac,
    0 5px 8px #0005;
}
.card-corner {
  position: absolute;
  top: 6px;
  left: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.05;
  font-size: 17px;
  font-family: Georgia, serif;
}
.card-corner b {
  font-weight: 800;
}
.card-corner > span {
  font-size: 15px;
  margin-top: 2px;
}
.card-corner.bottom {
  top: auto;
  left: auto;
  right: 7px;
  bottom: 6px;
  transform: rotate(180deg);
}
.card-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
}
.red-suit {
  color: #ac2435;
}
.black-suit {
  color: #15312a;
}
.card-back {
  background: repeating-linear-gradient(
    45deg,
    #133f35 0,
    #133f35 5px,
    #205344 5px,
    #205344 7px
  );
  border: 3px solid #ded6bf;
}
.card-back:hover {
  background: repeating-linear-gradient(
    45deg,
    #194f3f 0,
    #194f3f 5px,
    #27664f 5px,
    #27664f 7px
  );
}
.back-motif {
  position: absolute;
  inset: 8px;
  display: grid;
  place-items: center;
  border: 1px solid #b8a166;
  border-radius: 3px;
  color: #e8d5a3;
  font-size: 32px;
}
.card-slot {
  width: var(--card-width);
  height: var(--card-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #94ac83;
  border-radius: 8px;
  color: #b9c9ac;
  font-size: 23px;
  background: #061c1160;
  flex-shrink: 0;
}
.status {
  min-height: 44px;
  margin: 14px 0 0;
  padding: 10px 14px;
  background: #071d14b3;
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  line-height: 1.45;
  font-size: 14px;
}
.help-panel,
.result-panel {
  padding: 20px;
  border: 1px solid #7b8357;
  border-radius: 14px;
  margin: 15px 0;
  background: #0b291d;
}
.help-panel li {
  margin-bottom: 8px;
  line-height: 1.5;
}
.help-panel ul,
.help-panel ol {
  padding-left: 22px;
}
.result-panel {
  border-color: var(--gold);
  text-align: center;
}
.game-footer {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.game-footer a {
  padding: 8px 0;
  display: inline-block;
}
.celebrating {
  animation: celebrate 1s ease-out;
}
@keyframes celebrate {
  50% {
    box-shadow: 0 0 50px #d9c47180;
  }
}
[hidden] {
  display: none !important;
}
@media (max-width: 600px) {
  :root {
    --card-width: 44px;
    --card-height: 66px;
  }
  .card-room {
    padding: 16px 8px 24px;
  }
  .room-header {
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
  }
  .room-header p {
    font-size: 12px;
  }
  .room-header .eyebrow {
    font-size: 9px;
    letter-spacing: 0.15em;
  }
  .table {
    padding: 14px 6px;
    border-radius: 14px;
    box-shadow:
      inset 0 0 0 3px #071b12,
      0 10px 25px #0003;
  }
  .toolbar {
    gap: 6px;
  }
  .toolbar button {
    font-size: 12px;
    padding: 9px 10px;
  }
  .stats {
    gap: 8px;
    margin: 12px 0;
  }
  .stat {
    font-size: 10px;
    min-width: 60px;
  }
  .stat strong,
  .stat b {
    font-size: 18px;
  }
  .card-corner {
    font-size: 15px;
    left: 4px;
    top: 4px;
  }
  .card-corner > span {
    font-size: 12px;
    margin-top: 1px;
  }
  .card-corner.bottom {
    right: 4px;
    bottom: 4px;
  }
  .card-center {
    font-size: 21px;
  }
  .playing-card {
    border-radius: 5px;
  }
  .back-motif {
    inset: 4px;
    font-size: 22px;
  }
  .status {
    font-size: 13px;
    padding: 9px 10px;
  }
  .help-panel,
  .result-panel {
    padding: 15px;
  }
  .game-footer {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
