/* Brink Originals · mini-games kit — общий стиль всех «оригиналов» (Mines, Plinko, Dice, …).
 * Подключение: <link rel="stylesheet" href="/games/warn/mini.css?v=N"> + /games/warn/mini.js. Описание — tools/warn/README.md.
 * Всё оформление — токены ниже; игра меняет только --mg-acc (свой акцент) и рисует своё поле в .mg-stage. */
:root {
  --mg-bg: #0e1420; --mg-bg2: #0b101a; --mg-panel: #161e2c; --mg-panel2: #1b2536; --mg-field: #0f1623; --mg-line: #24314a; --mg-line2: #31415f;
  --mg-acc: #f2c14e; --mg-acc2: #ffd978; --mg-acc-ink: #1a1404;
  --mg-win: #2ecc8f; --mg-lose: #ff5d6c; --mg-warn: #ffb347;
  --mg-txt: #e8edf7; --mg-mut: #8a97ad; --mg-dim: #5d6a80;
  --mg-r: 12px; --mg-r2: 14px; --mg-r3: 9px;
  --mg-ui: "Inter", "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mg-num: "Montserrat", "Inter", system-ui, sans-serif;
  --mg-ease: cubic-bezier(.2, .8, .25, 1);
  --mg-side: clamp(256px, 23vw, 330px);
  --mg-hh: 52px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--mg-bg); color: var(--mg-txt); font-family: var(--mg-ui); overflow: hidden;
  user-select: none; -webkit-user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; }
button, input, select { font-family: inherit; color: inherit; font-size: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; }
.mg-n { font-family: var(--mg-num); font-variant-numeric: tabular-nums; }
.mg-hide { display: none !important; }

/* ================================================================ shell */
.mg-app { position: relative; height: 100%; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: radial-gradient(1200px 600px at 70% -20%, rgba(80, 110, 170, .10), transparent 60%), var(--mg-bg); }
.mg-top { flex: none; height: var(--mg-hh); display: flex; align-items: center; gap: 10px; padding: 0 12px; border-bottom: 1px solid var(--mg-line); background: var(--mg-bg2); }
.mg-back { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 10px; background: var(--mg-panel); border: 1px solid var(--mg-line);
  color: var(--mg-txt); text-decoration: none; font-weight: 700; font-size: 12.5px; letter-spacing: .4px; white-space: nowrap; transition: border-color .2s; }
.mg-back:hover { border-color: var(--mg-line2); }
.mg-title { display: flex; flex-direction: column; justify-content: center; line-height: 1.05; min-width: 0; overflow: hidden; }
.mg-title b { font: 800 17px var(--mg-num); letter-spacing: .3px; white-space: nowrap; }
.mg-title small { font: 700 9.5px var(--mg-num); letter-spacing: 1.6px; color: var(--mg-acc); white-space: nowrap; }
.mg-acct { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.mg-bal { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 4px 0 11px; border-radius: 10px; background: var(--mg-field); border: 1px solid var(--mg-line);
  font: 700 14px var(--mg-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mg-coin { width: 16px; height: 16px; border-radius: 50%; flex: none; background: radial-gradient(circle at 35% 30%, #ffe9a8, #f2c14e 55%, #a87a1c); }
.mg-bal button { width: 26px; height: 26px; border-radius: 7px; background: var(--mg-acc); color: var(--mg-acc-ink); font-weight: 900; font-size: 16px; line-height: 1; }
.mg-bal.up #mgBal { color: var(--mg-win); transition: color .2s; }
.mg-login { height: 34px; padding: 0 14px; border-radius: 10px; background: #2aabee; color: #fff; font-weight: 800; font-size: 13px; white-space: nowrap; }
.mg-icons { display: flex; gap: 6px; }
.mg-ib { width: 34px; height: 34px; border-radius: 10px; background: var(--mg-panel); border: 1px solid var(--mg-line); color: var(--mg-txt);
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; transition: border-color .2s, color .2s; position: relative; }
.mg-ib:hover { border-color: var(--mg-line2); }
.mg-ib svg { width: 17px; height: 17px; }
.mg-ib.off { color: var(--mg-dim); }
.mg-ib .mg-spdv { font: 800 11px var(--mg-num); }
.mg-ib.on { color: var(--mg-acc); border-color: rgba(242, 193, 78, .45); }

.mg-main { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 8px; }
.mg-side { flex: none; display: flex; flex-direction: column; min-height: 0; }
.mg-panel { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--mg-panel); border: 1px solid var(--mg-line); border-radius: var(--mg-r2); min-height: 0; }
/* панель = прокручиваемые настройки + неподвижная полоса с главной кнопкой (кнопка видна всегда, в т.ч. во вкладке «Auto») */
.mg-pscroll { display: flex; flex-direction: column; gap: inherit; min-height: 0; flex: 0 1 auto; overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain; }
.mg-pscroll::-webkit-scrollbar { display: none; }
.mg-pscroll > * { flex-shrink: 0; }
.mg-pscroll.more { -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - 22px), transparent); }
.mg-gobar { flex: none; display: flex; flex-direction: column; gap: 6px; }
.mg-area { position: relative; flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; background: var(--mg-panel); border: 1px solid var(--mg-line); border-radius: var(--mg-r2); overflow: hidden; }
.mg-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: manipulation; }
.mg-foot { flex: none; height: 38px; display: flex; align-items: center; gap: 6px; padding: 0 10px; border-top: 1px solid var(--mg-line); background: rgba(0, 0, 0, .12); }
.mg-foot button { white-space: nowrap; flex: none; height: 26px; padding: 0 10px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--mg-mut); transition: color .2s, background .2s; }
.mg-foot button:hover { color: var(--mg-txt); background: rgba(255, 255, 255, .04); }
.mg-foot .mg-note { margin-left: auto; font: 600 11px var(--mg-num); color: var(--mg-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ================================================================ controls */
.mg-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: var(--mg-r); background: var(--mg-field); border: 1px solid var(--mg-line); }
.mg-tabs button { height: 30px; border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--mg-mut); transition: background .2s, color .2s; }
.mg-tabs button.on { background: var(--mg-panel2); color: var(--mg-txt); box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 2px 6px rgba(0, 0, 0, .25); }
.mg-tabs button:disabled { opacity: .5; }
.mg-f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.mg-lbl { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 11.5px; font-weight: 700; color: var(--mg-mut); padding: 0 2px; }
.mg-lbl b { font: 700 11.5px var(--mg-num); color: var(--mg-txt); font-variant-numeric: tabular-nums; }
.mg-in { display: flex; align-items: center; height: 40px; border-radius: var(--mg-r); background: var(--mg-field); border: 1px solid var(--mg-line); overflow: hidden; transition: border-color .2s; min-width: 0; }
.mg-in:focus-within { border-color: var(--mg-line2); }
.mg-in input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; padding: 0 10px; font: 700 15px var(--mg-num); font-variant-numeric: tabular-nums; }
.mg-in input:disabled { color: var(--mg-mut); }
.mg-in .mg-ic { flex: none; margin-left: 10px; }
.mg-in .mg-suf { flex: none; padding-right: 10px; font: 700 13px var(--mg-num); color: var(--mg-mut); }
.mg-in > button { flex: none; height: 100%; min-width: 38px; padding: 0 9px; border-left: 1px solid var(--mg-line); font: 800 12.5px var(--mg-num); text-transform: uppercase; color: var(--mg-mut); transition: background .15s, color .15s; }
.mg-in > button:hover:not(:disabled) { background: rgba(255, 255, 255, .04); color: var(--mg-txt); }
.mg-in > button:disabled { opacity: .4; }
.mg-chips { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 5px; } /* равные колонки: длинная подпись («0.5 FUN») не раздвигает кнопку */
.mg-chips .wm-cur { font-size: .78em; } /* мелкие кнопки быстрых ставок: «FUN» читаемым (WM.moneyHTML) */
.mg-chips button { min-width: 0; overflow: hidden; padding: 0 3px; height: 28px; border-radius: 8px; background: var(--mg-field); border: 1px solid var(--mg-line); font: 700 12px var(--mg-num); color: var(--mg-mut); transition: border-color .2s, color .2s, background .2s; white-space: nowrap; }
.mg-chips button:hover:not(:disabled) { color: var(--mg-txt); }
.mg-chips button.on { color: var(--mg-txt); border-color: var(--mg-acc); background: rgba(242, 193, 78, .08); }
.mg-chips button:disabled { opacity: .4; }
.mg-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 3px; border-radius: var(--mg-r); background: var(--mg-field); border: 1px solid var(--mg-line); }
.mg-seg button { height: 32px; border-radius: 8px; font-weight: 700; font-size: 12.5px; color: var(--mg-mut); transition: background .2s, color .2s; white-space: nowrap; }
.mg-seg button.on { background: var(--mg-panel2); color: var(--mg-txt); box-shadow: inset 0 0 0 1px var(--mg-line2); }
.mg-seg button:disabled { opacity: .45; }
.mg-sel { height: 40px; width: 100%; border-radius: var(--mg-r); background: var(--mg-field); border: 1px solid var(--mg-line); padding: 0 10px; font: 700 14px var(--mg-num); outline: 0; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--mg-mut) 50%), linear-gradient(135deg, var(--mg-mut) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.mg-sel:disabled { color: var(--mg-mut); }
.mg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mg-tg { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--mg-mut); cursor: pointer; }
.mg-tg i { width: 32px; height: 18px; border-radius: 10px; background: var(--mg-field); border: 1px solid var(--mg-line2); position: relative; transition: background .2s; flex: none; }
.mg-tg i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--mg-mut); transition: transform .2s var(--mg-ease), background .2s; }
.mg-tg.on { color: var(--mg-txt); }
.mg-tg.on i { background: rgba(242, 193, 78, .2); border-color: var(--mg-acc); }
.mg-tg.on i::after { transform: translateX(14px); background: var(--mg-acc); }

/* главная кнопка: play / cash / stop / busy */
.mg-go { position: relative; flex: none; height: 52px; border-radius: var(--mg-r); background: var(--mg-acc); color: var(--mg-acc-ink); font: 800 15.5px var(--mg-ui); letter-spacing: .6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.12; box-shadow: 0 6px 18px rgba(242, 193, 78, .18), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: background .2s, color .2s, transform .1s, box-shadow .2s, opacity .2s; }
.mg-go:hover:not(:disabled) { background: var(--mg-acc2); }
.mg-go:active:not(:disabled) { transform: scale(.985); }
.mg-go small { font: 700 11.5px var(--mg-num); opacity: .72; letter-spacing: .2px; font-variant-numeric: tabular-nums; }
.mg-go.cash { background: var(--mg-win); color: #04241a; box-shadow: 0 6px 18px rgba(46, 204, 143, .2), inset 0 1px 0 rgba(255, 255, 255, .3); }
.mg-go.cash:hover:not(:disabled) { background: #43dca0; }
.mg-go.stop { background: transparent; color: var(--mg-lose); box-shadow: inset 0 0 0 1.5px var(--mg-lose); }
.mg-go.stop:hover:not(:disabled) { background: rgba(255, 93, 108, .08); }
.mg-go.tg { background: #2aabee; color: #fff; box-shadow: none; }
.mg-go:disabled { opacity: .55; box-shadow: none; }
.mg-go.busy::after { content: ""; position: absolute; right: 16px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: mgSpin .7s linear infinite; opacity: .7; }
@keyframes mgSpin { to { transform: rotate(360deg); } }
.mg-stat { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.mg-stat > div { padding: 6px 9px; border-radius: var(--mg-r3); background: var(--mg-field); border: 1px solid var(--mg-line); min-width: 0; }
.mg-stat small { display: block; font-size: 10.5px; font-weight: 700; color: var(--mg-mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-stat b { display: block; font: 700 15px var(--mg-num); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-stat b.w { color: var(--mg-win); }
.mg-autoinfo { font: 600 11.5px var(--mg-num); color: var(--mg-mut); text-align: center; min-height: 14px; }
.mg-autoinfo:empty { display: none; }
.mg-autoinfo b.w { color: var(--mg-win); } .mg-autoinfo b.l { color: var(--mg-lose); }
.mg-autobox { display: flex; flex-direction: column; gap: 9px; }
.mg-onx { display: grid; grid-template-columns: 1fr 1fr 76px; gap: 4px; }
.mg-onx .mg-seg { grid-column: 1 / 3; }
.mg-onx .mg-seg button { white-space: normal; line-height: 1.05; font-size: 11.5px; padding: 0 2px; overflow-wrap: anywhere; }
.mg-onx .mg-in { height: 38px; }
.mg-onx .mg-in input { padding: 0 6px; font-size: 13px; text-align: right; }

/* недоступно в текущем состоянии (data-en, см. mini.js applyState) */
.mg-off { opacity: .5; pointer-events: none; transition: opacity .2s; }
.mg-off .mg-off { opacity: 1; }
.mg-tabs.mg-off, .mg-in.mg-off { opacity: .55; }

/* ================================================================ история (чипы) */
.mg-hist { position: absolute; z-index: 4; top: 10px; right: 10px; left: 10px; display: flex; justify-content: flex-start; gap: 5px; overflow: hidden; pointer-events: none; height: 26px; }
.mg-hist i { flex: none; font-style: normal; height: 26px; min-width: 52px; padding: 0 8px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  font: 700 12px var(--mg-num); font-variant-numeric: tabular-nums; background: var(--mg-field); border: 1px solid var(--mg-line); color: var(--mg-mut); animation: mgChip .35s var(--mg-ease); }
.mg-hist i.w { color: var(--mg-win); border-color: rgba(46, 204, 143, .35); background: rgba(46, 204, 143, .08); }
.mg-hist i.l { color: var(--mg-lose); border-color: rgba(255, 93, 108, .3); background: rgba(255, 93, 108, .06); }
.mg-hist i.g { color: var(--mg-acc); border-color: rgba(242, 193, 78, .4); background: rgba(242, 193, 78, .08); }
@keyframes mgChip { from { opacity: 0; transform: translateX(-10px) scale(.9); } }
.mg-hist.col { top: 10px; bottom: 10px; left: auto; right: 10px; flex-direction: column; justify-content: flex-start; height: auto; width: 56px; }
.mg-hist.col i { width: 56px; min-width: 0; padding: 0 4px; animation-name: mgChipV; }
@keyframes mgChipV { from { opacity: 0; transform: translateY(-10px) scale(.9); } }

/* ================================================================ карточка результата, баннер повтора, тосты */
.mg-card { position: absolute; z-index: 6; left: 50%; top: 50%; min-width: 150px; padding: 14px 22px; border-radius: var(--mg-r2); text-align: center; pointer-events: none;
  background: rgba(14, 20, 32, .94); border: 1.5px solid var(--mg-win); box-shadow: 0 16px 40px rgba(0, 0, 0, .45), 0 0 0 6px rgba(46, 204, 143, .06);
  transform: translate(-50%, -50%) scale(.92); opacity: 0; transition: opacity .28s ease, transform .4s var(--mg-ease); }
.mg-card.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.mg-card b { display: block; font: 800 30px var(--mg-num); color: var(--mg-win); line-height: 1.05; font-variant-numeric: tabular-nums; }
.mg-card small { display: block; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--mg-line); font: 700 14px var(--mg-num); color: var(--mg-txt); font-variant-numeric: tabular-nums; }
.mg-card.l { border-color: var(--mg-lose); box-shadow: 0 16px 40px rgba(0, 0, 0, .45), 0 0 0 6px rgba(255, 93, 108, .05); }
.mg-card.l b { color: var(--mg-lose); font-size: 22px; }
.mg-rp { position: absolute; z-index: 7; left: 50%; top: 44px; transform: translateX(-50%); display: none; align-items: center; gap: 8px; max-width: calc(100% - 20px); padding: 5px 6px 5px 12px; border-radius: 10px;
  background: rgba(11, 16, 26, .94); border: 1px solid var(--mg-line2); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.mg-rp.show { display: flex; }
.mg-rp span { overflow: hidden; text-overflow: ellipsis; }
.mg-rp b { color: var(--mg-acc); }
.mg-rp button { flex: none; height: 26px; padding: 0 10px; border-radius: 7px; background: var(--mg-acc); color: var(--mg-acc-ink); font-weight: 800; font-size: 12px; }
.mg-toast { position: fixed; z-index: 60; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(14px); max-width: 92vw; padding: 10px 16px; border-radius: 11px;
  background: rgba(22, 30, 44, .97); border: 1px solid var(--mg-line2); font-size: 13.5px; font-weight: 700; text-align: center; opacity: 0; transition: opacity .25s, transform .3s var(--mg-ease); pointer-events: none; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.mg-toast.show { opacity: 1; transform: translateX(-50%); }

/* ================================================================ окна */
.ov { position: fixed; inset: 0; z-index: 40; display: none; align-items: center; justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); background: rgba(5, 8, 14, .72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.ov.show { display: flex; animation: mgFade .2s ease; }
@keyframes mgFade { from { opacity: 0; } }
.sheet { position: relative; width: min(560px, 100%); max-height: 92vh; max-height: 92dvh; overflow: auto; padding: 20px 18px 18px; border-radius: 16px; background: var(--mg-panel); border: 1px solid var(--mg-line2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55); user-select: text; -webkit-user-select: text; scrollbar-width: thin; }
.sheet h3 { margin: 0 40px 12px 0; font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.sheet h3 i { color: var(--mg-acc); }
.sheet h4 { margin: 16px 0 7px; font-size: 12px; font-weight: 800; color: var(--mg-mut); letter-spacing: .6px; text-transform: uppercase; }
.sheet p, .sheet li { font-size: 13.5px; line-height: 1.55; color: #c6cfdd; }
.sheet ul { padding-left: 18px; margin: 6px 0; }
.sheet a { color: var(--mg-acc); }
.sheet .x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--mg-line); background: var(--mg-field); font-size: 14px; color: var(--mg-mut); }
.mono { font: 600 12px ui-monospace, Menlo, Consolas, monospace; word-break: break-all; padding: 8px 10px; border-radius: 9px; background: var(--mg-field); border: 1px solid var(--mg-line); color: #d6deea; }
.frm { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.frm label { font-size: 11px; color: var(--mg-mut); font-weight: 700; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.frm label.w { grid-column: 1 / -1; }
.frm input, .frm select { height: 38px; border-radius: 9px; border: 1px solid var(--mg-line); background: var(--mg-field); padding: 0 10px; font: 600 13px ui-monospace, Menlo, monospace; min-width: 0; outline: 0; }
.frm input:focus, .frm select:focus { border-color: var(--mg-line2); }
.btn { height: 38px; padding: 0 16px; border-radius: 10px; background: var(--mg-acc); color: var(--mg-acc-ink); font-weight: 800; font-size: 13px; }
.btn.g { background: var(--mg-field); color: var(--mg-txt); border: 1px solid var(--mg-line); }
.btn:disabled { opacity: .5; }
.btns { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.vres { margin-top: 10px; font-size: 13px; }
.okm { color: var(--mg-win); font-weight: 800; } .bad { color: var(--mg-lose); font-weight: 800; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl td, .tbl th { padding: 6px 5px; border-bottom: 1px solid var(--mg-line); text-align: left; font-variant-numeric: tabular-nums; }
.tbl th { color: var(--mg-mut); font-weight: 700; font-size: 11px; }
.tbl .w { color: var(--mg-win); font-weight: 800; } .tbl .l { color: var(--mg-lose); font-weight: 800; }
.tbl button { font-size: 12px; color: var(--mg-acc); font-weight: 800; }
.tbl a { color: var(--mg-mut); font-size: 12px; margin-left: 6px; }
.tbl.c td, .tbl.c th { text-align: center; }

/* Telegram без шрифта Font Awesome Brands (115K ради одной иконки): та же фигура FA 6.5.2 (CC BY 4.0) маской, размер и базовая линия как у глифа */
.fa-brands.fa-telegram, .fab.fa-telegram { font-family: inherit; } /* шрифт Brands не нужен ни глифу, ни строке */
.fa-brands.fa-telegram::before, .fab.fa-telegram::before { content: ""; display: inline-block; width: .969em; height: 1em; vertical-align: -.125em; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 496 512'%3E%3Cpath d='M248,8C111.033,8,0,119.033,0,256S111.033,504,248,504,496,392.967,496,256,384.967,8,248,8ZM362.952,176.66c-3.732,39.215-19.881,134.378-28.1,178.3-3.476,18.584-10.322,24.816-16.948,25.425-14.4,1.326-25.338-9.517-39.287-18.661-21.827-14.308-34.158-23.215-55.346-37.177-24.485-16.135-8.612-25,5.342-39.5,3.652-3.793,67.107-61.51,68.335-66.746.153-.655.3-3.1-1.154-4.384s-3.59-.849-5.135-.5q-3.283.746-104.608,69.142-14.845,10.194-26.894,9.934c-8.855-.191-25.888-5.006-38.551-9.123-15.531-5.048-27.875-7.717-26.8-16.291q.84-6.7,18.45-13.7,108.446-47.248,144.628-62.3c68.872-28.647,83.183-33.623,92.511-33.789,2.052-.034,6.639.474,9.61,2.885a10.452,10.452,0,0,1,3.53,6.716A43.765,43.765,0,0,1,362.952,176.66Z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 496 512'%3E%3Cpath d='M248,8C111.033,8,0,119.033,0,256S111.033,504,248,504,496,392.967,496,256,384.967,8,248,8ZM362.952,176.66c-3.732,39.215-19.881,134.378-28.1,178.3-3.476,18.584-10.322,24.816-16.948,25.425-14.4,1.326-25.338-9.517-39.287-18.661-21.827-14.308-34.158-23.215-55.346-37.177-24.485-16.135-8.612-25,5.342-39.5,3.652-3.793,67.107-61.51,68.335-66.746.153-.655.3-3.1-1.154-4.384s-3.59-.849-5.135-.5q-3.283.746-104.608,69.142-14.845,10.194-26.894,9.934c-8.855-.191-25.888-5.006-38.551-9.123-15.531-5.048-27.875-7.717-26.8-16.291q.84-6.7,18.45-13.7,108.446-47.248,144.628-62.3c68.872-28.647,83.183-33.623,92.511-33.789,2.052-.034,6.639.474,9.61,2.885a10.452,10.452,0,0,1,3.53,6.716A43.765,43.765,0,0,1,362.952,176.66Z'/%3E%3C/svg%3E") center / contain no-repeat; }

/* ================================================================ раскладка
 * широкий экран (ландшафт): панель слева, игра справа;  портрет: игра сверху, панель снизу (главная кнопка первой).
 * Поле игры — главное: всё второстепенное на низких экранах прячется (mg-opt-tall / mg-opt-short), на телефонах футер становится плавающими кнопками. */
@media (min-aspect-ratio: 11/10) {
  .mg-main { flex-direction: row; padding: 10px; gap: 10px; }
  .mg-side { width: var(--mg-side); }
  .mg-panel { flex: 1; }
  .mg-pscroll { flex: 1 1 auto; }
}
@media (min-aspect-ratio: 11/10) and (max-height: 640px) {
  :root { --mg-hh: 44px; }
  .mg-main { padding: 6px; gap: 6px; }
  .mg-back, .mg-bal, .mg-login, .mg-ib { height: 30px; } .mg-ib { width: 30px; }
  .mg-panel { gap: 7px; padding: 9px; }
  .mg-in { height: 34px; } .mg-sel { height: 34px; } .mg-tabs button { height: 26px; } .mg-seg button { height: 27px; } .mg-chips button { height: 25px; }
  .mg-go { height: 44px; font-size: 14.5px; }
  .mg-foot { height: 32px; }
  .mg-opt-tall { display: none !important; }
}
@media (min-aspect-ratio: 11/10) and (max-height: 430px) {
  :root { --mg-side: 250px; }
  .mg-main { padding: 4px 6px; gap: 6px; }
  .mg-title small, .mg-back span { display: none; }
  .mg-panel { gap: 6px; padding: 8px; }
  .mg-lbl { font-size: 10.5px; }
  .mg-go { height: 40px; }
  .mg-opt-short { display: none !important; }
  /* футер — плавающие кнопки в правом нижнем углу поля (под колонкой истории) */
  .mg-foot { position: absolute; z-index: 5; right: 10px; bottom: 8px; width: 56px; height: auto; padding: 0; gap: 6px; flex-direction: column; align-items: stretch; border: 0; background: none; }
  .mg-foot button { height: 40px; padding: 0; justify-content: center; border-radius: 10px; background: var(--mg-field); border: 1px solid var(--mg-line); font-size: 15px; color: var(--mg-mut); }
  .mg-foot button span, .mg-foot .mg-note { display: none; }
}
@media (max-aspect-ratio: 11/10) {
  :root { --mg-hh: 48px; }
  .mg-main { padding: 6px; gap: 6px; }
  .mg-area { order: -1; }
  .mg-side { max-height: 58%; }
  .mg-panel { padding: 10px; gap: 8px; }
  .mg-gobar { order: -1; }
  .mg-autoinfo { margin-top: -2px; }
  .mg-opt-tall { display: none !important; }
  .mg-foot { height: 32px; }
  /* свои контролы игры — в две колонки (ставка остаётся на всю ширину): панель ниже, поле выше */
  #mgCtl { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); align-items: end; gap: 8px !important; }
}
@media (max-aspect-ratio: 11/10) and (max-width: 420px) {
  .mg-top { gap: 6px; padding: 0 8px; }
  .mg-back { padding: 0 9px; } .mg-back span { display: none; }
  .mg-title b { font-size: 15px; } .mg-title small { font-size: 8.5px; letter-spacing: 1.2px; }
  .mg-bal { font-size: 12.5px; padding-left: 8px; gap: 5px; } .mg-coin { width: 14px; height: 14px; }
  .mg-ib { width: 30px; height: 30px; font-size: 13px; } .mg-icons { gap: 4px; }
  .mg-back, .mg-bal, .mg-login { height: 30px; }
  .mg-bal button { width: 22px; height: 22px; }
  .mg-in { height: 38px; }
  .mg-go { height: 48px; }
  .mg-foot .mg-note { display: none; }
}
/* телефон, портрет: звук и музыка — в окне настроек (там же громкость), в шапке — скорость и настройки */
@media (max-aspect-ratio: 11/10) and (max-width: 520px) {
  #soundBtn, #wmMusicBtn { display: none !important; }
  .mg-top { gap: 6px; padding: 0 8px; }
  .mg-back { padding: 0 9px; } .mg-back span { display: none; }
  .mg-side { max-height: 52%; }
  /* футер — две плавающие кнопки в правом верхнем углу поля, строка истории укорочена */
  .mg-foot { position: absolute; z-index: 5; top: 8px; right: 8px; height: auto; padding: 0; gap: 6px; border: 0; background: none; }
  .mg-foot button { width: 40px; height: 34px; padding: 0; justify-content: center; border-radius: 9px; background: var(--mg-field); border: 1px solid var(--mg-line); font-size: 14px; color: var(--mg-mut); }
  .mg-foot button span, .mg-foot .mg-note { display: none; }
  .mg-hist:not(.col) { right: 104px; top: 12px; }
  #mgCtl .mg-chips { display: none !important; } /* мины / ряды — кнопками ± и вводом */
}
@media (max-aspect-ratio: 11/10) and (max-width: 380px) { .mg-title small { letter-spacing: .5px; } .mg-top { gap: 4px !important; padding: 0 6px !important; } .mg-bal { gap: 4px !important; padding-left: 7px !important; } .mg-icons { gap: 3px !important; } }
@media (max-aspect-ratio: 11/10) and (max-height: 820px) { .mg-opt-short { display: none !important; } }
@media (max-aspect-ratio: 11/10) and (max-height: 700px) {
  .mg-panel { padding: 8px; gap: 6px; }
  .mg-go { height: 46px; }
  .mg-lbl { font-size: 10.5px; }
}

/* сенсорные экраны: цели нажатия не меньше 44 px, поля ввода 16 px (iOS не увеличивает страницу) */
@media (pointer: coarse) {
  :root { --mg-hh: 52px; }
  .mg-top { gap: 6px; }
  .mg-back, .mg-ib, .mg-login { height: 44px !important; min-width: 44px; }
  .mg-ib { width: 44px !important; font-size: 15px; }
  .mg-back { justify-content: center; }
  .mg-bal { height: 44px !important; padding-right: 4px; }
  .mg-bal button { position: relative; width: 36px !important; height: 36px !important; border-radius: 9px; font-size: 18px; }
  .mg-bal button::after { content: ""; position: absolute; inset: -4px; }
  .mg-icons { gap: 4px; }
  .mg-tabs { padding: 2px; } .mg-tabs button { height: 44px !important; }
  .mg-seg { padding: 2px; } .mg-seg button { height: 44px !important; }
  .mg-in { height: 44px !important; } .mg-in > button { min-width: 44px; }
  .mg-in input, .mg-onx .mg-in input, .mg-sel, .frm input, .frm select { font-size: 16px !important; }
  .mg-onx .mg-in { height: 44px !important; }
  .mg-chips button { height: 44px !important; }
  .mg-tg { min-height: 44px; }
  .mg-foot button { min-height: 44px; min-width: 44px; }
  .mg-foot { height: 48px; }
  .sheet .x { width: 44px; height: 44px; top: 8px; right: 8px; }
  .sheet h3 { margin-right: 50px; min-height: 30px; }
  .btn { min-height: 44px; }
  .tbl button { min-height: 44px; padding: 0 6px; } .tbl a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin-left: 0; }
  .mg-rp button { min-height: 44px; }
}
@media (pointer: coarse) and (min-aspect-ratio: 11/10) and (max-height: 430px) {
  :root { --mg-hh: 48px; }
  .mg-go { height: 44px; }
  .mg-foot { height: auto; }
  .mg-foot button { height: 44px; }
}
@media (pointer: coarse) and (max-aspect-ratio: 11/10) and (max-width: 520px) {
  .mg-foot { height: auto; }
  .mg-foot button { width: 44px; height: 44px; }
  .mg-hist:not(.col) { right: 112px; top: 17px; }
}
@media (max-width: 420px) { .tbl td, .tbl th { padding: 6px 3px; } .tbl { font-size: 12px; } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* шапка на телефоне (владелец 30.11): всё в одну строку, ничего не наезжает — название и «Brink Originals» ужимаются первыми, баланс — с многоточием */
.mg-back, .mg-icons { flex: none; }
.mg-title { flex: 0 1 auto; }
.mg-title b, .mg-title small { display: block; overflow: hidden; text-overflow: ellipsis; }
.mg-acct { flex: 0 1 auto; }
.mg-bal { min-width: 0; overflow: hidden; }
#mgBal { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mg-bal button { flex: none; }
@media (max-aspect-ratio: 11/10) and (max-width: 420px) {
  .mg-title small { font-size: 8px; letter-spacing: .2px; }
  .mg-bal { font-size: 12px; }
}
/* полосы прокрутки (01.12): тонкие, тёмная дорожка, стальной бегунок, мятный при наведении (как в оболочке brink.bet) */
* { scrollbar-width: thin; scrollbar-color: rgba(120,138,180,.45) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(120,138,180,.45); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #2FE6B8; }
::-webkit-scrollbar-corner { background: transparent; }

/* 01.12: сегменты (риск Низкий/Средний/Высокий) не вылезают за поле на узком телефоне — колонки сжимаются, длинные RU-слова мельче */
.mg-seg { grid-auto-columns: minmax(0, 1fr); }
.mg-seg button { min-width: 0; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
@media (max-width: 420px) { .mg-seg { gap: 2px; } .mg-seg button { font-size: 10.5px; padding: 0 1px; } }
.mg-lbl, .mg-lbl b { line-height: 16px; min-height: 16px; } /* подписи полей в одном ряду — на одной линии */

/* 01.12: поля в одном ряду (Plinko «Риск» / «Ряды») — подписи и рамки на одной линии: сегмент той же высоты, что и поле ввода */
.mg-seg { height: 40px; padding: 3px; align-items: stretch; } .mg-seg button { height: auto !important; }
@media (pointer: coarse) { .mg-seg { height: 44px; padding: 2px; } }
@media (max-aspect-ratio: 11/10) and (max-width: 420px) { .mg-seg { height: 34px; } }
@media (pointer: coarse) and (max-aspect-ratio: 11/10) and (max-width: 420px) { .mg-seg { height: 44px; } }
