/* ===================== KỲ VƯƠNG TRUYỀN KỲ ===================== */
:root {
  --bg: #0f1117;
  --bg2: #161a23;
  --panel: #1c212c;
  --panel2: #232937;
  --line: #2e3546;
  --text: #e6e8ee;
  --muted: #8f97aa;
  --gold: #f2c14e;
  --gold2: #c9962c;
  --red: #ef4f5f;
  --green: #4cc38a;
  --blue: #4aa3ff;
  --purple: #b45cff;
  --orange: #ffae00;
  --mana: #4a7dff;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .35);
  --sq-light: #f0d9b5;
  --sq-dark: #b58863;
  --pc-white: #ffffff;
  --pc-black: #1a1a1a;
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45;
  background-image: radial-gradient(1200px 600px at 80% -10%, rgba(242, 193, 78, .08), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(180, 92, 255, .07), transparent 60%);
  background-attachment: fixed;
}
a { color: var(--gold); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.gold { color: var(--gold); } .red { color: var(--red); } .green { color: var(--green); } .blue { color: var(--blue); } .purple { color: var(--purple); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.hidden { display: none !important; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel2); cursor: pointer; transition: .15s; font-weight: 600; user-select: none; white-space: nowrap;
}
.btn:hover { border-color: #46506a; background: #2a3142; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #f7cf63, #d19a2a); color: #2a1a00; border-color: #e6b445; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { background: linear-gradient(180deg, #f2606e, #c43846); border-color: #e04b5a; color: #fff; }
.btn.green { background: linear-gradient(180deg, #5bd69b, #2e9e69); border-color: #42b981; color: #04210f; }
.btn.blue { background: linear-gradient(180deg, #62b1ff, #2f7fd6); border-color: #4b9af0; color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: .85em; border-radius: 8px; }
.btn.lg { padding: 13px 24px; font-size: 1.08em; }
.btn.block { width: 100%; }

input.inp, select.inp, textarea.inp {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; width: 100%;
}
input.inp:focus, select.inp:focus, textarea.inp:focus { border-color: var(--gold2); }
label.lbl { display: block; font-size: .85em; color: var(--muted); margin-bottom: 4px; }

/* ---------- Thẻ ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card h3 { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: .78em; background: var(--panel2); border: 1px solid var(--line); font-weight: 600; }
.badge.gold { background: rgba(242, 193, 78, .15); border-color: rgba(242, 193, 78, .4); }
.badge.red { background: rgba(239, 79, 95, .15); border-color: rgba(239, 79, 95, .4); }
.badge.green { background: rgba(76, 195, 138, .15); border-color: rgba(76, 195, 138, .4); }
.badge.vip { background: linear-gradient(90deg, #f7cf63, #ff8a00); color: #2a1a00; border: 0; }
.tag { font-size: .75em; padding: 1px 6px; border-radius: 6px; background: #2a3142; color: var(--muted); }

/* ---------- Thanh tiến trình ---------- */
.bar { position: relative; height: 16px; border-radius: 99px; background: #0b0d12; overflow: hidden; border: 1px solid #000; }
.bar > .fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; transition: width .35s ease; }
.bar > .ghost { position: absolute; inset: 0 auto 0 0; background: rgba(255, 255, 255, .35); transition: width 1s ease .3s; }
.bar > .txt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.bar.hp > .fill { background: linear-gradient(90deg, #e0424f, #ff7a6b); }
.bar.php > .fill { background: linear-gradient(90deg, #2fb36f, #6ee7a5); }
.bar.mp > .fill { background: linear-gradient(90deg, #3466e8, #6fa1ff); }
.bar.exp > .fill { background: linear-gradient(90deg, #d19a2a, #f7cf63); }
.bar.time > .fill { background: linear-gradient(90deg, #f2c14e, #fff0b3); transition: width .25s linear; }
.bar.time > .ghost, .bar.php > .ghost, .bar.mp > .ghost { display: none; }
.bar.time.warn > .fill { background: linear-gradient(90deg, #ef4f5f, #ff9a8b); }
.bar.thin { height: 7px; }
.bar.thin > .txt { display: none; }
.bar.mp.thin { height: 9px; }
.bar .mark { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(0, 0, 0, .6); }

/* ---------- Bố cục ---------- */
#app { min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 14px; padding: 8px 16px; background: rgba(15, 17, 23, .92);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--gold); white-space: nowrap; letter-spacing: .3px; }
.logo .k { font-size: 1.6rem; filter: drop-shadow(0 0 6px rgba(242, 193, 78, .6)); }
.res { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.res .pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); font-weight: 700; font-size: .9em; }
.me-mini { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; background: var(--panel2); border: 2px solid var(--gold2); flex-shrink: 0; }
.avatar.lg { width: 80px; height: 80px; font-size: 50px; border-width: 3px; }
.layout { flex: 1; display: grid; grid-template-columns: 220px 1fr; min-height: 0; }
.sidebar { border-right: 1px solid var(--line); padding: 12px 8px; position: sticky; top: 55px; height: calc(100vh - 55px); overflow-y: auto; background: rgba(22, 26, 35, .6); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--text); font-weight: 600; margin-bottom: 2px; position: relative; }
.nav a:hover { background: var(--panel2); }
.nav a.active { background: linear-gradient(90deg, rgba(242, 193, 78, .18), transparent); color: var(--gold); }
.nav a .ic { width: 22px; text-align: center; font-size: 1.1em; }
.nav a .dot { position: absolute; right: 10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; display: grid; place-items: center; }
.nav .sep { height: 1px; background: var(--line); margin: 8px 6px; }
.main { padding: 20px; min-width: 0; max-width: 1400px; width: 100%; margin: 0 auto; }
.page-title { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.page-title h1 { margin: 0; }
.menu-btn { display: none; font-size: 1.4rem; background: none; border: 0; cursor: pointer; }

/* ---------- Chat ---------- */
.chat-fab { position: fixed; right: 18px; bottom: 18px; z-index: 60; width: 54px; height: 54px; border-radius: 50%; border: 0; background: linear-gradient(180deg, #f7cf63, #d19a2a); font-size: 24px; cursor: pointer; box-shadow: var(--shadow); }
.chat-fab .dot { position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--red); border: 2px solid var(--bg); }
.chat { position: fixed; right: 18px; bottom: 82px; z-index: 60; width: 360px; max-width: calc(100vw - 24px); height: 480px; max-height: calc(100vh - 120px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.chat .tabs { display: flex; border-bottom: 1px solid var(--line); }
.chat .tabs button { flex: 1; padding: 10px; background: none; border: 0; cursor: pointer; font-weight: 700; color: var(--muted); }
.chat .tabs button.on { color: var(--gold); box-shadow: inset 0 -2px 0 var(--gold); }
.chat .msgs { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; font-size: .9em; }
.chat .msg .n { font-weight: 700; cursor: pointer; }
.chat .msg.sys { color: var(--gold); font-style: italic; }
.chat form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }

/* ---------- Toast & modal ---------- */
#toasts { position: fixed; top: 64px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--gold); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); max-width: 360px; animation: tin .25s ease; }
.toast.error { border-left-color: var(--red); }
.toast.achievement, .toast.level { border-left-color: var(--orange); background: linear-gradient(90deg, rgba(255, 174, 0, .18), transparent) var(--panel2); }
.toast.boss { border-left-color: var(--red); background: linear-gradient(90deg, rgba(239, 79, 95, .2), transparent) var(--panel2); }
@keyframes tin { from { opacity: 0; transform: translateX(30px); } }
.modal-bg { position: fixed; inset: 0; z-index: 150; background: rgba(0, 0, 0, .65); display: grid; place-items: center; padding: 16px; animation: fin .2s; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); animation: pop .25s ease; }
.modal.wide { max-width: 760px; }
@keyframes fin { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }

/* ---------- Bàn cờ ---------- */
.board-wrap { position: relative; width: 100%; max-width: 560px; aspect-ratio: 1; margin: 0 auto; touch-action: none; user-select: none; }
.board { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); border-radius: 6px; overflow: hidden; box-shadow: 0 10px 40px rgba(0, 0, 0, .5), 0 0 0 4px #2a2116; }
.sq { position: relative; display: flex; align-items: center; justify-content: center; }
.sq.l { background: var(--sq-light); } .sq.d { background: var(--sq-dark); }
.sq.last::before { content: ''; position: absolute; inset: 0; background: rgba(255, 235, 59, .38); }
.sq.sel::before { content: ''; position: absolute; inset: 0; background: rgba(20, 160, 255, .45); }
.sq.hintf::after { content: ''; position: absolute; inset: 4%; border-radius: 50%; box-shadow: 0 0 0 4px #ff3df2 inset, 0 0 18px #ff3df2; animation: pulse 1s infinite; }
.sq.hintt::after { content: ''; position: absolute; inset: 4%; border-radius: 8px; box-shadow: 0 0 0 4px #33ff99 inset, 0 0 18px #33ff99; animation: pulse 1s infinite; }
.sq.check { background: radial-gradient(circle, #ff3030 0%, rgba(255, 0, 0, .5) 40%, transparent 75%), var(--sq-dark); }
.sq.l.check { background: radial-gradient(circle, #ff3030 0%, rgba(255, 0, 0, .5) 40%, transparent 75%), var(--sq-light); }
.sq .dotm { position: absolute; width: 30%; height: 30%; border-radius: 50%; background: rgba(0, 0, 0, .22); z-index: 3; pointer-events: none; }
.sq .capm { position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 6px rgba(0, 0, 0, .25); z-index: 3; pointer-events: none; }
.sq .co { position: absolute; font-size: 11px; font-weight: 700; opacity: .75; pointer-events: none; z-index: 1; }
.sq .co.f { right: 3px; bottom: 1px; } .sq .co.r { left: 3px; top: 1px; }
.sq.l .co { color: var(--sq-dark); } .sq.d .co { color: var(--sq-light); }
@keyframes pulse { 50% { opacity: .45; } }
.pc {
  position: relative; z-index: 2; display: inline-block; width: 1em; height: 1em; font-size: calc(min(560px, 92vw) / 8 * .9); line-height: 1; cursor: grab;
  transition: transform .12s;
}
.pc .pcs { display: block; width: 1em; height: 1em; overflow: visible; filter: drop-shadow(0 .045em .04em rgba(0, 0, 0, .45)); }
.pc .pb { fill: currentColor; stroke: var(--pc-line); stroke-width: 3.2; stroke-linejoin: round; stroke-linecap: round; }
.pc .ps { fill: url(#pcShade); stroke: none; pointer-events: none; }
.pc .pd { fill: none; stroke: var(--pc-detail); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.pc .pd .eye { fill: var(--pc-line); stroke: none; }
.pc.w { color: var(--pc-white); --pc-line: #221c18; --pc-detail: rgba(34, 28, 24, .7); }
.pc.b { color: var(--pc-black); --pc-line: #0a0809; --pc-detail: rgba(255, 255, 255, .6); }
.pc.b .pd .eye { fill: rgba(255, 255, 255, .85); }
@media (hover: hover) { .sq:hover > .pc:not(.ghosted) { transform: translateY(-2px); } }
.pc.drag { position: fixed; z-index: 1000; pointer-events: none; transform: translate(-50%, -50%) scale(1.15); }
.pc.ghosted { opacity: .25; }
.pc.popin { animation: popin .25s ease; }
@keyframes popin { from { transform: scale(1.35); } }
.board-wrap.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.board-wrap.fog .board { filter: blur(10px) grayscale(.6); transition: filter .6s; }
.board-wrap .overlay { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; pointer-events: none; }
.big-text { font-size: clamp(28px, 6vw, 56px); font-weight: 900; color: var(--gold); text-shadow: 0 4px 0 #6b4a00, 0 0 30px rgba(242, 193, 78, .8); animation: bigtext 1s ease forwards; letter-spacing: 1px; text-align: center; }
.big-text.red { color: #ff6070; text-shadow: 0 4px 0 #5a0010, 0 0 30px rgba(255, 60, 80, .8); }
@keyframes bigtext { 0% { transform: scale(.4); opacity: 0; } 20% { transform: scale(1.15); opacity: 1; } 70% { transform: scale(1); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }
.promo { position: absolute; z-index: 30; inset: 0; background: rgba(0, 0, 0, .6); display: grid; place-items: center; }
.promo .opts { display: flex; gap: 8px; background: var(--panel); padding: 12px; border-radius: 12px; }
.promo .opts button { width: 64px; height: 64px; font-size: 48px; display: grid; place-items: center; padding: 0; background: var(--sq-light); border: 0; border-radius: 8px; cursor: pointer; }

/* ---------- Trận đấu ---------- */
.battle { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.fighters { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; margin-bottom: 12px; }
.fighter { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; position: relative; }
.fighter .nm { font-weight: 800; display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.fighter .bars { display: flex; flex-direction: column; gap: 5px; }
.monster-emoji { font-size: 64px; line-height: 1; text-align: center; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .6)); position: relative; }
.monster-emoji.hit { animation: mhit .35s; }
.monster-emoji.attack { animation: matk .45s; }
.monster-emoji.boss { font-size: 84px; animation: bossidle 2.4s ease-in-out infinite; }
@keyframes mhit { 30% { transform: translateX(10px) rotate(8deg); filter: brightness(2) drop-shadow(0 0 12px red); } }
@keyframes matk { 40% { transform: translateX(-26px) scale(1.25); } }
@keyframes bossidle { 50% { transform: translateY(-6px) scale(1.04); } }
.music-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 17px; flex-shrink: 0; }
.music-btn:hover { border-color: var(--gold2); }
/* ---------- Khung cảnh 2D ---------- */
.scene { position: relative; height: clamp(200px, 32vh, 290px); border-radius: var(--radius); overflow: hidden; margin-bottom: 10px; border: 1px solid var(--line); box-shadow: var(--shadow); background: #101018; }
.scene-canvas { position: absolute; inset: 0; display: block; }
.scene .hud { position: absolute; left: 8px; right: 8px; top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 10vw; pointer-events: none; z-index: 2; }
.scene .hud .fighter { background: rgba(14, 16, 24, .72); backdrop-filter: blur(3px); padding: 6px 9px; border-color: rgba(255, 255, 255, .08); pointer-events: auto; max-width: 300px; }
.scene .hud .fighter + .fighter { justify-self: end; width: 100%; }
.scene .hud .fighter .nm { margin-bottom: 4px; font-size: .92em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene .hud .combo { font-size: .95rem; text-shadow: 0 1px 3px #000; }
.scene .hud .fighter { position: relative; }
.scene .hud .hud-extra { position: absolute; left: 0; top: calc(100% + 4px); display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.scene .hud .hud-extra .badge { font-size: .7em; padding: 1px 6px; }
.battle .board-wrap { max-width: max(300px, min(560px, calc(100vh - 400px))); }
.field { position: relative; height: clamp(300px, 58vh, 520px); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: #101018; touch-action: none; user-select: none; }
.field canvas { position: absolute; inset: 0; display: block; cursor: pointer; }
.field .ctl { position: absolute; bottom: 10px; display: flex; gap: 8px; z-index: 2; }
.field .ctl button { width: 54px; height: 54px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); background: rgba(0,0,0,.45); color: #fff; font-size: 22px; font-weight: 900; cursor: pointer; }
.field .ctl button:active { background: rgba(242,193,78,.5); }
.field .hint { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.55); padding: 4px 12px; border-radius: 99px; font-size: .85em; color: #fff; z-index: 2; white-space: nowrap; pointer-events: none; }
.rtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.rtabs button { border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 7px 12px; border-radius: 10px; cursor: pointer; font-weight: 700; }
.rtabs button.on { border-color: var(--gold); color: var(--gold); background: linear-gradient(180deg, rgba(242,193,78,.15), var(--panel)); }
.rtabs button.lock { opacity: .45; }
.vs { font-weight: 900; color: var(--gold); font-size: 1.4rem; text-align: center; }
.floater { position: absolute; z-index: 40; font-weight: 900; font-size: 26px; pointer-events: none; animation: floatup 1.1s ease forwards; text-shadow: 0 2px 0 #000, 0 0 10px rgba(0, 0, 0, .6); white-space: nowrap; }
.floater.crit { font-size: 36px; color: var(--orange); }
.floater.dmg { color: #fff; } .floater.hurt { color: var(--red); } .floater.heal { color: var(--green); } .floater.mana { color: var(--blue); }
@keyframes floatup { 0% { transform: translate(-50%, 0) scale(.6); opacity: 0; } 15% { transform: translate(-50%, -10px) scale(1.2); opacity: 1; } 100% { transform: translate(-50%, -70px) scale(1); opacity: 0; } }
.combo { font-weight: 900; color: var(--orange); font-size: 1.1rem; }
.combo.big { font-size: 1.5rem; text-shadow: 0 0 12px rgba(255, 174, 0, .7); }
.skillbar { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.skill {
  position: relative; width: 62px; height: 62px; border-radius: 12px; background: var(--panel2); border: 2px solid var(--line); cursor: pointer; display: grid; place-items: center;
  font-size: 28px; transition: .12s; overflow: hidden; user-select: none;
}
.skill:hover { border-color: var(--gold2); transform: translateY(-2px); }
.skill .key { position: absolute; top: 2px; left: 5px; font-size: 11px; font-weight: 800; color: var(--gold); }
.skill .cost { position: absolute; bottom: 1px; right: 4px; font-size: 10px; font-weight: 800; color: #8fb3ff; }
.skill .cnt { position: absolute; bottom: 1px; right: 4px; font-size: 11px; font-weight: 800; color: #fff; }
.skill .cd { position: absolute; inset: 0; background: rgba(0, 0, 0, .72); display: grid; place-items: center; font-size: 16px; font-weight: 800; color: #fff; }
.skill.nomana { filter: grayscale(.8); opacity: .6; }
.skill.active { border-color: var(--gold); box-shadow: 0 0 14px rgba(242, 193, 78, .7); }
.skill.flash { animation: sflash .4s; }
@keyframes sflash { 50% { transform: scale(1.15); box-shadow: 0 0 20px var(--gold); } }
.blog { height: 300px; overflow-y: auto; font-size: .88em; display: flex; flex-direction: column; gap: 4px; padding-right: 4px; }
.blog div { padding: 3px 6px; border-radius: 6px; background: rgba(255, 255, 255, .02); }
.buffs { display: flex; gap: 4px; flex-wrap: wrap; min-height: 22px; }
.turn-ind { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.turn-ind .sw { width: 16px; height: 16px; border-radius: 4px; border: 1px solid #000; }
.mech { cursor: help; }

/* ---------- Bản đồ ---------- */
.region { border-radius: 16px; padding: 16px; border: 1px solid var(--line); background: var(--panel); position: relative; overflow: hidden; }
.region::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, var(--rc, #444) 0%, transparent 55%); opacity: .18; pointer-events: none; }
.region.locked { filter: grayscale(.9); opacity: .6; }
.region .hd { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; position: relative; }
.region .hd .ic { font-size: 40px; }
.stages { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; position: relative; }
.stage { border-radius: 12px; padding: 8px 4px; background: var(--panel2); border: 1px solid var(--line); text-align: center; cursor: pointer; transition: .15s; }
.stage:hover:not(.locked) { border-color: var(--gold2); transform: translateY(-2px); }
.stage .em { font-size: 30px; line-height: 1.1; }
.stage .nm { font-size: .72em; font-weight: 700; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage .stars { font-size: .72em; letter-spacing: -1px; color: var(--gold); min-height: 1.1em; }
.stage.locked { opacity: .4; cursor: not-allowed; }
.stage.boss { grid-column: span 2; background: linear-gradient(180deg, rgba(239, 79, 95, .2), var(--panel2)); border-color: rgba(239, 79, 95, .5); }
.stage.boss .em { font-size: 38px; }

/* ---------- Trang bị ---------- */
.item { border-radius: 10px; padding: 8px 10px; background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--rc, #888); cursor: pointer; position: relative; transition: .12s; }
.item:hover { transform: translateY(-1px); border-color: #46506a; }
.item .nm { font-weight: 700; color: var(--rc); font-size: .92em; }
.item .st { font-size: .78em; color: var(--muted); }
.item.eq::after { content: 'Đang mặc'; position: absolute; top: 6px; right: 8px; font-size: .68em; color: var(--green); font-weight: 800; }
.item.sel { outline: 2px solid var(--gold); }
.slot-box { border-radius: 12px; border: 1px dashed var(--line); padding: 10px; min-height: 74px; }
.slot-box .lbl2 { font-size: .75em; color: var(--muted); margin-bottom: 4px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.stat-grid div { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding: 3px 0; }
.cls-card { border: 2px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; transition: .15s; background: var(--panel2); }
.cls-card:hover { border-color: #5a6684; }
.cls-card.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 193, 78, .2); }
.cls-card .ic { font-size: 40px; }

/* ---------- Bảng ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: .92em; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.tbl th { color: var(--muted); font-weight: 600; font-size: .85em; text-transform: uppercase; letter-spacing: .4px; }
.tbl tr:hover td { background: rgba(255, 255, 255, .02); }
.tabs2 { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs2 button { padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 600; }
.tabs2 button.on { background: var(--gold); color: #2a1a00; border-color: var(--gold); }

/* ---------- Landing ---------- */
.hero { text-align: center; padding: 50px 20px 30px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); background: linear-gradient(180deg, #fff3c4, #f2c14e 50%, #c9962c); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .5)); }
.hero .pieces { font-size: 52px; letter-spacing: 10px; margin-bottom: 10px; }
.hero p { font-size: 1.1rem; color: var(--muted); max-width: 680px; margin: 0 auto 24px; }
.feat { text-align: center; }
.feat .ic { font-size: 40px; }
.auth-box { max-width: 760px; margin: 0 auto; }

/* ---------- Khác ---------- */
.empty { text-align: center; padding: 40px; color: var(--muted); }
.kbd { display: inline-block; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); border-bottom-width: 2px; font-size: .8em; font-weight: 700; background: var(--bg2); }
.quest { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; background: var(--panel2); margin-bottom: 8px; }
.quest .bar { flex: 1; }
.login-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.login-days div { text-align: center; border-radius: 10px; padding: 8px 2px; background: var(--panel2); border: 1px solid var(--line); font-size: .78em; }
.login-days div.done { border-color: var(--green); background: rgba(76, 195, 138, .12); }
.login-days div.today { border-color: var(--gold); box-shadow: 0 0 10px rgba(242, 193, 78, .4); }
.ach { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); }
.ach.done { border-color: rgba(242, 193, 78, .5); background: rgba(242, 193, 78, .08); }
.ach .ic { font-size: 28px; filter: grayscale(1); opacity: .5; }
.ach.done .ic { filter: none; opacity: 1; }
.wb-hp { height: 30px; }
.wb-hp .txt { font-size: 14px; }
.spinner { width: 34px; height: 34px; border: 4px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin 1s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.solution { background: var(--bg2); border-radius: 10px; padding: 10px; font-size: .9em; border: 1px solid var(--line); }
.solution .mv { font-weight: 800; color: var(--gold); font-family: Consolas, monospace; }
.pvp-hp { display: flex; align-items: center; gap: 10px; }
.searching { font-size: 60px; animation: bossidle 1.2s infinite; text-align: center; }
.skin-prev { display: grid; grid-template-columns: repeat(4, 1fr); width: 72px; height: 36px; border-radius: 6px; overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .battle { grid-template-columns: 1fr; }
  .blog { height: 160px; }
}
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 55px; z-index: 70; width: 240px; transform: translateX(-100%); transition: .2s; background: var(--bg2); }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .menu-btn { display: block; }
  .main { padding: 12px; }
  .res .pill.hide-sm, .me-mini .nm { display: none; }
  .fighters { grid-template-columns: 1fr auto 1fr; gap: 6px; }
  .monster-emoji { font-size: 44px; } .monster-emoji.boss { font-size: 56px; }
  .fighter { padding: 6px 8px; font-size: .85em; }
  .skill { width: 50px; height: 50px; font-size: 22px; }
  .scene { height: 200px; }
  .scene .hud { gap: 8px; left: 5px; right: 5px; top: 5px; }
  .scene .hud .fighter { padding: 4px 6px; font-size: .8em; }
  .field { height: 58vh; }
  .rtabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .rtabs button { white-space: nowrap; flex-shrink: 0; }
  .field .hint { font-size: .75em; }
  .field .ctl button { width: 48px; height: 48px; }
  .logo .t { display: none; }
}
.field .fpill { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.5); color: #fff; padding: 3px 10px; border-radius: 99px; font-size: .8em; z-index: 2; pointer-events: none; }
/* ---------- Chém – Phong Ấn ---------- */
.run-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.run-prog { display: flex; gap: 4px; align-items: center; font-size: 14px; color: #666; }
.run-prog span.done { color: var(--green); } .run-prog span.cur { color: var(--red); transform: scale(1.3); }
.act { position: relative; height: clamp(420px, 72vh, 660px); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: #101018; touch-action: none; user-select: none; }
.act-canvas { position: absolute; inset: 0; display: block; }
.act-hud { position: absolute; left: 8px; right: 8px; top: 8px; display: flex; justify-content: space-between; gap: 10px; pointer-events: none; z-index: 2; }
.act-hud .fighter { background: rgba(14, 16, 24, .72); padding: 6px 9px; width: min(300px, 46%); border-color: rgba(255, 255, 255, .08); }
.act-hud .fighter .nm { font-size: .9em; margin-bottom: 4px; }
.rage { position: relative; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, .08); margin-top: 4px; overflow: hidden; }
.rage > div { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ff8a20, #ff3a3a); transition: width .1s; }
.rage.full > div { box-shadow: 0 0 10px #ff6020; animation: pulse 1s infinite; }
.rage > span { position: absolute; inset: 0; font-size: 9px; line-height: 10px; text-align: center; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000; }
@keyframes pulse { 50% { filter: brightness(1.4); } }
.soul { position: absolute; right: 10px; top: 10px; bottom: 10px; width: min(430px, 48%); z-index: 5; background: rgba(12, 16, 30, .93); border: 1px solid rgba(160, 210, 255, .35); border-radius: 14px; padding: 10px; box-shadow: 0 0 40px rgba(120, 190, 255, .35); overflow-y: auto; animation: soulin .35s ease; }
.soul .soul-hd { color: #bfe8ff; margin-bottom: 6px; text-shadow: 0 0 10px #7cf; }
.soul .board-wrap { max-width: 100%; }
.soul .skill { width: 48px; height: 48px; font-size: 22px; }
.soul .skill.used { opacity: .35; }
@keyframes soulin { from { transform: translateX(40px); opacity: 0; } }
.act-ctl { position: absolute; left: 0; right: 0; bottom: 8px; display: none; justify-content: space-between; padding: 0 8px; z-index: 3; pointer-events: none; }
.act-ctl > div { display: flex; gap: 6px; align-items: flex-end; pointer-events: auto; }
.act-ctl button { width: 50px; height: 50px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); background: rgba(0,0,0,.45); color: #fff; font-size: 20px; font-weight: 900; }
.act-ctl button.big { width: 64px; height: 64px; font-size: 26px; }
.act-ctl button.on { background: rgba(242,193,78,.55); }
@media (pointer: coarse) { .act-ctl { display: flex; } }
.mapcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.mapcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.mapcard canvas { width: 100%; height: 120px; display: block; }
.mapcard .bd { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.mapcard.locked { opacity: .55; }
.mapcard.boss { border-color: rgba(239, 79, 95, .6); }
@media (max-width: 820px) {
  .act { height: 64vh; }
  .act-ctl .r { display: grid; grid-template-columns: repeat(3, 46px); gap: 6px; }
  .act-ctl button, .act-ctl button.big { width: 46px; height: 46px; font-size: 19px; }
  .act-ctl button.big { grid-column: span 2; width: 98px; border-radius: 23px; }
  .act-ctl .l button { width: 54px; height: 54px; }
  .soul { left: 6px; right: 6px; width: auto; top: 6px; bottom: 6px; }
  .act-hud .fighter { font-size: .8em; padding: 4px 6px; }
}

/* ===================== Hệ thống trang bị / Tu luyện / Lãnh địa / Boss TG ===================== */
.ult-banner { padding: 8px 12px; border-radius: 10px; background: linear-gradient(90deg, rgba(255, 60, 60, .35), rgba(255, 140, 0, .25)); border: 1px solid #ff5a5a; color: #fff; font-weight: 700; text-align: center; animation: ultPulse .8s ease-in-out infinite alternate; }
@keyframes ultPulse { from { box-shadow: 0 0 0 rgba(255, 60, 60, 0); } to { box-shadow: 0 0 18px rgba(255, 60, 60, .7); } }
.pulse { animation: pulse 1.1s ease-in-out infinite; }
.badge.blue { background: rgba(80, 150, 255, .18); color: #8fc0ff; border-color: rgba(80, 150, 255, .5); }
.setb { color: #7fe0c0; font-weight: 700; }
.socks { display: flex; gap: 3px; align-items: center; font-size: .9em; }
.sock { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px dashed #6a7590; vertical-align: middle; }
.item.mythic { border-left-color: #ff4040; background: linear-gradient(135deg, rgba(255, 64, 64, .14), var(--panel2) 60%); box-shadow: 0 0 10px rgba(255, 64, 64, .35); animation: mythGlow 2.4s ease-in-out infinite alternate; }
.item.mythic .nm { text-shadow: 0 0 6px rgba(255, 64, 64, .8); }
@keyframes mythGlow { from { box-shadow: 0 0 6px rgba(255, 64, 64, .3); } to { box-shadow: 0 0 16px rgba(255, 120, 64, .6); } }
.slots6 { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.empty-slot { cursor: pointer; padding: 10px 0; text-align: center; border: 1px dashed var(--line); border-radius: 8px; }
.empty-slot:hover { border-color: var(--gold); color: var(--gold); }
.train-row { padding: 6px 0; border-bottom: 1px solid var(--line); align-items: center; }
.train-row:last-child { border-bottom: 0; }
.stars { display: flex; gap: 4px; margin: 6px 0; font-size: 22px; }
.stars .star { color: #3a4258; transition: .2s; }
.stars .star.on { color: var(--gold); text-shadow: 0 0 8px rgba(242, 193, 78, .8); }
.skin-pcs { display: flex; gap: 4px; justify-content: center; background: #8a8a8a; border-radius: 8px; padding: 4px 6px; }
.skin-pcs .pc { font-size: 38px; cursor: default; }
.tabs2 button .dot { display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; margin-left: 4px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; }

/* ===================== Bàn cờ phong cách Lichess ===================== */
.board { border-radius: 3px; box-shadow: 0 2px 10px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .4); }
.sq.last::before { background: rgba(155, 199, 0, .41); }
.sq.sel::before { content: ''; position: absolute; inset: 0; background: rgba(20, 85, 30, .5); }
.sq .dotm { width: 100%; height: 100%; border-radius: 0; background: radial-gradient(rgba(20, 85, 30, .5) 19%, rgba(0, 0, 0, 0) 20%); }
.sq .capm { inset: 0; border-radius: 0; box-shadow: none; background: radial-gradient(transparent 0%, transparent 79%, rgba(20, 85, 30, .3) 80%); }
.sq.hov::before { content: ''; position: absolute; inset: 0; background: rgba(20, 85, 30, .3); }
.sq.hov .dotm, .sq.hov .capm { background: none; }
.sq.check, .sq.l.check { background: radial-gradient(ellipse at center, #ff0000 0%, #e70000 25%, rgba(169, 0, 0, 0) 89%, rgba(158, 0, 0, 0) 100%), var(--sq-dark); }
.sq.l.check { background: radial-gradient(ellipse at center, #ff0000 0%, #e70000 25%, rgba(169, 0, 0, 0) 89%, rgba(158, 0, 0, 0) 100%), var(--sq-light); }
.sq .co { font-size: clamp(8px, 1.6vw, 12px); font-weight: 700; opacity: 1; font-family: 'Noto Sans', system-ui, sans-serif; }
.sq .co.f { right: 3px; bottom: 0; } .sq .co.r { left: 3px; top: 1px; }
.pc { transition: none; }
.pc .pimg { display: block; width: 1em; height: 1em; filter: none; -webkit-user-drag: none; user-select: none; pointer-events: none; }
@media (hover: hover) { .sq:hover > .pc:not(.ghosted) { transform: none; } }
.board .pc { cursor: pointer; }
.pc.drag { transform: translate(-50%, -50%); cursor: grabbing; }
.pc.ghosted { opacity: .3; }
.skin-pcs .pimg { width: 1em; height: 1em; }

/* Tay nắm đổi cỡ bàn cờ (giống Lichess) */
.board-resize { position: absolute; right: -9px; bottom: -9px; width: 22px; height: 22px; z-index: 25; cursor: nwse-resize; touch-action: none; border-radius: 4px; opacity: .55; transition: opacity .15s;
  background: linear-gradient(135deg, transparent 0 42%, #ddd 42% 50%, transparent 50% 62%, #ddd 62% 70%, transparent 70% 82%, #ddd 82% 90%, transparent 90%); }
.board-resize:hover, .board-wrap.resizing .board-resize { opacity: 1; }
.board-wrap.resizing, .board-wrap.resizing * { user-select: none; cursor: nwse-resize !important; }
@media (hover: none) { .board-resize { opacity: .8; width: 28px; height: 28px; right: -12px; bottom: -12px; } }

/* ===================== GIỮ CHÂN & TRẢI NGHIỆM (1–22) ===================== */
.spacer { flex: 1; }
/* khóa tính năng theo cấp */
.nav a.locked { opacity: .5; cursor: not-allowed; }
.nav a.locked .lk { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 600; }
/* 1. hướng dẫn tân thủ */
.tut-guide { position: fixed; left: 16px; bottom: 16px; z-index: 65; width: 300px; background: linear-gradient(180deg, #252c3b, #1b2029); border: 1px solid var(--gold2); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); animation: tutIn .3s ease; }
.tut-guide.min { width: auto; padding: 0; border: 0; background: none; box-shadow: none; }
.tut-guide .tut-min { position: relative; border: 1px solid var(--gold2); background: #252c3b; color: var(--gold); font-weight: 700; border-radius: 22px; padding: 8px 14px; cursor: pointer; box-shadow: var(--shadow); }
.tut-guide .tut-min .dot { position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff; border-radius: 9px; font-size: 11px; padding: 0 6px; }
.tut-head { display: flex; align-items: center; color: var(--gold); }
.tut-head .x { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; }
.tut-prog { height: 4px; background: var(--line); border-radius: 2px; margin: 6px 0 8px; overflow: hidden; }
.tut-prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold2), var(--gold)); }
.tut-title { font-weight: 800; margin-bottom: 2px; }
.tut-text { font-size: 13px; color: #cfd4df; margin-bottom: 4px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.tut-hl { position: relative; z-index: 2; outline: 3px solid var(--gold) !important; outline-offset: 3px; border-radius: 8px; animation: tutPulse 1.2s ease-in-out infinite; }
@keyframes tutPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(242, 193, 78, .55); } 50% { box-shadow: 0 0 0 10px rgba(242, 193, 78, 0); } }
@keyframes tutIn { from { transform: translateY(20px); opacity: 0; } }
/* 2. vắng mặt */
.away-list { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.away-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; background: var(--panel2); border-radius: 8px; }
.away-row.col { flex-direction: column; }
/* 5. so sánh trang bị */
.item { position: relative; }
.item .delta { position: absolute; top: 6px; right: 8px; font-size: 12px; font-weight: 800; padding: 0 5px; border-radius: 6px; background: rgba(0, 0, 0, .35); }
.item .delta.up { color: var(--green); } .item .delta.down { color: var(--red); } .item .delta.eq { color: var(--muted); }
.presets .preset { display: inline-flex; gap: 2px; }
/* 4. quét màn */
.sweep-box { margin-bottom: 10px; border-color: var(--gold2); }
/* 6. lịch 28 ngày */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin: 10px 0; }
.cal-d { position: relative; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 3px; min-height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; }
.cal-d .cn { font-weight: 800; color: var(--muted); font-size: 11px; }
.cal-d .cr { text-align: center; line-height: 1.2; }
.cal-d.big { border-color: var(--gold2); background: linear-gradient(180deg, rgba(242, 193, 78, .14), var(--panel2)); }
.cal-d.got { opacity: .45; }
.cal-d.got i { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 22px; color: var(--green); }
.cal-d.today { outline: 2px solid var(--gold); opacity: 1; animation: tutPulse 1.4s infinite; }
/* 7. Sổ Thử Thách */
.pass-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pass-lv { text-align: center; min-width: 70px; } .pass-lv .big { font-size: 42px; font-weight: 900; color: var(--gold); line-height: 1; }
.pass-track { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; scroll-behavior: smooth; }
.pass-col { flex: 0 0 74px; display: flex; flex-direction: column; gap: 5px; }
.pass-col .t { text-align: center; font-weight: 800; color: var(--muted); font-size: 13px; }
.pass-col.got .t { color: var(--gold); } .pass-col.next .t { color: #fff; text-decoration: underline; }
.pass-col .r { position: relative; height: 66px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; text-align: center; font-size: 12px; padding: 3px; line-height: 1.25; }
.pass-col .r.prem { background: linear-gradient(180deg, rgba(180, 92, 255, .16), var(--panel2)); }
.pass-col.big .r { border-color: var(--gold2); }
.pass-col .r.ready { cursor: pointer; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(242, 193, 78, .35); }
.pass-col .r.ready:hover { transform: translateY(-2px); }
.pass-col .r.claimed { opacity: .45; } .pass-col .r.lock { opacity: .7; }
.pass-col .r .ck { position: absolute; right: 3px; bottom: 1px; font-style: normal; font-size: 12px; color: var(--green); }
.pass-col.lbl .r { background: none; border: 0; font-weight: 700; color: var(--muted); }
/* 8. sự kiện */
.ev-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.ev-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.ev-chip.hot { border-color: var(--orange); background: linear-gradient(90deg, rgba(255, 174, 0, .2), var(--panel)); }
.ev-card { display: flex; gap: 12px; align-items: flex-start; } .ev-card .ev-ic { font-size: 44px; line-height: 1; }
.ev-card.on { border-color: var(--orange); }
.quick-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
.quick { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--text); font-weight: 700; font-size: 13px; text-align: center; }
.quick:hover { border-color: var(--gold2); }
.quick span { font-size: 26px; } .quick small { color: var(--muted); font-weight: 500; font-size: 11px; }
.quick .dot { position: absolute; top: 6px; right: 8px; background: var(--red); color: #fff; border-radius: 9px; font-size: 11px; padding: 0 6px; font-style: normal; }
/* 9. mùa giải */
.tier-row { display: flex; gap: 6px; overflow-x: auto; margin: 10px 0; }
.tier { flex: 1 0 78px; text-align: center; padding: 8px 4px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); opacity: .55; }
.tier.ok { opacity: 1; } .tier.cur { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(242, 193, 78, .3); }
.tier .ti { font-size: 26px; } .tier .tn { font-weight: 700; font-size: 12px; } .tier .tm { color: var(--muted); font-size: 11px; }
.tier-big { display: flex; align-items: center; gap: 10px; font-size: 40px; } .tier-big b { font-size: 18px; }
.tbl tr.me td { background: rgba(242, 193, 78, .12); }
/* 10. biểu đồ */
.stat-tiles .stat-tile { padding: 14px; } .hero-n { font-size: 30px; font-weight: 900; line-height: 1.15; }
.grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ch-wrap { position: relative; }
.ch { width: 100%; height: auto; display: block; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-ax { fill: var(--muted); font-size: 11px; }
.ch-line { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-area { fill: rgba(242, 193, 78, .1); }
.ch-dot, .ch-hdot { fill: var(--gold); stroke: var(--panel); stroke-width: 2; }
.ch-cross { stroke: var(--muted); stroke-dasharray: 3 3; }
.ch-lbl { fill: var(--text); font-size: 12px; font-weight: 700; }
.ch-tip { position: absolute; pointer-events: none; background: #0b0d12; border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 12px; white-space: nowrap; box-shadow: var(--shadow); }
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr 74px; align-items: center; gap: 8px; font-size: 13px; }
.hbar .hb-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { height: 10px; background: var(--panel2); border-radius: 5px; overflow: hidden; }
.hb-track i { display: block; height: 100%; background: var(--gold2); border-radius: 0 4px 4px 0; }
.hbar:hover .hb-track i { background: var(--gold); }
.hb-v { text-align: right; font-variant-numeric: tabular-nums; }
/* 11. ôn tập */
.srs-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 8px; }
.srs-box { text-align: center; background: var(--panel2); border-radius: 8px; padding: 5px 2px; }
.srs-box b { display: block; font-size: 18px; } .srs-box span { font-size: 10px; color: var(--muted); }
.srs-box.done b { color: var(--green); }
/* 12. giải nhanh */
.storm-big { font-size: 64px; font-weight: 900; color: var(--gold); line-height: 1; }
.storm-top { position: relative; display: flex; align-items: center; gap: 16px; margin-bottom: 10px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.storm-clock { font-size: 34px; font-weight: 900; font-variant-numeric: tabular-nums; min-width: 96px; }
.storm-clock.low { color: var(--red); animation: tutPulse 1s infinite; }
.storm-score span { font-size: 34px; font-weight: 900; color: var(--gold); } .storm-score small { color: var(--muted); margin-left: 4px; }
.storm-combo { font-size: 22px; font-weight: 800; color: var(--orange); }
.storm-float { position: absolute; left: 120px; top: -6px; font-weight: 900; font-size: 22px; animation: floatUp .9s ease-out forwards; }
@keyframes floatUp { to { transform: translateY(-30px); opacity: 0; } }
.storm-play { max-width: 640px; margin: 0 auto; }
.btn.big { font-size: 1.2rem; padding: 14px; }
/* 13. phân tích */
.modal.wide { max-width: 980px; width: 96vw; }
.an-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; margin-top: 10px; }
.an-left { display: flex; gap: 8px; }
.an-board { flex: 1; min-width: 0; }
.an-eval { width: 14px; border-radius: 4px; background: #333; position: relative; overflow: hidden; }
.an-eval i { position: absolute; bottom: 0; left: 0; right: 0; height: 50%; background: #eee; transition: height .3s; }
.an-moves { display: flex; flex-wrap: wrap; gap: 3px 6px; background: var(--panel2); border-radius: 8px; padding: 8px; max-height: 180px; overflow: auto; font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
.an-moves .no { color: var(--muted); } .an-moves .mv { cursor: pointer; padding: 0 3px; border-radius: 4px; }
.an-moves .mv:hover { background: var(--line); } .an-moves .mv.on { background: var(--gold2); color: #000; } .an-moves .mv.var { color: var(--blue); }
.an-score { font-size: 26px; font-weight: 900; } .an-score.neg { color: #cfd4df; }
/* 14/16. bạn bè & sư đồ */
.friend-row { gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); align-items: center; }
.friend-row .hero-cv { width: 48px; height: 60px; flex: 0 0 auto; }
.on-dot, .off-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 4px; vertical-align: middle; }
.off-dot { background: #555; }
.tabs2 button { position: relative; }
.tabs2 button .dot { position: absolute; top: 2px; right: 2px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
/* 15. bang chiến */
.gwar-card.on { border-color: var(--red); }
/* 17. xem trực tiếp */
.spec-hud { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.spec-p.right { text-align: right; } .spec-p .nm { font-weight: 700; }
.spec-row { padding: 6px 0; border-bottom: 1px solid var(--line); gap: 8px; }
/* 18. cài đặt */
.no-coords .board .co { display: none; }
.no-anim *, .no-anim *::before, .no-anim *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
.board .sq.pre { background-image: linear-gradient(rgba(20, 30, 85, .5), rgba(20, 30, 85, .5)); }
.board .sq.presel { background-image: linear-gradient(rgba(20, 30, 85, .45), rgba(20, 30, 85, .45)); }
.kbd-btn { min-width: 64px; margin: 2px; padding: 4px 8px; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 6px; cursor: pointer; font-family: ui-monospace, Consolas, monospace; }
.kbd-btn.listen { border-color: var(--gold); color: var(--gold); animation: tutPulse 1s infinite; }
.skin-sw { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; background: var(--panel2); border: 2px solid var(--line); border-radius: 8px; cursor: pointer; color: var(--text); width: 74px; }
.skin-sw.on { border-color: var(--gold); }
.skin-sw small { font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 66px; }
.skin-sw .sw2 { display: flex; width: 44px; height: 44px; border-radius: 4px; overflow: hidden; align-items: center; justify-content: center; font-size: 36px; }
.skin-sw .sw2 i { flex: 1; height: 100%; }
.skin-sw .sw2 .pimg { width: 40px; height: 40px; }
/* 20. hiệu ứng */
.board-wrap.mate-flash { animation: mateFlash .6s ease-out; }
@keyframes mateFlash { 0% { filter: brightness(1.8) saturate(1.4); transform: scale(1.015); } 100% { filter: none; transform: none; } }
.rare-drop { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: radial-gradient(circle, rgba(255, 64, 64, .35), rgba(0, 0, 0, .75) 60%); animation: rareBg 3.8s ease forwards; cursor: pointer; }
.rare-in { text-align: center; animation: rarePop .6s cubic-bezier(.2, 1.6, .4, 1); }
.rare-star { font-size: 110px; animation: spin 2.4s linear infinite; filter: drop-shadow(0 0 30px #ff4040); }
.rare-t { font-size: 44px; font-weight: 900; color: #ff5050; letter-spacing: 4px; text-shadow: 0 0 20px #ff2020, 0 3px 0 #000; }
.rare-n { font-size: 22px; font-weight: 800; color: #fff; text-shadow: 0 2px 6px #000; }
@keyframes rarePop { from { transform: scale(.2); opacity: 0; } }
@keyframes rareBg { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
/* 22. admin */
.dau-bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; }
.dau-bars .db { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.dau-bars .db i { display: block; width: 100%; background: var(--gold2); border-radius: 4px 4px 0 0; min-height: 2px; }
.dau-bars .db:hover i { background: var(--gold); }
.dau-bars .db span { font-size: 10px; color: var(--muted); }
.ret-c { background: rgba(242, 193, 78, calc(var(--a) * .6)); font-variant-numeric: tabular-nums; }
/* 19. di động: thanh điều hướng dưới, nút lớn */
.bnav { display: none; }
@media (max-width: 820px) {
  .bnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 62; background: rgba(22, 26, 35, .97); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); backdrop-filter: blur(6px); }
  .bnav a { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 0 6px; color: var(--muted); font-size: 11px; font-weight: 600; min-height: 52px; }
  .bnav a span { font-size: 21px; line-height: 1.1; }
  .bnav a.active { color: var(--gold); }
  .bnav .bdot { position: absolute; top: 5px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
  .main { padding-bottom: 80px !important; }
  .chat-fab { bottom: 72px; width: 48px; height: 48px; }
  .tut-guide { left: 8px; right: 8px; width: auto; max-width: 360px; bottom: 66px; }
  .tut-guide.min { right: auto; }
  .quick-row { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .quick { padding: 8px 2px; font-size: 11px; } .quick span { font-size: 22px; }
  .grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-body { grid-template-columns: 1fr; }
  .btn { min-height: 40px; }
  .btn.sm { min-height: 34px; }
  .storm-clock, .storm-score span { font-size: 26px; }
  .cal-d { min-height: 44px; font-size: 10px; }
}
@media (max-width: 820px) and (orientation: portrait) {
  .battle { grid-template-columns: 1fr !important; }
}
.big-btns .btn { min-height: 46px; font-size: 1.02rem; padding-left: 16px; padding-right: 16px; }
.big-btns .btn.sm { min-height: 40px; }
.big-btns .nav a { padding: 12px; }
.tier-big > div { font-size: 15px; }
.tier-big > div .muted { font-size: 13px; }
label.row { flex-wrap: nowrap; align-items: flex-start; }
label.row > input[type=checkbox] { flex: 0 0 auto; margin-top: 3px; }

/* ===== ⚖️ Cân bằng game (admin) ===== */
.chip { padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 13px; color: inherit; }
.chip.on { background: var(--gold); color: #2a1a00; border-color: var(--gold); }
.bal-groups { gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.bal-ev { margin-top: 10px; padding: 10px; border-radius: 10px; border: 1px dashed var(--line); }
.bal-ev.on { border: 1px solid rgba(242, 193, 78, .5); background: rgba(242, 193, 78, .08); }
.bal-ev.on .btn { margin-top: 6px; }
.bal-sub { margin: 14px 0 6px; font-weight: 700; color: var(--gold); font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.bal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 6px; }
.bal-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); border-left-width: 3px; }
.bal-row.chg { border-left-color: var(--gold); background: rgba(242, 193, 78, .05); }
.bal-row.dirty { border-left-color: #4ea1ff; background: rgba(78, 161, 255, .08); }
.bal-row.bad { border-color: var(--red); }
.bal-l { flex: 1; font-size: 13px; min-width: 0; }
.bal-i { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.bal-i input.inp[type=number] { width: 84px; padding: 5px 7px; }
.bal-i input.inp:not([type]) { width: 150px; padding: 5px 7px; }
.bal-i .muted.small { max-width: 80px; }
.bal-save { position: sticky; bottom: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); opacity: .65; z-index: 5; }
.bal-save.on { opacity: 1; border-color: #4ea1ff; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); }
.bal-tbl td, .bal-tbl th { white-space: nowrap; font-size: 13px; }
.bal-log { padding: 8px 0; border-bottom: 1px solid var(--line); }
.bal-log:last-child { border-bottom: 0; }
.switch { position: relative; display: inline-block; width: 38px; height: 21px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); cursor: pointer; transition: .2s; }
.switch span::before { content: ''; position: absolute; left: 3px; top: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--gold); }
.switch input:checked + span::before { transform: translateX(17px); }
@media (max-width: 600px) { .bal-grid { grid-template-columns: 1fr; } .bal-row { flex-wrap: wrap; } }

/* ===== ⏳ Hạn mức chơi & 🎓 Lớp học ===== */
.acc-pill { cursor: pointer; border-color: rgba(78, 161, 255, .5) !important; }
.acc-pill.low { border-color: var(--gold) !important; color: var(--gold); animation: pulse 1.6s infinite; }
.acc-pill.lock { border-color: var(--red) !important; color: var(--red); }
.acc-lock-ic { font-size: 56px; line-height: 1.1; }
.acc-lock h2 { margin: 6px 0; }
.acc-kpi .big { font-size: 26px; font-weight: 800; }
.acc-kpi { margin-bottom: 12px; }
.acc-chart { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 6px; }
.acc-chart .col-b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 10px; color: var(--muted); }
.acc-chart .stack { width: 100%; max-width: 26px; display: flex; flex-direction: column-reverse; border-radius: 4px 4px 0 0; overflow: hidden; min-height: 2px; background: var(--line); }
.acc-chart .stack i { display: block; }
.acc-chart .f, i.lg.f { background: #4ea1ff; } .acc-chart .l, i.lg.l { background: var(--gold); } .acc-chart .s, i.lg.s { background: #5ccf7a; }
i.lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; }
.cls-card { display: block; color: inherit; text-decoration: none; transition: transform .15s; }
.cls-card:hover { transform: translateY(-2px); border-color: var(--gold); }
.cls-bulk { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; position: sticky; top: 60px; z-index: 4; }
.cls-tbl td, .cls-tbl th { white-space: nowrap; font-size: 13px; }
.cls-tbl tr.sel td { background: rgba(242, 193, 78, .08); }
.cls-tbl th.sortable { cursor: pointer; user-select: none; } .cls-tbl th.sortable.on { color: var(--gold); }
.hw-row { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hw-row:last-child { border-bottom: 0; }
.hw-bar { height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 5px 0; }
.hw-bar.big { height: 10px; }
.hw-bar i { display: block; height: 100%; background: linear-gradient(90deg, #5ccf7a, var(--gold)); transition: width .3s; }
.hw-item { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.hw-item:hover { border-color: var(--gold); }
.hw-item.done { opacity: .75; } .hw-item.late { border-color: rgba(255, 90, 90, .5); }
.hw-ic { font-size: 30px; }
.hw-tbl td, .hw-tbl th { padding: 4px 6px; font-size: 13px; white-space: nowrap; }
.hw-c { text-align: center; } .hw-c.none { color: var(--muted); }
.spark { display: inline-flex; align-items: flex-end; gap: 1px; height: 24px; vertical-align: middle; }
.spark i { display: block; width: 5px; background: #4ea1ff; border-radius: 1px; } .spark i.z { background: var(--line); }
/* Phiếu đăng nhập in trong trang */
#printArea { position: fixed; inset: 0; z-index: 9999; overflow: auto; background: #fff; color: #111; padding: 14px; font-family: system-ui, 'Segoe UI', Arial, sans-serif; }
#printArea .pa-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; position: sticky; top: -14px; background: #f3f3f3; padding: 8px; border-radius: 8px; margin-bottom: 10px; }
#printArea h1 { font-size: 18px; margin: 0 0 10px; color: #111; }
#printArea .pa-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
#printArea .slip { display: flex; gap: 10px; align-items: center; border: 1.5px dashed #888; border-radius: 8px; padding: 8px; break-inside: avoid; page-break-inside: avoid; }
#printArea .info { font-size: 13px; line-height: 1.5; } #printArea .nm { font-size: 16px; font-weight: 700; } #printArea .cls, #printArea .hint { font-size: 11px; color: #555; }
#printArea .slip b { font-family: Consolas, monospace; font-size: 14px; }
body.printing { overflow: hidden; }
@media (max-width: 600px) { #printArea .pa-grid { grid-template-columns: 1fr; } }
@media print {
  body.printing > *:not(#printArea) { display: none !important; }
  body.printing { overflow: visible; background: #fff; }
  #printArea { position: static; padding: 0; overflow: visible; }
  #printArea .pa-bar { display: none; }
}

/* ===== Nhiều người chơi: phòng, đua giải đố, thách đấu, lớp học trực tiếp ===== */
.conn-banner { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 9999; background: #8a2a1a; color: #fff; padding: 8px 16px; border-radius: 0 0 10px 10px; box-shadow: 0 4px 14px #0008; font-weight: 600; animation: connPulse 1.4s infinite; }
@keyframes connPulse { 50% { opacity: .75; } }
.mode-card { text-align: center; align-items: center; gap: 6px; transition: transform .15s; }
.mode-card:hover { transform: translateY(-3px); }
.room-modes { display: flex; gap: 6px; flex-wrap: wrap; }
.room-mem { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; background: var(--panel); margin: 4px 0; flex-wrap: wrap; }
.room-mem.off { opacity: .5; }
.team-h { font-weight: 700; padding: 4px 8px; border-radius: 6px; margin-bottom: 4px; }
.team-h.t1 { background: #1d4f8a55; color: #8cc4ff; }
.team-h.t2 { background: #8a1d2a55; color: #ff9aa6; }
.room-chat .msgs { height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; font-size: 14px; padding: 4px; background: #0003; border-radius: 8px; }
.room-chat .emotes { gap: 2px; flex-wrap: wrap; }
.emo { font-size: 22px; display: inline-block; animation: emoPop .4s; }
@keyframes emoPop { from { transform: scale(.2); } 70% { transform: scale(1.3); } }
.race-row { gap: 8px; padding: 5px 8px; border-radius: 8px; align-items: center; }
.race-row.me { background: #f5c54222; outline: 1px solid #f5c54255; }
.live-dist { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.ld-row { display: grid; grid-template-columns: 70px 1fr 70px; gap: 8px; align-items: center; font-size: 14px; }
.ld-san { font-weight: 700; font-family: monospace; }
.ld-bar { height: 14px; background: #0004; border-radius: 7px; overflow: hidden; }
.ld-bar i { display: block; height: 100%; background: var(--gold); transition: width .4s; }
.ld-row.ok .ld-bar i { background: #3fbf6a; }
.ld-row.bad .ld-bar i { background: #c94b4b; }
.live-roster { display: flex; flex-wrap: wrap; gap: 4px; }

/* ===== Mục tiêu chung, Liên lớp, Giải đấu ===== */
.goal-card { margin-bottom: 14px; border-color: #3fa7ff66; background: linear-gradient(90deg, rgba(63,167,255,.12), var(--panel)); }
.goal-bar { position: relative; height: 16px; border-radius: 8px; background: #0005; margin-top: 10px; }
.goal-bar > i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, #3fa7ff, #6be3a0); transition: width .6s; }
.goal-tick { position: absolute; top: 18px; transform: translateX(-100%); font-size: 11px; color: var(--muted, #999); }
.goal-tick::before { content: ''; position: absolute; right: 0; top: -18px; width: 2px; height: 16px; background: #fff5; }
.goal-tick.on { color: var(--gold); }
.liga-me { display: flex; gap: 18px; flex-wrap: wrap; }
.liga-me > div { display: flex; flex-direction: column; align-items: center; min-width: 64px; }
tr.liga-mine td { background: #f5c54218; }
.tour-card { gap: 6px; }
.tour-my { margin-bottom: 12px; border-color: var(--gold); }
.tour-my.playing { border-color: #3fbf6a; }
.bracket { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.br-col { display: flex; flex-direction: column; justify-content: space-around; gap: 10px; min-width: 170px; }
.br-h { font-weight: 700; font-size: 13px; color: var(--gold); text-align: center; }
.br-m { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.br-p { display: flex; justify-content: space-between; gap: 6px; padding: 5px 8px; font-size: 14px; }
.br-p + .br-p { border-top: 1px solid var(--line); }
.br-p.win { background: #3fbf6a22; font-weight: 700; }
.br-p.lose { opacity: .55; }
.br-p.me span { color: var(--gold); }
.br-tag { display: block; font-size: 11px; text-align: center; padding: 2px; background: #0003; color: var(--muted, #aaa); }
.br-tag.live { color: #3fbf6a; }

/* ===== Ping ô cờ (2 vs 2) ===== */
.sq.mk-ping { box-shadow: inset 0 0 0 4px #3fa7ff; }
.sq.mk-ping::after { content: ''; position: absolute; inset: 20%; border-radius: 50%; border: 3px solid #3fa7ff; animation: pingRing 1s infinite; pointer-events: none; }
.sq.mk-ping2 { box-shadow: inset 0 0 0 4px #ff6b8a; }
@keyframes pingRing { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }

/* ===== Đồng đội 2 vs 2 ===== */
.team-hud { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.th-side.op { text-align: right; }
.th-name { font-size: 14px; margin-bottom: 4px; }
.team-log { max-height: 200px; overflow-y: auto; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
#tBoard.my-turn { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
/* ===== Cùng phiêu lưu ===== */
.coop-hud { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.coop-mon { display: flex; gap: 12px; align-items: center; }
.coop-emo { font-size: 54px; line-height: 1; filter: drop-shadow(0 4px 8px #000a); transition: filter .3s; }
.coop-emo.barrier { filter: drop-shadow(0 0 12px #9b6bff) drop-shadow(0 0 4px #c9a8ff); }
.coop-emo.shake { animation: coopShake .35s; }
@keyframes coopShake { 25% { transform: translateX(-6px) rotate(-6deg); } 75% { transform: translateX(6px) rotate(6deg); } }
.coop-barrier { color: #c9a8ff; font-weight: 600; }
/* ===== Bang chiến trực tiếp ===== */
.gw-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; max-width: 560px; aspect-ratio: 1; }
.gw-cell { position: relative; border: 2px solid var(--line); border-radius: 10px; background: #ffffff0d; color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 15px; padding: 2px; transition: transform .12s; }
.gw-cell:hover { transform: scale(1.04); }
.gw-cell.can { border-color: #f5c542aa; }
.gw-cell.mine { box-shadow: inset 0 0 0 3px var(--gold); }
.gw-cell.cur { animation: connPulse 1s infinite; }
.gw-cell.duel { border-color: #ff5060; }
.gw-v { font-size: 10px; color: #ffd76a; }
.gw-f { position: absolute; left: 3px; bottom: 2px; font-size: 11px; }
.gw-p { position: absolute; right: 3px; top: 2px; font-size: 10px; }
.gw-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }

/* =====================================================================
   NÂNG CẤP GIAO DIỆN (A4): font tiêu đề, khung thẻ, nút nổi, tiêu đề vàng
   ===================================================================== */
@font-face { font-family: 'Baloo 2'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/fonts/baloo2-vietnamese.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Baloo 2'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/fonts/baloo2-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Baloo 2'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/fonts/baloo2-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --title-font: 'Baloo 2', var(--font);
  --frame: linear-gradient(160deg, #3b4258 0%, #232838 40%, #1a1e2a 60%, #3a3346 100%);
  --sheen: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,0) 38%);
}
h1, h2, h3, .modal h2, .logo { font-family: var(--title-font); letter-spacing: .2px; }
h1, h2 { font-weight: 800; }
h3 { font-weight: 700; }
.page-title h1 {
  background: linear-gradient(180deg, #fff3c4 0%, #f2c14e 55%, #c9862a 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.55)); font-size: 1.95rem;
}
/* thẻ: lớp bóng sáng phía trên + viền trong mảnh */
.card { background: var(--sheen), var(--panel); box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.05); }
.card.flat { box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.card > h3:first-child { padding-bottom: 6px; margin-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.06); }
.card > h3:first-child::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(242,193,78,.35), transparent); margin-left: 6px; }
/* khung kim loại cho hộp thoại và thẻ quan trọng (.frame) */
.modal, .card.frame {
  position: relative; border: 2px solid transparent;
  background: var(--sheen) padding-box, linear-gradient(var(--panel), var(--panel)) padding-box, var(--frame) border-box;
  box-shadow: 0 18px 50px rgba(0,0,0,.6), inset 0 0 0 1px rgba(0,0,0,.5);
}
.modal::before, .modal::after, .card.frame::before, .card.frame::after {
  content: ''; position: absolute; width: 14px; height: 14px; pointer-events: none;
  border: 2px solid var(--gold); opacity: .8;
}
.modal::before, .card.frame::before { top: 5px; left: 5px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.modal::after, .card.frame::after { bottom: 5px; right: 5px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }
/* nút nổi: có cạnh dưới, ấn xuống thì lún */
.btn { box-shadow: 0 3px 0 rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.07); transition: transform .08s, box-shadow .08s, filter .15s, background .15s, border-color .15s; }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.05); }
.btn.primary { box-shadow: 0 3px 0 #8a5a10, inset 0 1px 0 rgba(255,255,255,.45); text-shadow: 0 1px 0 rgba(255,255,255,.35); }
.btn.primary:active:not(:disabled) { box-shadow: 0 1px 0 #8a5a10, inset 0 1px 0 rgba(255,255,255,.3); }
.btn.danger { box-shadow: 0 3px 0 #7a1c26, inset 0 1px 0 rgba(255,255,255,.3); }
.btn.green { box-shadow: 0 3px 0 #1a6a42, inset 0 1px 0 rgba(255,255,255,.35); }
.btn.blue { box-shadow: 0 3px 0 #1a4f8e, inset 0 1px 0 rgba(255,255,255,.35); }
.btn.ghost, .btn.sm.ghost { box-shadow: none; }
.btn.lg, .btn.big { font-family: var(--title-font); font-weight: 700; letter-spacing: .3px; }
/* ô truy cập nhanh & tab */
.quick { background: var(--sheen), var(--panel); transition: transform .15s, border-color .15s, box-shadow .15s; }
.quick:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.35), 0 0 0 1px rgba(242,193,78,.25); }
.quick span { filter: drop-shadow(0 3px 3px rgba(0,0,0,.4)); }
.tabs2 button.on { box-shadow: 0 2px 0 #8a5a10; }
.nav a.active { box-shadow: inset 3px 0 0 var(--gold); }
/* thanh máu: bóng kính */
.bar { box-shadow: inset 0 2px 4px rgba(0,0,0,.5); }
.bar > .fill::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(255,255,255,.3), rgba(255,255,255,0) 50%, rgba(0,0,0,.14)); }
/* đồ họa thấp: bỏ bóng và hiệu ứng tốn GPU */
body.gfx-low { background-image: none; }
body.gfx-low .card, body.gfx-low .modal, body.gfx-low .quick { box-shadow: none !important; }
body.gfx-low .page-title h1 { filter: none; }
body.gfx-low *, body.gfx-low *::before, body.gfx-low *::after { backdrop-filter: none !important; }

/* ===== Quái vẽ tay (A1) & cảnh chiến đấu ===== */
.mon-cv { display: inline-block; vertical-align: middle; }
.big-mon { display: block; margin: 0 auto; filter: drop-shadow(0 8px 14px #000a); }
.stage .em canvas { display: block; margin: 0 auto; }
.scene.coop-scene { height: clamp(180px, 28vh, 250px); margin-bottom: 8px; }
.scene.barrier { box-shadow: inset 0 0 40px #9b6bffaa, 0 0 12px #9b6bff66; }
.scene.barrier::after { content: '🔮 Kết giới'; position: absolute; top: 8px; right: 10px; font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #2a1650cc; color: #e0ccff; pointer-events: none; }
body.gfx-low .big-mon { filter: none; }

/* ===== Vũ khí đặc biệt (đợt 2) ===== */
.item .gunl { color: #ffd27a; font-size: 11.5px; line-height: 1.35; }
.gun-ev { border-color: #ff9020 !important; background: linear-gradient(90deg, #3a1a0a, #2a1408) !important; color: #ffe0b0; margin-bottom: 10px; }
.quick.gun-hot { border-color: #ff9020; box-shadow: 0 0 14px #ff902066; animation: gunHot 1.6s ease-in-out infinite; }
@keyframes gunHot { 50% { box-shadow: 0 0 22px #ff9020aa; } }
body.gfx-low .quick.gun-hot { animation: none; }

/* ===== Cảnh phim ngắn (A7) ===== */
.cine { position: fixed; inset: 0; z-index: 10000; background: radial-gradient(ellipse at 50% 42%, rgba(30, 20, 10, .55), rgba(0, 0, 0, .88)); cursor: pointer; animation: cineIn .25s ease-out; transition: opacity .25s; }
.cine.out { opacity: 0; }
.cine-boss { background: radial-gradient(ellipse at 50% 42%, rgba(60, 0, 0, .6), rgba(0, 0, 0, .92)); }
.cine canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.cine-txt { position: absolute; left: 0; right: 0; top: 70%; text-align: center; pointer-events: none; animation: cineTxt .55s .25s cubic-bezier(.2, 1.6, .4, 1) both; }
.cine-txt b { display: block; font-family: var(--title-font, inherit); font-weight: 800; font-size: clamp(34px, 7vw, 72px); line-height: 1.05; letter-spacing: 1px; background: linear-gradient(180deg, #fff6c8, #ffc83a 55%, #d88a10); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 #5a3000) drop-shadow(0 0 18px rgba(255, 180, 40, .55)); }
.cine-boss .cine-txt b { background-image: linear-gradient(180deg, #ffe0e0, #ff5050 55%, #a01010); filter: drop-shadow(0 3px 0 #300) drop-shadow(0 0 20px rgba(255, 40, 40, .6)); }
.cine-txt small { display: block; margin-top: 6px; color: #f4e6c8; font-size: clamp(14px, 2.2vw, 19px); text-shadow: 0 2px 4px #000; }
.cine-skip { position: absolute; right: 18px; bottom: 18px; background: rgba(0, 0, 0, .5); color: #ddd; border: 1px solid #666; border-radius: 20px; padding: 6px 14px; font-size: 13px; cursor: pointer; }
.cine-skip:hover { color: #fff; border-color: #aaa; }
@keyframes cineIn { from { opacity: 0; } }
@keyframes cineTxt { from { opacity: 0; transform: scale(.4); } }

/* ===== Bàn cờ hoa văn & bộ quân hiệu ứng (A5) ===== */
.tex-marble { --tex-l: linear-gradient(118deg, transparent 38%, rgba(140, 140, 155, .28) 41%, transparent 44%), linear-gradient(32deg, transparent 62%, rgba(120, 120, 135, .22) 64%, transparent 67%), radial-gradient(circle at 70% 30%, rgba(255, 255, 255, .5), transparent 60%);
  --tex-d: linear-gradient(118deg, transparent 40%, rgba(235, 238, 245, .35) 43%, transparent 46%), linear-gradient(40deg, transparent 58%, rgba(60, 64, 75, .25) 61%, transparent 64%); }
.tex-oak { --tex-l: repeating-linear-gradient(92deg, rgba(120, 70, 20, .09) 0 2px, transparent 2px 7px), radial-gradient(ellipse at 30% 60%, rgba(120, 70, 20, .18), transparent 30%);
  --tex-d: repeating-linear-gradient(88deg, rgba(50, 25, 5, .16) 0 2px, transparent 2px 6px), radial-gradient(ellipse at 65% 35%, rgba(50, 25, 5, .22), transparent 28%); }
.tex-galaxy { --tex-l: radial-gradient(1px 1px at 20% 30%, #fff, transparent), radial-gradient(1px 1px at 70% 65%, #dfe8ff, transparent), radial-gradient(ellipse at 40% 50%, rgba(255, 140, 230, .22), transparent 70%);
  --tex-d: radial-gradient(1.2px 1.2px at 30% 70%, #fff, transparent), radial-gradient(1px 1px at 75% 25%, #fff, transparent), radial-gradient(1px 1px at 55% 50%, #bfe0ff, transparent), radial-gradient(ellipse at 60% 40%, rgba(120, 90, 255, .3), transparent 70%); }
.board-wrap[class*="tex-"] .sq.l { background-image: var(--tex-l); }
.board-wrap[class*="tex-"] .sq.d { background-image: var(--tex-d); }
.skin-prev[class*="tex-"] > div:nth-child(odd) { background-image: var(--tex-l); }
.skin-prev[class*="tex-"] > div:nth-child(even) { background-image: var(--tex-d); }
.board-wrap.tex-galaxy .co { color: #cfd6ff !important; }
.pfx-pixel .pc .pcs { filter: url(#kvPixel) drop-shadow(.04em .04em 0 rgba(0, 0, 0, .5)); image-rendering: pixelated; }
.pfx-crystal .pc .pcs { opacity: .92; filter: drop-shadow(0 0 .07em #bff4ff) drop-shadow(0 .04em .04em rgba(0, 0, 0, .4)); }
.pfx-crystal .pc.b .pcs { filter: drop-shadow(0 0 .08em #b49cff) drop-shadow(0 .04em .04em rgba(0, 0, 0, .4)); }
.pfx-wood .pc .pcs { filter: sepia(.35) contrast(1.08) drop-shadow(0 .05em .03em rgba(40, 20, 0, .55)); }
.pfx-fire .pc .pcs { animation: pcFire 1.1s ease-in-out infinite alternate; }
@keyframes pcFire { from { filter: drop-shadow(0 0 .04em #ffb030) drop-shadow(0 .04em .04em rgba(0, 0, 0, .45)); } to { filter: drop-shadow(0 -.05em .13em #ff5010) drop-shadow(0 .04em .04em rgba(0, 0, 0, .45)); } }
body.gfx-low .pfx-fire .pc .pcs, body.no-anim .pfx-fire .pc .pcs { animation: none; }

/* ===================== XÃ HỘI: chat 2, tin riêng, bạn bè, phòng, săn boss ===================== */
.chat-fab .cnt, .chat2 .tabs .cnt, .dm-row .cnt { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font: 700 11px/20px var(--font); font-style: normal; text-align: center; }
.chat2 { width: 400px; height: 540px; }
.chat2 .tabs { overflow-x: auto; scrollbar-width: none; }
.chat2 .tabs button { position: relative; flex: 0 0 auto; padding: 9px 9px; font-size: .86em; }
.chat2 .tabs .tl { display: none; }
.chat2 .tabs button.on .tl { display: inline; }
.chat2 .tabs .dt { position: absolute; top: 5px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.chat2 .tabs .cnt { position: static; display: inline-block; margin-left: 3px; }
.ch-info { padding: 0 10px; color: var(--muted); }
.ch-info:empty { display: none; }
.ch-reply { padding: 4px 10px; background: var(--panel2); border-top: 1px solid var(--line); }
.chat2 form.ch-form { gap: 4px; align-items: center; }
.chat2 form.ch-form .btn.ghost { padding: 6px; }
.chat .msg { position: relative; padding: 3px 6px; border-radius: 8px; line-height: 1.4; word-break: break-word; }
.chat .msg:hover { background: rgba(255, 255, 255, .04); }
.chat .msg.mine { background: rgba(242, 193, 78, .06); }
.chat .msg.menti { background: rgba(74, 163, 255, .14); box-shadow: inset 3px 0 0 var(--blue); }
.chat .msg.solve { color: var(--green); }
.chat .msg .q { color: var(--muted); border-left: 2px solid var(--line); padding-left: 6px; margin-bottom: 2px; }
.chat .msg .mact { position: absolute; top: 2px; right: 2px; display: none; border: 0; background: var(--panel2); color: var(--text); border-radius: 6px; cursor: pointer; padding: 0 6px; }
.chat .msg:hover .mact { display: block; }
.ment { color: var(--blue); } .ment.me { color: #fff; background: var(--blue); border-radius: 4px; padding: 0 3px; }
.stk { display: inline-block; font-size: 1.7em; line-height: 1.2; animation: stkPop .35s ease; }
@keyframes stkPop { from { transform: scale(.3); } 70% { transform: scale(1.15); } to { transform: scale(1); } }
.ccard { margin-top: 4px; padding: 8px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.ccard.pz { border-color: rgba(242, 193, 78, .5); }
.ccard.rm { border-color: rgba(76, 195, 138, .5); }
.ccard.lf { border-color: rgba(239, 79, 95, .5); }
.ccard .item { margin: 0; }
.ch-pop { position: absolute; bottom: 58px; left: 8px; right: 8px; max-height: 260px; overflow: auto; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 8px; box-shadow: var(--shadow); z-index: 3; }
.stk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.stk-grid button, .quick button { border: 1px solid var(--line); background: var(--bg2); color: var(--text); border-radius: 8px; padding: 6px; cursor: pointer; font-size: 1em; }
.stk-grid button:hover, .quick button:hover { border-color: var(--gold2); }
.quick { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.quick button { font-size: .82em; }
.lfg-head { background: var(--bg2); border-radius: 10px; padding: 8px; margin-bottom: 6px; }
.lfg-row { display: flex; align-items: center; gap: 6px; justify-content: space-between; padding: 3px 0; border-top: 1px dashed var(--line); }
.umenu { position: fixed; z-index: 200; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; min-width: 160px; }
.umenu b { padding: 4px 8px; color: var(--gold); }
.umenu button { text-align: left; border: 0; background: none; color: var(--text); padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.umenu button:hover { background: var(--panel); }
.dm-row { position: relative; padding: 8px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.dm-row:hover { background: var(--panel2); border-color: var(--line); }
.dm-row .cnt { position: static; display: inline-block; }
.dm-dock { position: fixed; bottom: 0; right: 84px; z-index: 59; display: flex; gap: 10px; align-items: flex-end; pointer-events: none; }
.dm-win { pointer-events: auto; width: 290px; height: 380px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; box-shadow: var(--shadow); position: relative; }
.dm-win.min { height: auto; }
.dm-win.min .dm-b, .dm-win.min .dm-f, .dm-win.min .dm-seen { display: none; }
.dm-h { display: flex; align-items: center; gap: 4px; padding: 6px 8px; background: var(--panel2); border-radius: 12px 12px 0 0; }
.dm-h .btn { padding: 2px 6px; }
.dm-b { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 4px; font-size: .9em; }
.dmm { max-width: 82%; padding: 6px 10px; border-radius: 14px; background: var(--panel2); align-self: flex-start; word-break: break-word; }
.dmm.mine { align-self: flex-end; background: linear-gradient(180deg, #3d5a8a, #2f4a74); }
.dm-seen { text-align: right; padding: 0 8px; min-height: 14px; }
.dm-f { display: flex; gap: 4px; padding: 6px; border-top: 1px solid var(--line); }
.dm-f .btn.ghost { padding: 4px; }
.dm-win .ch-pop { bottom: 48px; }
@media (max-width: 700px) { .dm-dock { right: 0; left: 0; justify-content: center; } .dm-win { width: 100%; height: 60vh; } .dm-win:not(:last-child) { display: none; } .chat2 { width: calc(100vw - 24px); } }
/* bạn bè */
.tabs2.wrap { flex-wrap: wrap; }
.hearts { font-size: .8em; letter-spacing: -2px; }
.pair-frame { border-radius: 12px; background: linear-gradient(90deg, rgba(255, 105, 180, .12), rgba(242, 193, 78, .08)); box-shadow: inset 0 0 0 2px rgba(255, 120, 190, .45); }
.aff-perks { display: grid; gap: 2px; margin-top: 6px; }
.feed-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.lb-row { padding: 6px 8px; border-radius: 8px; }
.lb-row.me { background: rgba(242, 193, 78, .1); }
.fcode { font: 800 30px/1.2 monospace; letter-spacing: 6px; color: var(--gold); margin: 6px 0; }
.qr-box { display: inline-block; background: #fff; padding: 10px; border-radius: 10px; margin: 6px 0; }
.qr-box svg { display: block; }
/* phòng */
.lobby-cv-wrap { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 12px; box-shadow: var(--shadow); }
.lobby-cv { display: block; width: 100%; height: 230px; cursor: pointer; }
.room-set { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.room-set label { display: flex; flex-direction: column; gap: 2px; font-size: .85em; color: var(--muted); }
.room-set label.chk { flex-direction: row; align-items: center; gap: 6px; grid-column: span 2; color: var(--text); }
.room-set .inp { padding: 6px 8px; }
label.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.warm-board .board-wrap { max-width: 300px !important; margin: 0 auto; }
.room-li { padding: 8px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); align-items: center; gap: 8px; }
.room-li.fr { border-color: rgba(76, 195, 138, .5); }
.emo-bubble { position: absolute; top: 40%; font-size: 40px; z-index: 5; animation: emoUp 2.6s ease forwards; pointer-events: none; }
.emo-bubble.l { left: 22%; } .emo-bubble.r { right: 22%; }
@keyframes emoUp { from { transform: translateY(20px) scale(.4); opacity: 0; } 15% { transform: translateY(0) scale(1.15); opacity: 1; } 80% { opacity: 1; } to { transform: translateY(-50px) scale(1); opacity: 0; } }
/* săn boss */
.hunt-field.live { border-color: rgba(239, 79, 95, .6); box-shadow: 0 0 0 1px rgba(239, 79, 95, .3), 0 0 24px rgba(239, 79, 95, .2); }
.hunt-party { border-color: rgba(242, 193, 78, .45); }
.hunt-mems { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin: 8px 0; }
.hunt-mems .hm { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); }
.hunt-mems .hm.empty { justify-content: center; color: var(--muted); border-style: dashed; min-height: 64px; }
.boss-row { align-items: center; gap: 8px; padding: 4px; border-radius: 10px; background: var(--bg2); }
.book-grid { margin-top: 10px; }
.book-card { display: flex; gap: 10px; padding: 10px; border-radius: 12px; background: linear-gradient(135deg, color-mix(in srgb, var(--bc) 18%, transparent), var(--bg2)); border: 1px solid color-mix(in srgb, var(--bc) 50%, var(--line)); }
.book-card.locked { filter: grayscale(.9) brightness(.7); }
.book-card .lore p { margin: 4px 0; font-style: italic; }
.sched-row { align-items: center; gap: 8px; padding: 6px; border-radius: 10px; background: var(--bg2); }
.sched-row.live { box-shadow: inset 3px 0 0 var(--red); }
.lfg-card { align-items: center; gap: 10px; padding: 8px; border-bottom: 1px solid var(--line); }
.rp-log { height: 220px; overflow-y: auto; background: var(--bg2); border-radius: 10px; padding: 8px; }
.friend-row { flex-wrap: wrap; }
.friend-row > div:nth-child(2) { min-width: 150px; }
.hearts { white-space: nowrap; }

/* ===== 📱 Rà soát giao diện (desktop + điện thoại) ===== */
.tscroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tscroll > table.tbl { margin-top: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-align: center; line-height: 1.25; }
.btn.block { display: flex; }
.card h2, .card h3 { overflow-wrap: anywhere; }
img, canvas, video { max-width: 100%; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.tabs2 button { transition: background .15s, border-color .15s, color .15s; }
.tabs2 button:hover:not(.on) { border-color: var(--gold2); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #2c3446; border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #3b4560; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 820px) {
  html { -webkit-text-size-adjust: 100%; }
  body { overscroll-behavior-y: none; }
  /* thanh trên gọn 1 hàng */
  .topbar { gap: 8px; padding: 6px 10px; padding-top: max(6px, env(safe-area-inset-top)); }
  .res { flex-wrap: nowrap; gap: 4px; min-width: 0; overflow: hidden; }
  .res .pill { padding: 3px 8px; font-size: .78em; gap: 3px; white-space: nowrap; }
  .res .pill.hide-sm { display: inline-flex; }
  .res .pill .muted { display: none; }
  .music-btn { width: 32px; height: 32px; font-size: 15px; }
  .me-mini .avatar { width: 34px; height: 34px; font-size: 21px; }
  .menu-btn { padding: 4px 2px; }
  .logo .k { font-size: 1.4rem; }
  /* tiêu đề trang */
  .page-title { margin-bottom: 12px; gap: 8px; }
  .page-title h1 { font-size: 1.35rem; line-height: 1.25; }
  .card { padding: 12px; }
  /* tab: 1 hàng cuộn ngang thay vì nhiều hàng */
  .tabs2:not(.wrap) { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -12px; margin-right: -12px; padding: 2px 12px 4px; scroll-padding: 12px; }
  .tabs2:not(.wrap)::-webkit-scrollbar { display: none; }
  .tabs2 button { flex-shrink: 0; white-space: nowrap; padding: 7px 12px; font-size: 13px; }
  /* bảng */
  .tbl th, .tbl td { padding: 7px 6px; }
  .tscroll .tbl th, .tscroll .tbl td { white-space: nowrap; }
  /* nút to & nút trong hàng */
  .btn.lg { padding: 12px 18px; font-size: 1.02em; }
  .btn.lg, .btn.block { white-space: normal; }
  input, select, textarea { font-size: 16px; } /* tránh iOS tự phóng to khi nhập */
  /* các nút nổi: nhỏ, không che nội dung */
  .chat-fab { right: 10px; bottom: calc(66px + env(safe-area-inset-bottom)); width: 44px; height: 44px; font-size: 20px; opacity: .95; }
  .tut-guide { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .tut-guide.min { left: 8px; }
  .tut-guide .tut-min { padding: 5px 10px; font-size: 12px; opacity: .92; }
  .main { padding-bottom: calc(120px + env(safe-area-inset-bottom)) !important; }
  .bnav { box-shadow: 0 -6px 18px rgba(0, 0, 0, .35); }
  .bnav a { transition: color .15s; }
  .bnav a.active span { transform: translateY(-1px) scale(1.08); filter: drop-shadow(0 0 6px rgba(242, 193, 78, .55)); }
}
@media (max-width: 380px) {
  .res .pill.hide-sm { display: none; }
  .bnav a { font-size: 10px; }
}

/* ===== 🔫 Chiến Trường Lớp Học ===== */
.br-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; margin-bottom: 12px; }
.br-stats > div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.br-stats span { font-size: 20px; } .br-stats b { font-size: 1.2em; color: var(--gold); } .br-stats small { color: var(--muted); font-size: 11px; }
.br-cur { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-color: var(--gold2); }
.br-list { display: flex; flex-direction: column; gap: 8px; }
.br-li { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); }
.br-li.mine { border-color: var(--gold2); box-shadow: 0 0 0 1px rgba(242, 193, 78, .25); }
.br-li-ic { font-size: 30px; width: 44px; text-align: center; }
.br-form .lbl { display: block; margin: 10px 0 4px; font-weight: 700; font-size: 13px; color: var(--muted); }
.br-form .inp { width: 100%; }
.br-kinds, .br-maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.br-kind, .br-map { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); color: inherit; cursor: pointer; transition: border-color .15s, transform .15s; }
.br-kind:hover, .br-map:hover { transform: translateY(-1px); border-color: var(--gold2); }
.br-kind.on, .br-map.on { border-color: var(--gold); background: linear-gradient(180deg, rgba(242, 193, 78, .16), rgba(242, 193, 78, .04)); }
.br-kind span, .br-map span { font-size: 26px; } .br-kind small, .br-map small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.br-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 10px; }
.br-grid .lbl { display: block; margin: 10px 0 4px; font-weight: 700; font-size: 13px; color: var(--muted); }
.br-grid .inp { width: 100%; }
.br-guide ul { margin: 4px 0 8px; padding-left: 18px; } .br-guide b { display: inline-block; margin-top: 6px; }
.br-code { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.br-code-v { font: 800 44px/1.1 var(--title-font, inherit); letter-spacing: 6px; color: var(--gold); text-shadow: 0 0 18px rgba(242, 193, 78, .35); }
.br-qr { background: #fff; padding: 6px; border-radius: 10px; line-height: 0; }
.br-set { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 10px; font-size: 14px; }
.br-team-h { margin: 10px 0 6px; padding: 4px 10px; border-left: 4px solid var(--tc); background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 22%, transparent), transparent); border-radius: 6px; font-weight: 800; }
.br-pls { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.br-pl { display: flex; align-items: center; gap: 6px; padding: 4px 8px 4px 4px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); }
.br-pl.me { border-color: var(--gold2); }
.br-pl canvas { flex-shrink: 0; }
.br-pl .inp.sm { padding: 3px 4px; font-size: 12px; width: auto; }
.br-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.br-pct { position: relative; height: 16px; min-width: 70px; background: rgba(255, 255, 255, .06); border-radius: 8px; overflow: hidden; }
.br-pct i { position: absolute; inset: 0 auto 0 0; border-radius: 8px; opacity: .75; }
.br-pct span { position: relative; font-size: 11px; font-weight: 700; padding-left: 6px; }
/* kết quả */
.br-tres { text-align: center; }
.br-tres-w { font: 800 26px var(--title-font, inherit); color: var(--tc); text-shadow: 0 0 20px color-mix(in srgb, var(--tc) 50%, transparent); margin-bottom: 8px; }
.br-tbar { display: flex; gap: 3px; border-radius: 10px; overflow: hidden; }
.br-tbar > div { min-width: 60px; padding: 6px 8px; background: color-mix(in srgb, var(--tc) 38%, #111); border-bottom: 3px solid var(--tc); font-size: 13px; text-align: center; white-space: nowrap; }
.br-tbar.sm > div { padding: 2px 6px; min-width: 34px; font-weight: 800; font-size: 13px; }
.br-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 10px; max-width: 620px; margin: 10px auto 16px; }
.br-pod { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.br-pod-n { font-size: 14px; } .br-pod-s { color: var(--gold); font-weight: 800; }
.br-pod-b { width: 100%; margin-top: 6px; border-radius: 10px 10px 0 0; font: 800 28px var(--title-font, inherit); color: rgba(0, 0, 0, .55); display: grid; place-items: center; }
.br-pod.p1 .br-pod-b { height: 110px; background: linear-gradient(180deg, #ffe17a, #d49a24); }
.br-pod.p2 .br-pod-b { height: 80px; background: linear-gradient(180deg, #e6eaf2, #9aa3b5); }
.br-pod.p3 .br-pod-b { height: 60px; background: linear-gradient(180deg, #f0b48a, #a8643a); }
.br-titles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-bottom: 14px; }
.br-title { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: linear-gradient(135deg, rgba(242, 193, 78, .12), var(--panel)); border: 1px solid rgba(242, 193, 78, .35); }
.br-title > span { font-size: 30px; }

/* ---- sân đấu (toàn màn hình) ---- */
body.br-on .bnav, body.br-on .chat-fab, body.br-on .tut-guide, body.br-on .dm-dock, body.br-on .chat2 { display: none !important; }
body.br-on { overflow: hidden; }
.br-stage { position: fixed; inset: 0; z-index: 120; background: #0b0d12; user-select: none; -webkit-user-select: none; touch-action: none; overflow: hidden; }
.br-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.br-stage > div, .br-stage > canvas.br-mini { position: absolute; }
.br-top { top: 8px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; z-index: 3; }
.br-timer { background: rgba(10, 12, 20, .78); border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; padding: 2px 16px 4px; text-align: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }
.br-timer span { display: block; font: 800 30px/1.1 var(--title-font, system-ui); font-variant-numeric: tabular-nums; color: #fff; }
.br-timer small { font-size: 11px; color: var(--muted); }
.br-timer.gold { border-color: var(--gold); box-shadow: 0 0 22px rgba(242, 193, 78, .45); } .br-timer.gold span { color: var(--gold); }
.br-timer.low span { color: #ff5a5a; animation: pulse 1s infinite; }
.br-meh { top: 10px; left: 58px; display: flex; gap: 8px; align-items: center; background: rgba(10, 12, 20, .72); border-radius: 12px; padding: 6px 12px; font-size: 14px; pointer-events: none; z-index: 3; }
.br-meh b { color: var(--gold); font-size: 17px; }
.br-side { top: 10px; right: 10px; width: 210px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; z-index: 3; }
.br-lb { background: rgba(10, 12, 20, .7); border-radius: 12px; padding: 6px 8px; font-size: 13px; }
.br-lb > div { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.br-lb > div span { width: 18px; color: var(--muted); text-align: right; font-size: 12px; }
.br-lb > div b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.br-lb > div em { font-style: normal; font-weight: 800; color: var(--gold); }
.br-lb > div.me b { color: #9effb8; }
.br-feed { display: flex; flex-direction: column; gap: 3px; align-items: flex-end; font-size: 12px; }
.br-feed > div { background: rgba(10, 12, 20, .65); border-radius: 8px; padding: 2px 8px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.br-feed > div.me { background: rgba(242, 193, 78, .25); }
.br-mini { left: 10px; bottom: 10px; width: 180px; height: 120px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .15); background: rgba(0, 0, 0, .3); z-index: 3; pointer-events: none; }
.br-note { top: 92px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; z-index: 4; width: min(92vw, 560px); }
.br-n { background: rgba(10, 12, 20, .82); border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; padding: 5px 14px; font-weight: 700; text-align: center; animation: brN 3.2s ease forwards; }
.br-n.gold { border-color: var(--gold); color: var(--gold); font-size: 1.15em; } .br-n.kill { color: #ffb0b0; } .br-n.item { color: #9fe6ff; }
@keyframes brN { 0% { opacity: 0; transform: translateY(-8px) scale(.95); } 10% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
.br-gun { bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; background: rgba(10, 12, 20, .75); border-radius: 12px; padding: 6px 14px; font-size: 13px; pointer-events: none; z-index: 3; white-space: nowrap; }
.br-gun b { font-size: 18px; color: var(--gold); }
.br-btns { top: 10px; left: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.br-btns button { width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .15); background: rgba(10, 12, 20, .75); color: #fff; font-size: 17px; cursor: pointer; }
.br-btns button:hover { border-color: var(--gold2); }
.br-emo { top: 10px; left: 58px; margin-top: 46px; display: grid; grid-template-columns: repeat(4, 44px); gap: 4px; background: rgba(10, 12, 20, .88); padding: 6px; border-radius: 12px; z-index: 6; }
.br-emo button { height: 40px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, .08); color: #fff; font-size: 20px; cursor: pointer; }
.br-board, .br-host { inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .45); z-index: 8; }
.br-board-in, .br-host-in { width: min(94vw, 640px); max-height: 86vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); }
.br-host-l { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; }
.br-host-l .row { gap: 6px; padding: 4px 6px; border-radius: 8px; background: var(--panel2); }
.br-host-l .inp.sm { padding: 3px 4px; font-size: 12px; width: auto; }
.br-over { inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .55); z-index: 7; font: 800 30px var(--title-font, inherit); text-align: center; pointer-events: none; }
.br-over small { display: block; font-size: 14px; color: var(--muted); font-weight: 400; }
.br-count { inset: 0; display: grid; place-items: center; z-index: 7; pointer-events: none; font: 900 120px var(--title-font, inherit); color: var(--gold); text-shadow: 0 0 40px rgba(242, 193, 78, .6), 0 6px 0 #8a5a10; animation: pop .35s; }
.br-rot { display: none; }
/* Ngục Cờ */
.br-jail { inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at center, rgba(30, 10, 40, .72), rgba(0, 0, 0, .85)); z-index: 9; padding: 10px; }
.br-jail-in { width: min(94vw, 460px); max-height: 96vh; overflow-y: auto; background: linear-gradient(180deg, #241c34, #171321); border: 1px solid rgba(180, 140, 255, .45); border-radius: 16px; padding: 12px; box-shadow: 0 0 40px rgba(140, 90, 255, .35); display: flex; flex-direction: column; gap: 6px; }
.br-jail-h { display: flex; flex-direction: column; align-items: center; text-align: center; } .br-jail-h b { font-size: 18px; color: #ffb0b0; } .br-jail-h span { color: #cdb8ff; font-weight: 700; }
.br-jail-p { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: 13px; }
.br-jail-p i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 12px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25); }
.br-jail-p i.ok { background: var(--green); color: #04210f; border-color: var(--green); }
.br-jail-b .board-wrap { max-width: min(88vw, 56vh, 420px) !important; margin: 0 auto; }
.br-jail-s { text-align: center; min-height: 40px; font-size: 14px; }
/* điều khiển cảm ứng */
.br-pad, .br-act { display: none; }
.br-stage.touch .br-pad { display: block; left: 18px; bottom: 22px; width: 132px; height: 132px; border-radius: 50%; background: rgba(255, 255, 255, .07); border: 2px solid rgba(255, 255, 255, .18); z-index: 5; touch-action: none; }
.br-knob { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; background: rgba(255, 255, 255, .28); border: 2px solid rgba(255, 255, 255, .45); pointer-events: none; }
.br-stage.touch .br-act { display: grid; right: 16px; bottom: 20px; grid-template-columns: 62px 82px; grid-template-rows: 62px 62px; gap: 10px; z-index: 5; }
.br-act button { border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); background: rgba(10, 12, 20, .55); color: #fff; font-size: 26px; position: relative; overflow: hidden; touch-action: none; }
.br-act button.on { background: rgba(242, 193, 78, .5); }
.br-act .br-fire { grid-row: span 2; grid-column: 2; align-self: center; width: 82px; height: 82px; font-size: 34px; border-color: rgba(255, 120, 80, .6); background: rgba(160, 40, 20, .45); }
.br-act #aM { grid-column: 1; grid-row: 1; } .br-act #aD { grid-column: 1; grid-row: 2; }
.br-act #aDc { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, .55); pointer-events: none; }
.br-stage.touch .br-mini { left: auto; right: 10px; bottom: auto; top: auto; display: none; }
.br-stage.touch .br-gun { bottom: auto; top: 64px; font-size: 12px; padding: 4px 10px; }
.br-stage.spec .br-side { width: 300px; font-size: 16px; } .br-stage.spec .br-lb { font-size: 16px; } .br-stage.spec .br-timer span { font-size: 44px; }
.br-stage.spec .br-mini, .br-stage.spec .br-gun { display: none; }
.br-stage.spec .br-meh { font-size: 18px; } .br-stage.spec .br-meh b { font-size: 22px; letter-spacing: 3px; }
@media (max-width: 820px), (max-height: 520px) {
  .br-side { width: 150px; } .br-lb { font-size: 11px; padding: 4px 6px; } .br-feed { font-size: 10px; }
  .br-timer span { font-size: 22px; } .br-timer { padding: 1px 10px 2px; }
  .br-meh { font-size: 12px; padding: 4px 8px; gap: 6px; } .br-meh b { font-size: 14px; }
  .br-btns button { width: 34px; height: 34px; font-size: 14px; border-radius: 10px; }
  .br-count { font-size: 80px; }
  .br-note { top: 70px; font-size: 13px; }
}
@media (orientation: portrait) and (max-width: 600px) {
  .br-stage.touch .br-rot { display: block; position: absolute; left: 50%; bottom: 170px; transform: translateX(-50%); width: max-content; max-width: 88vw; text-align: center; background: rgba(10, 12, 20, .7); padding: 4px 12px; border-radius: 10px; font-size: 12px; color: var(--muted); pointer-events: none; animation: brFade 6s forwards; }
}
@keyframes brFade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
@media (orientation: portrait) and (max-width: 600px) {
  .br-meh { top: 56px; left: 52px; }
  .br-top { top: 6px; }
  .br-side { top: 6px; width: 128px; }
  .br-stage.touch .br-gun { top: 90px; left: 52px; transform: none; }
  .br-note { top: 120px; }
}
.g2.br-fit { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* ===== Hiệu ứng giải đúng (Luyện tập / Giải nhanh) – lớp phủ không chặn thao tác ===== */
.fx-layer { position: absolute; inset: 0; z-index: 21; pointer-events: none; overflow: visible; --fx1: #ff8a3d; --fx2: #ffd23d; }
.fx-layer > * { position: absolute; pointer-events: none; }
.fx-glow { transform: translate(-50%, -50%); border-radius: 8px; background: radial-gradient(circle, var(--fx2) 0%, var(--fx1) 45%, transparent 72%); mix-blend-mode: screen; animation: fxGlow .65s ease-out forwards; }
@keyframes fxGlow { 0% { opacity: .95; transform: translate(-50%, -50%) scale(.6); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); } }
.fx-p { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: var(--fx1); box-shadow: 0 0 8px var(--fx1); animation: fxP .75s cubic-bezier(.2, .7, .3, 1) forwards; }
.fx-layer[data-style="snow"] .fx-p { border-radius: 2px; transform: rotate(45deg); }
@keyframes fxP { 0% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 14px)) scale(.3); } }
.fx-float { transform: translate(-50%, -50%); font-weight: 900; font-size: clamp(18px, 3.6vw, 28px); color: var(--fx2); text-shadow: 0 2px 0 rgba(0, 0, 0, .55), 0 0 12px var(--fx1); animation: fxUp .9s ease-out forwards; white-space: nowrap; }
@keyframes fxUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); } 20% { opacity: 1; transform: translate(-50%, -80%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -190%) scale(1); } }
.fx-fast { transform: translate(-50%, -50%); padding: 2px 8px; border-radius: 99px; background: rgba(20, 16, 40, .85); border: 1px solid var(--gold); color: var(--gold); font-weight: 800; font-size: 13px; white-space: nowrap; animation: fxUp 1s ease-out forwards; }
.fx-tier { left: 50%; top: 42%; transform: translate(-50%, -50%); font-size: clamp(30px, 7vw, 54px); font-weight: 900; color: var(--fx2); text-shadow: 0 3px 0 rgba(0, 0, 0, .5), 0 0 24px var(--fx1); white-space: nowrap; animation: fxTier 1.2s ease-out forwards; }
.fx-tier.t3 { background: linear-gradient(90deg, #ff5d8f, #ffd23d, #6cff9a, #5ec8ff, #c77dff); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .5)); }
@keyframes fxTier { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 70% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -70%) scale(1); } }
.fx-ring { width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 3px solid var(--fx2); animation: fxRing .7s ease-out forwards; }
@keyframes fxRing { 0% { opacity: 1; transform: scale(.3); } 100% { opacity: 0; transform: scale(7); } }
.fx-banner { left: 0; right: 0; top: 8%; text-align: center; padding: 8px 0; font-weight: 900; font-size: clamp(20px, 4.6vw, 34px); color: #fff; background: linear-gradient(90deg, transparent, rgba(242, 193, 78, .92) 20%, rgba(242, 193, 78, .92) 80%, transparent); text-shadow: 0 2px 0 #6b4a00; animation: fxBanner 1.8s ease forwards; }
@keyframes fxBanner { 0% { opacity: 0; transform: scaleY(0); } 12% { opacity: 1; transform: scaleY(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
.board-wrap.fx-ok .board { box-shadow: 0 0 0 3px var(--gold), 0 0 26px rgba(242, 193, 78, .55); transition: box-shadow .1s; }
.board-wrap .board { transition: box-shadow .5s; }
/* thanh combo + nhiệt + linh vật */
.fx-hud { display: flex; align-items: center; gap: 10px; max-width: 560px; margin: 0 auto 8px; min-height: 54px; --fx1: #ff8a3d; --fx2: #ffd23d; }
.fx-mascot { flex: none; }
.fx-combo { flex: none; min-width: 64px; text-align: center; line-height: 1; padding: 4px 8px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }
.fx-combo b { display: block; font-size: 22px; font-weight: 900; }
.fx-combo small { font-size: 11px; }
.fx-combo.on { color: var(--text); }
.fx-combo.t1 { color: var(--orange); border-color: var(--orange); box-shadow: 0 0 12px rgba(255, 138, 61, .35); }
.fx-combo.t2 { color: #ffe14f; border-color: #ffe14f; box-shadow: 0 0 14px rgba(255, 225, 79, .45); }
.fx-combo.t3 { color: #fff; border-color: transparent; background: linear-gradient(135deg, #ff5d8f, #ffb03d, #4fd18b, #3fb6ff, #a86bff); box-shadow: 0 0 18px rgba(168, 107, 255, .5); }
.fx-combo.pop { animation: fxPop .25s ease-out; }
@keyframes fxPop { 50% { transform: scale(1.22); } }
.fx-heat { flex: 1; height: 10px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); overflow: hidden; }
.fx-heat i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--fx1), var(--fx2)); transition: width .25s ease-out; }
.fx-heat.max i { background: linear-gradient(90deg, #ff5d8f, #ffd23d, #6cff9a, #5ec8ff, #c77dff, #ff5d8f); background-size: 200% 100%; animation: fxShine 1.2s linear infinite; }
@keyframes fxShine { to { background-position: -200% 0; } }
.fx-mult { flex: none; font-weight: 800; font-size: 13px; min-width: 52px; text-align: right; }
@media (prefers-reduced-motion: reduce) { .fx-heat.max i, .fx-combo.pop { animation: none; } }
/* Giải nhanh: tổng kết */
.storm-best { font-weight: 700; }
.storm-stats { justify-content: space-around; margin: 10px 0; flex-wrap: wrap; gap: 8px; }
.cmp { display: grid; gap: 6px; margin: 12px 0 4px; }
.cmp-r { display: grid; grid-template-columns: 72px 1fr 34px; align-items: center; gap: 8px; }
.cmp-r b { text-align: right; }
.cmp-b { height: 12px; border-radius: 99px; background: var(--panel2); overflow: hidden; }
.cmp-b i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--muted); transition: width 1s cubic-bezier(.2, .8, .3, 1); }
.cmp-b.now i { background: linear-gradient(90deg, var(--orange), var(--gold)); }
.chest-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.chest { text-align: center; padding: 8px 4px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); min-width: 0; }
.chest .ch-ic { font-size: 28px; line-height: 1.1; }
.chest.lock { opacity: .55; }
.chest.win .ch-rw { visibility: hidden; }
.chest.open { border-color: var(--gold); box-shadow: 0 0 14px rgba(242, 193, 78, .4); animation: fxPop .35s ease-out; }
.chest.open .ch-rw { visibility: visible; }
.chest .ch-rw .row { justify-content: center; gap: 2px; }
.chest .ch-rw .badge { font-size: 10px; padding: 1px 4px; }
/* thẻ luyện tập mỗi ngày */
.prac-card h3 { margin-top: 0; }
.prac-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.prac-streak { flex: none; text-align: center; padding: 6px 10px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); line-height: 1.1; }
.prac-streak b { display: block; font-size: 20px; }
.prac-streak small { font-size: 10px; color: var(--muted); }
.prac-streak.on { border-color: var(--orange); box-shadow: 0 0 10px rgba(255, 138, 61, .3); }
.prac-day { min-width: 0; }
.prac-q { display: grid; gap: 6px; }
.prac-qi, .prac-bag { display: flex; align-items: center; gap: 8px; }
.prac-qi .qi-ic, .prac-bag > span { flex: none; font-size: 20px; width: 26px; text-align: center; }
.qi-b { flex: 1; min-width: 0; }
.prac-qi.done .qi-ic { filter: drop-shadow(0 0 6px var(--gold)); }
.prac-bag { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.prac-bar { position: relative; height: 14px; border-radius: 99px; background: var(--panel2); overflow: hidden; margin-top: 2px; }
.prac-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #8be28b); border-radius: 99px; transition: width .4s; }
.prac-bar.gold i { background: linear-gradient(90deg, var(--orange), var(--gold)); }
.prac-bar span { position: absolute; inset: 0; font-size: 10px; line-height: 14px; text-align: center; font-weight: 700; text-shadow: 0 1px 2px #000; }
.prac-fx { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.fx-sw { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); font-size: 17px; cursor: pointer; padding: 0; }
.fx-sw.on { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(242, 193, 78, .4); }
.fx-sw.lock { opacity: .45; font-size: 13px; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; max-height: 60vh; overflow: auto; }
.book-it { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.book-it:hover { border-color: var(--gold); }
.book-it .bi-ic { font-size: 22px; flex: none; }
.book-it .bi-b { flex: 1; min-width: 0; }
.book-it.t0 { opacity: .8; }
.book-it.t3 { border-color: var(--gold); }
@media (max-width: 600px) {
  .fx-hud { gap: 6px; min-height: 46px; }
  .fx-combo { min-width: 52px; padding: 3px 6px; }
  .fx-combo b { font-size: 18px; }
  .chest .ch-ic { font-size: 22px; }
  .cmp-r { grid-template-columns: 62px 1fr 30px; }
}

/* =====================================================================
   GIAO DIỆN SÁNG  (html[data-theme="light"])
   Chỉ đổi khung, thẻ, chữ, bảng. Cảnh game vẽ canvas (phiêu lưu, Chiến
   Trường, màn phim...) vẫn giữ tông tối cho đẹp và dễ nhìn.
   ===================================================================== */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f1ea;
  --bg2: #ebe5d8;
  --panel: #ffffff;
  --panel2: #f4efe4;
  --line: #ddd3bf;
  --text: #1f2330;
  --muted: #687084;
  --gold: #9c6500;
  --gold2: #b8862c;
  --red: #cf2e3d;
  --green: #17895a;
  --blue: #1c6cc4;
  --purple: #8436c9;
  --orange: #c26a00;
  --mana: #2e5bd6;
  --shadow: 0 6px 18px rgba(80, 60, 25, .10);
  --frame: linear-gradient(160deg, #e2c27a 0%, #fff4d6 40%, #f3e3b8 60%, #c9a253 100%);
  --sheen: linear-gradient(180deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0) 38%);
}
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] body { background-image: radial-gradient(1200px 600px at 80% -10%, rgba(242, 193, 78, .16), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(180, 92, 255, .07), transparent 60%); }
/* Vùng cảnh game: giữ biến màu tối */
html[data-theme="light"] :is(.scene, .field, .act, .br-stage, .cine, .rare-drop, .soul, .fx-layer, .promo, .big-mon-wrap, .ad-stage) {
  color-scheme: dark;
  --bg: #0f1117; --bg2: #161a23; --panel: #1c212c; --panel2: #232937; --line: #2e3546; --text: #e6e8ee; --muted: #8f97aa;
  --gold: #f2c14e; --gold2: #c9962c; --red: #ef4f5f; --green: #4cc38a; --blue: #4aa3ff; --purple: #b45cff; --orange: #ffae00; --mana: #4a7dff;
  --shadow: 0 8px 30px rgba(0, 0, 0, .35);
  --frame: linear-gradient(160deg, #3b4258 0%, #232838 40%, #1a1e2a 60%, #3a3346 100%);
  --sheen: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, 0) 38%);
  color: var(--text);
}
/* khung chính */
html[data-theme="light"] .topbar { background: rgba(255, 253, 248, .94); border-bottom-color: var(--line); }
html[data-theme="light"] .sidebar { background: rgba(255, 255, 255, .55); }
html[data-theme="light"] .bnav { background: rgba(255, 253, 248, .97); }
html[data-theme="light"] .nav a.active { background: linear-gradient(90deg, rgba(242, 193, 78, .32), transparent); }
html[data-theme="light"] .page-title h1 { background: linear-gradient(180deg, #d99a1e 0%, #a86a00 60%, #7a4a00 100%); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .8)); }
html[data-theme="light"] .card { box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .9); }
html[data-theme="light"] .card > h3:first-child { border-bottom-color: rgba(0, 0, 0, .07); }
html[data-theme="light"] .card > h3:first-child::after { background: linear-gradient(90deg, rgba(190, 135, 30, .45), transparent); }
html[data-theme="light"] :is(.modal, .card.frame) { box-shadow: 0 18px 50px rgba(60, 40, 10, .25), inset 0 0 0 1px rgba(255, 255, 255, .6); }
html[data-theme="light"] .modal-bg { background: rgba(40, 32, 20, .45); }
/* nút */
html[data-theme="light"] .btn { box-shadow: 0 2px 0 rgba(120, 95, 50, .28), inset 0 1px 0 rgba(255, 255, 255, .8); }
html[data-theme="light"] .btn:hover { border-color: #c9b88f; background: #ece4d2; }
html[data-theme="light"] .btn:active:not(:disabled) { box-shadow: 0 1px 0 rgba(120, 95, 50, .28); }
html[data-theme="light"] .btn.primary { color: #2a1a00; box-shadow: 0 3px 0 #a87a22, inset 0 1px 0 rgba(255, 255, 255, .5); }
html[data-theme="light"] .btn.primary:hover { background: linear-gradient(180deg, #f9d672, #d9a535); }
html[data-theme="light"] .btn.green:hover { background: linear-gradient(180deg, #67dea5, #35a873); }
html[data-theme="light"] .btn.blue:hover { background: linear-gradient(180deg, #72baff, #3a8ae0); }
html[data-theme="light"] :is(.tabs2 button.on, .chip.on) { background: linear-gradient(180deg, #f7cf63, #e0aa38); border-color: #d3a03a; color: #2a1a00; box-shadow: 0 2px 0 #b38328; }
html[data-theme="light"] .switch input:checked + span { background: #e0aa38; }
html[data-theme="light"] .music-btn { box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
/* ô nhập, bảng, nhãn, thanh */
html[data-theme="light"] :is(.inp, input, select, textarea) { background-color: #fffdf8; }
html[data-theme="light"] .tag { background: #ece5d6; }
html[data-theme="light"] .tbl tr:hover td { background: rgba(0, 0, 0, .025); }
html[data-theme="light"] .tbl tr.me td { background: rgba(242, 193, 78, .22); }
html[data-theme="light"] .badge.gold { background: rgba(242, 193, 78, .25); border-color: rgba(190, 135, 30, .5); }
html[data-theme="light"] .badge.blue { color: #1c5fae; }
html[data-theme="light"] .bar { background: #ddd5c5; border-color: #c9bda5; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .15); }
html[data-theme="light"] .bar .mark { background: rgba(0, 0, 0, .3); }
html[data-theme="light"] .quick:hover { box-shadow: 0 6px 16px rgba(80, 60, 25, .15), 0 0 0 1px rgba(190, 135, 30, .35); }
html[data-theme="light"] .quick span { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .18)); }
html[data-theme="light"] .toast.achievement, html[data-theme="light"] .toast.level { background: linear-gradient(90deg, rgba(255, 174, 0, .22), transparent) var(--panel2); }
html[data-theme="light"] .toast { box-shadow: 0 8px 24px rgba(60, 40, 10, .18); }
html[data-theme="light"] .ch-tip { background: #fffdf8; box-shadow: 0 4px 14px rgba(0, 0, 0, .15); }
html[data-theme="light"] .an-eval { background: #c9c2b3; }
html[data-theme="light"] .tut-guide { background: linear-gradient(180deg, #fffaf0, #f6eedc); box-shadow: 0 10px 30px rgba(60, 40, 10, .2); }
html[data-theme="light"] .tut-guide .tut-min { background: #fffaf0; }
html[data-theme="light"] .dmm.mine { background: linear-gradient(180deg, #d8e7ff, #c4dafc); }
html[data-theme="light"] .gun-ev { background: linear-gradient(90deg, #fff0dd, #ffe6c7) !important; color: #7a3d00; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: #cfc4ad; background-clip: padding-box; }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background-color: #b9ac90; }
html[data-theme="light"] .board-wrap .board { box-shadow: 0 6px 20px rgba(60, 40, 10, .22); }
html[data-theme="light"] .fx-combo.t2 { color: #9a7400; border-color: #e0b400; }
html[data-theme="light"] .prac-bar span { color: #fff; }
/* nút giao diện trên thanh trên cùng: ẩn trên điện thoại (đổi trong Cài đặt) */
@media (max-width: 600px) { .theme-btn { display: none; } }
/* chọn giao diện trong Cài đặt */
.theme-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.theme-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel2); cursor: pointer; color: var(--text); }
.theme-opt.on { border-color: var(--gold2); box-shadow: 0 0 0 2px rgba(242, 193, 78, .35); }
.theme-opt b { font-size: 13px; }
.th-prev { display: grid; grid-template-columns: 1fr 2fr; grid-template-rows: 1fr 1fr; gap: 3px; width: 100%; height: 44px; padding: 4px; border-radius: 8px; }
.th-prev i { border-radius: 4px; }
.th-prev i:first-child { grid-row: span 2; }
.th-prev.dark { background: #0f1117; } .th-prev.dark i { background: #232937; } .th-prev.dark i:nth-child(2) { background: #f2c14e; }
.th-prev.light { background: #f4f1ea; } .th-prev.light i { background: #fff; border: 1px solid #ddd3bf; } .th-prev.light i:nth-child(2) { background: #e0aa38; }
.th-prev.auto { background: linear-gradient(135deg, #f4f1ea 50%, #0f1117 50%); } .th-prev.auto i { background: rgba(128, 128, 128, .45); } .th-prev.auto i:nth-child(2) { background: #e0aa38; }
/* sáng: chữ màu sáng viết cứng → tối lại cho dễ đọc */
html[data-theme="light"] .item .nm { color: color-mix(in srgb, var(--rc) 60%, #1f2330); }
html[data-theme="light"] .tut-text { color: #4a5060; }
html[data-theme="light"] .pass-col.next .t { color: var(--text); }
html[data-theme="light"] .an-score.neg { color: #555b66; }
html[data-theme="light"] .team-h.t2 { color: #b0283a; }
html[data-theme="light"] .coop-barrier { color: #7a3fc9; }
html[data-theme="light"] .gw-cell { background: var(--panel2); color: var(--text); }
html[data-theme="light"] .gw-v { color: #9c6500; }
html[data-theme="light"] .item .gunl { color: #9a5a00; }
html[data-theme="light"] .item.mythic { background: linear-gradient(135deg, rgba(255, 64, 64, .12), var(--panel2) 60%); }
/* chọn ngôn ngữ */
.lang-pick { display: inline-flex; gap: 4px; padding: 3px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); margin-bottom: 8px; }
.lang-pick button { border: 0; background: none; padding: 5px 12px; border-radius: 99px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.lang-pick button.on { background: linear-gradient(180deg, #f7cf63, #e0aa38); color: #2a1a00; }
.hero .lang-pick { position: absolute; top: 12px; right: 12px; margin: 0; z-index: 2; }
.hero { position: relative; }

/* ---- thanh điều hướng chia nhóm ---- */
.nav .sec { display: flex; align-items: center; gap: 6px; margin: 10px 4px 2px; padding: 6px 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; border-top: 1px solid var(--line); cursor: pointer; user-select: none; border-radius: 6px; }
.nav .sec:hover { color: var(--text); background: var(--panel2); }
.nav .sec span:first-child { flex: 1; }
.nav .sec .car { transition: transform .15s; font-size: 11px; }
.nav .sec.fold .car { transform: rotate(-90deg); }
.nav .sec .dot { position: static; min-width: 16px; height: 16px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }

/* ---- trang chủ: Hôm nay nên làm ---- */
.today-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.today-btn { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; background: linear-gradient(135deg, var(--panel2), var(--panel)); border: 1px solid var(--line); color: var(--text); transition: transform .12s, border-color .12s; }
.today-btn:hover { transform: translateY(-2px); border-color: var(--gold); }
.today-btn .ic { grid-row: span 2; font-size: 30px; }
.today-btn b { font-size: 1.05em; }
.today-btn small { color: var(--muted); }
.today-btn.hot { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(242, 193, 78, .35) inset; }
@media (max-width: 760px) { .today-row { grid-template-columns: 1fr; gap: 8px; } .today-btn { padding: 10px 14px; } .today-btn .ic { font-size: 24px; } }

/* 💰 Kinh tế (admin) – biểu đồ đường */
:root { --series-1: #338ced; }
[data-theme="light"] { --series-1: #257de0; }
.ec-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 10px; }
.ec-tile { margin: 0; padding: 10px 12px; }
.ec-big { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ec-card { margin-bottom: 10px; }
.ec-wrap { position: relative; margin-top: 6px; }
.ec-svg { display: block; overflow: visible; touch-action: pan-y; }
.ec-grid { stroke: var(--line); stroke-width: 1; }
.ec-ax { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.ec-line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ec-dot, .ec-hover { fill: var(--series-1); stroke: var(--panel); stroke-width: 2; }
.ec-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.ec-tip { position: absolute; top: 4px; pointer-events: none; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 12px; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.ec-g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 760px) { .ec-g2 { grid-template-columns: 1fr; } }
.ec-g2 > *, .ec-wrap { min-width: 0; }
.ec-wrap { overflow: hidden; }

/* 🧭 Lộ trình học */
.pth-head { margin-bottom: 12px; }
.pth-bar { height: 10px; border-radius: 6px; background: var(--panel2); overflow: hidden; margin: 6px 0; }
.pth-bar i { display: block; height: 100%; background: linear-gradient(90deg, #f0b84a, #e08a1e); border-radius: 6px; }
.pth-list { display: flex; flex-direction: column; gap: 10px; position: relative; }
.pth-ch { display: flex; gap: 14px; align-items: flex-start; margin: 0; }
.pth-ch.locked { opacity: .55; }
.pth-ch.cur { border-color: #f0b84a; box-shadow: 0 0 0 1px #f0b84a inset; }
.pth-ch.done .pth-ic { background: rgba(63, 191, 98, .18); }
.pth-ic { font-size: 30px; width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--panel2); }
.pth-body { flex: 1; min-width: 0; }
.pth-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.pth-step.ok { border-color: rgba(63, 191, 98, .6); }
.pth-st { font-size: 11px; letter-spacing: -2px; margin-left: 2px; }
.pth-off { filter: grayscale(1); opacity: .35; }
.pth-dotrow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pth-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--panel2); color: var(--muted); border: 2px solid transparent; }
.pth-dot.ok { background: rgba(63, 191, 98, .2); color: #2e9e4f; }
.pth-dot.bad { background: rgba(235, 70, 71, .18); color: #d33; }
.pth-dot.now { border-color: #f0b84a; color: var(--text); }
@media (max-width: 600px) { .pth-ic { width: 40px; height: 40px; font-size: 22px; } .pth-ch { gap: 10px; } }

/* Ô chọn/nút radio: to hơn, cùng màu chủ đạo; trên màn hình cảm ứng thêm vùng chạm */
input[type=checkbox], input[type=radio] { accent-color: var(--gold); width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; }
@media (pointer: coarse) { input[type=checkbox], input[type=radio] { width: 20px; height: 20px; } }
.keys-tbl td:last-child { text-align: right; }
@media (max-width: 600px) { .keys-tbl .kbd-btn { min-width: 46px; padding: 6px 6px; font-size: 12px; } .keys-tbl td:first-child { padding-right: 4px; } }
.tscroll .keys-tbl td:first-child { white-space: normal; }
/* Thông báo nổi trên điện thoại: gọn, tối đa 2 dòng, chạm để tắt */
.toast { cursor: pointer; }
@media (max-width: 820px) {
  #toasts { top: calc(50px + env(safe-area-inset-top)); left: 10px; right: 10px; align-items: center; gap: 6px; }
  .toast { font-size: 13px; line-height: 1.35; padding: 7px 12px; max-width: min(420px, 100%); }
}
@media (max-width: 480px) { .res .pill .emax { display: none; } }
