* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #141a16;
  color: #f4fffb;
  font-family: system-ui, "Segoe UI", sans-serif;
}

body {
  min-height: 100dvh;
  background: radial-gradient(ellipse at 50% 0%, #244033 0%, #141a16 58%);
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 14px calc(20px + env(safe-area-inset-bottom));
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.top a {
  color: #b7e0d4;
  font-weight: 700;
  text-decoration: none;
}

h1 { margin: 0 0 8px; font-size: 1.6rem; }

p, li { line-height: 1.45; color: #d7e6df; }

.legal {
  font-size: 0.88rem;
  color: #9bb8b0;
}

label {
  display: block;
  font-weight: 700;
  margin: 12px 0 6px;
}

input {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.16);
  background: #0f1612;
  color: #f4fffb;
  font: 1rem/1.2 system-ui, "Segoe UI", sans-serif;
}

.row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  background: #1b8f86;
  color: #f4fffb;
  font: 700 1rem/1.2 system-ui, "Segoe UI", sans-serif;
  cursor: pointer;
}

button.ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.28);
}

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

.row button { flex: 1; }

.panel {
  background: rgba(12, 20, 16, 0.88);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 14px;
  margin-top: 12px;
}

.code {
  font-size: 1.8rem;
  letter-spacing: 0.18em;
  font-weight: 800;
}

.players { list-style: none; margin: 8px 0 0; padding: 0; }

.players li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: #f4fffb;
}

.me { color: #9fe3d4; }

.hands {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.seat h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.cards {
  display: flex;
  gap: 8px;
}

.card {
  width: 72px;
  height: 100px;
  border-radius: 10px;
  background: #f7f1e6;
  color: #1a1a1a;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.card.red { color: #c0392b; }
.card.back {
  background: repeating-linear-gradient(45deg, #1b4d44, #1b4d44 8px, #163c36 8px, #163c36 16px);
  color: transparent;
}

.nut {
  margin-top: 6px;
  font-weight: 800;
}

.win { color: #f2d48a; }

.status { min-height: 1.4em; margin: 8px 0 0; }

.error { color: #ffb4a8; }

.hidden { display: none !important; }

button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid #f2d48a;
  outline-offset: 2px;
}
