:root {
  color-scheme: dark;
  --felt: #163626;
  --felt-deep: #092018;
  --gold: #f1c66d;
  --paper: #fffaf0;
  --ink: #182119;
  --red: #c82f37;
  --blue: #2e63d8;
  --muted: rgba(255, 255, 255, 0.66);
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  background: #07140f;
  font-family: ui-rounded, "SF Pro Rounded", "Noto Sans TC", system-ui, sans-serif;
  letter-spacing: 0;
  touch-action: manipulation;
}

button,
input {
  font: inherit;
}

.app {
  position: relative;
  min-height: 100dvh;
  color: white;
  background:
    radial-gradient(circle at 22% 16%, rgba(241, 198, 109, 0.16), transparent 28%),
    radial-gradient(circle at 76% 82%, rgba(44, 115, 182, 0.16), transparent 34%),
    linear-gradient(145deg, var(--felt), var(--felt-deep));
  isolation: isolate;
}

.felt-glow {
  position: absolute;
  inset: 58px 3vw 88px;
  border-radius: 42px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 17px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px 19px);
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.36);
  opacity: 0.78;
  z-index: -1;
}

.topbar {
  position: relative;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top)) 22px 8px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(160deg, #f7da90, #c98a3b);
  color: #1e2318;
  font-weight: 900;
  box-shadow: var(--shadow);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.1;
}

#roundCaption {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.icon-btn,
.chip-btn {
  border: 0;
  border-radius: 999px;
  color: white;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.icon-btn {
  width: 44px;
  height: 44px;
  font-size: 22px;
}

.table {
  display: grid;
  grid-template-rows: minmax(118px, 0.82fr) minmax(190px, 1fr) minmax(184px, 1.05fr);
  gap: 10px;
  height: calc(100dvh - 76px);
  padding: 0 clamp(12px, 3vw, 34px) max(14px, env(safe-area-inset-bottom));
}

.player-panel {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 9px;
}

.player-meta {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 13px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
}

.player-meta strong {
  color: var(--gold);
  font-size: 16px;
}

.hand {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 96px;
  width: 100%;
  transition: gap 220ms ease, padding 220ms ease, min-height 220ms ease;
}

.ai-hand {
  gap: clamp(2px, 0.7vw, 8px);
}

.player-hand {
  gap: clamp(3px, 0.72vw, 9px);
  padding-inline: 4px;
}

.card {
  position: relative;
  flex: 0 0 auto;
  width: clamp(48px, 6.2vw, 76px);
  aspect-ratio: 0.705;
  border: 0;
  border-radius: 9px;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 247, 226, 0.98)),
    var(--paper);
  box-shadow: 0 12px 18px rgba(0, 0, 0, 0.24);
  transform: translateY(0) scale(1);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease, margin 240ms ease;
  cursor: pointer;
}

.card::before {
  content: attr(data-rank);
  position: absolute;
  top: 7px;
  left: 8px;
  font-size: clamp(17px, 2vw, 24px);
  font-weight: 900;
}

.card::after {
  content: attr(data-suit);
  position: absolute;
  right: 8px;
  bottom: 5px;
  font-size: clamp(21px, 2.4vw, 29px);
}

.card .pip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(26px, 3.5vw, 44px);
  opacity: 0.78;
}

.card.red {
  color: var(--red);
}

.card.black {
  color: #151a1d;
}

.card.joker {
  color: #7932c6;
  background:
    radial-gradient(circle at 50% 35%, rgba(241, 198, 109, 0.52), transparent 26%),
    linear-gradient(145deg, #fff9e6, #efe6ff);
}

.card.joker .pip {
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 900;
}

.card.back-card,
.back-card {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 21%),
    repeating-linear-gradient(45deg, #263a82 0 8px, #18265d 8px 16px);
  box-shadow: 0 14px 23px rgba(0, 0, 0, 0.28);
}

.card.back-card::before,
.card.back-card::after {
  content: "";
}

.card.selected {
  transform: translateY(-18px) scale(1.04);
  box-shadow: 0 21px 32px rgba(0, 0, 0, 0.31), 0 0 0 3px rgba(241, 198, 109, 0.72);
}

.card.locked {
  filter: saturate(0.42) brightness(0.82);
  cursor: not-allowed;
}

.card.fresh-card {
  transform: translateY(-18px) scale(1.04);
  box-shadow: 0 24px 36px rgba(0, 0, 0, 0.36), 0 0 0 3px rgba(241, 198, 109, 0.88), 0 0 34px rgba(241, 198, 109, 0.34);
}

.card.fresh-card.selected {
  transform: translateY(-18px) scale(1.04);
}

.card.open-meld-card {
  filter: none;
  box-shadow: 0 22px 34px rgba(0, 0, 0, 0.34), 0 0 0 3px rgba(108, 206, 255, 0.68), 0 0 26px rgba(108, 206, 255, 0.28);
}

.card.lifted-open {
  transform: translateY(-16px) scale(1.03);
}

.hand.has-open-meld {
  min-height: 112px;
}

.player-hand.has-open-meld {
  padding-top: 28px;
}

.card.revealed-card {
  box-shadow: 0 14px 23px rgba(0, 0, 0, 0.28), 0 0 0 2px rgba(241, 198, 109, 0.42);
}

.card.segment-start {
  margin-left: clamp(13px, 2.2vw, 26px);
}

.center-zone {
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 12px;
}

.discard-stream {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.river {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: 4px;
  width: min(780px, 100%);
  max-height: 100%;
  padding-inline: 12px;
}

.river .card {
  width: clamp(22px, 3.2vw, 34px);
  border-radius: 5px;
  box-shadow: 0 6px 9px rgba(0, 0, 0, 0.18);
  cursor: default;
}

.river .card::before {
  top: 3px;
  left: 4px;
  font-size: 11px;
}

.river .card::after {
  display: block;
  right: 4px;
  bottom: 2px;
  font-size: 13px;
}

.river .card .pip {
  display: none;
}

.action-stage {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(22px, 6vw, 72px);
}

.arrange-switch {
  display: flex;
  justify-self: start;
  align-items: center;
  gap: 2px;
  margin: 0 0 7px clamp(2px, 4vw, 34px);
  padding: 3px;
  border-radius: 999px;
  background: rgba(5, 12, 9, 0.32);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.arrange-tab {
  border: 0;
  border-radius: 999px;
  padding: 5px 11px;
  color: rgba(255, 255, 255, 0.7);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.arrange-tab.active {
  color: #223027;
  background: linear-gradient(160deg, #f8da8d, #d89c43);
  box-shadow: 0 6px 14px rgba(142, 90, 22, 0.22);
}

.hand-labels {
  display: none;
  justify-content: center;
  align-items: center;
  grid-template-columns: minmax(0, 5fr) minmax(0, 5fr) minmax(0, 3fr);
  gap: clamp(13px, 2.2vw, 26px);
  min-height: 28px;
  margin-top: 2px;
  width: min(100%, 1040px);
  padding-inline: clamp(4px, 3vw, 38px);
}

.hand-labels.show {
  display: grid;
}

.hand-label {
  justify-self: center;
  padding: 4px 9px;
  border-radius: 999px;
  color: #1e2318;
  background: rgba(241, 198, 109, 0.9);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.hand-label.empty {
  visibility: hidden;
}

.player-hand.manual-sort .card {
  cursor: grab;
  touch-action: none;
}

.player-hand.manual-sort .card.dragging {
  cursor: grabbing;
  box-shadow: 0 25px 34px rgba(0, 0, 0, 0.38), 0 0 0 3px rgba(241, 198, 109, 0.72);
}

.pile {
  position: relative;
  border: 0;
  background: transparent;
  color: white;
  min-width: 88px;
  min-height: 118px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 10px;
  opacity: 0.48;
  transform: translateY(0);
  transition: opacity 180ms ease, transform 180ms ease, filter 180ms ease;
}

.pile.active {
  opacity: 1;
  transform: translateY(-3px);
  filter: drop-shadow(0 0 22px rgba(241, 198, 109, 0.26));
}

.pile:disabled {
  pointer-events: none;
}

.pile[hidden] {
  display: none;
}

.pile em {
  position: relative;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-style: normal;
  color: white;
  font-size: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.pile.active em {
  animation: breathe 1.2s ease-in-out infinite;
}

.pile.eat-win .mini-card {
  animation: card-breathe 1.05s ease-in-out infinite;
  filter: drop-shadow(0 0 16px rgba(218, 45, 42, 0.42));
}

.eat-win-badge {
  display: block;
  margin-top: 2px;
  color: #ff352f;
  font-size: 12px;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.28);
}

.eat-type-label {
  display: block;
  margin-top: 2px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.mini-card {
  display: block;
  width: 58px;
  aspect-ratio: 0.705;
  border-radius: 8px;
}

.deck-stack {
  position: relative;
  width: 64px;
  aspect-ratio: 0.705;
  border-radius: 9px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 21%),
    repeating-linear-gradient(45deg, #b43645 0 8px, #8f2231 8px 16px);
  box-shadow: 5px 5px 0 #f7efe0, 10px 10px 0 #24345b, 0 16px 21px rgba(0, 0, 0, 0.3);
}

.deck-pile b {
  position: absolute;
  top: 11px;
  right: 10px;
  color: var(--gold);
  font-size: 13px;
}

.hint-bar {
  min-height: 34px;
  text-align: center;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(4, 10, 8, 0.56);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.modal.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#betModal.show {
  pointer-events: none;
}

#betModal .sheet {
  pointer-events: auto;
}

.sheet {
  width: min(430px, 100%);
  border-radius: 22px;
  padding: 24px;
  background: rgba(248, 241, 221, 0.96);
  color: #172019;
  box-shadow: var(--shadow);
  transform: translateY(16px) scale(0.98);
  transition: transform 220ms ease;
}

.modal.show .sheet {
  transform: translateY(0) scale(1);
}

.sheet h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.sheet p {
  color: rgba(23, 32, 25, 0.72);
  line-height: 1.55;
}

.tutorial-modal {
  z-index: 35;
}

.eat-choice-modal {
  z-index: 34;
}

.eat-choice-sheet {
  display: grid;
  gap: 13px;
  width: min(560px, calc(100vw - 28px));
}

.eat-choice-list {
  display: grid;
  gap: 10px;
}

.eat-choice-option {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 16px;
  padding: 10px;
  color: #172019;
  background: rgba(31, 43, 35, 0.08);
  box-shadow: inset 0 0 0 1px rgba(31, 43, 35, 0.05);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.eat-choice-option:active {
  transform: scale(0.985);
}

.eat-choice-meta {
  display: grid;
  gap: 4px;
  text-align: left;
}

.eat-choice-meta strong {
  font-size: 16px;
  line-height: 1.15;
}

.eat-choice-meta em {
  justify-self: start;
  padding: 3px 8px;
  border-radius: 999px;
  color: #203d30;
  background: rgba(241, 198, 109, 0.8);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.eat-choice-cards {
  display: flex;
  align-items: center;
  min-width: 0;
}

.eat-choice-card {
  width: 42px;
  border-radius: 7px;
  box-shadow: 0 8px 13px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.eat-choice-card + .eat-choice-card {
  margin-left: -8px;
}

.eat-choice-card.taken-card {
  transform: translateY(-8px);
  box-shadow: 0 13px 20px rgba(0, 0, 0, 0.28), 0 0 0 3px rgba(241, 198, 109, 0.82);
}

.eat-choice-card::before {
  top: 4px;
  left: 5px;
  font-size: 14px;
}

.eat-choice-card::after {
  right: 5px;
  bottom: 3px;
  font-size: 18px;
}

.eat-choice-card .pip {
  font-size: 24px;
}

.eat-choice-card.joker .pip {
  font-size: 12px;
}

.tutorial-sheet {
  display: grid;
  gap: 12px;
  width: min(620px, calc(100vw - 28px));
  max-height: calc(100dvh - 34px);
  overflow: auto;
}

.tutorial-step-mark {
  justify-self: start;
  padding: 4px 10px;
  border-radius: 999px;
  color: #203d30;
  background: rgba(241, 198, 109, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.tutorial-body {
  display: grid;
  gap: 12px;
}

.tutorial-body p {
  font-size: 15px;
}

.tutorial-examples {
  display: grid;
  gap: 9px;
}

.tutorial-example {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px;
  border-radius: 14px;
  background: rgba(31, 43, 35, 0.08);
}

.tutorial-example-meta {
  display: grid;
  gap: 3px;
}

.tutorial-example-meta strong {
  font-size: 15px;
  line-height: 1.15;
}

.tutorial-example-meta span {
  justify-self: start;
  padding: 2px 7px;
  border-radius: 999px;
  color: #203d30;
  background: rgba(241, 198, 109, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.tutorial-cards {
  display: flex;
  align-items: center;
  min-width: 0;
}

.tutorial-card {
  width: 40px;
  border-radius: 6px;
  box-shadow: 0 8px 13px rgba(0, 0, 0, 0.2);
  cursor: default;
}

.tutorial-card + .tutorial-card {
  margin-left: -8px;
}

.tutorial-example.long-example {
  grid-template-columns: 74px minmax(0, 1fr);
}

.tutorial-example.long-example .tutorial-card {
  width: 30px;
  border-radius: 5px;
}

.tutorial-example.long-example .tutorial-card + .tutorial-card {
  margin-left: -17px;
}

.tutorial-example.long-example .tutorial-card::before {
  top: 3px;
  left: 4px;
  font-size: 11px;
}

.tutorial-example.long-example .tutorial-card::after {
  right: 4px;
  bottom: 2px;
  font-size: 14px;
}

.tutorial-example.long-example .tutorial-card .pip {
  font-size: 17px;
}

.tutorial-card::before {
  top: 4px;
  left: 5px;
  font-size: 14px;
}

.tutorial-card::after {
  right: 5px;
  bottom: 3px;
  font-size: 18px;
}

.tutorial-card .pip {
  font-size: 23px;
}

.tutorial-card.joker .pip {
  font-size: 12px;
}

.tutorial-sheet .primary-btn {
  margin-top: 6px;
}

.bet-controls,
.dealer-controls {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.dealer-controls {
  grid-template-columns: 1fr 1.3fr;
}

input[type="range"] {
  width: 100%;
  accent-color: #c98a3b;
}

.bet-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.chip-btn {
  width: 42px;
  height: 42px;
  background: #203d30;
  color: white;
  font-size: 24px;
}

.bet-line strong {
  min-width: 116px;
  text-align: center;
  font-size: 26px;
}

.primary-btn,
.ghost-btn,
.toast button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 800;
}

.primary-btn {
  color: #1e2318;
  background: linear-gradient(160deg, #f8da8d, #d89c43);
  box-shadow: 0 12px 23px rgba(142, 90, 22, 0.23);
}

.ghost-btn {
  color: #1f2b23;
  background: rgba(31, 43, 35, 0.1);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 26px);
  padding: 10px;
  border-radius: 999px;
  color: #1e2318;
  background: rgba(255, 250, 235, 0.96);
  box-shadow: var(--shadow);
  transform: translate(-50%, 130%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 220ms ease, opacity 220ms ease, visibility 220ms ease;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.toast span {
  padding-left: 8px;
  white-space: nowrap;
}

.toast button {
  padding: 9px 12px;
}

.toast button:first-of-type {
  background: #203d30;
  color: white;
}

.toast button:last-of-type {
  background: rgba(31, 43, 35, 0.11);
  color: #1f2b23;
}

.result-sheet {
  position: relative;
  overflow: hidden;
}

.result-lines {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.result-lines div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(31, 43, 35, 0.08);
}

#fireworks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

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

@keyframes card-breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

@media (max-width: 720px) {
  .topbar {
    padding-inline: 14px;
  }

  #roundCaption {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .table {
    grid-template-rows: 92px minmax(166px, 1fr) 194px;
    gap: 2px;
    height: calc(100dvh - 68px);
    padding-inline: 6px;
  }

  .felt-glow {
    inset: 58px 8px 76px;
    border-radius: 24px;
  }

  .ai-hand .card {
    margin-left: -20px;
  }

  .ai-hand .card:first-child {
    margin-left: 0;
  }

  .player-hand {
    gap: 0;
    justify-content: center;
    overflow: visible;
    min-height: 76px;
    padding: 18px 4px 8px;
  }

  .player-hand.has-open-meld {
    min-height: 92px;
    padding-top: 30px;
  }

  .card.lifted-open {
    transform: translateY(-12px) scale(1.03);
  }

  .player-hand .card {
    width: clamp(39px, 12vw, 48px);
    margin-left: clamp(-22px, -5.7vw, -18px);
  }

  .player-hand .card.fresh-card {
    width: clamp(39px, 12vw, 48px);
    margin-left: clamp(-22px, -5.7vw, -18px);
  }

  .player-hand .card:first-child,
  .player-hand .card.segment-start {
    margin-left: 0;
  }

  .player-hand .card.segment-start {
    margin-left: clamp(4px, 1.8vw, 8px);
  }

  .player-panel.self {
    align-content: end;
    gap: 3px;
  }

  .self .player-meta {
    justify-content: flex-start;
    gap: 8px;
    padding-left: 10px;
    font-size: 12px;
    line-height: 1;
    pointer-events: none;
  }

  .self .player-meta strong {
    font-size: 14px;
  }

  .action-stage {
    gap: 22px;
  }

  .center-zone {
    gap: 6px;
  }

  .arrange-switch {
    margin-left: 10px;
    margin-bottom: 4px;
  }

  .arrange-tab {
    padding: 4px 9px;
    font-size: 11px;
  }

  .hand-labels {
    min-height: 24px;
    gap: 10px;
    margin-top: 0;
    padding-inline: 6px;
  }

  .hand-label {
    padding: 3px 7px;
    font-size: 11px;
  }

  .pile {
    min-height: 98px;
  }

  .mini-card {
    width: 50px;
  }

  .deck-stack {
    width: 56px;
  }

  #betModal {
    place-items: start center;
    padding-top: max(72px, env(safe-area-inset-top));
  }

  #betModal .sheet {
    width: min(350px, calc(100vw - 22px));
    padding: 16px;
    border-radius: 18px;
  }

  .tutorial-modal {
    padding: 12px;
  }

  .eat-choice-modal {
    padding: 12px;
  }

  .eat-choice-sheet {
    width: min(340px, calc(100vw - 24px));
    padding: 16px;
    border-radius: 18px;
    gap: 10px;
  }

  .eat-choice-option {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 7px;
    padding: 8px;
  }

  .eat-choice-meta strong {
    font-size: 14px;
  }

  .eat-choice-card {
    width: clamp(31px, 8.5vw, 36px);
  }

  .eat-choice-card + .eat-choice-card {
    margin-left: clamp(-10px, -2.4vw, -7px);
  }

  .tutorial-sheet {
    width: min(320px, calc(100vw - 42px));
    padding: 16px;
    border-radius: 18px;
    gap: 9px;
  }

  .tutorial-example {
    grid-template-columns: 75px minmax(0, 1fr);
    gap: 7px;
    padding: 7px;
  }

  .tutorial-example-meta strong {
    font-size: 13px;
  }

  .tutorial-example-meta span {
    font-size: 11px;
    padding-inline: 6px;
  }

  .tutorial-card {
    width: clamp(29px, 8vw, 34px);
  }

  .tutorial-card + .tutorial-card {
    margin-left: clamp(-10px, -2.4vw, -7px);
  }

  .tutorial-example.long-example {
    grid-template-columns: 67px minmax(0, 1fr);
  }

  .tutorial-example.long-example .tutorial-card {
    width: 25px;
  }

  .tutorial-example.long-example .tutorial-card + .tutorial-card {
    margin-left: -15px;
  }

  #betModal .sheet h2 {
    font-size: 20px;
    margin-bottom: 5px;
  }

  #betModal .sheet p {
    font-size: 14px;
    line-height: 1.42;
  }

  .bet-controls,
  .dealer-controls {
    gap: 10px;
    margin-top: 12px;
  }

  .bet-line strong {
    font-size: 22px;
  }

  .toast {
    border-radius: 18px;
    flex-wrap: wrap;
    justify-content: center;
    width: calc(100vw - 26px);
  }

  .toast span {
    width: 100%;
    text-align: center;
    white-space: normal;
  }
}

@media (max-width: 380px) {
  h1 {
    font-size: 19px;
  }

  #roundCaption {
    font-size: 12px;
  }

  .mark,
  .icon-btn {
    width: 38px;
    height: 38px;
  }

  .table {
    grid-template-rows: 86px minmax(154px, 1fr) 188px;
    padding-inline: 4px;
  }

  .ai-hand .card {
    margin-left: -23px;
  }

  .player-hand .card {
    width: clamp(37px, 12vw, 42px);
    margin-left: clamp(-22px, -6.1vw, -19px);
  }

  .player-hand .card.fresh-card {
    width: clamp(37px, 12vw, 42px);
    margin-left: clamp(-22px, -6.1vw, -19px);
  }

  .card::before {
    top: 5px;
    left: 6px;
    font-size: 16px;
  }

  .card::after {
    right: 6px;
    bottom: 4px;
    font-size: 20px;
  }

  .hint-bar {
    font-size: 13px;
  }
}
