/* Chim bay bay: giao diện bổ sung cho ChiaNè / Trò chơi nhóm (game.css). */
.fb-narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.fb-code-in { text-align: center; font-size: 2rem; font-weight: 800; letter-spacing: .5em; padding-left: calc(.5em + 14px); text-transform: uppercase; }
.fb-code-tag { display: inline-block; padding: 0 .5em; border-radius: 10px; background: var(--teal-soft); color: var(--teal-deep); letter-spacing: .25em; font-weight: 800; }
.fb-label { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.fb-wait { margin: 8px 0; color: var(--ink-2); }
.fb-room .card { margin-bottom: 14px; }
.fb-msg { text-align: center; }
.fb-bigcode { font-size: clamp(2.4rem, 12vw, 3.6rem); font-weight: 800; letter-spacing: .3em; padding-left: .3em; color: var(--teal-deep); line-height: 1.15; }
.fb-guest-code { text-align: center; }
.fb-invite-grid { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
@media (max-width: 520px) { .fb-invite-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.fb-invite-info { min-width: 0; width: 100%; }
.fb-link { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.fb-link input { flex: 1; min-width: 0; padding: 9px 12px; border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; font: inherit; font-size: .9rem; }
.fb-qr { width: 200px; height: 200px; line-height: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.fb-qr svg { width: 100%; height: 100%; display: block; }
.fb-count { font-weight: 600; color: var(--ink-3); font-size: .9em; }
.fb-plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fb-prow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.fb-prow.is-off { opacity: .6; }
.fb-av { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 800; }
.fb-pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.fb-pname small { color: var(--ink-3); font-weight: 500; }
.fb-badge { padding: 2px 8px; border-radius: 99px; background: var(--khaki-soft); color: var(--ink-2); font-size: .72rem; font-weight: 700; }
.fb-badge.is-off { background: var(--mahogany-soft); color: var(--mahogany); }
.fb-x { flex: none; min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 99px; background: transparent; font: inherit; font-weight: 700; color: var(--mahogany); cursor: pointer; }
.fb-x:hover, .fb-x.is-arm { background: var(--mahogany); color: #fff; border-color: var(--mahogany); }
.fb-lobby-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.fb-lobby-actions .btn-primary { margin-left: auto; min-width: 190px; }
.fb-lock-ico { font-size: 1.2rem; margin-right: 4px; }
#drLock.is-locked { border-color: var(--mahogany); background: var(--mahogany-soft); color: var(--mahogany); }
.fb-msgs { margin: 12px 0; max-height: 220px; min-height: 80px; overflow-y: auto; display: grid; gap: 6px; align-content: start; }
.fb-audio { position: absolute; width: 0; height: 0; overflow: hidden; }

.fb-home { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 420px) { .fb-home { grid-template-columns: 1fr; } }


.fb-modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(20, 16, 14, .55); }
.fb-modal[hidden] { display: none; }
.fb-modal-box { width: 100%; max-width: 440px; max-height: 92vh; overflow: auto; padding: 22px; border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow-lift); }
.fb-modal-box h2 { margin: 0 0 6px; }
.fb-home { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 420px) { .fb-home { grid-template-columns: 1fr; } }
.fb-hint { margin: 0 0 14px; color: var(--ink-2); font-size: .9rem; }
.fb-modal-sub { margin: 0 0 14px; color: var(--ink-2); }

/* ---- Màn đua ---- */
.fb-game { max-width: 760px; margin: 0 auto; padding-bottom: 36px; }
.fb-who { color: var(--ink-2); font-size: .9rem; }
.fb-alone { margin: 6px 0 10px; padding: 10px 14px; border-radius: 12px; background: #fff4c7; border: 1px solid #e6c84a; text-align: center; font-weight: 700; }

.fb-keys { margin: 10px 0 0; color: var(--ink-3); font-size: .82rem; text-align: center; }
@media (hover: none) { .fb-keys { display: none; } }
.fb-rank { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fb-rk { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: .82rem; transition: opacity .3s, filter .3s; }
.fb-rk.is-me { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-soft); }
.fb-rk.is-dead { opacity: .35; filter: grayscale(1); }
.fb-rk-i { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--khaki-soft); text-align: center; font-size: .68rem; font-weight: 800; line-height: 18px; }
.fb-rk-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.fb-rk-n small { color: var(--ink-3); font-weight: 500; }
.fb-rk-s { font-size: .78rem; font-variant-numeric: tabular-nums; font-weight: 800; font-family: "Courier New", monospace; letter-spacing: .08em; }
/* ---- Trang chủ: Trở về -> tiêu đề -> Chơi riêng -> (tách đôi) Tạo phòng / Vào phòng ---- */
.fb-vlink { width: 5px; height: 28px; border-radius: 3px; background: #e8962a; }
.fb-vlink + a.mp-solo { margin-top: 0; }
.fb-vlink.is-pink { background: #f0558c; }
.mp-links.fb-after-solo .t { stroke: #f0558c; }
a.mp-card.mp-solo { flex-direction: row; gap: 10px; width: 156px; height: 116px; min-height: 0; padding: 0 12px; border-radius: 26px; }
a.mp-card.mp-solo .mp-ico { flex: none; width: 52px; height: 52px; font-size: 1.6rem; border-width: 3px; }
a.mp-card.mp-solo h2 { margin: 0; font-size: 1.15rem; }
@media (max-width: 480px) {
  a.mp-card.mp-solo { width: 140px; height: 96px; padding: 0 8px; }
  a.mp-card.mp-solo .mp-ico { width: 40px; height: 40px; font-size: 1.2rem; }
  a.mp-card.mp-solo h2 { font-size: 1rem; }
}
/* ---- Chơi riêng ---- */
.fb-solo-score { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0 10px; font-weight: 700; }
.fb-top2 { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }

/* ---- Máy chơi game: màn hình ở giữa, nút Lên / Xuống hai bên ---- */
.fb-tip { margin: 0 0 10px; color: var(--ink-2); font-size: .85rem; }

/* ---- Màn chơi dọc ---- */
.fb-hbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 10px; font-weight: 700; }
.fb-alone[hidden], .fb-countdown[hidden], .fb-over[hidden], .fb-start[hidden], .fb-endactions[hidden] { display: none; }
.fb-stage { position: relative; width: min(100%, 380px, calc((100vh - 190px) * 9 / 16)); min-width: 220px; margin: 0 auto; border-radius: 18px; overflow: hidden; background: linear-gradient(#5ec2ee 50%, #d9c17a 50%); line-height: 0; touch-action: none; user-select: none; -webkit-user-select: none; box-shadow: 0 8px 28px rgba(30, 60, 90, .25); border: 4px solid #fff; }
.fb-stage canvas { display: block; width: 100%; height: 100%; aspect-ratio: 9 / 16; object-fit: contain; touch-action: none; -webkit-tap-highlight-color: transparent; }
.fb-countdown { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 5rem; font-weight: 800; line-height: 1; color: #fff; text-shadow: 0 3px 0 #2b3a4a, 0 0 18px rgba(0,0,0,.35); background: rgba(94, 194, 238, .25); }
.fb-start { position: absolute; left: 0; right: 0; bottom: 18%; z-index: 4; margin: 0 auto; width: max-content; max-width: 86%; padding: 10px 16px; border: 3px solid #fff; border-radius: 99px; background: #e8532f; color: #fff; font-family: 'Be Vietnam Pro', system-ui, sans-serif; font-size: .95rem; font-weight: 700; line-height: 1.3; cursor: pointer; box-shadow: 0 4px 0 #a73516; }
.fb-over { position: absolute; left: 10%; right: 10%; top: 28%; z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 14px; text-align: center; line-height: 1.3; border: 3px solid #fff; border-radius: 20px; background: rgba(255, 255, 255, .95); box-shadow: 0 8px 30px rgba(0,0,0,.3); color: var(--ink, #2b3a4a); }
.fb-over.fb-over-end { position: static; margin: 12px auto 0; max-width: 460px; }
.fb-over-ico { font-size: 2.6rem; line-height: 1.1; }
.fb-over-t { margin: 0; font-size: 1.1rem; }
.fb-over-s { margin: 2px 0 8px; color: var(--ink-2); font-weight: 600; }
.fb-over-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.fb-keys { margin: 10px 0 0; color: var(--ink-3); font-size: .82rem; text-align: center; }
@media (hover: none) { .fb-keys { display: none; } }
.fb-rank { list-style: none; margin: 10px auto 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-width: 560px; }
.fb-rk { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: .82rem; }
.fb-rk.is-me { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-soft); }
.fb-rk.is-dead { opacity: .45; }
.fb-rk-i { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--khaki-soft); text-align: center; font-size: .68rem; font-weight: 800; line-height: 18px; }
.fb-rk-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.fb-rk-n small { color: var(--ink-3); font-weight: 500; }
.fb-rk-s { font-weight: 800; font-variant-numeric: tabular-nums; }
/* Điện thoại / máy tính bảng: màn chơi phủ kín màn hình (chơi riêng: ngay khi vào trang; chơi phòng: từ lúc bắt đầu tới hết ván) */
@media (pointer: coarse) and (max-width: 900px) {
  .fb-solo .fb-stage, html.fb-full .fb-stage { position: fixed; inset: 0; z-index: 80; width: auto; min-width: 0; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  .fb-solo .fb-stage canvas, html.fb-full .fb-stage canvas { width: 100%; height: 100%; aspect-ratio: auto; }
  .fb-solo .fb-over, html.fb-full .fb-stage .fb-over { left: 8%; right: 8%; top: 24%; }
  html.fb-full, html.fb-full body, body:has(.fb-solo) { overflow: hidden; overscroll-behavior: none; }
  .fb-solo .fb-top2 { display: none; }
}

/* Máy tính: màn chơi cao bằng cả cửa sổ (tỉ lệ 9:16), nằm giữa trang */
@media (pointer: fine), (min-width: 901px) {
  .fb-solo .fb-stage, html.fb-full .fb-stage { position: fixed; top: 0; bottom: 0; left: 50%; z-index: 80; width: calc(100vh * 9 / 16); min-width: 0; height: auto; margin: 0; transform: translateX(-50%); border: 0; border-radius: 0; box-shadow: 0 0 40px rgba(30, 60, 90, .35); }
  .fb-solo .fb-stage canvas, html.fb-full .fb-stage canvas { width: 100%; height: 100%; aspect-ratio: auto; }
  html.fb-full, html.fb-full body, body:has(.fb-solo) { overflow: hidden; }
  .fb-solo .fb-top2 { position: fixed; top: 12px; left: 12px; right: 12px; z-index: 90; pointer-events: none; }
  .fb-solo .fb-top2 > * { pointer-events: auto; }
}

.fb-over-bird { display: block; width: clamp(54px, 14vw, 72px); height: auto; margin: 0 auto 4px; image-rendering: pixelated; }

.fb-topnav { position: absolute; top: 0; left: 0; right: 0; z-index: 6; padding: 10px 12px; line-height: 1.2; text-align: left; }
.fb-topnav[hidden] { display: none; }
.fb-alive { list-style: none; margin: 4px 0 0; padding: 0; width: 100%; display: grid; gap: 5px; }
.fb-alive li { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border: 1px solid var(--line, #dfe6ee); border-radius: 12px; background: #fff; font-size: .9rem; text-align: left; }
.fb-alive .fb-rk-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.fb-alive .fb-rk-s { font-weight: 800; font-variant-numeric: tabular-nums; }


/* Chim ở tiêu đề trang chủ game: nằm ngang hàng chữ, bay vòng tròn nhỏ tại chỗ, vỗ cánh luân phiên fly1 / fly2 */
.fb-hero-fly { display: inline-block; position: relative; width: 56px; height: 48px; margin-right: 8px; vertical-align: middle; }
.fb-hero-orbit { position: absolute; left: 50%; top: 50%; width: 0; height: 0; animation: fbOrbit 2.6s linear infinite; }
.fb-hero-bird { position: absolute; left: -22px; top: -19px; width: 44px; height: auto; max-width: none; image-rendering: pixelated; }
.fb-hero-bird.f2 { animation: fbFlapB .36s steps(1) infinite; }
.fb-hero-bird.f1 { animation: fbFlapA .36s steps(1) infinite; }
@keyframes fbOrbit { from { transform: rotate(0deg) translateX(7px) rotate(0deg); } to { transform: rotate(360deg) translateX(7px) rotate(-360deg); } }
@keyframes fbFlapA { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes fbFlapB { 0% { opacity: 0; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fb-hero-orbit, .fb-hero-bird { animation: none !important; } .fb-hero-bird.f2 { opacity: 0; } }
