@font-face {
  font-family: "BatHoangInk";
  src: url("/assets/ui/thuy-mac/NotoSerif-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "BatHoangThuPhap";
  src: url("/assets/fonts/BatHoangThuPhap.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --ink: #1e2723;
  --ink-muted: #525d55;
  --paper: #efe6d2;
  --paper-bright: #f7f0df;
  --paper-card: rgba(244, 237, 221, 0.94);
  --jade: #2c5749;
  --seal: #8f2d24;
  --gold: #9a7432;
  --slate-blue: #365666;
  --line: #8f846e;
  --lacquer: #162421;
  --timber: #5c4632;
  --slate-tile: #4f5d57;
  --mystic: #6e446b;
  --lantern: #e0822d;
  --font-main: "BatHoangInk", "Noto Serif", Georgia, serif;
}

* { box-sizing: border-box; user-select: none; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: #e4dac2; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #8f846e; border-radius: 4px; border: 1px solid #efe6d2; }
::-webkit-scrollbar-thumb:hover { background: #5c5342; }

html, body {
  margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden;
  background: #d8d1be; font-family: var(--font-main); color: var(--ink);
}

#world-canvas {
  display: block; width: 100vw; height: 100vh; cursor: crosshair;
}

.hidden { display: none !important; }

.bh-card {
  background: var(--paper-card) url("/assets/ui/thuy-mac/giay-do.png") center/cover;
  border: 1.5px solid #6e6757;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(20, 24, 20, 0.34), inset 0 0 0 2px rgba(252, 247, 233, 0.80), inset 0 0 0 3px rgba(130, 120, 98, 0.35);
  pointer-events: auto;
}

.bh-panel {
  position: relative;
  background: var(--paper) url("/assets/ui/thuy-mac/giay-do.png") center/cover;
  border: 2px solid #5c5342;
  border-radius: 4px;
  box-shadow: 0 22px 54px rgba(16, 22, 18, 0.65), inset 0 0 0 5px #f8f2e2, inset 0 0 0 7px #8e836d;
}

.bh-btn {
  font-family: var(--font-main); color: var(--ink); font-size: 13px; font-weight: 600;
  background: #f2ead6 url("/assets/ui/thuy-mac/nut-giay.png") center/100% 100% no-repeat;
  border: 1px solid #7d735f; border-radius: 3px; padding: 6px 12px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  text-shadow: 0 1px 0 rgba(255, 250, 236, 0.7);
  transition: filter 0.14s ease, transform 0.1s ease, border-color 0.14s ease;
}
.bh-btn:hover { filter: brightness(0.95); border-color: var(--seal); }
.bh-btn:active { transform: translateY(1px); }
.bh-btn img { width: 15px; height: 15px; object-fit: contain; flex-shrink: 0; }
.bh-btn.primary {
  background: linear-gradient(180deg, #2b5948, #1d3f33);
  color: #fbf6e8; border-color: #142b22; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}
.bh-btn.seal {
  background: #f0dfd5 url("/assets/ui/thuy-mac/nut-nhan.png") center/100% 100% no-repeat;
  color: var(--seal); border-color: #94443b;
}
.bh-btn.gold { background: linear-gradient(180deg, #f5ecd5, #e6d7b2); color: #6e4a12; border-color: #9e7c3e; }
.bh-btn.mini { padding: 3px 8px; font-size: 11px; }
.bh-btn.small { padding: 4px 10px; font-size: 12px; }
.bh-btn.large { padding: 10px 18px; font-size: 15px; width: 100%; }

.bh-overlay {
  position: fixed; inset: 0; z-index: 40;
  background:
    radial-gradient(ellipse at 50% 25%, rgba(62, 74, 68, 0.45), rgba(18, 24, 21, 0.86)),
    linear-gradient(180deg, rgba(44, 54, 49, 0.72) 0%, rgba(22, 28, 25, 0.90) 100%);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
#screen-create.bh-overlay {
  background:
    radial-gradient(ellipse at 50% 35%, rgba(239, 230, 210, 0.22), rgba(24, 31, 27, 0.58)),
    url("/assets/ui/thuy-mac/nen-dang-nhap-son-thuy.webp") center/cover no-repeat;
}

/* ---- CHARACTER CREATION SCREEN (THỦY MẶC CỔ PHONG) ---- */
.create-box { width: min(1140px, 96vw); max-height: 92vh; overflow-y: auto; padding: 22px 26px; }
.create-header { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid #8f846e; padding-bottom: 12px; margin-bottom: 16px; }
.seal-stamp {
  width: 54px; height: 54px; border: 2.5px solid var(--seal); border-radius: 3px; color: var(--seal);
  display: flex; align-items: center; justify-content: center; text-align: center; font-weight: 700; font-size: 15px; line-height: 1.15;
  background: radial-gradient(circle, rgba(143, 45, 36, 0.14), rgba(143, 45, 36, 0.04));
  box-shadow: inset 0 0 0 1px rgba(143, 45, 36, 0.4);
  transform: rotate(-2deg);
}
.create-header h1 { margin: 0; font-size: 25px; letter-spacing: 0.06em; color: var(--ink); text-shadow: 0 1px 0 #fffaf0; }
.subtitle { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-muted); letter-spacing: 0.02em; }

.create-grid { display: grid; grid-template-columns: 1.05fr 1.15fr 1fr; gap: 16px; }
.create-col { background: rgba(250, 244, 230, 0.72); border: 1.5px solid #968b74; border-radius: 4px; padding: 12px; display: flex; flex-direction: column; gap: 10px; box-shadow: inset 0 0 12px rgba(140, 125, 96, 0.14); }
.create-col h3 { margin: 0; font-size: 14px; border-bottom: 1px dashed #9d927b; padding-bottom: 6px; color: var(--seal); letter-spacing: 0.02em; }
.col-head-flex { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px dashed #9d927b; padding-bottom: 6px; }
.col-head-flex h3 { border: 0; padding: 0; }

.hero-preview-row { display: flex; gap: 10px; align-items: flex-start; }
#create-preview { background: radial-gradient(circle, #f6f0e1, #d8cfba); border: 1.5px solid #7d735f; border-radius: 4px; flex-shrink: 0; }
.hero-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; max-height: 150px; overflow-y: auto; flex: 1; }
.hero-chip {
  font-size: 11px; padding: 4px 6px; border: 1px solid #9b9079; background: #f8f2e2; border-radius: 3px; cursor: pointer; text-align: left; color: var(--ink);
}
.hero-chip.active { background: #d2dece; border-color: var(--jade); font-weight: 700; color: #16382b; box-shadow: inset 2px 0 var(--seal); }

.field-row label { display: block; font-size: 12px; color: var(--ink-muted); margin-bottom: 6px; }
.field-row input {
  width: 100%; margin-top: 3px; padding: 7px 9px; font-family: var(--font-main); font-size: 13px;
  background: #fbf6ea; color: var(--ink); border: 1.5px solid #8a7f69; border-radius: 3px;
}

.school-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; max-height: 295px; overflow-y: auto; }
.school-card {
  display: flex; align-items: center; gap: 8px; padding: 6px; border: 1px solid #9b9079;
  background: #f8f2e2; border-radius: 3px; cursor: pointer; text-align: left; color: var(--ink);
}
.school-card.active { background: #d4e0cf; border-color: var(--jade); box-shadow: inset 3px 0 var(--seal); }
.school-card img { width: 30px; height: 30px; object-fit: contain; flex-shrink: 0; }
.school-card b { display: block; font-size: 12px; }
.school-card small { font-size: 10px; color: var(--ink-muted); }

.destiny-list { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.destiny-card { padding: 8px 10px; border: 1px solid #9c917a; border-left: 3px solid var(--gold); background: #f8f2e2; border-radius: 3px; }
.destiny-card b { font-size: 12.5px; color: var(--seal); }
.destiny-card p { margin: 2px 0 0; font-size: 11px; color: var(--ink-muted); }
.create-actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }

/* ---- LIVE HUD (THỦY MẶC CỔ PHONG) ---- */
#hud-layer { position: fixed; inset: 0; z-index: 10; pointer-events: none; }

#hud-left-col { position: absolute; left: 10px; top: 10px; width: 262px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; z-index: 4; }
#hud-left-col > * { pointer-events: auto; }
#hud-profile { position: relative; width: 100%; padding: 8px 10px; border-left: 3px solid var(--seal); }
.prof-top { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
#hud-avatar { border: 1.5px solid #7d735f; border-radius: 4px; background: #e3dac4; flex-shrink: 0; }
.prof-info { flex: 1; min-width: 0; }
.prof-name-row { display: flex; align-items: center; gap: 6px; }
.prof-name-row strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.realm-tag { font-size: 10px; background: #dbe5d3; border: 1px solid #6e8772; color: #193b2d; padding: 1px 5px; border-radius: 3px; }
.prof-sub { font-size: 11px; color: var(--ink-muted); }
.stone-pill { font-size: 11px; font-weight: 700; color: var(--seal); background: #ece3cc; border: 1px solid #a19273; padding: 2px 6px; border-radius: 3px; }

.stat-bars { display: flex; flex-direction: column; gap: 4px; }
.sbar { position: relative; height: 15px; background: #d4cbb5; border: 1px solid #8a7f6a; border-radius: 2px; overflow: hidden; }
.sfill { height: 100%; width: 100%; transition: width 0.15s; }
.sfill.hp { background: linear-gradient(90deg, #7d251e, #ab3b31); }
.sfill.mp { background: linear-gradient(90deg, #2d5563, #4a7c8c); }
.sfill.exp { background: linear-gradient(90deg, #5f7a44, #8ca65a); }
.sbar span { position: absolute; inset: 0; text-align: center; font-size: 10px; line-height: 14px; color: #fcf8eb; text-shadow: 0 1px 2px #161c18; }
.prof-quick-row { display: flex; gap: 6px; margin-top: 7px; }
.prof-quick-row button { flex: 1; }

#hud-squad { position: relative; width: 100%; padding: 8px 10px; }
.squad-head { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 700; margin-bottom: 6px; border-bottom: 1px solid #bcc3b1; padding-bottom: 3px; }
.squad-slots { display: flex; flex-direction: column; gap: 4px; }
.sq-row { display: flex; align-items: center; gap: 6px; padding: 3px 5px; background: rgba(255,252,243,0.72); border: 1px solid #b5bda9; border-radius: 3px; font-size: 11px; cursor: pointer; }
.sq-row.empty { opacity: 0.55; justify-content: center; border-style: dashed; }
.sq-row img { width: 22px; height: 22px; object-fit: cover; border-radius: 2px; }
.sq-meta { flex: 1; min-width: 0; }
.sq-hp { height: 4px; background: #cfd5c6; margin-top: 2px; }
.sq-hp > i { display: block; height: 100%; background: #4f8564; }

#hud-calendar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); max-width: min(640px, calc(100vw - 505px)); min-width: 240px; padding: 5px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; z-index: 5; }
.cal-main { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 3px 6px; font-size: 11px; max-width: 100%; }
#hud-region { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.cal-date { font-weight: 700; color: var(--seal); flex-shrink: 0; }
.cal-sep { color: #a7b09d; flex-shrink: 0; }
.cal-btns { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }

#hud-minimap-box { position: absolute; right: 10px; top: 10px; width: 204px; padding: 7px; border-top: 3px solid var(--ink); }
.mini-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font-size: 11px; font-weight: 700; }
#mini-canvas { display: block; width: 100%; height: 136px; border: 1px solid #7d897b; background: #d4dccb; }
.sys-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; margin-top: 7px; }
.bh-btn.sys { padding: 5px 4px; font-size: 11px; justify-content: flex-start; }
.bh-btn.sys img { width: 16px; height: 16px; object-fit: contain; }

#arena-hud { position: absolute; top: 96px; left: 50%; transform: translateX(-50%); padding: 6px 14px; display: flex; align-items: center; gap: 12px; border: 2px solid var(--seal); z-index: 14; }
.arena-score { font-weight: 700; font-size: 13px; color: var(--seal); }

#hud-log { position: absolute; left: 14px; bottom: 14px; width: 268px; padding: 8px; }
.log-feed { height: 96px; overflow-y: auto; font-size: 11px; line-height: 1.45; display: flex; flex-direction: column; gap: 3px; padding-right: 4px; }
.log-line.imp { color: var(--seal); font-weight: 600; }
.log-line.chat { color: #1c4e6b; }
.chat-row { display: flex; gap: 5px; margin-top: 6px; }
.chat-row input { flex: 1; min-width: 0; font-family: var(--font-main); font-size: 11px; padding: 4px 6px; background: #fffdf6; border: 1px solid #9da692; border-radius: 3px; }

#hud-skills { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); padding: 5px 7px; display: flex; gap: 4px; max-width: 98vw; overflow-x: auto; z-index: 6; }
.skill-slot {
  position: relative; width: 58px; height: 54px; padding: 3px 4px; border: 2px solid #8a9483;
  background: #faf6ea; border-radius: 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: space-between; overflow: hidden; flex-shrink: 0;
}
.skill-slot.basic { width: 62px; border-color: #6b5a3c; background: #f3ecda; }
.skill-slot.act-slot img { width: 22px; height: 22px; object-fit: contain; border-radius: 2px; background: rgba(25,30,28,0.08); }
.skill-slot.syn-active { box-shadow: 0 0 8px rgba(212, 160, 23, 0.72); }
.skill-slot:hover { border-color: var(--jade); background: #e8efe4; }
.skey { font-size: 9px; color: var(--ink-muted); font-weight: 700; align-self: flex-start; line-height: 1; }
.sinfo { position: absolute; right: 2px; top: 1px; font-size: 9.5px; line-height: 1; color: #3c6e5c; opacity: 0.72; padding: 1px 2px; border-radius: 3px; cursor: help; }
.sinfo:hover { opacity: 1; background: rgba(60,110,92,0.18); }
.skill-slot strong { font-size: 9.5px; line-height: 1.05; width: 100%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scd {
  position: absolute; inset: 0; background: rgba(30, 44, 38, 0.72); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.scd:empty { display: none; }

/* ---- MODAL WINDOWS ---- */
.modal-window { width: min(1040px, 95vw); max-height: 90vh; display: flex; flex-direction: column; padding: 18px 22px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.modal-head h2 { margin: 0; font-size: 20px; }
.close-x { padding: 4px; width: 32px; height: 32px; }
.close-x img { width: 18px; height: 18px; }

.modal-tabs { display: flex; gap: 6px; padding: 10px 0; border-bottom: 1px solid #c2c8b6; flex-wrap: wrap; }
.mtab { padding: 6px 12px; }
.mtab.active { background: #cfe0cd; border-color: var(--jade); border-bottom: 3px solid var(--seal); }

.modal-body { flex: 1; overflow-y: auto; padding-top: 12px; }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.danger-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 3px; border: 1px solid #968b74; background: #e6f3ec; color: #2d6a4f; }
.sub-card { background: rgba(255, 252, 244, 0.78); border: 1px solid #abb4a1; border-radius: 4px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.npc-card-head { display: flex; gap: 10px; align-items: center; }
.npc-card-head img { width: 46px; height: 68px; object-fit: contain; background: #dfe5d7; border: 1px solid #9aa491; border-radius: 3px; image-rendering: high-quality; }
.wp-icon { width: 48px; height: 48px; object-fit: contain; background: #e3e8da; border: 1px solid #9aa491; border-radius: 4px; image-rendering: high-quality; }
.btn-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: auto; }
.atlas-wrap { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
#atlas-canvas { border: 2px solid #6e7b6d; background: #d6ded0; cursor: pointer; width: 500px; height: 500px; max-width: 100%; image-rendering: high-quality; }
.atlas-sidebar { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 8px; max-height: 510px; overflow-y: auto; }
.atlas-sidebar > * { flex-shrink: 0; }
.bh-btn.pk-on { background: #8f2222; color: #fff4e8; border-color: #5c1414; }
.tier-pill { font-size: 10px; padding: 1px 5px; border-radius: 3px; background: #ede6cf; border: 1px solid #b4a474; color: #6c4d14; font-weight: 700; }
.eq-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 8px; margin-bottom: 12px; }
.bag-list { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.bag-tag { font-size: 10px; padding: 1px 4px; background: #eef1e4; border: 1px solid #b2bba6; border-radius: 2px; }
.slot-bar { display: flex; gap: 6px; margin-top: 4px; }
.slot-bar .bh-btn { flex: 1; }
#hud-quest-box { position: relative; width: 100%; padding: 8px 10px; }
.guide-tip { margin-top: 6px; padding: 6px; background: #faf5e2; border: 1px dashed #9d8b55; border-radius: 3px; font-size: 10px; line-height: 1.35; }
.rw-card { border: 2px solid #993b32; background: linear-gradient(180deg, #fbf4ea, #f2e5d4); padding: 12px; border-radius: 5px; display: flex; flex-direction: column; gap: 6px; }
.bh-btn.seal-btn { background: #eadbc6; border-color: #9b513f; color: #5c1914; font-weight: 700; }
.syn-banner { padding: 8px 10px; background: linear-gradient(90deg, #f6eed8, #efe4c8); border: 1px solid #b88c38; border-radius: 4px; margin-bottom: 10px; font-size: 12px; }
.skill-icon-sm { width: 34px; height: 34px; object-fit: contain; border-radius: 4px; background: #1e2422; padding: 2px; flex-shrink: 0; }

/* V6 & V7 Clean 2-Column Skills, Bag (10 Slots + Sets + Hoan My) & Inspector */
.skills-shell, .bag-shell { display: grid; grid-template-columns: 1fr 310px; gap: 12px; align-items: start; }
.skills-main, .bag-main { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.skills-inspector {
  background: linear-gradient(180deg, #faf5e8, #f2ead7); border: 2px solid #8c7a5b;
  border-radius: 6px; padding: 12px; position: sticky; top: 0; display: flex; flex-direction: column; gap: 8px;
}
.eq10-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.eq10-slot {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; text-align: center;
  border-radius: 5px; background: rgba(255,253,246,0.9); border: 2px solid #9aa491; cursor: pointer; min-height: 76px;
}
.eq10-slot:hover { background: #ecf4e9; }
.eq10-slot img { width: 38px; height: 38px; object-fit: contain; border-radius: 4px; background: #1e2422; image-rendering: high-quality; }
.eq10-slot .eq-slot-lbl { font-size: 9px; font-weight: 700; color: #475569; text-transform: uppercase; }
.eq10-slot .eq-item-nm { font-size: 9.5px; font-weight: 700; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eq10-slot.perfected, .item-tile.perfected { box-shadow: 0 0 8px rgba(245, 158, 11, 0.72); background: linear-gradient(180deg, #fffbeb, #fef3c7); }
.item-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px;
  border-radius: 5px; background: rgba(255,253,246,0.92); border: 2px solid #9aa491; cursor: pointer; text-align: center;
}
.item-tile:hover { background: #ecf4e9; }
.item-tile.inspected, .eq10-slot.inspected { box-shadow: 0 0 0 2px #993b32; }
.item-tile img { width: 42px; height: 42px; object-fit: contain; border-radius: 4px; background: #18201d; image-rendering: high-quality; }
.item-tile small { font-size: 9.5px; line-height: 1.15; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.it-qty { position: absolute; bottom: 20px; right: 4px; background: rgba(15,23,42,0.85); color: #fff; font-size: 9px; padding: 0 4px; border-radius: 3px; }
.hm-badge { position: absolute; top: 2px; left: 3px; font-size: 9px; color: #d97706; font-weight: 700; }
.set-chip { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 10.5px; font-weight: 700; border: 1px solid #b4a474; background: #faf5e2; margin: 2px 4px 2px 0; }
.sk-subtabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid #c5bca7; padding-bottom: 8px; }
.sk-slots-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.sk-equip-box {
  display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 5px; background: #fffdf6;
  border: 2px solid #aeb5a2; cursor: pointer; transition: transform 0.08s;
}
.sk-equip-box:hover { transform: translateY(-1px); background: #f3f7ef; }
.sk-equip-box.active-sel { box-shadow: 0 0 0 2px #993b32; }
.skill-icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 7px; }
.skill-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px;
  border-radius: 5px; background: rgba(255,253,246,0.9); border: 2px solid #9aa491; cursor: pointer; text-align: center;
}
.skill-tile:hover { background: #ecf4e9; }
.skill-tile.inspected { box-shadow: 0 0 0 2px #993b32; background: #fdf1e6; }
.skill-tile.locked { opacity: 0.62; }
.skill-tile img { width: 44px; height: 44px; border-radius: 5px; background: #18201d; object-fit: contain; image-rendering: high-quality; }
.skill-tile small { font-size: 9.5px; line-height: 1.15; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.sk-badge-lock { position: absolute; top: 2px; right: 3px; font-size: 9px; }
.sk-stat-kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; font-size: 11px; background: rgba(255,255,255,0.68); padding: 7px; border-radius: 4px; border: 1px solid #c9bfa9; }

/* V6 Quy Coc Bát Hoang NPC Character Sheet Modal */
.npc-qc-shell { display: grid; grid-template-columns: 270px 1fr; gap: 14px; align-items: start; }
.npc-qc-left {
  background: linear-gradient(180deg, #faf4e6, #eee4ce); border: 2px solid #8a785c;
  border-radius: 6px; padding: 12px; display: flex; flex-direction: column; gap: 8px;
}
.npc-qc-portrait { width: 84px; height: 116px; object-fit: contain; background: #dce4d6; border: 2px solid #7d8a7a; border-radius: 5px; margin: 0 auto; display: block; }
.npc-qc-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; font-size: 11px; background: rgba(255,255,255,0.7); padding: 7px; border-radius: 4px; border: 1px solid #c5baa4; }
.lineage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 6px; margin-top: 4px; }
.lineage-node { background: #fffcf3; border: 1px solid #b4a474; border-radius: 5px; padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; font-size: 11px; }
.lineage-node:hover { background: #f3ecda; border-color: #993b32; }
.aff-bar { height: 10px; background: #dad5c5; border-radius: 5px; overflow: hidden; border: 1px solid #a29a84; }
.aff-bar > i { display: block; height: 100%; transition: width 0.2s; }
.npc-qc-right { min-width: 0; display: flex; flex-direction: column; gap: 8px; }

@media (max-width: 860px) {
  .skills-shell, .bag-shell, .npc-qc-shell { grid-template-columns: 1fr; }
  .sk-slots-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eq10-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.touch-joystick { display: none; position: fixed; left: 14px; bottom: 18px; z-index: 20; pointer-events: auto; touch-action: none; }
.joy-ring { position: relative; width: 112px; height: 112px; border-radius: 50%; border: 2px solid rgba(94, 84, 65, 0.72); background: radial-gradient(circle, rgba(244, 238, 224, 0.25), rgba(44, 87, 73, 0.18)); box-shadow: inset 0 0 12px rgba(20, 26, 22, 0.22); display: flex; align-items: center; justify-content: center; }
.joy-knob { width: 44px; height: 44px; border-radius: 50%; border: 2px solid #5c4d3c; background: radial-gradient(circle at 35% 35%, #f9f3e3, #c9bda1); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35); pointer-events: none; transition: transform 0.04s linear; }
.touch-action-pad { display: none; position: fixed; right: 12px; bottom: 14px; z-index: 20; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: auto; touch-action: manipulation; }
.tap-utils { display: flex; gap: 4px; }
.tap-mini { padding: 4px 8px; font-size: 10.5px; font-weight: 700; border-radius: 5px; border: 1px solid #736852; background: rgba(247, 240, 223, 0.90); color: #1b211d; cursor: pointer; }
.tap-combat { display: flex; align-items: flex-end; gap: 8px; }
.tap-skills-4 { display: grid; grid-template-columns: repeat(2, 46px); gap: 6px; }
.tap-sk { position: relative; width: 46px; height: 46px; border-radius: 50%; border: 2px solid #7b705a; background: rgba(250, 245, 232, 0.92); padding: 3px; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.28); }
.tap-sk img { width: 30px; height: 30px; object-fit: contain; border-radius: 50%; }
.tap-sk span { position: absolute; bottom: 1px; right: 4px; font-size: 9px; font-weight: 700; color: #1b211d; background: rgba(247,240,223,0.85); padding: 0 2px; border-radius: 3px; }
.tap-atk { width: 64px; height: 64px; border-radius: 50%; border: 2.5px solid #5c1914; background: radial-gradient(circle at 35% 30%, #b84236, #7d2219); color: #fbf4e4; font-weight: 700; font-size: 13px; cursor: pointer; box-shadow: 0 4px 12px rgba(20, 12, 10, 0.42); flex-shrink: 0; }
.mob-only-toggle { display: none !important; }

@media (max-width: 1020px), (hover: none) and (pointer: coarse) {
  .create-grid { grid-template-columns: 1fr; }
  .mob-only-toggle { display: inline-flex !important; }
  #hud-calendar { top: 4px; left: 4px; right: 4px; transform: none; width: auto; max-width: none; min-width: 0; padding: 4px 6px; gap: 3px; }
  .cal-main { font-size: 10px; gap: 2px 5px; }
  #hud-region { max-width: 140px; }
  .cal-btns { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; width: 100%; padding-bottom: 1px; }
  .cal-btns .bh-btn.mini { flex-shrink: 0; padding: 2px 6px; font-size: 10px; }
  #hud-left-col { top: 68px; left: 5px; width: min(192px, 47vw); gap: 4px; }
  #hud-profile { padding: 6px 7px; }
  #hud-avatar { width: 34px; height: 34px; }
  .prof-top { gap: 5px; margin-bottom: 4px; }
  .prof-name-row strong { font-size: 11.5px; }
  .sbar { height: 12px; }
  .sbar span { font-size: 9px; line-height: 11px; }
  .prof-quick-row .bh-btn.mini { font-size: 9.5px; padding: 2px 4px; }
  #hud-squad { display: none; }
  #hud-minimap-box { top: 68px; right: 5px; width: min(176px, 45vw); padding: 5px; }
  #mini-canvas { height: 74px; }
  .mini-head { font-size: 9.5px; margin-bottom: 3px; }
  .sys-grid { gap: 3px; margin-top: 4px; }
  .bh-btn.sys { padding: 3px 3px; font-size: 9.5px; }
  .bh-btn.sys img { width: 13px; height: 13px; }
  #hud-log { display: none; z-index: 24; width: min(260px, 82vw); }
  #hud-log.mobile-show { display: block; bottom: 145px; left: 8px; }
  #hud-quest-box { display: none; }
  #hud-quest-box.mobile-show { display: block; }
  #hud-skills { display: none; }
  .touch-joystick { display: block; }
  .touch-action-pad { display: flex; }
}

/* V13: 2-Step Login, 9-Pick-3 Destiny Grid, Territory Arrival Banner & Combat Regen Pill */
.create-step1-shell { padding: 12px 0; }
.hero-story-preview { font-size: 11px; background: #fffdf5; border: 1px solid #b5bdab; border-left: 3px solid var(--gold); border-radius: 4px; padding: 8px; line-height: 1.4; max-height: 150px; overflow-y: auto; }
.destiny-grid-9 { display: grid; grid-template-columns: 1fr; gap: 5px; max-height: 295px; overflow-y: auto; }
.destiny-card { cursor: pointer; transition: transform 0.08s, box-shadow 0.08s; }
.destiny-grid-9 .sub-card.destiny-card.selected, .destiny-card.selected { border: 2px solid #993b32; background: #fef3c7; box-shadow: 0 2px 8px rgba(153, 59, 50, 0.25); }
.destiny-tier { display: inline-block; font-size: 9.5px; font-weight: 700; padding: 1px 5px; border-radius: 3px; color: #fff; margin-right: 4px; }
.combat-state-pill { margin-top: 5px; font-size: 10px; font-weight: 700; text-align: center; padding: 3px 6px; border-radius: 3px; background: #e3e9d8; color: #264d3b; border: 1px solid #7d967c; }
.combat-state-pill.in-combat { background: #f2deda; color: #8f2d24; border-color: #ad594e; }
.skill-slot img.tm-slot-ic { width: 18px; height: 18px; object-fit: contain; margin: 1px auto; display: block; opacity: 0.92; }
#hud-zone-banner { position: absolute; top: 88px; left: 50%; transform: translateX(-50%); padding: 13px 68px; text-align: center; border: 1.5px solid #6e6757; border-left: 5px solid var(--seal); border-right: 5px solid var(--seal); z-index: 6; background: linear-gradient(90deg, rgba(247, 240, 223, 0.72), rgba(247, 240, 223, 0.94) 16%, rgba(247, 240, 223, 0.94) 84%, rgba(247, 240, 223, 0.72)), url("/assets/ui/thuy-mac/khung-cuon-thu-ngang.png") center/100% 100% no-repeat; box-shadow: 0 10px 26px rgba(18, 24, 20, 0.36); pointer-events: auto; min-width: 300px; max-width: min(640px, 88vw); }
#hzb-title { font-family: "BatHoangThuPhap", "BatHoangInk", serif; font-size: 16.5px; font-weight: 700; color: var(--seal); text-shadow: 0 1px 0 rgba(255, 250, 236, 0.92); }
#hzb-sub { font-size: 11.5px; color: var(--ink); font-weight: 600; text-shadow: 0 1px 0 rgba(255, 250, 236, 0.85); }
h1, #hud-zone-banner, .realm-title, .boss-name { font-family: "BatHoangThuPhap", "BatHoangInk", serif; }
.thuy-mac-event-banner { display: block; width: 100%; max-height: 175px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; border: 1.5px solid #8f846e; margin-bottom: 10px; box-shadow: 0 4px 12px rgba(20, 24, 20, 0.2); }
.sect-emblem-ic { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; border-radius: 4px; background: rgba(239, 230, 210, 0.65); border: 1px solid #9b9079; padding: 2px; }
.tm-modal-ic { width: 16px; height: 16px; object-fit: contain; vertical-align: -3px; margin-right: 4px; }

/* V17: Top Target Avatar Frame + Right-Click Context Menu */
#hud-target-frame {
  position: absolute; top: 84px; left: calc(50% + 28px); transform: translateX(-50%);
  width: min(335px, 88vw); padding: 7px 10px; z-index: 9; pointer-events: auto;
  display: flex; align-items: center; gap: 10px; border-left: 3.5px solid var(--seal);
  background: rgba(244, 237, 221, 0.96); box-shadow: 0 6px 18px rgba(18, 24, 20, 0.28);
}
#hud-target-avatar {
  width: 52px; height: 52px; overflow: hidden; border-radius: 5px;
  border: 2px solid #8c7a5b; background: #e6dfd0; cursor: context-menu; flex-shrink: 0;
}
#hud-target-avatar:hover { box-shadow: 0 0 0 2px #993b32; }
.htf-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.htf-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.htf-head strong { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.htf-sub { font-size: 10.5px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.htf-hp-bar { height: 12px; margin-top: 1px; }
.htf-hp-bar span { font-size: 9.5px; line-height: 11px; }
.htf-meta { font-size: 10px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hud-zone-banner.has-target { top: 168px; }
#target-context-menu {
  position: fixed; z-index: 70; min-width: 196px; padding: 5px;
  display: flex; flex-direction: column; gap: 3px; border: 1.5px solid #8c7a5b;
  background: rgba(247, 240, 223, 0.98); box-shadow: 0 8px 24px rgba(15, 20, 17, 0.36);
}
.tcm-head { font-size: 11px; font-weight: 700; color: var(--seal); padding: 2px 6px 4px; border-bottom: 1px dashed #b4a474; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcm-item { justify-content: flex-start; text-align: left; width: 100%; font-size: 11.5px; padding: 5px 8px; }
.tcm-item:hover { background: #dce8d6; border-color: var(--jade); }

/* Pinned Boss HP Bar, 2-Col Equip Diff, Bag Lock, Trial Tower & Settings */
#hud-boss-bar {
  position: absolute; top: 144px; left: 50%; transform: translateX(-50%);
  width: min(440px, 84vw); padding: 7px 11px; z-index: 13; pointer-events: none;
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid #8f2d24; border-left: 5px solid #8f2d24;
  background: rgba(244, 237, 221, 0.96); box-shadow: 0 8px 22px rgba(24, 16, 16, 0.34);
}
.boss-bar-img { width: 42px; height: 42px; border-radius: 5px; object-fit: cover; border: 1.5px solid #8f2d24; background: #e8dec8; flex-shrink: 0; }
.boss-bar-body { flex: 1; min-width: 0; }
.boss-bar-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 3px; }
.boss-bar-top strong { font-size: 13px; color: #5b1d17; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.boss-phase-tag { font-size: 9.5px; font-weight: 700; padding: 1px 6px; border-radius: 3px; background: #e5decb; color: #394a43; border: 1px solid #b4a474; flex-shrink: 0; }
.boss-phase-tag.enraged { background: #8f2d24; color: #fff8eb; border-color: #5b1d17; }
.boss-sbar { height: 14px; }
.boss-sbar span { font-size: 10px; line-height: 13px; font-weight: 700; }

.diff-box { background: #f2ece0; border: 1px solid #bdb299; border-left: 3px solid #2c5749; border-radius: 4px; padding: 6px 8px; margin: 4px 0; }
.diff-head { font-size: 10.5px; font-weight: 700; color: #2c5749; margin-bottom: 4px; }
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; font-size: 10.5px; }
.diff-row { display: flex; justify-content: space-between; gap: 6px; }
.diff-pos { color: #166534; font-weight: 700; }
.diff-neg { color: #b91c1c; font-weight: 700; }
.diff-eq { color: #64748b; }

.item-tile { position: relative; }
.lock-badge { position: absolute; top: 2px; left: 3px; font-size: 10px; line-height: 1; }
.tower-card { border-left: 4px solid #9a7432; }
.tower-card.cleared { border-left-color: #2c5749; background: #e8efe6; }
#hud-layer.arena-mode #hud-calendar,
#hud-layer.arena-mode #hud-target-frame,
#hud-layer.arena-mode #hud-zone-banner,
#hud-layer.arena-mode #hud-minimap-box { display: none !important; }
#hud-layer.arena-mode #arena-hud { top: 10px !important; z-index: 20; background: rgba(244, 237, 221, 0.96); box-shadow: 0 6px 18px rgba(10, 14, 12, 0.38); }
#hud-layer.arena-mode #hud-boss-bar { top: 58px !important; z-index: 19; }
.tower-victory-box { max-width: 520px; margin: 0 auto; text-align: center; }
.tower-reward-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 10px 0 14px; text-align: left; }
.settings-box { display: flex; flex-direction: column; gap: 10px; max-width: 560px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #f3ecdc; border: 1px solid #c5bca7; border-radius: 4px; padding: 8px 10px; }
.settings-row input[type="range"] { width: 170px; accent-color: #8f2d24; }

/* ---- REDESIGNED STEP 1 SAVE CARDS & STEP 2 2-COL CREATOR + SPIRIT ROOT ---- */
.name-input-row { display: flex; gap: 8px; align-items: center; }
.name-input-row input { flex: 1; }
.save-cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0; }
.save-slot-card {
  background: #f5efe0; border: 1.5px solid #968b74; border-radius: 4px; padding: 9px 10px;
  display: flex; flex-direction: column; gap: 6px; cursor: pointer; transition: border-color .14s, background .14s;
}
.save-slot-card.active { border-color: #8f2d24; background: #faf4e4; box-shadow: 0 2px 10px rgba(143, 45, 36, 0.16); }
.save-slot-card.empty { align-items: center; justify-content: center; text-align: center; min-height: 98px; border-style: dashed; }
.save-card-top { display: flex; gap: 8px; align-items: center; }
.save-card-avatar { width: 44px; height: 44px; overflow: hidden; border-radius: 4px; border: 1px solid #7d735f; background: #e8dec8; flex-shrink: 0; }
.save-card-avatar img { width: 800%; height: 400%; max-width: none; display: block; }
.save-card-title { font-size: 12.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.save-card-meta { font-size: 10.5px; color: var(--ink-muted); line-height: 1.3; }
.save-card-empty-title { font-size: 12.5px; font-weight: 700; color: var(--jade); }
.save-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.cloud-sync-box { background: rgba(242, 234, 214, 0.72); border: 1px dashed #9d927b; border-radius: 4px; padding: 6px 10px; font-size: 12px; }
.cloud-sync-box summary { cursor: pointer; font-weight: 600; color: var(--jade); }

.creator-2col { display: grid; grid-template-columns: 320px 1fr; gap: 14px; align-items: stretch; }
.creator-stage-col { align-items: center; }
.stage-canvas-wrap { display: flex; justify-content: center; align-items: center; width: 100%; }
.creator-stage-controls { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.live-stats-box { width: 100%; background: #f2ead8; border: 1px solid #968b74; border-left: 3px solid var(--jade); border-radius: 4px; padding: 8px 10px; font-size: 11.5px; }
.live-stat-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; color: var(--seal); }
.live-stat-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.live-stat-tags span { background: #e6dcc4; border: 1px solid #b5a788; border-radius: 3px; padding: 1px 6px; font-size: 10px; }
.live-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 8px; font-size: 11px; }
.live-root-hint { margin-top: 6px; padding-top: 5px; border-top: 1px dashed #a89c82; font-size: 10.5px; color: #2c5749; line-height: 1.35; }

.creator-wizard-col { min-width: 0; }
.creator-tab-bar { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1.5px solid #9d927b; padding-bottom: 8px; }
.creator-tab-btn.active { background: linear-gradient(180deg, #8f2d24, #681e17); color: #fff8ea; border-color: #4f150f; text-shadow: none; }
.creator-tab-pane { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 360px; max-height: 455px; overflow-y: auto; padding-right: 2px; }
.creator-hero-grid { max-height: 185px; }
.creator-school-2col { grid-template-columns: repeat(2, 1fr); max-height: 390px; overflow-y: auto; }

.origin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; max-height: 240px; overflow-y: auto; }
.origin-card {
  text-align: left; font-family: var(--font-main); background: #f5efe2; border: 1px solid #a2957c; border-radius: 4px;
  padding: 7px 8px; cursor: pointer; display: flex; flex-direction: column; gap: 3px;
}
.origin-card:hover { border-color: var(--seal); }
.origin-card.active { border: 2px solid #8f2d24; background: #fbf4e3; box-shadow: inset 0 0 0 1px rgba(143, 45, 36, 0.2); }
.origin-head { display: flex; justify-content: space-between; align-items: center; gap: 4px; font-size: 12px; color: var(--ink); }
.origin-tag { font-size: 9.5px; background: #e3dac3; padding: 1px 5px; border-radius: 3px; color: var(--jade); }
.origin-lore { margin: 0; font-size: 10.5px; color: var(--ink-muted); line-height: 1.3; }
.origin-bonus { font-size: 10px; font-weight: 700; color: #2c5749; }

.mind-diff-block { background: #efe7d4; border: 1px solid #b5a788; border-radius: 4px; padding: 7px 9px; }
.mind-row-label { font-size: 11px; font-weight: 700; color: var(--seal); margin-bottom: 4px; }
.pill-choice-row { display: flex; gap: 5px; flex-wrap: wrap; }
.pill-choice {
  font-family: var(--font-main); font-size: 11px; padding: 3px 8px; background: #f8f2e4; border: 1px solid #968b74; border-radius: 3px; cursor: pointer;
}
.pill-choice.active { background: #2c5749; color: #fbf6e8; border-color: #1b382e; font-weight: 700; }

.destiny-top-row { display: flex; justify-content: space-between; align-items: center; gap: 4px; margin-bottom: 3px; }
.destiny-lock-btn {
  font-family: var(--font-main); font-size: 10px; padding: 1px 5px; border: 1px solid #9d927b; border-radius: 3px;
  background: #efe6d2; color: #394a43; cursor: pointer;
}
.destiny-lock-btn.active { background: #8f2d24; color: #fff8eb; border-color: #5b1d17; }
.destiny-card.locked-card { box-shadow: inset 0 0 0 1px #8f2d24; }
.destiny-picked-mark { float: right; color: #993b32; font-weight: 700; font-size: 10.5px; }

.root-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 3px;
  border: 1px solid #2c5749; font-size: 11.5px; font-weight: 700; margin: 2px;
}
.compat-pill-ok { background: #dcfce7; color: #166534; border: 1px solid #16a34a; border-radius: 3px; padding: 1px 6px; font-size: 10.5px; font-weight: 700; }
.compat-pill-lock { background: #fee2e2; color: #991b1b; border: 1px solid #dc2626; border-radius: 3px; padding: 1px 6px; font-size: 10.5px; font-weight: 700; }
.prologue-scroll, .awaken-altar { max-width: 640px; margin: 0 auto; text-align: center; }
.prologue-banner { font-size: 17px; font-weight: 700; color: #8f2d24; border-bottom: 1.5px dashed #9d927b; padding-bottom: 6px; margin-bottom: 8px; }
.prologue-scroll .sub-card { text-align: left; }

@media (max-width: 900px) {
  .save-cards-grid { grid-template-columns: 1fr; }
  .creator-2col { grid-template-columns: 1fr; }
  .origin-grid, .creator-school-2col { grid-template-columns: 1fr; }
}

/* ==== GÓI 1-3 VISUAL POLISH, FASHION, ACTIVITIES & 1366x768 RESPONSIVE ==== */
.status-strip { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.status-strip.hidden { display: none; }
.status-pill {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 3px;
  background: #f5efe0; border: 1px solid #9a7432; color: #27342e;
}
.status-pill img { width: 14px; height: 14px; object-fit: contain; display: block; }
.bh-btn { position: relative; }
.bh-btn.has-notif::after {
  content: ""; position: absolute; top: -2px; right: -2px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #c83228; border: 1px solid #fff8eb; pointer-events: none;
}
.sect-emblem-ic {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  border: 1.5px solid #8c7a5b; background: #1e2723; flex-shrink: 0;
}
.log-filter-bar { display: flex; gap: 4px; margin-bottom: 4px; flex-wrap: wrap; }
.log-ft {
  font-family: var(--font-main); font-size: 10px; font-weight: 600;
  padding: 1px 7px; border-radius: 3px; cursor: pointer;
  background: rgba(240, 232, 213, 0.85); color: #394a43; border: 1px solid #b5aa91;
}
.log-ft.active { background: #2c5749; color: #fbf6e8; border-color: #1b382e; }
.gfs-preset-bar, .gfs-evo-box { margin-bottom: 6px; }
.gfs-costume-thumb { width: 64px; height: 64px; overflow: hidden; border: 1px solid #9a7432; border-radius: 5px; background: #141a18; }
@media (max-width: 1400px), (max-height: 780px) {
  #hud-profile { max-width: 295px; padding: 7px 9px; font-size: 11px; }
  #hud-calendar { max-width: 245px; font-size: 11px; }
  #hud-boss-bar { top: 48px; min-width: 300px; max-width: 38vw; }
  #hud-quest-box { max-width: 240px; }
  #hud-minimap-box canvas { width: 132px; height: 132px; }
  #hud-log { max-width: 310px; max-height: 148px; }
  .bh-modal { max-width: 96vw; max-height: 92vh; }
}

/* ==== KỲ ÁN & SỰ KIỆN BƯỚC NGOẶC (PARCHMENT EVENT CARD) ==== */
.story-parchment {
  position: relative; max-width: 560px; margin: 4px auto 8px;
  padding: 20px 24px 28px; border-radius: 3px;
  background: linear-gradient(180deg, #f6efe0 0%, #ede3cb 100%);
  border: 2px solid #8a7c60;
  box-shadow: inset 0 0 0 4px #f5eedc, inset 0 0 0 5.5px #a49679, 0 8px 24px rgba(20, 18, 12, 0.35);
  color: #241f18; font-family: var(--font-main);
}
.story-corner {
  position: absolute; width: 7px; height: 7px; background: #8f2d24; transform: rotate(45deg);
}
.story-corner.tl { top: 8px; left: 8px; }
.story-corner.tr { top: 8px; right: 8px; }
.story-corner.bl { bottom: 8px; left: 8px; }
.story-corner.br { bottom: 8px; right: 8px; }
.story-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.story-title { font-size: 20px; font-weight: 800; color: #1b1812; letter-spacing: 0.2px; }
.story-loc { font-size: 13.5px; color: #6c6352; font-style: italic; }
.story-body-txt { font-size: 14px; line-height: 1.58; color: #2b241b; margin-bottom: 16px; }
.story-body-txt b { color: #17130d; font-weight: 800; }
.story-choice-list { display: flex; flex-direction: column; gap: 8px; }
.story-choice-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 14px; border-radius: 2px; cursor: pointer;
  background: linear-gradient(180deg, #f9f4e7 0%, #eee6d1 100%);
  border: 1.5px solid #8d8064; box-shadow: inset 0 1px 0 #fffdf7;
  font-family: var(--font-main); font-size: 13.5px; font-weight: 600; color: #241f18;
  transition: border-color 0.14s, background 0.14s;
}
.story-choice-btn:hover { border-color: #8f2d24; background: linear-gradient(180deg, #fffaf0 0%, #f5ead1 100%); }
.story-choice-num { font-weight: 800; font-size: 15px; color: #8f2d24; min-width: 18px; }
.story-choice-lbl { flex: 1; }
.story-seal-badge {
  position: absolute; right: 12px; bottom: -14px; width: 38px; height: 38px; border-radius: 50%;
  background: #f5eedc; border: 2px solid #8f2d24; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.story-clue-bar {
  margin-top: 4px; padding: 3px 6px; border-radius: 3px; font-size: 11px;
  background: #f5ead2; border: 1px solid #b59a6a; color: #5b3e17;
}
.cos-frame-crop {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 5px;
  border: 1.5px solid #968b74; background-color: #141a18;
  background-repeat: no-repeat; background-size: 1400% 800%; background-position: 0% 0%;
  image-rendering: pixelated;
}
.cos-thumb-54 {
  width: 54px; height: 54px; flex-shrink: 0; border-radius: 4px;
  border: 1.5px solid var(--timber, #5c4632); background: var(--lacquer, #162421);
  object-fit: contain; image-rendering: pixelated; padding: 2px;
}
.charbag-layout {
  display: grid; grid-template-columns: minmax(340px, 43%) 1fr; gap: 12px; align-items: start;
}
.cb-left, .cb-right { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cb-inv-scroll { max-height: 235px; overflow-y: auto; padding-right: 2px; }
#hud-skillbar .skill-slot.aiming {
  border-color: var(--seal, #8f2d24); background: rgba(143, 45, 36, 0.34);
  box-shadow: 0 0 10px rgba(224, 130, 45, 0.55), inset 0 0 6px rgba(227, 199, 124, 0.42);
  transform: translateY(-3px);
}
@media (max-width: 960px) {
  .charbag-layout { grid-template-columns: 1fr; }
}
#scene-hud {
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 25;
  display: flex; align-items: center; gap: 12px; padding: 6px 14px; font-weight: 700;
}
#scene-hud.hidden { display: none; }
