:root { --k: 1; --ui: 'Montserrat', 'Segoe UI', Arial, sans-serif; --disp: 'Forum', 'Georgia', serif;
  --panel: rgba(14, 22, 44, .8); --panel2: rgba(16, 24, 48, .96); --edge: rgba(222, 182, 98, .42); --gold: #f2c45a; --gold2: #c8902a; --marble: #f3efe7; --ink: #0e1630;
  --c1: #9aa3ad; --c2: #3fbf5f; --c3: #3a8cff; --c4: #b45cff; --c5: #ffb02e; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #8cc4f0; font-family: var(--ui); color: #fff; user-select: none; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; transition: filter .3s; }
#bars-layer, #fx-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
#veil { position: fixed; inset: 0; pointer-events: none; z-index: 3; background: rgba(255,255,255,0); }
button { font-family: var(--ui); }
.ti { width: 1.1em; height: 1.1em; vertical-align: -0.2em; fill: currentColor; flex: none; }
.ci { display: inline-block; width: .95em; height: .95em; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff6b0, #ffd23f 45%, #d69a12); box-shadow: inset 0 0 0 2px rgba(150,90,0,.55); vertical-align: -0.12em; margin-right: .25em; }
body[data-phase="title"] #top, body[data-phase="title"] #traits, body[data-phase="title"] #itembench, body[data-phase="title"] #players, body[data-phase="title"] #shopwrap, body[data-phase="title"] #btn-ready { display: none; }
.panel-edge { box-shadow: inset 0 0 0 1px var(--edge), 0 4px 18px rgba(4, 8, 24, .35); }

/* ---------- unit bars ---------- */
.ubar { position: absolute; left: 0; top: 0; width: 76px; display: none; will-change: transform; text-align: center; }
.ustars { font-size: 13px; line-height: 13px; letter-spacing: -1px; -webkit-text-stroke: 1px rgba(0,0,0,.7); paint-order: stroke fill; margin-bottom: 2px; }
.ustars.s1 { color: #e8b47a; } .ustars.s2 { color: #e6eef8; } .ustars.s3 { color: #ffd23f; font-size: 15px; text-shadow: 0 0 6px #ffb02e; }
.uhp { position: relative; height: 8px; background: rgba(10,12,24,.85); border-radius: 2px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,.6); }
.uhp .ufill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: linear-gradient(#5ff08a, #2fb85a); }
.foe .uhp .ufill { background: linear-gradient(#ff7060, #d0302a); }
.uhp .ush { position: absolute; top: 0; bottom: 0; background: #f2f2f2; }
.uhp::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 9px, rgba(0,0,0,.45) 9px 10px); }
.umana { height: 4px; margin-top: 1px; background: rgba(10,12,24,.85); border-radius: 2px; overflow: hidden; }
.umana i { display: block; height: 100%; width: 0; background: #4fc3f7; }
.uits { margin-top: 1px; font-size: 13px; line-height: 15px; }
.uits span { display: inline-block; background: rgba(10,14,30,.65); border-radius: 4px; padding: 0 1px; margin: 0 1px; }
.ubar.plan .uhp, .ubar.plan .umana { display: none; }

/* ---------- floating numbers ---------- */
.dmg { position: absolute; left: 0; top: 0; font-weight: 900; font-size: 20px; color: #fff; -webkit-text-stroke: 1.3px #10142a; paint-order: stroke fill; white-space: nowrap; will-change: transform; }
.dmg.mag { color: #7fd8ff; } .dmg.tru { color: #ffb05a; }
.dmg.crit { font-size: 28px; color: #ffd23f; }
.dmg.huge { font-size: 32px; -webkit-text-stroke: 2px #10142a; } .dmg.mag.crit { color: #b9e8ff; }
.dmg.small { font-size: 12px; }
.dmg.heal { color: #7dff9a; font-size: 15px; }
.dmg.dodge { color: #8ff0ff; font-size: 15px; } .dmg.stun { color: #ffe27a; font-size: 13px; }
.dmg.cast { color: #fff4d6; font-family: var(--disp); font-size: 19px; letter-spacing: .5px; background: linear-gradient(rgba(20,30,70,.85), rgba(14,20,50,.85)); border-radius: 6px; padding: 1px 9px; -webkit-text-stroke: 0; box-shadow: inset 0 0 0 1px var(--edge); }
.dmg.coin { color: #ffd84a; font-size: 22px; }

/* ---------- top ---------- */
#top { position: fixed; left: 50%; top: 10px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; pointer-events: none; }
#stage, #phase, #vs { background: var(--panel); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--edge), 0 4px 18px rgba(4, 8, 24, .35); }
#stage { display: flex; align-items: center; gap: 8px; padding: 6px 12px; }
#stage b { font-size: 22px; font-family: var(--disp); color: var(--gold); }
#rounds { display: flex; gap: 4px; }
#rounds i { width: 22px; height: 22px; border-radius: 6px; background: #1c2648; display: grid; place-items: center; font-style: normal; font-size: 12px; opacity: .55; }
#rounds i.now { opacity: 1; box-shadow: 0 0 0 2px var(--gold); }
#rounds i.w { background: #2a7a43; opacity: .9; } #rounds i.l { background: #8a2a2a; opacity: .9; }
#phase { display: flex; align-items: center; gap: 8px; padding: 8px 12px; min-width: 260px; }
#phase-name { font-family: var(--disp); font-size: 17px; letter-spacing: .5px; white-space: nowrap; }
#tbar { flex: 1; height: 8px; border-radius: 4px; background: #1c2648; overflow: hidden; }
#tbar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #c8902a, #ffd86a); transition: width .2s linear; }
#timer { font-weight: 900; font-size: 16px; min-width: 22px; text-align: right; }
#vs { padding: 8px 12px; font-weight: 800; font-size: 14px; display: none; }
#vs.show { display: block; }

/* ---------- traits ---------- */
#traits { position: fixed; left: 10px; top: 70px; width: 214px; display: flex; flex-direction: column; gap: 4px; max-height: calc(100% - 330px); overflow: hidden; }
.tr { display: flex; align-items: center; gap: 8px; background: var(--panel); border-radius: 10px; padding: 4px 8px 4px 4px; cursor: default; box-shadow: inset 3px 0 0 var(--tc, #888), inset 0 0 0 1px rgba(222,182,98,.18); }
.tr.off { opacity: .62; background: rgba(14,22,44,.55); }
.hexi { width: 32px; height: 36px; flex: none; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); display: grid; place-items: center; font-size: 17px; background: #2a3354; color: var(--tc, #ccc); }
.hexi .ti { width: 20px; height: 20px; }
.hexi.l0 { background: linear-gradient(#d8955a, #8a5424); color: #2a1404; } .hexi.l1 { background: linear-gradient(#f0f4f8, #9aa6b2); color: #1a2030; } .hexi.l2 { background: linear-gradient(#ffe27a, #d69a12); color: #3a2200; } .hexi.l3 { background: linear-gradient(135deg, #ff9ad8, #8fdcff, #ffe27a); color: #1a1030; }
.tr-m { flex: 1; min-width: 0; }
.tr-n { font-weight: 800; font-size: 13px; display: flex; justify-content: space-between; }
.tr-n b { font-size: 14px; color: var(--gold); }
.tr-s { font-size: 11px; color: #8f9abd; font-weight: 700; letter-spacing: .5px; }
.tr-s .on { color: #fff; }

/* ---------- items ---------- */
#itembench { position: fixed; left: 10px; bottom: 150px; width: 214px; background: var(--panel); border-radius: 12px; padding: 6px 8px 8px; box-shadow: inset 0 0 0 1px var(--edge); }
#itembench.empty { display: none; }
.ib-t { font-size: 12px; font-family: var(--disp); color: var(--gold); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 4px; }
#items { display: flex; flex-wrap: wrap; gap: 5px; }
.item { width: 34px; height: 34px; border-radius: 8px; background: #1c2648; display: grid; place-items: center; font-size: 20px; cursor: grab; box-shadow: inset 0 0 0 2px rgba(255,255,255,.12); }
.item.full { box-shadow: inset 0 0 0 2px var(--gold); background: #3a3020; }
.item:hover { filter: brightness(1.25); }
#dragitem { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 50; font-size: 30px; transform: translate(-50%, -50%); filter: drop-shadow(0 3px 4px rgba(0,0,0,.6)); }

/* ---------- players ---------- */
#players { position: fixed; right: 10px; top: 70px; width: 200px; display: flex; flex-direction: column; gap: 4px; }
.pl { position: relative; display: flex; align-items: center; gap: 8px; background: var(--panel); border-radius: 10px; padding: 5px 8px 5px 5px; transition: transform .3s; box-shadow: inset 0 0 0 1px rgba(222,182,98,.15); }
.pl.me { box-shadow: inset 0 0 0 2px var(--gold); }
.pl.foe { box-shadow: inset 0 0 0 2px #ff6b5e; }
.pl.out { opacity: .4; filter: grayscale(1); }
.pl .av { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; font-size: 15px; font-family: var(--disp); color: #111; }
.pl-m { flex: 1; min-width: 0; }
.pl-n { font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-hp { position: relative; height: 12px; border-radius: 4px; background: #1c2648; overflow: hidden; margin-top: 2px; }
.pl-hp i { position: absolute; left: 0; top: 0; bottom: 0; background: #3ad55c; transition: width .5s; }
.pl-hp span { position: absolute; inset: 0; font-size: 10px; font-weight: 900; line-height: 12px; text-align: center; text-shadow: 0 1px 2px #000; }
.pl-l { font-size: 10px; font-weight: 800; color: #8f9abd; min-width: 30px; text-align: right; }
.pl .hit { position: absolute; right: -6px; top: -6px; background: #e5412f; border-radius: 6px; font-size: 11px; font-weight: 900; padding: 1px 5px; animation: fadeout 3s forwards; }
@keyframes fadeout { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- the shop ---------- */
#shopwrap { position: fixed; left: 50%; bottom: 8px; transform: translateX(-50%); width: min(960px, calc(100% - 16px)); }
#above { display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin-bottom: 6px; pointer-events: none; }
#goldbox { display: flex; align-items: center; gap: 4px; background: var(--panel); border-radius: 12px; padding: 4px 14px; font-size: 26px; font-weight: 900; color: #ffe08a; box-shadow: inset 0 0 0 1px var(--edge); }
#goldbox .ci { width: 26px; height: 26px; }
#goldbox.bump { animation: bump .25s ease-out; }
@keyframes bump { 0% { transform: scale(1.15); } 100% { transform: scale(1); } }
#streak { font-size: 14px; margin-left: 6px; }
#interest { display: flex; gap: 3px; background: var(--panel); border-radius: 10px; padding: 6px 8px; box-shadow: inset 0 0 0 1px var(--edge); }
#interest i { width: 10px; height: 10px; border-radius: 50%; background: #1c2648; } #interest i.on { background: #ffd23f; box-shadow: 0 0 6px #ffd23f; }
#boardn { background: var(--panel); border-radius: 10px; padding: 6px 10px; font-weight: 900; font-size: 14px; box-shadow: inset 0 0 0 1px var(--edge); }
#boardn.over { background: #8a2a2a; }
#shop { position: relative; display: flex; gap: 8px; background: linear-gradient(rgba(20,30,62,.96), rgba(12,18,40,.97)); border-radius: 14px; padding: 8px; box-shadow: inset 0 0 0 1px var(--edge), inset 0 2px 0 rgba(255,220,150,.12), 0 6px 24px rgba(0,0,0,.35); }
#shop::before { content: ''; position: absolute; left: 14px; right: 14px; top: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .7; }
.sb-left { display: flex; flex-direction: column; gap: 5px; width: 150px; flex: none; }
.sb-right { display: flex; flex-direction: column; gap: 5px; flex: none; }
#lvl { display: flex; align-items: center; gap: 8px; background: #141d3c; border-radius: 9px; padding: 4px 8px; }
#lvl b { font-size: 26px; font-family: var(--disp); color: var(--gold); min-width: 22px; text-align: center; }
.lvl-r { flex: 1; }
#lvl-t { font-size: 10px; font-weight: 800; color: #8f9abd; text-transform: uppercase; letter-spacing: 1px; }
#xpbar { position: relative; height: 12px; border-radius: 4px; background: #1c2648; overflow: hidden; }
#xpbar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #2a8ae0, #4fc3f7); transition: width .3s; }
#xpbar span { position: absolute; inset: 0; font-size: 9px; font-weight: 900; text-align: center; line-height: 12px; }
.sbtn { display: flex; align-items: center; justify-content: space-between; gap: 6px; border: 0; border-radius: 9px; padding: 8px 10px; font-weight: 800; font-size: 13px; color: #fff; background: linear-gradient(#2f6ac8, #1f4a9a); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.sbtn small { font-size: 11px; font-weight: 800; color: #ffe9a0; white-space: nowrap; }
#btn-roll { background: linear-gradient(#c8903a, #8a5a1a); }
.sbtn:hover { filter: brightness(1.12); }
.sbtn.no { filter: grayscale(.8) brightness(.7); }
.sbtn.sq { width: 46px; height: 46px; justify-content: center; font-size: 18px; padding: 0; background: #222c52; }
.sbtn.sq.on { background: #2f5fa8; }
#cards { flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; min-width: 0; }
.card { position: relative; height: 100px; border-radius: 10px; overflow: hidden; cursor: pointer; background: #121a36; box-shadow: inset 0 0 0 3px var(--cc); transition: transform .08s; }
.card:hover { transform: translateY(-3px); }
.card.empty { background: rgba(0,0,0,.25); box-shadow: inset 0 0 0 1px rgba(222,182,98,.15); cursor: default; transform: none; }
.card.no { filter: grayscale(.6) brightness(.7); }
.card .cimg { position: absolute; inset: 3px 3px 30px 3px; border-radius: 8px 8px 0 0; background: radial-gradient(circle at 60% 30%, color-mix(in srgb, var(--cc) 50%, #fff 18%), color-mix(in srgb, var(--cc) 30%, #10183a) 55%, #0c1230 90%); }
.card .cimg img { position: absolute; right: 0; bottom: 0; height: 100%; width: auto; max-width: 100%; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0,0,0,.6)); }
.card .ctr { position: absolute; left: 5px; top: 5px; display: flex; flex-direction: column; gap: 2px; z-index: 2; }
.card .ctr span { display: flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 800; background: rgba(8,12,28,.7); border-radius: 5px; padding: 1px 5px 1px 3px; white-space: nowrap; box-shadow: inset 2px 0 0 var(--tc); }
.card .ctr .ti { color: var(--tc); width: 12px; height: 12px; }
.card .cbot { position: absolute; left: 3px; right: 3px; bottom: 3px; height: 27px; display: flex; align-items: center; justify-content: space-between; padding: 0 7px; background: linear-gradient(color-mix(in srgb, var(--cc) 55%, #10183a), color-mix(in srgb, var(--cc) 35%, #0a0f24)); border-radius: 0 0 8px 8px; }
.card .cname { font-size: 15px; font-family: var(--disp); letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .ccost { font-size: 14px; font-weight: 900; white-space: nowrap; }
.card.up { box-shadow: inset 0 0 0 3px var(--cc), 0 0 0 2px #ffd23f, 0 0 14px #ffd23f; }
.card.up::after { content: '★'; position: absolute; right: 6px; top: 4px; color: #ffd23f; font-size: 18px; -webkit-text-stroke: 1px #000; z-index: 3; }
.card .own { position: absolute; right: 6px; top: 6px; font-size: 10px; font-weight: 900; background: rgba(0,0,0,.6); border-radius: 5px; padding: 1px 5px; z-index: 2; }
#sellzone { position: absolute; inset: 0; border-radius: 14px; background: rgba(140, 30, 30, .9); display: none; place-items: center; font-size: 22px; font-weight: 900; box-shadow: inset 0 0 0 3px #ff6b5e; }
#sellzone.show { display: grid; }
#sellzone.hot { background: rgba(190, 40, 40, .95); }

#btn-ready { position: fixed; right: 10px; bottom: 160px; border: 0; border-radius: 12px; padding: 12px 18px; font-family: var(--disp); font-size: 20px; letter-spacing: .5px; color: #fff; background: linear-gradient(#e0503a, #a82a1e); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,220,150,.4), 0 4px 0 #6a1a10; }
#btn-ready:hover { filter: brightness(1.1); }
body:not([data-phase="plan"]) #btn-ready { display: none; }

/* ---------- unit info ---------- */
#info { position: fixed; right: 220px; top: 70px; width: 280px; background: var(--panel2); border-radius: 12px; padding: 10px 12px; display: none; box-shadow: inset 0 0 0 1px var(--edge), 0 6px 24px rgba(0,0,0,.4); pointer-events: none; }
#info.show { display: block; }
.in-top { display: flex; gap: 10px; align-items: center; }
.in-top img { width: 66px; height: 66px; object-fit: contain; border-radius: 10px; background: radial-gradient(circle at 50% 35%, #3a4a7a, #121a36); }
.in-n { font-family: var(--disp); font-size: 22px; line-height: 1.05; }
.in-c { font-size: 12px; font-weight: 800; }
.in-tr { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.in-tr span { display: flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 800; background: #1c2648; border-radius: 6px; padding: 1px 6px 1px 4px; box-shadow: inset 2px 0 0 var(--tc); }
.in-tr .ti { color: var(--tc); }
.in-st { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 8px 0; }
.in-st div { background: #141d3c; border-radius: 7px; padding: 3px 6px; font-size: 11px; font-weight: 700; color: #8f9abd; }
.in-st b { color: #fff; float: right; }
.in-ab { background: linear-gradient(#1d2a58, #16204a); border-radius: 8px; padding: 7px 9px; font-size: 12px; font-weight: 600; color: #d6deef; line-height: 1.35; box-shadow: inset 0 0 0 1px rgba(79,195,247,.25); }
.in-ab b { display: block; color: #fff4d6; font-family: var(--disp); font-size: 16px; font-weight: 400; margin-bottom: 2px; }
.in-ab small { color: #7fd8ff; font-weight: 800; }
.in-it { margin-top: 6px; font-size: 12px; font-weight: 600; color: #cfd3d7; }
.in-it div { margin-top: 3px; } .in-it b { color: #ffd23f; }
#tip { position: fixed; left: 0; top: 0; max-width: 270px; background: var(--panel2); border-radius: 10px; padding: 8px 10px; font-size: 12px; font-weight: 600; line-height: 1.4; display: none; pointer-events: none; z-index: 60; box-shadow: inset 0 0 0 1px var(--edge), 0 6px 24px rgba(0,0,0,.4); }
#tip b { font-size: 13px; } #tip .lv { color: #8f9abd; } #tip .lv.on { color: #ffd23f; }
#tip .tt-n { font-family: var(--disp); font-size: 17px; font-weight: 400; color: var(--tc); }

/* ---------- banner, toast ---------- */
#banner { position: fixed; left: 50%; top: 24%; transform: translateX(-50%); text-align: center; opacity: 0; pointer-events: none; }
#banner.show { animation: banner 2.4s ease-out forwards; }
#banner .b-title { font-family: var(--disp); font-size: 72px; letter-spacing: 4px; color: #fff4d6; -webkit-text-stroke: 3px #10142a; paint-order: stroke fill; text-shadow: 0 0 24px rgba(242,196,90,.5); }
#banner .b-sub { font-size: 18px; font-weight: 800; -webkit-text-stroke: 1px rgba(0,0,0,.8); paint-order: stroke fill; margin-top: 2px; }
#banner.win .b-title { color: #ffe08a; } #banner.loss .b-title { color: #ff7a6a; }
@keyframes banner { 0% { opacity: 0; transform: translateX(-50%) scale(1.4); } 10% { opacity: 1; transform: translateX(-50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
#toast { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); background: #c8352a; color: #fff; font-weight: 800; padding: 8px 16px; border-radius: 10px; opacity: 0; pointer-events: none; z-index: 70; box-shadow: inset 0 0 0 1px rgba(255,220,150,.35); }
#toast.ok { background: #2a7a43; }
#toast.show { animation: toast 1.8s ease-out forwards; }
@keyframes toast { 0% { opacity: 0; } 10% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; display: none; place-items: center; background: rgba(8, 12, 30, .5); z-index: 40; }
.modal.show { display: grid; }
.mcard { width: min(580px, calc(100% - 32px)); background: linear-gradient(rgba(20,30,62,.97), rgba(12,18,40,.97)); border-radius: 16px; padding: 24px 26px 20px; box-sizing: border-box; box-shadow: inset 0 0 0 1px var(--edge), 0 10px 40px rgba(0,0,0,.5); }
.mcard.wide { width: min(880px, calc(100% - 32px)); }
.m-title { font-family: var(--disp); font-size: 36px; color: #fff4d6; }
.m-sub { color: #b9c2dc; font-weight: 600; margin: 8px 0 14px; line-height: 1.4; }
.rules { display: grid; gap: 9px; margin-top: 12px; }
.rules div { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 600; color: #e0e6f2; line-height: 1.35; }
.rules b { width: 24px; flex: none; text-align: center; font-size: 16px; }
button.big { width: 100%; height: 54px; margin-top: 18px; border: 0; border-radius: 12px; background: linear-gradient(#3fbf5f, #1e8a3e); color: #fff; font-size: 20px; font-weight: 900; letter-spacing: 1px; cursor: pointer; box-shadow: 0 4px 0 #0e5a26; }
button.big:hover { filter: brightness(1.08); }
button.big.gold { background: linear-gradient(#ffe08a, #e0a83a 55%, #b8781a); color: #2a1400; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), 0 5px 0 #7a4a0a, 0 10px 30px rgba(242,180,60,.35); font-family: var(--disp); font-weight: 400; }
#fair-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
#fair-cards .card { height: 160px; }
#fair-cards .card .citem { position: absolute; right: 6px; top: 6px; z-index: 3; font-size: 22px; background: rgba(0,0,0,.6); border-radius: 8px; padding: 2px 4px; }
#fair-t { text-align: center; margin-top: 12px; font-weight: 800; color: #8f9abd; }
#over-board { display: grid; gap: 4px; margin-top: 6px; }
#over-board div { display: flex; justify-content: space-between; background: #141d3c; border-radius: 8px; padding: 6px 10px; font-weight: 700; font-size: 13px; }
#over-board div.me { box-shadow: inset 0 0 0 2px var(--gold); }
#loading { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; gap: 8px; background: radial-gradient(circle at 50% 40%, #1f3a7a, #0a1230); font-weight: 800; font-size: 18px; z-index: 100; color: #b9c2dc; }
#loading .ld-logo { font-family: var(--disp); font-size: 64px; color: var(--gold); letter-spacing: 6px; }

/* ---------- the main menu ---------- */
#title { position: fixed; inset: 0; display: none; z-index: 40; pointer-events: none; background: linear-gradient(90deg, rgba(8,14,40,.78) 0%, rgba(8,14,40,.45) 34%, rgba(8,14,40,0) 52%), linear-gradient(0deg, rgba(8,14,40,.55), rgba(8,14,40,0) 30%); }
#title.show { display: block; }
#title > * { pointer-events: auto; }
.t-left { position: absolute; left: 64px; top: 50%; transform: translateY(-50%); width: 440px; }
.logo { font-family: var(--disp); line-height: .9; }
.logo .l1 { display: block; font-size: 112px; letter-spacing: 6px; background: linear-gradient(#fff6d8 10%, #ffd86a 45%, #c8902a 75%, #ffe9a8); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 #3a2208) drop-shadow(0 10px 24px rgba(0,0,0,.5)); }
.logo .l2 { display: block; font-size: 38px; letter-spacing: 21px; color: #e8f4ff; margin: 6px 0 0 6px; text-shadow: 0 2px 0 #1a3a7a, 0 0 18px rgba(79,195,247,.6); }
.tagline { margin: 18px 0 8px; font-size: 16px; font-weight: 600; color: #dce6f6; line-height: 1.45; text-shadow: 0 1px 3px rgba(0,0,0,.6); max-width: 400px; }
#btn-play { height: 82px; margin-top: 22px; font-size: 40px; display: flex; align-items: center; justify-content: center; gap: 14px; }
#btn-play small { font-family: var(--ui); font-size: 14px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; opacity: .75; }
.t-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.tile { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 8px; text-align: left; border: 0; border-radius: 12px; padding: 10px 12px; background: rgba(16,26,58,.85); color: #fff; cursor: pointer; box-shadow: inset 0 0 0 1px var(--edge), 0 4px 14px rgba(0,0,0,.3); }
.tile:hover { background: rgba(28,44,92,.92); }
.tile i { grid-row: 1 / 3; font-style: normal; font-size: 24px; text-align: center; }
.tile b { font-family: var(--disp); font-weight: 400; font-size: 20px; }
.tile small { font-size: 11px; font-weight: 700; color: #9fb0d6; text-transform: uppercase; letter-spacing: .6px; }
.t-right { position: absolute; right: 40px; bottom: 36px; width: 300px; display: flex; flex-direction: column; gap: 10px; }
.pcard { background: linear-gradient(rgba(20,30,62,.92), rgba(12,18,40,.92)); border-radius: 14px; padding: 14px; box-shadow: inset 0 0 0 1px var(--edge), 0 6px 24px rgba(0,0,0,.4); }
.pc-top { display: flex; gap: 12px; align-items: center; }
.pc-av { width: 54px; height: 54px; flex: none; border-radius: 50%; display: grid; place-items: center; font-family: var(--disp); font-size: 30px; color: #2a1400; background: radial-gradient(circle at 35% 30%, #fff2c0, #f2c45a 50%, #b8781a); box-shadow: 0 0 0 3px #10183a, 0 0 0 5px var(--gold2); }
.pc-n { flex: 1; min-width: 0; }
.pc-l { font-size: 11px; font-weight: 800; color: #9fb0d6; text-transform: uppercase; letter-spacing: 1px; }
#name { width: 100%; box-sizing: border-box; height: 34px; border-radius: 8px; border: 0; background: #0c1430; color: #fff; font: 800 16px var(--ui); padding: 0 10px; outline: none; box-shadow: inset 0 0 0 1px rgba(222,182,98,.25); margin-top: 3px; }
#name:focus { box-shadow: inset 0 0 0 2px var(--gold); }
.pc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.pc-stats div { background: #0c1430; border-radius: 8px; padding: 5px 6px; text-align: center; }
.pc-stats b { display: block; font-family: var(--disp); font-size: 24px; color: var(--gold); font-weight: 400; line-height: 1; }
.pc-stats span { font-size: 10px; font-weight: 800; color: #9fb0d6; text-transform: uppercase; }
.pc-factions { display: flex; justify-content: space-between; margin-top: 10px; font-size: 22px; }
.pc-factions span { width: 34px; height: 34px; border-radius: 50%; background: #0c1430; display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.hints { background: rgba(12,18,40,.75); border-radius: 12px; padding: 10px 12px; display: grid; gap: 5px; box-shadow: inset 0 0 0 1px rgba(222,182,98,.2); }
.hints div { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: #cdd6ea; }
kbd { min-width: 22px; height: 22px; padding: 0 5px; box-sizing: border-box; border-radius: 6px; background: #f3efe7; color: #10183a; font: 900 12px var(--ui); display: grid; place-items: center; box-shadow: 0 2px 0 #9a8a6a; }

@media (max-width: 1100px) { #traits, #itembench { width: 170px; } #players { width: 170px; } #info { right: 190px; } .sb-left { width: 128px; } }

/* the whole interface is laid out for ~1440×880 and scaled to the window (see main.js) */
#hud { position: fixed; left: 0; top: 0; width: calc(100vw / var(--k)); height: calc(100vh / var(--k)); transform: scale(var(--k)); transform-origin: 0 0; pointer-events: none; z-index: 5; }
#hud > *:not(#top):not(#tip):not(#banner):not(#toast):not(#info):not(#title) { pointer-events: auto; }
#hud > .modal:not(.show) { pointer-events: none; }
#title { position: absolute; }
.ubar { transform-origin: 50% 100%; }
.sbtn.sq { width: 40px; height: 34px; font-size: 15px; }

body[data-phase="lobby"] #top, body[data-phase="lobby"] #traits, body[data-phase="lobby"] #itembench, body[data-phase="lobby"] #players, body[data-phase="lobby"] #shopwrap, body[data-phase="lobby"] #btn-ready { display: none; }
.row2 { display: flex; gap: 10px; } .row2 button.big { margin-top: 10px; font-size: 16px; }
button.big.blue { background: linear-gradient(#3a7ae0, #1f4a9a); box-shadow: 0 4px 0 #142e66; } button.big.gray { background: linear-gradient(#2a3660, #1a2244); box-shadow: 0 4px 0 #0c1230; }
button.big:disabled { filter: grayscale(1) brightness(.6); cursor: default; }
button.link { display: block; margin: 14px auto 0; background: none; border: 0; color: #8f9abd; font: 700 13px var(--ui); cursor: pointer; text-decoration: underline; }
#lobby-code { color: #ffd23f; letter-spacing: 3px; }
#lobby-seats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#lobby-seats div { background: #141d3c; border-radius: 8px; padding: 8px 10px; font-weight: 800; font-size: 14px; display: flex; justify-content: space-between; }
#lobby-seats div.bot { color: #6a7598; font-weight: 700; }
#lobby-seats div.off { opacity: .5; }
#net { position: fixed; left: 50%; top: 58px; transform: translateX(-50%); background: #8a2a2a; border-radius: 8px; padding: 4px 12px; font-weight: 800; font-size: 13px; display: none; z-index: 60; }
#net.show { display: block; }
#btn-ready.on { background: linear-gradient(#3fbf5f, #1e8a3e); box-shadow: 0 4px 0 #0e5a26; }

/* phones held sideways: the menu stacks up */
@media (max-aspect-ratio: 4/3) { .t-left { left: 24px; width: 380px; } .logo .l1 { font-size: 84px; } .t-right { right: 16px; width: 260px; } }

/* a soft vignette over the scene (under the bars and the HUD) */
#vig { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse 75% 70% at 50% 46%, transparent 55%, rgba(26,18,52,.42) 100%); }
body[data-phase="title"] #vig { background: radial-gradient(ellipse 80% 75% at 50% 45%, transparent 50%, rgba(20,14,44,.5) 100%); }

/* loading the figures */
#loadbar { width: 100%; margin: 0 0 10px; text-align: center; color: #f3e2b8; font-weight: 700; }
#loadbar .lb-b { height: 10px; border-radius: 6px; background: rgba(0,0,0,.45); border: 1px solid rgba(255,215,140,.35); overflow: hidden; margin-top: 6px; }
#loadbar .lb-b i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffb02e, #ffe28a); transition: width .2s; }
button:disabled { opacity: .45; pointer-events: none; }
