:root {
  color-scheme: light;
  --ink: #18221f;
  --muted: #60706b;
  --paper: #fbfcf8;
  --wash: #eef5f2;
  --panel: #ffffff;
  --panel-glass: rgba(255, 255, 255, 0.84);
  --line: #d8e0dc;
  --teal: #0f766e;
  --coral: #b7463b;
  --gold: #c39b37;
  --charcoal: #24302d;
  --shadow: 0 24px 70px rgba(24, 34, 31, 0.14);
  --header-height: 72px;
  --content-max: 1200px;
  --page-x: clamp(18px, 5vw, 72px);
  --felt: var(--teal);
  --felt-dark: #0b5d58;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(
      circle at 18% 14%,
      rgba(15, 118, 110, 0.12),
      transparent 28%
    ),
    linear-gradient(135deg, #fbfcf8 0%, #eef5f1 100%);
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-height);
  padding: 14px max(var(--page-x), calc((100vw - var(--content-max)) / 2));
  background: rgba(251, 252, 248, 0.86);
  border-bottom: 1px solid rgba(216, 224, 220, 0.7);
  backdrop-filter: blur(18px);
}

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  color: var(--charcoal);
  font-weight: 800;
  text-decoration: none;
}

.home-link span:first-child {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #fff;
  background: var(--charcoal);
  border-radius: 8px;
  font-size: 1.5rem;
  line-height: 1;
}

.status-row,
.top-actions,
.action-buttons,
.action-controls {
  display: flex;
  gap: 10px;
}

.status-box {
  min-width: 92px;
  padding: 9px 12px;
  text-align: center;
  background: var(--panel-glass);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.status-box span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.status-box strong {
  display: block;
  margin-top: 2px;
  color: var(--charcoal);
  font-size: 1.25rem;
}

.poker-shell {
  display: grid;
  place-items: center;
  min-height: calc(100svh - var(--header-height));
  padding: 8px clamp(14px, 4vw, 44px) 42px;
}

.table-panel {
  width: min(100%, 1080px);
}

.game-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--felt);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 4.7rem;
  line-height: 0.96;
}

.ghost-button,
.solid-button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 800;
  transition:
    transform 150ms ease,
    background 150ms ease,
    color 150ms ease,
    border-color 150ms ease;
}

.ghost-button {
  color: var(--charcoal);
  background: var(--panel-glass);
  border: 1px solid var(--line);
}

.solid-button {
  color: #fff;
  background: var(--felt);
  border: 1px solid var(--felt);
}

.ghost-button:hover,
.solid-button:hover {
  transform: translateY(-2px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.table {
  position: relative;
  min-height: 640px;
  padding: 24px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 45%),
    var(--felt);
  border: 14px solid var(--charcoal);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.community-area {
  position: absolute;
  inset: 50%;
  display: grid;
  place-items: center;
  width: min(86%, 560px);
  min-height: 176px;
  padding: 18px;
  color: #fff;
  background: rgba(11, 93, 88, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  transform: translate(-50%, -50%);
}

.community-area p,
.community-area strong {
  margin: 0;
}

.community-area p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 850;
}

.community-cards,
.cards {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.community-cards {
  min-height: 82px;
  margin: 14px 0;
}

.card {
  display: grid;
  place-items: center;
  width: 56px;
  height: 76px;
  color: var(--charcoal);
  background: #fff;
  border: 1px solid rgba(37, 50, 45, 0.18);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(23, 35, 31, 0.16);
  font-size: 1.1rem;
  font-weight: 900;
}

.card.is-red {
  color: #c83444;
}

.card.is-back {
  color: rgba(255, 255, 255, 0.74);
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.1) 0 6px,
      rgba(255, 255, 255, 0.02) 6px 12px
    ),
    var(--charcoal);
}

.seat {
  position: absolute;
  display: grid;
  gap: 8px;
  width: 190px;
  padding: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
}

.seat.is-current {
  outline: 3px solid var(--gold);
}

.seat.is-folded {
  opacity: 0.58;
}

.seat.is-winner {
  outline: 3px solid #fff;
}

.seat-0 {
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
}

.seat-1 {
  left: 34px;
  bottom: 124px;
}

.seat-2 {
  top: 34px;
  left: 34px;
}

.seat-3 {
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
}

.seat-4 {
  top: 34px;
  right: 34px;
}

.seat-5 {
  right: 34px;
  bottom: 124px;
}

.seat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.seat-name {
  font-weight: 900;
}

.dealer {
  display: none;
  place-items: center;
  width: 26px;
  height: 26px;
  color: #fff;
  background: var(--charcoal);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 900;
}

.seat.is-dealer .dealer {
  display: grid;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.last-action {
  min-height: 20px;
  color: var(--felt-dark);
  font-size: 0.9rem;
  font-weight: 850;
}

.action-panel,
.log-panel {
  margin-top: 14px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.action-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.hint {
  color: var(--muted);
  font-weight: 800;
}

.action-controls {
  align-items: center;
  justify-content: flex-end;
}

.raise-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px 0 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 850;
  white-space: nowrap;
}

.raise-field input {
  width: 92px;
  min-height: 32px;
  color: var(--charcoal);
  background: #f7faf7;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 900;
  text-align: center;
}

.raise-field input:disabled {
  opacity: 0.45;
}

.log-panel {
  display: grid;
  gap: 6px;
  max-height: 150px;
  overflow-y: auto;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

@media (max-width: 860px) {
  .game-top,
  .action-panel {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 3.45rem;
  }

  .top-actions,
  .action-buttons,
  .action-controls {
    width: 100%;
  }

  .top-actions button,
  .action-buttons button {
    flex: 1;
  }

  .action-controls {
    align-items: stretch;
  }

  .raise-field {
    justify-content: space-between;
  }

  .raise-field input {
    width: 118px;
  }

  .table {
    display: grid;
    gap: 12px;
    min-height: auto;
    padding: 14px;
    border-width: 8px;
  }

  .community-area,
  .seat {
    position: static;
    width: 100%;
    transform: none;
  }

  .seat {
    order: 2;
  }

  .community-area {
    order: 1;
  }

  .card {
    width: 48px;
    height: 66px;
  }
}

@media (max-width: 560px) {
  .app-header {
    align-items: stretch;
    flex-direction: column;
  }

  .status-row {
    width: 100%;
  }

  .status-box {
    flex: 1;
  }

  .poker-shell {
    min-height: auto;
  }

  h1 {
    font-size: 2.7rem;
  }

  .action-buttons,
  .top-actions,
  .action-controls {
    flex-direction: column;
  }

  .raise-field input {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ghost-button,
  .solid-button {
    transition: none;
  }

  .ghost-button:hover,
  .solid-button:hover {
    transform: none;
  }
}
