* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --felt: #0b6b3a;
  --felt2: #0a5730;
  --rail: #4a2c14;
  --rail2: #6b4423;
  --gold: #d4af37;
  --gold2: #f0d878;
  --chip: #c0392b;
  --text: #f5f5f5;
  --panel: #12241a;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Segoe UI', system-ui, Arial, sans-serif;
  background: radial-gradient(ellipse at 50% 25%, #144a2a 0%, #0a2e19 40%, #051a0e 72%, #010a05 100%);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

#app {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  position: relative;
  height: 100vh;
  z-index: 1;
}

/* ---------------- BACKGROUND ---------------- */
.casino-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 25%, #144a2a 0%, #0a2e19 40%, #051a0e 72%, #010a05 100%);
}

.vignette {
  display: none;
}

/* ---------------- LOGIN ---------------- */
#login {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 25%, #144a2a 0%, #0a2e19 40%, #051a0e 72%, #010a05 100%);
}

.login-card {
  display: flex;
  align-items: stretch;
  background: linear-gradient(160deg, #173d27, #0c2417);
  color: #f5f5f5;
  width: 680px;
  max-width: 94vw;
  border-radius: 16px;
  overflow: hidden;
  text-align: center;
  border: 1px solid rgba(212, 175, 55, .35);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .04);
  animation: pop .4s cubic-bezier(.2, .9, .3, 1.4);
}

.login-visual {
  flex: 1 1 44%;
  min-width: 0;
}

.login-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.login-content {
  flex: 1 1 56%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 36px;
}

/* stack + drop the image on very narrow screens */
@media (max-width: 560px) {
  .login-card {
    width: 380px;
  }

  .login-visual {
    display: none;
  }
}

@keyframes pop {
  from { transform: scale(.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.suit-row {
  font-size: 30px;
  letter-spacing: 8px;
  color: var(--gold2);
  margin-bottom: 8px;
}

.login-card h2 {
  font-weight: 700;
  font-size: 24px;
  margin: 6px 0 4px;
  color: var(--gold2);
}

.login-card p {
  color: #a7c0b2;
  font-size: 14px;
  margin-bottom: 24px;
}

.field {
  text-align: left;
  margin-bottom: 18px;
}

.field input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 10px;
  font-size: 16px;
  outline: none;
  transition: border .2s;
  background: rgba(0, 0, 0, .25);
  color: #fff;
  text-align: center;
}

.field input::placeholder {
  color: #8aa89a;
}

.field input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, .2);
}

.primary {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  letter-spacing: 1px;
  background: linear-gradient(145deg, var(--gold2), var(--gold));
  color: #3a2a00;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: .15s;
}

.primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* ---------------- MODAL / SPEED BUMP ---------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .26s ease, visibility 0s linear .26s;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .26s ease, visibility 0s linear 0s;
}

.modal-card {
  position: relative;
  background: linear-gradient(160deg, #173d27, #0c2417);
  color: #f5f5f5;
  width: 380px;
  max-width: 90vw;
  border-radius: 16px;
  padding: 30px 30px 26px;
  text-align: center;
  border: 1px solid rgba(212, 175, 55, .4);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .65);
  opacity: 0;
  transform: scale(.88) translateY(6px);
  transition: opacity .26s ease, transform .3s cubic-bezier(.2, .9, .3, 1.35);
}

.modal-overlay.show .modal-card {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.modal-icon {
  font-size: 38px;
  margin-bottom: 6px;
}

.modal-card h3 {
  font-size: 21px;
  font-weight: 700;
  color: var(--gold2);
  margin-bottom: 8px;
}

.modal-card p {
  font-size: 14px;
  color: #bcd;
  line-height: 1.5;
  margin-bottom: 22px;
}

.modal-btns {
  display: flex;
  gap: 12px;
}

.modal-btns button {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: .15s;
  border: none;
}

.modal-cancel {
  background: rgba(255, 255, 255, .12);
  color: #e8f0ea;
  border: 1px solid rgba(255, 255, 255, .2) !important;
}

.modal-cancel:hover {
  background: rgba(255, 255, 255, .2);
}

.modal-ok {
  background: linear-gradient(145deg, var(--gold2), var(--gold));
  color: #3a2a00;
}

.modal-ok:hover {
  filter: brightness(1.08);
}

/* ---------------- TABLE ---------------- */
#game {
  display: none;
  position: relative;
  height: 100vh;
  flex-direction: column;
  padding: 8px 10px 10px;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 14px 6px;
  flex: 0 0 auto;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .5px;
}

.brand b {
  color: var(--gold);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-wrap {
  position: relative;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4285F4, #34A853);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
}

/* dropdown menu (⋮) */
.menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 120;
  display: none;
  flex-direction: column;
  gap: 2px;
  min-width: 234px;
  max-height: 80vh;
  overflow: auto;
  padding: 8px;
  background: linear-gradient(160deg, #173d27, #0c2417);
  border: 1px solid rgba(212, 175, 55, .35);
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .6);
}

.menu-dropdown.open {
  display: flex;
}

.menu-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  font-size: 14px;
}

.menu-blinds {
  font-size: 12px;
  color: #cfe6d8;
  padding: 6px 10px 8px;
}

.menu-blinds b {
  color: var(--gold2);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: none;
  color: #e8f0ea;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background .12s;
}

.menu-item:hover {
  background: rgba(212, 175, 55, .16);
}

.mi-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold2);
}

.mi-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.mi-label {
  flex: 1 1 auto;
}

#btn-logout {
  background: linear-gradient(145deg, var(--gold2), var(--gold));
  color: #3a2a00;
  border: none;
  border-radius: 9px;
  padding: 11px 22px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .3px;
  cursor: pointer;
  transition: .15s;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .35);
}

#btn-logout:hover {
  filter: brightness(1.08);
  color: #3a2a00;
  border: none;
  transform: translateY(-1px);
}

.table-wrap {
  position: relative;
  width: 90%;
  height: 600px;
  flex: 0 0 auto;
  margin: 2px auto 0;
}

.felt {
  position: absolute;
  inset: 2% 5%;
  border-radius: 50% / 50%;
  background: radial-gradient(ellipse at center, var(--felt) 0%, var(--felt2) 78%);
  border: 18px solid var(--rail);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .55), 0 12px 40px rgba(0, 0, 0, .6),
              0 0 0 3px var(--rail2), 0 0 0 6px #2a1810;
}

.felt::after {
  content: "";
  position: absolute;
  inset: 5%;
  border-radius: 50% / 50%;
  border: 2px solid rgba(212, 175, 55, .35);
}

.logo-center {
  position: absolute;
  top: 31%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: rgba(255, 255, 255, .12);
  pointer-events: none;
  user-select: none;
}

.logo-center .l1 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 3px;
}

.logo-center .l2 {
  font-size: 14px;
  letter-spacing: 6px;
}

/* community + pot */
.board {
  position: absolute;
  top: 44%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}

.pot-display {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, .55);
  padding: 8px 26px;
  border-radius: 26px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--gold);
  z-index: 5;
  white-space: nowrap;
  box-shadow: 0 0 22px rgba(212, 175, 55, .45), inset 0 1px 3px rgba(255, 255, 255, .12);
}

.pot-label {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--gold);
  text-transform: uppercase;
}

.pot-value {
  font-size: 30px;
  font-weight: 900;
  color: var(--gold2);
  text-shadow: 0 2px 6px rgba(0, 0, 0, .6), 0 0 14px rgba(212, 175, 55, .5);
}

/* seats */
.seat {
  position: absolute;
  width: 222px;
  transform: translate(-50%, -50%);
  z-index: 6;
  transition: filter .3s;
}

.seat.folded {
  filter: grayscale(.7) opacity(.7);
}

/* $0 / busted player looks disabled */
.seat.busted {
  filter: grayscale(1) opacity(.38);
  pointer-events: none;
  transition: filter .3s, opacity .3s;
}

.seat.busted .p-chips {
  color: #c0392b;
}

.seat.active {
  z-index: 20;
}

.seat.active .player-card {
  transform: scale(1.12);
  box-shadow: 0 0 0 3px var(--gold), 0 0 26px rgba(212, 175, 55, .75);
}

/* winner: enlarged card + crown */
.seat.winner {
  z-index: 30;
}

.seat.winner .player-card {
  transform: scale(1.22);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold), 0 0 30px rgba(212, 175, 55, .85), 0 10px 26px rgba(0, 0, 0, .55);
  animation: winner-pop .45s cubic-bezier(.2, .9, .3, 1.5);
}

@keyframes winner-pop {
  0%   { transform: scale(1); }
  60%  { transform: scale(1.32); }
  100% { transform: scale(1.22); }
}

.crown {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 37px;
  display: none;
  z-index: 2;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5));
  animation: crown-bob 1.6s ease-in-out infinite;
}

.crown svg {
  width: 100%;
  height: 100%;
  display: block;
}

.seat.winner .crown {
  display: block;
}

@keyframes crown-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-4px); }
}

.player-card {
  position: relative;
  background: linear-gradient(160deg, #173d27, #0c2417);
  border-radius: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(212, 175, 55, .35);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .04);
  transition: box-shadow .28s ease, transform .28s cubic-bezier(.2, .8, .3, 1.1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pc-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  flex: 0 0 auto;
  width: auto;
  text-align: center;
}

.p-name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 96px;
}

.p-chips {
  font-size: 16px;
  color: var(--gold2);
  font-weight: 800;
  margin-top: 1px;
}

.p-hand {
  display: flex;
  gap: 5px;
  justify-content: center;
  align-items: center;
  flex: 0 0 auto;
  min-height: 78px;
}

.p-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  margin: 0 auto 3px;
  overflow: hidden;
  border: 2px solid rgba(212, 175, 55, .7);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .45);
}

.p-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.p-action {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #3a2a00;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 10px;
  opacity: 0;
  transition: opacity .2s;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .4);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.p-action.show {
  opacity: 1;
}

.p-action.fold {
  background: #7a7a7a;
  color: #fff;
}

.p-action.win {
  background: #34A853;
  color: #fff;
}

.dealer-btn {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #d8d8d8);
  color: #111;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #999;
  box-shadow: 0 3px 6px rgba(0, 0, 0, .5);
  z-index: 8;
  transition: top .5s, left .5s;
  transform: translate(-50%, -50%);
}

/* bet chips near seat */
.seat-bet {
  position: absolute;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, .55);
  padding: 6px 12px;
  border-radius: 16px;
  z-index: 7;
  border: 1px solid rgba(212, 175, 55, .5);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: opacity .3s;
  white-space: nowrap;
}

.seat-bet::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  --body: #c0392b;
  --edge: #f6f6f6;
  border-radius: 50%;
  display: inline-block;
  background:
    radial-gradient(circle, var(--body) 0 17%, transparent 18% 100%),
    radial-gradient(circle, transparent 0 27%, var(--edge) 27% 33%, transparent 34% 100%),
    radial-gradient(circle, var(--body) 0 66%, transparent 67% 100%),
    repeating-conic-gradient(var(--edge) 0deg 15deg, var(--body) 15deg 30deg);
  box-shadow: 0 2px 3px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(0, 0, 0, .25);
}

/* ---------------- CARDS ---------------- */
.card {
  width: 54px;
  height: 76px;
  border-radius: 7px;
  position: relative;
  background: #fff;
  box-shadow: 0 3px 7px rgba(0, 0, 0, .45);
  font-weight: 700;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px 6px;
  user-select: none;
}

.card.big {
  width: 74px;
  height: 104px;
  padding: 6px 8px;
  border-radius: 9px;
}

.card .r {
  font-size: 20px;
  line-height: 1;
}

.card.big .r {
  font-size: 27px;
}

.card .s-mid {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
}

.card.big .s-mid {
  font-size: 40px;
}

.card .r.bot {
  align-self: flex-end;
  transform: rotate(180deg);
}

.card.red {
  color: #c0392b;
}

.card.black {
  color: #1a1a1a;
}

.card.back {
  background: repeating-linear-gradient(45deg, #1e3a8a, #1e3a8a 6px, #2748a8 6px, #2748a8 12px);
  border: 2px solid #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .4);
}

.card.back::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 3px;
  border: 2px solid rgba(255, 255, 255, .35);
}

/* deal animation */
@keyframes dealIn {
  from { transform: translate(var(--dx), var(--dy)) scale(.5) rotate(-30deg); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.deal {
  animation: dealIn .45s cubic-bezier(.2, .8, .3, 1) both;
}

/* flip animation */
@keyframes flip {
  0%   { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}

.flip {
  animation: flip .35s ease both;
}

/* chip fly to pot */
.fly-chip {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  z-index: 20;
  --body: #c0392b;
  --edge: #f6f6f6;
  pointer-events: none;
  background:
    radial-gradient(circle, var(--body) 0 17%, transparent 18% 100%),
    radial-gradient(circle, transparent 0 27%, var(--edge) 27% 33%, transparent 34% 100%),
    radial-gradient(circle, var(--body) 0 66%, transparent 67% 100%),
    repeating-conic-gradient(var(--edge) 0deg 15deg, var(--body) 15deg 30deg);
  box-shadow: 0 3px 5px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(0, 0, 0, .25);
  transition: transform .55s cubic-bezier(.4, 0, .2, 1), opacity .55s;
}

/* ---------------- CONTROLS ---------------- */
.controls {
  width: 100%;
  margin: 8px auto 0;
  flex: 0 0 auto;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}

.msg {
  text-align: center;
  font-size: 13px;
  color: #bcd;
  min-height: 16px;
}

.msg b {
  color: var(--gold2);
}

.btnrow {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.act {
  padding: 9px 22px;
  border: none;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: .15s;
  min-width: 110px;
  color: #fff;
}

.act:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.act.fold {
  background: linear-gradient(145deg, #c0392b, #922b21);
}

.act.call {
  background: linear-gradient(145deg, #2980b9, #1f618d);
}

.act.raise {
  background: linear-gradient(145deg, #27ae60, #1e8449);
}

.act:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .4);
}

.raiserow {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.raiserow input[type=range] {
  width: 300px;
  accent-color: var(--gold);
}

.raiseval {
  font-weight: 800;
  color: var(--gold2);
  min-width: 70px;
}

.newhand {
  margin: 2px auto 0;
  padding: 10px 30px;
  border: none;
  border-radius: 9px;
  font-weight: 800;
  font-size: 15px;
  background: linear-gradient(145deg, var(--gold2), var(--gold));
  color: #3a2a00;
  cursor: pointer;
  display: none;
}

.newhand:hover {
  filter: brightness(1.08);
}

.quick {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.quick button {
  background: #1c3326;
  border: 1px solid rgba(255, 255, 255, .12);
  color: #cde;
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

.quick button:hover {
  background: #254433;
}

.stage-tag {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, .4);
  text-transform: uppercase;
  z-index: 5;
}

/* ---------------- UTILITIES ---------------- */
#uname {
  font-weight: 600;
}

.you-tag {
  font-size: 11px;
  color: #8aa;
}

#dbtn {
  display: none;
}

#raiseRow {
  display: none;
}

#quickRow {
  display: none;
}

/* ---------------- DIFFICULTY SELECTOR ---------------- */
.diff-label {
  text-align: left;
  font-size: 12px;
  color: #a7c0b2;
  margin: 2px 0 6px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.diff-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.diff-opt {
  flex: 1;
  padding: 10px 4px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(0, 0, 0, .25);
  color: #cfe6d8;
  border: 1px solid rgba(255, 255, 255, .18);
  transition: .15s;
}

.diff-opt:hover {
  border-color: rgba(212, 175, 55, .6);
}

.diff-opt.sel {
  background: linear-gradient(145deg, var(--gold2), var(--gold));
  color: #3a2a00;
  border-color: var(--gold);
}

/* ---------------- TOPBAR ADDITIONS ---------------- */
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .08);
  color: #ffffff;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .15s;
}

.icon-btn svg {
  width: 24px;
  height: 24px;
  display: block;
}

.icon-btn:hover {
  background: rgba(212, 175, 55, .25);
  border-color: var(--gold);
  color: #ffffff;
}

/* live hand-strength readout */
.hand-info {
  text-align: center;
  min-height: 18px;
  font-size: 14px;
  color: #9fd8b6;
}

.hand-info b {
  color: var(--gold2);
  font-size: 15px;
}

/* wide modal + close button */
.modal-card.wide {
  width: 960px;
  max-width: 94vw;
  text-align: left;
}

.x-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.x-close:hover {
  background: rgba(255, 255, 255, .25);
}

/* ---------------- HOW TO PLAY ---------------- */
.howto-card {
  width: 760px;
  max-width: 94vw;
}

.howto-cols {
  display: flex;
  gap: 22px;
  align-items: stretch;
  text-align: left;
}

.howto-left {
  flex: 0 0 400px;
}

.howto-left img {
  width: 100%;
  height: 100%;
  max-height: 60vh;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(212, 175, 55, .35);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
}

.howto-body {
  flex: 1 1 auto;
  min-width: 0;
  max-height: 60vh;
  overflow: auto;
}

.howto-body p {
  font-size: 14px;
  color: #d6e6dc;
  line-height: 1.6;
  margin-bottom: 12px;
  text-align: left;
}

.howto-body h4 {
  color: var(--gold2);
  font-size: 16px;
  margin: 10px 0 8px;
}

.howto-body h4 span {
  color: #8aa89a;
  font-size: 12px;
  font-weight: 400;
}

.rankings {
  list-style: none;
  counter-reset: r;
  margin: 0;
  padding: 0;
}

.rankings li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 7px;
  margin-bottom: 4px;
  background: rgba(0, 0, 0, .22);
}

.rankings .rk {
  font-size: 14px;
  font-weight: 700;
  color: #f0f5f2;
}

.rankings .ex {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  color: #ffd97a;
  letter-spacing: 1px;
}

/* ---------------- STATS GRID ---------------- */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.stat {
  background: rgba(0, 0, 0, .25);
  border: 1px solid rgba(212, 175, 55, .25);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
}

.stat.wide2 {
  grid-column: 1 / span 2;
}

.stat-val {
  font-size: 26px;
  font-weight: 900;
  color: var(--gold2);
}

.stat-key {
  font-size: 12px;
  color: #a7c0b2;
  margin-top: 3px;
  letter-spacing: .5px;
}

/* ---------------- CONFETTI ---------------- */
.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 150;
  overflow: hidden;
}

.confetti-pc {
  position: absolute;
  border-radius: 1px;
  opacity: .95;
  will-change: transform;
  --fall: 120px;
}

@keyframes confetti-drop {
  0%   { transform: translateY(-6px) rotate(0deg); opacity: 0; }
  12%  { opacity: 1; }
  100% { transform: translateY(var(--fall)) rotate(540deg); opacity: .5; }
}

/* ---------------- HAND RESULT MODAL ---------------- */
.result-trophy {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 2px;
}

#result-body {
  margin: 6px 0 20px;
}

.result-row {
  background: rgba(0, 0, 0, .25);
  border: 1px solid rgba(212, 175, 55, .3);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.result-row:last-child {
  margin-bottom: 0;
}

.result-win {
  font-size: 16px;
  font-weight: 700;
  color: #f5f5f5;
}

.result-win .amt {
  color: var(--gold2);
  font-weight: 900;
}

.result-hand {
  font-size: 14px;
  color: #bcd;
  margin-top: 4px;
}

.result-hand b {
  color: var(--gold2);
}

.result-hand .muted {
  color: #8aa89a;
  font-weight: 400;
}

/* SEO intro: crawlable by search engines, hidden from sighted users (game UI replaces it) */
.seo-intro {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ================= ROTATE-TO-LANDSCAPE NOTICE ================= */
#rotate-notice {
  display: none;
}

.rotate-inner {
  max-width: 320px;
  padding: 0 24px;
}

.rotate-phone {
  color: var(--gold2);
  width: 90px;
  margin: 0 auto 20px;
  animation: rotate-hint 2.4s ease-in-out infinite;
}

.rotate-phone svg {
  width: 100%;
  height: auto;
  display: block;
}

.rotate-phone .rotate-arrow {
  stroke: var(--gold);
}

@keyframes rotate-hint {
  0%, 45%   { transform: rotate(0deg); }
  70%, 100% { transform: rotate(-90deg); }
}

#rotate-notice h2 {
  font-size: 22px;
  color: var(--gold2);
  margin-bottom: 10px;
}

#rotate-notice p {
  font-size: 14px;
  line-height: 1.5;
  color: #bcd;
}

/* ================= MOBILE — PORTRAIT (block play) ================= */
@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
  #rotate-notice {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(ellipse at 50% 25%, #144a2a 0%, #0a2e19 40%, #051a0e 72%, #010a05 100%);
  }

  #app {
    display: none !important;
  }
}

/* ================= MOBILE — LANDSCAPE (compact play layout) ================= */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) {
  #game {
    padding: 3px 6px 5px;
  }

  /* --- top bar --- */
  .topbar {
    padding: 2px 6px 3px;
  }

  .brand {
    font-size: 13px;
  }

  .topbar-right {
    gap: 8px;
  }

  .icon-btn {
    width: 30px;
    height: 30px;
  }

  .icon-btn svg {
    width: 17px;
    height: 17px;
  }

  #btn-logout {
    padding: 6px 12px;
    font-size: 12px;
  }

  /* --- table --- */
  .table-wrap {
    width: 84%;
    height: auto;
    flex: 1 1 auto;
    min-height: 0;
    margin: 2px auto 0;
  }

  .felt {
    border-width: 10px;
  }

  .logo-center {
    display: none;
  }

  .seat {
    width: 128px;
  }

  .player-card {
    padding: 4px 6px;
    border-radius: 9px;
    gap: 5px;
  }

  .p-avatar {
    width: 30px;
    height: 30px;
    margin-bottom: 2px;
  }

  .p-name {
    font-size: 11px;
    max-width: 62px;
  }

  .p-chips {
    font-size: 11px;
  }

  .p-hand {
    min-height: 0;
    gap: 3px;
  }

  .p-action {
    font-size: 9px;
    padding: 1px 7px;
    top: -12px;
  }

  .card {
    width: 30px;
    height: 42px;
    border-radius: 4px;
    padding: 2px 3px;
  }

  .card .r {
    font-size: 12px;
  }

  .card .s-mid {
    font-size: 15px;
  }

  .card.big {
    width: 56px;
    height: 71px;
    padding: 3px 4px;
    border-radius: 5px;
  }

  .card.big .r {
    font-size: 14px;
  }

  .card.big .s-mid {
    font-size: 19px;
  }

  .pot-display {
    padding: 4px 14px;
    gap: 6px;
  }

  .pot-label {
    font-size: 9px;
    letter-spacing: 2px;
  }

  .pot-value {
    font-size: 18px;
  }

  .seat-bet {
    font-size: 16px;
    padding: 3px 8px;
  }

  .seat-bet::before {
    width: 12px;
    height: 12px;
  }

  .dealer-btn {
    width: 18px;
    height: 18px;
    font-size: 8px;
    border-width: 1px;
  }

  .stage-tag {
    font-size: 9px;
    letter-spacing: 2px;
  }

  /* --- compact action bar --- */
  .controls {
    position: absolute;
    right: 10px;
    bottom: 16px;
    z-index: 40;
    width: 340px;
    max-width: 58vw;
    margin: 0;
    padding: 5px 10px;
    gap: 4px;
    border-radius: 10px;
  }

  .hand-info {
    font-size: 11px;
    min-height: 0;
  }

  .hand-info b {
    font-size: 12px;
  }

  .msg {
    font-size: 11px;
    min-height: 0;
  }

  .btnrow {
    gap: 6px;
  }

  .act {
    padding: 7px 16px;
    font-size: 13px;
    min-width: 78px;
    border-radius: 8px;
  }

  .raiserow {
    gap: 8px;
  }

  .raiserow input[type=range] {
    width: 44vw;
    max-width: 260px;
  }

  .raiseval {
    font-size: 12px;
    min-width: 46px;
  }

  .quick {
    gap: 6px;
  }

  .quick button {
    padding: 4px 9px;
    font-size: 11px;
  }

  .newhand {
    padding: 7px 22px;
    font-size: 13px;
  }
}
