:root {
  --bg: #0b0c0f;
  --panel: #12141a;
  --ink: #eef0f4;
  --muted: #8b919c;
  --line: rgba(255, 255, 255, 0.09);
  --a: #ff6b8a;
  --b: #5eb6ff;
  --ok: #6dcaa0;
  --warn: #e2b75a;
  --ban: #ff5a68;
  --pick: #5fd6a4;
  --font: "Sora", system-ui, sans-serif;
  --radius: 12px;
  --max: 720px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body.mb-page {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}

@keyframes mb-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes mb-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes mb-stamp {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes mb-coin-toss {
  0% {
    transform: translateY(36px);
  }
  40% {
    transform: translateY(-78px);
  }
  75% {
    transform: translateY(6px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes mb-coin-flip-a {
  from {
    transform: rotateY(0deg);
  }
  to {
    transform: rotateY(1800deg);
  }
}

@keyframes mb-coin-flip-b {
  from {
    transform: rotateY(0deg);
  }
  to {
    transform: rotateY(1980deg);
  }
}

@keyframes mb-coin-shadow {
  0%,
  100% {
    transform: scaleX(1);
    opacity: 0.28;
  }
  40% {
    transform: scaleX(0.55);
    opacity: 0.1;
  }
}

@keyframes mb-result-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.mb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 12, 15, 0.92);
  position: sticky;
  top: 0;
  z-index: 5;
}

.mb-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
}

.mb-brand img {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  object-fit: cover;
}

.mb-brand em {
  font-style: normal;
  color: var(--muted);
  font-weight: 600;
}

.mb-brand em::before {
  content: "/";
  margin-right: 7px;
  color: rgba(255, 255, 255, 0.2);
}

.mb-top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mb-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.mb-pill.is-a {
  color: #ffc2d0;
  border-color: rgba(255, 107, 138, 0.35);
}

.mb-pill.is-b {
  color: #c7e8ff;
  border-color: rgba(94, 182, 255, 0.35);
}

.mb-pill.is-host {
  color: #f0d59a;
  border-color: rgba(226, 183, 90, 0.35);
}

.mb-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.mb-link:hover {
  color: var(--ink);
}

.mb-shell {
  width: min(var(--max), calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 56px;
  animation: mb-in 0.28s ease both;
}

.mb-boot {
  color: var(--muted);
  padding: 48px 0;
  text-align: center;
}

.mb-hero {
  margin-bottom: 20px;
}

.mb-hero h1 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.mb-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  max-width: 48ch;
}

.mb-grid2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

.mb-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.mb-panel h2 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
}

.mb-field {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
}

.mb-field label {
  font-size: 10px;
  font-weight: 650;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mb-field input,
.mb-field select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  background: #0d0f14;
  color: var(--ink);
  border-radius: 9px;
  padding: 0 11px;
  font: inherit;
  font-size: 13px;
}

.mb-field input:focus,
.mb-field select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.22);
}

.mb-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 520px) {
  .mb-row {
    grid-template-columns: 1fr;
  }
}

.mb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.mb-btn {
  border: 0;
  border-radius: 9px;
  height: 36px;
  padding: 0 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  background: #1c2028;
  color: var(--ink);
}

.mb-btn:hover {
  filter: brightness(1.08);
}

.mb-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mb-btn.primary {
  background: #ff6b8a;
  color: #14080c;
}

.mb-btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
}

.mb-btn.coin {
  border: 1px solid rgba(226, 183, 90, 0.35);
  background: rgba(226, 183, 90, 0.1);
  color: #f0d59a;
}

.mb-btn.a {
  background: rgba(255, 107, 138, 0.14);
  color: #ffc2d0;
}

.mb-btn.b {
  background: rgba(94, 182, 255, 0.14);
  color: #c7e8ff;
}

.mb-pool {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
  align-items: start;
}

.mb-pool-item {
  position: relative;
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  cursor: pointer;
  background: #0d0f14;
  padding: 0;
  text-align: left;
  color: inherit;
  font: inherit;
  transition: border-color 0.15s;
}

.mb-pool-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.mb-pool-item img {
  display: block;
  width: 100%;
  height: 54px;
  object-fit: cover;
  object-position: center;
}

.mb-pool-item span {
  display: block;
  padding: 6px 7px 7px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mb-pool-item.is-on {
  border-color: rgba(109, 202, 160, 0.55);
}

.mb-pool-item.is-on::after {
  content: "✓";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--ok);
  color: #0b1a12;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.mb-starter-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  margin-bottom: 12px;
}

.mb-starter-banner.is-a {
  border-color: rgba(255, 107, 138, 0.35);
}

.mb-starter-banner.is-b {
  border-color: rgba(94, 182, 255, 0.35);
}

.mb-starter-banner strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.mb-starter-banner span {
  color: var(--muted);
  font-size: 11px;
}

.mb-code-chip {
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0.12em;
  padding: 7px 10px;
  border-radius: 8px;
  background: #0d0f14;
  border: 1px solid var(--line);
}

.mb-turn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-bottom: 12px;
  background: var(--panel);
}

.mb-turn strong {
  display: block;
  font-size: 15px;
  font-weight: 750;
}

.mb-turn span {
  color: var(--muted);
  font-size: 12px;
}

.mb-turn.is-a {
  border-color: rgba(255, 107, 138, 0.4);
}

.mb-turn.is-b {
  border-color: rgba(94, 182, 255, 0.4);
}

.mb-side-pick {
  margin: 0 0 14px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 214, 102, 0.35);
  background: rgba(255, 214, 102, 0.06);
}

.mb-side-pick p {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text);
}

.mb-side-pick strong {
  font-weight: 700;
}

.mb-map.needs-side {
  border-color: rgba(255, 214, 102, 0.55);
  box-shadow: 0 0 0 1px rgba(255, 214, 102, 0.15);
}

.mb-teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.mb-team {
  border-radius: var(--radius);
  padding: 11px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.mb-team.is-a {
  border-color: rgba(255, 107, 138, 0.3);
}

.mb-team.is-b {
  border-color: rgba(94, 182, 255, 0.3);
}

.mb-team h3 {
  margin: 0 0 3px;
  font-size: 13px;
  font-weight: 700;
}

.mb-team p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.mb-maps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
  align-items: start;
}

.mb-map {
  position: relative;
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #0d0f14;
  padding: 0;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: default;
  transition: border-color 0.15s, transform 0.15s;
}

.mb-map img {
  display: block;
  width: 100%;
  height: 78px;
  object-fit: cover;
  object-position: center;
}

.mb-map .mb-map-name {
  padding: 7px 8px 8px;
  font-size: 12px;
  font-weight: 700;
  background: #0d0f14;
}

.mb-map .mb-map-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.65);
  animation: mb-stamp 0.25s ease both;
}

.mb-map.is-open.can-act {
  cursor: pointer;
}

.mb-map.is-open.can-act:hover {
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.mb-map.is-ban img {
  filter: grayscale(1) brightness(0.45);
}

.mb-map.is-ban .mb-map-tag {
  background: var(--ban);
  color: #fff;
}

.mb-map.is-pick img,
.mb-map.is-decider img {
  filter: saturate(1.1);
}

.mb-map.is-pick .mb-map-tag,
.mb-map.is-decider .mb-map-tag {
  background: var(--pick);
  color: #062214;
}

.mb-map.is-gone:not(.is-ban):not(.is-pick):not(.is-decider) {
  opacity: 0.35;
}

.mb-result {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.mb-result-maps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.mb-result-card {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(95, 214, 164, 0.3);
  background: #0d0f14;
}

.mb-result-card img {
  width: 100%;
  height: 84px;
  object-fit: cover;
  display: block;
}

.mb-result-card div {
  padding: 8px 10px;
}

.mb-result-card strong {
  display: block;
  font-size: 13px;
}

.mb-result-card span {
  color: var(--muted);
  font-size: 11px;
}

.mb-log {
  display: grid;
  gap: 5px;
  margin-top: 12px;
}

.mb-log-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.mb-log-item b {
  color: var(--ink);
  font-weight: 700;
}

.mb-err {
  color: #ff8f9a;
  font-size: 12px;
  margin: 8px 0 0;
}

.mb-share {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.mb-share label {
  font-size: 10px;
  color: var(--muted);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mb-share input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  background: #0d0f14;
  color: var(--ink);
  border-radius: 8px;
  padding: 0 10px;
  font: inherit;
  font-size: 11px;
}

.mb-join {
  display: grid;
  gap: 2px;
}

.mb-coin-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 9, 12, 0.82);
  backdrop-filter: blur(8px);
  animation: mb-fade 0.2s ease both;
}

.mb-coin-stage {
  width: min(280px, 100%);
  text-align: center;
  animation: mb-in 0.25s ease both;
}

.mb-coin-scene {
  position: relative;
  height: 180px;
  margin: 0 auto 4px;
  perspective: 800px;
}

.mb-coin-floor {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 72px;
  height: 10px;
  margin-left: -36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  filter: blur(2px);
}

.mb-coin-toss {
  position: absolute;
  left: 50%;
  bottom: 28px;
  width: 96px;
  height: 96px;
  margin-left: -48px;
  transform-style: preserve-3d;
}

.mb-coin-toss.is-toss {
  animation: mb-coin-toss 1.45s cubic-bezier(0.22, 0.8, 0.25, 1) both;
}

.mb-coin-toss.is-toss .mb-coin-floor-soft {
  animation: mb-coin-shadow 1.45s ease both;
}

.mb-coin-floor-soft {
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 56px;
  height: 10px;
  margin-left: -28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  filter: blur(3px);
}

.mb-coin3d {
  width: 96px;
  height: 96px;
  position: relative;
  transform-style: preserve-3d;
}

.mb-coin-toss.is-toss .mb-coin3d.is-a {
  animation: mb-coin-flip-a 1.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.mb-coin-toss.is-toss .mb-coin3d.is-b {
  animation: mb-coin-flip-b 1.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.mb-coin-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.mb-coin-face.front {
  background: radial-gradient(circle at 30% 28%, #fff1c4, #d2a24a 60%, #8a641c);
  transform: rotateY(0deg) translateZ(1px);
}

.mb-coin-face.back {
  background: radial-gradient(circle at 30% 28%, #f2f3f5, #b5b9c1 60%, #6d727c);
  transform: rotateY(180deg) translateZ(1px);
}

.mb-coin-face em {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(30, 24, 12, 0.85);
}

.mb-coin-face.back em {
  color: rgba(24, 26, 32, 0.82);
}

.mb-coin-meta {
  min-height: 78px;
  display: grid;
  gap: 4px;
  justify-items: center;
}

.mb-coin-kicker {
  margin: 0;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

.mb-coin-title {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
}

.mb-coin-sub {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.mb-coin-result {
  margin-top: 2px;
  opacity: 0;
}

.mb-coin-result.is-on {
  animation: mb-result-in 0.3s ease both;
}

.mb-coin-result strong {
  display: block;
  font-size: 16px;
  font-weight: 750;
  margin-bottom: 2px;
}

.mb-coin-result span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 12px;
}

.mb-coin-result.is-a strong {
  color: #ffb3c2;
}

.mb-coin-result.is-b strong {
  color: #a9dcff;
}

.mb-hidden {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
