html {
  font-size: 16px;
  background: #090e0e;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  color: #f2efe7;
  background: #090e0e;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.site-nav {
  margin-bottom: 0 !important;
  border-bottom: 1px solid #293b39;
  background: #111a1a !important;
}

.site-nav-container {
  min-height: 72px;
}

.site-brand {
  color: #f0d384 !important;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 700;
}

.site-nav-link {
  color: #d3ded8 !important;
  font-size: 1rem;
}

.site-nav-link:hover, .site-nav-link:focus-visible {
  color: #f0d384 !important;
}

.navbar-toggler {
  width: 52px;
  min-height: 48px;
  border-color: #667873;
}

.navbar-toggler-icon {
  filter: invert(1);
}

.poker-app {
  max-width: 1040px;
  margin: 48px auto 80px;
}

.app-heading {
  margin-bottom: 30px;
  text-align: center;
}

.app-heading h1 {
  margin: 0;
  color: #f1d27b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 7vw, 4rem);
}

.app-heading > p:last-child {
  color: #b7c5bf;
}

.eyebrow {
  margin: 0 0 8px;
  color: #b8a064;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
}

.lobby-panel, .game-panel {
  overflow: hidden;
  border: 1px solid #2c413d;
  border-radius: 20px;
  background: #141d1d;
  box-shadow: 0 18px 48px #0008;
}

.lobby-panel {
  max-width: 580px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 42px);
}

.lobby-panel h2 {
  margin: 0 0 24px;
  color: #f1d27b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}

.lobby-panel label, .bet-control {
  display: block;
  margin-bottom: 8px;
  color: #d8e1db;
  font-size: .88rem;
  font-weight: 700;
}

.lobby-panel input, .bet-control input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #435652;
  border-radius: 9px;
  background: #0c1414;
  color: #f2efe7;
  font: inherit;
}

.lobby-panel input:focus, .bet-control input:focus {
  border-color: #e6c46b;
  outline: 3px solid #e6c46b55;
}

.lobby-actions {
  display: grid;
  gap: 25px;
  margin-top: 20px;
}

.join-controls {
  padding-top: 21px;
  border-top: 1px solid #2c413d;
}

.join-row {
  display: flex;
  gap: 10px;
}

.join-row input {
  flex: 1;
  min-width: 0;
  letter-spacing: .16em;
}

.button {
  min-height: 64px;
  padding: 15px 24px;
  border: 2px solid transparent;
  border-radius: 14px;
  font: inherit;
  font-size: 1.12rem;
  font-weight: 850;
  cursor: pointer;
  transition: filter .15s ease, transform .15s ease, box-shadow .15s ease;
}

.button:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px #0006;
}

.button:focus-visible, .copy-code:focus-visible {
  outline: 3px solid #fff1b7;
  outline-offset: 3px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.button-primary {
  color: #16150f;
  background: #f0cf71;
  box-shadow: 0 4px 16px #f0cf7133;
}

.button-secondary {
  color: #e6f4ec;
  background: #275b4d;
  border-color: #3a7664;
}

.button-danger {
  color: #fff5f2;
  background: #a33b45;
  border-color: #c15b63;
}

.rules-note {
  margin: 24px 0 0;
  color: #a3b2ac;
  font-size: .82rem;
  text-align: center;
}

.error-message {
  max-width: 580px;
  margin: 18px auto;
  padding: 12px 15px;
  border-radius: 9px;
  border: 1px solid #9a4549;
  color: #ffe3df;
  background: #421f24;
}

.game-panel {
  margin-top: 22px;
}

.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 25px;
  border-bottom: 1px solid #e5ebe6;
}

.room-code {
  color: #f1d27b;
  font-size: 2.2rem;
  font-weight: 850;
  letter-spacing: .2em;
}

.copy-code {
  margin-top: 6px;
  padding: 3px 0;
  border: 0;
  color: #e9cd7e;
  background: none;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.game-status {
  color: #c1cdc7;
  text-align: right;
}

.game-status span {
  display: block;
}

.table-surface {
  position: relative;
  overflow: hidden;
  min-height: 390px;
  padding: 28px;
  color: #fff;
  background: radial-gradient(ellipse at center, #1d5945 0%, #123a30 62%, #0c2622 100%);
}

.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 12px;
}

.player-seat {
  display: grid;
  gap: 4px;
  min-height: 85px;
  padding: 12px;
  border: 1px solid #ffffff44;
  border-radius: 12px;
  background: #071d19bb;
}

.player-seat.current-turn {
  border-color: #f2d783;
  box-shadow: 0 0 0 3px #f2d78355, 0 8px 24px #0005;
}

.player-status {
  color: #d3e6dc;
  font-size: .76rem;
}

.board-area, .player-hand {
  margin-top: 24px;
  text-align: center;
}

.pot-label {
  margin-bottom: 12px;
  font-weight: 750;
  transition: color .25s ease, transform .25s ease;
}

.pot-label.pot-increased {
  color: #ffe28a;
  transform: scale(1.12);
}

.cards-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  min-height: 120px;
}

.playing-card {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: clamp(84px, 10vw, 112px);
  height: clamp(122px, 14vw, 162px);
  overflow: hidden;
  border: 2px solid #d8b66d;
  border-radius: 12px;
  color: #e8ca85;
  background:
    radial-gradient(ellipse at 50% 48%, #24211a 0, #10100f 52%, #070808 100%);
  box-shadow: inset 0 0 0 4px #0a0a09, inset 0 0 0 5px #b38d4d, 0 9px 18px #0008;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.playing-card::before {
  position: absolute;
  inset: 5px;
  border: 1px solid #9a7944;
  border-radius: 8px;
  content: "";
  pointer-events: none;
}

.playing-card::after {
  position: absolute;
  inset: 12% 10%;
  border: 1px solid #d4ae6733;
  border-radius: 48% 48% 45% 45%;
  content: "";
  pointer-events: none;
}

.card-corner {
  position: absolute;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 2px;
  line-height: 1;
  color: #ffe4a0;
  text-shadow: 0 1px 2px #000, 0 0 5px #000;
}

.card-corner-top {
  top: 12px;
  left: 12px;
}

.card-corner-bottom {
  right: 12px;
  bottom: 12px;
  transform: rotate(180deg);
}

.card-rank {
  color: #fff0c2;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -.04em;
}

.card-suit {
  color: #f0cf80;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: .9;
}

.card-emblem {
  color: #d7b36c;
  font-size: clamp(3.2rem, 5vw, 5rem);
  line-height: 1;
  text-shadow: 0 2px 0 #523d1d, 0 0 18px #d1a85b44;
}

.playing-card.black-card .card-rank,
.playing-card.black-card .card-suit {
  color: #ffe3a0;
}

.playing-card.red-card .card-rank,
.playing-card.red-card .card-suit,
.playing-card.red-card .card-emblem {
  color: #ff958c;
}

.playing-card.card-deal {
  transform-origin: bottom center;
  animation: card-deal .42s cubic-bezier(.18, .8, .25, 1) both;
}

.chip-effects {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.flying-chip {
  position: absolute;
  z-index: 2;
  display: grid;
  min-width: 46px;
  min-height: 38px;
  padding: 2px 8px;
  place-items: center;
  border: 3px dashed #fff0b0;
  border-radius: 20px;
  color: #543c12;
  background: linear-gradient(135deg, #ffe48c, #d6a53c);
  box-shadow: 0 3px 8px #0008;
  font-size: .82rem;
  font-weight: 900;
  animation: chip-to-pot .65s cubic-bezier(.2, .75, .3, 1) both;
}

.flying-chip.chip-win {
  border-color: #e8ffd2;
  color: #173c20;
  background: linear-gradient(135deg, #c8ff9a, #54bc69);
  animation-name: chip-win-flight;
}

.flying-chip.chip-loss {
  border-color: #ffd5c8;
  color: #4a181b;
  background: linear-gradient(135deg, #ffaaa0, #d6535c);
  animation-name: chip-loss-flight;
}

.red-card {
  color: #ba3636;
}

@keyframes chip-win-flight {
  0% { opacity: 0; transform: translate(0, 0) scale(.5); }
  15% { opacity: 1; }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--chip-x, 0), var(--chip-y, 0)) scale(1.15); }
}

@keyframes chip-loss-flight {
  0% { opacity: 0; transform: translate(0, 0) scale(1); }
  15% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--chip-x, 0), var(--chip-y, 0)) scale(.65); }
}

@keyframes card-deal {
  from { opacity: 0; transform: translateY(-42px) rotateY(90deg) scale(.8); }
  to { opacity: 1; transform: translateY(0) rotateY(0) scale(1); }
}

@keyframes chip-to-pot {
  0% { opacity: 0; transform: translate(0, 0) scale(.5) rotate(-35deg); }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--chip-x, 0), var(--chip-y, 0)) scale(.75) rotate(35deg); }
}

.black-card {
  color: #1e2822;
}

.small-cards {
  justify-content: flex-start;
  min-height: 56px;
  margin-top: 4px;
  gap: 5px;
}

.small-cards .playing-card {
  width: 40px;
  height: 56px;
  border-width: 1px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px #0a0a09, inset 0 0 0 3px #b38d4d, 0 3px 6px #0005;
}

.small-cards .playing-card::before {
  inset: 3px;
  border-radius: 4px;
}

.small-cards .playing-card::after {
  display: none;
}

.small-cards .card-corner-top {
  top: 6px;
  left: 6px;
}

.small-cards .card-corner-bottom {
  right: 6px;
  bottom: 6px;
}

.small-cards .card-rank {
  font-size: .82rem;
}

.small-cards .card-suit {
  font-size: .68rem;
}

.small-cards .card-emblem {
  font-size: 1.55rem;
}

.game-message, .waiting-message {
  margin: 0;
  padding: 12px 24px;
  color: #d3e2d9;
  text-align: center;
}

.table-controls {
  display: flex;
  justify-content: center;
  padding: 16px 24px 24px;
}

.action-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: center;
  gap: 10px;
}

.bet-control {
  width: 170px;
  margin: 0;
}

.bet-control input {
  display: block;
  margin-top: 5px;
}

.site-footer {
  position: static;
  margin-top: 32px;
  padding: 20px 0;
  border-top: 1px solid #293b39;
  color: #aebbb5;
  background: #111a1a;
}

a {
  color: #e9cd7e;
}

a:hover {
  color: #fff0b5;
}

.copy-code {
  min-height: 48px;
  padding: 8px 14px;
  border: 1px solid #77663c;
  border-radius: 10px;
  background: #22261f;
}

.copy-code:hover {
  color: #fff0b5;
  background: #303326;
}

.winner-modal {
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid #d5b66a;
  border-radius: 22px;
  color: #f2efe7;
  background: #141d1d;
  box-shadow: 0 24px 80px #000b;
}

.winner-modal::backdrop {
  background: #030908d9;
  backdrop-filter: blur(5px);
}

.winner-modal[open] {
  animation: winner-enter .28s cubic-bezier(.2, .8, .2, 1) both;
}

.winner-modal-content {
  padding: clamp(28px, 7vw, 44px);
  text-align: center;
}

.winner-modal h2 {
  margin: 0;
  color: #f1d27b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 8vw, 3rem);
}

.winner-message {
  margin: 16px 0 26px;
  color: #d3e2d9;
  font-size: 1.15rem;
}

@keyframes winner-enter {
  from { opacity: 0; transform: translateY(16px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .playing-card.card-deal,
  .flying-chip {
    animation: none !important;
  }
}

.notification-stack {
  position: fixed;
  z-index: 2000;
  top: 20px;
  right: 20px;
  display: grid;
  width: min(440px, calc(100vw - 40px));
  gap: 12px;
  pointer-events: none;
}

.event-toast {
  padding: 18px 20px;
  border: 1px solid #d8bd70;
  border-left: 6px solid #f0cf71;
  border-radius: 12px;
  color: #fff9e9;
  background: #172321f5;
  box-shadow: 0 12px 35px #0009;
  font-size: 1rem;
  font-weight: 700;
  animation: toast-enter .2s ease-out;
}

.event-toast.is-error {
  border-color: #bd5a60;
  border-left-color: #ee777e;
  color: #ffe9e6;
}

.event-toast.is-leaving {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity .25s ease, transform .25s ease;
}

@keyframes toast-enter {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .poker-app {
    margin: 28px auto 50px;
  }

  .site-nav-container {
    min-height: 64px;
  }

  .button {
    min-height: 60px;
    padding: 14px 18px;
    font-size: 1.05rem;
  }

  .join-row .button {
    min-width: 90px;
  }

  .game-topbar {
    padding: 17px;
  }

  .table-surface {
    min-height: 320px;
    padding: 18px 12px;
  }

  .players-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .playing-card {
    width: clamp(62px, 17vw, 82px);
    height: clamp(92px, 25vw, 118px);
  }

  .card-corner-top {
    top: 9px;
    left: 9px;
  }

  .card-corner-bottom {
    right: 9px;
    bottom: 9px;
  }

  .card-rank {
    font-size: 1.45rem;
  }

  .card-suit {
    font-size: 1.05rem;
  }

  .card-emblem {
    font-size: 3rem;
  }

  .small-cards .playing-card {
    width: 34px;
    height: 48px;
  }

  .small-cards .card-emblem {
    font-size: 1.3rem;
  }

  .notification-stack {
    top: 10px;
    right: 10px;
    width: calc(100vw - 20px);
  }

  .event-toast {
    padding: 15px 16px;
  }

  .table-controls {
    padding: 12px;
  }
}