* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: #c45c28;
  color: #2b2118;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Helvetica Neue", sans-serif;
}
body {
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior: none;
  background:
    radial-gradient(120% 55% at 50% -8%, #ffe7c8 0%, transparent 52%),
    linear-gradient(165deg, #f6c99a 0%, #ef8d4c 46%, #c45c28 100%);
}
button, input { font-family: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible {
  outline: 3px solid #ff8a3d;
  outline-offset: 2px;
}
[hidden] { display: none !important; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.app {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
  overflow: auto;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.table {
  flex: 1;
  min-height: 280px;
  margin: calc(8px + env(safe-area-inset-top)) 12px 0;
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  border: 3px solid #ff8a3d;
  background-color: #fff6ee;
  background-image: radial-gradient(rgba(255, 138, 61, .16) 1.15px, transparent 1.25px);
  background-size: 14px 14px;
  box-shadow: 0 8px 0 #b24e1c;
}

.toprow {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 6px;
  align-items: start;
}
.tool {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: #e06a22;
  box-shadow: 0 3px 0 #f0c2a4;
  display: grid;
  place-items: center;
  padding: 0;
}
.tool .mp-icon { width: 22px; height: 22px; }
.tool:active { transform: translateY(2px); box-shadow: 0 1px 0 #f0c2a4; }
.tool.flat { box-shadow: none; background: #fff1e4; }

.seat {
  min-width: 0;
  background: rgba(255, 255, 255, .9);
  border-radius: 16px;
  padding: 6px 6px 4px;
}
.toprow .seat { justify-self: center; width: 100%; max-width: 220px; }
.seat.bank { box-shadow: inset 0 0 0 2px #f6c453; }
.who { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.who-txt { min-width: 0; }
.who-name { font-size: 14px; font-weight: 800; line-height: 1.2; }
.who-sub, .seat-hand {
  font-size: 12px;
  font-weight: 700;
  color: #8a6a52;
  line-height: 1.3;
}
.seat-hand { min-height: 16px; text-align: center; margin-top: 3px; }
.seat-hand.win { color: #e06a22; }
.seat-hand.lose { color: #c4483a; }

.av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: #ff8a3d;
  overflow: hidden;
}
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av.bank { background: #e0a322; color: #5a3a10; }
.av.tiger { background: #e07a22; }
.av.deer { background: #1f9d62; }

.cards { display: flex; justify-content: center; gap: 4px; min-height: 54px; }
.cards .slot,
.cards .poker { width: 38px; height: 54px; }
.cards.lg { gap: 8px; margin-top: 8px; min-height: 118px; }
.cards.lg .slot,
.cards.lg .poker { width: 72px; height: 102px; }

.slot {
  border-radius: 8px;
  border: 1.5px dashed rgba(255, 138, 61, .55);
  background: rgba(255, 138, 61, .08);
}
.cards.lg .slot { border-radius: 12px; }

.poker {
  display: block;
  position: relative;
  perspective: 700px;
}
.poker-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform .4s ease;
}
.poker.up .poker-inner { transform: rotateY(180deg); }
.poker-back, .poker-face {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}
.cards.lg .poker-back,
.cards.lg .poker-face { border-radius: 12px; }
.poker-back {
  background: #ff8a3d;
  border: 2px solid #fff6ec;
  color: #fff6ec;
  display: flex;
  align-items: center;
  justify-content: center;
}
.poker-back .mp-icon { width: 16px; height: 16px; }
.cards.lg .poker-back .mp-icon { width: 26px; height: 26px; }
.poker-face {
  transform: rotateY(180deg);
  background: #fffdfb;
  border: 1px solid #f0e0d2;
}
.poker-face.red { color: #e1262d; }
.poker-face.black { color: #231c18; }
.c1, .c2 {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  font-weight: 800;
}
.c1 { top: 3px; left: 3px; }
.c2 { right: 3px; bottom: 3px; transform: rotate(180deg); }
.c1 b, .c2 b { font-size: 11px; }
.c1 em, .c2 em { font-style: normal; font-size: 9px; }
.cards.lg .c1 b, .cards.lg .c2 b { font-size: 15px; }
.cards.lg .c1 em, .cards.lg .c2 em { font-size: 12px; }
.poker-face.ten .c1 b, .poker-face.ten .c2 b { font-size: 9px; }
.cards.lg .poker-face.ten .c1 b, .cards.lg .poker-face.ten .c2 b { font-size: 12px; }
.suitchar { font-style: normal; line-height: 1; }
.pips { position: absolute; inset: 0; }
.cards:not(.lg) .pips { display: none; }
.pip { position: absolute; font-size: 14px; line-height: 1; }
.pips.solo .pip { font-size: 32px; }
.midmark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.cards.lg .midmark:not(.face) { display: none; }
.midmark.face {
  position: absolute;
  inset: 16px 6px;
  border-radius: 8px;
  background: #ffe8d4;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cards:not(.lg) .midmark.face { inset: 12px 3px; }
.midmark.face .mp-icon { width: 14px; height: 14px; }
.cards.lg .midmark.face .mp-icon { width: 28px; height: 28px; }
.poker.in { animation: fly .3s ease both; }
@keyframes fly {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: none; }
}

.mid {
  position: relative;
  flex: 1;
  min-height: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 8px 4px;
}
.brand {
  position: absolute;
  font-size: 48px;
  font-weight: 900;
  color: rgba(255, 138, 61, .18);
  pointer-events: none;
}
.odds {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #a56b45;
}
.status {
  position: relative;
  z-index: 1;
  margin: 0;
  background: #ff8a3d;
  color: #fffaf5;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  border-radius: 999px;
  padding: 8px 14px;
}
.result {
  position: relative;
  z-index: 2;
  width: min(100%, 240px);
  background: #fffdfb;
  border-radius: 16px;
  padding: 10px 12px;
  border: 2px solid #ffe0c8;
}
.result.win { border-color: #f6c453; }
.result.lose { border-color: #f3c2ba; }
.result .kicker { font-size: 12px; font-weight: 800; color: #8a6a52; }
.result .main { font-size: 26px; font-weight: 900; line-height: 1.15; margin: 2px 0; }
.result.win .main { color: #e06a22; }
.result.lose .main { color: #c4483a; }
.result .sub { font-size: 13px; font-weight: 700; color: #5c4636; line-height: 1.4; }

.burst { position: absolute; inset: 0; pointer-events: none; }
.burst i {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 8px;
  height: 8px;
  margin: -4px;
  border-radius: 2px;
  background: #ff8a3d;
  opacity: 0;
}
.burst.go i { animation: shoot .6s ease forwards; }
@keyframes shoot {
  0% { opacity: 1; transform: rotate(var(--a)) translateY(0); }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(70px); }
}

.rivals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dock {
  margin: 10px 12px 12px;
  padding: 12px;
  background: #fff8f1;
  border-radius: 20px;
}
.me { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.me-id {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2b2118;
  text-align: left;
  min-width: 0;
}
.me-id .av { width: 36px; height: 36px; font-size: 16px; }
.me-txt { display: flex; flex-direction: column; min-width: 0; }
.me-name {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  max-width: 8em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.me-sub { font-size: 12px; font-weight: 700; color: #8a6a52; }
.me-id .mp-icon { width: 16px; height: 16px; color: #d0a184; }
.purse {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  color: #e06a22;
}
.purse .mp-icon { width: 18px; height: 18px; }
.purse b { font-size: 16px; color: #2b2118; }
.delta {
  position: absolute;
  right: 4px;
  top: -16px;
  font-size: 13px;
  font-weight: 900;
}
.delta.plus { color: #e06a22; }
.delta.minus { color: #c4483a; }

.my-hand {
  margin-top: 6px;
  min-height: 24px;
  text-align: center;
  font-size: 16px;
  font-weight: 900;
}
.my-hand.hot { color: #e06a22; }
.stake {
  margin: 4px 0 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #8a6a52;
}
.bets {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.bets.frozen { opacity: .55; }
.bet {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: #5c4636;
  font-size: 14px;
  font-weight: 800;
}
.bet.on {
  background: #ff8a3d;
  color: #fffaf5;
}
.bet:disabled { cursor: default; }
.act {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  background: #ff8a3d;
  color: #fffaf5;
  font-size: 18px;
  font-weight: 900;
}
.act:disabled { background: #e7c3aa; color: #fff; }
.act:active { transform: translateY(1px); }

.mask {
  position: fixed;
  inset: 0;
  background: rgba(60, 24, 8, .45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 5;
  padding: 12px;
}
.sheet {
  width: min(100%, 440px);
  max-height: 82vh;
  overflow: auto;
  background: #fff8f1;
  border-radius: 20px;
  padding: 14px 14px 18px;
}
.sheet-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sheet-hd h2 { margin: 0; font-size: 18px; }
.rules h3 { margin: 12px 0 4px; font-size: 15px; }
.rules p, .rules li, .hint { font-size: 14px; line-height: 1.5; color: #5c4636; }
.rules ol { margin: 0; padding-left: 18px; }
.hint { margin: 8px 0 10px; }
input {
  width: 100%;
  min-height: 48px;
  border: 2px solid #ffd3b0;
  border-radius: 12px;
  padding: 0 12px;
  font-size: 16px;
  background: #fff;
  color: #2b2118;
}
.row2 { display: flex; gap: 8px; margin-top: 12px; }
.ghost {
  flex: 1;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: #e06a22;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.row2 .act { flex: 1; width: auto; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #2b2118;
  color: #fff8f1;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  z-index: 6;
  max-width: 86vw;
}
