/* ================= v2: Vạn Giới ================= */
[hidden] { display: none !important; }
.fill.en { background: linear-gradient(90deg, #6b5bff, #3cf0ff); }
#enRow.ready .bar { box-shadow: 0 0 10px #3cf0ff; animation: lowhp 1s infinite; }
#enRow .bar span { font-size: 15px; }
.hslot { border-color: var(--rc, #3a2a1a); }
.hslot.active { border-color: var(--rc, var(--gold)); box-shadow: 0 0 14px var(--rc, rgba(255,207,58,0.45)); }
.toast.love { border-color: #ff8ab8; color: #ffc6dc; }
#saveInfo { font-size: 18px; color: var(--muted); text-shadow: 1px 1px 0 #000; margin-top: -6px; }
#comphud { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.cpm { display: flex; gap: 6px; align-items: center; background: var(--panel); border: 1px solid #5a2a40; padding: 2px 6px 2px 2px; width: fit-content; font-size: 16px; }
.cpm img { width: 34px; height: 34px; object-fit: cover; border: 1px solid #ff8ab8; }
.cpm b { color: #ffb3cf; font-weight: normal; }
.cpm span { color: #ff8ab8; font-size: 13px; }
.cphp { width: 80px; height: 4px; background: #300; }
.cphp i { display: block; height: 100%; background: #4fd16a; }
.cpm.down { filter: grayscale(1); }
.cpm.love { animation: bloodp 1.2s infinite; border-color: #ff8ab8; }
#combo { position: absolute; right: 230px; top: 70px; font-size: 40px; color: #ffcf3a; text-shadow: 3px 3px 0 #000, 0 0 16px #ff8a00; opacity: 0; transition: opacity .3s; transform: rotate(-6deg); }
#combo.pop { animation: cpop .4s; }
@keyframes cpop { 0% { transform: rotate(-6deg) scale(1.8); } 100% { transform: rotate(-6deg) scale(1); } }
#skillflash { position: absolute; left: 0; right: 0; top: 34%; text-align: center; font-size: clamp(48px, 9vw, 110px); letter-spacing: 8px; opacity: 0; text-shadow: 0 0 30px currentColor, 4px 4px 0 #000; pointer-events: none; }
#skillflash.go { animation: skf 1.3s ease-out; }
@keyframes skf { 0% { opacity: 0; transform: scale(2.2); } 15% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: scale(1.05); } }
#banner { position: absolute; left: 0; right: 0; top: 22%; text-align: center; opacity: 0; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(0,0,0,0.75), transparent); padding: 8px 0; }
#banner h2 { font-size: clamp(36px, 6vw, 64px); letter-spacing: 6px; text-shadow: 3px 3px 0 #000; }
#banner p { font-size: 22px; color: var(--text); }
#banner.go { animation: ban 3.2s; }
@keyframes ban { 0% { opacity: 0; transform: scaleY(0.2); } 10%, 80% { opacity: 1; transform: scaleY(1); } 100% { opacity: 0; } }
#lootcard { position: absolute; top: 120px; left: 50%; transform: translateX(-50%); width: 300px; text-align: center; background: linear-gradient(#1a1410, #0b0806); border: 3px solid var(--rc); box-shadow: 0 0 30px var(--rc); padding: 8px 12px; opacity: 0; pointer-events: none; }
#lootcard.go { animation: lcard 3.6s; }
@keyframes lcard { 0% { opacity: 0; transform: translateX(-50%) scale(0.5) rotate(-4deg); } 8% { opacity: 1; transform: translateX(-50%) scale(1.08); } 14%, 85% { opacity: 1; transform: translateX(-50%) scale(1); } 100% { opacity: 0; transform: translateX(-50%) translateY(-30px); } }
.lc-r { color: var(--rc); letter-spacing: 4px; font-size: 18px; }
#lootcard img { width: 70px; height: 70px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 0 8px var(--rc)); }
#lootcard b { display: block; color: var(--rc); font-size: 24px; font-weight: normal; }
#lootcard small { color: var(--muted); font-size: 15px; }
#lootcard p { font-size: 16px; line-height: 1.05; margin-top: 4px; text-align: left; }
#fader { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .4s; z-index: 40; }
#fader.on { opacity: 1; }

/* dialog */
#dialog { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; justify-content: flex-end; padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(transparent 40%, rgba(0,0,0,0.6)); }
#dialog.cine { background: rgba(0,0,0,0.88); justify-content: center; }
#dialog.cine .dbox { background: transparent; border: none; box-shadow: none; }
#dialog.cine .dtext { font-size: clamp(24px, 3vw, 38px); text-align: center; }
#dTitle { text-align: center; font-size: clamp(30px, 4vw, 50px); color: var(--gold); letter-spacing: 4px; text-shadow: 3px 3px 0 #000; margin-bottom: 14px; }
.dbox { display: flex; gap: 14px; align-items: flex-end; max-width: 980px; width: 100%; margin: 0 auto; background: rgba(14,10,14,0.94); border: 3px solid #6a3a52; box-shadow: 0 0 0 3px #000, 0 10px 40px rgba(0,0,0,0.7); padding: 12px 16px; }
#dPort { width: clamp(110px, 18vw, 190px); aspect-ratio: 1; object-fit: cover; border: 3px solid #ff8ab8; box-shadow: 0 0 18px rgba(255,138,184,0.4); margin-top: -70px; flex-shrink: 0; max-width: 100%; }
.dmain { flex: 1; min-width: 0; }
#dName { color: #ff8ab8; font-size: 26px; letter-spacing: 2px; }
.dtext { font-size: clamp(20px, 2.2vw, 27px); line-height: 1.15; min-height: 2.4em; }
.dtext.sys { color: #d8cfe8; font-style: italic; }
.dtext.hero { color: #9ad8ff; }
#dChoices { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.dchoice { min-width: 0; text-align: left; font-size: 21px; letter-spacing: 0; padding: 4px 12px; }
#dHint { text-align: right; color: var(--muted); animation: blink 1s infinite; }

/* world select */
#worlds { background: radial-gradient(ellipse at center, #1a1220, #050405); overflow: auto; align-items: flex-start; }
.worlds-wrap { width: min(1200px, 100%); padding: 20px 16px; }
.wtitle { text-align: center; font-size: clamp(36px, 5vw, 60px); color: var(--gold); letter-spacing: 6px; text-shadow: 3px 3px 0 #000; margin-bottom: 14px; }
#worldCards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.wcard { background: #0e0b10; border: 3px solid #2a2030; cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s; overflow: hidden; }
.wcard:hover { transform: translateY(-6px); border-color: var(--wc); box-shadow: 0 0 26px var(--wc); }
.wimg { height: 150px; background-size: cover; background-position: center; image-rendering: pixelated; }
.wbody { padding: 8px 10px 12px; }
.wbody h3 { color: var(--wc); font-size: 30px; letter-spacing: 2px; }
.wbody b { display: block; font-weight: normal; color: var(--text); font-size: 18px; margin-bottom: 4px; }
.wbody p { font-size: 16px; color: var(--muted); line-height: 1.1; }
#worldPick { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; align-items: start; }
#pickArt { aspect-ratio: 16/9; max-width: 100%; background-size: cover; background-position: center; border: 3px solid var(--edge); image-rendering: pixelated; }
.pickbox h2 { font-size: 44px; color: var(--gold); }
.pickbox label { display: block; font-size: 20px; color: var(--muted); }
#heroName { width: 100%; font-family: var(--font); font-size: 28px; background: #000; color: var(--text); border: 2px solid var(--edge); padding: 4px 10px; margin: 4px 0 10px; }
#pickComps { display: flex; gap: 12px; margin: 8px 0; flex-wrap: wrap; }
.pc { display: flex; flex-direction: column; align-items: center; width: 130px; text-align: center; }
.pc img { width: 110px; height: 110px; object-fit: cover; border: 2px solid #ff8ab8; }
.pc b { font-weight: normal; color: #ffb3cf; font-size: 20px; }
.pc span { font-size: 15px; color: var(--muted); line-height: 1; }

/* inventory v2 */
.tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.tabs button { min-width: 0; font-size: 20px; padding: 2px 14px; }
.tabs button.on { border-color: var(--gold); color: var(--gold); }
.gequip, .gstash { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.geqs { display: flex; flex-direction: column; align-items: center; width: 74px; text-align: center; }
.geqs small { font-size: 14px; color: var(--muted); line-height: 1; }
.gslot { position: relative; width: 64px; height: 64px; background: rgba(0,0,0,0.55); border: 2px solid var(--rc, #333); box-shadow: inset 0 0 12px var(--rc, transparent); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.gslot.empty { border-style: dashed; border-color: #333; box-shadow: none; cursor: default; }
.gslot img { max-width: 48px; max-height: 44px; image-rendering: pixelated; }
.gslot .gl { position: absolute; bottom: -2px; right: 3px; font-size: 13px; color: var(--muted); }
.gdetail { min-height: 90px; }
.gd { display: flex; gap: 12px; border: 2px solid var(--rc); padding: 8px; background: rgba(0,0,0,0.4); }
.gd img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; }
.gd b { font-size: 24px; font-weight: normal; }
.gd p { font-size: 18px; line-height: 1.1; margin: 4px 0; }
.gd button { min-width: 0; font-size: 18px; padding: 2px 12px; }
.ggrid { display: grid; grid-template-columns: repeat(auto-fill, 64px); gap: 6px; }
.comps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.compc { display: flex; gap: 10px; background: rgba(40,10,25,0.5); border: 2px solid #6a3a52; padding: 8px; }
.compc img { width: 96px; height: 96px; object-fit: cover; border: 2px solid #ff8ab8; flex-shrink: 0; }
.compc.locked img { filter: brightness(0.15); }
.compc b { font-weight: normal; font-size: 24px; color: #ffb3cf; }
.compc small { display: block; color: var(--muted); font-size: 16px; }
.compc p { font-size: 16px; line-height: 1.05; }
.affbar { height: 8px; background: #200; margin: 4px 0; }
.affbar i { display: block; height: 100%; background: linear-gradient(90deg, #ff5a8a, #ffb3cf); }
.hearts { color: #ff8ab8; font-size: 16px; }
.stats2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; font-size: 19px; }
#lvlRank { font-size: 26px; color: var(--gold); margin-top: -6px; }
#winPort { width: 140px; height: 140px; object-fit: cover; border: 3px solid #ff8ab8; box-shadow: 0 0 30px #ff8ab8; margin-bottom: 8px; max-width: 100%; }
#mapInfo { margin-top: 6px; font-size: 18px; }

/* touch v2 */
#tDash, #tSkill { display: none; }
body.touch.tplay #tDash, body.touch.tplay #tSkill { display: flex; position: fixed; z-index: 5; align-items: center; justify-content: center; padding: 0; min-width: 0; border-radius: 50%; letter-spacing: 0; font-size: 14px; box-shadow: 0 4px 0 #000; }
#tDash { right: calc(110px + env(safe-area-inset-right, 0px)); bottom: calc(92px + env(safe-area-inset-bottom, 0px)); width: 56px; height: 56px; background: radial-gradient(circle at 40% 35%, #2a6b8a, #0c2430); border: 2px solid #8ad8ff; }
#tSkill { right: calc(22px + env(safe-area-inset-right, 0px)); bottom: calc(112px + env(safe-area-inset-bottom, 0px)); width: 66px; height: 66px; border: 3px solid #555; background: conic-gradient(#ffcf3a var(--en, 0%), #1a1a22 0); font-size: 13px; text-shadow: 1px 1px 0 #000; }
#tSkill.full { border-color: #ffcf3a; animation: pulse 1s infinite; box-shadow: 0 0 20px #ffcf3a; }
#tSkill.down, #tDash.down { transform: scale(0.9); }
body.touch.tplay #tbtns { bottom: calc(186px + env(safe-area-inset-bottom, 0px)); grid-template-columns: repeat(3, 44px); }
body.touch #tbtns button { width: 44px; height: 44px; }
body.touch #comphud .cpm { font-size: 13px; }
body.touch .cpm img { width: 24px; height: 24px; }
body.touch .cphp { width: 50px; }
body.touch #combo { right: 120px; top: 150px; font-size: 26px; }
body.touch #lootcard { top: 60px; width: 240px; padding: 4px 8px; }
body.touch #lootcard p { display: none; }
body.touch .dbox { padding: 6px 10px; }
body.touch #dPort { width: 90px; margin-top: -40px; }
body.touch .dtext { font-size: 18px; min-height: 0; }
body.touch .dchoice { font-size: 17px; padding: 2px 8px; }
body.touch #dName { font-size: 18px; }
body.touch #dialog.cine .dtext { font-size: 22px; }
body.touch #enRow .bar span { font-size: 11px; }
body.touch #banner h2 { font-size: 30px; }
body.touch #banner p { font-size: 16px; }
@media (max-width: 800px) { #worldPick { grid-template-columns: 1fr; } .stats2 { grid-template-columns: 1fr; } .wimg { height: 100px; } .wbody p { display: none; } }

/* 3D views */

/* ---------- v3: gender pick, shop, save files ---------- */
.gender { display: flex; gap: 8px; margin: 8px 0 2px; }
.gender button { min-width: 0; flex: 1; font-size: 22px; padding: 2px 10px; }
.gender button.on { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 10px rgba(255,207,58,0.35); }
.pc em { font-style: normal; font-size: 14px; line-height: 1.1; margin-top: 2px; }
.pc em.rom { color: #ff8ab8; }
.pc em.bond { color: var(--gold); }
#dPort.pop { animation: portpop .22s ease-out; }
@keyframes portpop { from { transform: scale(0.94); filter: brightness(1.4); } to { transform: none; filter: none; } }
.shophead { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; padding-right: 40px; }
.shophead img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; background: rgba(0,0,0,0.5); border: 2px solid var(--gold); }
.shophead h2 { margin: 0; font-size: 28px; }
.shophead p { margin: 2px 0 0; color: var(--muted); font-size: 18px; line-height: 1.1; }
.shophead > div:nth-child(2) { flex: 1; min-width: 0; }
#shopGold { display: flex; align-items: center; gap: 6px; font-size: 30px; color: var(--gold); white-space: nowrap; }
#shopGold img { width: 34px; image-rendering: pixelated; }
#shopGold small { font-size: 16px; color: var(--muted); }
#shopBody h3 { margin: 10px 0 6px; font-size: 22px; color: var(--gold); font-weight: normal; }
#shopBody h3 small { color: var(--muted); font-size: 15px; }
.srows { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 6px; }
.srow { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,0.45); border: 2px solid var(--rc, #3a2a1a); padding: 4px 8px; min-width: 0; }
.srow > img { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; flex-shrink: 0; }
.srow .sinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.05; }
.srow .sinfo b { font-weight: normal; font-size: 19px; }
.srow .sinfo small { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow button { min-width: 0; font-size: 17px; padding: 1px 10px; letter-spacing: 1px; }
.srow button.dim, .menu button.dim { opacity: 0.45; }
.price { display: flex; align-items: center; gap: 3px; color: var(--gold); font-size: 20px; white-space: nowrap; }
.price img { width: 18px; image-rendering: pixelated; }
.chestrow { box-shadow: inset 0 0 14px var(--rc); }
.chestrow > img { width: 48px; height: 48px; }
.menu.row.wrap { flex-wrap: wrap; }
.filebtn { display: inline-flex; align-items: center; justify-content: center; font-size: 28px; letter-spacing: 3px; padding: 6px 20px; cursor: pointer; border: 2px solid var(--edge); background: linear-gradient(#4a1e0e, #24100a); color: var(--text); }
.filebtn input { display: none; }
#sioText { width: 100%; height: 140px; margin-top: 10px; background: rgba(0,0,0,0.6); color: #cfe8c0; border: 2px solid var(--edge); font-family: monospace; font-size: 12px; resize: vertical; user-select: text; }
#saveio .menu button, .filebtn { min-width: 0; font-size: 22px; }
@media (max-width: 800px) { .srows { grid-template-columns: 1fr; } .shophead h2 { font-size: 22px; } #shopGold { font-size: 22px; } }
.pickbox { min-width: 0; }
.gender button, #worldPick .menu.row button, #saveio .menu button, .shophead button { min-width: 0 !important; flex: 1 1 auto; }
#worldPick .menu.row { flex-wrap: nowrap; }
body.touch #shop button, body.touch #saveio button, body.touch .gender button, body.touch #inv .tabs button { min-width: 0; }
#shop .tabs button { flex: 1; }
@media (max-width: 640px) {
  .shophead { flex-wrap: wrap; gap: 8px; }
  .shophead img { width: 44px; height: 44px; }
  .shophead h2 { font-size: 20px; line-height: 1; }
  .shophead p { font-size: 15px; }
  #shopGold { width: 100%; }
  .srow { flex-wrap: wrap; }
  .srow .sinfo { flex-basis: calc(100% - 52px); }
  .srow .price { margin-left: 48px; }
  .srow button { font-size: 16px; margin-left: auto; }
}

/* ---------- v4: gacha, pets, journal ---------- */
#tmenu .gbtn { background: linear-gradient(#5a3a8a, #24104a); border-color: #c08bff; }
.gpanel { max-width: 980px; }
.ghead { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-right: 40px; }
.ghead h2 { margin: 0; flex: 1; min-width: 0; color: #ffe6a0; text-shadow: 0 0 12px rgba(255,200,80,0.5); }
.gcur { display: flex; align-items: center; gap: 6px; font-size: 26px; color: var(--gold); }
.gcur img { width: 30px; image-rendering: pixelated; }
.gcur small { font-size: 15px; color: var(--muted); }
.gbanner { display: flex; gap: 16px; align-items: center; margin: 10px 0; padding: 12px; background: radial-gradient(ellipse at 20% 50%, rgba(160,90,255,0.35), rgba(10,8,20,0.9) 70%); border: 2px solid #6a4aa0; }
.galtar { width: 150px; image-rendering: pixelated; animation: gfloat 3s ease-in-out infinite; flex-shrink: 0; }
@keyframes gfloat { 50% { transform: translateY(-6px); filter: drop-shadow(0 0 14px #c08bff); } }
.gbtext { min-width: 0; flex: 1; }
.gbtext b { color: #ffe6a0; font-weight: normal; font-size: 22px; }
#gFeat { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.gfp { display: flex; flex-direction: column; align-items: center; font-size: 14px; color: #ffe6a0; width: 84px; text-align: center; line-height: 1; }
.gfp img { width: 52px; height: 52px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 0 8px #ffcf4a); }
#gPity { color: #c8b8ff; font-size: 18px; margin: 4px 0; }
.gbtns button { min-width: 0; font-size: 22px; }
.gbtns button.gold { background: linear-gradient(#a07818, #4a3208); border-color: #ffd65a; color: #fff6d0; }
.gbtns button:disabled { opacity: 0.4; }
.ganim { position: fixed; inset: 0; z-index: 40; overflow: hidden; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 10px; padding: 20px; cursor: pointer; }
.ganim .gsky { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 120%, #2a1850, #05040c 70%); z-index: -2; }
.ganim .gsky::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(1px 1px at 10% 20%, #fff, transparent), radial-gradient(1px 1px at 30% 70%, #fff, transparent), radial-gradient(2px 2px at 60% 30%, #fff, transparent), radial-gradient(1px 1px at 80% 60%, #fff, transparent), radial-gradient(1px 1px at 45% 10%, #fff, transparent), radial-gradient(2px 2px at 90% 15%, #fff, transparent); opacity: 0.7; }
.ganim .gstreak { position: absolute; left: 110%; top: -10%; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 20px 8px var(--sc), 0 0 60px 20px var(--sc); z-index: -1; animation: gstreak 1.6s cubic-bezier(.5,0,.9,.6) forwards; }
.ganim .gstreak::after { content: ''; position: absolute; right: -300px; top: 4px; width: 300px; height: 6px; background: linear-gradient(90deg, var(--sc), transparent); transform-origin: left center; transform: rotate(-32deg); filter: blur(1px); }
@keyframes gstreak { to { left: 45%; top: 55%; } }
.ganim .gflash { position: absolute; inset: 0; background: var(--sc); opacity: 0; z-index: -1; pointer-events: none; }
.ganim.rev .gflash { animation: gflash .8s ease-out; }
.ganim.rev .gstreak { display: none; }
@keyframes gflash { 0% { opacity: 0.85; } 100% { opacity: 0; } }
#gCards { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 900px; }
.gcard { width: 150px; min-height: 190px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; text-align: center; background: linear-gradient(#1a1430, #0a0814); border: 2px solid #6fb8ff; box-shadow: 0 0 16px rgba(111,184,255,0.5); opacity: 0; transform: rotateY(90deg) scale(0.8); animation: gflip .45s ease-out forwards; }
.gcard.st4 { border-color: #c07bff; box-shadow: 0 0 22px rgba(192,123,255,0.7); }
.gcard.st5 { border-color: #ffcf4a; box-shadow: 0 0 30px rgba(255,207,74,0.9); background: linear-gradient(#3a2a08, #120c02); }
.gcard img { width: 72px; height: 72px; object-fit: contain; image-rendering: pixelated; }
.gcard b { font-weight: normal; font-size: 17px; line-height: 1.05; }
.gcard i { font-style: normal; font-size: 14px; color: #c8b8ff; }
.gst { color: #ffd65a; font-size: 16px; letter-spacing: 1px; }
.gcard.st3 .gst { color: #6fb8ff; } .gcard.st4 .gst { color: #c07bff; }
@keyframes gflip { to { opacity: 1; transform: none; } }
#gCont { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); min-width: 0; }
.petgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.petc { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 8px; background: rgba(0,0,0,0.45); border: 2px solid var(--pc); box-shadow: inset 0 0 14px var(--pc); }
.petc.locked { filter: grayscale(1) brightness(0.45); border-color: #333; box-shadow: none; }
.petc.on { box-shadow: 0 0 18px var(--pc), inset 0 0 14px var(--pc); }
.petc img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; }
.petc b { font-weight: normal; font-size: 20px; color: var(--pc); }
.petc .pst { color: #ffd65a; font-size: 15px; }
.petc small { color: var(--muted); font-size: 15px; line-height: 1.05; min-height: 32px; }
.petc button { min-width: 0 !important; font-size: 17px; padding: 1px 10px; }
.cxsum { display: flex; flex-wrap: wrap; gap: 14px; font-size: 19px; color: var(--muted); }
.cxsum b { color: var(--gold); font-weight: normal; }
.cxgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.cxb, .cxw { display: flex; flex-direction: column; align-items: center; text-align: center; font-size: 15px; line-height: 1.05; background: rgba(0,0,0,0.4); border: 1px solid #3a2a1a; padding: 4px; }
.cxb img { width: 100%; height: 48px; object-fit: cover; image-rendering: pixelated; }
.cxw img { width: 90px; height: 90px; object-fit: contain; image-rendering: pixelated; }
.cxb.locked img, .cxw.locked img { filter: brightness(0) opacity(0.5); }
.cxb.locked span, .cxw.locked span { color: #666; }
.srow.worn { background: rgba(40,30,10,0.55); }
.srow button.warn { background: linear-gradient(#8a1a0a, #3a0804); border-color: #ff6a4a; }
@media (max-width: 700px) { .galtar { width: 90px; } .gcard { width: 104px; min-height: 150px; } .gcard img { width: 52px; height: 52px; } .gcard b { font-size: 14px; } }

#quick .qslot, #hotbar .hslot { pointer-events: auto; cursor: pointer; }

/* ---------- co-op ---------- */
.coopp { max-width: 720px; }
.ccode { font-size: 64px; letter-spacing: 12px; text-align: center; color: #4dffe0; text-shadow: 0 0 18px rgba(77,255,224,0.6); margin: 6px 0; }
#cLink { width: 100%; background: rgba(0,0,0,0.5); color: #9fd; border: 1px solid var(--edge); font-family: monospace; font-size: 13px; padding: 4px; user-select: text; }
.cform { display: flex; gap: 12px; flex-wrap: wrap; }
.cform label { display: flex; flex-direction: column; font-size: 18px; color: var(--muted); flex: 1; min-width: 160px; }
.cform input { font-family: var(--font); font-size: 26px; padding: 4px 8px; background: rgba(0,0,0,0.6); color: var(--text); border: 2px solid var(--edge); text-transform: none; }
#cJoinCode { text-transform: uppercase; letter-spacing: 6px; color: #4dffe0; }
.cplayers { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; font-size: 20px; }
.cplayers span { background: rgba(77,255,224,0.12); border: 1px solid #2a8a7a; padding: 2px 10px; }
.cmsg { color: #ffe6a0; font-size: 19px; min-height: 22px; }
.small { font-size: 15px; }
#coop .menu button { min-width: 0; font-size: 22px; }
#partyHud { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); background: var(--panel); border: 1px solid #2a8a7a; padding: 2px 10px; font-size: 15px; display: flex; gap: 10px; align-items: center; }
#partyHud b { color: #4dffe0; font-weight: normal; }
#partyHud .pm { display: flex; flex-direction: column; line-height: 1; }
#partyHud .pm i { display: block; width: 60px; height: 4px; background: rgba(0,0,0,0.6); }
#partyHud .pm u { display: block; height: 100%; background: #6dff7a; }
#partyHud .pm.dead span { color: #888; text-decoration: line-through; }
#chatBox { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 30; background: var(--panel); border: 2px solid #2a8a7a; padding: 8px; width: min(520px, 92vw); }
#chatPresets { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
#chatPresets button, #chatBox .crow button { min-width: 0 !important; font-size: 17px; padding: 2px 8px; letter-spacing: 0; }
#chatBox .crow { display: flex; gap: 6px; }
#chatIn { flex: 1; min-width: 0; font-family: var(--font); font-size: 20px; padding: 2px 6px; background: rgba(0,0,0,0.6); color: var(--text); border: 1px solid var(--edge); }
body.touch #partyHud { top: calc(4px + env(safe-area-inset-top, 0px)); font-size: 12px; }

#coop h3 { margin: 10px 0 4px; color: #4dffe0; font-weight: normal; font-size: 22px; }
#partyHud { pointer-events: auto; cursor: pointer; }

/* ---------- v5: base, map, phone layout ---------- */
.basep { max-width: 960px; }
.bhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-right: 40px; }
.bhead h2 { margin: 0; flex: 1; min-width: 0; }
.bhead h2 small { font-size: 18px; color: var(--muted); }
#bRes { display: flex; gap: 12px; font-size: 20px; color: var(--gold); }
#bRes span { display: flex; align-items: center; gap: 3px; }
#bRes img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; }
.baway { background: rgba(80,40,10,0.5); border: 1px solid #a07030; padding: 6px 10px; margin: 6px 0; font-size: 17px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.baway button { min-width: 0 !important; font-size: 18px; padding: 2px 10px; }
.bcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 8px; }
.bcard { display: flex; gap: 8px; align-items: flex-start; background: rgba(0,0,0,0.45); border: 2px solid #6a5020; padding: 8px; flex-wrap: wrap; }
.bcard.none { border-style: dashed; opacity: 0.85; }
.bcard > img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; }
.bcard .binfo { flex: 1; min-width: 150px; line-height: 1.05; }
.bcard .binfo b { font-weight: normal; font-size: 21px; color: var(--gold); }
.bcard .binfo small { color: var(--muted); font-size: 15px; }
.bcard p { margin: 3px 0; font-size: 15px; }
.bcard .next { color: #9fd; }
.bcard .cost b { font-weight: normal; color: var(--gold); }
.bcard .cost b.bad { color: #ff7a6a; }
.bcard button, #base .srow button { min-width: 0 !important; font-size: 17px; padding: 2px 10px; }
.bcard button.dim, #base button.dim { opacity: 0.4; }
.bprog { display: block; height: 5px; background: rgba(0,0,0,0.6); margin-top: 3px; }
.bprog u { display: block; height: 100%; background: linear-gradient(90deg, #ffcf3a, #ffe6a0); }
.srow.claimed { opacity: 0.5; }
.mapwrap { position: relative; display: inline-block; max-width: 100%; }
.mapwrap canvas { touch-action: none; cursor: grab; }
.mapctl { position: absolute; right: 8px; top: 56px; display: flex; flex-direction: column; gap: 6px; }
.mapctl button { min-width: 0 !important; width: 40px; height: 40px; padding: 0; font-size: 22px; }
#mapTp { min-width: 0; font-size: 22px; margin: 6px auto; display: block; background: linear-gradient(#1e5a8a, #0c2a44); border-color: #7dd8ff; }
#tmore { position: absolute; top: 40px; right: 0; display: grid; grid-template-columns: repeat(3, 84px); gap: 6px; background: var(--panel); border: 2px solid var(--edge); padding: 8px; }
#tmore button { height: 60px; width: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 22px; padding: 2px; }
#tmore button span { font-size: 13px; color: var(--muted); line-height: 1; margin-top: 2px; }
#tmore button img { width: 26px; height: 26px; }
#tMoreBtn.note { border-color: var(--gold); box-shadow: 0 0 10px rgba(255,207,58,0.7); }
/* compact phone HUD: nothing overlaps the minimap or each other */
body.touch #tmenu button { font-size: 18px; height: 34px; min-width: 38px; padding: 0 8px; }
body.touch.tplay #tbtns { display: grid; grid-template-columns: repeat(2, 40px); gap: 6px; top: calc(46px + env(safe-area-inset-top, 0px)); bottom: auto; right: calc(112px + env(safe-area-inset-right, 0px)); }
body.touch #tbtns button { width: 40px; height: 40px; font-size: 18px; }
body.touch #tbtns button span { display: none; }
body.touch #tbtns button img { width: 24px; height: 24px; }
body.touch.tplay #tbtns button.big { position: fixed; width: 56px; height: 56px; font-size: 24px; right: calc(186px + env(safe-area-inset-right, 0px)); bottom: calc(70px + env(safe-area-inset-bottom, 0px)); top: auto; }
body.touch.tplay #tbtns button.big span { display: block; font-size: 11px; }
body.touch #topright { top: calc(46px + env(safe-area-inset-top, 0px)); }
body.touch #minimap { width: 96px; height: 96px; }
body.touch #objective { max-width: 34vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.touch #bars { top: calc(86px + env(safe-area-inset-top, 0px)); padding: 3px 5px; gap: 2px; }
body.touch .brow .bar { width: 74px; height: 7px; }
body.touch .brow img { width: 11px; height: 11px; }
body.touch .brow .bar span { display: none; }
body.touch #radio { top: calc(44px + env(safe-area-inset-top, 0px)); width: min(380px, 46vw); }
body.touch #radioText { font-size: 14px; }
body.touch #feed { max-width: 34vw; bottom: 64px; }
body.touch #feed .toast:nth-child(n+4) { display: none; }
body.touch .toast { font-size: 13px; line-height: 1.1; }
body.touch #banner h2 { font-size: 26px; }
body.touch #comphud { display: none; }

body.touch .basep, body.touch .gpanel { padding: 8px 10px; }
@media (max-height: 420px) { body.touch #tmore { grid-template-columns: repeat(5, 74px); } body.touch #tmore button { width: 74px; height: 54px; } }

#bigmap { width: min(78vh, 88vw); height: min(78vh, 88vw); display: block; }
body.touch .mapp { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; padding: 4px 8px; display: flex; flex-direction: column; }
body.touch .mapp h2 { font-size: 20px; margin: 0; }
body.touch .mapwrap { flex: 1; min-height: 0; width: 100%; }
body.touch #bigmap { width: 100%; height: 100%; }
body.touch #mapInfo { font-size: 13px; line-height: 1.1; }
body.touch #mapTp { position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 3; font-size: 18px; }
body.touch .mapp { position: relative; }
#base .tabs button { flex: 1; min-width: 0 !important; font-size: 17px; padding: 2px 6px; }
/* v6: breakthrough tab, mount button */
.bthead { padding: 8px 10px; margin-bottom: 8px; border: 1px solid rgba(255,230,160,0.3); border-radius: 8px; background: rgba(255,230,160,0.06); }
.bthead b { font-size: 18px; } .bthead b.gold { color: #ffe6a0; }
.btn6 { font: 16px VT323, monospace; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.btn6.ok { color: #6dff7a; } .btn6.bad { color: #ff6a5a; }
#tMount.on { border-color: #ffd65a; box-shadow: 0 0 12px rgba(255,214,90,0.7); background: rgba(90,60,10,0.85); }

/* v7: pixel UI frames (ui_panel / ui_btn / ui_bar) + icon buttons */
.panel { border: 26px solid transparent; border-image: url(../assets/img/ui_panel.png) 40 fill / 26px stretch; background: none; box-shadow: 0 20px 60px rgba(0,0,0,0.7); padding: 12px 18px; }
.panel .close { z-index: 3; }
.panel > h2, .panel h2 { text-shadow: 2px 2px 0 #000; }
.menu button, .panel button:not(.close):not(.tic-btn) { border: 10px solid transparent; border-image: url(../assets/img/ui_btn.png) 26 40 fill / 10px 16px stretch; background: none; box-shadow: none; }
.menu button:hover:not(:disabled), .panel button:not(.close):hover:not(:disabled) { background: none; filter: brightness(1.25); }
.panel button.dim { filter: grayscale(0.6); }
.brow .bar { border: 5px solid transparent; border-image: url(../assets/img/ui_bar.png) 14 30 fill / 5px 12px stretch; background: none; height: 22px; box-sizing: border-box; }
.brow .bar .fill { border-radius: 2px; }
#tmenu button.hasic { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 2px; }
#tmenu button .tic, #tmore button .tic { width: 26px; height: 26px; object-fit: contain; image-rendering: pixelated; pointer-events: none; }
#tmore button.hasic { flex-direction: column; gap: 2px; }
#tmore button.hasic .tic { width: 34px; height: 34px; }
#tDash .tic { width: 30px; height: 30px; image-rendering: pixelated; pointer-events: none; display: block; margin: 0 auto -2px; }
#tDash { flex-direction: column; font-size: 11px; }
#tSkill .tic { position: absolute; inset: 9px; width: calc(100% - 18px); height: calc(100% - 18px); object-fit: contain; image-rendering: pixelated; border-radius: 50%; pointer-events: none; opacity: 0.9; }
#tSkill span { position: relative; z-index: 1; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000; }
#tSkill { position: fixed; overflow: hidden; }
body.touch .brow .bar { height: 13px; border-width: 3px 7px; }
body.touch .brow .bar .fill { min-height: 5px; }

/* ===== v10: mana, Pháp / Bóng buttons, attributes, party, shadows, map travel list ===== */
.fill.mp { background: linear-gradient(#b4a4ff, #4a2ad0); }
#tCast, #tShadow { display: none; }
body.touch.tplay #tCast, body.touch.tplay #tShadow:not([hidden]) { display: flex; position: fixed; z-index: 5; flex-direction: column; align-items: center; justify-content: center; padding: 0; min-width: 0; border-radius: 50%; letter-spacing: 0; font-size: 11px; color: #fff; text-shadow: 1px 1px 0 #000; }
#tCast { right: calc(188px + env(safe-area-inset-right, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); width: 54px; height: 54px; background: radial-gradient(circle at 40% 35%, #2a4f9a, #0c1838); border: 2px solid #5a7ac8; opacity: 0.7; }
#tCast.ready { opacity: 1; border-color: #8fd0ff; box-shadow: 0 0 12px rgba(120,190,255,0.7); }
#tCast .tic { width: 28px; height: 28px; image-rendering: pixelated; pointer-events: none; margin-bottom: -3px; }
#tCast i { position: absolute; top: -4px; right: -4px; font-style: normal; font-size: 12px; background: #1f56c8; border: 1px solid #8fd0ff; border-radius: 8px; padding: 0 4px; }
#tShadow { right: calc(26px + env(safe-area-inset-right, 0px)); bottom: calc(190px + env(safe-area-inset-bottom, 0px)); width: 52px; height: 52px; background: radial-gradient(circle at 40% 35%, #4a3a9a, #140c30); border: 2px solid #8a7bff; font-size: 12px; }
#tCast.down, #tShadow.down { transform: scale(0.9); }

.attr10 { margin-bottom: 14px; }
.attr10 h3 { display: flex; align-items: center; gap: 12px; }
.attr10 .pts { font-size: 18px; color: var(--muted); }
.attr10 .pts.has { color: #ffd65a; animation: pulse 1.2s infinite; }
.arows { display: grid; gap: 6px; }
.arow { display: grid; grid-template-columns: minmax(130px, 1fr) 48px 2fr auto auto; align-items: center; gap: 8px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); padding: 4px 8px; font-size: 19px; }
.arow b { font-weight: normal; color: #ffe6a0; }
.arow .av { font-size: 24px; text-align: center; color: #fff; }
.arow small { color: var(--muted); font-size: 16px; line-height: 1.05; }
.arow button { min-width: 0; padding: 2px 10px; font-size: 18px; }
.derived { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 4px; font-size: 18px; color: var(--muted); }
.derived b { color: #fff; font-weight: normal; }

.party10 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.pc10 { display: flex; gap: 10px; background: rgba(20,26,40,0.6); border: 2px solid #34405a; padding: 8px; }
.pc10.on { border-color: #6fd0ff; }
.pc10.sh { border-color: color-mix(in srgb, var(--tc) 50%, #222); background: rgba(24,16,48,0.6); }
.pc10.sh.on { border-color: var(--tc); box-shadow: 0 0 10px color-mix(in srgb, var(--tc) 40%, transparent); }
.pc10 img { width: 78px; height: 78px; flex-shrink: 0; border: 2px solid #46526e; background: rgba(0,0,0,0.35); }
.pc10 img.port { object-fit: cover; }
.pc10 img.spr { object-fit: contain; image-rendering: pixelated; }
.pci { min-width: 0; flex: 1; }
.pci b { font-weight: normal; font-size: 22px; color: #dff3ff; display: block; line-height: 1; }
.pci b .star { color: #ffd65a; font-style: normal; font-size: 16px; }
.pci b .heart { color: #ff8ab8; font-style: normal; }
.pci small { display: block; color: var(--muted); font-size: 15px; }
.pst { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 16px; color: #cfd8e8; }
.pstat { font-size: 15px; color: #9fe8ff; margin: 2px 0 4px; }
.pbtn { display: flex; gap: 6px; flex-wrap: wrap; }
.pbtn button { min-width: 0; padding: 2px 10px; font-size: 16px; }
.pbtn button.ghost { opacity: 0.7; }
.shbar { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.shbar button { flex-shrink: 0; background: linear-gradient(#4a3a9a, #1c1240); border-color: #8a7bff; }
.shbar .muted { font-size: 16px; line-height: 1.1; }

/* map: canvas + travel list side by side, full screen */
.panel.mapp { width: min(1400px, 98vw); height: 94vh; max-height: 94vh; display: flex; flex-direction: column; padding: 8px 12px; }
.panel.mapp h2 { margin: 0 0 4px; }
.mapbody { flex: 1; min-height: 0; display: flex; gap: 10px; }
.mapbody .mapwrap { flex: 1; min-width: 0; height: 100%; display: block; }
.mapbody #bigmap { width: 100% !important; height: 100% !important; }
#mapSide { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; min-height: 0; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.08); }
#mapChips { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; }
#mapChips button { min-width: 0; padding: 2px 8px; font-size: 16px; opacity: 0.65; }
#mapChips button.on { opacity: 1; border-color: #7dd8ff; }
#mapList { flex: 1; overflow-y: auto; padding: 0 6px 6px; }
.mrow { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-bottom: 1px solid rgba(255,255,255,0.06); cursor: pointer; }
.mrow:hover { background: rgba(125,216,255,0.08); }
.mrow .mic { font-size: 24px; width: 28px; text-align: center; text-shadow: 1px 1px 0 #000; flex-shrink: 0; }
.mrow .mtx { flex: 1; min-width: 0; }
.mrow b { font-weight: normal; font-size: 17px; display: block; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow small { color: var(--muted); font-size: 14px; }
.mrow button { min-width: 0; width: 46px; height: 40px; padding: 0; font-size: 22px; background: linear-gradient(#1e5a8a, #0c2a44); border-color: #7dd8ff; flex-shrink: 0; }
body.touch .panel.mapp { width: 100vw; height: 100vh; max-height: 100vh; padding: 4px 6px; }
body.touch #mapSide { width: 220px; }
body.touch .mrow b { font-size: 15px; }
body.touch .mrow small { font-size: 13px; }
body.touch #mapInfo { font-size: 14px; }
#mapTp { font-size: 22px; padding: 6px 22px; }
@media (max-width: 800px) { .arow { grid-template-columns: 1fr 40px auto auto; } .arow small { display: none; } .party10 { grid-template-columns: 1fr; } .shbar { flex-direction: column; align-items: stretch; } }
body.touch #inv .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 4px; }
body.touch #inv .tabs::-webkit-scrollbar { display: none; }
body.touch #inv .tabs button { flex-shrink: 0; font-size: 15px; padding: 2px 10px; min-width: 0; }
.panel .pbtn button, .panel .arow button, .panel .mrow button, .panel #mapChips button { border-width: 6px 10px; border-image-width: 6px 10px; padding: 0 8px; font-size: 15px; line-height: 1.2; }
.panel .pbtn { flex-direction: row; }
.panel .pbtn button { flex: 1; }
.panel .mrow button { width: 48px; height: 38px; font-size: 20px; }
.panel .pbtn button, .panel .arow button { width: auto; display: inline-block; margin: 0; }
.panel .pbtn { flex-wrap: nowrap; }
.panel .pbtn button, .panel .arow button, .panel .mrow button, .panel #mapChips button, .panel .shbar button { letter-spacing: 0; min-width: 0; }
.mrow b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ===== v11: class picker, class card, summon jobs, map explore ===== */
#pickClass { margin: 6px 0; }
.pcl { display: flex; gap: 4px; flex-wrap: wrap; }
.pcl button { min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: center; padding: 2px 4px; font-size: 15px; letter-spacing: 0; opacity: 0.6; }
.pcl button.on { opacity: 1; border-color: var(--cc); box-shadow: 0 0 10px color-mix(in srgb, var(--cc) 50%, transparent); }
.pcl img { width: 56px; height: 38px; object-fit: contain; image-rendering: pixelated; }
.pcd { font-size: 16px; line-height: 1.15; color: var(--muted); margin: 4px 0; }
.clscard { display: flex; gap: 12px; align-items: flex-start; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); padding: 8px; margin-bottom: 12px; }
.clscard img { width: 64px; height: 64px; image-rendering: pixelated; flex-shrink: 0; }
.clscard b { font-weight: normal; font-size: 24px; }
.clscard p { font-size: 16px; margin: 2px 0; line-height: 1.15; }
.panel .clscard button { min-width: 0; letter-spacing: 0; font-size: 16px; padding: 0 10px; border-width: 6px 10px; border-image-width: 6px 10px; margin-top: 4px; }
.panel .pbtn button.on { color: #9fe8ff; }
.pbtn + .pbtn { margin-top: 4px; }
#mapExplore { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 3; min-width: 0; font-size: 16px; letter-spacing: 0; padding: 2px 12px; white-space: nowrap; }
body.touch #worldPick .pcl img { width: 44px; height: 30px; }
#worldPick #pickClass .pcl button { width: auto; min-width: 0; flex: 1 1 0; display: flex; margin: 0; padding: 2px 2px; font-size: 14px; letter-spacing: 0; line-height: 1.1; }
#worldPick #pickClass .pcl button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* v12: kill mastery + weapon proficiency */
.feat12 { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; margin-bottom: 12px; }
.feat12 .ft { display: flex; gap: 8px; align-items: center; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); padding: 6px; min-width: 0; }
.feat12 .ft > div { flex: 1; min-width: 0; position: relative; padding-bottom: 6px; }
.feat12 .ft img { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; flex-shrink: 0; }
.feat12 .ft b { font-size: 17px; }
.feat12 .ft small { display: block; opacity: 0.8; font-size: 15px; line-height: 1.1; }
.feat12 .ft i { position: absolute; left: 0; bottom: 0; height: 3px; background: #ffd65a; }
.feat12 .ft.t1 { border-color: rgba(205,127,50,0.7); }
.feat12 .ft.t2 { border-color: rgba(220,220,235,0.8); }
.feat12 .ft.t3 { border-color: #ffd65a; box-shadow: 0 0 8px rgba(255,214,90,0.35); }
.feat12 .ft.lock { opacity: 0.45; }
.feat12 .badge { font-size: 14px; padding: 1px 5px; background: #ffd65a; color: #201608; font-weight: bold; }
.feat12.ach .ft > div { padding-bottom: 0; }
.prof12 { margin-bottom: 12px; }
.prof12 .pg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
@media (max-width: 520px) { .prof12 .pg { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.prof12 .pg > div { display: flex; flex-direction: column; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); padding: 5px 7px; font-size: 15px; }
.prof12 .pg > div.cur { border-color: #4da6ff; box-shadow: inset 0 0 0 1px #4da6ff; }
.prof12 .pg > div.bad span { color: #ff8a7a; }
.prof12 .pg > div.good span { color: #8aff9a; }

/* ===== v14: interaction chooser, close buttons, name box, talents, mastery, roomy shadow cards ===== */
#ixList { position: fixed; left: 50%; bottom: 26%; transform: translateX(-50%); z-index: 70; width: min(440px, 92vw); display: flex; flex-direction: column; gap: 6px; background: rgba(10,12,20,0.94); border: 2px solid #6fd0ff; padding: 8px; box-shadow: 0 0 24px rgba(0,0,0,0.7); }
#ixList[hidden] { display: none; }
#ixList .ixh { display: flex; justify-content: space-between; align-items: center; color: #9fe8ff; font-size: 20px; }
#ixList .ixb { display: flex; align-items: center; gap: 10px; text-align: left; min-width: 0; width: 100%; padding: 6px 10px; font-size: 20px; line-height: 1.1; letter-spacing: 0; }
#ixList .ixb b { flex: 0 0 26px; height: 26px; line-height: 26px; text-align: center; background: #243a58; border: 1px solid #6fd0ff; font-weight: normal; }
#ixList .ixb span { flex: 1; min-width: 0; }
body.touch #ixList { bottom: 34%; }
body.touch #ixList .ixb { font-size: 22px; padding: 10px 12px; }
.closex { position: absolute; top: 6px; right: 6px; z-index: 5; min-width: 0; width: 38px; height: 38px; padding: 0; font-size: 22px; line-height: 1; letter-spacing: 0; background: rgba(20,24,36,0.9); border: 2px solid #7a8199; color: #fff; cursor: pointer; }
#ixList .closex, #ixList .ixx { position: static; width: 34px; height: 34px; }
#ixList .ixx { min-width: 0; padding: 0; font-size: 20px; letter-spacing: 0; }
#dialog .closex { top: 10px; right: 10px; }
.closex[hidden] { display: none; }
#askBox { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; }
#askBox[hidden] { display: none; }
#askBox .askp { position: relative; background: #12182a; border: 2px solid #6fd0ff; padding: 18px 20px; width: min(380px, 90vw); display: flex; flex-direction: column; gap: 10px; }
#askBox h3 { margin: 0; font-weight: normal; font-size: 24px; color: #dff3ff; padding-right: 40px; }
#askBox input { font: inherit; font-size: 26px; padding: 6px 10px; background: #060810; color: #fff; border: 2px solid #46526e; }
#askBox .askb { display: flex; gap: 8px; } #askBox .askb button { flex: 1; min-width: 0; letter-spacing: 0; }
.card.major { border-color: #ffd65a; box-shadow: 0 0 22px rgba(255,214,90,0.45); }
.card .pk { display: block; margin-top: 6px; color: #ffd65a; font-size: 17px; }
.card .pk2 { display: block; color: var(--muted); font-size: 15px; }
.perk14 { margin-top: 12px; }
.pk14 { display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); padding: 5px 8px; margin: 4px 0; }
.pk14.maj { border-color: #ffd65a; }
.pk14 img { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; flex-shrink: 0; }
.pk14 b { font-weight: normal; font-size: 20px; color: #ffe6a0; display: block; line-height: 1; }
.pk14 small { color: var(--muted); font-size: 16px; line-height: 1.1; }
.mast { grid-column: 1 / -1; position: relative; margin-top: 6px; padding: 3px 0 7px; font-size: 15px; line-height: 1.1; }
.mast span { display: block; color: #9fe8ff; }
.mast small { display: block; color: var(--muted); font-size: 13px; }
.mast i { position: absolute; left: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, #4da6ff, #9fe8ff); }
.mast::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,0.1); z-index: -1; }
/* shadow cards: big enough to read on a phone */
.party10.shl { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.shl .pc10 { flex-wrap: wrap; padding: 10px; gap: 10px 12px; }
.shl .pc10 img { width: 92px; height: 92px; }
.shl .pci { flex: 1 1 200px; }
.shl .pci b { font-size: 28px; display: flex; align-items: center; gap: 8px; line-height: 1.05; }
.shl .pci b .ren { min-width: 0; width: 34px; height: 30px; padding: 0; font-size: 18px; letter-spacing: 0; flex-shrink: 0; }
.shl .pci small { font-size: 18px; }
.shl .pst { font-size: 19px; gap: 2px 14px; }
.shl .pstat { font-size: 18px; margin: 4px 0 0; }
.shl .shact { flex: 1 1 100%; display: flex; flex-direction: column; gap: 6px; }
.shl .shact .pbtn { flex-wrap: wrap; }
.shl .shact .pbtn button { flex: 1 1 0; min-width: 0; font-size: 18px; padding: 4px 4px; height: 40px; line-height: 1; white-space: nowrap; }
.shl .pbtn button.on { border-color: #7dffb0; color: #b8ffd0; }
.shl .pbtn.modes button { min-width: 0; }
body.touch .party10.shl { grid-template-columns: 1fr; }
body.touch .shl .pci b { font-size: 26px; }

/* ===== v15: summon controls, grades ===== */
.shctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.shctl button { min-width: 0; font-size: 18px; padding: 4px 12px; height: 42px; letter-spacing: 0; white-space: nowrap; }
.shctl button.warn { background: linear-gradient(#7a2a2a, #3a1010); border-color: #ff7a7a; }
.shctl button.ghost { opacity: 0.6; }
.shn { display: flex; align-items: center; gap: 6px; font-size: 18px; color: #cfd8e8; background: rgba(255,255,255,0.05); padding: 2px 8px; border: 1px solid rgba(255,255,255,0.12); }
.shn b { min-width: 64px; text-align: center; color: #fff; font-weight: normal; font-size: 22px; }
.shn button { width: 36px; padding: 0; height: 34px; font-size: 22px; }
#tDismiss { display: none; }
body.touch.tplay #tDismiss:not([hidden]) { display: flex; position: fixed; z-index: 5; align-items: center; justify-content: center; right: calc(86px + env(safe-area-inset-right, 0px)); bottom: calc(196px + env(safe-area-inset-bottom, 0px)); width: 38px; height: 38px; padding: 0; min-width: 0; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #8a3a3a, #2a0c0c); border: 2px solid #ff9a9a; color: #fff; font-size: 18px; }
#tDismiss.down { transform: scale(0.9); }
.gtag { display: inline-block; font-size: 15px; padding: 0 6px; border: 1px solid; margin-right: 4px; line-height: 1.25; }
.card .gr { display: block; margin-top: 6px; font-size: 17px; }
.card.g2 { box-shadow: 0 0 14px rgba(77,166,255,0.35); } .card.g3 { box-shadow: 0 0 18px rgba(180,107,255,0.5); } .card.g4 { box-shadow: 0 0 26px rgba(255,214,90,0.7); }
.card { border-color: var(--gc, inherit); }
.gdots i { font-style: normal; font-size: 13px; }
.bt15 { margin-top: 14px; }
.btg > div { position: relative; display: grid; grid-template-columns: 110px 1fr 54px; gap: 8px; align-items: center; padding: 3px 6px; margin: 3px 0; background: rgba(255,255,255,0.04); }
.btg b { font-weight: normal; color: var(--gc); font-size: 18px; }
.btg i { display: block; height: 10px; background: var(--gc); }
.btg span { text-align: right; font-size: 18px; }
.btg small { grid-column: 1 / -1; color: var(--muted); font-size: 14px; }
.btc { display: flex; gap: 8px; align-items: center; margin: 8px 0; font-size: 17px; color: #e8dcb0; }
.btc.dis { opacity: 0.5; }

/* ===== v15: character creation ===== */
.fp { aspect-ratio: 1; background-repeat: no-repeat; background-size: 600% 600%; background-color: #0a0a10; image-rendering: auto; }
#create { background: radial-gradient(ellipse at 50% 30%, #1b1630 0%, #07060c 80%); z-index: 12; }
.cr-wrap { width: min(1180px, 100%); height: min(720px, 100%); display: flex; flex-direction: column; padding: 10px 14px; gap: 8px; }
.cr-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.cr-head h2 { margin: 0; font-size: 30px; color: #ffe6a0; letter-spacing: 1px; }
.cr-steps { display: flex; gap: 6px; }
.cr-steps button { min-width: 0; padding: 4px 14px; font-size: 19px; letter-spacing: 0; opacity: 0.6; }
.cr-steps button.on { opacity: 1; border-color: #ffe6a0; } .cr-steps button.done { opacity: 0.85; }
.cr-body { flex: 1; min-height: 0; display: flex; gap: 14px; }
.cr-card { width: 210px; flex-shrink: 0; display: flex; flex-direction: column; gap: 6px; align-items: stretch; background: rgba(255,255,255,0.04); border: 2px solid #3a3250; padding: 8px; }
.cr-card .fp.big { width: 100%; border: 3px solid #b99a5a; box-shadow: 0 0 20px rgba(185,154,90,0.3); }
.cr-card b { font-weight: normal; font-size: 26px; color: #fff; text-align: center; word-break: break-word; line-height: 1.05; }
.cr-card small { color: var(--muted); text-align: center; font-size: 16px; }
.cr-chips { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }
.chip { font-size: 14px; padding: 0 6px; border: 1px solid #4a8a5a; color: #b8f0c8; line-height: 1.3; }
.chip.t { border-color: var(--gc); color: var(--gc); } .chip.f { border-color: #a04a4a; color: #ffb0a0; }
#crMain { flex: 1; min-width: 0; overflow-y: auto; padding-right: 6px; }
.cr-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.cr-row label { font-size: 20px; color: var(--muted); }
.cr-row input { font: inherit; font-size: 24px; padding: 4px 10px; background: #08080e; color: #fff; border: 2px solid #46526e; min-width: 0; flex: 1 1 160px; max-width: 280px; }
.cr-row button, .cr-foot button { min-width: 0; letter-spacing: 0; font-size: 19px; padding: 4px 12px; }
.cr-row .gender { display: flex; gap: 4px; } .cr-row .gender button.on { border-color: #ffe6a0; }
.cr-gal { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 8px; }
.cr-gal .gal { padding: 0; border: 2px solid #34405a; background: #000; cursor: pointer; min-width: 0; }
.cr-gal .gal.on { border-color: #ffe6a0; box-shadow: 0 0 12px rgba(255,230,160,0.6); }
.cr-gal .gal .fp { width: 100%; display: block; }
.cr-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cr-foot .muted { flex: 1; text-align: center; font-size: 17px; }
.cr-classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 8px; }
.cr-cls { display: flex; gap: 10px; background: rgba(255,255,255,0.04); border: 2px solid #34405a; padding: 8px; cursor: pointer; }
.cr-cls.on { border-color: var(--cc); box-shadow: 0 0 14px color-mix(in srgb, var(--cc) 50%, transparent); background: rgba(255,255,255,0.08); }
.cr-cls img { width: 84px; height: 56px; object-fit: contain; image-rendering: pixelated; flex-shrink: 0; align-self: center; }
.cr-cls b { font-weight: normal; font-size: 24px; } .cr-cls p { margin: 2px 0; font-size: 16px; line-height: 1.1; color: #cfd8e8; } .cr-cls p.d { color: var(--muted); } .cr-cls u { text-decoration: none; color: #ffe6a0; }
.cr-dice { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.cr-dice > button { font-size: 24px; padding: 6px 18px; letter-spacing: 0; } .cr-dice small { font-size: 16px; opacity: 0.8; }
.cr-dice .muted { flex: 1 1 240px; font-size: 16px; line-height: 1.1; }
.cr-res { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.dc { position: relative; background: rgba(255,255,255,0.04); border: 2px solid var(--gc, #34405a); padding: 8px 10px 8px; min-width: 0; }
.dc h4 { margin: 0 34px 4px 0; font-weight: normal; font-size: 22px; color: #fff; line-height: 1.1; }
.dc .fx { margin: 2px 0; font-size: 17px; color: #9fe8ff; line-height: 1.1; } .dc.fla .fx { color: #ffb0a0; }
.dc .st { margin: 3px 0 0; font-size: 16px; color: #cbd2e2; line-height: 1.15; font-style: italic; }
.dc small { font-size: 15px; color: var(--muted); display: block; margin-top: 4px; line-height: 1.1; }
.dc.org { grid-column: 1 / -1; } .dc.none { border-style: dashed; }
.dc .lk { position: absolute; top: 4px; right: 4px; min-width: 0; width: 32px; height: 32px; padding: 0; font-size: 17px; letter-spacing: 0; opacity: 0.7; } .dc .lk.on { opacity: 1; border-color: #ffe6a0; }
.sbs { margin: 4px 0; } .sb { display: grid; grid-template-columns: 90px 1fr 26px; gap: 6px; align-items: center; font-size: 17px; }
.sb i { display: block; height: 8px; background: var(--gc); } .sb b { font-weight: normal; text-align: right; color: #fff; }
body.touch .cr-wrap { padding: 4px 8px; } body.touch .cr-head h2 { font-size: 22px; } body.touch .cr-card { width: 150px; }
body.touch .cr-gal { grid-template-columns: repeat(8, 1fr); }

/* ===== v15: unified character sheet ===== */
.sh15 { display: flex; flex-direction: column; gap: 12px; }
.sh-top { display: flex; gap: 14px; align-items: flex-start; }
.sh-port { position: relative; width: 190px; flex-shrink: 0; }
.sh-port .fp.big { width: 100%; border: 3px solid #b99a5a; box-shadow: 0 0 18px rgba(185,154,90,0.3); }
.sh-spr { position: absolute; right: -10px; bottom: -10px; width: 86px; height: 62px; background: rgba(8,8,14,0.9); border: 2px solid #b99a5a; display: flex; align-items: center; justify-content: center; }
.sh-spr img { max-width: 100%; max-height: 100%; image-rendering: pixelated; }
.sh-info { flex: 1; min-width: 0; }
.sh-info h2 { margin: 0; font-size: 34px; color: #fff; line-height: 1; } .sh-info h2 small { color: var(--muted); font-size: 24px; }
.sh-info .rank { margin: 4px 0 8px; font-size: 22px; color: #ffe6a0; }
.sh-bars .b { position: relative; height: 22px; background: rgba(255,255,255,0.08); margin: 4px 0; border: 1px solid rgba(255,255,255,0.12); }
.sh-bars .b i { position: absolute; left: 0; top: 0; bottom: 0; opacity: 0.85; } .sh-bars .b span { position: relative; z-index: 1; font-size: 17px; padding-left: 8px; line-height: 22px; text-shadow: 1px 1px 0 #000; }
.sh-info .meta { margin: 6px 0 0; font-size: 18px; color: var(--muted); } .sh-info .meta b { color: #fff; font-weight: normal; }
.sh-sec h3 { margin: 4px 0 6px; } .sh-sec .org { margin: 0 0 8px; font-size: 18px; font-style: italic; color: #cbd2e2; line-height: 1.2; }
.sh-tal { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
.sh-tal .dc h4 { font-size: 20px; margin-right: 0; } .sh-tal .dc .fx { font-size: 16px; } .sh-tal .dc .st { font-size: 15px; }
.sh-sk { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px; }
.sk { display: flex; gap: 10px; background: rgba(255,255,255,0.04); border: 2px solid #34405a; padding: 6px 8px; cursor: pointer; min-width: 0; }
.sk.on { border-color: var(--pc, #ffe6a0); background: rgba(255,255,255,0.08); } .sk.ult { cursor: default; border-color: #ffe6a0; }
.sk img { width: 46px; height: 46px; flex-shrink: 0; image-rendering: pixelated; object-fit: contain; } .sk .ic { width: 46px; text-align: center; font-size: 30px; flex-shrink: 0; }
.sk b { font-weight: normal; font-size: 20px; color: #fff; line-height: 1.05; display: block; } .sk b small { color: var(--muted); font-size: 14px; }
.sk p { margin: 2px 0; font-size: 15px; color: var(--muted); line-height: 1.1; } .sk .mast { margin-top: 3px; padding-bottom: 6px; }
h3.sec { margin: 14px 0 6px; color: #ffe6a0; border-bottom: 1px solid rgba(255,230,160,0.25); padding-bottom: 2px; }
body.touch .sh-port { width: 130px; } body.touch .sh-info h2 { font-size: 26px; }
.sh15 .gdetail { min-height: 0; }

/* ===== v16: person panel, weaving ===== */
.npcp { width: min(980px, 98vw); max-height: 94vh; overflow-y: auto; padding: 14px 18px; }
.np-top { display: flex; gap: 16px; align-items: flex-start; }
.np-face { position: relative; width: 200px; flex-shrink: 0; }
.np-face .fp.big { width: 100%; border: 3px solid #b99a5a; box-shadow: 0 0 18px rgba(185,154,90,0.35); }
.np-face .rb { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; color: #101018; font-size: 19px; padding: 1px 4px; }
.np-info { flex: 1; min-width: 0; }
.np-info h2 { margin: 0; font-size: 34px; color: #fff; line-height: 1; } .np-info h2 small { font-size: 20px; color: var(--muted); }
.np-info .sub { margin: 4px 0 6px; color: #ffe6a0; font-size: 20px; }
.np-info .chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; } .np-info .chip { font-size: 16px; }
.aff { display: flex; align-items: center; gap: 10px; font-size: 18px; color: var(--muted); }
.aff .bar { position: relative; flex: 1; height: 14px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); }
.aff .bar i { position: absolute; left: 0; top: 0; bottom: 0; } .aff .bar s { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #fff; opacity: 0.5; }
.np-say { margin: 10px 0; min-height: 66px; background: rgba(0,0,0,0.35); border-left: 4px solid #ffe6a0; padding: 8px 12px; font-size: 22px; line-height: 1.2; color: #fff; }
.np-say q { quotes: none; } .np-say q::before { content: '“'; } .np-say q::after { content: '”'; }
.np-act { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.np-act button { min-width: 0; letter-spacing: 0; font-size: 19px; padding: 4px 12px; }
.np-act button.on { border-color: #ffe6a0; } .np-act button.hot { border-color: #ff9ac0; color: #ffd0e2; } .np-act button.dis { opacity: 0.55; } .np-act button.ghost { opacity: 0.75; }
.np-sec h3 { margin: 8px 0 4px; color: #ffe6a0; }
.bio { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); padding: 6px 10px; margin: 4px 0; } .bio b { font-weight: normal; color: #9fe8ff; font-size: 18px; } .bio p { margin: 2px 0 0; font-size: 18px; line-height: 1.2; color: #dfe6f4; } .bio.lock p { color: var(--muted); }
.lnk { display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,0.04); padding: 5px 8px; margin: 4px 0; }
.lnk .fp.mini { width: 54px; flex-shrink: 0; border: 2px solid #46526e; display: flex; align-items: center; justify-content: center; font-size: 28px; } .lnk .fp.unk { background: #14141c; color: #8a8aa0; }
.lnk b { font-weight: normal; font-size: 20px; } .lnk small { color: var(--muted); font-size: 15px; } .lnk p { margin: 1px 0 0; font-size: 16px; color: #cbd2e2; line-height: 1.15; }
.pc10 .fp.pface { width: 78px; height: 78px; flex-shrink: 0; border: 2px solid #46526e; background-size: 600% 600%; }
.pci b .rel { font-style: normal; }
#weave { background: radial-gradient(ellipse at 50% 40%, #241a3a 0%, #07060c 80%); z-index: 14; }
.wv { width: min(820px, 94vw); text-align: center; }
.wv h2 { font-size: 40px; color: #ffe6a0; letter-spacing: 3px; margin: 0 0 12px; }
.wv-bar { height: 10px; background: rgba(255,255,255,0.1); margin-bottom: 12px; } .wv-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7a48b0, #ffe6a0); transition: width .5s; }
#wvLog { min-height: 130px; text-align: left; font-size: 20px; color: #cfd8e8; } #wvLog p { margin: 3px 0; animation: wvin .4s; }
@keyframes wvin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.wv-faces { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0; }
.wf { position: relative; width: 62px; } .wf .fp { width: 62px; filter: blur(5px) grayscale(0.6) brightness(0.7); border: 2px solid #46526e; } .wf span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; color: #fff; text-shadow: 0 0 6px #000; }
.wv-sum { font-size: 22px; } #wvGo { margin-top: 10px; font-size: 24px; padding: 8px 26px; }
body.touch .np-face { width: 130px; } body.touch .np-info h2 { font-size: 26px; } body.touch .np-say { font-size: 19px; }
.cr-row button { width: auto; flex: 0 0 auto; } .cr-row .wide { flex: 0 0 auto; }
