/**
 * demo2 미니게임 플레이 — EOS 파워볼형 레이아웃
 */
.demo2-subpage {
  max-width: 1800px;
  margin: 0 auto;
  padding: 12px 16px 32px;
}

.mg-demo2-page {
  --mg-bg: #070813;
  --mg-panel: #0c0b22;
  --mg-line: #49348f;
  --mg-purple: #8a2cff;
  --mg-violet: #b43cff;
  --mg-cyan: #10c8ff;
  --mg-blue: #1186ff;
  --mg-red: #ff2f64;
  --mg-text: #f7f5ff;
  --mg-muted: #aaa6c7;
  color: var(--mg-text);
  padding: 0 0 24px;
  background:
    radial-gradient(ellipse at 50% -8%, rgba(122, 61, 255, 0.14), transparent 58%),
    radial-gradient(ellipse at 100% 40%, rgba(77, 125, 255, 0.08), transparent 45%);
}

.mg-demo2-page button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.mg-demo2-game-nav {
  margin-bottom: 12px;
}

.mg-demo2-game-nav-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mg-demo2-game-chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid #5a3db7;
  background: linear-gradient(180deg, #12122e, #0b0c21);
  color: var(--mg-text);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mg-demo2-game-chip:hover {
  border-color: #9a38ff;
  color: #fff;
}

.mg-demo2-game-chip.is-active {
  border-color: #b43cff;
  background: linear-gradient(180deg, #9a38ff, #6b1eff);
  box-shadow: 0 0 14px rgba(140, 47, 255, 0.45);
}

.mg-demo2-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 14px;
}

.mg-demo2-quadrant {
  min-width: 0;
  min-height: 0;
}

.mg-demo2-quadrant-tl,
.mg-demo2-quadrant-tr {
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.mg-demo2-quadrant-tl .mg-demo2-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.mg-demo2-quadrant-bl,
.mg-demo2-quadrant-br {
  padding: 14px;
}

.mg-demo2-quadrant-bl {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.mg-demo2-quadrant-tr.mg-demo2-bet-history {
  margin-top: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.mg-demo2-quadrant-tr .mg-demo2-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  position: relative;
  z-index: 1;
  padding: 0 14px;
}

.mg-demo2-page .panel-glow {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(122, 61, 255, 0.2), transparent 54%),
    radial-gradient(ellipse at 88% 100%, rgba(77, 125, 255, 0.1), transparent 48%),
    linear-gradient(180deg, rgba(28, 20, 58, 0.98) 0%, rgba(12, 10, 30, 0.98) 50%, rgba(7, 7, 20, 0.99) 100%);
  border: 1px solid rgba(122, 61, 255, 0.48);
  border-radius: 17px;
  box-shadow:
    0 0 20px rgba(122, 49, 255, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.mg-demo2-page .panel-glow::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image:
    linear-gradient(rgba(128, 51, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128, 51, 255, 0.08) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.42;
  pointer-events: none;
  z-index: 0;
}

.mg-demo2-quadrant-bl.panel-glow > *,
.mg-demo2-quadrant-br.panel-glow > * {
  position: relative;
  z-index: 1;
}

.mg-demo2-quadrant-tr.mg-demo2-bet-history.panel-glow {
  background:
    radial-gradient(ellipse at 8% 0%, rgba(122, 61, 255, 0.32), transparent 50%),
    radial-gradient(ellipse at 92% 92%, rgba(77, 125, 255, 0.16), transparent 46%),
    linear-gradient(165deg, #2a1458 0%, #15102e 34%, #090818 100%);
  border-color: rgba(122, 61, 255, 0.58);
  box-shadow:
    0 0 24px rgba(122, 49, 255, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.mg-demo2-quadrant-tr.mg-demo2-bet-history.panel-glow::before {
  opacity: 0.55;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 88%);
}

.mg-demo2-card {
  padding: 14px;
}

/* 중계 카드 — iframe만 전체 채움 */
.mg-demo2-live-only {
  padding: 0;
  overflow: hidden;
}

.mg-demo2-live-only .mg-demo2-live-wrap {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 600px;
  margin: 0;
  border: 0;
  border-radius: 16px;
  background: #000;
  overflow: hidden;
  line-height: 0;
}

.mg-demo2-live-only .mg-demo2-iframe-scaler {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center center;
  overflow: hidden;
  line-height: 0;
}

.mg-demo2-live-only .mg-demo2-live-empty {
  min-height: 420px;
  border-radius: 16px;
}

.mg-demo2-game-header {
  min-height: 96px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 45%, rgba(24, 135, 255, 0.3), transparent 25%),
    linear-gradient(120deg, #08072a, #161058 52%, #0d1536);
}

.mg-demo2-game-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(128, 51, 255, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128, 51, 255, 0.15) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.35;
}

.mg-demo2-title {
  position: relative;
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 900;
  text-align: center;
  color: #fff;
  text-shadow: 0 0 12px rgba(174, 61, 255, 0.72);
}

.mg-demo2-game-grid {
  display: grid;
  grid-template-columns: 1fr 1.45fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.mg-demo2-subpanel {
  padding: 10px;
  border: 1px solid #6045bc;
  border-radius: 14px;
  background: linear-gradient(180deg, #141339, #0b0c21);
  min-height: 0;
}

.mg-demo2-subpanel h3 {
  margin: 0 0 10px;
  padding: 11px;
  text-align: center;
  border-radius: 9px;
  background: linear-gradient(90deg, #15133a, #1b174a);
  font-size: 14px;
}

.mg-demo2-round-list,
.mg-demo2-result-list {
  max-height: 280px;
  overflow: auto;
}

.mg-demo2-round-card,
.mg-demo2-result-card {
  background: #14162e;
  border: 1px solid #2f335f;
  border-radius: 9px;
  padding: 8px;
  margin-bottom: 8px;
}

.mg-demo2-round-no,
.mg-demo2-result-no {
  font-size: 12px;
  color: #c7c4df;
  margin-bottom: 7px;
}

.mg-demo2-round-no span {
  float: right;
  background: #ffd527;
  color: #181818;
  padding: 2px 5px;
  border-radius: 5px;
  font-weight: 800;
}

.mg-demo2-number-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.mg-demo2-number-row i {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset 0 -4px 9px rgba(0, 0, 0, 0.28);
}

.mg-demo2-result-card .mg-demo2-chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.mg-demo2-chips span {
  padding: 5px 7px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 12px;
}

.mg-demo2-chip-blue {
  background: linear-gradient(#1cb5ff, #0677c8);
}

.mg-demo2-chip-red {
  background: linear-gradient(#ff4a63, #e22441);
}

.mg-demo2-chip-green {
  background: linear-gradient(#6bd24e, #2f9c29);
}

.mg-demo2-more-btn {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 10px;
  background: #19173a;
  color: var(--mg-text);
}

.mg-demo2-draw {
  text-align: center;
}

.mg-demo2-draw-time {
  display: inline-block;
  background: #080919;
  border-radius: 22px;
  padding: 7px 14px;
  font-size: 13px;
}

.mg-demo2-draw-title {
  font-size: 20px;
  font-weight: 900;
  margin: 10px 0;
  color: #c77cff;
  text-shadow: 0 0 10px #8b2bff;
}

.mg-demo2-live-wrap {
  width: 100%;
  min-height: 320px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid #49348f;
  background: #050611;
}

.mg-demo2-iframe-scaler {
  transform-origin: top left;
  width: 100%;
  min-height: 320px;
}

.mg-demo2-iframe {
  display: block;
  border: 0;
  outline: 0;
  margin: 0;
  padding: 0;
  background: #000;
  vertical-align: top;
}

.mg-demo2-live-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 24px;
  text-align: center;
  color: var(--mg-muted);
  font-size: 14px;
  line-height: 1.6;
}

.mg-demo2-progress-wrap {
  margin-top: 12px;
  padding: 11px;
  border: 1px solid #267cff;
  border-radius: 12px;
  background: #080b20;
}

.mg-demo2-progress-wrap strong {
  font-size: 13px;
}

.mg-demo2-progress {
  height: 14px;
  background: #16133a;
  border-radius: 9px;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid #6846cc;
}

.mg-demo2-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: repeating-linear-gradient(125deg, #a62fff 0 12px, #4f8bff 12px 22px);
  transition: width 0.4s linear;
}

.mg-demo2-game-info {
  margin-top: 12px;
  padding: 14px 18px;
  border: 1px solid #5a3db7;
  border-radius: 12px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: linear-gradient(90deg, #101033, #141442);
}

.mg-demo2-info-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #7445ff;
  font-weight: 900;
  flex-shrink: 0;
}

.mg-demo2-game-info strong {
  color: #34e5ff;
}

.mg-demo2-game-info p {
  margin: 5px 0;
  color: #e0ddf4;
  font-size: 13px;
}

.mg-demo2-bet-history {
  padding: 0;
}

.mg-demo2-bet-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 15px 16px 13px;
  position: relative;
  z-index: 1;
  background: linear-gradient(90deg, rgba(122, 61, 255, 0.72) 0%, rgba(90, 45, 190, 0.34) 40%, rgba(10, 8, 24, 0) 100%);
  border-bottom: 1px solid rgba(122, 61, 255, 0.32);
}

.mg-demo2-quadrant-tr.mg-demo2-bet-history h2 {
  font-size: 18px;
  margin: 0;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 14px rgba(174, 61, 255, 0.55);
}

.mg-demo2-bet-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #5a3db7;
  border-radius: 8px;
  background: #15133a;
  color: #e9d5ff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.mg-demo2-bet-refresh svg {
  width: 18px;
  height: 18px;
}

.mg-demo2-bet-refresh:hover,
.mg-demo2-bet-refresh:focus-visible {
  border-color: #b43cff;
  background: #1c1a42;
}

.mg-demo2-bet-refresh:disabled {
  opacity: 0.55;
  cursor: wait;
}

.mg-demo2-bet-refresh.is-spin svg {
  animation: mg-demo2-spin 0.6s linear;
}

@keyframes mg-demo2-spin {
  to { transform: rotate(360deg); }
}

.mg-demo2-bet-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
  background: #4a4a66;
}

.mg-demo2-bet-badge.is-win {
  background: linear-gradient(180deg, #1186ff, #0a6fd4);
  box-shadow: 0 0 10px rgba(17, 134, 255, 0.35);
}

.mg-demo2-bet-badge.is-lose {
  background: linear-gradient(180deg, #ff2f64, #d81f52);
  box-shadow: 0 0 10px rgba(255, 47, 100, 0.35);
}

.mg-demo2-bet-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  position: relative;
  z-index: 1;
  padding: 0 14px 14px;
}

.mg-demo2-bet-pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #5a3db7;
  border-radius: 8px;
  background: #15133a;
  color: #e9d5ff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.mg-demo2-bet-pager-btn:hover:not(:disabled),
.mg-demo2-bet-pager-btn:focus-visible:not(:disabled) {
  border-color: #b43cff;
  background: #1c1a42;
}

.mg-demo2-bet-pager-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.mg-demo2-bet-pager-cur {
  min-width: 64px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #d8d2f0;
}

.mg-demo2-table-wrap {
  overflow: auto;
}

.mg-demo2-page table {
  width: 100%;
  border-collapse: collapse;
}

.mg-demo2-page th {
  padding: 11px 8px;
  background: linear-gradient(90deg, rgba(26, 23, 48, 0.98), rgba(18, 16, 36, 0.94));
  border-bottom: 1px solid rgba(122, 61, 255, 0.28);
  font-size: 13px;
  white-space: nowrap;
  color: #e9d5ff;
}

.mg-demo2-page td {
  padding: 12px 8px;
  border-bottom: 1px solid #1f2038;
  font-size: 13px;
  text-align: center;
}

.mg-demo2-page td.empty {
  padding: 18px;
  color: #9995b9;
}

.mg-demo2-bet-zone {
  padding: 14px;
  align-self: start;
}

.mg-demo2-market-rows {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-top: 14px;
}

.mg-demo2-market-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  min-height: 0;
  height: 100%;
}

.mg-demo2-market-mode-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  height: 100%;
}

.mg-demo2-market-mode {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 10px 8px;
  border-radius: 8px;
  border: 1px solid #5a3db7;
  background: #15133a;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  line-height: 1.35;
  white-space: nowrap;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.mg-demo2-market-mode.is-active {
  color: #fff;
  border-color: #7eb6ff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 46%),
    linear-gradient(90deg, #7a3dff 0%, #4d7dff 100%);
  box-shadow:
    0 0 0 1px rgba(126, 182, 255, 0.35),
    0 0 14px rgba(77, 125, 255, 0.38);
}

.mg-demo2-market-pane-wrap {
  min-width: 0;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.mg-demo2-market-rows-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  height: 100%;
}

.mg-demo2-market-pane[data-mg-mode-pane="basic"] .mg-demo2-market-row-btns {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mg-demo2-market-pane[data-mg-mode-pane="combo"] .mg-demo2-market-row-btns {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.mg-demo2-market-pane[data-mg-mode-pane="combo"] .mg-demo2-market-btn {
  font-size: 11px;
  padding: 10px 4px;
  min-height: 48px;
  height: 100%;
}

.mg-demo2-market-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.mg-demo2-market-pane[hidden] {
  display: none !important;
}

.mg-demo2-market-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.mg-demo2-market-row-no-label {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.mg-demo2-market-row-no-label .mg-demo2-market-row-btns {
  flex: 1;
  height: auto;
}

.mg-demo2-market-row-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  border-radius: 8px;
  border: 1px solid #5a3db7;
  background: #15133a;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  line-height: 1.35;
  white-space: nowrap;
}

.mg-demo2-market-row-btns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  height: 100%;
  align-items: stretch;
}

.mg-demo2-market-row-btns .mg-demo2-market-btn {
  min-height: 52px;
  height: 100%;
  padding: 10px 6px;
  font-size: 13px;
}

.mg-demo2-market-row-combo {
  margin-top: 4px;
}

.mg-demo2-market-row-combo .mg-demo2-market-row-label {
  font-size: 12px;
}

.mg-demo2-market-row-combo .mg-demo2-market-row-btns {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

/* 사다리: 상단 파란 / 하단 빨간 2행 */
.mg-demo2-ladder-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.mg-demo2-ladder-row {
  flex: 1;
  display: flex;
  min-height: 0;
}

.mg-demo2-ladder-row .mg-demo2-market-row-btns {
  flex: 1;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  height: 100%;
}

.mg-demo2-bet-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(122, 61, 255, 0.45);
  border-radius: 12px;
  font-size: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 42%),
    linear-gradient(90deg, rgba(122, 61, 255, 0.42) 0%, rgba(45, 33, 84, 0.85) 55%, rgba(11, 10, 28, 0.95) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.mg-demo2-countdown {
  color: #ff5e80;
  white-space: nowrap;
}

.mg-demo2-balance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 4px 0;
  font-size: 14px;
  color: var(--mg-muted);
}

.mg-demo2-balance-row strong {
  color: #34e5ff;
  font-size: 16px;
}

.mg-demo2-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 15px 4px 12px;
}

.mg-demo2-tabs button {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #6551b1;
  background: #12122e;
}

.mg-demo2-tabs button.is-active {
  background: linear-gradient(180deg, #9a38ff, #6b1eff);
  box-shadow: 0 0 14px #8c2fff;
}

.mg-demo2-tab-pane[hidden] {
  display: none !important;
}

.mg-demo2-bet-row {
  display: grid;
  grid-template-columns: 1fr 52px 1fr;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
}

.mg-demo2-bet-row span {
  text-align: center;
  font-weight: 900;
}

.mg-demo2-bet-row-3 {
  grid-template-columns: repeat(3, 1fr);
}

.mg-demo2-market-btn {
  border-radius: 8px;
  padding: 14px 10px;
  border: 1px solid;
  font-weight: 700;
  line-height: 1.35;
}

.mg-demo2-market-btn.is-blue {
  background: linear-gradient(180deg, #168dfb, #0873d6);
  border-color: #22c1ff !important;
}

.mg-demo2-market-btn.is-red {
  background: linear-gradient(180deg, #f33b6d, #d91e52);
  border-color: #ff7598 !important;
}

.mg-demo2-market-btn.is-active {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.mg-demo2-market-btn:disabled,
.mg-demo2-market-btn.is-disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.15);
  outline: none;
}

.mg-demo2-combo-section {
  margin-top: 18px;
}

.mg-demo2-combo-section h4 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  margin: 0 0 8px;
}

.mg-demo2-combo-section h4::before,
.mg-demo2-combo-section h4::after {
  content: "";
  height: 1px;
  background: linear-gradient(90deg, transparent, #2aa4ff);
  flex: 1;
}

.mg-demo2-combo-section h4::after {
  background: linear-gradient(90deg, #2aa4ff, transparent);
}

.mg-demo2-two-col,
.mg-demo2-three-col {
  display: grid;
  gap: 9px;
  margin: 8px 0;
}

.mg-demo2-two-col {
  grid-template-columns: 1fr 1fr;
}

.mg-demo2-three-col {
  grid-template-columns: repeat(3, 1fr);
}

.mg-demo2-two-col .mg-demo2-market-btn,
.mg-demo2-three-col .mg-demo2-market-btn {
  min-height: 62px;
}

.mg-demo2-bet-slip {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.mg-demo2-slip-head {
  font-size: 13px;
  color: var(--mg-muted);
  margin-bottom: 10px;
}

.mg-demo2-slip-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mg-demo2-slip-label {
  margin: 0 0 6px;
  font-size: 12px;
  color: #fff;
}

.mg-demo2-slip-info,
.mg-demo2-slip-amount-wrap,
.mg-demo2-slip-balance-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(122, 61, 255, 0.38);
  background:
    linear-gradient(180deg, rgba(26, 22, 48, 0.96), rgba(11, 12, 33, 0.98));
}

.mg-demo2-slip-info {
  min-height: 100%;
}

.mg-demo2-slip-info.is-selected #mg-demo2-info-type {
  color: var(--mg-text);
}

.mg-demo2-slip-info-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mg-demo2-slip-info-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  line-height: 1.35;
}

.mg-demo2-slip-info-list span {
  flex: 0 0 auto;
  color: var(--mg-muted);
}

.mg-demo2-slip-info-list strong {
  min-width: 0;
  font-weight: 700;
  text-align: right;
  color: var(--mg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mg-demo2-slip-info.is-selected .mg-demo2-slip-info-list strong {
  color: var(--mg-text);
}

.mg-demo2-slip-info-list #mg-demo2-info-win {
  color: #10c8ff;
}

.mg-demo2-slip-amount-wrap {
  cursor: text;
}

.mg-demo2-slip-balance-wrap .mg-demo2-slip-label {
  margin-bottom: 6px;
}

.mg-demo2-balance-display {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  min-height: 0;
  margin-top: auto;
}

.mg-demo2-balance-display strong {
  color: #34e5ff;
  font-size: 16px;
  font-weight: 800;
  text-align: right;
}

.mg-demo2-slip-amount-inline {
  display: block;
  margin-bottom: 10px;
}

.mg-demo2-slip-amount-inline .mg-demo2-amount-field {
  min-height: 46px;
  padding: 0 12px 0 14px;
  border-radius: 8px;
  border: 1px solid #5a3db7;
  background: #0b0c21;
  margin-top: 0;
}

.mg-demo2-amount-field {
  display: flex;
  align-items: center;
  flex: 1;
  min-height: 0;
  margin-top: auto;
}

.mg-demo2-amount-field .mg-demo2-amount {
  width: 100%;
  min-width: 0;
  padding: 0 8px 0 0;
  border: 0;
  background: transparent;
  color: var(--mg-text);
  font-size: 15px;
  font-weight: 700;
  text-align: right;
}

.mg-demo2-amount-unit {
  flex: 0 0 auto;
  color: var(--mg-muted);
  font-size: 14px;
}

.mg-demo2-amt-btns {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-bottom: 10px;
  width: 100%;
}

.mg-demo2-amt {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 4px;
  border-radius: 8px;
  border: 1px solid rgba(122, 61, 255, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 38%),
    linear-gradient(180deg, #3a3278, #25224f);
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
}

.mg-demo2-amt.is-reset {
  flex: 0.95 1 0;
}

.mg-demo2-slip-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

.mg-demo2-slip-side-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 100%;
  height: 100%;
}

.mg-demo2-slip-side-stack .mg-demo2-slip-amount-wrap,
.mg-demo2-slip-side-stack .mg-demo2-slip-balance-wrap {
  flex: 1 1 0;
  min-height: 0;
}

.mg-demo2-slip-amount-wrap .mg-demo2-slip-label,
.mg-demo2-slip-balance-wrap .mg-demo2-slip-label {
  margin-bottom: 6px;
}

.mg-demo2-amount {
  width: 100%;
  color: var(--mg-text);
}

.mg-demo2-submit {
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 40%),
    linear-gradient(90deg, #9a38ff 0%, #6b1eff 55%, #4d7dff 100%);
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(107, 30, 255, 0.35);
}

@media (max-width: 1100px) {
  .mg-demo2-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .mg-demo2-quadrant-tl {
    order: 1;
  }

  .mg-demo2-quadrant-bl {
    order: 2;
    flex: none;
  }

  .mg-demo2-quadrant-br {
    order: 3;
  }

  .mg-demo2-quadrant-tr {
    order: 4;
  }

  .mg-demo2-quadrant-tr.mg-demo2-bet-history {
    max-height: none;
    min-height: 0;
  }

  .mg-demo2-live-only .mg-demo2-live-wrap {
    min-height: 320px;
  }

  .mg-demo2-market-rows,
  .mg-demo2-market-layout,
  .mg-demo2-market-pane-wrap,
  .mg-demo2-market-pane,
  .mg-demo2-market-rows-stack {
    flex: none;
    height: auto;
    min-height: 0;
  }

  .mg-demo2-market-row-no-label {
    flex: none;
  }

  .mg-demo2-market-row-no-label .mg-demo2-market-row-btns {
    flex: none;
    height: auto;
  }

  .mg-demo2-market-row-btns .mg-demo2-market-btn,
  .mg-demo2-market-pane[data-mg-mode-pane="combo"] .mg-demo2-market-btn {
    height: auto;
    min-height: 48px;
  }

  .mg-demo2-ladder-layout {
    flex: none;
    height: auto;
  }

  .mg-demo2-ladder-row {
    flex: none;
  }

  .mg-demo2-ladder-row .mg-demo2-market-row-btns {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: auto;
  }

  .mg-demo2-market-mode-nav {
    height: auto;
  }

  .mg-demo2-amt-btns {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .mg-demo2-amt {
    flex: none;
    min-width: 0;
    padding: 10px 4px;
    font-size: 12px;
  }

  .mg-demo2-amt.is-reset {
    flex: none;
  }

  .mg-demo2-slip-row {
    grid-template-columns: 1fr;
  }

  .mg-demo2-slip-info {
    min-height: 0;
  }

  .mg-demo2-slip-side-stack {
    min-height: 0;
    height: auto;
  }

  .mg-demo2-slip-side-stack .mg-demo2-slip-amount-wrap,
  .mg-demo2-slip-side-stack .mg-demo2-slip-balance-wrap {
    flex: none;
  }
}

@media (max-width: 760px) {
  .mg-demo2-market-layout {
    grid-template-columns: 1fr;
  }

  .mg-demo2-market-mode-nav {
    flex-direction: row;
  }

  .mg-demo2-market-mode {
    flex: 1;
    min-height: auto;
  }

  /* 조합베팅 탭: 좌 파란 / 우 빨간 2열 */
  .mg-demo2-market-pane[data-mg-mode-pane="combo"] .mg-demo2-market-rows-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .mg-demo2-market-pane[data-mg-mode-pane="combo"] .mg-demo2-market-row-no-label {
    display: contents;
  }

  .mg-demo2-market-pane[data-mg-mode-pane="combo"] .mg-demo2-market-row-no-label .mg-demo2-market-row-btns {
    display: contents;
  }

  .mg-demo2-market-pane[data-mg-mode-pane="combo"] .mg-demo2-market-btn[data-code="nb_odd_under"] { order: 1; }
  .mg-demo2-market-pane[data-mg-mode-pane="combo"] .mg-demo2-market-btn[data-code="nb_even_under"] { order: 2; }
  .mg-demo2-market-pane[data-mg-mode-pane="combo"] .mg-demo2-market-btn[data-code="nb_odd_over"] { order: 3; }
  .mg-demo2-market-pane[data-mg-mode-pane="combo"] .mg-demo2-market-btn[data-code="nb_even_over"] { order: 4; }
  .mg-demo2-market-pane[data-mg-mode-pane="combo"] .mg-demo2-market-btn[data-code="nb_odd_small"] { order: 5; }
  .mg-demo2-market-pane[data-mg-mode-pane="combo"] .mg-demo2-market-btn[data-code="nb_even_small"] { order: 6; }
  .mg-demo2-market-pane[data-mg-mode-pane="combo"] .mg-demo2-market-btn[data-code="nb_odd_mid"] { order: 7; }
  .mg-demo2-market-pane[data-mg-mode-pane="combo"] .mg-demo2-market-btn[data-code="nb_even_mid"] { order: 8; }
  .mg-demo2-market-pane[data-mg-mode-pane="combo"] .mg-demo2-market-btn[data-code="nb_odd_large"] { order: 9; }
  .mg-demo2-market-pane[data-mg-mode-pane="combo"] .mg-demo2-market-btn[data-code="nb_even_large"] { order: 10; }
  .mg-demo2-market-pane[data-mg-mode-pane="combo"] .mg-demo2-market-btn[data-code="pb_odd_under"] { order: 11; }
  .mg-demo2-market-pane[data-mg-mode-pane="combo"] .mg-demo2-market-btn[data-code="pb_even_under"] { order: 12; }
  .mg-demo2-market-pane[data-mg-mode-pane="combo"] .mg-demo2-market-btn[data-code="pb_odd_over"] { order: 13; }
  .mg-demo2-market-pane[data-mg-mode-pane="combo"] .mg-demo2-market-btn[data-code="pb_even_over"] { order: 14; }

  /* 일반베팅: 좌 파란 / 우 빨간 2열 */
  .mg-demo2-market-pane[data-mg-mode-pane="basic"] .mg-demo2-market-rows-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .mg-demo2-market-pane[data-mg-mode-pane="basic"] .mg-demo2-market-row-no-label {
    display: contents;
  }

  .mg-demo2-market-pane[data-mg-mode-pane="basic"] .mg-demo2-market-row-no-label .mg-demo2-market-row-btns {
    display: contents;
  }

  .mg-demo2-market-pane[data-mg-mode-pane="basic"] .mg-demo2-market-btn[data-code="nb_odd"] { order: 1; }
  .mg-demo2-market-pane[data-mg-mode-pane="basic"] .mg-demo2-market-btn[data-code="nb_even"] { order: 2; }
  .mg-demo2-market-pane[data-mg-mode-pane="basic"] .mg-demo2-market-btn[data-code="nb_under"] { order: 3; }
  .mg-demo2-market-pane[data-mg-mode-pane="basic"] .mg-demo2-market-btn[data-code="nb_over"] { order: 4; }
  .mg-demo2-market-pane[data-mg-mode-pane="basic"] .mg-demo2-market-btn[data-code="pb_odd"] { order: 5; }
  .mg-demo2-market-pane[data-mg-mode-pane="basic"] .mg-demo2-market-btn[data-code="pb_even"] { order: 6; }
  .mg-demo2-market-pane[data-mg-mode-pane="basic"] .mg-demo2-market-btn[data-code="pb_under"] { order: 7; }
  .mg-demo2-market-pane[data-mg-mode-pane="basic"] .mg-demo2-market-btn[data-code="pb_over"] { order: 8; }

  /* 사다리: 좌 빨간 / 우 파란 2열 5행 */
  .mg-demo2-ladder-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    flex: none;
    height: auto;
  }

  .mg-demo2-ladder-row {
    display: contents;
  }

  .mg-demo2-ladder-row .mg-demo2-market-row-btns {
    display: contents;
  }

  .mg-demo2-ladder-row .mg-demo2-market-btn {
    min-height: 48px;
    height: auto;
  }

  .mg-demo2-ladder-row-red .mg-demo2-market-btn[data-code="lr_right"] { order: 1; }
  .mg-demo2-ladder-row-blue .mg-demo2-market-btn[data-code="lr_left"] { order: 2; }
  .mg-demo2-ladder-row-red .mg-demo2-market-btn[data-code="line_4"] { order: 3; }
  .mg-demo2-ladder-row-blue .mg-demo2-market-btn[data-code="line_3"] { order: 4; }
  .mg-demo2-ladder-row-red .mg-demo2-market-btn[data-code="oe_even"] { order: 5; }
  .mg-demo2-ladder-row-blue .mg-demo2-market-btn[data-code="oe_odd"] { order: 6; }
  .mg-demo2-ladder-row-red .mg-demo2-market-btn[data-code="combo_right_3"] { order: 7; }
  .mg-demo2-ladder-row-blue .mg-demo2-market-btn[data-code="combo_left_3"] { order: 8; }
  .mg-demo2-ladder-row-red .mg-demo2-market-btn[data-code="combo_right_4"] { order: 9; }
  .mg-demo2-ladder-row-blue .mg-demo2-market-btn[data-code="combo_left_4"] { order: 10; }

  .mg-demo2-market-row {
    grid-template-columns: 1fr;
  }

  .mg-demo2-market-row-label {
    min-height: auto;
  }

  .mg-demo2-market-row-btns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mg-demo2-game-grid {
    grid-template-columns: 1fr;
  }

  .mg-demo2-game-header {
    min-height: 72px;
  }

  .mg-demo2-bet-top {
    flex-direction: column;
    align-items: flex-start;
    font-size: 14px;
  }

  .mg-demo2-three-col {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .mg-demo2-bet-row {
    grid-template-columns: 1fr 34px 1fr;
  }

  .mg-demo2-market-btn {
    font-size: 12px;
    padding: 10px 6px;
  }
}

/* demo2 미니게임 목록 — 보라 그라데이션 패널 */
.mg-minigame-nav {
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(122, 61, 255, 0.42);
  background:
    radial-gradient(ellipse at 10% 0%, rgba(122, 61, 255, 0.24), transparent 52%),
    linear-gradient(165deg, #221046 0%, #120c28 52%, #090818 100%);
  box-shadow: 0 0 18px rgba(122, 49, 255, 0.18);
}

.mg-nav-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 12px rgba(174, 61, 255, 0.45);
}

.mg-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mg-nav-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(122, 61, 255, 0.32);
  background: linear-gradient(180deg, rgba(26, 22, 48, 0.92), rgba(11, 12, 33, 0.96));
  color: #f4f4f5;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
}

.mg-nav-card:hover {
  border-color: rgba(154, 56, 255, 0.55);
  box-shadow: 0 0 12px rgba(122, 49, 255, 0.2);
}

.mg-nav-card.is-active {
  border-color: #7eb6ff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 42%),
    linear-gradient(90deg, rgba(122, 61, 255, 0.55), rgba(77, 125, 255, 0.35));
  box-shadow: 0 0 14px rgba(77, 125, 255, 0.28);
}

.mg-nav-card.is-stopped {
  opacity: 0.72;
  border-color: rgba(255, 47, 100, 0.35);
}

.mg-nav-maint-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff2f64, #d81f52);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.mg-nav-name {
  font-size: 14px;
  font-weight: 700;
}

.mg-nav-meta {
  font-size: 11px;
  color: var(--mg-muted, #aaa6c7);
}

.mg-minigame-index-hint {
  padding: 40px 16px;
  text-align: center;
  color: var(--mg-muted, #aaa6c7);
  font-size: 14px;
}

@media (max-width: 768px) {
  .mg-nav-grid {
    grid-template-columns: 1fr;
  }
}

/* ── 베팅 알림/확인 모달 ── */
body.mg-demo2-modal-open {
  overflow: hidden;
}

.mg-demo2-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(4, 3, 12, 0.78);
  backdrop-filter: blur(6px);
}

.mg-demo2-modal-overlay[hidden] {
  display: none !important;
}

.mg-demo2-modal {
  width: min(100%, 420px);
  padding: 22px 22px 18px;
  border-radius: 18px;
  animation: mg-demo2-modal-in 0.22s ease-out;
}

@keyframes mg-demo2-modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mg-demo2-modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.mg-demo2-modal-badge {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(180deg, rgba(154, 56, 255, 0.35), rgba(77, 125, 255, 0.18));
  border: 1px solid rgba(180, 60, 255, 0.45);
  box-shadow: 0 0 16px rgba(122, 49, 255, 0.25);
}

.mg-demo2-modal.is-alert .mg-demo2-modal-badge::before {
  content: "!";
  color: #f7f5ff;
}

.mg-demo2-modal.is-success .mg-demo2-modal-badge {
  background: linear-gradient(180deg, rgba(16, 200, 255, 0.35), rgba(49, 196, 81, 0.18));
  border-color: rgba(16, 200, 255, 0.55);
  box-shadow: 0 0 16px rgba(16, 200, 255, 0.22);
}

.mg-demo2-modal.is-success .mg-demo2-modal-badge::before {
  content: "✓";
  color: #10c8ff;
}

.mg-demo2-modal.is-error .mg-demo2-modal-badge {
  background: linear-gradient(180deg, rgba(255, 47, 100, 0.35), rgba(255, 47, 100, 0.12));
  border-color: rgba(255, 47, 100, 0.55);
  box-shadow: 0 0 16px rgba(255, 47, 100, 0.22);
}

.mg-demo2-modal.is-error .mg-demo2-modal-badge::before {
  content: "!";
  color: #ff5f88;
}

.mg-demo2-modal.is-confirm .mg-demo2-modal-badge::before {
  content: "?";
  color: #b43cff;
}

.mg-demo2-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--mg-text, #f7f5ff);
}

.mg-demo2-modal-body {
  position: relative;
  z-index: 1;
  font-size: 14px;
  line-height: 1.55;
  color: var(--mg-muted, #aaa6c7);
  word-break: keep-all;
}

.mg-demo2-modal-body.has-html {
  color: var(--mg-text, #f7f5ff);
}

.mg-demo2-modal-lead {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--mg-cyan, #10c8ff);
  font-weight: 700;
}

.mg-demo2-modal-detail {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  border: 1px solid rgba(122, 61, 255, 0.35);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(8, 7, 22, 0.55);
}

.mg-demo2-modal-detail li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-top: 1px solid rgba(122, 61, 255, 0.18);
}

.mg-demo2-modal-detail li:first-child {
  border-top: 0;
}

.mg-demo2-modal-detail li span {
  font-size: 13px;
  color: var(--mg-muted, #aaa6c7);
}

.mg-demo2-modal-detail li strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--mg-text, #f7f5ff);
  text-align: right;
}

.mg-demo2-modal-detail li.is-highlight strong {
  color: var(--mg-cyan, #10c8ff);
}

.mg-demo2-modal-note {
  margin: 0;
  font-size: 13px;
  color: var(--mg-muted, #aaa6c7);
  text-align: center;
}

.mg-demo2-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.mg-demo2-modal-actions:has(.is-cancel[style*="display: none"]),
.mg-demo2-modal-actions:has(.is-cancel:hidden) {
  justify-content: stretch;
}

.mg-demo2-modal-btn {
  flex: 1;
  min-height: 46px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(122, 61, 255, 0.45);
  background: linear-gradient(180deg, #15102e, #0b0c21);
  color: var(--mg-text, #f7f5ff);
  font-weight: 700;
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}

.mg-demo2-modal-btn:hover {
  border-color: rgba(180, 60, 255, 0.7);
}

.mg-demo2-modal-btn:active {
  transform: translateY(1px);
}

.mg-demo2-modal-btn.is-confirm {
  border: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 40%),
    linear-gradient(90deg, #9a38ff 0%, #6b1eff 55%, #4d7dff 100%);
  box-shadow: 0 8px 20px rgba(107, 30, 255, 0.35);
}

.mg-demo2-modal.is-success .mg-demo2-modal-btn.is-confirm {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 40%),
    linear-gradient(90deg, #10c8ff 0%, #31c451 100%);
  box-shadow: 0 8px 20px rgba(16, 200, 255, 0.28);
}

.mg-demo2-modal.is-error .mg-demo2-modal-btn.is-confirm {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 40%),
    linear-gradient(90deg, #ff2f64 0%, #c41e52 100%);
  box-shadow: 0 8px 20px rgba(255, 47, 100, 0.28);
}

@media (max-width: 480px) {
  .mg-demo2-modal {
    padding: 18px 16px 14px;
  }

  .mg-demo2-modal-actions {
    flex-direction: column-reverse;
  }
}
