:root {
  /* mybc brand palette — shared with rps/mines/tower/limbo/hilo */
  --panel:        #23204E;
  --board:        #120D24;
  --card-bg:      #23204E;
  --card-shadow:  #0a0818;
  --elevated:     #272859;
  --hairline:     rgba(255, 255, 255, 0.06);
  --toggle-bg:    rgba(30, 24, 69, 0.8);
  --toggle-border:rgba(255, 255, 255, 0.12);
  --input-border: rgba(255, 255, 255, 0.10);
  --input-bg:     #23204E;

  --text:         #FFFFFF;
  --text-75:      rgba(255, 255, 255, 0.75);
  --text-mid:     #8B8BA3;
  --text-dim:     rgba(139, 139, 163, 0.50);
  --text-dimmer:  #5C5C7A;

  --accent:       #F7931A;
  --accent-border:rgba(247, 147, 26, 0.45);
  --accent-glow:  rgba(247, 147, 26, 0.20);

  --green:        #0ECC68;
  --green-bright: #10e676;
  --green-bg:     rgba(14, 204, 104, 0.12);
  --red:          #F85F5D;
  --red-bg:       rgba(248, 95, 93, 0.15);

  --field-line:   rgba(255, 255, 255, 0.22);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  background: var(--board);
  color: var(--text);
  font-family: 'Montserrat', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
body {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* #root wraps the app (createRoot mount) — must pass the full height through,
   else .app { height:100% } collapses and the field disappears. */
#root {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== APP FRAME — slot style vertical ===== */
.app {
  width: 520px;
  height: 920px;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  background: transparent;
  box-shadow: 0 40px 100px -20px rgba(0,0,0,0.7), 0 0 0 1px rgba(47, 69, 83, 0.30);
}

/* ===== Loading splash (parity with the other games) ===== */
/* Loading splash — matches mines/rps/hilo (MYBC logo + fill bar + dim text) */
.loading-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--board);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.loading-content { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.loading-logo { width: 80px; height: auto; }
.loading-bar-wrap { width: 160px; height: 3px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.loading-bar { width: 100%; height: 100%; background: var(--accent); border-radius: 3px; animation: loadFill 2.2s ease forwards; }
.loading-text { font-size: 11px; color: rgba(255,255,255,0.35); margin-top: 4px; }
@keyframes loadFill { 0% { width: 0%; } 100% { width: 100%; } }

/* ===== Header action row + dots menu (parity) ===== */
.header-right .hdr-btn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--toggle-border); border-radius: 8px; background: transparent; color: var(--text-mid); cursor: pointer; transition: all 0.15s; flex-shrink: 0; }
.header-right .hdr-btn:hover { border-color: var(--accent-border); color: var(--text); background: rgba(255,255,255,0.04); }
.header-right .hdr-btn svg { width: 15px; height: 15px; }
.header-right .hdr-info { font-size: 13px; font-weight: 800; }
.header-right .hdr-desktop { display: flex; }
.header-right .hdr-mobile { display: none; }
.hdr-dots { position: relative; }
.dots-menu { display: none; position: absolute; top: calc(100% + 6px); right: 0; background: var(--panel); border: 1px solid var(--hairline); border-radius: 12px; padding: 4px; min-width: 160px; box-shadow: 0 12px 40px rgba(0,0,0,0.5); z-index: 60; flex-direction: column; }
.dots-menu.open { display: flex; }
.dots-menu-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: 12px; font-weight: 500; color: var(--text-75); cursor: pointer; transition: background 0.12s; white-space: nowrap; }
.dots-menu-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.dots-menu-item svg { width: 16px; height: 16px; flex-shrink: 0; }
@media (max-width: 420px) {
  .header-right .hdr-desktop { display: none; }
  .header-right .hdr-mobile { display: flex; }
}
.ic.faved { color: var(--accent); }
.ic.faved svg { fill: var(--accent); }

/* ===== Standardized bet panel (parity) ===== */
.stake-bet { display: flex; gap: 6px; width: 100%; align-items: stretch; }
.stake-left { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.risk-label { font-size: 11px; font-weight: 600; color: var(--text-mid); text-transform: uppercase; letter-spacing: 0.04em; }
.stake-input { display: flex; align-items: center; gap: 0; background: var(--board); border: 1px solid var(--hairline); border-radius: 10px; height: 38px; overflow: hidden; }
.stake-pm { width: 38px; height: 100%; background: none; border: none; color: var(--text-mid); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: color 0.12s; -webkit-tap-highlight-color: transparent; }
.stake-pm:active { color: var(--text); }
.stake-amount { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--text); font-size: 14px; font-weight: 600; text-align: center; font-family: inherit; -moz-appearance: textfield; }
.stake-amount::-webkit-inner-spin-button, .stake-amount::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stake-bal { display: none; align-items: center; align-self: stretch; white-space: nowrap; font-size: 11px; font-weight: 700; color: var(--accent); border-left: 1px solid var(--hairline); padding: 0 12px 0 10px; flex-shrink: 0; }
.stake-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.stake-chip { height: 28px; background: var(--board); border: 1px solid var(--hairline); border-radius: 6px; color: var(--text-mid); font-size: 11px; font-weight: 600; cursor: pointer; transition: all 0.12s; font-family: inherit; -webkit-tap-highlight-color: transparent; }
.stake-chip:active { background: rgba(255,255,255,0.08); color: var(--text); }
.stake-bet .place-btn { display: flex; flex: 1; min-width: 0; width: 100%; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: auto; border: none; border-radius: 10px; background: linear-gradient(135deg, #F7931A 0%, #E67A00 100%); color: #fff; font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: filter 0.12s; }
.stake-bet .place-btn:hover:not(:disabled) { filter: brightness(1.06); }
.stake-bet .place-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.stake-bet-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.1; opacity: 0.85; }
.stake-bet-amount { font-size: 16px; font-weight: 800; line-height: 1.1; }
.sp-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; }
.stake-right { flex: 0 0 44%; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.speed-toggle { display: flex; gap: 4px; width: 100%; background: var(--board); border: 1px solid var(--hairline); border-radius: 9px; padding: 3px; }
.speed-opt { flex: 1; height: 26px; padding: 0; border: none; border-radius: 6px; background: transparent; color: var(--text-mid); font-family: inherit; font-size: 11px; font-weight: 700; cursor: pointer; transition: all 0.15s; -webkit-tap-highlight-color: transparent; }
.speed-opt.active { background: linear-gradient(135deg, #F7931A 0%, #E67A00 100%); color: #fff; }
.sp-payout { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.sp-payout-label { color: var(--text-mid); font-weight: 600; }
.sp-payout-val { color: var(--green); font-weight: 800; font-variant-numeric: tabular-nums; }
.sp-change-team { display: none; align-items: center; gap: 5px; background: transparent; border: 1px solid var(--toggle-border); border-radius: 8px; padding: 6px 10px; color: var(--text-mid); font-family: inherit; font-size: 11px; font-weight: 700; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sp-change-team:active { color: var(--text); border-color: var(--accent-border); }
.sp-change-team svg { flex-shrink: 0; }

/* ===== Free rounds (indicator + modals) ===== */
.free-round-slot { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 6px 14px; height: 42px; background: linear-gradient(135deg, rgba(247, 147, 26,0.15) 0%, rgba(247, 147, 26,0.05) 100%); border: 1px solid rgba(247, 147, 26,0.35); border-radius: 10px; }
.free-round-ico { display: flex; align-items: center; color: var(--accent); }
.free-round-ico svg { width: 16px; height: 16px; }
.frs-row1 { display: flex; align-items: center; gap: 8px; }
.frs-label { font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: 0.04em; font-size: 12px; }
.frs-count { margin-left: auto; font-weight: 700; color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.frs-row2 { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-mid); font-weight: 600; white-space: nowrap; }
.frs-bet { color: var(--text); font-weight: 700; }
.frs-tw { margin-left: auto; }
.frs-row2 b { color: var(--green); font-weight: 800; font-variant-numeric: tabular-nums; }
.place-btn.free-mode { background: linear-gradient(135deg, #F7931A 0%, #E67A00 100%); }

.free-bet-welcome, .free-bet-summary { text-align: center; }
.free-bet-welcome h2, .free-bet-summary h2 { font-size: 18px; font-weight: 800; margin-bottom: 4px; color: var(--text); }
.fbw-icon, .fbs-icon { width: 64px; height: 64px; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; border-radius: 18px; background: rgba(247, 147, 26,0.14); border: 1px solid rgba(247, 147, 26,0.30); color: var(--accent); }
.fbw-icon svg, .fbs-icon svg { width: 34px; height: 34px; }
.fbw-desc { font-size: 15px; color: var(--text-mid); line-height: 1.5; margin-bottom: 4px; }
.fbw-hl { color: var(--accent); font-weight: 800; }
.fbw-sub { font-size: 13px; color: var(--text-mid); line-height: 1.6; margin-bottom: 18px; }
.fbw-sub strong { color: var(--text); font-weight: 800; }
.fbw-btn, .fbs-btn { display: block; width: 100%; height: 50px; margin-top: 16px; border: none; border-radius: 10px; background: linear-gradient(135deg, #F7931A 0%, #E67A00 100%); color: #fff; font-family: inherit; font-weight: 800; font-size: 15px; cursor: pointer; text-transform: uppercase; letter-spacing: 0.04em; transition: filter 0.15s; }
.fbw-btn:hover, .fbs-btn:hover { filter: brightness(1.06); }
.fbs-played { font-size: 14px; color: var(--text-mid); margin-bottom: 14px; }
.fbs-played strong { color: var(--text); font-weight: 800; }
.fbs-total { font-size: 20px; font-weight: 800; white-space: nowrap; margin: 4px 0 16px; }

/* ===== HEADER ===== */
.header {
  display: flex;
  height: 48px;
  background: var(--panel);
  border-bottom: 1px solid var(--hairline);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  z-index: 10;
}
.header-left { display: flex; align-items: center; gap: 8px; }
.game-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.game-name .ico { font-size: 16px; color: var(--accent); }
.header-balance {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  margin-right: 8px;
}
.header-bal-icon { font-size: 14px; font-weight: 700; color: var(--accent); }
.header-bal-value {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.header-right { display: flex; align-items: center; gap: 6px; }

/* Header scoreboard mode */
.hdr-team {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hdr-flag {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.15);
}
.hdr-code {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.hdr-code.off { color: var(--green); }
.hdr-code.def { color: var(--accent); }
.hdr-score-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.hdr-score {
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.04em;
  line-height: 1;
}
.hdr-phase-row {
  display: flex;
  align-items: center;
  gap: 5px;
}
.hdr-phase {
  font-size: 8px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}
.hdr-timer {
  width: 40px;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}
.hdr-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--accent));
  border-radius: 2px;
  transition: width 0.15s linear;
}
.wl-display {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  display: flex;
  gap: 8px;
}
.wl-display .w-val { color: var(--green); }
.wl-display .l-val { color: var(--red); }

/* ===== HISTORY BAR ===== */
.history-bar {
  display: none;
  align-items: center;
  gap: 5px;
  padding: 6px 16px;
  background: rgba(26, 44, 56, 0.5);
  border-bottom: 1px solid var(--hairline);
  overflow-x: auto;
  flex-shrink: 0;
  height: 34px;
}
.history-bar::-webkit-scrollbar { height: 2px; }
.history-bar::-webkit-scrollbar-track { background: transparent; }
.history-bar::-webkit-scrollbar-thumb { background: rgba(145,159,192,0.12); border-radius: 1px; }
.history-empty {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  font-weight: 500;
}
.history-chip {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  animation: chipSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transition: transform 0.15s ease;
}
.history-chip:hover { transform: scale(1.08); }
@keyframes chipSlideIn {
  0% { opacity: 0; transform: translateX(-10px) scale(0.8); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
.history-chip.hc-win {
  background: rgba(14, 204, 104, 0.10);
  color: var(--green);
  border: 1px solid rgba(14, 204, 104, 0.25);
}
.history-chip.hc-lose {
  background: rgba(145, 159, 192, 0.10);
  color: var(--text-mid);
  border: 1px solid rgba(145, 159, 192, 0.22);
}

/* ===== FOOTBALL FIELD (vertical, takes center) ===== */
.field-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--board);
  padding: 24px 12px;
  min-height: 0;
  position: relative;
}

.football-field {
  position: relative;
  aspect-ratio: 44 / 58;
  width: auto;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  background:
    linear-gradient(180deg,
      #267a3d 0%,
      #1e6832 20%,
      #24723a 40%,
      #1d6530 60%,
      #236f38 80%,
      #267a3d 100%
    );
  border-radius: 10px;
  border: 3px solid rgba(255,255,255,0.25);
  overflow: visible;
  box-shadow:
    0 16px 50px rgba(0,0,0,0.5),
    inset 0 0 60px rgba(0,0,0,0.1),
    inset 0 0 120px rgba(0,50,0,0.1);
  transition: box-shadow 0.3s ease;
}
.football-field.goal-active {
  box-shadow:
    0 16px 50px rgba(0,0,0,0.5),
    inset 0 0 60px rgba(0,0,0,0.1),
    0 0 40px rgba(14, 204, 104, 0.15);
}

/* Field clip — keeps grass/lines inside rounded corners */
.field-clip {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  overflow: hidden;
  z-index: 0;
  background:
    linear-gradient(180deg,
      #267a3d 0%,
      #1e6832 20%,
      #24723a 40%,
      #1d6530 60%,
      #236f38 80%,
      #267a3d 100%
    );
}

/* Grass stripes — alternating mow lines */
.field-stripes {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(255,255,255,0.02) 0px,
    rgba(255,255,255,0.02) 32px,
    rgba(0,0,0,0.02) 32px,
    rgba(0,0,0,0.02) 64px
  );
}
/* Subtle grass texture overlay */
.field-stripes::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.015) 1px, transparent 1px),
    radial-gradient(circle at 60% 70%, rgba(255,255,255,0.01) 1px, transparent 1px),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 13px 13px, 17px 17px, 11px 11px;
}

/* Center line — horizontal */
.center-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--field-line);
}

/* Center circle */
.center-circle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 80px;
  height: 80px;
  margin: -40px 0 0 -40px;
  border: 2px solid var(--field-line);
  border-radius: 50%;
}
.center-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--field-line);
  border-radius: 50%;
}

/* Goal areas — top and bottom */
.goal-area {
  position: absolute;
  left: 50%;
  height: 40px;
  width: 120px;
  margin-left: -60px;
  border: 2px solid var(--field-line);
  background: transparent;
}
.goal-area.top {
  top: 0;
  border-top: none;
  border-radius: 0 0 8px 8px;
}
.goal-area.bottom {
  bottom: 0;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
}

/* Penalty areas */
.penalty-area {
  position: absolute;
  left: 50%;
  height: 90px;
  width: 220px;
  margin-left: -110px;
  border: 2px solid var(--field-line);
  background: transparent;
  overflow: hidden;
}
.penalty-area.top {
  top: 0;
  border-top: none;
  border-radius: 0 0 6px 6px;
}
.penalty-area.bottom {
  bottom: 0;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
}

/* ===== GOALS — posts + crossbar + subtle net ===== */
.goal-frame {
  position: absolute;
  left: 50%;
  width: 130px;
  margin-left: -65px;
  z-index: 2;
}
.goal-frame.top {
  top: -16px;
  height: 20px;
}
.goal-frame.bottom {
  bottom: -16px;
  height: 20px;
}

/* Net mesh overlay */
.goal-net-mesh {
  position: absolute;
  left: 4px;
  right: 4px;
  background:
    repeating-linear-gradient(90deg, transparent, transparent 8px, rgba(255,255,255,0.1) 8px, rgba(255,255,255,0.1) 9px),
    repeating-linear-gradient(180deg, transparent, transparent 6px, rgba(255,255,255,0.07) 6px, rgba(255,255,255,0.07) 7px);
}
.goal-frame.top .goal-net-mesh {
  top: 0;
  bottom: 3px;
  border-radius: 3px 3px 0 0;
  background-color: #236f38;
}
.goal-frame.bottom .goal-net-mesh {
  top: 3px;
  bottom: 0;
  border-radius: 0 0 3px 3px;
  background-color: #267a3d;
}

/* Goal posts */
.goal-post {
  position: absolute;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #e8e8e8, #bbb);
  border-radius: 2px;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.4);
}
.goal-post.left { left: 0; }
.goal-post.right { right: 0; }

/* Crossbar */
.goal-crossbar {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #bbb, #e8e8e8, #bbb);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.goal-frame.top .goal-crossbar { top: 0; }
.goal-frame.bottom .goal-crossbar { bottom: 0; }

/* Flag in penalty area — fills the whole box */
.penalty-flag {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.18;
  pointer-events: none;
  border-radius: inherit;
}

/* Flag behind goal net */
.goal-flag {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0.7;
  z-index: 0;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  border: 2px solid rgba(255,255,255,0.2);
}
.goal-flag.top { top: -10px; }
.goal-flag.bottom { bottom: -10px; }

/* Color accent glow on crossbar */
.goal-crossbar::after {
  content: '';
  position: absolute;
  left: 4px;
  right: 4px;
  height: 2px;
  border-radius: 1px;
}
.goal-frame.top .goal-crossbar::after {
  bottom: -2px;
  background: rgba(14, 204, 104, 0.5);
  box-shadow: 0 0 6px rgba(14, 204, 104, 0.3);
}
.goal-frame.bottom .goal-crossbar::after {
  top: -2px;
  background: rgba(237, 65, 99, 0.5);
  box-shadow: 0 0 6px rgba(237, 65, 99, 0.3);
}

/* Score glow */
.goal-frame.scored .goal-net-mesh {
  transition: box-shadow 0.3s ease;
}
.goal-frame.top.scored .goal-net-mesh {
  box-shadow: 0 0 20px rgba(14, 204, 104, 0.5);
  background-color: rgba(14, 204, 104, 0.2);
}
.goal-frame.bottom.scored .goal-net-mesh {
  box-shadow: 0 0 20px rgba(237, 65, 99, 0.5);
  background-color: rgba(237, 65, 99, 0.2);
}
.goal-frame.scored .goal-crossbar {
  animation: barFlash 0.6s ease-out;
}
@keyframes barFlash {
  0% { filter: brightness(1); }
  30% { filter: brightness(1.8); }
  100% { filter: brightness(1); }
}

/* Corner arcs */
.corner-arc {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--field-line);
  z-index: 1;
}
.corner-arc.tl { top: 0; left: 0; border-radius: 0 0 100% 0; border-top: none; border-left: none; }
.corner-arc.tr { top: 0; right: 0; border-radius: 0 0 0 100%; border-top: none; border-right: none; }
.corner-arc.bl { bottom: 0; left: 0; border-radius: 0 100% 0 0; border-bottom: none; border-left: none; }
.corner-arc.br { bottom: 0; right: 0; border-radius: 100% 0 0 0; border-bottom: none; border-right: none; }


/* Penalty dots */
.penalty-dot {
  position: absolute;
  left: 50%;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  background: var(--field-line);
  border-radius: 50%;
  z-index: 1;
}
.penalty-dot.top { top: 60px; }
.penalty-dot.bottom { bottom: 60px; }

/* Crowd stands — dark borders around field */
.crowd-stands {
  position: absolute;
  inset: -8px;
  border-radius: 14px;
  z-index: -1;
  background:
    linear-gradient(180deg, #0a1620 0%, #0d1e2c 50%, #0a1620 100%);
  border: 1px solid rgba(85,112,134,0.15);
  overflow: hidden;
}
/* Crowd dots pattern */
.crowd-stands::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,200,100,0.04) 1px, transparent 1px),
    radial-gradient(circle, rgba(200,200,255,0.03) 1px, transparent 1px);
  background-size: 6px 5px, 8px 7px;
  background-position: 0 0, 3px 2px;
}

/* Floodlight glow from corners */
.floodlight {
  position: absolute;
  width: 100px;
  height: 100px;
  pointer-events: none;
  z-index: -1;
  opacity: 0.08;
  background: radial-gradient(circle, rgba(255,255,200,0.8) 0%, transparent 70%);
}
.floodlight.fl-tl { top: -20px; left: -20px; }
.floodlight.fl-tr { top: -20px; right: -20px; }
.floodlight.fl-bl { bottom: -20px; left: -20px; }
.floodlight.fl-br { bottom: -20px; right: -20px; }

/* Team banner strips on the sides */
.team-banner {
  position: absolute;
  top: 50%;
  width: 6px;
  height: 60px;
  margin-top: -30px;
  border-radius: 3px;
  z-index: -1;
  opacity: 0.5;
}
.team-banner.left { left: -12px; }
.team-banner.right { right: -12px; }

/* Camera shake */
.field-area.shake {
  animation: cameraShake 0.4s ease-out;
}
@keyframes cameraShake {
  0% { transform: translate(0, 0); }
  15% { transform: translate(-3px, 2px); }
  30% { transform: translate(3px, -2px); }
  45% { transform: translate(-2px, 1px); }
  60% { transform: translate(2px, -1px); }
  75% { transform: translate(-1px, 1px); }
  100% { transform: translate(0, 0); }
}

/* Confetti particles */
.confetti-bit {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  pointer-events: none;
  z-index: 25;
  animation: confettiFall 1.8s ease-out forwards;
}
@keyframes confettiFall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translateY(120px) rotate(720deg) scale(0.3); }
}

/* Match timer bar on field */
.match-timer-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 4;
  border-radius: 2px 2px 0 0;
  overflow: hidden;
  background: rgba(0,0,0,0.2);
}
.match-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--accent));
  transition: width 0.1s linear;
  border-radius: 2px;
}

/* Possession indicator */
.possession-indicator {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(0,0,0,0.4);
  border-radius: 10px;
  z-index: 4;
  font-size: 9px;
  font-weight: 700;
  backdrop-filter: blur(4px);
}
.poss-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.poss-label {
  color: var(--text-75);
}

/* ===== PLAYERS ===== */
.player {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  z-index: 5;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.45);
  transition: left 0.06s linear,
              top 0.06s linear,
              transform 0.2s ease,
              opacity 0.25s ease,
              box-shadow 0.2s ease;
  will-change: left, top, transform;
}
/* Smooth repositioning when formation changes */
.player:not(.running) {
  transition: left 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
              top 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 0.3s ease,
              opacity 0.5s ease,
              box-shadow 0.2s ease;
}
/* New player fades in gently */
.player.entering {
  animation: playerFadeIn 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}
@keyframes playerFadeIn {
  0% { opacity: 0; transform: scale(0.6); }
  100% { opacity: 1; transform: scale(1); }
}
/* Flag image fills player circle */
.player-flag {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  pointer-events: none;
  display: block;
}

/* Running — fast transitions for gameplay, overrides formation slide */
.player.running {
  animation: playerBob 0.3s ease-in-out infinite;
  transition: left 0.06s linear,
              top 0.06s linear,
              transform 0.2s ease,
              opacity 0.25s ease,
              box-shadow 0.2s ease !important;
}
@keyframes playerBob {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -2px; }
}

.player.offense {
  background: linear-gradient(135deg, #0ECC68 0%, #0aa854 100%);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.45);
}
.player.defense {
  background: linear-gradient(135deg, #F7931A 0%, #E67A00 100%);
  color: #3F260B;
  border: 2px solid rgba(255,255,255,0.35);
}
.player.gk.offense {
  background: linear-gradient(135deg, #0a8a4a, #067035);
  border: 2px solid rgba(255,255,255,0.5);
  box-shadow: 0 3px 10px rgba(0,0,0,0.5), 0 0 8px rgba(10,138,74,0.3);
}
.player.gk.defense {
  background: linear-gradient(135deg, #E67A00, #b8900a);
  border: 2px solid rgba(255,255,255,0.5);
  box-shadow: 0 3px 10px rgba(0,0,0,0.5), 0 0 8px rgba(212,168,16,0.3);
}
.player.has-ball {
  box-shadow: 0 0 18px rgba(255,255,255,0.55), 0 0 8px rgba(14,204,104,0.4), 0 3px 10px rgba(0,0,0,0.45);
  transform: scale(1.18);
  z-index: 8;
}
.player.tackled {
  opacity: 0.3;
  transform: scale(0.7);
  transition: opacity 0.15s ease, transform 0.15s ease;
  animation: none;
}
/* Celebration — scorer jumps */
.player.celebrating {
  animation: celebrate 0.6s ease-out;
  z-index: 10;
}
@keyframes celebrate {
  0% { transform: scale(1); }
  20% { transform: scale(1.3) translateY(-8px); }
  40% { transform: scale(1) translateY(0); }
  55% { transform: scale(1.2) translateY(-5px); }
  70% { transform: scale(1) translateY(0); }
  85% { transform: scale(1.1) translateY(-2px); }
  100% { transform: scale(1) translateY(0); }
}

/* Player shadow on field — stretched like sun shadow */
.player::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 20px;
  height: 8px;
  margin-left: -10px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.25) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
  transform: skewX(-10deg);
}

/* Motion trail — ghost behind moving player */
.player::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.1s;
}
.player.running::before {
  opacity: 0.15;
  transform: translate(2px, 3px) scale(0.9);
  filter: blur(2px);
}

/* ===== BALL — realistic football ===== */
.ball-wrap {
  position: absolute;
  z-index: 9;
  transition: left 0.06s linear,
              top 0.06s linear,
              transform 0.15s ease;
  will-change: left, top, transform;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.ball-wrap.rolling .ball-inner {
  animation: ballSpin 0.5s linear infinite;
}
.ball-wrap.flying {
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.7));
  transform: scale(1.3);
  transition: left 0.08s linear, top 0.08s linear, transform 0.15s ease;
}
.ball-wrap.flying .ball-inner {
  animation: ballSpin 0.15s linear infinite;
}
@keyframes ballSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
/* Ball ground shadow — grows when airborne */
.ball-wrap::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 12px;
  height: 4px;
  margin-left: -6px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.3) 0%, transparent 70%);
  border-radius: 50%;
  transition: all 0.15s;
}
.ball-wrap.flying::after {
  width: 18px;
  height: 6px;
  margin-left: -9px;
  bottom: -8px;
  opacity: 0.5;
}
/* Ball trail when flying */
.ball-trail {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  pointer-events: none;
  z-index: 8;
  animation: trailFade 0.3s ease-out forwards;
}
@keyframes trailFade {
  0% { opacity: 0.4; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.3); }
}
/* Net ripple on goal */
.net-ripple {
  position: absolute;
  left: 50%;
  width: 60px;
  height: 20px;
  margin-left: -30px;
  pointer-events: none;
  z-index: 3;
}
.net-ripple.top { top: -10px; }
.net-ripple.bottom { bottom: -10px; }
.net-ripple::before, .net-ripple::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  animation: netRipple 0.6s ease-out forwards;
}
.net-ripple::after { animation-delay: 0.15s; }
@keyframes netRipple {
  0% { transform: scale(0.3); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}
.ball-inner {
  width: 18px;
  height: 18px;
  position: relative;
}
/* Goal flash — multi-layer pulse */
.goal-flash {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: 8px;
  overflow: hidden;
}
.goal-flash::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center 30%, rgba(14, 204, 104, 0.35) 0%, transparent 65%);
  animation: goalPulse 1.2s ease-out forwards;
}
.goal-flash::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(14, 204, 104, 0.25) 0%, transparent 40%);
  animation: goalWipe 0.8s ease-out forwards;
}
@keyframes goalPulse {
  0% { opacity: 0; transform: scale(0.6); }
  20% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.2); }
}
@keyframes goalWipe {
  0% { opacity: 1; transform: translateY(-100%); }
  40% { opacity: 0.8; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(100%); }
}

/* Goal text */
.goal-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 42px;
  font-weight: 900;
  color: var(--green-bright);
  text-shadow:
    0 0 40px rgba(14, 204, 104, 0.7),
    0 0 80px rgba(14, 204, 104, 0.3),
    0 4px 20px rgba(0,0,0,0.5);
  animation: goalTextPop 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  z-index: 20;
  pointer-events: none;
  letter-spacing: 0.12em;
}
@keyframes goalTextPop {
  0% { transform: translate(-50%, -50%) scale(0.2) rotate(-5deg); opacity: 0; }
  25% { transform: translate(-50%, -50%) scale(1.35) rotate(2deg); opacity: 1; }
  45% { transform: translate(-50%, -50%) scale(0.92) rotate(-1deg); }
  60% { transform: translate(-50%, -50%) scale(1.08) rotate(0deg); }
  80% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 0; }
}

/* Win splash — big amount with sparkle */
.win-splash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 21;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.win-amount {
  font-size: 42px;
  font-weight: 900;
  color: var(--green-bright);
  text-shadow:
    0 0 30px rgba(14, 204, 104, 0.6),
    0 0 60px rgba(14, 204, 104, 0.3),
    0 4px 20px rgba(0, 0, 0, 0.5);
  letter-spacing: -0.02em;
  white-space: nowrap;
  animation: winPop 2.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes winPop {
  0% { opacity: 0; transform: scale(0.3); }
  15% { opacity: 1; transform: scale(1.2); }
  30% { transform: scale(0.95); }
  45% { transform: scale(1.05); }
  60% { transform: scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: scale(0.9) translateY(-20px); }
}
.win-sparkle {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(14, 204, 104, 0.25) 0%, transparent 60%);
  animation: sparkleGlow 2.5s ease-out forwards;
}
@keyframes sparkleGlow {
  0% { opacity: 0; transform: scale(0.2); }
  20% { opacity: 1; transform: scale(1.5); }
  50% { opacity: 0.6; transform: scale(1.8); }
  100% { opacity: 0; transform: scale(2.5); }
}

/* Tackle flash — shockwave ring */
.tackle-flash {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  z-index: 15;
  pointer-events: none;
}
.tackle-flash::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 3px solid rgba(237, 65, 99, 0.6);
  animation: tackleRing 0.5s ease-out forwards;
}
.tackle-flash::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(237, 65, 99, 0.45) 0%, transparent 65%);
  animation: tackleCore 0.35s ease-out forwards;
}
@keyframes tackleRing {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}
@keyframes tackleCore {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

/* Result overlay — compact floating pill */
.match-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--panel);
  border: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 30;
  border-radius: 14px;
  padding: 20px 36px;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  animation: overlayPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.match-overlay.win { background: #0e3a27; border-color: var(--green); }
.match-overlay.lose { background: #3a1622; border-color: var(--red); }
@keyframes overlayPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.match-overlay-mult {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  text-shadow: 0 2px 10px rgba(0,0,0,0.4);
  animation: overlayFadeUp 0.4s ease-out 0.15s both;
}
@keyframes overlayScalePop {
  0% { opacity: 0; transform: scale(0.4); }
  100% { opacity: 1; transform: scale(1); }
}
.match-overlay-score {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 24px rgba(0,0,0,0.5);
  animation: overlayScalePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.match-overlay-tap {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dimmer);
  margin-top: 8px;
  animation: overlayFadeUp 0.4s ease-out 0.4s both;
}
@keyframes overlayFadeUp {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ===== CORNER COUNTERS — on stadium corners ===== */
.corner-btn {
  position: absolute;
  z-index: 22;
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  background: rgba(15, 33, 46, 0.8);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .corner-btn:hover:not(:disabled) {
    background: rgba(247, 147, 26, 0.2);
    border-color: var(--accent);
    color: var(--accent);
  }
}
.corner-btn:active:not(:disabled) {
  transform: scale(0.88);
  background: rgba(247, 147, 26, 0.35);
  border-color: var(--accent);
  color: var(--accent);
}
.corner-btn:disabled { opacity: 0.2; cursor: not-allowed; }

/* Defense — top corners */
/* Defense — near top, mirroring offense */
.corner-btn.top-left { top: 8%; left: 10%; }
.corner-btn.top-right { top: 8%; right: 10%; }
/* Offense — near bottom, spread wider */
.corner-btn.bottom-left { bottom: 8%; left: 10%; }
.corner-btn.bottom-right { bottom: 8%; right: 10%; }

/* Count display — centered on each side */
.corner-count {
  position: absolute;
  z-index: 22;
  font-size: 18px;
  font-weight: 800;
  background: rgba(15, 33, 46, 0.8);
  backdrop-filter: blur(6px);
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 3px 12px;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: countPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes countPop {
  0% { transform: translateX(-50%) scale(0.7); }
  50% { transform: translateX(-50%) scale(1.15); }
  100% { transform: translateX(-50%) scale(1); }
}
.corner-count.top-center {
  top: 42%;
  left: 50%;
  transform: translateX(-50%);
  color: var(--accent);
}
.corner-count.bottom-center {
  bottom: 42%;
  left: 50%;
  transform: translateX(-50%);
  color: var(--green);
}

/* ===== FIELD SIDE STATS — multiplier/win chance on stadium ===== */
.field-side-stat {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 8px;
  background: rgba(15, 33, 46, 0.80);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  pointer-events: none;
}
.field-side-stat.left-side { left: 6px; }
.field-side-stat.right-side { right: 6px; }
.fss-label {
  font-size: 7px;
  font-weight: 600;
  color: rgba(177, 186, 211, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.fss-val {
  font-size: 14px;
  font-weight: 800;
}
.fss-val.accent { color: var(--accent); }
.fss-val.green { color: var(--green); }

/* ===== FIELD OVERLAY — stats + bet on stadium ===== */
.field-overlay-controls {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: auto;
}
.field-stats-row {
  display: flex;
  gap: 4px;
}
.field-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 4px 6px;
  background: rgba(15, 33, 46, 0.80);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(85, 112, 134, 0.25);
  border-radius: 6px;
}
.field-stat .fs-label {
  font-size: 8px;
  font-weight: 600;
  color: rgba(177, 186, 211, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field-stat .fs-val {
  font-size: 13px;
  font-weight: 800;
}
.field-stat .fs-val.accent { color: var(--accent); }
.field-stat .fs-val.green { color: var(--green); }

.field-bet-row {
  display: flex;
  align-items: center;
  height: 34px;
  background: rgba(15, 33, 46, 0.80);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(85, 112, 134, 0.25);
  border-radius: 8px;
  overflow: hidden;
}
.field-bet-currency {
  width: 28px;
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  text-align: center;
  flex-shrink: 0;
}
.field-bet-row input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  padding: 0 4px;
  -moz-appearance: textfield;
}
.field-bet-row input::-webkit-outer-spin-button,
.field-bet-row input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field-bet-chips {
  display: flex;
  gap: 2px;
  padding: 0 4px;
  flex-shrink: 0;
}
.field-bet-chips button {
  width: 32px;
  height: 24px;
  border-radius: 5px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(85, 112, 134, 0.3);
  color: var(--text-75);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.field-bet-chips button:hover:not(:disabled) {
  border-color: var(--accent-border);
  background: rgba(247, 147, 26, 0.10);
  color: var(--accent);
}
.field-bet-chips button:disabled { opacity: 0.3; cursor: not-allowed; }

/* ===== BET MODAL — on stadium ===== */
/* Bet panel — below the field */
.bet-panel {
  flex-shrink: 0;
  background: var(--panel);
  border-top: 1px solid var(--hairline);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: 320px;
  transition: opacity 0.3s ease;
}
.bet-panel.panel-hidden {
  opacity: 0;
  pointer-events: none;
}

/* Team picker inside modal */
.bm-pick-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  letter-spacing: 0.02em;
}
.bm-pick-search input {
  width: 100%;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  padding: 0 12px;
  outline: none;
  transition: border-color 0.2s;
}
.bm-pick-search input::placeholder { color: var(--text-dimmer); }
.bm-pick-search input:focus { border-color: rgba(247, 147, 26, 0.4); }
.bm-pick-grid {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 -4px;
  padding: 0 4px;
}
.bm-pick-grid::-webkit-scrollbar { width: 3px; }
.bm-pick-grid::-webkit-scrollbar-track { background: transparent; }
.bm-pick-grid::-webkit-scrollbar-thumb { background: rgba(145,159,192,0.15); border-radius: 2px; }
.bm-pick-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bm-pick-letter {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  padding: 8px 10px 6px;
  letter-spacing: 0.06em;
  position: sticky;
  top: 0;
  background: var(--elevated);
  z-index: 2;
}
.bm-pick-team {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  text-align: left;
  transition: all 0.15s;
}
.bm-pick-team:hover {
  background: rgba(247, 147, 26, 0.06);
  border-color: rgba(247, 147, 26, 0.15);
}
.bm-pick-team:active {
  background: rgba(247, 147, 26, 0.12);
  transform: scale(0.98);
}
.bpt-flag { font-size: 18px; }
.bpt-name {
  font-size: 12px;
  font-weight: 600;
  flex: 1;
}
.bpt-code {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
}

/* Team display row */
.bm-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.bm-teams:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
}
.bm-team-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bm-team-flag { font-size: 18px; }
.bm-team-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.bm-team-vs {
  font-size: 10px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.2);
  letter-spacing: 0.05em;
}
.bm-change-btn {
  font-size: 9px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(247, 147, 26, 0.08);
  border: 1px solid rgba(247, 147, 26, 0.2);
  border-radius: 6px;
  padding: 3px 8px;
  margin-left: auto;
  transition: all 0.2s;
}
.bm-teams:hover .bm-change-btn {
  background: rgba(247, 147, 26, 0.15);
  border-color: rgba(247, 147, 26, 0.35);
}

/* Stats strip */
.bm-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 8px 0;
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.bm-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.bm-stat-val {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.bm-stat-val.accent { color: var(--accent); }
.bm-stat-val.green { color: var(--green); }
.bm-stat-label {
  font-size: 8px;
  font-weight: 600;
  color: rgba(177, 186, 211, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.bm-stat-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

/* Formation sliders */
.bm-formation {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bm-slider-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bm-slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bm-slider-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.bm-slider-label.def-c { color: var(--accent); }
.bm-slider-label.off-c { color: var(--green); }
.bm-slider-num {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}
.bm-slider-num.def-c { color: var(--accent); }
.bm-slider-num.off-c { color: var(--green); }

/* Range slider styling */
.bm-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
  cursor: pointer;
}
.bm-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.bm-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}
.bm-slider::-webkit-slider-thumb:active {
  transform: scale(0.95);
}
.bm-slider.def::-webkit-slider-thumb {
  background: var(--accent);
  border-color: rgba(247, 147, 26, 0.5);
}
.bm-slider.off::-webkit-slider-thumb {
  background: var(--green);
  border-color: rgba(14, 204, 104, 0.5);
}
.bm-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.bm-slider.def::-moz-range-thumb {
  background: var(--accent);
  border-color: rgba(247, 147, 26, 0.5);
}
.bm-slider.off::-moz-range-thumb {
  background: var(--green);
  border-color: rgba(14, 204, 104, 0.5);
}

/* Bet input section */
.bm-bet-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bm-input-wrap {
  display: flex;
  align-items: center;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.bm-input-wrap:focus-within {
  border-color: rgba(247, 147, 26, 0.4);
  box-shadow: 0 0 0 3px rgba(247, 147, 26, 0.06);
}
.bm-currency {
  width: 32px;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
  text-align: center;
  flex-shrink: 0;
  opacity: 0.8;
}
.bm-input-wrap input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  padding: 0 4px;
  -moz-appearance: textfield;
}
.bm-input-wrap input::placeholder { color: var(--text-dimmer); font-weight: 500; }
.bm-input-wrap input::-webkit-outer-spin-button,
.bm-input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bm-chips {
  display: flex;
  gap: 3px;
  padding: 0 4px;
  flex-shrink: 0;
}
.bm-chips button {
  width: 36px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.bm-chips button:hover {
  border-color: var(--accent-border);
  background: rgba(247, 147, 26, 0.1);
  color: var(--accent);
}

/* Payout strip */
.bm-payout-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}
.bm-payout-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
}
.bm-payout-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--green);
  text-shadow: 0 0 12px rgba(14, 204, 104, 0.15);
}

/* Kick off button */
.bm-kick-btn {
  height: 46px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #F3CC24 0%, #EFB51E 50%, #E8A910 100%);
  color: #3F260B;
  font-family: inherit;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow:
    0 4px 16px rgba(247, 147, 26, 0.25),
    0 1px 3px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
@media (hover: hover) {
  .bm-kick-btn:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow:
      0 8px 28px rgba(247, 147, 26, 0.35),
      0 2px 6px rgba(0, 0, 0, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
}
.bm-kick-btn:active {
  transform: translateY(0) scale(0.98);
}
.bm-kick-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}
.bm-kick-icon { flex-shrink: 0; opacity: 0.7; }

/* Dual game mode buttons */
.bm-dual-btns {
  display: flex;
  gap: 8px;
}
.bm-dual-btns .bm-kick-btn {
  flex: 1;
  font-size: 12px;
  height: 42px;
  letter-spacing: 0.06em;
}
.bm-dual-btns .bm-kick-btn.fast {
  background: linear-gradient(135deg, #0ECC68 0%, #0aa854 50%, #088a44 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(14, 204, 104, 0.25), 0 1px 3px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.2);
}
.bm-dual-btns .bm-kick-btn.fast:hover {
  box-shadow: 0 8px 28px rgba(14, 204, 104, 0.35), 0 2px 6px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.25);
}

/* Change team button on canvas penalty area */
.field-change-team {
  position: absolute;
  bottom: 4%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 22;
  padding: 10px 24px;
  background: rgba(247, 147, 26, 0.9);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
@media (hover: hover) {
  .field-change-team:hover {
    background: rgba(247, 147, 26, 1);
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 4px 16px rgba(247, 147, 26, 0.3);
  }
}
.bm-broke {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--red);
  padding: 4px 0;
}

/* Speed picker */
.bm-speed {
  display: flex;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.18);
}
.bm-speed-btn {
  flex: 1;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.bm-speed-btn.active {
  background: rgba(247, 147, 26, 0.12);
  color: var(--accent);
}
.bm-speed-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-75);
}


/* Halftime overlay */
.halftime-overlay {
  position: absolute;
  inset: 0;
  z-index: 18;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(15, 33, 46, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 8px;
  animation: htFadeIn 0.4s ease both;
}
@keyframes htFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
.ht-text {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.1em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
.ht-score {
  font-size: 36px;
  font-weight: 900;
  color: var(--accent);
  text-shadow: 0 2px 16px rgba(247, 147, 26, 0.3);
}
.ht-tap {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 8px;
  animation: htFadeIn 0.5s ease 0.5s both;
}
.ht-sub {
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
  letter-spacing: 0.05em;
  text-shadow: 0 1px 8px rgba(14, 204, 104, 0.3);
  animation: htFadeIn 0.5s ease 0.3s both;
}

/* Final score in result overlay */
.mo-final-score {
  font-size: 28px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  animation: overlayFadeUp 0.4s ease-out 0.1s both;
}

/* ===== BET CORNER BADGE — during gameplay ===== */
.bet-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(15, 33, 46, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  pointer-events: none;
  animation: badgeFadeIn 0.4s ease both;
}
@keyframes badgeFadeIn {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}
.bb-bet {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}
.bb-arrow {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.3);
}
.bb-win {
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
}

/* ===== BOTTOM CONTROLS (legacy — now mostly in modal) ===== */
.controls {
  flex-shrink: 0;
  background: var(--panel);
  border-top: 1px solid var(--hairline);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Row layouts */
.ctrl-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.ctrl-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Labels */
.ctrl-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Bet + Payout unified row */
.bet-payout-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.bet-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.payout-section {
  width: 90px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.payout-display {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  background: linear-gradient(180deg, #213743 0%, #1A2C38 100%);
}
.payout-value {
  font-size: 14px;
  font-weight: 800;
  color: var(--green);
}

/* Bet input */
.bet-input-row {
  height: 42px;
  display: flex;
  align-items: center;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, #213743 0%, #1A2C38 100%);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.bet-input-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(247, 147, 26, 0.08);
}
.bet-input-row .currency {
  width: 34px;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
  text-align: center;
  flex-shrink: 0;
}
.bet-input-row input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  padding: 0 6px;
  -moz-appearance: textfield;
}
.bet-input-row input::-webkit-outer-spin-button,
.bet-input-row input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Chips */
.chips {
  display: flex;
  gap: 3px;
  padding: 0 6px;
  flex-shrink: 0;
}
.chip {
  width: 36px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--toggle-border);
  color: var(--text-75);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.chip:hover:not(:disabled) {
  border-color: var(--accent-border);
  background: rgba(247, 147, 26, 0.08);
  color: var(--accent);
}
.chip:disabled { opacity: 0.3; cursor: not-allowed; }

/* +/- Counter control */
.counter-control {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, #213743 0%, #1A2C38 100%);
  height: 42px;
}
.counter-btn {
  width: 36px;
  height: 100%;
  border: none;
  background: rgba(255,255,255,0.03);
  color: var(--text-75);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-family: inherit;
}
.counter-btn:hover:not(:disabled) {
  background: rgba(247, 147, 26, 0.12);
  color: var(--accent);
}
.counter-btn:active:not(:disabled) {
  background: rgba(247, 147, 26, 0.2);
}
.counter-btn:disabled { opacity: 0.25; cursor: not-allowed; }
.counter-btn.minus { border-right: 1px solid var(--hairline); }
.counter-btn.plus { border-left: 1px solid var(--hairline); }
.counter-value {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  min-width: 36px;
  padding: 0 4px;
}
.counter-value.off-c { color: var(--green); }
.counter-value.def-c { color: var(--accent); }

/* Counter label badge */
.counter-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  padding-top: 2px;
}
.counter-badge.offense { color: var(--green); }
.counter-badge.defense { color: var(--accent); }

/* Stats row */
.stats-row {
  display: flex;
  gap: 6px;
}
.stat-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--hairline);
  border-radius: 8px;
}
.stat-pill .s-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-pill .s-val {
  font-size: 14px;
  font-weight: 800;
}
.stat-pill .s-val.accent { color: var(--accent); }
.stat-pill .s-val.green { color: var(--green); }

/* Kick Off button */
.play-btn {
  height: 50px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(257.95deg, #EFB51E 2.9%, #EFB71E 54.53%, #F7931A 54.68%, #F3CC24 95.53%);
  color: #3F260B;
  font-family: inherit;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(247, 147, 26,0.30), inset 0 1px 0 rgba(255,255,255,0.2);
  width: 100%;
}
.play-btn:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 6px 24px rgba(247, 147, 26,0.40), inset 0 1px 0 rgba(255,255,255,0.2);
  transform: translateY(-1px);
}
.play-btn:active:not(:disabled) { transform: translateY(0); }
.play-btn:disabled { opacity: 0.4; cursor: not-allowed; filter: none; transform: none; }

/* Alert toast */
.alert-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: rgba(248, 95, 93, 0.18);
  border: 1px solid rgba(248, 95, 93, 0.45);
  border-radius: 14px;
  color: var(--red);
  font-size: 14px;
  font-weight: 700;
  z-index: 200;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  animation: alertSlide 0.3s ease-out forwards;
  white-space: nowrap;
  pointer-events: none;
}
.alert-icon { font-size: 16px; }
@keyframes alertSlide {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  width: min(420px, calc(100vw - 32px));
  max-height: min(520px, 70dvh);
  overflow-y: auto;
  padding: 24px;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(47,69,83,0.30);
}
.modal::-webkit-scrollbar { width: 3px; }
.modal::-webkit-scrollbar-track { background: transparent; }
.modal::-webkit-scrollbar-thumb { background: rgba(145,159,192,0.15); border-radius: 2px; }
.modal h2 {
  font-size: 16px; font-weight: 700;
  margin-bottom: 14px; color: var(--text);
}
.modal h3 {
  font-size: 13px; font-weight: 700;
  color: var(--accent); margin: 12px 0 6px;
}
.modal p, .modal li {
  font-size: 12px; line-height: 1.6; color: var(--text-75);
}
.modal ul, .modal ol { padding-left: 18px; margin-bottom: 8px; }
.modal li { margin-bottom: 3px; }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 28px; height: 28px;
  background: var(--card-bg);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  color: var(--text-mid);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover { border-color: var(--accent-border); color: var(--text); }
.modal-payout-box {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  background: var(--card-bg);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  margin-bottom: 8px;
}
.modal-payout-box .label { font-size: 12px; color: var(--text-mid); }
.modal-payout-box .value { font-size: 13px; font-weight: 700; color: var(--accent); }
.info-box {
  display: flex; gap: 10px; padding: 12px;
  background: var(--card-bg);
  border: 1px solid var(--hairline);
  border-radius: 10px; margin-bottom: 8px;
}
.info-box .info-icon { font-size: 20px; flex-shrink: 0; }
.info-box p { margin: 0; }
.mult-table-wrap { overflow-x: auto; margin-bottom: 8px; }
.mult-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mult-table th, .mult-table td {
  padding: 7px 10px; text-align: left;
  border-bottom: 1px solid var(--hairline);
}
.mult-table th { color: var(--text-mid); font-weight: 600; }
.mult-table td { color: var(--text-75); }

/* Provably Fair modal */
.pf-desc { margin-bottom: 16px; }
.pf-section {
  background: var(--card-bg);
  border: 1px solid var(--hairline);
  border-radius: 10px; padding: 12px; margin-bottom: 10px;
}
.pf-label {
  font-size: 12px; font-weight: 600; color: var(--text);
  margin-bottom: 4px; display: flex; align-items: center; gap: 6px;
}
.pf-icon { font-size: 14px; }
.pf-sublabel { font-size: 11px; color: var(--text-dim); margin-bottom: 8px; }
.pf-toggle-row { display: flex; gap: 6px; margin-bottom: 10px; }
.pf-toggle-btn {
  flex: 1; height: 32px;
  border: 1px solid var(--toggle-border);
  border-radius: 8px; background: transparent;
  color: var(--text-mid); font-family: inherit;
  font-size: 11px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.pf-toggle-btn.active {
  border-color: var(--accent); color: var(--accent);
  background: rgba(247, 147, 26, 0.08);
}
.pf-input-row { display: flex; gap: 6px; margin-bottom: 8px; }
.pf-input-row input {
  flex: 1; height: 34px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: linear-gradient(180deg, #213743 0%, #1A2C38 100%);
  color: var(--text); font-family: monospace;
  font-size: 11px; padding: 0 10px; outline: none;
  transition: border-color 0.2s;
}
.pf-input-row input:focus { border-color: var(--accent); }
.pf-btn-sm {
  width: 34px; height: 34px;
  border: 1px solid var(--toggle-border);
  border-radius: 8px; background: rgba(255,255,255,0.03);
  color: var(--text-mid); font-family: inherit;
  font-size: 10px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
}
.pf-btn-sm:hover { border-color: var(--accent-border); color: var(--text); }
.pf-hash-box {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--hairline);
  border-radius: 8px; padding: 10px;
  font-family: monospace; font-size: 10px;
  color: var(--text-mid); word-break: break-all;
  margin-bottom: 8px; line-height: 1.5;
}
.pf-cp-row { display: flex; gap: 6px; margin-bottom: 8px; }
.pf-note { font-size: 11px; color: var(--text-dim); margin: 0; line-height: 1.5; }
.pf-how {
  background: var(--card-bg);
  border: 1px solid var(--hairline);
  border-radius: 10px; padding: 16px;
}
.pf-how-title { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.pf-how ol { padding-left: 18px; }
.pf-how li { font-size: 11px; color: var(--text-75); margin-bottom: 5px; line-height: 1.5; }

/* Fair Play button — same as limbo */
.fairplay {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--toggle-border);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.2s;
}
.fairplay::before {
  content: '';
  width: 14px; height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23919FC0' stroke-width='2'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.fairplay:hover { border-color: var(--accent-border); color: var(--text); }

/* Info button — same as limbo */
.info-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--toggle-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.2s;
}
.info-btn:hover { border-color: var(--accent-border); color: var(--text); }

/* ===== BOTTOM BAR ===== */
.footer-bar {
  height: 44px;
  background: var(--panel);
  border-top: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
}
.footer-bar .footer-icons { display: flex; gap: 14px; }
.ic {
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color 0.2s, transform 0.15s;
}
.ic:hover { color: var(--text-75); transform: scale(1.1); }
.ic.muted { color: var(--red); }
.footer-logo {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dimmer);
  letter-spacing: 0.12em;
}

/* ===== TEAM PICKER ===== */
.picker-overlay {
  position: fixed;
  inset: 0;
  background: var(--board);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
.picker-card {
  width: 520px;
  height: 920px;
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  box-shadow: 0 40px 100px -20px rgba(0,0,0,0.7), 0 0 0 1px rgba(47, 69, 83, 0.30);
}
@media (max-width: 520px) {
  .picker-card { border-radius: 0; height: 100dvh; }
}

/* Header */
.picker-header {
  display: flex;
  height: 50px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--hairline);
  flex-shrink: 0;
}
.picker-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.picker-icon { font-size: 16px; color: var(--accent); }
.picker-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.picker-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  background: rgba(247, 147, 26,0.08);
  border: 1px solid rgba(247, 147, 26,0.18);
  border-radius: 999px;
}

/* Picked badge — shown when offense is chosen */
.picked-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 16px 0;
  padding: 10px 14px;
  background: var(--card-bg);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s;
  flex-shrink: 0;
}
.picked-badge:hover { border-color: var(--accent-border); }
.picked-flag { font-size: 20px; }
.picked-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}
.picked-vs {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
}
.picked-hint {
  font-size: 10px;
  color: var(--text-dim);
}

/* Prompt + Search */
.picker-prompt {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 16px 6px;
  flex-shrink: 0;
}
.picker-search {
  padding: 0 16px 8px;
  flex-shrink: 0;
}
.picker-search input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  background: linear-gradient(180deg, #213743 0%, #1A2C38 100%);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 0 14px;
  outline: none;
  transition: border-color 0.2s;
}
.picker-search input::placeholder { color: var(--text-dimmer); }
.picker-search input:focus { border-color: var(--accent); }

/* Team list — simple rows */
.picker-grid {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.picker-grid::-webkit-scrollbar { width: 3px; }
.picker-grid::-webkit-scrollbar-track { background: transparent; }
.picker-grid::-webkit-scrollbar-thumb { background: rgba(145,159,192,0.15); border-radius: 2px; }

.team-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  font-family: inherit;
  text-align: left;
  color: var(--text);
  flex-shrink: 0;
}
.team-card:hover:not(:disabled) {
  background: var(--card-bg);
  border-color: var(--hairline);
}
.team-card:active:not(:disabled) {
  background: rgba(247, 147, 26, 0.06);
  border-color: var(--accent-border);
}
.team-card.disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

.team-color-bar {
  width: 4px;
  height: 28px;
  border-radius: 2px;
  flex-shrink: 0;
}
.team-flag { font-size: 22px; flex-shrink: 0; }
.team-name {
  font-size: 13px;
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.team-code {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 520px) {
  .app {
    width: 100%;
    height: 100vh; height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
  .header { height: 42px; padding: 0 12px; }
  .game-name { font-size: 12px; }
  .game-name .ico { font-size: 14px; }
  .header-balance { padding: 4px 10px 4px 8px; }
  .header-bal-value { font-size: 12px; }
  .fairplay { font-size: 0; padding: 5px 8px; gap: 0; }
  .fairplay::before { width: 12px; height: 14px; }
  .info-btn { width: 26px; height: 26px; font-size: 10px; }

  .history-bar { height: 30px; padding: 4px 10px; gap: 4px; }
  .history-chip { padding: 2px 8px; font-size: 9px; }

  .field-area { padding: 16px 6px; }
  .football-field { max-height: none; border-radius: 8px; }
  .field-clip { border-radius: 6px; }
  .center-circle { width: 50px; height: 50px; margin: -25px 0 0 -25px; }
  .penalty-area { width: 170px; margin-left: -85px; height: 70px; }
  .goal-area { width: 90px; margin-left: -45px; height: 30px; }
  .goal-frame { width: 100px; margin-left: -50px; }
  .player { width: 24px; height: 24px; font-size: 8px; }
  .player::after { width: 14px; margin-left: -7px; }
  .ball-inner { width: 14px; height: 14px; }

  .match-overlay { padding: 16px 28px; }
  .match-overlay-score { font-size: 32px; }
  .match-overlay-mult { font-size: 14px; }

  .field-side-stat { padding: 4px 6px; backdrop-filter: none; background: rgba(15, 33, 46, 0.88); }
  .field-side-stat.left-side { left: 4px; }
  .field-side-stat.right-side { right: 4px; }
  .fss-label { font-size: 6px; }
  .fss-val { font-size: 11px; }

  .corner-btn { width: 36px; height: 36px; font-size: 20px; border-radius: 10px; backdrop-filter: none; background: rgba(15, 33, 46, 0.85); }
  .corner-btn.top-left { top: 6%; left: 6%; }
  .corner-btn.top-right { top: 6%; right: 6%; }
  .corner-btn.bottom-left { bottom: 6%; left: 6%; }
  .corner-btn.bottom-right { bottom: 6%; right: 6%; }
  .corner-count { font-size: 16px; padding: 4px 12px; backdrop-filter: none; background: rgba(15, 33, 46, 0.85); }
  .corner-count.top-center { top: 40%; }
  .corner-count.bottom-center { bottom: 40%; }

  .field-overlay-controls { bottom: 4px; left: 4px; right: 4px; gap: 4px; }
  .field-stat { padding: 3px 4px; }
  .field-stat .fs-label { font-size: 7px; }
  .field-stat .fs-val { font-size: 11px; }
  .field-bet-row { height: 30px; }
  .field-bet-currency { width: 24px; font-size: 11px; }
  .field-bet-row input { font-size: 11px; }
  .field-bet-chips button { width: 28px; height: 20px; font-size: 8px; }
  .field-overlay-controls { backdrop-filter: none; }
  .field-stat { backdrop-filter: none; background: rgba(15, 33, 46, 0.88); }
  .field-bet-row { backdrop-filter: none; background: rgba(15, 33, 46, 0.88); }

  .bet-panel { padding: 10px 12px; gap: 8px; max-height: 280px; }
  .bm-stats { padding: 6px 0; }
  .bm-stat-val { font-size: 15px; }
  .bm-stat-label { font-size: 7px; }
  .bm-stat-divider { height: 22px; }
  .bm-slider-num { font-size: 15px; }
  .bm-slider-label { font-size: 8px; }
  .bm-slider::-webkit-slider-thumb { width: 18px; height: 18px; }
  .bm-input-wrap { height: 42px; }
  .bm-input-wrap input { font-size: 16px; }
  .bm-chips button { width: 32px; height: 24px; font-size: 9px; }
  .bm-payout-val { font-size: 14px; }
  .bm-speed-btn { height: 28px; font-size: 10px; }
  .bm-kick-btn { height: 40px; font-size: 12px; }
  .hdr-flag { width: 20px; height: 20px; }
  .hdr-code { font-size: 10px; }
  .hdr-score { font-size: 16px; }
  .hdr-phase { font-size: 7px; }
  .hdr-timer { width: 32px; }
  .ht-text { font-size: 18px; }
  .ht-score { font-size: 28px; }
  .mo-final-score { font-size: 22px; }

  .bet-badge { padding: 3px 8px; }
  .bb-bet, .bb-win { font-size: 10px; }

  .payout-section { width: 75px; }
  .payout-display { height: 36px; }
  .payout-value { font-size: 12px; }
  .controls { padding: 8px 10px; gap: 7px; }
  .ctrl-row { gap: 6px; }
  .ctrl-label { font-size: 9px; }
  .counter-control { height: 36px; }
  .counter-btn { width: 32px; font-size: 16px; }
  .counter-value { font-size: 14px; }
  .counter-badge { font-size: 8px; }
  .play-btn { height: 42px; font-size: 13px; }

  .footer-bar { height: 36px; padding: 0 12px; }
  .ic svg { width: 14px; height: 14px; }
  .footer-logo { font-size: 11px; }

  /* Mobile performance — disable expensive effects */
  .player { will-change: transform; }
  .player:not(.running) {
    transition: left 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                top 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                opacity 0.4s ease;
  }
  .player::before { display: none; } /* no motion trail */
  .player::after { display: none; } /* no ground shadow */
  .ball-wrap { transition: none; will-change: transform; filter: none; }
  .ball-wrap::after { display: none; }
  .ball-wrap.flying { filter: none; }
  .crowd-stands::before { display: none; }
  .floodlight { display: none; }
  .field-stripes::after { display: none; }
  .match-overlay { }
  .confetti-bit { display: none; }
  .field-area.shake { animation: none; }
  .possession-indicator { backdrop-filter: none; }
  .net-ripple { display: none; }
}

/* Small phones (iPhone SE = 375px) */
@media (max-width: 375px) {
  .controls { padding: 6px 8px; gap: 5px; }
  .counter-control { height: 32px; }
  .counter-btn { width: 28px; }
  .bet-input-row { height: 32px; }
  .play-btn { height: 38px; font-size: 12px; }
  .match-overlay-score { font-size: 28px; }
  .match-overlay-mult { font-size: 12px; }
  .penalty-area { width: 140px; margin-left: -70px; height: 55px; }
  .goal-area { width: 70px; margin-left: -35px; height: 24px; }
  .goal-frame { width: 80px; margin-left: -40px; }
  .player { width: 20px; height: 20px; font-size: 7px; }
}

@media (min-width: 521px) and (max-height: 920px) {
  .app { height: 100vh; height: 100dvh; border-radius: 0; }
}

/* Android performance: disable expensive backdrop-filter */
html.android .bet-modal,
html.android .halftime-overlay,
html.android .match-overlay,
html.android .bet-badge,
html.android .field-change-team,
html.android .corner-btn,
html.android .corner-count {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html.android .halftime-overlay { background: rgba(15, 33, 46, 0.6); }
html.android .match-overlay { background: rgba(15, 33, 46, 0.6); }

/* ===========================================================================
   DRAWERS (How to Play / Provably Fair / History) — ported from hilo, shares
   the same design-token names so it themes to the SoccerPro palette.
   =========================================================================== */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.drawer-backdrop.show { opacity: 1; pointer-events: auto; }
.drawer-backdrop.show .drawer { transform: translateY(0); }
.drawer {
  width: 100%; max-width: 480px; max-height: 80vh;
  display: flex; flex-direction: column;
  background: var(--panel);
  border-radius: 16px 16px 0 0;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}
.drawer-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px; height: 56px; box-sizing: border-box; flex-shrink: 0;
  border-radius: 16px 16px 0 0;
}
.drawer-title { font-weight: 600; font-size: 14px; color: var(--text); }
.drawer-close {
  width: 36px; height: 36px;
  display: flex; justify-content: center; align-items: center;
  background: none; border: none; border-radius: 10px;
  cursor: pointer; color: var(--text-mid);
}
.drawer-close:active { background: rgba(255,255,255,0.06); }
.drawer-close svg { width: 18px; height: 18px; }
.drawer-tabs {
  display: flex; align-items: center; padding: 4px;
  margin: 0 16px 12px;
  background: var(--board); border: 1px solid var(--hairline); border-radius: 14px;
}
.drawer-tab {
  flex: 1; height: 32px;
  display: flex; justify-content: center; align-items: center;
  border: none; border-radius: 10px; background: transparent;
  cursor: pointer; font-weight: 400; font-size: 12px; color: var(--text-mid);
  font-family: inherit;
}
.drawer-tab.active {
  background: var(--card-bg); color: var(--text);
  box-shadow: 0 1px 0 var(--card-shadow); font-weight: 500;
}
.drawer-body {
  overflow-y: auto; flex: 1;
  padding: 4px 16px 16px;
}
.drawer-body::-webkit-scrollbar { width: 3px; }
.drawer-body::-webkit-scrollbar-track { background: transparent; }
.drawer-body::-webkit-scrollbar-thumb { background: rgba(145,159,192,0.15); border-radius: 2px; }

/* Drawer → centered modal on desktop */
@media (min-width: 681px) {
  .drawer-backdrop { align-items: center; }
  .drawer-backdrop.show .drawer { transform: scale(1); }
  .drawer {
    max-width: 480px; max-height: 70vh; border-radius: 16px;
    transform: scale(0.9); opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .drawer-backdrop.show .drawer { opacity: 1; }
  .drawer-header { border-radius: 16px 16px 0 0; }
  .drawer-body { border-radius: 0 0 16px 16px; }
}

/* Team picker drawer */
.team-picker-drawer .drawer-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.team-picker-drawer .bm-pick-search {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel);
  padding-bottom: 4px;
  flex-shrink: 0;
}
.team-picker-drawer .bm-pick-grid {
  flex: 1;
  max-height: none;
  min-height: 0;
}

/* Drawer content primitives */
.drw-text { font-size: 12px; line-height: 1.6; color: var(--text-75); }
.drw-card {
  background: rgba(0,0,0,0.2); border-radius: 16px;
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 10px;
}
.drw-card:last-child { margin-bottom: 0; }
.drw-card-title { font-weight: 500; font-size: 13px; color: var(--text); text-align: center; }
.drw-stat-row {
  display: flex; justify-content: space-between; align-items: center; height: 28px;
}
.drw-stat-label { font-size: 12px; color: var(--text-mid); }
.drw-stat-value { font-size: 12px; font-weight: 600; color: var(--text); }
.drw-stat-value.green { color: var(--green); }
.drw-steps {
  display: flex; flex-direction: column; gap: 2px;
  background: rgba(0,0,0,0.2); border-radius: 14px; padding: 12px;
}
.drw-step { display: flex; gap: 10px; align-items: center; }
.drw-step-num {
  width: 24px; height: 24px; min-width: 24px;
  border-radius: 50%; background: var(--accent); color: var(--board);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.drw-step-text { flex: 1; font-size: 12px; line-height: 1.5; color: var(--text-75); }
.drw-step-arrow { display: flex; padding: 0 12px; }
.drw-step-arrow-line { width: 0; height: 12px; border-left: 1px dashed var(--text-dim); }

/* PF drawer inputs */
.drw-input {
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; background: var(--board);
  border: 1px solid var(--hairline); border-radius: 14px;
  padding: 8px 10px 8px 14px; box-sizing: border-box; width: 100%;
}
.drw-input:focus-within { border-color: var(--accent-border); }
.drw-input-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.drw-input-label { font-size: 10px; color: var(--text-mid); line-height: 1.4; }
.drw-input-value {
  font-size: 13px; color: var(--text); background: none; border: none;
  outline: none; padding: 0; width: 100%; font-family: inherit;
}
.drw-input-value.mono { font-family: monospace; font-size: 11px; word-break: break-all; }
.drw-input-value.green { color: var(--green); }
.drw-input-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; min-width: 32px;
  background: var(--card-bg); border: none; border-radius: 10px;
  cursor: pointer; color: var(--text-mid);
}
.drw-input-btn:active { transform: scale(0.92); }
.drw-input-btn svg { width: 14px; height: 14px; }
.drw-save-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 44px;
  background: rgba(255,255,255,0.08); border: 1px solid var(--hairline); border-radius: 12px;
  font-weight: 600; font-size: 13px; color: var(--text); cursor: pointer;
  font-family: inherit; transition: all 0.15s;
}
.drw-save-btn:hover { background: rgba(255,255,255,0.12); }
.drw-save-btn:disabled { opacity: 0.4; cursor: default; }

/* ===== HISTORY LIST ===== */
.hist-list { display: flex; flex-direction: column; gap: 6px; }
.hist-item {
  background: var(--elevated); border-radius: 14px;
  overflow: hidden; cursor: pointer; transition: background 0.12s;
}
.hist-item:hover { background: #322e6b; }
.hist-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 8px 8px 4px; width: 100%; box-sizing: border-box;
}
.hist-left { display: flex; align-items: center; min-width: 0; flex-shrink: 1; }
.hist-icon {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; min-width: 36px; border-radius: 10px;
}
.hist-icon svg { width: 18px; height: 18px; }
.hist-info { display: flex; flex-direction: column; justify-content: center; margin-left: 2px; }
.hist-info-title { font-weight: 500; font-size: 13px; line-height: 1.4; color: var(--text); white-space: nowrap; }
.hist-info-sub { font-weight: 400; font-size: 10px; line-height: 1.4; color: var(--text-mid); white-space: nowrap; }
.hist-right { display: flex; align-items: center; flex-shrink: 0; margin-left: auto; }
.hist-chips { display: flex; align-items: center; gap: 6px; }
.hist-mult-chip {
  display: flex; align-items: center; justify-content: center;
  height: 24px; min-width: 48px; padding: 4px 8px;
  background: var(--card-bg); border-radius: 8px;
  box-shadow: 0 1px 0 var(--card-shadow);
  font-weight: 500; font-size: 11px; line-height: 1; color: var(--text-75);
  white-space: nowrap;
}
.hist-payout-chip {
  display: flex; align-items: center; justify-content: center;
  height: 24px; min-width: 64px; padding: 4px 8px;
  border-radius: 8px; font-weight: 600; font-size: 11px; line-height: 1; white-space: nowrap;
}
.hist-payout-chip--win { background: var(--green-bg); color: var(--green); }
.hist-payout-chip--lose { background: var(--red-bg); color: var(--red); }
.hist-chevron {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; margin-left: 4px;
}
.hist-chevron svg { width: 14px; height: 14px; }
.hist-details { padding: 0 8px 8px; width: 100%; box-sizing: border-box; }
.hist-details-inner {
  display: flex; flex-direction: column; gap: 10px;
  background: rgba(0,0,0,0.18); border-radius: 10px; padding: 10px 12px;
}
.hist-seeds { display: flex; flex-direction: column; gap: 8px; }
.hist-seed-group { display: flex; flex-direction: column; }
.hist-seed-label { font-weight: 500; font-size: 10px; line-height: 1.4; color: var(--text-mid); }
.hist-seed-value {
  font-weight: 400; font-size: 11px; line-height: 1.4; color: var(--text-75);
  word-break: break-all; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.hist-verify-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 36px; background: rgba(255,255,255,0.06);
  border: 1px solid var(--hairline); border-radius: 8px;
  color: var(--text-75); font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.hist-verify-btn:hover { border-color: var(--accent-border); color: var(--text); }
.hist-verify-btn:disabled { opacity: 0.5; cursor: default; }
.hist-verify-btn svg { width: 16px; height: 16px; }
.hist-pager {
  display: flex; justify-content: center; align-items: center;
  gap: 10px; margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--hairline);
}
.hist-pager-btn {
  width: 28px; height: 28px; border-radius: 8px;
  border: 1px solid var(--toggle-border); background: transparent;
  color: var(--text-mid); font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; font-family: inherit;
}
.hist-pager-btn:hover:not(:disabled) { border-color: var(--accent-border); color: var(--text); }
.hist-pager-btn:disabled { opacity: 0.2; cursor: default; }
.hist-pager-info { font-size: 11px; color: var(--text-mid); min-width: 40px; text-align: center; }
.hist-empty, .hist-loading {
  text-align: center; padding: 40px 0; color: var(--text-dim); font-size: 12px;
}

/* loading-screen MYBC logo */

/* Desktop: app fills the viewport (no floating card). Header / history / field / footer
   are full-width bars; only the controls (bet panel / team picker) stay a centered column. */
@media (min-width: 521px) {
  .app { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; box-shadow: none; }
  .stake-bal { display: flex; }
  .header.header-match { justify-content: center; gap: 12px; }
  /* center the matchup logo on desktop; balance + icons stay on the right */
  .header { position: relative; }
  .header-left { position: absolute; left: 50%; transform: translateX(-50%); }
  .bet-panel {
    width: 100%;
    max-width: 460px;
    margin: 0 auto 12px;
    background: var(--panel);
    border: 1px solid var(--hairline);
    border-radius: 14px;
  }
}

/* ===== Smart mobile bet panel — input + inline Place (row 1), chips + speed (row 2) ===== */
@media (max-width: 520px) {
  .footer-bar { display: none; }
  .history-bar { display: none; }
  .bet-panel .stake-bet { display: grid; grid-template-columns: 1fr 1.15fr; grid-template-rows: 42px 30px; gap: 6px; align-items: stretch; }
  .bet-panel .stake-input, .bet-panel .stake-chips, .bet-panel .speed-toggle, .bet-panel .stake-chip, .bet-panel .speed-opt { height: auto; }
  .bet-panel .stake-left, .bet-panel .stake-right { display: contents; }
  .bet-panel .risk-label { display: none; }
  .bet-panel .stake-input { grid-column: 1; grid-row: 1; }
  .bet-panel .stake-chips { grid-column: 1; grid-row: 2; }
  .bet-panel .free-round-slot { grid-column: 1; grid-row: 1 / span 2; height: auto; }
  .bet-panel .stake-bet .place-btn { grid-column: 2; grid-row: 1; flex-direction: row; gap: 6px; }
  .bet-panel .speed-toggle { grid-column: 2; grid-row: 2; }
  /* Change Team moves off the pitch into the Potential Win row on mobile */
  .field-change-team { display: none; }
  .sp-change-team { display: flex; }
  .sp-row { justify-content: space-between; margin-top: 2px; }
}
