:root {
  --bg: #03070f;
  --panel: rgba(4, 12, 24, 0.92);
  --panel-2: rgba(8, 19, 36, 0.96);
  --gold: #ffd773;
  --gold-2: #b46c13;
  --blue: #16a4ff;
  --red: #ff453a;
  --green: #20d466;
  --purple: #b64cff;
  --cyan: #34e5ff;
  --text: #f8fbff;
  --muted: #9fb4cc;
  --line: rgba(108, 190, 255, 0.34);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  touch-action: manipulation;
  overscroll-behavior: none;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  background:
    radial-gradient(circle at 50% 8%, rgba(239, 49, 41, 0.22), transparent 26rem),
    radial-gradient(circle at 10% 40%, rgba(31, 137, 255, 0.24), transparent 18rem),
    linear-gradient(160deg, #02040a 0%, #071423 48%, #02050c 100%);
  overflow-x: hidden;
}

button {
  color: inherit;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.app-shell {
  min-height: 100svh;
  display: grid;
  place-items: start center;
  padding: 10px 10px calc(12px + var(--safe-bottom));
  position: relative;
  isolation: isolate;
}

.title-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 12px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 72, 42, 0.28), transparent 24rem),
    radial-gradient(circle at 40% 48%, rgba(31, 151, 255, 0.24), transparent 19rem),
    rgba(1, 4, 10, 0.96);
}

.title-overlay.hidden {
  display: none;
}

.title-card {
  width: min(100%, 430px);
  min-height: min(780px, calc(100svh - 24px));
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 18px;
  border-radius: 28px;
  border: 1px solid rgba(255, 215, 104, 0.58);
  background:
    linear-gradient(180deg, rgba(5, 10, 20, 0.2), rgba(3, 6, 12, 0.98) 78%),
    radial-gradient(circle at 50% 21%, rgba(255, 213, 98, 0.22), transparent 24%),
    radial-gradient(circle at 28% 40%, rgba(20, 116, 255, 0.32), transparent 28%),
    radial-gradient(circle at 75% 42%, rgba(255, 55, 45, 0.28), transparent 30%),
    linear-gradient(120deg, rgba(12, 83, 164, 0.7), rgba(95, 10, 10, 0.72));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), inset 0 0 46px rgba(255, 195, 67, 0.12);
  position: relative;
  overflow: hidden;
}

.title-card::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 68, 42, 0.28), transparent 21%),
    radial-gradient(circle at 46% 42%, rgba(118, 64, 255, 0.2), transparent 24%),
    linear-gradient(68deg, transparent 48%, rgba(255, 216, 110, 0.24) 49%, transparent 51%),
    linear-gradient(112deg, transparent 46%, rgba(41, 185, 255, 0.22) 47%, transparent 49%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 34px);
  animation: titleFlow 12s linear infinite;
}

.title-card::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 236, 159, 0.24);
  border-radius: 20px;
  pointer-events: none;
  box-shadow: inset 0 0 34px rgba(40, 176, 255, 0.12);
  z-index: 0;
}

@keyframes titleFlow {
  from { transform: translate3d(-4%, -2%, 0); }
  to { transform: translate3d(4%, 2%, 0); }
}

.broadcast-badge,
.title-kicker,
.title-card h1,
.title-card p,
.title-character,
.title-showcase,
.challenge-card,
.title-start,
.title-sub {
  position: relative;
  z-index: 1;
}

.title-kicker {
  align-self: end;
  justify-self: start;
  width: max-content;
  max-width: calc(100% - 158px);
  padding: 7px 18px;
  border: 1px solid rgba(255, 216, 112, 0.56);
  border-radius: 999px;
  color: #fff4c6;
  background: linear-gradient(90deg, transparent, rgba(255, 216, 112, 0.16), transparent);
  font-size: 12px;
  font-weight: 950;
  text-align: center;
}

.broadcast-badge {
  justify-self: end;
  align-self: start;
  position: absolute;
  top: 18px;
  right: 18px;
  max-width: 150px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 211, 99, 0.62);
  border-radius: 8px;
  color: #ffe49b;
  background: rgba(84, 21, 12, 0.72);
  font-size: 12px;
  font-weight: 950;
}

.title-card h1 {
  margin: 0;
  color: #ffd96e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 9.8vw, 54px);
  line-height: 1.04;
  letter-spacing: 0;
  word-break: keep-all;
  text-shadow: 0 3px 0 #4c2300, 0 0 25px rgba(255, 208, 75, 0.52);
  text-align: left;
}

.title-card h1 small {
  display: block;
  margin-bottom: 2px;
  color: #ffffff;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 950;
  text-shadow: 0 0 18px rgba(52, 229, 255, 0.72);
}

.title-card h1 span {
  color: #ff4b39;
}

.title-card p {
  margin: 0;
  color: #fff1bf;
  font-weight: 950;
  font-size: 18px;
}

.title-character {
  position: absolute;
  z-index: 2;
  right: 10px;
  bottom: 326px;
  width: min(24vw, 94px);
  display: block;
  border-radius: 18px;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.52));
  animation: characterPulse 3.6s ease-in-out infinite;
}

@keyframes characterPulse {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(0, -4px, 0) scale(1.02); }
}

.story-card-title {
  position: relative;
  z-index: 1;
  padding: 10px 12px;
  border: 1px solid rgba(255, 216, 112, 0.42);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(5, 12, 23, 0.86), rgba(80, 11, 15, 0.76)),
    radial-gradient(circle at 12% 50%, rgba(255, 216, 112, 0.2), transparent 48%);
  box-shadow: inset 0 0 18px rgba(255, 195, 67, 0.1);
}

.story-card-title strong,
.story-card-title span {
  display: block;
}

.story-card-title strong {
  color: #ffe39a;
  font-size: 14px;
  font-weight: 950;
}

.story-card-title span {
  margin-top: 3px;
  color: #e8f5ff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
}

.title-showcase {
  height: 148px;
  position: relative;
  margin: 4px 0 -2px;
  border: 1px solid rgba(69, 177, 255, 0.32);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 216, 112, 0.22), transparent 38%),
    linear-gradient(90deg, rgba(6, 43, 91, 0.8), rgba(93, 12, 17, 0.8)),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 18px);
  overflow: hidden;
  box-shadow: inset 0 0 24px rgba(42, 167, 255, 0.12);
}

.title-showcase-copy {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  min-width: 232px;
  padding: 3px 10px;
  border: 1px solid rgba(255, 216, 112, 0.42);
  border-radius: 999px;
  color: #ffe39a;
  background: rgba(0, 0, 0, 0.48);
  font-size: 10px;
  font-weight: 950;
  text-align: center;
}

.title-showcase::before {
  content: "PLAYER  BANKER";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 10px;
  color: rgba(255, 244, 207, 0.34);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 950;
  letter-spacing: 0;
  text-align: center;
  word-spacing: 38px;
}

.show-card {
  position: absolute;
  width: 76px;
  height: 106px;
  top: 18px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #fff, #dfe1da);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.42);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 950;
}

.show-card span {
  position: absolute;
  top: 7px;
  left: 8px;
  font-size: 20px;
}

.show-card b {
  font-size: 46px;
}

.card-blue {
  left: 70px;
  color: #121820;
  transform: rotate(-8deg);
}

.card-red {
  right: 70px;
  color: #c5211d;
  transform: rotate(8deg);
}

.show-chip {
  position: absolute;
  bottom: 18px;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 5px dashed rgba(255, 255, 255, 0.82);
  color: #10131a;
  font-size: 13px;
  font-weight: 950;
  box-shadow: 0 9px 18px rgba(0, 0, 0, 0.38);
}

.title-achievement-mini {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 7px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(255, 216, 112, 0.42);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.42);
}

.title-achievement-mini span {
  color: #9edaff;
  font-size: 12px;
  font-weight: 950;
}

.title-achievement-mini strong {
  color: #ffe097;
  font-size: 15px;
}

.title-achievement-mini small {
  min-width: 0;
  color: #dbeeff;
  font-size: 11px;
  font-weight: 900;
  text-align: right;
}

.chip-a {
  left: 26px;
  background: radial-gradient(circle, #fff 0 38%, #0a55ac 39% 44%, #1896ff 45%);
}

.chip-b {
  right: 26px;
  background: radial-gradient(circle, #fff8df 0 38%, #a5650a 39% 44%, #e9a12e 45%);
}

.challenge-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 18px;
}

.challenge-card div {
  min-height: 66px;
  display: grid;
  place-items: center;
  padding: 8px 5px;
  border: 1px solid rgba(255, 216, 104, 0.42);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.56);
  text-align: center;
}

.challenge-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.challenge-card strong {
  color: #ffe7a0;
  font-size: 13px;
}

.title-start,
.title-sub {
  min-height: 62px;
  border: 1px solid rgba(255, 224, 123, 0.82);
  color: #ffe89b;
  font-weight: 950;
}

.title-start {
  clip-path: polygon(7% 0, 93% 0, 100% 50%, 93% 100%, 7% 100%, 0 50%);
  background: linear-gradient(135deg, rgba(139, 28, 20, 0.98), rgba(110, 30, 126, 0.98));
  font-size: 28px;
  text-shadow: 0 2px 0 #210000;
}

.title-sub {
  min-height: 48px;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(18, 74, 37, 0.96), rgba(5, 20, 12, 0.96));
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 54px);
  mask-image: linear-gradient(to bottom, transparent, black 12%, black 88%, transparent);
}

.game-frame {
  width: min(100%, 430px);
  min-height: calc(100svh - 20px);
  padding: 12px 12px calc(88px + var(--safe-bottom));
  border: 1px solid rgba(255, 216, 112, 0.42);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(10, 20, 38, 0.86), rgba(3, 8, 15, 0.96)),
    radial-gradient(circle at 50% 20%, rgba(255, 46, 37, 0.12), transparent 42%);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(48, 199, 255, 0.16),
    inset 0 0 42px rgba(28, 113, 255, 0.13);
  position: relative;
  overflow: hidden;
}

.game-frame::before,
.game-frame::after {
  content: "";
  position: absolute;
  left: -12%;
  right: -12%;
  height: 220px;
  pointer-events: none;
}

.game-frame::before {
  top: 70px;
  background:
    linear-gradient(105deg, transparent 9%, rgba(27, 153, 255, 0.16) 10%, transparent 12%),
    linear-gradient(74deg, transparent 55%, rgba(255, 55, 41, 0.2) 56%, transparent 58%);
  filter: blur(0.5px);
}

.game-frame::after {
  bottom: 120px;
  background:
    linear-gradient(92deg, transparent 28%, rgba(255, 211, 104, 0.2) 29%, transparent 31%),
    linear-gradient(115deg, transparent 62%, rgba(151, 79, 255, 0.18) 63%, transparent 65%);
}

.topbar,
.bankroll-panel,
.status-strip,
.table-stage,
.bet-board,
.chip-deck,
.bet-control,
.confirm-button,
.road-panel,
.bottom-nav {
  position: relative;
  z-index: 1;
}

.topbar {
  display: grid;
  grid-template-columns: 46px 1fr 60px;
  gap: 8px;
  align-items: center;
}

.icon-button,
.mission-button {
  border: 1px solid rgba(99, 189, 255, 0.48);
  background: linear-gradient(180deg, rgba(20, 36, 62, 0.96), rgba(7, 14, 26, 0.96));
  box-shadow: 0 0 18px rgba(31, 157, 255, 0.18), inset 0 0 16px rgba(38, 146, 255, 0.2);
  min-height: 44px;
  border-radius: 9px;
}

.icon-button {
  display: grid;
  gap: 4px;
  justify-items: center;
  align-content: center;
}

.icon-button span {
  width: 20px;
  height: 3px;
  border-radius: 4px;
  background: #d7ecff;
}

.mission-button {
  display: grid;
  place-items: center;
  gap: 0;
  font-size: 18px;
}

.mission-button small {
  font-size: 9px;
  color: var(--gold);
  line-height: 1;
}

.mission-tag {
  min-height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 200, 88, 0.52);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(31, 17, 8, 0.95), rgba(7, 12, 22, 0.96)),
    linear-gradient(90deg, transparent, rgba(255, 211, 94, 0.16), transparent);
  box-shadow: inset 0 0 18px rgba(255, 173, 36, 0.15);
  text-align: center;
}

.mission-tag span {
  color: var(--gold);
  font-weight: 900;
  letter-spacing: 0;
  font-size: 14px;
}

.mission-tag strong {
  color: #ffffff;
  font-size: 11px;
  letter-spacing: 0;
}

.mission-tag em {
  color: #94d9ff;
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
}

.bankroll-panel {
  margin-top: 10px;
  padding: 12px 12px 10px;
  text-align: center;
  border: 1px solid rgba(255, 212, 103, 0.45);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(16, 16, 20, 0.98), rgba(8, 12, 19, 0.96)),
    radial-gradient(circle at 50% 0, rgba(255, 205, 80, 0.18), transparent 70%);
  box-shadow: inset 0 0 24px rgba(255, 180, 42, 0.1), 0 0 24px rgba(0, 0, 0, 0.28);
}

.label,
.goal-row span,
.current-bet span,
.status-strip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.money {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 10.4vw, 48px);
  font-weight: 900;
  line-height: 1.05;
  text-shadow: 0 2px 0 #522d00, 0 0 16px rgba(255, 214, 115, 0.32);
}

.goal-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  align-items: baseline;
  margin-top: 4px;
}

.goal-row strong {
  color: #ffe7a2;
  font-size: 16px;
}

.progress-track {
  margin-top: 8px;
  height: 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.progress-fill {
  width: 1%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #158cff, #37e6ff, #ffd773);
  box-shadow: 0 0 18px rgba(54, 216, 255, 0.45);
  transition: width 420ms ease;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 8px 0;
}

.story-status {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  gap: 6px;
  margin: -1px 0 8px;
}

.story-status div {
  min-height: 46px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 6px 4px;
  border: 1px solid rgba(255, 82, 67, 0.34);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(41, 10, 9, 0.86), rgba(4, 10, 20, 0.84));
  text-align: center;
  box-shadow: inset 0 0 14px rgba(255, 74, 56, 0.08);
}

.story-status span {
  color: #ffb7ae;
  font-size: 9px;
  font-weight: 900;
}

.story-status strong {
  color: #fff0c2;
  font-size: 11px;
  font-weight: 950;
  line-height: 1.2;
}

.status-strip div {
  min-height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(35, 148, 255, 0.42);
  border-radius: 8px;
  background: rgba(4, 14, 30, 0.76);
}

.status-strip strong {
  color: var(--gold);
  font-size: 20px;
}

.table-stage {
  min-height: 244px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  align-items: center;
  padding: 12px 8px;
  border: 1px solid rgba(55, 168, 255, 0.42);
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(9, 54, 117, 0.55), rgba(12, 8, 14, 0.8) 50%, rgba(120, 10, 10, 0.58)),
    radial-gradient(circle at 50% 45%, rgba(255, 215, 94, 0.2), transparent 33%);
  overflow: hidden;
}

.table-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 49.6%, rgba(255, 255, 255, 0.2), transparent 50.4%),
    radial-gradient(circle at 50% 48%, rgba(255, 80, 45, 0.2), transparent 23%);
  pointer-events: none;
}

.hand-zone {
  display: grid;
  gap: 8px;
  align-content: center;
  min-width: 0;
}

.hand-zone h2 {
  margin: 0;
  text-align: center;
  font-size: 17px;
  letter-spacing: 0;
}

.player-zone h2 {
  color: #51b8ff;
}

.banker-zone h2 {
  color: #ff7068;
}

.cards {
  min-height: 118px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(2px, 0.7vw, 5px);
  perspective: 900px;
  width: 100%;
}

.playing-card,
.card-placeholder {
  width: clamp(43px, 12.9vw, 62px);
  height: clamp(67px, 20vw, 94px);
  border-radius: 9px;
  flex: 0 0 auto;
}

.card-placeholder {
  display: grid;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  color: rgba(216, 235, 255, 0.35);
  background: rgba(0, 0, 0, 0.18);
  font-size: 10px;
  font-weight: 900;
}

.playing-card {
  position: relative;
  overflow: hidden;
  color: #11161f;
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 255, 255, 0.95), transparent 34%),
    linear-gradient(145deg, #ffffff 0%, #f2f3f0 56%, #d7d8d1 100%);
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.38),
    inset 0 0 0 1px rgba(0, 0, 0, 0.08),
    inset 0 -8px 20px rgba(0, 0, 0, 0.08);
  transform-style: preserve-3d;
}

.playing-card.just-dealt {
  animation: cardDeal 420ms cubic-bezier(.2,.9,.25,1.2);
}

@keyframes cardDeal {
  from {
    transform: translate3d(42px, -28px, 0) rotateZ(9deg) rotateY(68deg);
    opacity: 0;
  }
  to {
    transform: translate3d(0, 0, 0) rotateZ(0) rotateY(0);
    opacity: 1;
  }
}

.playing-card.red {
  color: #b91618;
}

.playing-card.black {
  color: #151a22;
}

.playing-card.back {
  color: #f6d484;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 214, 113, 0.2), transparent 36%),
    linear-gradient(135deg, rgba(255, 215, 102, 0.16), transparent 28%, rgba(31, 147, 255, 0.16)),
    repeating-linear-gradient(45deg, #071225 0 5px, #0c1d38 5px 10px);
  border-color: rgba(255, 216, 111, 0.66);
}

.playing-card.revealed {
  animation: cardFlip 340ms ease-out;
}

@keyframes cardFlip {
  from { transform: rotateY(74deg) scale(0.96); }
  to { transform: rotateY(0) scale(1); }
}

.card-back-inner {
  position: absolute;
  inset: 7px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 216, 112, 0.54);
  border-radius: 7px;
  background:
    radial-gradient(circle, rgba(255, 216, 112, 0.18), transparent 48%),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.05) 0 2px, transparent 2px 8px);
}

.card-back-inner span {
  transform: rotate(-90deg);
  color: rgba(255, 232, 168, 0.68);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
}

.card-back-inner b {
  position: absolute;
  font-size: 32px;
  opacity: 0.42;
}

.corner {
  position: absolute;
  display: grid;
  justify-items: center;
  line-height: 0.9;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 950;
}

.corner b {
  font-size: 15px;
}

.corner span {
  font-size: 15px;
}

.corner.top {
  top: 5px;
  left: 6px;
}

.corner.bottom {
  right: 6px;
  bottom: 5px;
  transform: rotate(180deg);
}

.card-pips {
  position: absolute;
  inset: 20px 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(5, 1fr);
  align-items: center;
  justify-items: center;
  font-size: clamp(11px, 3vw, 15px);
}

.pip {
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.55));
}

.ace {
  grid-column: 1 / 4;
  grid-row: 2 / 5;
  font-size: clamp(32px, 8.8vw, 42px);
  align-self: center;
}

.p1 { grid-column: 2; grid-row: 1; }
.p2 { grid-column: 2; grid-row: 5; transform: rotate(180deg); }
.p3 { grid-column: 2; grid-row: 3; }
.p4 { grid-column: 1; grid-row: 1; }
.p5 { grid-column: 3; grid-row: 5; transform: rotate(180deg); }
.p6 { grid-column: 3; grid-row: 1; }
.p7 { grid-column: 1; grid-row: 5; transform: rotate(180deg); }
.p8 { grid-column: 1; grid-row: 3; }
.p9 { grid-column: 3; grid-row: 3; }
.p10 { grid-column: 2; grid-row: 4; transform: rotate(180deg); }

.court {
  grid-column: 1 / 4;
  grid-row: 1 / 4;
  align-self: end;
  font-size: clamp(28px, 8vw, 38px);
  opacity: 0.9;
}

.card-pips strong {
  grid-column: 1 / 4;
  grid-row: 3 / 5;
  align-self: center;
  color: inherit;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  letter-spacing: 0;
}

.card-pips em {
  grid-column: 1 / 4;
  grid-row: 4 / 6;
  align-self: start;
  font-style: normal;
  font-size: clamp(22px, 6.2vw, 30px);
  transform: rotate(180deg);
  opacity: 0.72;
}

.score {
  place-self: center;
  min-width: 54px;
  padding: 2px 14px;
  border-radius: 5px;
  border: 1px solid currentColor;
  text-align: center;
  font-size: 22px;
  font-weight: 900;
  background: rgba(0, 0, 0, 0.4);
}

.player-zone .score {
  color: #62c5ff;
}

.banker-zone .score {
  color: #ff776f;
}

.result-seal {
  position: absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%);
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  padding: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 210, 104, 0.84);
  background:
    radial-gradient(circle, rgba(255, 214, 103, 0.25), transparent 58%),
    linear-gradient(180deg, rgba(41, 25, 6, 0.96), rgba(3, 6, 12, 0.98));
  box-shadow: 0 0 28px rgba(255, 187, 53, 0.34), inset 0 0 18px rgba(255, 225, 132, 0.18);
  text-align: center;
  z-index: 2;
}

.result-seal span {
  color: #f3cf76;
  font-size: 12px;
}

.result-seal strong {
  color: #fff0bf;
  font-size: 16px;
  line-height: 1.1;
}

.guide-character {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 92px;
  height: 112px;
  z-index: 3;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.dealer-message {
  grid-column: 1 / -1;
  justify-self: center;
  min-height: 28px;
  display: grid;
  place-items: center;
  padding: 4px 14px;
  border: 1px solid rgba(255, 216, 112, 0.38);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.44);
  color: #ffe6a1;
  font-size: 12px;
  font-weight: 900;
}

.guide-character img {
  width: 110px;
  max-width: none;
  border-radius: 20px;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.5));
  mask-image: radial-gradient(circle at 50% 36%, black 0 58%, transparent 82%);
}

.guide-character span {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(4, 10, 20, 0.92);
  border: 1px solid rgba(255, 216, 105, 0.45);
  color: #ffe7a7;
  font-size: 9px;
  line-height: 1.2;
  text-align: center;
}

.bet-board {
  margin-top: 8px;
}

.main-bets,
.side-bets {
  display: grid;
  gap: 6px;
}

.main-bets {
  grid-template-columns: 1fr 0.76fr 1fr;
}

.side-bets {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 6px;
}

.bet-tile,
.side-tile {
  min-height: 68px;
  display: grid;
  place-items: center;
  gap: 0;
  padding: 8px 5px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(4, 10, 18, 0.82);
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.06), 0 8px 18px rgba(0, 0, 0, 0.24);
  font-weight: 900;
  position: relative;
  overflow: hidden;
}

.bet-tile::before,
.side-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.42;
}

.bet-tile span,
.side-tile span,
.bet-tile small,
.side-tile small,
.bet-tile b,
.side-tile b {
  position: relative;
  z-index: 1;
}

.bet-tile span {
  font-size: 20px;
}

.bet-tile small,
.side-tile small {
  color: #fff3c8;
  font-size: 12px;
}

.bet-tile b,
.side-tile b {
  min-height: 18px;
  color: var(--gold);
  font-size: 13px;
}

.player {
  color: #dff3ff;
  border-color: rgba(41, 161, 255, 0.72);
}

.player::before {
  background: linear-gradient(135deg, #053776, #0d8aff);
}

.banker {
  color: #fff1ee;
  border-color: rgba(255, 87, 73, 0.75);
}

.banker::before {
  background: linear-gradient(135deg, #6e0d0a, #ff3129);
}

.tie {
  color: #eaffef;
  border-color: rgba(61, 255, 114, 0.7);
}

.tie::before {
  background: linear-gradient(135deg, #044916, #18ce55);
}

.side-tile {
  min-height: 54px;
}

.side-tile span {
  font-size: 13px;
}

.big {
  border-color: rgba(255, 193, 62, 0.75);
}

.big::before {
  background: linear-gradient(135deg, #5c3500, #ffb829);
}

.small {
  border-color: rgba(198, 80, 255, 0.78);
}

.small::before {
  background: linear-gradient(135deg, #2e0f4e, #a833ff);
}

.pair {
  border-color: rgba(56, 235, 229, 0.72);
}

.pair::before {
  background: linear-gradient(135deg, #073b45, #21c6cb);
}

.player-pair {
  border-color: rgba(41, 161, 255, 0.72);
}

.player-pair::before {
  background: linear-gradient(135deg, #052f66, #11a4ff);
}

.banker-pair {
  border-color: rgba(255, 87, 73, 0.75);
}

.banker-pair::before {
  background: linear-gradient(135deg, #6e0d0a, #ff453a);
}

.bet-tile.active,
.side-tile.active {
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(255, 216, 108, 0.28), inset 0 0 20px rgba(255, 255, 255, 0.12);
}

.chip-deck {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.chip {
  width: 100%;
  max-width: 62px;
  justify-self: center;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 5px dashed rgba(255, 255, 255, 0.82);
  background: radial-gradient(circle, #eeeeee 0 38%, #1c1f26 39% 44%, #d9d9d9 45%);
  color: #111823;
  font-weight: 950;
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.34);
}

.chip.green {
  background: radial-gradient(circle, #ffffff 0 38%, #148235 39% 44%, #2fbc55 45%);
}

.chip.blue {
  background: radial-gradient(circle, #ffffff 0 38%, #0a55ac 39% 44%, #1896ff 45%);
}

.chip.purple {
  background: radial-gradient(circle, #ffffff 0 38%, #6930a7 39% 44%, #b66aff 45%);
}

.chip.gold {
  background: radial-gradient(circle, #fff8df 0 38%, #a5650a 39% 44%, #e9a12e 45%);
}

.chip.selected {
  outline: 3px solid rgba(255, 222, 123, 0.92);
  box-shadow: 0 0 22px rgba(255, 219, 107, 0.5);
}

.bet-control {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 64px 44px 1fr 44px 76px;
  gap: 6px;
  align-items: center;
}

.power-controls {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 6px;
  margin-top: 8px;
}

.all-in-control,
.story-control {
  min-height: 50px;
  border: 1px solid rgba(255, 224, 122, 0.76);
  border-radius: 8px;
  color: #fff1c4;
  font-weight: 950;
}

.all-in-control {
  background:
    linear-gradient(135deg, rgba(119, 11, 11, 0.96), rgba(210, 44, 34, 0.96), rgba(106, 22, 120, 0.96)),
    radial-gradient(circle at 50% 0, rgba(255, 222, 117, 0.28), transparent 58%);
  box-shadow: 0 0 22px rgba(255, 75, 52, 0.28), inset 0 0 18px rgba(255, 215, 92, 0.16);
  text-shadow: 0 2px 0 rgba(30, 0, 0, 0.72);
}

.all-in-control span,
.all-in-control small {
  display: block;
}

.all-in-control span {
  font-size: 19px;
  line-height: 1.05;
}

.all-in-control small {
  margin-top: 2px;
  color: #ffe7a4;
  font-size: 10px;
}

.story-control {
  background: linear-gradient(180deg, rgba(15, 51, 88, 0.96), rgba(5, 12, 22, 0.96));
  font-size: 14px;
}

.bet-tile.selected-target,
.side-tile.selected-target {
  outline: 2px solid rgba(255, 241, 171, 0.9);
  outline-offset: 2px;
}

.mini-control,
.round-control {
  min-height: 42px;
  border: 1px solid rgba(255, 213, 107, 0.45);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(38, 30, 18, 0.95), rgba(8, 10, 14, 0.95));
  box-shadow: inset 0 0 14px rgba(255, 211, 102, 0.12);
  font-weight: 900;
}

.round-control {
  border-radius: 50%;
  font-size: 22px;
}

.current-bet {
  min-height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 213, 107, 0.36);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.38);
}

.current-bet strong {
  color: var(--gold);
  font-size: 20px;
}

.confirm-button {
  width: 100%;
  min-height: 70px;
  margin-top: 8px;
  border: 1px solid rgba(255, 224, 122, 0.82);
  clip-path: polygon(7% 0, 93% 0, 100% 50%, 93% 100%, 7% 100%, 0 50%);
  background:
    linear-gradient(135deg, rgba(93, 23, 16, 0.98), rgba(158, 39, 31, 0.98) 44%, rgba(105, 35, 126, 0.98)),
    radial-gradient(circle at 50% 0, rgba(255, 222, 117, 0.32), transparent 58%);
  box-shadow: 0 0 28px rgba(255, 75, 52, 0.34), inset 0 0 25px rgba(255, 215, 92, 0.22);
  color: #ffe89b;
  font-weight: 950;
  text-shadow: 0 2px 0 rgba(30, 0, 0, 0.72);
}

.confirm-button span {
  display: block;
  font-size: clamp(26px, 8vw, 36px);
  line-height: 1;
}

.confirm-button small {
  color: #fff8dc;
  font-size: 12px;
}

.confirm-button:disabled {
  filter: grayscale(0.8);
  opacity: 0.62;
}

.road-panel {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 216, 111, 0.32);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.38);
}

.road-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.road-title span {
  color: #ffe7a4;
  font-size: 12px;
  font-weight: 900;
}

.road-title button {
  border: 1px solid rgba(255, 216, 111, 0.4);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  color: #ffe9b0;
  font-size: 11px;
}

.road {
  min-height: 28px;
  display: flex;
  gap: 4px;
  overflow: hidden;
}

.road-dot {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.road-dot.P {
  background: #1168c8;
}

.road-dot.B {
  background: #bf2420;
}

.road-dot.T {
  background: #1d9340;
}

.bottom-nav {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(12px + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  border: 1px solid rgba(255, 216, 107, 0.34);
  border-radius: 11px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.76);
}

.nav-item {
  min-height: 58px;
  display: grid;
  place-items: center;
  border: 0;
  background: linear-gradient(180deg, rgba(25, 32, 44, 0.94), rgba(4, 7, 12, 0.96));
  color: #e9eef8;
  font-weight: 900;
}

.nav-item span {
  font-size: 24px;
  line-height: 1;
}

.nav-item small {
  font-size: 10px;
}

.nav-item.active {
  color: #ffe49a;
  background:
    radial-gradient(circle at 50% 0, rgba(167, 67, 255, 0.42), transparent 70%),
    linear-gradient(180deg, rgba(32, 60, 111, 0.98), rgba(7, 12, 21, 0.98));
}

.panel-drawer,
.squeeze-overlay,
.ending-overlay,
.result-overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: end center;
  z-index: 20;
  padding: 10px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.panel-drawer.open,
.squeeze-overlay.open,
.ending-overlay.open,
.result-overlay.open {
  display: grid;
}

.drawer-card,
.squeeze-card-panel,
.ending-card,
.result-card {
  width: min(100%, 430px);
  max-height: calc(100svh - 24px);
  overflow: auto;
  border: 1px solid rgba(255, 216, 106, 0.52);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(9, 20, 36, 0.98), rgba(3, 7, 14, 0.98));
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.64), inset 0 0 28px rgba(54, 171, 255, 0.12);
}

.drawer-card {
  padding: 18px;
  position: relative;
}

.close-button {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(0, 0, 0, 0.38);
  font-size: 24px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.tab-panel h2,
.ending-card h1 {
  margin: 0 42px 12px 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
}

.tab-panel p {
  color: #d9e7f7;
  line-height: 1.75;
  margin: 0 0 14px;
  font-weight: 700;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.info-grid div,
.rule-list div,
.history-item,
.chart-card {
  border: 1px solid rgba(73, 171, 255, 0.34);
  border-radius: 8px;
  background: rgba(3, 10, 21, 0.78);
  padding: 10px;
}

.info-grid span,
.rule-list span,
.history-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.info-grid strong,
.rule-list strong {
  color: #ffe4a0;
  font-size: 20px;
}

.rule-list {
  display: grid;
  gap: 8px;
}

.rule-list strong {
  display: block;
  font-size: 16px;
}

.history-list {
  display: grid;
  gap: 8px;
}

.road-dashboard {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.road-card-main {
  padding: 10px;
  border: 1px solid rgba(73, 171, 255, 0.34);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(5, 16, 32, 0.9), rgba(2, 6, 13, 0.9)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 24px);
}

.road-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.road-head strong {
  color: #ffe09a;
  font-size: 15px;
}

.road-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.big-road-grid,
.bead-plate {
  display: grid;
  grid-template-rows: repeat(6, 24px);
  grid-auto-flow: column;
  grid-auto-columns: 24px;
  gap: 2px;
  overflow-x: auto;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background:
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(255,255,255,0.08) 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(255,255,255,0.08) 23px 24px),
    rgba(1, 8, 17, 0.82);
}

.road-cell,
.bead-cell {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 950;
  position: relative;
}

.road-cell.empty,
.bead-cell.empty {
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.road-cell.P,
.bead-cell.P {
  background: #1168c8;
  box-shadow: 0 0 10px rgba(24, 142, 255, 0.42);
}

.road-cell.B,
.bead-cell.B {
  background: #bf2420;
  box-shadow: 0 0 10px rgba(255, 64, 54, 0.42);
}

.road-cell.T,
.bead-cell.T {
  background: #1d9340;
  box-shadow: 0 0 10px rgba(36, 220, 100, 0.42);
}

.road-cell.tie::after {
  content: "";
  position: absolute;
  width: 130%;
  height: 3px;
  border-radius: 3px;
  background: #1ff06a;
  transform: rotate(-42deg);
  box-shadow: 0 0 8px rgba(31, 240, 106, 0.72);
}

.road-cell .tie-count {
  position: absolute;
  right: -4px;
  top: -5px;
  min-width: 12px;
  height: 12px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #0d2817;
  color: #baffcb;
  border: 1px solid rgba(31, 240, 106, 0.65);
  font-size: 8px;
}

.road-cell.pair::before,
.bead-cell.pair::before {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffda73;
  box-shadow: 0 0 6px rgba(255, 218, 115, 0.8);
}

.road-cell.natural,
.bead-cell.natural {
  outline: 2px solid rgba(255, 216, 112, 0.65);
}

.achievement-progress {
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 216, 112, 0.38);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.34);
}

.achievement-progress span {
  display: block;
  color: #ffe5a5;
  font-weight: 950;
  margin-bottom: 8px;
}

.achievement-progress div {
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.1);
}

.achievement-progress i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #178bff, #32e6ff, #ffd773);
  box-shadow: 0 0 18px rgba(54, 216, 255, 0.42);
  transition: width 300ms ease;
}

.achievement-grid {
  display: grid;
  gap: 8px;
}

.achievement-item {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 9px;
  align-items: center;
  min-height: 58px;
  padding: 9px;
  border: 1px solid rgba(73, 171, 255, 0.3);
  border-radius: 10px;
  background: rgba(3, 10, 21, 0.72);
}

.achievement-item > div:not(.badge-icon) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.achievement-item .badge-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #09111b;
  background: linear-gradient(180deg, #ffeaa6, #bd7815);
  font-size: 18px;
  font-weight: 950;
}

.achievement-item.locked {
  opacity: 0.56;
  filter: saturate(0.4);
}

.achievement-item strong {
  display: block;
  color: #fff2c8;
  font-size: 14px;
  line-height: 1.25;
}

.achievement-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.achievement-item em {
  color: #ffe49d;
  font-style: normal;
  font-size: 11px;
  font-weight: 950;
}

.trend-strip {
  display: flex;
  gap: 5px;
  min-height: 30px;
  overflow-x: auto;
}

.trend-chip {
  flex: 0 0 auto;
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.trend-chip.P { background: rgba(17, 104, 200, 0.95); }
.trend-chip.B { background: rgba(191, 36, 32, 0.95); }
.trend-chip.T { background: rgba(29, 147, 64, 0.95); }

.history-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 8px;
  align-items: center;
}

.history-item strong {
  color: #fff;
}

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

.history-item .loss {
  color: #ff8179;
}

.history-item .win {
  color: #79ff9d;
}

.chart-title {
  color: #ffe1a0;
  font-weight: 900;
  margin-bottom: 8px;
}

.sparkline {
  height: 120px;
  display: flex;
  align-items: end;
  gap: 3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
}

.spark-bar {
  flex: 1;
  min-width: 3px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #3ee7ff, #106de8);
}

.danger-soft {
  width: 100%;
  margin-top: 14px;
  min-height: 48px;
  border: 1px solid rgba(255, 80, 68, 0.5);
  border-radius: 8px;
  background: rgba(100, 10, 8, 0.42);
  color: #ffe2df;
  font-weight: 900;
}

.setting-row {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(73, 171, 255, 0.34);
  border-radius: 8px;
  background: rgba(3, 10, 21, 0.78);
}

.setting-row span {
  color: #dceeff;
  font-weight: 900;
}

.toggle {
  min-width: 70px;
  min-height: 34px;
  border: 1px solid rgba(255, 216, 107, 0.44);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: var(--muted);
  font-weight: 950;
}

.toggle.active {
  color: #07101a;
  background: linear-gradient(180deg, #ffe594, #c9811e);
}

.squeeze-card-panel {
  padding: 14px;
}

.squeeze-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.squeeze-top span {
  color: #8fd3ff;
  font-weight: 950;
}

.squeeze-top strong {
  color: var(--gold);
  font-size: 22px;
}

.squeeze-top small {
  justify-self: end;
  color: var(--muted);
}

.squeeze-table {
  min-height: 330px;
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 216, 107, 0.35);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 56, 54, 0.22), transparent 42%),
    linear-gradient(180deg, rgba(7, 13, 26, 0.95), rgba(0, 0, 0, 0.9));
}

.squeeze-card {
  width: 190px;
  height: 270px;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  transform: perspective(900px) rotateX(8deg);
  border: 1px solid rgba(255, 214, 105, 0.72);
  background:
    repeating-linear-gradient(45deg, #071226 0 10px, #0d1d35 10px 20px),
    linear-gradient(135deg, rgba(255, 216, 112, 0.18), transparent 40%);
  box-shadow: 0 24px 42px rgba(0, 0, 0, 0.46), 0 0 32px rgba(142, 65, 255, 0.32);
}

.card-back-art {
  position: absolute;
  inset: 12px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 216, 112, 0.55);
  border-radius: 12px;
  color: rgba(255, 216, 112, 0.75);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
  letter-spacing: 0;
}

.peek,
.open-face {
  position: absolute;
  display: none;
  background: #f7f7f2;
  color: #10141b;
}

.peek.vertical {
  left: 0;
  right: 0;
  top: 0;
  height: 42px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.peek.horizontal {
  top: 0;
  bottom: 0;
  right: 0;
  width: 48px;
  border-left: 1px solid rgba(0, 0, 0, 0.2);
}

.peek.visible {
  display: grid;
  place-items: center;
}

.peek .pip-row {
  display: flex;
  gap: 14px;
  font-size: 24px;
}

.peek.red {
  color: #cd1f1b;
}

.open-face {
  inset: 0;
  place-items: center;
  font-size: 82px;
  font-weight: 950;
}

.open-face.visible {
  display: grid;
}

.open-face small {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 34px;
  line-height: 1;
}

.open-face.red {
  color: #c91e1a;
}

.finger-mask {
  position: absolute;
  display: none;
  width: 74px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f2c1a5, #a9664f);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.36);
  opacity: 0.94;
}

.finger-mask.one {
  left: -18px;
  top: -8px;
  transform: rotate(-22deg);
}

.finger-mask.two {
  right: -18px;
  bottom: 18px;
  transform: rotate(20deg);
}

.squeeze-card.peeking .finger-mask {
  display: block;
}

.tension-meter {
  width: min(100%, 260px);
  height: 28px;
  border: 1px solid rgba(255, 82, 139, 0.64);
  border-radius: 999px;
  padding: 4px;
  position: relative;
  overflow: hidden;
}

.tension-meter div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #208cff, #ff3b8a, #ffd773);
  box-shadow: 0 0 18px rgba(255, 58, 135, 0.5);
  transition: width 260ms ease;
}

.tension-meter span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffe7f0;
  font-size: 12px;
  font-weight: 900;
}

.squeeze-hint {
  min-height: 48px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #ffe9aa;
  font-weight: 900;
}

.squeeze-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.squeeze-actions button,
.ending-actions button {
  min-height: 50px;
  border: 1px solid rgba(255, 216, 106, 0.48);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(25, 45, 72, 0.96), rgba(8, 12, 18, 0.96));
  color: #fff1c4;
  font-weight: 950;
}

.ending-overlay {
  place-items: center;
}

.result-overlay {
  place-items: center;
}

.fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 35;
  overflow: hidden;
}

.fx-burst {
  position: absolute;
  left: 50%;
  top: 38%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--fx-color, #ffd773);
  box-shadow: 0 0 18px var(--fx-color, #ffd773);
  animation: fxBurst 950ms ease-out forwards;
}

@keyframes fxBurst {
  from {
    transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0) scale(1);
    opacity: 1;
  }
  to {
    transform: translate(-50%, -50%) rotate(var(--angle)) translateX(var(--distance)) scale(0.08);
    opacity: 0;
  }
}

.screen-flash {
  position: fixed;
  inset: 0;
  z-index: 34;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 222, 111, 0.5), transparent 62%);
  animation: flashFade 700ms ease-out forwards;
}

@keyframes flashFade {
  from { opacity: 0.8; }
  to { opacity: 0; }
}

.achievement-toast {
  position: fixed;
  left: 50%;
  top: calc(18px + env(safe-area-inset-top, 0px));
  z-index: 45;
  width: min(calc(100% - 24px), 390px);
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 216, 112, 0.72);
  border-radius: 14px;
  background:
    radial-gradient(circle at 18% 50%, rgba(255, 216, 112, 0.24), transparent 38%),
    linear-gradient(180deg, rgba(14, 22, 36, 0.98), rgba(4, 8, 14, 0.98));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.52), 0 0 28px rgba(255, 216, 112, 0.18);
  transform: translate(-50%, -140%);
  opacity: 0;
  pointer-events: none;
}

.achievement-toast.show {
  animation: toastInOut 3600ms ease forwards;
}

@keyframes toastInOut {
  0% { transform: translate(-50%, -140%); opacity: 0; }
  10%, 78% { transform: translate(-50%, 0); opacity: 1; }
  100% { transform: translate(-50%, -140%); opacity: 0; }
}

.achievement-toast span {
  color: #83d9ff;
  font-size: 11px;
  font-weight: 950;
}

.achievement-toast strong {
  color: #ffe49b;
  font-size: 18px;
  font-weight: 950;
}

.achievement-toast small {
  color: #dceeff;
  font-size: 12px;
  font-weight: 800;
}

.ending-card {
  padding: 24px 18px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 214, 98, 0.28), transparent 46%),
    linear-gradient(180deg, rgba(16, 12, 7, 0.98), rgba(3, 6, 12, 0.98));
}

.ending-card h1 {
  margin: 0 0 6px;
  font-size: 42px;
  text-shadow: 0 0 22px rgba(255, 215, 87, 0.42);
}

.ending-card p {
  color: #fff1c8;
  margin: 0 0 16px;
  font-weight: 900;
}

.ending-money {
  margin: 16px 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 12vw, 54px);
  font-weight: 950;
}

.ending-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.result-card {
  padding: 18px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 216, 99, 0.24), transparent 40%),
    linear-gradient(180deg, rgba(7, 14, 27, 0.98), rgba(2, 5, 10, 0.98));
}

.result-hero {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 13vw, 60px);
  font-weight: 950;
  line-height: 0.95;
  text-shadow: 0 3px 0 #4d2200, 0 0 26px rgba(255, 211, 75, 0.46);
}

.result-character {
  width: min(28vw, 104px);
  margin: 4px auto -2px;
  display: block;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.52));
}

.result-score {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.result-score div,
.result-breakdown div {
  border: 1px solid rgba(73, 171, 255, 0.36);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.42);
  padding: 10px;
}

.result-score span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.result-score strong {
  color: #fff;
  font-size: 30px;
}

.result-profit {
  margin: 12px 0;
  color: #78ff9c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 950;
}

.result-profit.loss {
  color: #ff837a;
}

.result-breakdown {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.result-breakdown div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #dceeff;
  font-size: 13px;
  font-weight: 800;
}

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

.next-round,
.result-sub {
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(255, 216, 106, 0.58);
  color: #fff1c4;
  font-weight: 950;
}

.next-round {
  clip-path: polygon(7% 0, 93% 0, 100% 50%, 93% 100%, 7% 100%, 0 50%);
  background: linear-gradient(135deg, rgba(118, 65, 8, 0.98), rgba(216, 152, 38, 0.98));
  color: #101010;
  font-size: 22px;
}

.result-sub {
  margin-top: 8px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(19, 49, 88, 0.96), rgba(7, 12, 20, 0.96));
}

@media (min-width: 760px) {
  .app-shell {
    padding-block: 24px;
  }

  .game-frame {
    min-height: 900px;
  }
}

@media (max-width: 370px) {
  .game-frame {
    padding-inline: 8px;
  }

  .table-stage {
    grid-template-columns: 1fr 1fr;
  }

  .playing-card {
    width: 48px;
    height: 74px;
  }

  .result-seal {
    width: 82px;
    height: 82px;
  }

  .bet-control {
    grid-template-columns: 56px 40px 1fr 40px 64px;
  }
}
