:root {
  --bg: #1b1d2a; --panel: #262a3d; --panel2: #2f3450; --line: #3d4363;
  --text: #ece9f5; --muted: #a3a6c2; --gold: #f2c35b; --good: #6fd39a; --bad: #ef6f6f;
  --accent: #8f7cf7;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font-family: "Segoe UI", "Noto Sans Thai", system-ui, sans-serif; font-size: 15px; }
button { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 14px; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
input, select { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.gold { color: var(--gold); }
.good { color: var(--good); }
.bad { color: var(--bad); }

/* title */
#title { max-width: 520px; margin: 10vh auto; text-align: center; }
#title h1 { font-size: 44px; margin: 0 0 6px; letter-spacing: 1px; }
#title .box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin-top: 24px; text-align: left; }
#title .row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
#title .row label { width: 110px; }
#title .row input, #title .row select { flex: 1; }
.btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* game */
#game { display: grid; grid-template-rows: auto auto 1fr; height: 100vh; }
header { display: flex; gap: 18px; align-items: center; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
header .name { font-weight: 700; font-size: 17px; }
header .spacer { flex: 1; }
.phasebar { display: flex; gap: 6px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.phasebar .ph { padding: 6px 12px; border-radius: 20px; background: var(--panel); color: var(--muted); }
.phasebar .ph.on { background: var(--accent); color: #fff; }
.phasebar .arrow { color: var(--muted); }
.phasebar .spacer { flex: 1; }
main { display: grid; grid-template-columns: 1fr 320px; gap: 14px; padding: 14px 16px; overflow: hidden; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; overflow: auto; }
.panel h3 { margin: 0 0 10px; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.side { display: grid; grid-template-rows: auto auto 1fr; gap: 14px; overflow: hidden; }
.loglist { font-size: 13px; }
.loglist div { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.ledger { width: 100%; border-collapse: collapse; }
.ledger td { padding: 4px 0; }
.ledger td:last-child { text-align: right; }
.ledger tr.total td { border-top: 1px solid var(--line); font-weight: 700; }

/* modal */
#modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; }
#modal .box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; min-width: 360px; max-width: 560px; max-height: 80vh; overflow: auto; }
.slots .slot { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.slots .slot .info { flex: 1; }
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--accent); padding: 8px 16px; border-radius: 8px; }

/* part 2: recruiting */
.small { font-size: 12px; }
.walk > div { margin-bottom: 8px; }
.walk .label { display: inline-block; width: 70px; color: var(--muted); }
.choices { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.choices button { padding: 5px 10px; }
.choices button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cand { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cand .who { flex: 1; }
.bar { display: inline-block; width: 90px; height: 7px; background: var(--panel2); border-radius: 4px; vertical-align: middle; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--good); }
.hint { margin: 4px 0; }
.advrow { padding: 5px 0; border-bottom: 1px dashed var(--line); }

/* part 3: growth */
.clickable { cursor: pointer; }
.clickable:hover { background: var(--panel2); }
table.stats { margin: 8px 0; border-collapse: collapse; }
table.stats td { padding: 2px 10px 2px 0; }

/* part 4: quests */
.qform { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.qform label { display: inline-flex; gap: 6px; align-items: center; }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line); }
details summary { cursor: pointer; color: var(--muted); }

/* part 6: loot rarity colors */
.r-n { color: #cfd2e3; } .r-uc { color: #7fd38f; } .r-r { color: #6fb3ff; } .r-sr { color: #c48cff; } .r-ssr { color: #ffb347; } .r-l { color: #ff6b8b; font-weight: 700; }
.inv { max-height: 180px; overflow: auto; }

/* part 7: shops */
.shops { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.shopbox { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.shopbox h4 { margin: 0 0 6px; }
.shopbox > div { margin: 4px 0; }
.craftrow { padding: 3px 0; border-bottom: 1px dashed var(--line); }
.craftrow button, .shopbox button { padding: 3px 10px; }

/* part 10: stories */
.box.story { max-width: 520px; }
.box.story p { line-height: 1.5; }

/* ---- town map & people cards (explore) ---- */
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tabs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.townmap { position: relative; width: 100%; aspect-ratio: 1216 / 832; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; overflow: hidden;
  background: url('../images/maps/town.png') center / cover, url('../images/map.png') center / cover, radial-gradient(circle at 50% 45%, #3b4a36, #1d2419); }
.townmap button { position: absolute; transform: translate(-50%, -50%); padding: 3px 8px; font-size: 13px; background: rgba(15, 18, 14, .85); white-space: nowrap; }
.townmap button.on { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 10px var(--accent); }
.chip { display: inline-block; padding: 0 6px; border-radius: 9px; background: var(--panel2); font-size: 11px; }
.pcard { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0; }
.pcard-top { display: flex; gap: 10px; align-items: center; }
.pcard-top .who { flex: 1; }
.stattbl { border-collapse: collapse; margin: 4px 0; font-size: 13px; }
.stattbl td { padding: 1px 8px 1px 0; }
.bar.sbar { width: 120px; }
.evchoice { display: block; width: 100%; margin: 6px 0; text-align: left; padding: 8px 10px; }
#modal .box.wide { max-width: 680px; width: 92vw; }

.walkcard { max-width: min(1100px, calc((100vh - 390px) * 1.46)); border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--panel); }
.walkcard .townmap { margin-bottom: 8px; }
.walkcard .townmap button { font-size: 17px; padding: 5px 12px; } .walkcard, .walkcard .small { font-size: 16px; } .walkcard .wrow select, .walkcard .wrow button { font-size: 17px; }
.wrow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.wrow select { padding: 3px 6px; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; }

/* ---- tab design (19 Nov): guild tab + phase tabs + sub-tabs ---- */
main.full { grid-template-columns: 1fr; overflow: auto; }
.phasebar button.ph { border: 1px solid var(--line); }
.phasebar button.ph.dim { opacity: .45; }
.phasebar button.ph.now:not(.on) { border-color: var(--accent); }
.subpane.hidden, #phase-panel.hidden { display: none; }
.ggrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin-bottom: 12px; }
.gcard { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--panel); }
.gcard.loglist { max-height: 320px; overflow: auto; }
.tblwrap { overflow-x: auto; }
.mtbl { border-collapse: collapse; width: 100%; font-size: 13px; }
.mtbl th, .mtbl td { padding: 4px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.mtbl th { color: var(--muted); font-weight: normal; }
.mcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 8px; margin-top: 8px; }
.mcards .pcard { margin: 0; }

/* pictures from imagegen */
img.ico { width: 20px; height: 20px; vertical-align: middle; border-radius: 4px; margin-right: 4px; }
img.avatar { width: 28px; height: 28px; object-fit: cover; object-position: top; border-radius: 50%; vertical-align: middle; }
img.portrait { width: 64px; height: 94px; object-fit: cover; object-position: top; border-radius: 6px; flex: none; }
img.portrait.big { width: 120px; height: 175px; float: right; margin-left: 10px; }

/* world map behind the world panel */
.worldbg { background: linear-gradient(rgba(20,24,34,.82), rgba(20,24,34,.82)), url('../images/maps/world.png') center / cover; border-radius: 8px; }

/* ===== Guild tab (19 Nov redesign) ===== */
.hero { position: relative; min-height: 190px; border-radius: 12px; overflow: hidden; margin-bottom: 14px;
  background: linear-gradient(90deg, rgba(15,17,28,.92) 0%, rgba(15,17,28,.55) 55%, rgba(15,17,28,.15) 100%), url('../images/maps/town.png') center 40% / cover, #2a2f45;
  border: 1px solid rgba(242,195,91,.35); box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.herotxt { padding: 22px 26px; }
.hero h1 { margin: 2px 0 14px; font-size: 32px; letter-spacing: .5px; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chipbig { display: flex; gap: 10px; align-items: center; padding: 8px 14px; border-radius: 10px; background: rgba(20,22,36,.78); border: 1px solid var(--line); min-width: 150px; }
.chipbig .ci { font-size: 26px; }
.chipbig small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.chipbig b { font-size: 18px; } .chipbig b small { display: inline; text-transform: none; }
.chipbig.gold b { color: var(--gold); } .chipbig.warn { border-color: var(--bad); }
.gmain { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(300px, 1fr); gap: 14px; }
@media (max-width: 1100px) { .gmain { grid-template-columns: 1fr; } }
.gmain h2 { margin: 4px 0 10px; font-size: 18px; }
.gright .gcard { margin-bottom: 12px; }
.advgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.advcard { display: flex; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer; transition: transform .12s, border-color .12s; }
.advcard:hover { transform: translateY(-2px); border-color: var(--accent); }
.advpic { position: relative; flex: none; }
img.advimg { width: 104px; height: 152px; object-fit: cover; object-position: top; border-radius: 8px; display: block; background: #1b1e2e; }
.rankbadge { position: absolute; top: 4px; left: 4px; background: var(--gold); color: #1b1e2e; font-weight: 800; border-radius: 6px; padding: 0 7px; font-size: 13px; }
.promo { position: absolute; top: 4px; right: 4px; background: var(--good); color: #10251a; border-radius: 6px; padding: 0 6px; font-weight: 800; }
.ribbon { position: absolute; bottom: 4px; left: 4px; right: 4px; text-align: center; font-size: 11px; border-radius: 5px; padding: 1px 0; background: rgba(20,22,36,.85); }
.ribbon.free { color: var(--good); } .ribbon.hurt { color: var(--bad); } .ribbon.quest { color: var(--gold); }
.advinfo { flex: 1; min-width: 0; font-size: 13px; }
.advinfo > b { font-size: 16px; }
.mini { margin: 6px 0; } .mini div { display: grid; grid-template-columns: 32px 1fr 34px; gap: 6px; align-items: center; font-size: 11px; }
.mini .bar.sbar { width: auto; }
.alltable { margin-top: 12px; } .alltable summary { cursor: pointer; color: var(--muted); }
.empty { text-align: center; padding: 28px; border: 1px dashed var(--line); border-radius: 12px; background: var(--panel); }
.emptyfaces { display: flex; justify-content: center; gap: 10px; margin-bottom: 10px; opacity: .85; }
.emptyfaces img.portrait { width: 90px; height: 130px; }
button.big { font-size: 17px; padding: 10px 22px; }
.btiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.btile { text-align: center; padding: 10px 4px; border-radius: 10px; background: var(--panel2); font-size: 13px; }
.btile .bi { font-size: 30px; }
.invgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.invcell { position: relative; aspect-ratio: 1; border-radius: 8px; background: var(--panel2); border: 2px solid var(--line); overflow: hidden; }
img.invimg { width: 100%; height: 100%; object-fit: cover; display: block; }
.invcell .cnt { position: absolute; right: 2px; bottom: 0; font-size: 11px; font-weight: 700; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.r-nb { border-color: #565b78; } .r-ucb { border-color: #7fd38f; } .r-rb { border-color: #6fb3ff; } .r-srb { border-color: #c48cff; } .r-ssrb { border-color: #ffb347; } .r-lb { border-color: #ff6b8b; }
.worldbg { min-height: 160px; }
/* ===== Walk result popup: big picture, one person per page ===== */
#modal .box.wide { max-width: 1200px; width: 94vw; max-height: 92vh; font-size: 16px; padding: 26px; }
.bigcard { display: flex; gap: 26px; align-items: flex-start; }
img.portrait.huge { width: min(400px, 30vw); height: min(585px, 68vh); border-radius: 12px; box-shadow: 0 6px 22px rgba(0,0,0,.45); }
.bigbody { flex: 1; min-width: 0; }
.bighead { font-size: 19px; margin-bottom: 8px; } .bighead b { font-size: 30px; }
.bigcard .stattbl { font-size: 19px; margin: 10px 0; } .bigcard .stattbl td { padding: 4px 18px 4px 0; } .bigcard .stattbl .small { font-size: 15px; }
.bigcard .bar.sbar { width: 220px; height: 14px; } .bigcard .bigbar .bar { width: 200px; height: 14px; } .bigcard .small { font-size: 15px; }
.bigbar { margin: 6px 0; } .bigact { margin: 10px 0; } .bigact button { font-size: 20px; padding: 11px 26px; }
.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; } .pager button.on { border-color: var(--accent); background: var(--panel2); }
.popnav { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.rumorbox { margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: var(--panel2); border-left: 3px solid var(--gold); }
@media (max-width: 760px) { .bigcard { flex-direction: column; } img.portrait.huge { width: 100%; height: auto; } }

.evbox { margin: 10px 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--panel2); border-left: 3px solid var(--accent); }
.evbox h3 { margin: 0 0 8px; font-size: 17px; }
.statwin { margin: 8px 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
.statwin summary { cursor: pointer; }

/* ===== clickable world map (plan > quests) ===== */
.wmapwrap { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 14px; margin-bottom: 14px; }
@media (max-width: 1000px) { .wmapwrap { grid-template-columns: 1fr; } }
.wmap { position: relative; aspect-ratio: 1216 / 832; border-radius: 12px; overflow: hidden; border: 1px solid rgba(242,195,91,.35);
  background: url('../images/maps/world.png') center / cover, radial-gradient(circle, #3b4a36, #1d2419); box-shadow: 0 6px 22px rgba(0,0,0,.35); }
.wmap button { position: absolute; transform: translate(-50%, -50%); padding: 4px 10px; font-size: 13px; background: rgba(15,18,28,.85); white-space: nowrap; border-radius: 16px; }
.wmap button.on { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 12px var(--accent); }
.wmap button.locked { opacity: .55; }
.evdot { display: inline-block; animation: pulse 1.4s infinite; } .evdot.army, .evdot.lord { filter: drop-shadow(0 0 4px #ef6f6f); }
@keyframes pulse { 50% { transform: scale(1.25); } }
.wside { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.wside h3 { margin: 0 0 8px; }
.wev { padding: 6px 8px; border-radius: 6px; background: var(--panel2); margin: 4px 0; font-size: 13px; }
.wev.army, .wev.lord { border-left: 3px solid var(--bad); } .wev.dungeon { border-left: 3px solid #c48cff; } .wev.rampage { border-left: 3px solid var(--gold); }
.wacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.qform.flash { animation: flash 1s; } @keyframes flash { 30% { box-shadow: 0 0 0 3px var(--accent); } }

/* world map grid */
.wgrid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: repeat(8, 1fr); }
.wc { border: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; gap: 2px; font-size: 18px; }
.wc.sea { border-color: transparent; }
.wc[data-wc] { cursor: pointer; border-color: rgba(255,255,255,.22); }
.wc[data-wc]:hover { background: rgba(143,124,247,.25); }
.wc.samez { background: rgba(143,124,247,.14); }
.wc.on { background: rgba(143,124,247,.38); border: 2px solid var(--accent); box-shadow: inset 0 0 12px rgba(143,124,247,.7); }
.wc.locked { background: rgba(0,0,0,.35); }
.wsec { margin: 10px 0 4px; font-weight: 700; font-size: 13px; color: var(--muted); }
.wres { display: flex; flex-wrap: wrap; gap: 4px; } .wri { font-size: 12px; background: var(--panel2); border-radius: 6px; padding: 2px 6px 2px 2px; }
.wmon { line-height: 1.9; } .wev.here { outline: 1px solid var(--accent); }
.wside { max-height: 640px; overflow: auto; }
.wc { position: relative; } .zlabel { position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11px; padding: 0 6px; border-radius: 8px; background: rgba(15,18,28,.8); pointer-events: none; z-index: 2; }
.townmark { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11px; padding: 0 6px; border-radius: 8px; background: var(--gold); color: #1b1e2e; font-weight: 700; z-index: 3; pointer-events: none; }

/* town map (plan > town) + building pictures */
.townmap.big { max-width: 980px; margin: 0 0 6px; background: url('../images/maps/town.png') center / cover, radial-gradient(circle at 50% 45%, #3b4a36, #1d2419); }
.tspot { display: flex; align-items: center; gap: 4px; }
.tspot.built { background: rgba(242,195,91,.92) !important; color: #1b1e2e; border-color: var(--gold) !important; font-weight: 600; }
.tspot.empty { opacity: .8; border-style: dashed !important; }
img.tsimg { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
img.bimg { float: left; width: 200px; height: 200px; object-fit: contain; border-radius: 10px; margin: 0 14px 6px 0; background: #fff; }   /* Tony 19 Nov: whole square picture, never cropped */
.shopbox { display: flow-root; }
.townlayout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(380px, 1fr); gap: 14px; align-items: start; }
.townlayout .townmap.big { max-width: none; }
.townlayout .shops { grid-template-columns: 1fr; margin: 0; }
.townlayout .shopbox h4 { font-size: 18px; margin: 4px 0 8px; }
@media (max-width: 1100px) { .townlayout { grid-template-columns: 1fr; } }
.shopbox.flash { animation: flash 1s; }

.qbadge { position: absolute; top: 2px; right: 2px; font-size: 11px; font-weight: 700; padding: 0 5px; border-radius: 8px; background: var(--accent); color: #fff; z-index: 3; }
.qbadge.out { top: auto; bottom: 2px; right: 2px; background: var(--good); color: #10251a; }
.wev.quest { border-left: 3px solid var(--accent); } .wev.out { border-left: 3px solid var(--good); }
button.tiny { padding: 1px 8px; font-size: 11px; float: right; }
.wmapwrap { grid-template-columns: minmax(0, 900px) minmax(300px, 1fr); }
.qbadge.out { top: 2px; bottom: auto; left: 2px; right: auto; }
/* map + side panel fit the screen (Tony 19 Nov): map as big as the screen height allows, panel fixed width next to it */
.wmapwrap { grid-template-columns: auto minmax(340px, 460px); justify-content: start; }
.wmap { height: min(76vh, 880px); width: auto; max-width: calc(100vw - 560px); }
.wside { max-height: min(76vh, 880px); }
@media (max-width: 1000px) { .wmapwrap { grid-template-columns: 1fr; } .wmap { height: auto; width: 100%; max-width: none; } }

/* plan > quests: map on the left, everything else (square info, post form, board, parties) in the column next to it */
.sub-plan-quests:not(.hidden) { display: grid; grid-template-columns: auto minmax(420px, 1fr); column-gap: 16px; align-items: start; }
.sub-plan-quests > .wmap { grid-column: 1; grid-row: 1 / span 40; }
.sub-plan-quests > *:not(.wmap) { grid-column: 2; }
.sub-plan-quests > .wside { max-height: none; margin-bottom: 8px; }
@media (max-width: 1100px) { .sub-plan-quests:not(.hidden) { display: block; } .wmap { height: auto; width: 100%; max-width: none; } }
/* fog: squares not surveyed yet */
.wc.fog { background: rgba(10,12,20,.35); }
.wc.known { background: transparent; }

/* walk tab: map left, people you have met right (Tony 19 Nov) */
.walklayout { display: grid; grid-template-columns: auto minmax(340px, 1fr); gap: 14px; align-items: start; }
.walklayout .walkcard { width: min(1100px, calc((100vh - 390px) * 1.46)); max-width: none; }
.chatlist { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--panel); max-height: calc(100vh - 220px); overflow: auto; }
.chatlist h3 { margin: 0 0 4px; }
.chatrow { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
img.chatpic { width: 110px; height: 150px; object-fit: cover; object-position: top; border-radius: 8px; flex: none; }
.chatrow { gap: 16px; padding: 12px 0; }
.chatrow .cw { flex: 1; min-width: 0; font-size: 17px; } .chatrow .ca button { font-size: 18px; padding: 9px 20px; white-space: nowrap; } .chatrow .ca .muted { font-size: 16px; }
.cname { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.ctags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; font-size: 17px; }
.ptag, .lvtag { padding: 3px 12px; border-radius: 8px; font-size: 18px; border: 2px solid var(--line); background: var(--panel2); }
.ptag b, .lvtag b { font-size: 24px; margin-left: 4px; }
.ptag.p-F { border-color: #8a8fa8; } .ptag.p-E { border-color: #7fd38f; color: #a8f0b5; } .ptag.p-D { border-color: #6fb3ff; color: #a9d2ff; } .ptag.p-C { border-color: #c48cff; color: #dcb8ff; }
.ptag.p-B { border-color: #ffb347; color: #ffd08f; } .ptag.p-A { border-color: #ff6b8b; color: #ff9db2; } .ptag.p-S { border-color: #f2c35b; color: #f2c35b; background: rgba(242,195,91,.12); }
.lvtag { border-color: var(--accent); }
.cint .bar { width: 200px; height: 12px; }
@media (max-width: 1100px) { .walklayout { grid-template-columns: 1fr; } .walklayout .walkcard { width: auto; } }

/* title screen: world map behind (Tony 19 Nov) */
#title::before { content: ''; position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(12,14,24,.35), rgba(12,14,24,.8)), url('../images/maps/world.png') center / cover no-repeat; }
#title h1 { font-size: 64px; text-shadow: 0 4px 18px rgba(0,0,0,.8); }
#title > .muted { color: #e6e8f2; font-size: 18px; text-shadow: 0 2px 8px rgba(0,0,0,.9); }
#title .box { background: rgba(28,31,48,.88); backdrop-filter: blur(4px); box-shadow: 0 10px 40px rgba(0,0,0,.5); }

.perkchip { display: inline-block; margin: 4px 0; padding: 3px 10px; border-radius: 8px; background: rgba(242,195,91,.12); border: 1px solid rgba(242,195,91,.5); color: #f2d48b; font-size: 14px; }
.bigcard .perkchip { font-size: 17px; }

.persline { font-size: 14px; color: var(--muted, #a9adc6); margin: 3px 0; } .bigcard .persline { font-size: 16px; }
.bighead .persline b, .persline b { font-size: inherit; color: var(--text); }

/* guild tab: members out in the same party share a frame (Tony 19 Nov) */
.partybox { grid-column: 1 / -1; border: 2px solid var(--accent); border-radius: 14px; padding: 10px; background: rgba(139,123,255,.08); }
.partyhead { font-weight: 700; margin-bottom: 8px; }
.partycards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }

.chatrow .clickable { cursor: pointer; } .chatrow .cname.clickable:hover { color: var(--accent); }

.pask { display: flex; flex-direction: column; gap: 6px; } .paskm { display: flex; align-items: center; gap: 8px; } .paskm.out { opacity: .45; text-decoration: line-through; } .paskm button { margin-left: auto; text-decoration: none; }

/* results popup with team pictures (Tony 19 Nov) */
.reshead { font-size: 26px; font-weight: 800; margin: 6px 0 12px; }
.resteam { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.resmember { width: 220px; border-radius: 12px; overflow: hidden; background: var(--panel2); border: 2px solid var(--line); }
.resmember.win { border-color: #f2c35b; } .resmember.lose { border-color: #7a3b4a; }
img.respic { width: 100%; height: 300px; object-fit: cover; object-position: top; display: block; }
.resmember.lose img.respic { filter: grayscale(.35) brightness(.85); }
.resname { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 16px; }
.lvbox { display: inline-block; vertical-align: top; margin: 8px 14px 4px 0; padding: 8px 12px; border-radius: 10px; background: var(--panel2); border: 1px solid #f2c35b; }
.lvbox .stattbl { font-size: 15px; }

/* event markers on the world map (Tony 19 Nov) */
.wc .evdot { font-size: 26px; line-height: 1; position: relative; z-index: 2; filter: drop-shadow(0 0 4px #000); }
.evdot.dungeon { filter: drop-shadow(0 0 6px #b06bff); } .evdot.secret { filter: drop-shadow(0 0 6px #f2c35b); } .evdot.rampage { filter: drop-shadow(0 0 6px #ff9b4a); }
.evbig { font-size: 28px; vertical-align: middle; }

/* team-up request: show each person's status (Tony 19 Nov) */
.bondside { display: flex; flex-wrap: wrap; gap: 10px; }
.bondrow { display: flex; align-items: center; gap: 10px; } .bondrow > .bondside { flex: 1; flex-direction: column; }
.bondcard { display: flex; gap: 12px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
img.bondpic { width: 120px; height: 170px; object-fit: cover; object-position: top; border-radius: 10px; flex: none; }
.bondinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.bondinfo .mini { display: grid; grid-template-columns: 1fr; gap: 2px; font-size: 13px; }
.bondinfo .mini > div { display: grid; grid-template-columns: 34px 1fr 30px; align-items: center; gap: 6px; } .bondinfo .mini .bar { max-width: 160px; }
.bondinfo .mini .bar { width: 100%; }
.bondplus { font-size: 20px; font-weight: 700; margin: 6px 0; }
.guildbox { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; background: var(--panel); }
.guildbox.g-blackdragon { border-color: #6b5aa8; } .guildbox.g-greywolf { border-color: #8a93a8; } .guildbox.g-redscorpion { border-color: #a84a4a; }

/* bigger build / upgrade buttons (Tony 19 Nov) */
button[data-sact=build] { font-size: 18px; padding: 10px 26px; margin-top: 8px; background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
button[data-sact=build]:disabled { background: #3a3f5c; color: #c8cbe0; border-color: #565b78; opacity: .75; }
/* guild master portrait */
.hero { position: relative; display: flex; align-items: stretch; }
.heroface { flex: none; display: flex; align-items: flex-end; padding: 10px 0 0 18px; }
img.heroimg { width: 140px; height: 180px; object-fit: cover; object-position: top; border-radius: 12px; border: 2px solid var(--gold); box-shadow: 0 6px 18px rgba(0,0,0,.5); }
img.herobig { width: 240px; height: 330px; object-fit: cover; object-position: top; border-radius: 14px; flex: none; }
.heroemoji { font-size: 90px; display: flex; align-items: center; justify-content: center; }
span.heroimg { width: 140px; height: 180px; } span.herobig { width: 240px; height: 300px; font-size: 140px; }
.heroface.sad { justify-content: center; padding: 0 0 10px; }

/* day-1 applicants (Tony 20 Nov) */
.appgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-height: 70vh; overflow: auto; }
.appcard { display: flex; gap: 10px; padding: 10px; border: 2px solid var(--line); border-radius: 12px; background: var(--panel2); cursor: pointer; }
.appcard.on { border-color: #f2c35b; box-shadow: 0 0 12px rgba(242,195,91,.4); }
img.apppic { width: 110px; height: 160px; object-fit: cover; object-position: top; border-radius: 10px; flex: none; }
.appinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.appinfo .cname { font-size: 20px; margin: 0; } .appinfo .mini { display: grid; gap: 1px; font-size: 12px; }
.appinfo .mini > div { display: grid; grid-template-columns: 52px 1fr 24px; gap: 4px; align-items: center; }
.appsel { margin-top: auto; font-weight: 700; color: var(--accent); }

/* Tony 20 Nov: day-end countdown */
.countpop { text-align: center; min-width: 260px; padding: 30px 40px; }
.countnum { font-size: 96px; font-weight: 800; color: var(--accent, #9b87f5); line-height: 1.1; animation: cpop .7s ease-out; }
@keyframes cpop { from { transform: scale(1.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Tony 20 Nov: shop pages */
.shoptabs button small { opacity: .8; }
.shoppage { margin-top: 8px; }
.shophead { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 10px; }
.shophead .bimg { width: 160px; height: 110px; object-fit: cover; border-radius: 10px; }
.prodgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.prodcard { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.prodcard:hover { border-color: var(--accent, #9b87f5); }
.prodcard img { width: 64px; height: 64px; object-fit: contain; }
.prodcard.empty { opacity: .8; } .prodcard.locked { opacity: .5; }
.prodcard .pname { font-weight: 700; } .prodcard .pfx { color: #a8d8a8; }
.prodpop { display: flex; gap: 18px; max-width: 640px; } .prodpop .pbig img { width: 140px; height: 140px; object-fit: contain; }
.prodcard { align-items: flex-start; text-align: left; }

/* Tony 20 Nov: research */
.resgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rescard { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.reshead2 { display: flex; gap: 12px; align-items: center; } .reshead2 .bimg { width: 110px; height: 76px; object-fit: cover; border-radius: 8px; }
.resrow { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 8px; } .resrow.on { background: rgba(155,135,245,.15); }
.resrow img { width: 40px; height: 40px; object-fit: contain; } .resrow > span { flex: 1; }
.resrow .bar { height: 6px; background: #333a55; border-radius: 3px; margin: 3px 0; } .resrow .bar i { display: block; height: 100%; background: #9b87f5; border-radius: 3px; }
.reslast { background: var(--panel2); border-left: 4px solid #9b87f5; padding: 8px 12px; border-radius: 8px; margin-bottom: 10px; }
.reslast img { width: 32px; height: 32px; vertical-align: middle; }

/* Tony 20 Nov: guild overview (replaces the log) */
.gsumtop { display: flex; gap: 10px; margin-bottom: 8px; } .gsumtop > div { flex: 1; background: var(--panel2); border-radius: 10px; padding: 8px 10px; }
.gsumtop small { display: block; opacity: .7; } .gsumtop b { font-size: 22px; }
table.gstat { width: 100%; border-collapse: collapse; } table.gstat td { padding: 3px 6px; border-bottom: 1px solid var(--line); }
.gcls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* Tony 20 Nov: monsters fought in the results popup */
.monstrip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.moncell { position: relative; width: 84px; text-align: center; background: var(--panel2); border-radius: 8px; padding: 4px; }
.moncell img, .moncell .monph { width: 76px; height: 76px; object-fit: contain; display: block; margin: 0 auto; font-size: 44px; line-height: 76px; }
.moncell.dead img, .moncell.dead .monph { filter: grayscale(.6) brightness(.7); }
.monx { position: absolute; left: 4px; top: 4px; width: 76px; height: 76px; pointer-events: none; }
.monx::before, .monx::after { content: ''; position: absolute; left: 50%; top: 4px; width: 7px; height: 68px; margin-left: -3px; background: #e0262f; border-radius: 3px; box-shadow: 0 0 4px #000; }
.monx::before { transform: rotate(45deg); } .monx::after { transform: rotate(-45deg); }
.monnm { font-size: 11px; line-height: 1.2; margin-top: 2px; }

/* Tony 20 Nov: buildable list beside the town map */
.blist { display: flex; flex-direction: column; gap: 8px; }
.bitem { display: flex; gap: 10px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.bitem .bthumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.bitem .binfo { flex: 1; } .bitem .binfo img.ico { width: 18px; height: 18px; vertical-align: middle; }
.bitem .bact { display: flex; flex-direction: column; gap: 4px; }

/* Tony 20 Nov: results popup — team left, details right */
.reslayout { display: flex; gap: 18px; align-items: flex-start; }
.reslayout .resteam { flex: 0 0 auto; margin-bottom: 0; max-width: 60%; }
.resright { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.lvrow { display: flex; flex-wrap: wrap; gap: 10px; } .lvrow .lvbox { margin: 0; }

/* Tony 20 Nov: quest cards */
.qthumbs { display: inline-flex; gap: 3px; margin-right: 10px; vertical-align: middle; }
.qthumbs img, .qthumbs .qph { width: 38px; height: 38px; object-fit: contain; background: var(--panel2); border-radius: 6px; font-size: 22px; line-height: 38px; text-align: center; display: inline-block; }
.qrow { align-items: center; } .qrow:hover, .wev.quest.clickable:hover { outline: 1px solid var(--accent, #9b87f5); }
.qpgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 12px; }
.qprow { background: var(--panel2); border-radius: 8px; padding: 6px 10px; display: flex; flex-direction: column; } .qprow span { font-size: 12px; }
.qpmons { display: flex; flex-wrap: wrap; gap: 8px; }
.qpmon { width: 96px; text-align: center; background: var(--panel2); border-radius: 10px; padding: 6px; }
.qpmon img, .qpmon .qph { width: 80px; height: 80px; object-fit: contain; display: block; margin: 0 auto; font-size: 46px; line-height: 80px; }
#modal { z-index: 1000; }   /* Tony 20 Nov: map labels were showing through popups */

/* Tony 20 Nov: quest card — two columns, big pictures, little empty space */
#modal .box.qpop { max-width: 1180px; width: 94vw; padding: 16px 20px; }
.qpop h3 { margin: 0 0 6px; } .qpop h4 { margin: 8px 0 6px; } .qpop p { margin: 0 0 6px; }
.qplayout { display: grid; grid-template-columns: minmax(300px, 1fr) 1.4fr; gap: 16px; align-items: start; }
.qpop .qpgrid { grid-template-columns: 1fr 1fr; gap: 6px; margin: 6px 0; }
.qpop .qprow { padding: 5px 9px; }
.qpright .qpmons { gap: 10px; }
.qpright .qpmon { width: 180px; padding: 6px; }
.qpright .qpmon img, .qpright .qpmon .qph { width: 168px; height: 168px; font-size: 90px; line-height: 168px; }
.qpleft .qpmon { width: 104px; } .qpleft .qpmon img { width: 92px; height: 92px; }
.qpop .popnav { margin-top: 10px; }
@media (max-width: 900px) { .qplayout { grid-template-columns: 1fr; } }
.qpleft .qpmon img, .qpleft .qpmon .qph { width: 92px; height: 92px; font-size: 50px; line-height: 92px; }

/* Tony 20 Nov: team overview at the right end of a team frame */
.partycards .teamsum { margin-left: auto; min-width: 210px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; align-self: stretch; }
.teamsum .tshead { font-weight: 700; margin-bottom: 4px; } .teamsum .tspow small { display: block; opacity: .7; } .teamsum .tspow b { font-size: 22px; }
.teamsum table.gstat td { padding: 2px 6px; }
.partyrow { display: flex; gap: 12px; align-items: stretch; } .partyrow .partycards { flex: 1; } .partyrow .teamsum { flex: 0 0 230px; min-width: 210px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }

/* Tony 20 Nov: quest card beside the team in today's plans */
.qmini .qpgrid { grid-template-columns: 1fr 1fr; gap: 6px; margin: 6px 0; }
.qmini .qpmon { width: 120px; } .qmini .qpmon img { width: 108px; height: 108px; object-fit: contain; display: block; margin: 0 auto; }

/* Tony 20 Nov: power after the name, potential at the portrait's top right */
.advpic { position: relative; }
.potbadge { position: absolute; top: 4px; right: 4px; background: rgba(15,18,28,.85); color: #fff; font-weight: 800; border-radius: 6px; padding: 0 7px; font-size: 13px; border: 1px solid #9b87f5; }
.potbadge.pot-S { border-color: #ffd166; color: #ffd166; } .potbadge.pot-A { border-color: #ff8fab; } .potbadge.pot-B { border-color: #9b87f5; }
.potbadge.pot-C { border-color: #5fb3ff; } .potbadge.pot-D { border-color: #6ee7b7; } .potbadge.pot-E, .potbadge.pot-F { border-color: #9aa0b4; }
.advpow { font-weight: 700; color: #ffd166; font-size: 14px; }
.unknowncard .advpic .unk { width: 100%; aspect-ratio: 3/4; display: flex; align-items: center; justify-content: center; font-size: 48px; background: var(--panel2); border-radius: 10px; opacity: .6; }
.unknowncard { opacity: .75; }
.unknowncard .advpic { width: 150px; } .unknowncard .advpic .unk { height: 200px; aspect-ratio: auto; }
.detrow { display: grid; grid-template-columns: minmax(380px, 1.6fr) minmax(220px, 1fr); gap: 10px; align-items: start; }
.detrow .stattbl td { white-space: nowrap; } .ftbl td { padding: 2px 6px; white-space: nowrap; } .detrow .statwin { margin: 0; }

/* ===== Tony 22 Nov layout pass ===== */
.herotoday { margin: 18px 18px 18px auto; align-self: center; min-width: 300px; max-width: 380px; background: rgba(16,18,30,.78); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; backdrop-filter: blur(3px); position: relative; z-index: 1; }
.herotoday .htitle { font-weight: 700; margin-bottom: 6px; }
.herotoday .hrow { display: flex; gap: 8px; font-size: 14px; padding: 3px 0; border-top: 1px solid rgba(255,255,255,.06); }
.gsumwide { margin-top: 14px; }
.gsumwide .gstat { display: none; }
.gsumwide .gstatrow { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 8px; }
.gsumwide .gstatrow div { background: var(--panel2); border-radius: 8px; padding: 6px 10px; text-align: center; }
.gsumwide .gstatrow small { display: block; color: var(--muted); }

.stohead { display: flex; align-items: baseline; gap: 14px; } .stohead h3 { margin: 4px 0 10px; }
.stoempty { text-align: center; padding: 60px 20px; border: 2px dashed var(--line); border-radius: 14px; } .stoempty .big { font-size: 64px; }
.stogrp { margin-bottom: 14px; } .stoglabel { font-weight: 700; margin: 6px 0; }
.stogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.stocard { display: flex; gap: 10px; align-items: center; background: var(--panel2); border: 2px solid var(--line); border-radius: 10px; padding: 6px; }
img.stoimg { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; }
.stoinfo { min-width: 0; font-size: 13px; } .stoinfo b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .stocnt { font-weight: 700; }

.achhead { font-weight: 700; margin: 4px 0 10px; }
.achgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.achcard { display: flex; gap: 14px; align-items: center; background: var(--panel2); border: 2px solid var(--line); border-radius: 14px; padding: 14px; opacity: .75; }
.achcard.got { opacity: 1; border-color: #e2b93b; background: linear-gradient(135deg, rgba(226,185,59,.16), var(--panel2)); }
.achicon { font-size: 44px; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.25); border-radius: 50%; flex: none; }
.achbody { flex: 1; } .achbody b { font-size: 16px; }
.achbar { height: 8px; background: rgba(255,255,255,.08); border-radius: 4px; margin-top: 6px; overflow: hidden; } .achbar span { display: block; height: 100%; background: var(--accent); }

.resprog { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.restier { display: grid; grid-template-columns: 34px 140px 48px 1fr; gap: 8px; align-items: center; margin: 5px 0; }
.restier .rtl { font-weight: 700; color: var(--muted); } .restier .bar { height: 8px; }
.rticons { display: flex; flex-wrap: wrap; gap: 3px; } .rticons img { width: 26px; height: 26px; border-radius: 5px; }

.shophead { display: flex; gap: 14px; align-items: flex-start; }
.shopside { margin-left: auto; min-width: 280px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 14px; line-height: 1.8; }
.lockrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; }
.lockchip { background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--muted); }

.qpunknown { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; border: 2px dashed var(--line); border-radius: 14px;
  background: linear-gradient(rgba(20,22,36,.78), rgba(20,22,36,.9)), url(../images/maps/world.png) center/cover; padding: 20px; }
.qpunknown .qpuz { font-size: 72px; line-height: 1; } .qpunknown b { font-size: 20px; }
.restier .bar { display: block; height: 8px; background: rgba(255,255,255,.08); border-radius: 4px; overflow: hidden; } .restier .bar i { display: block; height: 100%; background: var(--accent); }

/* known / talk lists: 2 columns of cards (Tony 22 Nov) */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(560px, 1fr)); gap: 10px; }
.pgrid .pcard { margin: 0; background: var(--panel); padding: 10px 12px; }
.pgrid .pcard-top { flex-wrap: wrap; align-items: flex-start; }
.pgrid .pcard-top .act { flex-basis: 100%; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.pgrid img.portrait { width: 84px; height: 122px; }
.chatlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); column-gap: 14px; align-content: start; }
.chatlist > h3, .chatlist > p { grid-column: 1 / -1; }
.chatlist img.chatpic { width: 96px; height: 132px; }
.chatlist .chatrow .cw { font-size: 15px; }

.detside { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }

.resmid { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; } .resmid .lvrow { flex: 0 1 auto; } .resloot { flex: 1; min-width: 260px; }
.loottiles { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.ltile { position: relative; width: 76px; background: var(--panel2); border: 2px solid var(--line); border-radius: 8px; padding: 3px; text-align: center; }
img.ltimg { width: 66px; height: 66px; object-fit: cover; border-radius: 6px; display: block; margin: 0 auto; }
.ltile .cnt { position: absolute; right: 4px; top: 48px; font-weight: 700; font-size: 12px; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.ltile .lnm { font-size: 10px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.idleteam { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.idleteam .resmember { width: auto !important; } .idleteam img.respic { width: 100% !important; height: 200px !important; }

#modal .box.evpop { width: min(620px, 92vw); max-width: 620px; }
.evcard { display: flex; gap: 16px; align-items: center; padding: 14px; margin: 8px 0; border-radius: 12px; border: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(20,22,36,.92), rgba(20,22,36,.7)), url(../images/maps/world.png) center/cover; }
.evicon { font-size: 54px; width: 76px; height: 76px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.35); border-radius: 50%; flex: none; }
.evcell { font-weight: 700; font-size: 18px; }

/* results tabs (Tony 22 Nov) */
.rcard { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.rchead { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; } .rchead h3 { margin: 0; } img.rcimg { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; }
.rlines div { padding: 5px 0; border-top: 1px solid rgba(255,255,255,.05); font-size: 14px; }
.sub-results-shops { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; align-items: start; }
.rqgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(560px, 1fr)); gap: 12px; }
.rqgrid .cand.rcard { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.rqteam { display: flex; gap: 4px; flex: none; } img.rqpic { width: 70px; height: 102px; object-fit: cover; object-position: top; border-radius: 8px; }
.rworld { min-height: 260px; }
.ledtop { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.ledtop div { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; } .ledtop small { display: block; color: var(--muted); } .ledtop b { font-size: 24px; }
.ledcols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .ledcols h4 { margin: 0 0 6px; }

.ltbox { width: 66px; height: 66px; margin: 0 auto; border-radius: 6px; background: rgba(0,0,0,.25); display: flex; align-items: center; justify-content: center; }
.ltbox::before { content: '📦'; font-size: 30px; position: absolute; opacity: .5; } .ltbox img { position: relative; }

/* item popup (Tony 22 Nov) */
.clickable { cursor: pointer; } .invcell.clickable:hover, .stocard.clickable:hover { filter: brightness(1.2); transform: translateY(-1px); }
#modal .box.itempop { max-width: 1000px; }
.ipwrap { display: grid; grid-template-columns: 300px 1fr; gap: 22px; }
.ipimg { border: 3px solid var(--line); border-radius: 14px; background: rgba(0,0,0,.3); aspect-ratio: 1; display: flex; align-items: center; justify-content: center; position: relative; }
.ipimg::before { content: '📦'; font-size: 90px; opacity: .4; position: absolute; }
img.ipbig { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; position: relative; }
.ipleft h2 { margin: 10px 0 6px; } .iptbl { width: 100%; margin-top: 10px; } .iptbl td { padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.ipsec { font-weight: 700; margin: 12px 0 6px; } .ipsec:first-child { margin-top: 0; }
.ipmons { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.ipmon { display: flex; gap: 8px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
img.ipmimg { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.iprow { display: flex; gap: 8px; align-items: center; padding: 4px 0; } img.ipsm { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; }

.ipmons.compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 5px; } .ipmons.compact .ipmon { padding: 3px 5px; font-size: 13px; }
.ipmons.compact img.ipmimg { width: 34px; height: 34px; } .ipright { max-height: 70vh; overflow: auto; padding-right: 6px; }

.ipdesc { font-style: italic; color: var(--muted); margin: 0 0 8px; line-height: 1.4; }

/* battle replay (Tony 22 Nov) */
#modal .box.replaypop { max-width: 1300px; }
.rptop { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; } .rpspace { flex: 1; } .rptop button.on { background: var(--accent, #7c6cf0); color: #fff; }
.rpstage { display: grid; grid-template-columns: 1fr 340px 1fr; gap: 16px; align-items: center; min-height: 460px; padding: 18px; border-radius: 14px;
  background: linear-gradient(rgba(14,16,28,.78), rgba(14,16,28,.88)), url(../images/maps/world.png) center/cover; }
.rpside { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-content: center; }
.rpunit { width: 140px; background: rgba(30,33,52,.92); border: 2px solid var(--line); border-radius: 12px; padding: 6px; transition: transform .25s, box-shadow .25s, filter .4s; }
.rpunit.ally { border-color: #4a6fa8; } .rpunit.foe { border-color: #8a4a5a; } .rpunit.boss { border-color: #f2c35b; }
.rpunit.act.ally { transform: translateX(22px) scale(1.06); box-shadow: 0 0 18px rgba(120,170,255,.6); }
.rpunit.act.foe { transform: translateX(-22px) scale(1.06); box-shadow: 0 0 18px rgba(255,110,110,.6); }
.rpunit.down { filter: grayscale(1) brightness(.5); }
.rppic { position: relative; height: 160px; border-radius: 8px; overflow: hidden; background: rgba(0,0,0,.3); display: flex; align-items: center; justify-content: center; }
.rppic img { width: 100%; height: 100%; object-fit: cover; object-position: top; } .rpemoji { font-size: 60px; }
.rpname { font-weight: 700; font-size: 13px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rphp { height: 8px; background: #2a2d44; border-radius: 4px; overflow: hidden; margin-top: 3px; } .rphp i { display: block; height: 100%; background: #5fd08a; transition: width .35s; }
.rpunit.foe .rphp i { background: #e06c6c; } .rphpn { font-size: 11px; color: var(--muted); text-align: right; }
.rpfloat { position: absolute; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.rpfloat span { position: absolute; font-size: 30px; font-weight: 800; text-shadow: 0 0 4px #000, 0 0 4px #000; animation: rpfly 1.2s ease-out forwards; }
.rpfloat .dmg { color: #ff6b6b; } .rpfloat .heal { color: #6bff9a; }
@keyframes rpfly { 0% { transform: translateY(10px) scale(.7); opacity: 0; } 15% { transform: translateY(0) scale(1.15); opacity: 1; } 100% { transform: translateY(-46px) scale(1); opacity: 0; } }
.rptext { min-height: 120px; background: rgba(0,0,0,.45); border-radius: 12px; padding: 14px; font-size: 15px; line-height: 1.5; text-align: center; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.rptext div:last-child { font-weight: 700; } .rpbanner { font-size: 34px; font-weight: 800; }

/* skill hover box (Tony 22 Nov) */
.skchip { position: relative; cursor: help; }
.skchip:hover::after, .skchip:focus::after { content: attr(data-tip); position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 300; width: 280px; white-space: pre-line;
  background: #12141f; border: 1px solid #6b5a2a; border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.45; color: #eee; box-shadow: 0 8px 24px rgba(0,0,0,.6); text-align: left; font-weight: normal; }

/* battle stats (Tony 22 Nov) */
.bstats { margin: 10px 0; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.bshead { margin-bottom: 6px; } .bsgrid { display: grid; gap: 6px; }
.bsrow { display: grid; grid-template-columns: 170px 1fr auto; gap: 12px; align-items: center; padding: 4px 6px; border-radius: 8px; }
.bsrow.mvp { background: rgba(242,195,91,.12); border: 1px solid rgba(242,195,91,.4); }
.bsname { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bsbar { height: 10px; background: #1b1d2c; border-radius: 5px; overflow: hidden; } .bsbar i { display: block; height: 100%; background: linear-gradient(90deg, #c4703d, #ffb35b); }
.bsnums { display: flex; gap: 12px; font-size: 13px; white-space: nowrap; }

/* monster book (Tony 22 Nov) */
.bkzone { margin: 8px 0; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; } .bkzone summary { cursor: pointer; font-size: 16px; }
.bkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.bkcard { background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 10px; padding: 6px; text-align: center; } .bkcard.boss { border-color: #f2c35b; }
.bkpic { height: 120px; display: flex; align-items: center; justify-content: center; } img.bkimg { max-width: 100%; max-height: 120px; object-fit: contain; }
.bkcard.unknown img.bkimg { filter: brightness(0) opacity(.55); } .bkemoji { font-size: 50px; }
.bkname { font-weight: 700; font-size: 13px; margin-top: 4px; } .bkdrops { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; margin-top: 4px; }
img.bkdimg { width: 26px; height: 26px; border-radius: 5px; object-fit: cover; }

/* big map (Tony 22 Nov) */
.wmaptools { display: flex; justify-content: flex-end; margin-bottom: 6px; }
#modal .box.bigmap { width: 96vw; max-width: 1700px; height: 92vh; display: flex; flex-direction: column; }
.bmtop { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; } .bmtop button.on { background: var(--accent, #7c6cf0); color: #fff; }
.bmscroll { flex: 1; overflow: auto; border-radius: 12px; background: #0e1a24; }
.bmgrid { display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: repeat(8, 1fr); width: calc(1520px * var(--bmz)); aspect-ratio: 1216 / 832;
  background: url(../images/maps/world.png) center/100% 100%; }
.bmc { position: relative; border-radius: 0; padding: 3px; overflow: hidden; cursor: pointer; border: 1px solid rgba(255,255,255,.12); font-size: calc(11px * var(--bmz)); }
.bmc:hover { outline: 2px solid #ffd257; } .bmc.sea { background: rgba(20,40,70,.35); border: none; cursor: default; }
.bmc.known { background: rgba(15,18,30,.55); } .bmc.fog { background: rgba(10,12,20,.78); } .bmc.town { background: rgba(120,90,20,.55); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.bmtown { font-size: calc(30px * var(--bmz)); } .bmname { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; }
.bmq { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: calc(30px * var(--bmz)); color: rgba(255,255,255,.25); }
.bmev { position: absolute; right: 3px; top: 2px; font-size: calc(14px * var(--bmz)); }
.bmres { display: flex; gap: 2px; margin-top: 2px; } img.bmri { width: calc(24px * var(--bmz)); height: calc(24px * var(--bmz)); border-radius: 4px; object-fit: cover; }
.bmmons { display: flex; align-items: flex-end; gap: 1px; margin-top: 2px; } img.bmmon { width: calc(34px * var(--bmz)); height: calc(34px * var(--bmz)); object-fit: contain; }
.bmmore { font-size: calc(11px * var(--bmz)); color: var(--muted); }
.z-forest.bmc.known { box-shadow: inset 0 0 0 2px rgba(80,160,80,.5); } .z-coast.bmc.known { box-shadow: inset 0 0 0 2px rgba(70,140,220,.5); }
.z-mountain.bmc.known { box-shadow: inset 0 0 0 2px rgba(160,140,120,.5); } .z-ruins.bmc.known { box-shadow: inset 0 0 0 2px rgba(180,150,90,.5); }
.z-wasteland.bmc.known { box-shadow: inset 0 0 0 2px rgba(150,110,90,.5); } .z-desert.bmc.known, .z-grassland.bmc.known { box-shadow: inset 0 0 0 2px rgba(170,200,90,.5); }
.z-demon.bmc.known { box-shadow: inset 0 0 0 2px rgba(180,60,80,.5); }

img.bmri[src=''], .bmres img:not([src]) { display: none; }

/* intro + tips + NEW badge (Tony 22 Nov) */
#introlay { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: flex-end; justify-content: center; }
#introlay .intbg { position: absolute; inset: 0; background: linear-gradient(rgba(5,6,12,.35), rgba(5,6,12,.85)), url(../images/maps/town.png) center/cover; transition: filter 1s; }
#introlay .intbg.dark { background: linear-gradient(rgba(20,0,10,.45), rgba(5,0,8,.9)), url(../images/maps/world.png) center/cover; }
#introlay .intbox { position: relative; width: min(900px, 92vw); margin-bottom: 8vh; background: rgba(12,13,22,.88); border: 1px solid #6b5a2a; border-radius: 16px; padding: 26px 30px; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
#introlay .inttext { font-size: 24px; line-height: 1.6; margin: 0 0 18px; animation: intfade .8s ease-out; }
@keyframes intfade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#introlay .intnav { display: flex; align-items: center; gap: 8px; }
#tipbox { position: fixed; right: 24px; bottom: 24px; z-index: 2500; width: 340px; background: #12141f; border: 2px solid #f2c35b; border-radius: 14px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.6); animation: intfade .4s; }
#tipbox .tiptitle { font-weight: 800; margin-bottom: 4px; color: #ffd257; } #tipbox .tipnav { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }
.tipglow { outline: 3px solid #f2c35b !important; outline-offset: 2px; animation: tipglow 1.2s ease-in-out infinite; position: relative; z-index: 5; }
@keyframes tipglow { 50% { outline-color: rgba(242,195,91,.25); } }
.newbadge { display: inline-block; background: #e0453a; color: #fff; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 8px; margin-left: 6px; vertical-align: middle; }

/* intro with pictures (Tony 22 Nov) */
#introlay { flex-direction: column; align-items: center; justify-content: center; gap: 0; }
#introlay .intbg { filter: blur(14px) brightness(.45); transform: scale(1.1); }
#introlay .intpic { position: relative; width: min(1100px, 90vw); aspect-ratio: 1216 / 832; max-height: 62vh; border-radius: 14px 14px 0 0; overflow: hidden; border: 2px solid #b8963e; border-bottom: none; box-shadow: 0 0 40px rgba(242,195,91,.25); }
#introlay .intpic img { width: 100%; height: 100%; object-fit: cover; animation: intzoom 9s ease-out forwards; }
@keyframes intzoom { from { transform: scale(1.08); } to { transform: scale(1); } }
#introlay .intbox { width: min(1100px, 90vw); margin: 0; border-radius: 0 0 14px 14px; border: 2px solid #b8963e; border-top: 1px solid rgba(184,150,62,.5);
  background: linear-gradient(#1c1710, #120f0a); font-family: Georgia, 'Times New Roman', serif; }
#introlay .inttext { font-size: 22px; color: #f3e6c4; text-align: center; }

/* page guide (Tony 22 Nov) */
#tourbox { position: fixed; z-index: 2600; width: 340px; background: #12141f; border: 2px solid #7fb0ff; border-radius: 14px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.6); animation: intfade .3s; }
#tourbox .tiptitle { font-weight: 800; margin-bottom: 4px; color: #9fc4ff; } #tourbox .tipnav { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }
.tourglow { outline: 3px solid #7fb0ff !important; outline-offset: 3px; box-shadow: 0 0 0 9999px rgba(0,0,0,.45) !important; position: relative; z-index: 6; border-radius: 10px; }

/* monster popup + faces (Tony 22 Nov) */
#modal .box.monpop { max-width: 1000px; }
.mppic { border: 3px solid var(--line); border-radius: 14px; background: radial-gradient(#2a2f48, #10121c); aspect-ratio: 1; display: flex; align-items: center; justify-content: center; } .mppic.boss { border-color: #f2c35b; }
img.mpbig { max-width: 92%; max-height: 92%; object-fit: contain; } img.mpbig.unknown { filter: brightness(0) opacity(.6); }
.appview { font-size: 14px; margin-left: 4px; } [data-mon].clickable:hover, [data-person].clickable:hover { filter: brightness(1.25); }

/* ===== Battle replay v2 (Tony 25 Nov approved, from js/replay2.js) ===== */
  .b2wrap{position:relative;margin:0 auto;overflow:hidden;border-radius:14px}
  .b2scene{position:absolute;left:0;top:0;width:1600px;height:900px;transform-origin:0 0;overflow:hidden;font-family:inherit;color:#fff}
  .b2bg{position:absolute;inset:0;background:linear-gradient(#1d3a3f 0%,#2f5a4a 38%,#3d6b3f 52%,#2c4a2a 100%)}
  .b2trees{position:absolute;left:0;right:0;top:120px;height:360px;width:100%}
  .b2ground{position:absolute;left:-10%;right:-10%;bottom:-120px;height:560px;background:radial-gradient(ellipse at 50% 30%,#5d7f45 0%,#3e5a2f 45%,#24361c 80%);transform:perspective(900px) rotateX(58deg);border-radius:50%}
  .b2fog{position:absolute;inset:0;background:radial-gradient(ellipse at 50% 120%,rgba(0,0,0,0) 40%,rgba(0,0,0,.55) 100%);pointer-events:none}
  .b2ray{position:absolute;top:-100px;width:180px;height:900px;background:linear-gradient(rgba(255,240,180,.18),rgba(255,240,180,0));transform:rotate(18deg);filter:blur(8px)}
  .b2hud{position:absolute;top:18px;left:24px;right:24px;display:flex;align-items:center;gap:10px;z-index:90}
  .b2pill{background:rgba(10,11,20,.8);border:1px solid #6b5a2a;border-radius:999px;padding:6px 14px;font-size:16px;color:#fff;cursor:pointer} .b2pill.on{background:#6b5a2a}
  .b2unit{position:absolute;transition:transform .25s ease-out,filter .4s,opacity .6s}
  .b2fig{position:relative}
  .b2shadow{position:absolute;left:12%;right:12%;bottom:-10px;height:26px;background:radial-gradient(rgba(0,0,0,.6),rgba(0,0,0,0) 70%)}
  .b2spr{position:absolute;inset:0} .b2spr img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
  .b2mon{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 6px 4px rgba(0,0,0,.35))}
  .b2emoji{font-size:90px;display:block;text-align:center;line-height:230px}
  .b2plate{margin:6px auto 0;width:170px;background:linear-gradient(rgba(20,22,36,.92),rgba(10,11,20,.92));border:1px solid #6b5a2a;border-radius:8px;padding:5px 8px}
  .b2plate b{font-size:15px} .b2plate span{color:#e8d18a;font-size:12px;margin-left:6px}
  .b2bar{position:relative;height:9px;background:#1b1d2c;border-radius:5px;overflow:hidden;margin-top:4px}
  .b2bar i{position:absolute;left:0;top:0;bottom:0;width:100%} .b2bar .lag{background:#fff;transition:width .9s .35s} .b2bar .now{background:#5fd36f;transition:width .25s}
  .b2unit.foe .b2bar .now{background:#e06c6c}
  .b2unit.act.ally{transform:translateX(60px) scale(1.06)} .b2unit.act.foe{transform:translateX(-60px) scale(1.06)}
  .b2unit.hit .b2fig{animation:b2shake .35s}
  @keyframes b2shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-9px)}50%{transform:translateX(8px)}75%{transform:translateX(-4px)}}
  .b2unit.down{filter:grayscale(1) brightness(.45);opacity:.6}
  .b2fx{position:absolute;inset:0;pointer-events:none}
  .b2fx i{position:absolute;left:50%;top:50%;width:24px;height:24px;margin:-12px;border-radius:50%}
  .b2fx i.boom{background:radial-gradient(circle,#fff 0%,var(--c) 35%,transparent 70%);animation:b2boom .6s ease-out forwards}
  .b2fx i.heal{background:radial-gradient(circle,#eaffef 0%,#7be0a0 40%,transparent 70%);animation:b2boom .7s ease-out forwards}
  @keyframes b2boom{0%{transform:scale(.3);opacity:1}100%{transform:scale(8);opacity:0}}
  .b2float{position:absolute;left:0;right:0;top:15%;text-align:center;pointer-events:none;z-index:5}
  .b2float span{display:block;font-weight:900;font-size:40px;color:#fff;-webkit-text-stroke:2px #8a1010;text-shadow:0 3px 0 #500;animation:b2up 1.2s ease-out forwards}
  .b2float .dmg.crit{color:#ffd34d;font-size:52px} .b2float .heal{color:#b8ffc4;-webkit-text-stroke:2px #106a2a;text-shadow:0 3px 0 #053}
  @keyframes b2up{0%{transform:translateY(10px) scale(.6);opacity:0}15%{transform:translateY(0) scale(1.15);opacity:1}100%{transform:translateY(-60px) scale(1);opacity:0}}
  .b2acts{position:absolute;right:10px;top:4px;font-weight:900;font-size:26px;color:#ffe680;text-shadow:0 2px 3px #000}
  .b2cutin{position:absolute;left:0;right:0;top:330px;z-index:80;pointer-events:none}
  .b2ci{display:flex;align-items:center;justify-content:center;gap:30px;height:170px;background:linear-gradient(90deg,rgba(0,0,0,0),rgba(0,0,0,.82) 15%,rgba(0,0,0,.82) 85%,rgba(0,0,0,0));
    border-top:4px solid var(--c);border-bottom:4px solid var(--c);transform:skewY(-4deg);animation:b2ci .75s ease-out;overflow:hidden}
  .b2ci.foe{flex-direction:row-reverse}
  .b2ci b{font-size:54px;color:#fff;letter-spacing:2px;text-shadow:0 0 18px var(--c);transform:skewY(4deg)}
  .b2cipic{position:relative;width:240px;height:240px;margin-top:50px;transform:skewY(4deg)} .b2cipic img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 0 12px #000)}
  @keyframes b2ci{0%{transform:skewY(-4deg) scaleX(0);opacity:0}25%{transform:skewY(-4deg) scaleX(1);opacity:1}80%{opacity:1}100%{opacity:0}}
  .b2log{position:absolute;bottom:22px;left:50%;transform:translateX(-50%);min-width:720px;text-align:center;background:linear-gradient(90deg,rgba(0,0,0,0),rgba(8,9,16,.85) 15%,rgba(8,9,16,.85) 85%,rgba(0,0,0,0));padding:12px 60px;font-size:20px;z-index:85}
  .b2vs{position:absolute;inset:0;background:rgba(0,0,0,.7);display:flex;align-items:center;justify-content:center;gap:60px;z-index:95;transition:opacity .5s;font-size:34px;font-weight:800;text-align:center}
  .b2vs small{display:block;font-size:18px;color:#aaa;font-weight:400} .b2vs b{font-size:90px;color:#ffd257;text-shadow:0 0 24px #a60} .b2vs.off{opacity:0;pointer-events:none}
  .b2win{position:absolute;inset:0;background:radial-gradient(rgba(0,0,0,.4),rgba(0,0,0,.85));display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:96;animation:b2fade .5s}
  .b2win h1{font-size:96px;margin:0;color:#ffd257;text-shadow:0 0 30px #a60} .b2win.bad h1{color:#ff8a8a;text-shadow:0 0 30px #600}
  .b2mvp{display:flex;gap:24px;margin-top:20px} .b2mvp div{background:rgba(20,22,36,.9);border:1px solid #6b5a2a;border-radius:12px;padding:12px 22px;text-align:center;font-size:16px} .b2mvp b{display:block;font-size:30px;color:#ffd257}
  @keyframes b2fade{from{opacity:0}to{opacity:1}}
