body[data-page="minigame"] .page-shell {
  max-width: none;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}

#minigame-root {
  position: relative;
  min-height: 52vh;
  width: 100%;
}

.mg-boot {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.85rem;
  background: color-mix(in srgb, #050505 94%, transparent);
  backdrop-filter: blur(18px) saturate(0.55);
  -webkit-backdrop-filter: blur(18px) saturate(0.55);
  pointer-events: none;
}

.mg-boot.is-on {
  display: flex;
  pointer-events: auto;
}

.mg-boot p {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.mg-hourglass {
  width: 42px;
  height: 58px;
  position: relative;
  animation: mg-glass-turn 1.6s ease-in-out infinite;
}

.mg-hourglass::before,
.mg-hourglass::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  height: 22px;
  border: 2px solid var(--color-accent);
  background: linear-gradient(var(--color-accent) 0 var(--fill, 0%), transparent var(--fill, 0%));
}

.mg-hourglass::before {
  top: 4px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  animation: mg-sand-top 1.6s linear infinite;
}

.mg-hourglass::after {
  bottom: 4px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  animation: mg-sand-bot 1.6s linear infinite;
}

@keyframes mg-glass-turn {
  0%, 42% { transform: rotate(0deg); }
  58%, 100% { transform: rotate(180deg); }
}

@keyframes mg-sand-top {
  0% { background: linear-gradient(var(--color-accent) 0 80%, transparent 80%); }
  45% { background: linear-gradient(var(--color-accent) 0 8%, transparent 8%); }
  100% { background: linear-gradient(var(--color-accent) 0 80%, transparent 80%); }
}

@keyframes mg-sand-bot {
  0% { background: linear-gradient(transparent 0 75%, var(--color-accent) 75%); }
  45% { background: linear-gradient(transparent 0 12%, var(--color-accent) 12%); }
  100% { background: linear-gradient(transparent 0 75%, var(--color-accent) 75%); }
}

.minigame-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.minigame-balance {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.minigame-balance strong {
  color: var(--color-accent);
  font-size: 1.05rem;
}

.minigame-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.minigame-tab {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.minigame-tab.is-active {
  color: var(--color-accent);
  border-color: var(--color-border-accent);
  background: var(--color-accent-dim);
  box-shadow: var(--glow-accent);
}

.minigame-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.minigame-status h2 {
  font-size: 0.95rem;
}

.minigame-remain {
  font-family: var(--font-mono);
  color: var(--color-accent);
  font-size: 0.95rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.minigame-remain.is-closing,
.minigame-remain.is-draw {
  color: var(--color-error);
}

.mg-progress {
  height: 4px;
  border-radius: 99px;
  background: var(--color-surface);
  overflow: hidden;
  margin-bottom: 1rem;
}

.mg-progress.is-closing > span,
.mg-progress.is-draw > span {
  background: var(--color-error);
  box-shadow: none;
}

.mg-progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--color-accent);
  box-shadow: var(--glow-accent);
  transition: width 0.2s linear;
}

.mg-progress.is-ms > span {
  transition: none;
}

.mg-arena {
  display: grid;
  grid-template-columns: minmax(300px, 0.86fr) minmax(420px, 1.24fr);
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: start;
}

.mg-play {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  min-height: 0;
  height: auto;
}

.mg-logs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  min-height: 0;
  height: auto;
}

.mg-live,
.mg-bet,
.mg-col {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.mg-live {
  min-height: 0;
  flex: 0 0 auto;
}

.mg-bet {
  flex: 0 0 auto;
  margin-bottom: 0;
}

.mg-logs .mg-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

.mg-col-bets {
  flex: 0 0 auto;
}

.mg-col-bets .mg-history {
  flex: none;
  height: calc(2.45rem + 10 * 2.08rem);
  max-height: calc(2.45rem + 10 * 2.08rem);
  overflow: hidden;
}

.mg-logs > .mg-col:not(.mg-col-bets):not(.mg-col-stats) .mg-history {
  flex: none;
  height: calc(2.45rem + 10 * 2.72rem);
  max-height: calc(2.45rem + 10 * 2.72rem);
  overflow: hidden;
}

.mg-col-stats {
  flex: 0 0 auto;
  max-height: none;
  overflow: visible;
}

.mg-stats-row {
  display: flex;
  gap: 0.85rem;
  align-items: stretch;
}

.mg-stats-main {
  flex: 1;
  min-width: 0;
}

.mg-pie-side {
  width: 148px;
  flex: 0 0 148px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mg-board {
  display: none;
}

.mg-col h3 {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  margin-bottom: 0.65rem;
}

.mg-cage {
  position: relative;
  width: min(100%, 200px);
  aspect-ratio: 1;
  margin: 0 auto 0.7rem;
  border-radius: 50%;
  border: 2px solid var(--color-border-accent);
  background:
    radial-gradient(circle at 35% 30%, var(--color-accent-dim), transparent 55%),
    var(--color-surface);
  box-shadow: var(--glow-accent);
  overflow: hidden;
}

.mg-cage.is-spin {
  box-shadow: 0 0 22px var(--color-accent-glow);
}

.mg-cage.is-spin .mg-orbit {
  animation-duration: 0.55s;
}

.mg-orbit {
  position: absolute;
  inset: 12%;
  animation: mg-spin 7s linear infinite;
}

.mg-dot {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 0.55rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  color: #111;
}
.mg-dot.c1 { background: #ff7b7b; }
.mg-dot.c2 { background: #74c0fc; }
.mg-dot.c3 { background: #8ce99a; }
.mg-dot.c4 { background: #ffc078; }

@keyframes mg-spin {
  to { transform: rotate(360deg); }
}

.mg-cage-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text);
  pointer-events: none;
  z-index: 2;
}

.mg-balls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.mg-ball {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.8rem;
  color: #111;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.mg-ball.c1 { background: #ff7b7b; }
.mg-ball.c2 { background: #74c0fc; }
.mg-ball.c3 { background: #8ce99a; }
.mg-ball.c4 { background: #ffc078; }
.mg-ball.is-power {
  background: var(--color-accent);
  color: #0b0b12;
  box-shadow: var(--glow-accent);
}

.mg-tags {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 0.3rem 0.4rem;
  justify-content: center;
  margin: 0.65rem auto 0;
  width: max-content;
}

.mg-tag {
  font-size: 0.68rem;
  padding: 0.15rem 0.4rem;
  border-radius: 99px;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

.mg-tag.is-a {
  color: #2563eb;
  border-color: #2563eb;
}

.mg-tag.is-b {
  color: #dc2626;
  border-color: #dc2626;
}

.mg-ladder-wrap {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
}

.mg-ladder {
  width: 100%;
  display: block;
}

.mg-node {
  fill: #14141c;
  stroke: var(--color-border);
  stroke-width: 2;
}

.mg-node.is-a { stroke: #2563eb; fill: rgba(37, 99, 235, 0.22); }
.mg-node.is-b { stroke: #dc2626; fill: rgba(220, 38, 38, 0.22); }
.mg-node-label { fill: #f3f4f8; font-size: 12px; font-weight: 800; text-anchor: middle; dominant-baseline: middle; }
.mg-rail {
  stroke: url(#mg-rail-grad);
  stroke-width: 7;
  stroke-linecap: round;
}
.mg-rung.is-hit {
  stroke: url(#mg-path-grad);
  stroke-width: 5;
  filter: url(#mg-glow);
}

.mg-ball.is-pop {
  animation: mg-ball-pop 0.42s ease-out both;
}

@keyframes mg-ball-pop {
  from {
    transform: scale(0.15) translateY(-22px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}
.mg-path-ghost {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 4;
}
.mg-path-draw {
  fill: none;
  stroke: url(#mg-path-grad);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url(#mg-glow);
}
.mg-token {
  fill: #f8fbff;
  filter: url(#mg-glow);
}

.mg-pick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}

.mg-pick-row h4 {
  width: 100%;
  font-size: 0.7rem;
  color: var(--color-text-dim);
  margin-bottom: 0.15rem;
}

.minigame-pick,
.minigame-stake {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.minigame-pick {
  min-width: 68px;
  padding: 0.5rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.minigame-pick small {
  display: block;
  font-size: 0.65rem;
  color: var(--color-text-dim);
  font-weight: 500;
}

.minigame-pick.is-red { color: #dc2626; }
.minigame-pick.is-blue { color: #2563eb; }
.minigame-pick.is-green { color: #9ee0b8; }

.minigame-pick.is-on {
  border-color: currentColor;
  background: rgba(255, 255, 255, 0.05);
}

.minigame-pick.is-blocked {
  opacity: 0.4;
  cursor: not-allowed;
}

.minigame-hedge {
  font-size: 0.72rem;
  color: var(--color-text-dim);
  line-height: 1.4;
  margin-bottom: 0.65rem;
}

.mg-stake-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.mg-stake-label input {
  flex: 1;
  min-width: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.55rem;
  color: var(--color-text);
  appearance: textfield;
  -moz-appearance: textfield;
}

#mg-stake-input::-webkit-outer-spin-button,
#mg-stake-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
  display: none;
}

.minigame-stakes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.5rem 0 0.75rem;
}

.minigame-stake {
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  background: transparent;
  color: var(--color-text-muted);
}

.minigame-stake.is-on {
  color: var(--color-accent);
  border-color: var(--color-border-accent);
}

.minigame-submit { width: 100%; }

.hl-board {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.hl-card {
  width: 104px;
  height: 146px;
  perspective: 800px;
}

.hl-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s var(--ease-out);
  will-change: transform;
}

.hl-card.is-flip .hl-card-inner { transform: rotateY(180deg); }

.hl-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  display: grid;
  place-items: center;
}

.hl-back {
  background:
    repeating-linear-gradient(135deg, var(--color-accent-dim) 0 8px, var(--color-surface) 8px 16px);
  color: var(--color-accent);
  font-weight: 800;
  letter-spacing: 0.16em;
}

.hl-front {
  background: #f4f1ea;
  color: #1a1a1a;
  transform: rotateY(180deg);
  font-size: 1.5rem;
  font-weight: 800;
}

.hl-front.is-red { color: #c23b3b; }
.hl-front.is-joker {
  background: #111;
  color: #9ee0b8;
  border-color: #9ee0b8;
}

.hl-phase {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.mg-bars { display: grid; gap: 0.45rem; margin-bottom: 0.85rem; }
.mg-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--color-text-muted);
}
.mg-bar {
  height: 8px;
  border-radius: 99px;
  background: rgba(220, 38, 38, 0.42);
  overflow: hidden;
}
.mg-bar > span {
  display: block;
  height: 100%;
  background: #2563eb;
}

.mg-pie {
  width: 132px;
  height: 132px;
  display: block;
}

.mg-pie text {
  fill: #fff;
  font-size: 9px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.35);
  stroke-width: 2px;
}

.mg-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  margin-right: 0.35rem;
  vertical-align: -2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.mg-combos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  align-items: center;
}

.mg-road-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.55rem;
}

.mg-road-tab {
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  padding: 0.28rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}

.mg-road-tab.is-on {
  color: var(--color-accent);
  border-color: var(--color-border-accent);
  background: var(--color-accent-dim);
}

.mg-road-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.mg-streak {
  font-size: 0.65rem;
  color: var(--color-text-dim);
  display: flex;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.mg-road {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
  height: 186px;
  min-height: 186px;
  padding-bottom: 0.55rem;
  scrollbar-width: thin;
  scrollbar-color: var(--theme-scrollbar, rgba(61, 255, 154, 0.45)) var(--color-bg-elevated);
}

.mg-road-col {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 0 0 22px;
}

.mg-bead {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.55rem;
  font-weight: 700;
  border: 1px solid var(--color-border);
}

.mg-bead.is-a {
  background: #2563eb;
  color: #fff;
  border-color: #1d4ed8;
}

.mg-bead.is-b {
  background: #dc2626;
  color: #fff;
  border-color: #b91c1c;
}

.mg-history {
  overflow: auto;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--theme-scrollbar) transparent;
}

.mg-history::-webkit-scrollbar,
.mg-road::-webkit-scrollbar {
  width: 8px;
  height: 10px;
}

.mg-history::-webkit-scrollbar-track,
.mg-road::-webkit-scrollbar-track {
  background: transparent;
}

.mg-history::-webkit-scrollbar-thumb,
.mg-road::-webkit-scrollbar-thumb {
  background: var(--theme-scrollbar, rgba(61, 255, 154, 0.45));
  border-radius: 99px;
}

.mg-history::-webkit-scrollbar-thumb:hover,
.mg-road::-webkit-scrollbar-thumb:hover {
  background: var(--theme-scrollbar-hover, rgba(61, 255, 154, 0.65));
}

.mg-history table,
.mg-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.7rem;
}

.mg-history th,
.mg-history td {
  padding: 0.38rem 0.28rem;
  border-bottom: 1px solid var(--color-border);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 2.08rem;
  vertical-align: middle;
}

.mg-history th {
  color: var(--color-text-dim);
  font-size: 0.64rem;
}

.mg-grid .mg-num,
.mg-cell-stat {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.mg-history .mg-grid th:first-child,
.mg-history .mg-grid td:first-child {
  text-align: left;
}

.mg-col-bets .mg-grid th,
.mg-col-bets .mg-grid td,
.mg-col-bets .mg-grid th:first-child,
.mg-col-bets .mg-grid td:first-child {
  text-align: center;
}

.mg-grid .c-round { width: 16%; }
.mg-grid .c-res { width: 22%; }
.mg-grid .c-n { width: 9%; }
.mg-grid .c-join { width: 11%; }
.mg-grid .c-rate { width: 16%; }
.mg-grid .c-pick { width: 22%; }
.mg-grid .c-amt { width: 14%; }
.mg-grid .c-out { width: 18%; }
.mg-grid .c-pay { width: 12%; }
.mg-grid .c-paid { width: 7%; }
.mg-grid .c-time { width: 15%; }
.mg-grid .c-act { width: 8%; }
.mg-grid .c-nick { width: 30%; }
.mg-grid .c-pnl { width: 14%; }
.mg-grid .c-wdl { width: 10%; }

.mg-pad td {
  visibility: hidden;
  border-color: transparent;
}

.mg-cancel {
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  padding: 0.12rem 0.4rem;
  font-size: 0.66rem;
  font-weight: 700;
  cursor: pointer;
}

.mg-cancel:hover {
  color: var(--color-error);
  border-color: var(--color-error);
}

.mg-hist-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  white-space: normal;
  line-height: 1.2;
}

.mg-hist-balls {
  font-size: 0.62rem;
  letter-spacing: 0.02em;
}

.mg-logs > .mg-col:not(.mg-col-bets):not(.mg-col-stats) td:nth-child(2) {
  white-space: normal;
  overflow: hidden;
  height: auto;
  min-height: 2.08rem;
}

.minigame-chip {
  display: inline-flex;
  min-width: 1.5rem;
  padding: 0.08rem 0.32rem;
  border-radius: 99px;
  border: 1px solid var(--color-border);
  font-size: 0.68rem;
  justify-content: center;
}

.minigame-chip.is-win { color: #9ee0b8; border-color: #9ee0b8; }
.minigame-chip.is-lose { color: var(--color-text-dim); }
.minigame-chip.is-a { color: #2563eb; border-color: #2563eb; }
.minigame-chip.is-b { color: #dc2626; border-color: #dc2626; }
.minigame-chip.is-c { color: #9ee0b8; border-color: #9ee0b8; }
.minigame-chip.is-red { color: #dc2626; border-color: #dc2626; }
.minigame-chip.is-blue { color: #2563eb; border-color: #2563eb; }
.minigame-chip.is-green { color: #9ee0b8; border-color: #9ee0b8; }

.mg-bet {
  margin-bottom: 0;
}

.mg-lobby {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  margin: 0;
  min-height: 0;
}

.mg-lobby .mg-history {
  min-height: calc(2.45rem + 10 * 2.72rem);
  height: calc(2.45rem + 10 * 2.72rem);
  max-height: calc(2.45rem + 10 * 2.72rem);
  overflow: hidden;
  flex: none;
}

.mg-em {
  color: var(--color-accent);
  font-style: normal;
  font-weight: 700;
}

.mg-result-pair {
  margin-right: 0.25rem;
}

.mg-lobby th {
  white-space: nowrap;
  font-size: 0.68rem;
}

.mg-lobby th:first-child,
.mg-lobby td:first-child {
  text-align: left;
}

.mg-lobby .mg-grid .c-nick { width: 20%; }
.mg-lobby .mg-grid .c-pick { width: 24%; }
.mg-lobby .mg-grid .c-out { width: 18%; }

.mg-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.18rem;
  align-items: center;
  justify-content: flex-start;
}

.mg-lobby td:nth-child(2) .mg-chip-row,
.mg-lobby td:nth-child(3) .mg-chip-row {
  flex-wrap: wrap;
}

.mg-lobby td:nth-child(2) .minigame-chip,
.mg-lobby td:nth-child(3) .minigame-chip {
  flex: 0 0 calc(50% - 0.1rem);
  max-width: calc(50% - 0.1rem);
  box-sizing: border-box;
  text-align: center;
  justify-content: center;
}

.mg-chip-out {
  margin-left: 0;
}

.mg-lobby td:nth-child(2),
.mg-lobby td:nth-child(3) {
  white-space: normal;
  overflow: hidden;
  text-overflow: unset;
  height: auto;
  min-height: 2.08rem;
  line-height: 1.2;
  vertical-align: middle;
}

.mg-col-bets td:nth-child(2),
.mg-col-bets td:nth-child(4) {
  white-space: nowrap;
  overflow: hidden;
  height: 2.08rem;
  min-height: 2.08rem;
  line-height: 1.2;
  vertical-align: middle;
}

.mg-lobby td:nth-child(2) .minigame-chip,
.mg-lobby td:nth-child(3) .minigame-chip,
.mg-col-bets td:nth-child(2) .minigame-chip,
.mg-col-bets td:nth-child(4) .minigame-chip {
  margin: 0;
  padding: 0.04rem 0.28rem;
  font-size: 0.62rem;
}

.mg-paid {
  color: var(--color-accent);
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1;
  text-shadow: 0 0 10px var(--color-accent-glow);
}

.mg-paid.is-lost {
  color: var(--color-accent);
  font-size: 1.15rem;
  font-weight: 700;
}

.mg-bet-time {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  white-space: nowrap;
  color: var(--color-text-muted);
}

.mg-nick {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.mg-nick span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mg-online {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: #3a3a3a;
  box-shadow: inset 0 0 0 1px #222;
}

.mg-online.is-on {
  background: #3ecf6a;
  box-shadow: 0 0 7px rgba(62, 207, 106, 0.75);
}

.mg-lobby .tier-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.mg-wdl {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mg-pnl {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.mg-pnl.is-up { color: #9ee0b8; }
.mg-pnl.is-down { color: #dc2626; }

.mg-tag.is-a { color: #2563eb; border-color: #2563eb; }
.mg-tag.is-b { color: #dc2626; border-color: #dc2626; }
.mg-tag.is-c { color: #9ee0b8; border-color: #9ee0b8; }

.mg-col-bets {
  min-width: 0;
}

#mg-people-pager,
#mg-bets-pager,
#mg-hist-pager {
  flex: 0 0 auto;
  min-height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#mg-people-pager .pagination,
#mg-bets-pager .pagination,
#mg-hist-pager .pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.45rem;
}

#mg-people-pager .pagination .btn.is-active,
#mg-bets-pager .pagination .btn.is-active,
#mg-hist-pager .pagination .btn.is-active {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.mg-range-tabs {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.65rem;
}

.minigame-empty {
  color: var(--color-text-dim);
  font-size: 0.82rem;
  padding: 0.6rem 0;
}

.minigame-hint {
  font-size: 0.75rem;
  color: var(--color-text-dim);
  line-height: 1.45;
  margin-bottom: 0.75rem;
}

@media (max-width: 1100px) {
  .mg-arena {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 899px) {
  .mg-arena {
    grid-template-columns: 1fr;
  }

  .mg-logs {
    min-height: 0;
  }

  .mg-stats-row {
    flex-direction: column;
  }

  .mg-pie-side {
    width: 100%;
    flex: none;
    min-height: 140px;
  }

  .minigame-stakes {
    gap: 0.3rem;
  }

  .minigame-stake,
  .minigame-pick {
    min-height: 44px;
  }

  .mg-cage {
    width: min(100%, 180px);
  }

  .hl-card {
    width: 96px;
    height: 134px;
  }

  #mg-bets-pager .pagination .btn,
  #mg-hist-pager .pagination .btn {
    min-width: 2.5rem;
    min-height: 2.5rem;
  }
}

@media (max-width: 430px) {
  .minigame-tab,
  .minigame-pick,
  .minigame-stake {
    font-size: 0.72rem;
  }

  .mg-history {
    max-height: none;
  }
}
