/* ===== Mèo Bom pages: shell, lobby, waiting room, result podium, dialogs, guide.
   Tokens in meo-bom.css; table in meo-bom-table.css; animations in meo-bom-fx.css. ===== */
.mb-body { margin: 0; background: var(--op-bg-page); color: var(--op-text); }
/* JS toggles panels with the hidden attribute; class rules that set display must not override it. */
.mb-body [hidden] { display: none !important; }
.mb-body.mb-modal-open { overflow: hidden; }
.mb-main { max-width: 860px; margin: 0 auto; padding: 16px 16px 48px; box-sizing: border-box; }
.mb-section { margin-bottom: 14px; }
.mb-nav { overflow-x: auto; min-width: 0; }
.mb-nav a { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.mb-body .lm-btn { box-sizing: border-box; min-height: 44px; transition: transform .15s var(--mb-ease), box-shadow .15s, background-color .15s; }
.mb-body .lm-btn:not(:disabled):active { transform: scale(.97); }
.mb-body button:disabled, .mb-body .lm-btn:disabled { opacity: .5; cursor: not-allowed; }
.mb-body :focus-visible { outline: 3px solid var(--mb-focus); outline-offset: 2px; }
.mb-muted { color: var(--op-text-2); font-size: 13.5px; line-height: 1.5; margin: 0; }
.mb-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Account chip (same as the caro pages) */
.play-account { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; min-width: 0; }
.play-account-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; color: var(--op-brown); text-decoration: none; }
.play-account-logout { margin: 0; }
.play-account-logout button, .play-account-login { box-sizing: border-box; min-height: 40px; padding: 8px 12px; border-radius: 10px; font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; }
.play-account-logout button { border: 1px solid var(--op-border); background: #fff; color: var(--op-text-2); }
.play-account-login { margin-left: auto; background: var(--op-accent); color: #fff; font-weight: 700; display: inline-flex; align-items: center; }

/* Icons */
.mb-ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mb-ico--sm { width: 18px; height: 18px; }
.mb-icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--op-border); border-radius: 12px;
    background: var(--op-bg-card); color: var(--op-text); cursor: pointer; }
.mb-volume { width: 84px; min-height: 44px; accent-color: var(--op-accent, #E86F2C); }
@media (max-width: 480px) { .mb-volume { width: 64px; } }
.mb-icon-btn[aria-pressed="true"] { background: var(--op-accent-light); color: var(--op-accent-dark); border-color: var(--op-accent); }
.mb-link-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0; border: 0; background: none;
    color: var(--op-accent-dark); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.mb-nv { display: inline-block; margin-left: 5px; padding: 1px 5px; border-radius: 6px; background: var(--mb-rescue-soft); color: var(--mb-rescue);
    font-size: 10px; font-weight: 800; vertical-align: middle; }
.mb-you { margin-left: 5px; padding: 1px 5px; border-radius: 6px; background: var(--op-accent-light); color: var(--op-accent-dark); font-size: 10px; font-weight: 800; }
.mb-tag { margin-left: 8px; padding: 2px 7px; border-radius: 999px; background: var(--mb-reaction-soft); color: var(--mb-reaction); font-size: 11px; font-weight: 700; }

/* Lobby */
.mb-hero { display: flex; align-items: center; gap: 18px; padding: 6px 2px 18px; }
.mb-hero h1 { font-size: clamp(24px, 6vw, 34px); font-weight: 800; margin: 0 0 4px; letter-spacing: -.02em; }
.mb-hero p { margin: 0 0 4px; color: var(--op-text-2); font-size: 14px; line-height: 1.5; }
.mb-hero-cards { position: relative; flex: none; width: 92px; height: 100px; }
.mb-hero-card { position: absolute; width: 62px; height: 87px; filter: drop-shadow(0 6px 10px rgba(43, 27, 18, .3)); }
.mb-hero-card:first-child { left: 0; top: 8px; transform: rotate(-10deg); }
.mb-hero-card:last-child { right: 0; top: 0; transform: rotate(9deg); }
.mb-who { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.mb-who p { margin: 0; flex: 1 1 260px; font-size: 14px; }
.mb-create { display: grid; gap: 12px; }
.mb-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mb-card-title { font-size: 16px; font-weight: 800; margin: 0 0 10px; }
.mb-live { font-size: 12px; color: var(--op-text-muted); }
.mb-list { list-style: none; margin: 0; padding: 0; }
.mb-list-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--op-border-card); }
.mb-list-item:first-child { border-top: 0; }
.mb-list-main { flex: 1; min-width: 0; }
.mb-list-title { font-weight: 700; }
.mb-list-names { font-size: 13px; color: var(--op-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-list-count { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--op-brown); }
.mb-row-btn { min-height: 40px !important; padding: 8px 14px; }
.mb-empty { margin: 4px 0 0; font-size: 13.5px; color: var(--op-text-muted); }
.mb-switch { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; font-size: 14px; cursor: pointer; }
.mb-switch input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--op-accent); flex: none; }
.mb-switch small { color: var(--op-text-2); }

/* Room head */
.mb-room-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.mb-room-title { min-width: 0; }
.mb-room-title h1 { margin: 0; font-size: 20px; font-weight: 800; }
.mb-status { font-size: 13px; color: var(--op-text-2); }
.mb-toolbar { display: flex; gap: 6px; align-items: center; }

/* Waiting room */
.mb-wseats { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.mb-wseat { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
    padding: 10px; border: 1px solid var(--op-border-card); border-radius: 14px; background: var(--op-bg-card); min-height: 64px; box-sizing: border-box; }
.mb-wseat.is-me { border-color: var(--op-accent); background: var(--op-accent-light); }
.mb-wseat.is-empty { border-style: dashed; color: var(--op-text-muted); background: transparent; }
.mb-wseat.is-offline { opacity: .6; }
.mb-wseat-avatar { grid-row: span 2; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff;
    background: hsl(var(--hue, 25) 55% 45%); border: 2px solid var(--mb-ink); }
.mb-wseat.is-empty .mb-wseat-avatar { background: transparent; color: var(--op-text-muted); border: 2px dashed var(--op-border); }
.mb-wseat-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mb-wseat-meta { font-size: 12px; color: var(--op-text-2); }
.mb-invite { display: flex; gap: 8px; margin-bottom: 10px; }
.mb-invite-input { flex: 1; min-width: 0; min-height: 44px; box-sizing: border-box; }
.mb-waiting-text { margin: 6px 0 12px; font-size: 14px; }
.mb-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mb-actions--end { justify-content: flex-end; }

/* Result podium */
.mb-podium { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.mb-podium-row { display: grid; grid-template-columns: 40px 1fr auto auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--op-bg-cat); }
.mb-podium-row--1 { background: linear-gradient(135deg, #FFF3C4, #FFE08A); font-weight: 700; }
.mb-podium-place { font-weight: 800; font-size: 18px; color: var(--op-brown); }
.mb-podium-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-podium-why { font-size: 12px; color: var(--op-text-2); }
.mb-podium-elo { min-width: 44px; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.mb-podium-elo.is-up { color: var(--op-success); }
.mb-podium-elo.is-down { color: var(--op-error); }

/* Dialogs */
.mb-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(26, 18, 12, .55); box-sizing: border-box; }
.mb-modal-box { width: min(100%, 460px); max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); }
.mb-modal-box--wide { width: min(100%, 760px); }
.mb-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 6px; }
.mb-modal-head h2 { margin: 0; font-size: 17px; font-weight: 800; }
.mb-modal-body { padding: 6px 16px 12px; overflow-y: auto; }
.mb-modal-box > .mb-actions { padding: 0 16px 16px; }
.mb-pick-list { display: grid; gap: 8px; }
.mb-pick-seat { justify-content: space-between !important; width: 100%; }
.mb-pick-seat small { color: var(--op-text-2); font-weight: 500; }

/* Guide */
.mb-guide-rules { margin: 0 0 10px; padding-left: 20px; line-height: 1.55; font-size: 14px; }
.mb-guide-rules li { margin-bottom: 6px; }
.mb-guide-heading { font-size: 14px; font-weight: 800; margin: 16px 0 8px; text-transform: uppercase; letter-spacing: .06em; color: var(--op-text-2); }
.mb-gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; justify-items: center; }
.mb-gallery li { position: relative; }
.mb-card--gallery { --mb-card-w: 150px; }
.mb-gallery-count { position: absolute; top: -6px; right: -6px; padding: 2px 7px; border-radius: 999px; background: var(--mb-ink); color: #fff; font-size: 11px; font-weight: 800; }

/* Leaderboard */
.mb-tabs { display: flex; flex-wrap: wrap; margin: 0 0 14px; }
.mb-tabs .lm-pill { box-sizing: border-box; text-decoration: none; min-height: 40px; display: inline-flex; align-items: center; }
.mb-period { margin: 0 0 10px; font-size: 13px; color: var(--op-text-2); }
.mb-rank-table th.num, .mb-rank-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mb-rank { width: 44px; }
.mb-medal { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 700; font-size: 13px; color: var(--op-text-2); }
.mb-hero .mb-link-btn + .mb-link-btn { margin-left: 16px; }
.mb-medal--1 { color: #7C4A03; background: linear-gradient(135deg, #FDE68A, #F59E0B); }
.mb-medal--2 { color: #374151; background: linear-gradient(135deg, #F3F4F6, #CBD5E1); }
.mb-medal--3 { color: #6B3410; background: linear-gradient(135deg, #FCD9B8, #D9925B); }
.mb-rank-name { max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mb-rank-table tr.is-me td { background: var(--op-accent-light); }

@media (max-width: 480px) {
    .mb-main { padding: 12px 12px 40px; }
    .mb-invite { flex-direction: column; }
    .mb-hero { gap: 12px; }
    .mb-hero-cards { width: 70px; height: 80px; }
    .mb-hero-card { width: 48px; height: 67px; }
    .mb-gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .mb-card--gallery { --mb-card-w: min(150px, 40vw); }
    /* App bar, same as Caro: logo badge only, scrollable nav without bar, account chip on its own row. */
    .mb-body .lm-appbar { flex-wrap: wrap; gap: 8px 10px; }
    .mb-body .lm-brand { font-size: 0; gap: 0; }
    .mb-body .lm-brand .logo { font-size: 17px; }
    .mb-nav { scrollbar-width: none; }
    .mb-nav::-webkit-scrollbar { display: none; }
    .mb-nav .mb-ico { display: none; }
    .mb-body .play-account, .mb-body .play-account-login { order: 3; width: 100%; justify-content: flex-end; margin-left: 0; }
    .mb-rank-table th, .mb-rank-table td { padding: 9px 6px; font-size: 12.5px; }
    .mb-tabs { flex-wrap: nowrap; overflow-x: auto; }
    .mb-tabs .lm-pill { padding: 7px 11px; white-space: nowrap; }
}
