:root {
  font-family: 'DM Sans', system-ui, sans-serif;
  color: #e7eee9;
  background: #09151d;
  font-synthesis: none;
  color-scheme: dark;
  --muted: #899b9e;
  --green: #a9e9ba;
  --line: #27373e;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 35%, #162e34 0, transparent 65%), #09151d;
  min-height: 100vh;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 18px;
  background: #1d3038;
  color: #e7eee9;
  font-weight: 600;
  transition:
    background 0.2s,
    transform 0.2s;
}
button:hover:enabled {
  background: #2b444c;
  transform: translateY(-1px);
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button.primary {
  background: var(--green);
  color: #102b23;
  border-color: var(--green);
}
button.primary:hover:enabled {
  background: #c5f4d1;
}
button.danger {
  color: #f0b4ac;
}
button.small {
  font-size: 12px;
  padding: 7px 10px;
}
button.ghost {
  background: transparent;
}
a {
  color: inherit;
  text-decoration: none;
}
input,
select {
  width: 100%;
  background: #0f2029;
  color: #ecf2ef;
  padding: 12px;
  border: 1px solid #34464d;
  border-radius: 8px;
  outline: none;
}
input:focus,
select:focus,
button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
label {
  display: block;
  font-size: 12px;
  color: #a7b9bb;
  margin: 0 0 7px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2,
h3,
.brand {
  font-family: 'Manrope', system-ui, sans-serif;
}
h1 {
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.12;
  letter-spacing: -2px;
  margin-bottom: 17px;
}
h2 {
  font-size: 22px;
  letter-spacing: -0.6px;
}
p {
  line-height: 1.6;
  color: var(--muted);
}
.app {
  max-width: 1180px;
  margin: auto;
  padding: 0 30px;
}
header {
  height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 3px;
}
.brand-mark {
  color: var(--green);
  font-size: 34px;
  letter-spacing: 0;
}
.brand-tag {
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
  border-left: 1px solid #405056;
  padding-left: 14px;
  margin-left: 7px;
}
.header-right {
  display: flex;
  gap: 18px;
  align-items: center;
}
.language {
  background: transparent;
  padding: 7px 10px;
  font-size: 11px;
  letter-spacing: 1px;
}
#wallet {
  font-size: 13px;
  color: var(--green);
}
#notice {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  max-width: 90%;
  background: #303b3e;
  border: 1px solid #6a7b7b;
  padding: 14px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 50px #0006;
  display: none;
}
#notice.error {
  border-color: #d88a7c;
  color: #ffd1c7;
}
.hero {
  padding: 54px 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}
.eyebrow {
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 15px;
}
.hero p {
  max-width: 470px;
  font-size: 14px;
  margin-bottom: 0;
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 8px;
}
.hero-art {
  font-size: 100px;
  line-height: 1;
  color: #a9e9ba16;
  transform: rotate(-15deg);
  margin-right: 50px;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 17px 0 20px;
  gap: 15px;
}
.toolbar h2 {
  margin: 0;
}
.toolbar-actions {
  display: flex;
  gap: 10px;
}
.panel {
  border: 1px solid var(--line);
  background: #12232c;
  border-radius: 16px;
  padding: 25px;
}
.table-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 17px;
}
.room-card {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(150deg, #192e36, #10212a);
  position: relative;
  overflow: hidden;
}
.room-card:before {
  content: '♠';
  position: absolute;
  right: 15px;
  top: 8px;
  font-size: 95px;
  color: #ffffff04;
  pointer-events: none;
}
.room-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
}
.pill {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 5px 7px;
  border: 1px solid #345044;
  border-radius: 5px;
  color: var(--green);
}
.room-card h3 {
  font-size: 18px;
  margin: 0 0 7px;
}
.room-card p {
  font-size: 12px;
  margin-bottom: 23px;
}
.room-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.room-meta span {
  font-size: 12px;
  color: var(--muted);
}
.empty {
  padding: 45px;
  text-align: center;
  color: var(--muted);
  grid-column: 1/-1;
}
.feature-line {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin: 40px 0;
  color: #72898e;
  font-size: 11px;
}
.auth {
  max-width: 480px;
  margin: 70px auto;
  text-align: center;
}
.auth .brand-mark {
  font-size: 60px;
}
.auth h1 {
  font-size: 35px;
}
.auth p {
  font-size: 14px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}
.field.full {
  grid-column: 1/-1;
}
.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 23px;
}
.form-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}
.form-heading h2 {
  margin: 0;
}
.form-wrap {
  max-width: 650px;
  margin: 35px auto;
}
.hint {
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0 0;
}
.table-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 0 5px;
  gap: 12px;
}
.table-heading h2 {
  margin: 0 0 5px;
}
.table-heading p {
  font-size: 12px;
  margin: 0;
}
.connection {
  font-size: 10px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.table-stage {
  position: relative;
  height: 490px;
  max-width: 950px;
  margin: 10px auto 0;
}
.felt {
  position: absolute;
  inset: 65px 95px 75px;
  border-radius: 180px;
  border: 10px solid #233f42;
  box-shadow:
    0 0 0 2px #385255,
    0 16px 50px #0007,
    inset 0 0 60px #061b16aa;
  background: radial-gradient(ellipse, #225445, #123b31);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.felt:before {
  content: '';
  position: absolute;
  inset: 9px;
  border: 1px solid #bdebc526;
  border-radius: 160px;
  pointer-events: none;
}
.felt-brand {
  font-size: 10px;
  letter-spacing: 5px;
  color: #a0cdb44a;
  font-weight: 800;
  margin-bottom: 18px;
}
.board {
  display: flex;
  gap: 7px;
  min-height: 66px;
}
.card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 64px;
  border-radius: 6px;
  background: #f0f1e8;
  color: #192b35;
  box-shadow: 0 2px 6px #0004;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.1;
}
.card.red {
  color: #b44646;
}
.card .suit {
  font-size: 20px;
}
.card.back {
  background: repeating-linear-gradient(
    45deg,
    #253b52,
    #253b52 3px,
    #304961 3px,
    #304961 5px
  );
  border: 3px solid #e6ece5;
  color: transparent;
}
.card.blank {
  background: #163f34;
  box-shadow: none;
  border: 1px solid #82ae8e30;
}
.pot {
  font-size: 13px;
  color: #b9d5c6;
  margin-top: 16px;
}
.pot strong {
  color: #eaf5e9;
  font-size: 19px;
  margin-left: 7px;
}
.phase {
  font-size: 9px;
  color: #99b6a4;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 7px;
}
.seat {
  position: absolute;
  width: 145px;
  text-align: center;
  z-index: 2;
}
.seat.s0 {
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
}
.seat.s1 {
  left: 0;
  bottom: 95px;
}
.seat.s2 {
  left: 0;
  top: 45px;
}
.seat.s3 {
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}
.seat.s4 {
  right: 0;
  top: 45px;
}
.seat.s5 {
  right: 0;
  bottom: 95px;
}
.avatar {
  width: 39px;
  height: 39px;
  margin: 0 auto -8px;
  background: #2b4147;
  border: 2px solid #4b6668;
  position: relative;
  z-index: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 3px 8px #0004;
}
.seat.active .avatar {
  border-color: var(--green);
  box-shadow: 0 0 0 4px #a9e9ba22;
}
.seat-body {
  border: 1px solid #3a5256;
  border-radius: 9px;
  background: #14282f;
  padding: 13px 8px 8px;
  position: relative;
}
.seat.active .seat-body {
  border-color: var(--green);
}
.seat.folded {
  opacity: 0.5;
}
.seat-name {
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.seat-stack {
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  margin-top: 3px;
}
.seat-action {
  font-size: 9px;
  color: #8ba6a6;
  height: 13px;
  margin-top: 4px;
}
.seat-cards {
  display: flex;
  gap: 3px;
  justify-content: center;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 5px;
}
.seat-cards .card {
  width: 28px;
  height: 38px;
  font-size: 13px;
  border-radius: 4px;
}
.seat-cards .suit {
  font-size: 12px;
}
.seat.s3 .seat-cards,
.seat.s2 .seat-cards,
.seat.s4 .seat-cards {
  bottom: auto;
  top: 100%;
  margin: 4px 0 0;
}
.seat.empty-seat {
  color: #557279;
  font-size: 11px;
  border: 1px dashed #38535a;
  border-radius: 10px;
  padding: 14px;
  width: 105px;
}
.dealer {
  position: absolute;
  right: -8px;
  top: -8px;
  border-radius: 50%;
  background: #e5dfc0;
  color: #283332;
  font-size: 9px;
  font-weight: 800;
  width: 19px;
  height: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bet {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  color: #e0cc8e;
  font-size: 10px;
  white-space: nowrap;
  padding-top: 4px;
}
.seat.s0 .bet,
.seat.s1 .bet,
.seat.s5 .bet {
  top: auto;
  bottom: 100%;
  padding-bottom: 6px;
  left: 100%;
}
.clock {
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: #33474c;
  margin-top: 6px;
}
.clock i {
  display: block;
  background: var(--green);
  height: 100%;
  transition: width 0.2s;
}
.table-bottom {
  max-width: 850px;
  margin: 12px auto;
}
.action-panel {
  padding: 19px 22px;
  background: #14262e;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.action-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  margin-bottom: 16px;
  color: #b8c9c7;
}
.actions {
  display: flex;
  gap: 9px;
  align-items: end;
}
.actions > button {
  flex: 1;
}
.raise-group {
  display: flex;
  gap: 8px;
  align-items: end;
  flex: 2;
}
.raise-group .field {
  flex: 1;
}
.raise-group input {
  padding: 11px;
  min-width: 0;
}
.raise-group button {
  flex: 1;
}
.table-utilities {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 17px 0;
  color: var(--muted);
  font-size: 11px;
}
.table-utilities .spacer {
  flex: 1;
}
.join-bar {
  display: flex;
  align-items: end;
  gap: 12px;
}
.join-bar .field {
  flex: 1;
}
.winner {
  color: #e8d498 !important;
}
.history {
  font-size: 11px;
  color: var(--muted);
  padding: 12px 0;
  line-height: 1.6;
}
.history p {
  margin: 0;
  font-size: 11px;
}
footer {
  text-align: center;
  color: #536e77;
  font-size: 10px;
  letter-spacing: 0.4px;
  padding: 26px 0;
  border-top: 1px solid #20333b;
  margin-top: 35px;
}
.invite {
  color: #c7decf;
  font-size: 11px;
}
.pending {
  padding: 10px 0;
  font-size: 12px;
  color: #e0cc8e;
}
.auth button {
  width: 100%;
  margin-top: 12px;
}
.auth label {
  text-align: left;
}
.back-link {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
  display: inline-block;
}
.muted {
  color: var(--muted);
}
@media (min-width: 1000px) {
  .room-card {
    min-height: 217px;
  }
}
@media (max-width: 800px) {
  .table-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .app {
    padding: 0 20px;
  }
  .hero-art {
    margin-right: 0;
    font-size: 80px;
  }
  .table-stage {
    height: 460px;
  }
  .felt {
    inset: 70px 55px 70px;
  }
  .seat {
    width: 120px;
  }
  .seat.s1,
  .seat.s5 {
    bottom: 90px;
  }
  .seat.s2,
  .seat.s4 {
    top: 45px;
  }
  .actions {
    flex-wrap: wrap;
  }
  .raise-group {
    min-width: 240px;
  }
}
@media (max-width: 520px) {
  .app {
    padding: 0 16px;
  }
  header {
    height: 74px;
  }
  .brand {
    font-size: 22px;
  }
  .brand-tag {
    display: none;
  }
  .header-right {
    gap: 10px;
  }
  #wallet {
    font-size: 11px;
  }
  .hero {
    padding: 33px 0 23px;
  }
  .hero-art {
    display: none;
  }
  h1 {
    letter-spacing: -1.5px;
    font-size: 37px;
  }
  .hero p {
    font-size: 12px;
  }
  .toolbar {
    align-items: start;
  }
  .toolbar h2 {
    font-size: 18px;
    padding-top: 7px;
  }
  .toolbar-actions {
    gap: 6px;
  }
  .toolbar-actions button {
    font-size: 11px;
    padding: 10px;
  }
  .table-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .room-card {
    padding: 19px;
  }
  .room-top {
    margin-bottom: 17px;
  }
  .room-card p {
    margin-bottom: 17px;
  }
  .feature-line {
    font-size: 9px;
    gap: 14px;
    margin: 27px 0;
  }
  .panel {
    padding: 20px;
  }
  .form-grid {
    gap: 14px;
  }
  .form-grid .field {
    grid-column: 1/-1;
  }
  .table-heading {
    padding-top: 19px;
  }
  .table-heading h2 {
    font-size: 18px;
  }
  .table-heading p {
    font-size: 10px;
  }
  .table-stage {
    height: 470px;
    margin-top: 16px;
  }
  .felt {
    inset: 55px 25px 75px;
    border-width: 7px;
    border-radius: 130px;
  }
  .seat {
    width: 98px;
  }
  .seat.s0 {
    bottom: 0;
  }
  .seat.s1 {
    left: -5px;
    bottom: 110px;
  }
  .seat.s2 {
    left: -5px;
    top: 55px;
  }
  .seat.s3 {
    top: -5px;
  }
  .seat.s4 {
    right: -5px;
    top: 55px;
  }
  .seat.s5 {
    right: -5px;
    bottom: 110px;
  }
  .avatar {
    width: 31px;
    height: 31px;
    font-size: 11px;
  }
  .seat-body {
    padding: 12px 5px 5px;
  }
  .seat-name {
    font-size: 10px;
  }
  .seat-stack {
    font-size: 11px;
  }
  .seat.empty-seat {
    width: 77px;
    font-size: 9px;
    padding: 12px 4px;
  }
  .board {
    gap: 4px;
    min-height: 49px;
  }
  .card {
    width: 30px;
    height: 45px;
    font-size: 16px;
    border-radius: 4px;
  }
  .card .suit {
    font-size: 16px;
  }
  .felt-brand {
    font-size: 8px;
    letter-spacing: 3px;
    margin-bottom: 12px;
  }
  .pot {
    margin-top: 11px;
    font-size: 10px;
  }
  .pot strong {
    font-size: 17px;
  }
  .phase {
    font-size: 8px;
  }
  .seat-cards .card {
    width: 24px;
    height: 32px;
    font-size: 11px;
  }
  .seat-cards .suit {
    font-size: 11px;
  }
  .seat.s1 .bet {
    left: 85%;
  }
  .seat.s5 .bet {
    left: 10%;
  }
  .table-bottom {
    margin-top: 0;
  }
  .action-panel {
    padding: 15px;
  }
  .actions {
    gap: 7px;
  }
  .actions > button {
    font-size: 12px;
    padding: 12px 6px;
  }
  .raise-group {
    flex-basis: 100%;
    margin-top: 7px;
  }
  .raise-group label {
    font-size: 10px;
  }
  .table-utilities button {
    font-size: 10px;
    padding: 8px;
  }
  .connection {
    font-size: 9px;
  }
  .join-bar button {
    padding: 12px;
  }
  .auth {
    margin: 45px auto;
  }
  .table-heading .small {
    font-size: 10px;
  }
  .history {
    padding: 5px 0;
  }
  footer {
    margin-top: 22px;
  }
  .seat-action {
    font-size: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

body {
  padding-top: max(
    env(safe-area-inset-top, 0px),
    var(--tg-safe-area-inset-top, 0px)
  );
  padding-bottom: max(
    env(safe-area-inset-bottom, 0px),
    var(--tg-safe-area-inset-bottom, 0px)
  );
}
.app {
  padding-top: var(--tg-content-safe-area-inset-top, 0px);
  padding-bottom: var(--tg-content-safe-area-inset-bottom, 0px);
}
.toolbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.telegram-link {
  color: var(--green);
  font-weight: 600;
}
