/* ==========================================================================
   Join & Player – tối ưu điện thoại / tablet (chạm lớn, 1 tay)
   ========================================================================== */
.page-join .astro-bot, .page-player .astro-bot { left: 8px; bottom: 6px; }

.conn-banner { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 90; padding: 8px 18px; border-radius: 0 0 14px 14px; background: #f59e0b; color: #1E1B4B; font-weight: 900; font-size: .95rem; white-space: nowrap; }

/* ---------- Join ---------- */
.join-wrap { max-width: 560px; margin: 0 auto; padding: 22px 16px 150px; display: flex; flex-direction: column; gap: 18px; }
.join-header { text-align: center; }
.logo-rocket.small { font-size: 3rem; }
.join-title { font-size: clamp(1.8rem, 7vw, 2.6rem); margin: 0; background: linear-gradient(90deg, #a5f3fc, #f9a8d4, #fde68a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.join-steps { display: flex; align-items: center; justify-content: center; margin-top: 10px; }
.step-dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); border: 2px solid rgba(255,255,255,.3); font-family: var(--font-display); }
.step-dot.active { background: linear-gradient(135deg, var(--violet), var(--pink)); border-color: #fff; box-shadow: 0 0 16px rgba(236,72,153,.7); }
.step-dot.done { background: var(--green); border-color: #fff; }
.step-line { width: 40px; height: 3px; background: rgba(255,255,255,.25); }
.join-card { padding: 22px 18px; display: flex; flex-direction: column; gap: 10px; }
.join-card h2 { margin: 0 0 6px; font-size: 1.7rem; text-align: center; }
.field-label { font-size: 1.05rem; color: var(--muted); }
.game-input { width: 100%; padding: 14px 18px; border-radius: 18px; border: 3px solid rgba(165,180,252,.6); background: rgba(255,255,255,.95); color: #1E1B4B; font-size: 1.35rem; font-weight: 800; outline: none; transition: border-color .2s, box-shadow .2s; }
.game-input:focus { border-color: var(--pink); box-shadow: 0 0 0 5px rgba(236,72,153,.3); }
.code-input { text-align: center; font-family: var(--font-display); font-size: 2.2rem; letter-spacing: 12px; }
.btn-link-back { align-self: center; background: none; border: 0; color: var(--muted); font-weight: 800; padding: 8px; text-decoration: underline; }

.team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.team-pick { --team: var(--primary); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 8px; border-radius: 20px; border: 3px solid color-mix(in srgb, var(--team) 80%, #fff); background: linear-gradient(160deg, color-mix(in srgb, var(--team) 60%, transparent), rgba(30,27,75,.85)); color: #fff; box-shadow: 0 6px 0 rgba(0,0,0,.35); transition: transform .15s; }
.team-pick:active { transform: translateY(5px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.team-pick.full { filter: grayscale(1) brightness(.6); pointer-events: none; }
.team-pick.recommended::before { content: "Gợi ý ⭐"; position: absolute; margin-top: -30px; padding: 2px 10px; border-radius: 999px; background: #fde68a; color: #1E1B4B; font-size: .8rem; }
.team-pick { position: relative; }
.tp-emoji { font-size: 2.6rem; }
.tp-name { font-family: var(--font-display); font-size: 1.35rem; }
.tp-count { font-size: .9rem; opacity: .9; }

.avatar-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.avatar-pick { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 2px; border-radius: 18px; border: 3px solid rgba(255,255,255,.3); background: rgba(255,255,255,.08); color: #fff; transition: transform .15s; }
.avatar-pick.selected { border-color: #fde68a; background: linear-gradient(160deg, rgba(124,58,237,.7), rgba(236,72,153,.5)); transform: scale(1.08); box-shadow: 0 0 20px rgba(253,224,71,.6); }
.ap-emoji { font-size: 2.2rem; }
.ap-label { font-size: .75rem; }
.join-preview { text-align: center; font-size: 1.15rem; min-height: 1.5em; }
@media (max-width: 380px) { .avatar-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Player ---------- */
.player-layout { max-width: 760px; margin: 0 auto; padding: 10px 12px 130px; display: flex; flex-direction: column; gap: 12px; min-height: 100dvh; }
.player-card { --team: var(--primary); display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-color: color-mix(in srgb, var(--team) 80%, #fff); background: linear-gradient(90deg, color-mix(in srgb, var(--team) 45%, rgba(30,27,75,.8)), rgba(30,27,75,.8)); margin-right: 52px; }
.pc-avatar { font-size: 2.4rem; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: rgba(255,255,255,.15); flex: none; }
.pc-info { flex: 1; min-width: 0; }
.pc-name { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-team { font-size: .95rem; opacity: .95; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-energy { text-align: right; line-height: 1.1; }
.pc-energy small { font-size: .75rem; opacity: .85; }
.pc-energy .energy { font-size: 1.5rem; }
.pc-energy.bump .energy { animation: bump .6s; }
@keyframes bump { 40% { transform: scale(1.35); } }

.player-stage { flex: 1; display: flex; flex-direction: column; }
.stage-loading { flex: 1; display: grid; place-items: center; align-content: center; gap: 12px; text-align: center; }
.spinner-orbit { width: 64px; height: 64px; border-radius: 50%; border: 6px solid rgba(255,255,255,.15); border-top-color: var(--cyan); border-right-color: var(--pink); animation: spin 1s linear infinite; }

.p-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 14px 6px; }
.p-big-emoji { font-size: 5rem; animation: float 3s ease-in-out infinite; }
.p-title { font-size: 1.9rem; margin: 0; }
.p-sub { font-size: 1.15rem; color: var(--muted); margin: 0; }
.team-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 1.6rem; }
@keyframes float { 50% { transform: translateY(-12px); } }

.p-question { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.p-qhead { display: flex; align-items: center; gap: 12px; }
.p-qhead .countdown { width: 70px; height: 70px; }
.p-qhead .countdown .num { font-size: 1.6rem; }
.p-round-chip { font-size: .9rem; }
.p-prompt { padding: 14px 16px; font-size: 1.25rem; line-height: 1.35; font-family: var(--font-display); }
.p-question .options-grid { grid-template-columns: 1fr; gap: 12px; }
.p-question .option-tile { min-height: 74px; font-size: 1.2rem; padding: 12px 14px; }
.p-question .option-tile:active { transform: translateY(5px); }
.p-question .option-tile .opt-shape { width: 44px; height: 44px; }
.p-question .radar-grid { grid-template-columns: 1fr; }
.p-question .radar-btn { min-height: 130px; font-size: 1.9rem; }
@media (min-width: 640px) { .p-question .options-grid { grid-template-columns: 1fr 1fr; } .p-question .radar-grid { grid-template-columns: 1fr 1fr; } }

.locked-card { padding: 24px 18px; text-align: center; }
.locked-card .lock-emoji { font-size: 4rem; animation: zoomIn .5s cubic-bezier(.34,1.56,.64,1); }

.result-card { padding: 24px 18px; text-align: center; border-width: 4px; }
.result-card.good { border-color: #4ade80; box-shadow: 0 0 40px rgba(34,197,94,.6); }
.result-card.bad { border-color: #f87171; box-shadow: 0 0 40px rgba(239,68,68,.5); }
.result-card .r-emoji { font-size: 4.6rem; animation: zoomIn .5s cubic-bezier(.34,1.56,.64,1); }
.result-card .r-title { font-size: 2.1rem; margin: 4px 0; }
.result-card .r-points { font-size: 2.4rem; }
.result-card .r-explain { margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.1); font-size: 1.05rem; }

.p-question .scene { font-size: .98rem; }
.detective-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.found-count { font-family: var(--font-display); font-size: 1.3rem; }

.team-editor { display: flex; flex-direction: column; gap: 10px; }
.team-editor textarea { min-height: 170px; resize: vertical; font-size: 1.15rem; line-height: 1.4; }
.team-editor .editor-meta { font-size: .9rem; color: var(--muted); min-height: 1.2em; }

.boss-mini { display: flex; align-items: center; gap: 10px; }
.boss-mini img { width: 54px; animation: bossFloat 3s ease-in-out infinite; }
.boss-mini .boss-hp { flex: 1; height: 26px; }
.boss-mini .boss-hp-text { font-size: .95rem; }
