@font-face { font-family: 'HYWenHei'; src: url('/game/font/HYWenHei-75W.ttf') format('truetype'); font-display: swap; }
:root {
  --blue: #3d8bff; --blue-d: #16325f; --red: #ff4d4d; --red-d: #5f1616; --gold: #f2c86b; --ink: #11151c;
  --panel: rgba(16, 20, 28, .92); --line: rgba(242, 200, 107, .35); --txt: #eef1f6; --mut: #9aa4b5; --ok: #48c774;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0b0e13; color: var(--txt);
  font-family: 'HYWenHei', 'Segoe UI', Roboto, Arial, sans-serif; font-size: 14px; }
a { color: var(--gold); }
button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: #222a38; color: var(--txt);
  padding: 6px 12px; border-radius: 6px; }
button:hover:not(:disabled) { border-color: var(--gold); }
button:disabled { opacity: .45; cursor: default; }
button.pri { background: linear-gradient(#e8b54d, #b9822a); color: #241503; border-color: #ffd98a; font-weight: 700; }
button.dan { background: #6b2121; border-color: #d55; }
button.sm { padding: 3px 8px; font-size: 12px; }
input, select, textarea { font: inherit; background: #151b26; color: var(--txt); border: 1px solid #36405a;
  border-radius: 6px; padding: 6px 8px; }
textarea { width: 100%; }
.loading { padding: 40px; text-align: center; color: var(--mut); }
.hidden { display: none !important; }
.mut { color: var(--mut); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }

/* ---------------- trang chu / bang dau ---------------- */
.page { max-width: 1280px; margin: 0 auto; padding: 16px; }
.hdr { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(61, 139, 255, .15), transparent 40%, transparent 60%, rgba(255, 77, 77, .15)); }
.hdr h1 { margin: 0; font-size: 22px; color: var(--gold); letter-spacing: .5px; }
.hdr .who { margin-left: auto; color: var(--mut); }
.tabs { display: flex; gap: 6px; margin: 14px 0; }
.tabs button.on { background: var(--gold); color: #241503; }
.card { background: var(--panel); border: 1px solid #2b3447; border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.card h3 { margin: 0 0 10px; color: var(--gold); font-size: 16px; }
table.tb { width: 100%; border-collapse: collapse; }
table.tb td, table.tb th { padding: 6px 8px; border-bottom: 1px solid #252d3d; text-align: left; vertical-align: middle; }
table.tb th { color: var(--mut); font-weight: 400; font-size: 12px; }
.linkbox { font-family: Consolas, monospace; font-size: 12px; background: #0f141c; padding: 3px 6px; border-radius: 4px;
  max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }

.bracket { display: flex; gap: 22px; overflow-x: auto; padding: 8px 0 16px; }
.bcol { display: flex; flex-direction: column; min-width: 220px; }
.bcol h4 { margin: 0 0 8px; text-align: center; color: var(--gold); font-weight: 400; }
.bbody { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 10px; }
.ser { background: #151b26; border: 1px solid #2b3447; border-radius: 8px; padding: 6px 8px; position: relative; }
.ser.live { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.ser.mine { border-color: #7fb3ff; }
.ser .pl { display: flex; justify-content: space-between; padding: 3px 2px; gap: 8px; }
.ser .pl.win { color: var(--gold); font-weight: 700; }
.ser .pl.lose { color: var(--mut); text-decoration: line-through; }
.ser .meta { font-size: 11px; color: var(--mut); display: flex; justify-content: space-between; margin-top: 3px; }
.ser .acts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }

/* ---------------- phong cam/chon (khung thiet ke 1400x640) ---------------- */
.stage-wrap { position: fixed; inset: 0; background: #06080c; overflow: hidden; }
.stage { position: absolute; left: 0; top: 0; width: 1400px; height: 640px; transform-origin: 0 0; overflow: hidden;
  background: radial-gradient(ellipse at 50% 55%, #3a3f48 0%, #1d2129 55%, #0d0f14 100%); }
.stage.hasbg { background-size: cover; background-position: center; }
.topbar { position: absolute; left: 0; right: 0; top: 0; height: 64px; display: flex; }
.topbar .half { flex: 1; display: flex; align-items: center; gap: 12px; padding: 0 22px; font-size: 18px; }
.topbar .half.blue { background: linear-gradient(90deg, rgba(30, 80, 170, .95), rgba(30, 80, 170, .25)); }
.topbar .half.red { background: linear-gradient(270deg, rgba(170, 30, 30, .95), rgba(170, 30, 30, .25)); justify-content: flex-end; }
.topbar .nm { font-weight: 700; text-shadow: 0 2px 2px #000; }
.topbar .sv { font-size: 12px; color: #d6dcea; }
.topbar .tag { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: rgba(0, 0, 0, .35); }
.center-top { position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: 360px; height: 84px;
  text-align: center; background: linear-gradient(#141821, rgba(20, 24, 33, .85)); border: 1px solid var(--line);
  border-top: none; border-radius: 0 0 22px 22px; padding-top: 8px; z-index: 5; }
.center-top .ph { color: var(--gold); font-size: 17px; }
.center-top .clock { font-size: 34px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.center-top .clock.blue { color: #8cc0ff; } .center-top .clock.red { color: #ff9b9b; }
.center-top .clock.low { animation: blink .6s infinite alternate; }
@keyframes blink { to { opacity: .35; } }
.paused-banner { position: absolute; left: 50%; top: 270px; transform: translateX(-50%); z-index: 30; padding: 16px 40px;
  background: rgba(0, 0, 0, .8); border: 2px solid var(--gold); color: var(--gold); font-size: 30px; border-radius: 12px; }
.series-info { position: absolute; left: 50%; top: 88px; transform: translateX(-50%); font-size: 12px; color: var(--mut);
  text-align: center; z-index: 4; white-space: nowrap; }
.bans { position: absolute; top: 72px; display: flex; gap: 4px; align-items: center; font-size: 12px; color: #ffb3b3; z-index: 4; }
.bans.blue { left: 130px; } .bans.red { right: 130px; flex-direction: row-reverse; }
.bans .bi { width: 34px; height: 34px; border-radius: 50%; position: relative; border: 1px solid #a33; background: #222 center/cover; }
.bans .bi::after { content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: linear-gradient(45deg, transparent 45%, #e33 45%, #e33 55%, transparent 55%); }

.slot { position: absolute; width: 150px; height: 170px; transform: translate(-50%, -100%); cursor: default; }
.slot .base { position: absolute; left: 15px; bottom: 0; width: 120px; height: 46px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(242, 200, 107, .35), rgba(242, 200, 107, .08) 60%, transparent 70%);
  border: 2px solid rgba(242, 200, 107, .45); }
.slot.blue .base { border-color: rgba(120, 170, 255, .6); }
.slot.red .base { border-color: rgba(255, 120, 120, .6); }
.slot .num { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); font-size: 16px; color: rgba(255, 255, 255, .55);
  font-weight: 700; }
.slot .plus { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); width: 44px; height: 44px; border-radius: 50%;
  background: radial-gradient(#5be37a, #1d8a3a); color: #fff; font-size: 34px; line-height: 40px; text-align: center;
  box-shadow: 0 0 14px #5be37a; animation: pulse 1s infinite alternate; }
@keyframes pulse { to { box-shadow: 0 0 4px #5be37a; transform: translateX(-50%) scale(.92); } }
.slot.can { cursor: pointer; }
.slot .art { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); height: 150px; max-width: 170px;
  object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .7)); pointer-events: none; }
.slot.red .art { transform: translateX(-50%) scaleX(-1); }
.slot .ico { position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); width: 86px; height: 86px; border-radius: 50%;
  border: 2px solid var(--gold); background: #222 center/cover; }
.slot .label { position: absolute; left: 50%; bottom: -18px; transform: translateX(-50%); white-space: nowrap; font-size: 13px;
  padding: 1px 8px; border-radius: 9px; background: rgba(0, 0, 0, .65); }
.slot .label.trans { color: #e5b3ff; }
.slot.pending .art, .slot.pending .ico { opacity: .75; animation: blink .8s infinite alternate; }
.slot .lockmk { position: absolute; right: 18px; bottom: 6px; font-size: 13px; }
.slot.sel .base { border-color: #fff; box-shadow: 0 0 16px #fff; }
.slot .campbtn { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); font-size: 11px; padding: 1px 6px; z-index: 3; }
.slot .x { position: absolute; right: 8px; top: 8px; width: 22px; height: 22px; border-radius: 50%; padding: 0; font-size: 12px;
  line-height: 20px; background: #6b2121; z-index: 3; }

.petcol { position: absolute; top: 140px; width: 96px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.petcol.blue { left: 14px; } .petcol.red { right: 14px; }
.pet { width: 76px; height: 76px; border-radius: 50%; border: 2px solid #8a7444; background: #1b1f27 center/cover; position: relative;
  cursor: default; }
.pet.can { cursor: pointer; }
.pet .pl { position: absolute; left: -6px; top: -6px; width: 26px; height: 26px; border-radius: 50%; background: #6e4c18;
  border: 1px solid var(--gold); font-size: 13px; text-align: center; line-height: 24px; color: #fff; }
.pet .pn { position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%); font-size: 11px; white-space: nowrap; color: #ddd; }
.pet.soul { border-radius: 12px; border-color: #7fa6d8; }

.center { position: absolute; left: 50%; top: 220px; transform: translateX(-50%); width: 260px; text-align: center; z-index: 4; }
.center .msg { font-size: 18px; color: var(--gold); text-shadow: 0 2px 3px #000; min-height: 50px; }
.center .lockbtn { margin-top: 160px; font-size: 20px; padding: 10px 36px; border-radius: 30px; }
.bottombar { position: absolute; left: 0; right: 0; bottom: 0; height: 74px; display: flex; gap: 8px; align-items: center;
  padding: 0 14px; background: linear-gradient(rgba(10, 12, 16, 0), rgba(10, 12, 16, .95) 40%); z-index: 6; }
.setcard { width: 150px; height: 56px; border: 1px solid #5d5032; border-radius: 8px; background: #1c1a15; padding: 4px 8px;
  font-size: 12px; cursor: pointer; overflow: hidden; }
.setcard .t { color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.setcard .h { color: #ddd; }
.setcard.empty { opacity: .35; cursor: default; }
.refbar { position: absolute; left: 0; right: 0; bottom: 0; height: 74px; display: flex; gap: 8px; align-items: center;
  padding: 0 14px; background: rgba(8, 10, 14, .95); border-top: 1px solid var(--line); z-index: 7; flex-wrap: wrap; }
.logbox { position: absolute; right: 120px; top: 120px; width: 0; }

/* cam */
.banpanel { position: absolute; left: 50%; top: 110px; transform: translateX(-50%); width: 860px; height: 440px; z-index: 10;
  background: rgba(14, 17, 23, .96); border: 1px solid var(--gold); border-radius: 14px; padding: 12px 16px; }
.banpanel h2 { margin: 0 0 6px; text-align: center; color: var(--gold); font-size: 20px; }

/* popup chon tuong */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 100; display: flex; align-items: center; justify-content: center; }
.mbox { background: #121720; border: 1px solid var(--gold); border-radius: 14px; width: min(900px, 96vw); max-height: 92vh;
  display: flex; flex-direction: column; }
.mbox.wide { width: min(1200px, 98vw); }
.mhead { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid #2b3447; gap: 10px; }
.mhead h3 { margin: 0; color: var(--gold); font-size: 18px; flex: 1; }
.mbody { padding: 12px 14px; overflow: auto; }
.mfoot { padding: 10px 14px; border-top: 1px solid #2b3447; display: flex; gap: 8px; align-items: center; }
.hgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.hgrid.sm { grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.hcell { position: relative; text-align: center; cursor: pointer; font-size: 12px; }
.hcell .im { width: 84px; height: 84px; margin: 0 auto; border-radius: 50%; border: 2px solid #5d6b88; background: #222 center/cover; }
.hgrid.sm .hcell .im { width: 60px; height: 60px; border-radius: 10px; }
.hcell.c6 .im, .hcell.c7 .im { border-color: #ff6b4a; }
.hcell.c5 .im { border-color: #ffa63a; }
.hcell .nm { margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hcell.off { cursor: default; }
.hcell.off .im { filter: grayscale(1) brightness(.5); }
.hcell .st { position: absolute; left: 50%; top: 30px; transform: translateX(-50%); font-size: 11px; padding: 1px 6px; border-radius: 8px;
  background: rgba(0, 0, 0, .8); white-space: nowrap; }
.hcell .st.ban { color: #ff7d7d; }
.hcell.on .im { border-color: #fff; box-shadow: 0 0 12px var(--gold); }
.hcell .ck { position: absolute; right: 6px; top: 0; background: var(--gold); color: #241503; border-radius: 50%; width: 20px; height: 20px;
  font-weight: 700; line-height: 20px; }
.ftab { display: flex; gap: 4px; flex-wrap: wrap; }
.ftab button.on { background: var(--gold); color: #241503; }

/* bo thiet lap */
.setsum { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.setsum img, .ic { width: 34px; height: 34px; border-radius: 6px; background: #222 center/cover; border: 1px solid #444; display: inline-block; }
.ic.sm { width: 26px; height: 26px; }
.sect { margin: 10px 0 4px; color: var(--gold); }
.warn { color: #ffb36b; font-size: 12px; }
.err { color: #ff7d7d; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 10px; background: #263046; font-size: 12px; }
.chip.blue { background: #1f3e75; } .chip.red { background: #6e2323; } .chip.gold { background: #6e5420; }

/* phat lai */
.rp-unit { position: absolute; width: 110px; transform: translate(-50%, -100%); text-align: center; transition: opacity .3s; }
.rp-unit .art { height: 120px; max-width: 140px; object-fit: contain; filter: drop-shadow(0 4px 4px #000); }
.rp-unit.red .art { transform: scaleX(-1); }
.rp-unit .ico { width: 70px; height: 70px; border-radius: 50%; margin: 0 auto 6px; border: 2px solid var(--gold); background: #222 center/cover; }
.rp-unit .hp { height: 8px; background: #300; border: 1px solid #000; border-radius: 4px; overflow: hidden; margin: 2px 8px; }
.rp-unit .hp i { display: block; height: 100%; background: linear-gradient(#7dff8a, #2fa144); transition: width .3s; }
.rp-unit.red .hp i { background: linear-gradient(#ff9a7d, #c23a2a); }
.rp-unit .ag { font-size: 11px; color: #ffd36b; }
.rp-unit .nm { font-size: 12px; white-space: nowrap; text-shadow: 0 1px 2px #000; }
.rp-unit.dead { opacity: .25; filter: grayscale(1); }
.rp-unit.act .art, .rp-unit.act .ico { filter: drop-shadow(0 0 12px #fff); }
.rp-unit.tgt .nm { color: #ff9999; }
.float { position: absolute; font-weight: 700; font-size: 22px; pointer-events: none; text-shadow: 0 2px 2px #000; animation: fl 1s forwards; z-index: 20; }
.float.dmg { color: #ff6b5b; } .float.crit { color: #ffcc33; font-size: 28px; } .float.heal { color: #6bff86; } .float.miss { color: #ccc; font-size: 16px; }
@keyframes fl { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -50px); } }
.rp-cast { position: absolute; left: 50%; top: 110px; transform: translateX(-50%); font-size: 22px; color: var(--gold);
  text-shadow: 0 2px 3px #000; z-index: 10; white-space: nowrap; }
.rp-log { position: absolute; right: 0; top: 64px; bottom: 74px; width: 0; }
.result-banner { position: absolute; left: 50%; top: 240px; transform: translateX(-50%); z-index: 40; padding: 18px 50px; font-size: 34px;
  border-radius: 14px; background: rgba(0, 0, 0, .85); border: 2px solid var(--gold); color: var(--gold); text-align: center; }
.result-banner small { display: block; font-size: 15px; color: #ddd; margin-top: 6px; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #3a1c1c; border: 1px solid #d55; color: #fff;
  padding: 10px 18px; border-radius: 10px; z-index: 200; max-width: 80vw; }
.toast.ok { background: #1c3a24; border-color: #5c5; }
.loglist { font-size: 12px; max-height: 300px; overflow: auto; }
.loglist div { padding: 2px 0; border-bottom: 1px solid #1e2533; }

/* phòng cấm/chọn dựng bằng layout game (static/game) */
.room-host { position: fixed; inset: 0; background: #000; overflow: hidden; }

