/* ==========================================================================
 * Phong Than Online — Authentic play.fsweb.in Landscape & PC UI Skin
 * Active ONLY when body[data-ui-skin="fsweb"] (Landscape Mobile & PC)
 * Portrait mode (body[data-ui-skin="fsnhanroi"]) preserves 100% fsnhanroi UI!
 * ========================================================================== */

@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fs/ui/fsweb/fonts/oswald-600-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fs/ui/fsweb/fonts/oswald-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
 * 0. Strict Skin Isolation: Portrait = fsnhanroi · Landscape/PC = play.fsweb.in
 * -------------------------------------------------------------------------- */
body[data-ui-skin="fsnhanroi"] #fsweb-hud-root,
body[data-ui-skin="fsnhanroi"] .fsw-lg-logo,
body[data-ui-skin="fsnhanroi"] .fsw-lg-music,
body[data-ui-skin="fsnhanroi"] .fsw-cs-head,
body[data-ui-skin="fsnhanroi"] .fsw-cs-foot,
body[data-ui-skin="fsnhanroi"] .fsw-stage-act {
  display: none !important;
}

body[data-ui-skin="fsweb"] #fs-hud-root {
  display: none !important;
}

/* Authentic play.fsweb.in Custom Game Cursor on PC */
body[data-ui-skin="fsweb"][data-fsweb-touch="0"],
body[data-ui-skin="fsweb"][data-fsweb-touch="0"] #screen {
  cursor: url('../assets/fs/ui/fsweb/cursor/cursor_0.png') 0 0, default;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="0"] input[type="text"],
body[data-ui-skin="fsweb"][data-fsweb-touch="0"] input[type="password"],
body[data-ui-skin="fsweb"][data-fsweb-touch="0"] input[type="search"],
body[data-ui-skin="fsweb"][data-fsweb-touch="0"] textarea {
  cursor: text;
}

/* --------------------------------------------------------------------------
 * 1. play.fsweb.in Sprite Atlas (.fsw-ua -> atlas.webp 256x91)
 * -------------------------------------------------------------------------- */
.fsw-ua {
  display: inline-block;
  flex: none;
  background: url('../assets/fs/ui/fsweb/atlas.webp') no-repeat;
  background-size: 256px 91px;
  image-rendering: pixelated;
  vertical-align: top;
}
.fsw-ua-auto   { width: 67px; height: 29px; background-position: -140px -51px; }
.fsw-ua-bag    { width: 26px; height: 40px; background-position: -51px 0; }
.fsw-ua-char   { width: 26px; height: 40px; background-position: -79px 0; }
.fsw-ua-f2     { width: 49px; height: 49px; background-position: 0 0; }
.fsw-ua-friend { width: 26px; height: 40px; background-position: -107px 0; }
.fsw-ua-guild  { width: 26px; height: 40px; background-position: -135px 0; }
.fsw-ua-horse  { width: 26px; height: 40px; background-position: -163px 0; }
.fsw-ua-pk     { width: 26px; height: 40px; background-position: -191px 0; }
.fsw-ua-info   { width: 26px; height: 40px; background-position: -219px 0; }
.fsw-ua-mining { width: 26px; height: 40px; background-position: 0 -51px; }
.fsw-ua-quest  { width: 26px; height: 40px; background-position: -28px -51px; }
.fsw-ua-skill  { width: 26px; height: 40px; background-position: -56px -51px; }
.fsw-ua-sys    { width: 26px; height: 40px; background-position: -84px -51px; }
.fsw-ua-team   { width: 26px; height: 40px; background-position: -112px -51px; }

/* --------------------------------------------------------------------------
 * 2. play.fsweb.in Login Screen (Landscape & PC)
 * -------------------------------------------------------------------------- */
body[data-ui-skin="fsweb"] #pt-auth-backdrop {
  background:
    radial-gradient(ellipse 70% 75% at 35% 50%, rgba(6, 7, 10, 0.06), rgba(6, 7, 10, 0.58)),
    linear-gradient(90deg, rgba(6, 7, 10, 0.12) 0%, rgba(6, 7, 10, 0.14) 44%, rgba(6, 7, 10, 0.68) 100%),
    url('../assets/fs/ui/fsweb/bg_fsweb_1080.webp') 50% 40% / cover no-repeat,
    radial-gradient(ellipse at 50% 35%, #1d2433, #07080c 72%) !important;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}
body[data-ui-skin="fsweb"] #pt-auth-backdrop.hidden {
  display: none !important;
}
body[data-ui-skin="fsweb"] .pt-auth-top-tools {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 32;
  display: flex;
  align-items: center;
  gap: 8px;
}
body[data-ui-skin="fsweb"] .fsw-lg-music {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #8a6a2e;
  background: rgba(16, 13, 9, 0.82);
  color: #f0c96a;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}
body[data-ui-skin="fsweb"] .fsw-lg-music.is-muted {
  color: #8f8672;
  border-color: #4d3f25;
}
body[data-ui-skin="fsweb"] .fsw-lg-logo {
  position: absolute;
  left: max(20px, clamp(24px, 6.5vw, 120px));
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 440px - clamp(16px, 6vw, 110px) - clamp(24px, 6.5vw, 120px));
  text-align: center;
  pointer-events: none;
}
body[data-ui-skin="fsweb"] .fsw-lg-logo .fsw-lg-mark {
  width: clamp(92px, 16vw, 210px);
  height: clamp(92px, 16vw, 210px);
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.72));
}
body[data-ui-skin="fsweb"] .fsw-lg-name b {
  display: block;
  font: 700 clamp(24px, 3vw, 38px)/1.12 "Palatino Linotype", "Book Antiqua", Georgia, serif;
  background: linear-gradient(180deg, #fff4c9, #eac26a 50%, #a9752a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.88));
}
body[data-ui-skin="fsweb"] .fsw-lg-sub {
  margin-top: 3px;
  color: #b9a67c;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
}
body[data-ui-skin="fsweb"] #pt-auth-backdrop .pt-hero-header,
body[data-ui-skin="fsweb"] #pt-auth-backdrop .pt-shell-footer {
  display: none !important;
}
body[data-ui-skin="fsweb"] #pt-auth-backdrop .pt-auth-shell {
  position: relative;
  z-index: 3;
  margin: auto clamp(12px, 6vw, 110px) auto auto;
  width: 100%;
  max-width: 420px;
  max-height: calc(100% - 16px);
  overflow-y: auto;
  padding: 6px 0;
}
body[data-ui-skin="fsweb"] #pt-auth-backdrop .pt-auth-card {
  position: relative;
  padding: 22px 26px 16px;
  background: linear-gradient(180deg, rgba(32, 25, 16, 0.90), rgba(12, 10, 8, 0.95));
  border: 1px solid #8a6a2e;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.85), 0 20px 60px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 226, 150, 0.12);
}
body[data-ui-skin="fsweb"] #pt-auth-backdrop .pt-auth-card::after {
  display: none !important;
}
body[data-ui-skin="fsweb"] #pt-auth-backdrop .pt-auth-card::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(217, 184, 102, 0.2);
  border-radius: 7px;
  pointer-events: none;
}
body[data-ui-skin="fsweb"] #pt-auth-backdrop .pt-auth-card::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -1px;
  width: 46%;
  height: 2px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, #f3d27a, transparent);
}
body[data-ui-skin="fsweb"] #pt-auth-backdrop .pt-cluster-card {
  background: rgba(6, 6, 8, 0.55);
  border: 1px solid rgba(201, 154, 62, 0.35);
  border-radius: 6px;
}
body[data-ui-skin="fsweb"] #pt-auth-backdrop .pt-cluster-card[aria-checked="true"] {
  border-color: #e0b25a;
  background: rgba(201, 154, 62, 0.15);
  box-shadow: 0 0 0 1px rgba(241, 207, 120, 0.25);
}
body[data-ui-skin="fsweb"] #pt-auth-backdrop .pt-field input {
  min-height: 42px;
  background: rgba(6, 6, 8, 0.62);
  border: 1px solid #4d3f25;
  border-radius: 6px;
  color: #f3ead6;
  font-size: 15px;
}
body[data-ui-skin="fsweb"] #pt-auth-backdrop .pt-field input:focus {
  border-color: #d9b866;
  box-shadow: 0 0 0 3px rgba(217, 184, 102, 0.18);
}
body[data-ui-skin="fsweb"] #pt-auth-backdrop .pt-cta-btn {
  min-height: 46px;
  margin-top: 8px;
  border: 1px solid #f1cf78;
  border-radius: 6px;
  background: linear-gradient(180deg, #f7dc8f, #d7a748 52%, #b07f2a);
  color: #2b1705;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-shadow: none;
  box-shadow: 0 4px 16px rgba(201, 150, 50, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

/* Compact phone landscape Login (max-height: 520px) */
@media (max-height: 520px) {
  body[data-ui-skin="fsweb"] #pt-auth-backdrop .pt-auth-shell {
    max-width: 376px;
    margin-right: clamp(8px, 3vw, 40px);
  }
  body[data-ui-skin="fsweb"] #pt-auth-backdrop .pt-auth-card {
    padding: 12px 18px 10px;
  }
  body[data-ui-skin="fsweb"] .fsw-lg-logo .fsw-lg-mark {
    width: clamp(68px, 20vh, 128px);
    height: clamp(68px, 20vh, 128px);
  }
  body[data-ui-skin="fsweb"] .fsw-lg-sub {
    display: none;
  }
  body[data-ui-skin="fsweb"] #pt-auth-backdrop .pt-field input {
    min-height: 36px;
    padding: 5px 10px;
  }
  body[data-ui-skin="fsweb"] #pt-auth-backdrop .pt-cta-btn {
    min-height: 38px;
    margin-top: 4px;
  }
}

/* --------------------------------------------------------------------------
 * 3. play.fsweb.in Character Select / Create (Landscape & PC)
 * -------------------------------------------------------------------------- */
body[data-ui-skin="fsweb"] #fs-charselect .cs-scenery {
  background:
    radial-gradient(ellipse 70% 75% at 50% 50%, rgba(6, 7, 10, 0.2), rgba(6, 7, 10, 0.74)),
    url('../assets/fs/ui/fsweb/bg_fsweb_1080.webp') 50% 40% / cover no-repeat !important;
}
body[data-ui-skin="fsweb"] #fs-charselect .cs-topbar .cs-small-button,
body[data-ui-skin="fsweb"] #fs-charselect .cs-topbar .cs-brand,
body[data-ui-skin="fsweb"] #fs-charselect #cs-dragon-heading,
body[data-ui-skin="fsweb"] #fs-charselect .cs-selection-box > .cs-selected-summary,
body[data-ui-skin="fsweb"] #fs-charselect .cs-selection-box > .cs-dragon-action,
body[data-ui-skin="fsweb"] #fs-charselect .cs-selection-box > .cs-secondary-actions,
body[data-ui-skin="fsweb"] #fs-charselect .cs-hero-heading,
body[data-ui-skin="fsweb"] #fs-charselect .cs-hometown-badge {
  display: none !important;
}
body[data-ui-skin="fsweb"] #fs-charselect .cs-topbar {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  left: auto;
  width: auto;
  padding: 0;
  background: none;
  border: 0;
  z-index: 15;
}
body[data-ui-skin="fsweb"] #fs-charselect .cs-layout {
  position: relative;
  z-index: 2;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(276px, 340px) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  width: 100%;
  max-width: 1120px;
  height: 100%;
  padding: max(16px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
}
body[data-ui-skin="fsweb"] #fs-charselect .cs-controls-pane {
  order: -1;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100% - 16px);
  padding: 16px 18px 12px;
  background: linear-gradient(180deg, rgba(32, 25, 16, 0.88), rgba(12, 10, 8, 0.94));
  border: 1px solid #8a6a2e;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.85), 0 20px 60px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 226, 150, 0.12);
  overflow-y: auto;
}
body[data-ui-skin="fsweb"] #fs-charselect .cs-controls-pane::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(217, 184, 102, 0.2);
  border-radius: 7px;
  pointer-events: none;
}
body[data-ui-skin="fsweb"] #fs-charselect .fsw-cs-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(217, 184, 102, 0.25);
}
body[data-ui-skin="fsweb"] #fs-charselect .fsw-cs-head .fsw-lg-mark {
  width: 42px;
  height: 42px;
  object-fit: contain;
}
body[data-ui-skin="fsweb"] #fs-charselect .fsw-cs-head small {
  display: block;
  color: #b9a67c;
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}
body[data-ui-skin="fsweb"] #fs-charselect .fsw-cs-head h2 {
  margin: 0;
  font: 700 21px/1.2 "Palatino Linotype", "Book Antiqua", Georgia, serif;
  color: #f0c96a;
}
body[data-ui-skin="fsweb"] #fs-charselect .cs-character-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
body[data-ui-skin="fsweb"] #fs-charselect .cs-character-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 7px 10px;
  border: 1px solid #4d3f25;
  border-radius: 8px;
  background: rgba(6, 6, 8, 0.55);
  box-shadow: none;
}
body[data-ui-skin="fsweb"] #fs-charselect .cs-character-card img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #7a5f2c;
  background: #14110b;
  filter: saturate(0.6) brightness(0.82);
}
body[data-ui-skin="fsweb"] #fs-charselect .cs-character-card[aria-pressed="true"] {
  border-color: #f1cf78;
  background: linear-gradient(90deg, rgba(120, 86, 30, 0.45), rgba(30, 24, 14, 0.6));
  box-shadow: 0 0 0 1px rgba(241, 207, 120, 0.35), 0 0 16px rgba(217, 170, 80, 0.25);
}
body[data-ui-skin="fsweb"] #fs-charselect .cs-character-card[aria-pressed="true"] img {
  border-color: #f1cf78;
  filter: none;
}
body[data-ui-skin="fsweb"] #fs-charselect .cs-character-card.cs-create-slot {
  justify-content: center;
  border-style: dashed;
  background: rgba(6, 6, 8, 0.35);
  color: #cdbf9c;
  font-weight: 600;
}
body[data-ui-skin="fsweb"] #fs-charselect .cs-selection-box {
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}
body[data-ui-skin="fsweb"] #fs-charselect .fsw-cs-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(217, 184, 102, 0.18);
  color: #8f8672;
  font-size: 12px;
}
body[data-ui-skin="fsweb"] #fs-charselect .fsw-lnk-btn,
body[data-ui-skin="fsweb"] #fs-charselect .fsw-del-lnk {
  background: none;
  border: 0;
  color: #e5c47c;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
}
body[data-ui-skin="fsweb"] #fs-charselect .fsw-del-lnk {
  color: #e89a86;
}
body[data-ui-skin="fsweb"] #fs-charselect .fsw-lnk-btn:hover,
body[data-ui-skin="fsweb"] #fs-charselect .fsw-del-lnk:hover {
  text-decoration: underline;
}
body[data-ui-skin="fsweb"] #fs-charselect .character-selection {
  --fsw-glow: rgba(232, 150, 60, 0.32);
}
body[data-ui-skin="fsweb"] #fs-charselect .character-selection[data-prof="1"] {
  --fsw-glow: rgba(90, 170, 230, 0.32);
}
body[data-ui-skin="fsweb"] #fs-charselect .character-selection[data-prof="2"] {
  --fsw-glow: rgba(170, 100, 230, 0.32);
}
body[data-ui-skin="fsweb"] #fs-charselect .cs-hero-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
body[data-ui-skin="fsweb"] #fs-charselect .cs-hero-canvas-wrap {
  position: relative;
  width: min(440px, 100%, calc((100vh - 210px)));
  height: min(370px, calc(100vh - 210px));
}
body[data-ui-skin="fsweb"] #fs-charselect .cs-floor-glow {
  border-radius: 50%;
  border: 1px solid rgba(241, 207, 120, 0.45);
  background: radial-gradient(closest-side, rgba(241, 207, 120, 0.28), rgba(241, 207, 120, 0.05) 70%, transparent);
  box-shadow: 0 0 32px var(--fsw-glow);
}
body[data-ui-skin="fsweb"] #fs-charselect .fsw-stage-act {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  width: min(280px, 100%);
  text-align: center;
}
body[data-ui-skin="fsweb"] #fs-charselect .fsw-stage-info b {
  display: block;
  font: 700 26px/1.2 "Palatino Linotype", "Book Antiqua", Georgia, serif;
  color: #f0c96a;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}
body[data-ui-skin="fsweb"] #fs-charselect .fsw-stage-info span {
  color: #d8cba8;
  font-size: 13.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
body[data-ui-skin="fsweb"] #fs-charselect .fsw-stage-btns {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}
body[data-ui-skin="fsweb"] #fs-charselect .fsw-go-btn,
body[data-ui-skin="fsweb"] #fs-charselect #cs-btn-create {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid #f1cf78;
  border-radius: 6px;
  background: linear-gradient(180deg, #f7dc8f, #d7a748 52%, #b07f2a);
  color: #2b1705;
  font: 700 16px/1.2 "Segoe UI", Tahoma, Arial, sans-serif;
  letter-spacing: 2px;
  text-shadow: none;
  box-shadow: 0 4px 16px rgba(201, 150, 50, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  cursor: pointer;
}
body[data-ui-skin="fsweb"] #fs-charselect .fsw-go-btn:hover {
  filter: brightness(1.08);
}

@media (max-height: 520px) {
  body[data-ui-skin="fsweb"] #fs-charselect .cs-layout {
    grid-template-columns: minmax(248px, 316px) minmax(0, 1fr);
    gap: 12px;
    padding: 8px 14px;
  }
  body[data-ui-skin="fsweb"] #fs-charselect .cs-controls-pane {
    padding: 10px 12px 8px;
  }
  body[data-ui-skin="fsweb"] #fs-charselect .fsw-cs-head {
    padding-bottom: 6px;
    margin-bottom: 6px;
  }
  body[data-ui-skin="fsweb"] #fs-charselect .fsw-cs-head small,
  body[data-ui-skin="fsweb"] #fs-charselect .fsw-dbl-hint {
    display: none;
  }
  body[data-ui-skin="fsweb"] #fs-charselect .cs-character-card {
    min-height: 48px;
    padding: 4px 8px;
  }
  body[data-ui-skin="fsweb"] #fs-charselect .cs-character-card img {
    width: 38px;
    height: 38px;
  }
  body[data-ui-skin="fsweb"] #fs-charselect .cs-hero-canvas-wrap {
    width: min(260px, calc(100vh - 120px));
    height: min(215px, calc(100vh - 120px));
  }
  body[data-ui-skin="fsweb"] #fs-charselect .fsw-stage-info b {
    font-size: 19px;
  }
  body[data-ui-skin="fsweb"] #fs-charselect .fsw-stage-btns {
    flex-direction: row;
    gap: 10px;
    width: min(320px, 100%);
  }
  body[data-ui-skin="fsweb"] #fs-charselect .fsw-go-btn {
    min-height: 38px;
    font-size: 14px;
  }
}

/* --------------------------------------------------------------------------
 * 4. play.fsweb.in In-Game HUD (#fsweb-hud-root) — PC & Mobile Landscape
 * -------------------------------------------------------------------------- */
#fsweb-hud-root {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  font: 12px/1.38 Tahoma, "Segoe UI", Verdana, sans-serif;
  color: #e8e2d0;
  --chw: clamp(150px, calc(100vw - 500px), 240px);
}
#fsweb-hud-root[hidden] {
  display: none !important;
}
#fsweb-hud-root .fsw-interactive {
  pointer-events: auto;
}

/* 4A. Top-Left Stack (#fsw-left: #phud + Point Alerts + Target HUD + #qh Quest/Party) */
#fsw-left {
  position: absolute;
  left: max(10px, env(safe-area-inset-left));
  top: max(10px, env(safe-area-inset-top));
  width: 245px;
  max-height: calc(100% - 140px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  z-index: 22;
}
#fsw-phud {
  position: relative;
  width: 192px;
  padding: 5px 7px 7px 5px;
  background: linear-gradient(#1c1812, #0f0d09);
  border: 2px solid #7a5f2c;
  border-radius: 8px;
  box-shadow: 0 0 0 1px #000, 0 6px 22px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  pointer-events: auto;
}
#fsw-phud:hover {
  border-color: #b8923f;
}
#fsw-phud .pm {
  display: flex;
  gap: 6px;
  align-items: center;
}
#fsw-phud .pa {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
}
#fsw-phud .pc {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1a120c;
  overflow: hidden;
  border: 2px solid #7a5f2c;
  box-shadow: 0 0 0 1px #000;
}
#fsw-phud .pc img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#fsw-phud .plv {
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  min-width: 18px;
  height: 16px;
  padding: 0 3px;
  border-radius: 8px;
  background: #0f0d09;
  border: 1px solid #7a5f2c;
  box-shadow: 0 0 0 1px #000;
  font: 700 10px/14px Tahoma, Verdana, sans-serif;
  text-align: center;
  color: #7dff7d;
  text-shadow: 0 0 3px #000;
}
#fsw-phud .pi {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#fsw-phud .pr1 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
  height: 13px;
  font: 700 10.5px/13px Tahoma, Verdana, sans-serif;
  text-shadow: -1px 0 #000, 1px 0 #000, 0 -1px #000, 0 1px #000;
}
#fsw-ph-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f4ecd8;
}
#fsw-ph-fac {
  flex: none;
  font-size: 9.5px;
  color: #ffe34d;
}
#fsw-phud .bar {
  position: relative;
  overflow: hidden;
  background: #120c08;
  border: 1px solid #7a5f2c;
  height: 10px;
}
#fsw-phud .bar i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
}
#fsw-phud .bar.hp i {
  background: linear-gradient(#7a1410, #e8483c 40%, #ff8a70 55%, #c0281e 70%, #6a100c);
}
#fsw-phud .bar.mp i {
  background: linear-gradient(#10207a, #3c5ce8 40%, #7a9cff 55%, #2840c0 70%, #0c146a);
}
#fsw-phud .bar.xp i {
  background: linear-gradient(#6a5008, #e0b830 45%, #ffe27a 55%, #b08a18 70%, #5a4006);
}
#fsw-phud .bt {
  position: absolute;
  inset: 0;
  text-align: center;
  white-space: nowrap;
  color: #fff;
  font: 700 8px/8px Tahoma, Verdana, sans-serif;
  text-shadow: -1px 0 #000, 1px 0 #000, 0 -1px #000, 0 1px #000, 0 0 3px #000;
}

.fsw-ph-dot {
  position: absolute;
  right: -1px;
  top: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff4738;
  border: 1px solid #fff2b0;
  box-shadow: 0 0 5px rgba(255, 71, 56, 0.9);
  pointer-events: none;
}

#fsw-point-alerts {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.fsw-alert-pill {
  padding: 2px 8px;
  border: 1px solid #d4af59;
  border-radius: 5px;
  background: linear-gradient(#4a3516, #24190a);
  color: #ffe89e;
  font: 700 10.5px/1.3 Tahoma, sans-serif;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

#fsw-fsbtn {
  position: absolute;
  left: 50%;
  top: max(4px, env(safe-area-inset-top));
  transform: translateX(-50%);
  z-index: 27;
  padding: 2px 10px;
  border-radius: 12px;
  border: 1px solid #d4af59;
  background: rgba(18, 15, 10, 0.86);
  color: #ffe9a8;
  font: 700 10.5px/1.4 Tahoma, sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
  cursor: pointer;
}
#fsw-fsbtn[hidden] {
  display: none !important;
}

/* Active Auto-Navigation Pill (#fsw-qh-nav: stays visible even when #fsw-qh is minimized) */
#fsw-left > .qh-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  max-width: 190px;
  padding: 2px 7px;
  background: rgba(16, 30, 18, 0.78);
  border: 1px solid rgba(94, 196, 109, 0.72);
  border-radius: 5px;
  color: #b6ffbe;
  font: 700 10.5px/1.3 Tahoma, sans-serif;
  pointer-events: auto;
}
#fsw-left > .qh-nav[hidden] {
  display: none !important;
}
#fsw-left > .qh-nav span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#fsw-left > .qh-nav button {
  flex: none;
  padding: 0 5px;
  border: 1px solid #e0826d;
  border-radius: 4px;
  background: #5a1c14;
  color: #ffe2dc;
  font: 700 10px/1.3 Tahoma, sans-serif;
  cursor: pointer;
}

/* play.fsweb.in Quest / Party Tracker (#fsw-qh) */
#fsw-qh {
  --qh-h: min(26vh, 180px);
  width: 186px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  pointer-events: none;
}
#fsw-qh .qh-bar {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px;
  background: rgba(16, 20, 30, 0.14);
  border: 1px solid rgba(184, 146, 63, 0.48);
  border-radius: 6px;
  pointer-events: auto;
}
#fsw-qh .qh-bar button,
#fsw-qh .qh-show {
  height: 22px;
  padding: 0 7px;
  border: 1px solid #7a5f2c;
  border-radius: 5px;
  background: linear-gradient(rgba(42, 34, 22, 0.92), rgba(20, 16, 10, 0.92));
  cursor: pointer;
  font: 700 11px/20px Tahoma, Verdana, sans-serif;
  color: #b9b3a3;
  text-shadow: 1px 1px 0 #000;
}
#fsw-qh .qh-bar button:hover,
#fsw-qh .qh-show:hover {
  color: #f2ecd8;
  border-color: #b8923f;
}
#fsw-qh .qh-bar button.on {
  color: #ffd45a;
  border-color: #ffd45a;
  background: linear-gradient(#4a3a14, #241c0a);
  box-shadow: 0 0 6px rgba(255, 210, 90, 0.45);
}
#fsw-qh .qh-bar .qh-hide,
#fsw-qh .qh-show {
  width: 24px;
  padding: 0;
  text-align: center;
  color: #ffd45a;
  font-size: 11.5px;
}
#fsw-qh .qh-bar .qh-hide {
  margin-left: auto;
}
#fsw-qh .qh-body {
  width: 100%;
  max-height: var(--qh-h);
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 6px 8px;
  background: rgba(6, 8, 10, 0.16);
  border: 1px solid rgba(184, 146, 63, 0.46);
  border-radius: 6px;
  pointer-events: auto;
  font: 12px/1.45 Tahoma, Verdana, sans-serif;
  color: #f2ecd8;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
  scrollbar-width: thin;
  scrollbar-color: #7a5f2c transparent;
}
#fsw-qh .qh-show {
  display: none;
  align-self: flex-start;
  pointer-events: auto;
}
#fsw-qh.min .qh-bar,
#fsw-qh.min .qh-body {
  display: none;
}
#fsw-qh.min .qh-show {
  display: block;
}
#fsw-qh .qh-q {
  margin-bottom: 6px;
  cursor: pointer;
}
#fsw-qh .qh-q:last-child {
  margin-bottom: 0;
}
#fsw-qh .qh-q b {
  color: #ff6a56;
}
#fsw-qh .qh-npc {
  color: #3fe03f;
  text-decoration: underline;
  font-weight: 700;
  cursor: pointer;
}
#fsw-qh .qh-empty {
  color: #b9b3a3;
}

/* 4B. Top-Right Minimap (#fsw-mm) + Rank / Menu / KTC / Auto / Target */
#fsw-mm {
  position: absolute;
  right: 0;
  top: 0;
  width: 172px;
  background: linear-gradient(rgba(28, 24, 18, 0.94), rgba(15, 13, 9, 0.94));
  border: 2px solid #7a5f2c;
  border-top: 0;
  border-right: 0;
  border-radius: 0 0 0 8px;
  padding: 4px;
  box-shadow: 0 0 0 1px #000, 0 4px 14px rgba(0, 0, 0, 0.55);
  z-index: 23;
  pointer-events: auto;
}
#fsw-mm.is-expanded {
  width: 288px;
}
#fsw-mm.is-collapsed #fsw-mini-wrap,
#fsw-mm.is-collapsed .fsw-mm-tools {
  display: none;
}
#fsw-mm-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
  color: #e5c07b;
  font: 700 11.5px/1.2 Tahoma, sans-serif;
}
#fsw-mm-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#fsw-mm-h button {
  background: #1b2230;
  color: #d8dee9;
  border: 1px solid #4a3d22;
  border-radius: 4px;
  padding: 0 5px;
  height: 18px;
  font: 700 10.5px/16px Tahoma, sans-serif;
  cursor: pointer;
}
#fsw-mini-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 168 / 120;
  border: 1px solid #3c3220;
  border-radius: 3px;
  background: #06080a;
  overflow: hidden;
  cursor: pointer;
}
#fsw-mini-radar {
  display: block;
  width: 100%;
  height: 100%;
}
#fsw-mm-coords {
  position: absolute;
  right: 3px;
  bottom: 3px;
  padding: 1px 5px;
  border: 1px solid rgba(208, 174, 88, 0.65);
  border-radius: 3px;
  background: rgba(10, 12, 14, 0.82);
  color: #ffe38f;
  font: 700 10px/1.2 Consolas, monospace;
  cursor: pointer;
}
.fsw-mm-tools {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
.fsw-mm-tools button {
  flex: 1;
  height: 21px;
  padding: 0 4px;
  border: 1px solid #7a5f2c;
  border-radius: 4px;
  background: linear-gradient(#2c2415, #17130c);
  color: #e8d59e;
  font: 700 10.5px/19px Tahoma, sans-serif;
  cursor: pointer;
}
.fsw-mm-tools button:hover {
  border-color: #ffd870;
  color: #fff;
}
#fsw-mm-goto-form {
  display: flex;
  gap: 3px;
  margin-top: 4px;
}
#fsw-mm-goto-input {
  flex: 1;
  min-width: 0;
  height: 22px;
  padding: 0 5px;
  background: #0b0905;
  color: #fff;
  border: 1px solid #7a5f2c;
  border-radius: 3px;
  font: 11px Consolas, monospace;
}
#fsw-mm-goto-form button {
  height: 22px;
  padding: 0 8px;
  border: 1px solid #b8923f;
  border-radius: 3px;
  background: linear-gradient(#f0a640, #a8560f);
  color: #fff;
  font: 700 11px Tahoma, sans-serif;
  cursor: pointer;
}

/* Floating buttons left of Minimap */
#fsw-rankbtn {
  position: absolute;
  left: -32px;
  top: 4px;
  width: 26px;
  height: 26px;
  padding: 2px;
  border: 2px solid #7a5f2c;
  border-radius: 6px;
  background: linear-gradient(rgba(28, 24, 18, 0.94), rgba(15, 13, 9, 0.94));
  box-shadow: 0 0 0 1px #000;
  cursor: pointer;
}
#fsw-rankbtn:hover {
  border-color: #ffd870;
  box-shadow: 0 0 0 1px #000, 0 0 8px rgba(255, 216, 112, 0.6);
}
#fsw-menubtn,
#fsw-ktcbtn {
  display: none;
}

/* PC Auto + Quick-Target row directly below Minimap */
#fsw-pc-combat-side {
  position: absolute;
  right: 6px;
  top: 178px;
  z-index: 21;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  pointer-events: auto;
}
#fsw-mm.is-collapsed ~ #fsw-pc-combat-side {
  top: 34px;
}
#fsw-autobtn {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  line-height: 0;
}
#fsw-autobtn .fsw-ua {
  display: block;
  transform: scale(0.84);
  transform-origin: right top;
  filter: drop-shadow(0 1px 3px #000);
}
#fsw-autobtn:hover .fsw-ua {
  filter: drop-shadow(0 0 4px #ffd870) brightness(1.15);
}
#fsw-autobtn[aria-pressed="true"] .fsw-ua {
  filter: drop-shadow(0 0 6px #4cff6a) brightness(1.18);
}
#fsw-targetbtn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 24px;
  padding: 0 8px;
  border: 1.5px solid #b8923f;
  border-radius: 12px;
  background: linear-gradient(#3a1d16, #1a0c09);
  box-shadow: 0 0 0 1px #000, 0 2px 6px rgba(0, 0, 0, 0.65);
  color: #ffe9a8;
  font: 700 10.5px/1 Tahoma, sans-serif;
  cursor: pointer;
}
#fsw-targetbtn[data-mode="player"] {
  border-color: #5fd4ff;
  background: linear-gradient(#143448, #0b1c28);
  color: #d8f6ff;
}
#fsw-bagbtn {
  display: none;
}

/* 4C. PC Bottom-Center Dock (#fsw-dock: [Horse][PK][Party] + [#fsw-bar: Belt 1..4 + Ngự Các + Trái/Phải] + [#fsw-menu]) */
#fsw-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  z-index: 22;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 9px;
  pointer-events: none;
}
#fsw-dock > * {
  pointer-events: auto;
}
#fsw-horsebtn,
#fsw-pkbtn,
#fsw-partybtn {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  line-height: 0;
  margin: 0 0 2px 0;
}
#fsw-horsebtn .fsw-ua,
#fsw-pkbtn .fsw-ua,
#fsw-partybtn .fsw-ua {
  zoom: 0.88;
  transition: filter 0.12s;
}
#fsw-horsebtn .fsw-ua {
  filter: grayscale(0.55) brightness(0.78);
}
#fsw-horsebtn[aria-pressed="true"] .fsw-ua,
#fsw-horsebtn:hover .fsw-ua,
#fsw-pkbtn:hover .fsw-ua,
#fsw-partybtn:hover .fsw-ua {
  filter: drop-shadow(0 0 4px rgba(255, 216, 112, 0.9)) brightness(1.15);
}
#fsw-pk-dot {
  position: absolute;
  right: -1px;
  bottom: 2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid #000;
  background: #47e36e;
}
#fsw-pk-dot[data-pk="1"] { background: #ffc940; }
#fsw-pk-dot[data-pk="2"] { background: #ff3b30; }

#fsw-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  background: linear-gradient(rgba(28, 24, 18, 0.94), rgba(15, 13, 9, 0.94));
  border: 2px solid #7a5f2c;
  border-radius: 8px;
  box-shadow: 0 0 0 1px #000, 0 6px 22px rgba(0, 0, 0, 0.55);
}
#fsw-hk {
  display: flex;
  gap: 3px;
}
.fsw-hk-cell {
  width: 34px;
  height: 34px;
  border: 2px solid #b8791f;
  border-radius: 2px;
  background: #17130e;
  position: relative;
  padding: 0;
  cursor: pointer;
}
.fsw-hk-cell:hover {
  border-color: #ffd870;
}
.fsw-hk-cell img {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 28px;
  max-height: 28px;
  pointer-events: none;
}
.fsw-hk-cell.is-empty img {
  opacity: 0.22;
  filter: grayscale(1);
}
.fsw-hk-cell .qty {
  position: absolute;
  left: 2px;
  top: 1px;
  font: 700 11px/1 Arial, sans-serif;
  color: #ffd700;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
  pointer-events: none;
}
.fsw-hk-cell em {
  position: absolute;
  right: 2px;
  bottom: 0;
  font: normal 700 9px/11px Consolas, monospace;
  color: #e8e0cc;
  text-shadow: 0 0 3px #000, 0 0 3px #000;
  pointer-events: none;
}

#fsw-dock-k {
  display: flex;
  align-items: center;
  gap: 3px;
}
#fsw-f2btn {
  flex: none;
  position: relative;
  width: 60px;
  height: 34px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  line-height: 0;
  margin: 0 3px;
}
#fsw-f2btn::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 62px;
  height: 44px;
  margin-left: -31px;
  background: linear-gradient(#5a4520, #241a0c);
  border: 2px solid #b8923f;
  border-bottom: 0;
  border-radius: 31px 31px 0 0;
  box-shadow: 0 0 0 1px #000, inset 0 0 10px rgba(0, 0, 0, 0.65);
}
#fsw-f2btn .f2i {
  position: absolute;
  left: 50%;
  top: -18px;
  display: block;
  width: 50px;
  height: 52px;
  margin-left: -25px;
}
#fsw-f2btn .fsw-ua {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: filter 0.12s;
}
#fsw-f2btn b {
  position: absolute;
  left: 50%;
  bottom: 3px;
  transform: translateX(-50%);
  font: 700 9px/11px Tahoma, Verdana, sans-serif;
  color: #ffe9a8;
  white-space: nowrap;
  text-shadow: -1px 0 #3a1a00, 1px 0 #3a1a00, 0 -1px #3a1a00, 0 1px #3a1a00, 0 0 4px #000;
}
#fsw-f2btn:hover .fsw-ua {
  filter: brightness(1.2) drop-shadow(0 0 5px rgba(255, 216, 112, 0.9));
}

#fsw-slots {
  display: flex;
  gap: 3px;
}
#fsw-slots .slot {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 2px;
  border: 2px solid #b8791f;
  background: #17130e;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
}
#fsw-slots .slot:hover {
  border-color: #ffd870;
}
#fsw-slots .slot.is-casting {
  transform: scale(0.92);
  border-color: #ffe88a;
  box-shadow: 0 0 8px rgba(255, 216, 112, 0.75);
}
#fsw-slots .slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#fsw-slots .slot b {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font: 700 8px/10px Consolas, monospace;
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
  text-align: center;
  pointer-events: none;
}
#fsw-slots .slot.sm {
  display: none;
}
.fsw-sk-swap {
  position: absolute;
  top: 0;
  right: 0;
  width: 12px;
  height: 11px;
  display: grid;
  place-items: center;
  background: rgba(10, 12, 10, 0.82);
  border-left: 1px solid rgba(216, 180, 90, 0.65);
  border-bottom: 1px solid rgba(216, 180, 90, 0.65);
  color: #ffe28a;
  font: 700 8px/1 Tahoma, sans-serif;
  z-index: 2;
}

#fsw-dock-r {
  display: flex;
  align-items: flex-end;
}
#fsw-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 2px 0;
}
#fsw-menu .mb {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#fsw-menu .mi {
  position: relative;
  width: 23px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#fsw-menu .mi .fsw-ua {
  zoom: 0.85;
  transition: filter 0.12s;
}
#fsw-menu .mb:hover .fsw-ua,
#fsw-menu .mb.on .fsw-ua {
  filter: brightness(1.2) drop-shadow(0 0 4px rgba(255, 216, 112, 0.9));
}
#fsw-menu .mb b {
  display: none;
}

/* PK Mode Selector Popup (#fsw-pkmenu) */
#fsw-pkmenu {
  position: absolute;
  left: calc(50% - 175px);
  bottom: 54px;
  z-index: 28;
  min-width: 132px;
  padding: 3px 0;
  background: rgba(12, 10, 6, 0.95);
  border: 1px solid #8a6a2e;
  border-radius: 5px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.8);
  pointer-events: auto;
}
#fsw-pkmenu button {
  display: block;
  width: 100%;
  padding: 5px 12px;
  border: 0;
  background: none;
  font: 700 12.5px Tahoma, sans-serif;
  text-align: left;
  cursor: pointer;
  text-shadow: 1px 1px 0 #000;
}
#fsw-pkmenu button:hover,
#fsw-pkmenu button.sel {
  background: rgba(255, 216, 112, 0.18);
}

/* 4D. play.fsweb.in Chat (#fsw-chat: bottom-left on PC, bottom-center compact on Mobile Landscape) */
#fsw-chat {
  position: absolute;
  left: 8px;
  bottom: 8px;
  width: min(312px, calc(50vw - 235px));
  min-width: 220px;
  padding: 6px 7px 7px;
  z-index: 23;
  border: 2px solid #7a5f2c;
  border-radius: 8px;
  background: rgba(15, 13, 9, 0.22);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
  font: 12.5px/17px Tahoma, Verdana, sans-serif;
  pointer-events: auto;
}
#fsw-chat .ct {
  position: absolute;
  left: 6px;
  right: 32px;
  bottom: calc(100% + 2px);
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
#fsw-chat .ct::-webkit-scrollbar { display: none; }
#fsw-chat .ct button {
  flex: none;
  padding: 0 7px;
  border: 2px solid #7a5f2c;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(rgba(44, 36, 21, 0.88), rgba(23, 19, 12, 0.88));
  color: #c9b27a;
  font: 700 11.5px/17px Tahoma, Verdana, sans-serif;
  cursor: pointer;
}
#fsw-chat .ct button.on {
  background: linear-gradient(#f0a640, #c4721a);
  color: #fff;
  border-color: #e0b25a;
}
#fsw-chat-max {
  position: absolute;
  right: 6px;
  bottom: calc(100% + 2px);
  height: 19px;
  width: 22px;
  padding: 0;
  border: 2px solid #7a5f2c;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(rgba(44, 36, 21, 0.88), rgba(23, 19, 12, 0.88));
  color: #c9b27a;
  font: 700 11px/15px Tahoma, sans-serif;
  cursor: pointer;
}
#fsw-chat .cl {
  height: 92px;
  overflow-y: auto;
  overflow-x: hidden;
  word-break: break-word;
  display: flex;
  flex-direction: column;
  text-shadow: -1px 0 #000, 1px 0 #000, 0 -1px #000, 0 1px #000, 0 0 3px #000;
  scrollbar-width: thin;
  scrollbar-color: #7a5f2c transparent;
}
#fsw-chat .cl > :first-child { margin-top: auto; }
#fsw-chat .cl .fsw-cl-row { margin-bottom: 1px; }
#fsw-chat .cl .bd {
  display: inline-block;
  min-width: 20px;
  padding: 0 3px;
  margin-right: 4px;
  border: 1px solid #f0c76a;
  border-radius: 3px;
  background: linear-gradient(#ffb04a, #c4561a);
  color: #fff;
  font: 700 10px/13px Tahoma, sans-serif;
  text-align: center;
  vertical-align: 1px;
}
#fsw-chat .cl .bd[data-ch="party"] { background: linear-gradient(#5cc870, #1f7a34); }
#fsw-chat .cl .bd[data-ch="guild"] { background: linear-gradient(#5aa0e8, #1c4f9a); }
#fsw-chat .cl .bd[data-ch="private"] { background: linear-gradient(#b868e8, #6a2a9a); }
#fsw-chat .cl .bd[data-ch="system"] { background: linear-gradient(#e0b030, #9a7010); }
#fsw-chat .ci {
  display: flex;
  gap: 3px;
  margin-top: 4px;
}
#fsw-chat-ch {
  height: 24px;
  padding: 0 4px;
  border: 1px solid #7a5f2c;
  border-radius: 5px;
  background: linear-gradient(#2c2415, #17130c);
  color: #ffe9a8;
  font: 700 11.5px Tahoma, sans-serif;
}
#fsw-chat-in {
  flex: 1;
  min-width: 0;
  height: 24px;
  padding: 0 7px;
  background: rgba(10, 8, 5, 0.82);
  color: #fff;
  border: 1px solid #7a5f2c;
  border-radius: 5px;
  font: 12.5px Tahoma, sans-serif;
  outline: none;
}
#fsw-chat-in:focus { border-color: #ffd870; }
#fsw-chat-emo {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid #7a5f2c;
  border-radius: 5px;
  background: linear-gradient(#2c2415, #17130c);
  color: #ffd870;
  font-size: 13px;
  cursor: pointer;
}
#fsw-chat-go {
  height: 24px;
  padding: 0 9px;
  border: 1px solid #c9a24a;
  border-radius: 5px;
  background: linear-gradient(#8a2a1a, #4a0f08);
  color: #ffe9a8;
  font: 700 11.5px Tahoma, sans-serif;
  cursor: pointer;
}

/* Expanded Right-Drawer Chat (#fsw-chat.big) */
#fsw-chat.big {
  position: absolute;
  left: auto !important;
  right: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  transform: none !important;
  width: min(460px, 100%) !important;
  z-index: 36;
  display: flex;
  flex-direction: column;
  padding: 46px 10px 10px;
  border-width: 0 0 0 2px;
  border-radius: 0;
  background: linear-gradient(rgba(18, 15, 10, 0.97), rgba(11, 9, 6, 0.97));
}
#fsw-chat.big .ct {
  display: flex !important;
  left: 10px;
  right: 48px;
  top: 10px;
  bottom: auto;
}
#fsw-chat.big .ct button {
  height: 28px;
  padding: 0 11px;
  border-bottom: 2px solid #7a5f2c;
  border-radius: 6px;
}
#fsw-chat.big #fsw-chat-max {
  display: block !important;
  right: 10px;
  top: 10px;
  bottom: auto;
  width: 32px;
  height: 28px;
  border-bottom: 2px solid #7a5f2c;
  border-radius: 6px;
  font-size: 14px;
}
#fsw-chat.big .cl {
  flex: 1;
  height: auto !important;
  min-height: 0;
  margin-bottom: 8px;
  padding: 6px;
  border: 1px solid #4a3d22;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
}
#fsw-chat.big .ci {
  display: flex !important;
  gap: 6px;
}
#fsw-chat.big #fsw-chat-in,
#fsw-chat.big #fsw-chat-ch,
#fsw-chat.big #fsw-chat-emo,
#fsw-chat.big #fsw-chat-go {
  height: 34px;
  font-size: 14px;
}

/* 4E. Floating Touch Joystick (#fsw-joy: hidden when idle, appears ONLY under active finger drag) */
#fsw-joy {
  display: none !important;
  position: absolute;
  left: 24px;
  top: 200px;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: radial-gradient(rgba(40, 50, 70, 0.34), rgba(10, 12, 18, 0.54));
  border: 2px solid rgba(184, 146, 63, 0.68);
  z-index: 25;
  touch-action: none;
  pointer-events: none;
}
#fsw-joy-k {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(#6b7fa8, #2a3347);
  border: 2px solid #d9b866;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.65);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

body[data-ui-skin="fsweb"]:not([data-fsweb-touch="1"]) .fsw-touch-only {
  display: none !important;
}

/* Quick Skill Picker Tray on Landscape/PC */
body[data-ui-skin="fsweb"] #fs-quick-skill-tray {
  z-index: 38;
  border: 2px solid #7a5f2c;
  border-radius: 8px;
  background: linear-gradient(rgba(28, 24, 18, 0.97), rgba(15, 13, 9, 0.97));
  bottom: 62px;
}

/* --------------------------------------------------------------------------
 * 5. Mobile Landscape Touch Layout (body[data-ui-skin="fsweb"][data-fsweb-touch="1"])
 *    1:1 play.fsweb.in Open Battlefield + Floating Joy + Sleek Minimap + Skill Arc!
 * -------------------------------------------------------------------------- */
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-joy.is-active {
  display: block !important;
}

body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-left {
  left: max(6px, env(safe-area-inset-left));
  top: max(6px, env(safe-area-inset-top));
  width: 174px;
  max-height: calc(var(--fsw-h, 100%) - 96px);
  gap: 3px;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-phud {
  zoom: 0.84;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-point-alerts {
  display: none !important;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-qh {
  --qh-h: 76px;
  width: 168px;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-qh .qh-body {
  font-size: 11px;
  line-height: 1.38;
  padding: 4px 6px;
}

/* Sleek Top-Right Minimap (#fsw-mm) — no bulky tools underneath, plain centered coords */
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-mm:not(.is-expanded) {
  width: 122px;
  padding: 2px 3px 3px;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-mm:not(.is-expanded) #fsw-mm-h {
  font-size: 10.5px;
  margin-bottom: 2px;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-mm:not(.is-expanded) #fsw-mm-h button {
  height: 15px;
  padding: 0 4px;
  font-size: 9.5px;
  line-height: 13px;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-mm:not(.is-expanded) #fsw-mini-wrap {
  aspect-ratio: 168 / 114;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-mm .fsw-mm-tools {
  display: none !important;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-mm-coords {
  right: auto;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  padding: 0 4px;
  border: 0;
  background: none;
  color: #f4ecd8;
  font: 700 9.5px/1.1 Tahoma, Verdana, sans-serif;
  text-shadow: -1px 0 #000, 1px 0 #000, 0 -1px #000, 0 1px #000, 0 0 3px #000;
}

/* Top-Right Menu [☰], Rank [🏅], Ngự Các [F2] beside Minimap */
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-menubtn {
  display: flex;
  position: absolute;
  left: -108px;
  top: 4px;
  width: 32px;
  height: 32px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3.5px;
  padding: 0;
  border: 2px solid #7a5f2c;
  border-radius: 7px;
  background: linear-gradient(rgba(28, 24, 18, 0.94), rgba(15, 13, 9, 0.94));
  box-shadow: 0 0 0 1px #000;
  cursor: pointer;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-menubtn i {
  display: block;
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background: #e5c07b;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-menubtn.on {
  border-color: #ffd870;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-rankbtn {
  left: -72px;
  top: 4px;
  width: 32px;
  height: 32px;
  padding: 2.5px;
  border-radius: 7px;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-ktcbtn {
  display: block;
  position: absolute;
  left: -36px;
  top: 4px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 2px solid #7a5f2c;
  border-radius: 7px;
  overflow: hidden;
  background: linear-gradient(rgba(28, 24, 18, 0.94), rgba(15, 13, 9, 0.94));
  box-shadow: 0 0 0 1px #000;
  cursor: pointer;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-ktcbtn .fsw-ua {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.56);
}

/* Dissolve PC #fsw-dock / #fsw-bar containers on Mobile Landscape */
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-dock,
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-bar,
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-dock-k,
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-dock-r {
  display: contents;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-f2btn,
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-partybtn,
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-menu [data-fsw-panel="bag"] {
  display: none !important;
}

/* Top-Center Collapsible Menu Bar (#fsw-menu) on Mobile Landscape */
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-menu {
  display: none;
  position: absolute;
  left: 50%;
  top: max(5px, env(safe-area-inset-top));
  transform: translateX(-50%);
  width: calc(100% - 350px);
  min-width: 150px;
  z-index: 25;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 3px;
  pointer-events: none;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsweb-hud-root.fsw-menu-open #fsw-menu {
  display: flex;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-menu .mb {
  width: 44px;
  gap: 2px;
  pointer-events: auto;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-menu .mi {
  width: 32px;
  height: 32px;
  border: 2px solid #1b1710;
  border-radius: 6px;
  background: linear-gradient(#3a3224, #17130c);
  box-shadow: 0 0 0 1px #8d7440, 0 2px 6px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-menu .mi .fsw-ua {
  zoom: 1;
  transform: scale(0.7);
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-menu .mb b {
  display: block;
  font: 700 8.5px/1.1 Tahoma, sans-serif;
  color: #fff;
  white-space: nowrap;
  text-shadow: -1px 0 #000, 1px 0 #000, 0 -1px #000, 0 1px #000;
}

/* Borderless 3-Line Center Chat + Flanking [Horse][PK] & [Auto][Bag] (Exact Image 1!) */
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-chat:not(.big) {
  left: 50%;
  transform: translateX(-50%);
  bottom: max(5px, env(safe-area-inset-bottom));
  width: var(--chw);
  min-width: 146px;
  padding: 2px 5px;
  border: 0 !important;
  border-radius: 4px;
  box-shadow: none !important;
  background: rgba(15, 13, 9, 0.26) !important;
  cursor: pointer;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-chat:not(.big) .ct,
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-chat:not(.big) #fsw-chat-max,
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-chat:not(.big) .ci {
  display: none;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-chat:not(.big) .cl {
  height: 52px;
  font-size: 11px;
  line-height: 15.5px;
}

body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-pkbtn,
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-horsebtn {
  position: absolute;
  bottom: max(5px, env(safe-area-inset-bottom));
  margin: 0;
  padding: 1px 5px;
  z-index: 23;
  pointer-events: auto;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-pkbtn .fsw-ua,
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-horsebtn .fsw-ua {
  zoom: 0.78;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-pkbtn {
  left: calc(50% - var(--chw) / 2 - 4px);
  transform: translateX(-100%);
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-horsebtn {
  left: calc(50% - var(--chw) / 2 - 36px);
  transform: translateX(-100%);
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-pkmenu {
  left: calc(50% - var(--chw) / 2 - 64px);
  bottom: 48px;
}

body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-pc-combat-side {
  position: static;
  display: contents;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-autobtn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: calc(50% + var(--chw) / 2 + 8px);
  bottom: calc(max(5px, env(safe-area-inset-bottom)) + 36px);
  width: 32px;
  height: 32px;
  z-index: 23;
  border: 2px solid #7a5f2c;
  border-radius: 7px;
  background: linear-gradient(rgba(28, 24, 18, 0.94), rgba(15, 13, 9, 0.94));
  box-shadow: 0 0 0 1px #000;
  color: #e5c07b;
  font: 700 10px/1 Tahoma, sans-serif;
  pointer-events: auto;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-autobtn .fsw-ua {
  display: none;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-autobtn::after {
  content: "Auto";
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-autobtn[aria-pressed="true"] {
  color: #4cff6a;
  border-color: #4cff6a;
  box-shadow: 0 0 0 1px #000, 0 0 8px rgba(76, 255, 106, 0.45);
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-bagbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: calc(50% + var(--chw) / 2 + 8px);
  bottom: max(5px, env(safe-area-inset-bottom));
  width: 32px;
  height: 32px;
  padding: 0;
  z-index: 23;
  border: 2px solid #7a5f2c;
  border-radius: 7px;
  background: linear-gradient(rgba(28, 24, 18, 0.94), rgba(15, 13, 9, 0.94));
  box-shadow: 0 0 0 1px #000;
  cursor: pointer;
  pointer-events: auto;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-bagbtn .fsw-ua {
  zoom: 0.64;
}

/* Signature play.fsweb.in MOBA Radial Arc Skill Cluster (#fsw-slots) + Horizontal Potions (#fsw-hk) */
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-slots {
  position: absolute;
  right: max(10px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  width: 76px;
  height: 76px;
  display: block;
  z-index: 24;
  pointer-events: none;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-slots .slot {
  position: absolute;
  border-radius: 50%;
  border: 2px solid #b8923f;
  background: radial-gradient(#2a3347, #10141f);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.62);
  pointer-events: auto;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-slots .slot:not(.empty)::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.12);
  pointer-events: none;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-slots .slot img {
  border-radius: 50%;
  image-rendering: pixelated;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-slots .slot.empty::after {
  content: "+";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 400 18px/1 Consolas, monospace;
  color: #7f8aa3;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-slot-l {
  width: 76px;
  height: 76px;
  right: 0;
  bottom: 0;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-slot-l b {
  font-size: 10.5px;
  line-height: 14px;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-slot-r {
  display: block;
  width: 42px;
  height: 42px;
  right: 12px;
  bottom: 114px;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-slot-r b {
  font-size: 8.5px;
  line-height: 11px;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-slots .slot.sm {
  display: block;
  width: 42px;
  height: 42px;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-slot-1 { right: 114px; bottom: 12px; }
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-slot-2 { right: 100px; bottom: 62px; }
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-slot-3 { right: 62px;  bottom: 100px; }
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] .fsw-sk-swap {
  display: none;
}

body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsw-hk {
  display: flex;
  position: absolute;
  right: calc(max(10px, env(safe-area-inset-right)) + 12px);
  bottom: calc(max(10px, env(safe-area-inset-bottom)) + 170px);
  gap: 5px;
  z-index: 23;
  pointer-events: auto;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] .fsw-hk-cell {
  width: 30px;
  height: 30px;
  border: 1.5px solid #9a7428;
  border-radius: 3px;
  background: rgba(16, 13, 9, 0.88);
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] .fsw-hk-cell img {
  max-width: 24px;
  max-height: 24px;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] .fsw-hk-cell em {
  display: none;
}

/* Extra-Compact Mobile Landscape (stageH <= 425px, e.g. non-fullscreen browser bars or rotated portrait) */
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsweb-hud-root[data-compact="1"] #fsw-phud {
  zoom: 0.78;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsweb-hud-root[data-compact="1"] #fsw-mm:not(.is-expanded) {
  width: 112px;
  padding: 2px;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsweb-hud-root[data-compact="1"] #fsw-menubtn {
  left: -98px;
  width: 29px;
  height: 29px;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsweb-hud-root[data-compact="1"] #fsw-rankbtn {
  left: -65px;
  width: 29px;
  height: 29px;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsweb-hud-root[data-compact="1"] #fsw-ktcbtn {
  left: -32px;
  width: 29px;
  height: 29px;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsweb-hud-root[data-compact="1"] #fsw-slots {
  right: max(8px, env(safe-area-inset-right));
  bottom: max(7px, env(safe-area-inset-bottom));
  width: 64px;
  height: 64px;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsweb-hud-root[data-compact="1"] #fsw-slot-l {
  width: 64px;
  height: 64px;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsweb-hud-root[data-compact="1"] #fsw-slot-l b {
  font-size: 9.5px;
  line-height: 12px;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsweb-hud-root[data-compact="1"] #fsw-slot-r {
  width: 36px;
  height: 36px;
  right: 10px;
  bottom: 96px;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsweb-hud-root[data-compact="1"] #fsw-slots .slot.sm {
  width: 36px;
  height: 36px;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsweb-hud-root[data-compact="1"] #fsw-slot-1 { right: 96px; bottom: 10px; }
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsweb-hud-root[data-compact="1"] #fsw-slot-2 { right: 84px; bottom: 52px; }
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsweb-hud-root[data-compact="1"] #fsw-slot-3 { right: 52px; bottom: 84px; }
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsweb-hud-root[data-compact="1"] #fsw-hk {
  right: calc(max(8px, env(safe-area-inset-right)) + 8px);
  bottom: calc(max(7px, env(safe-area-inset-bottom)) + 144px);
  gap: 4px;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsweb-hud-root[data-compact="1"] .fsw-hk-cell {
  width: 27px;
  height: 27px;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsweb-hud-root[data-compact="1"] #fsw-chat:not(.big) .cl {
  height: 46px;
  font-size: 10.5px;
  line-height: 14.5px;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsweb-hud-root[data-compact="1"] #fsw-autobtn,
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsweb-hud-root[data-compact="1"] #fsw-bagbtn {
  width: 29px;
  height: 29px;
}
body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fsweb-hud-root[data-compact="1"] #fsw-autobtn {
  bottom: calc(max(5px, env(safe-area-inset-bottom)) + 33px);
}

body[data-ui-skin="fsweb"][data-fsweb-touch="1"] #fs-quick-skill-tray {
  left: 50%;
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
}

/* --------------------------------------------------------------------------
 * 6. play.fsweb.in Modal Windows (Ribbon Header + Circular Close Button)
 * -------------------------------------------------------------------------- */
body[data-ui-skin="fsweb"] .fs-window {
  border: 2px solid #7a5f2c;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(28, 24, 18, 0.97), rgba(15, 13, 9, 0.98));
  box-shadow: 0 0 0 1px #000, 0 10px 34px rgba(0, 0, 0, 0.72);
  padding-top: 18px;
  margin-top: 10px;
  max-height: calc(100% - 30px);
  overflow: visible;
}
body[data-ui-skin="fsweb"] .fs-win-header {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  min-height: 0;
  height: 0;
  padding: 0;
  border: 0;
  background: none !important;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  z-index: 5;
}
body[data-ui-skin="fsweb"] .fs-win-header h2,
body[data-ui-skin="fsweb"] .fs-win-header strong,
body[data-ui-skin="fsweb"] .fs-win-title {
  position: relative;
  transform: translateY(-50%);
  padding: 2px 22px 3px;
  border: 2px solid #f0c76a;
  border-radius: 8px;
  background: linear-gradient(#ffb04a 0%, #e4701f 45%, #a8360f 100%);
  color: #fff0b0 !important;
  font: 700 13px/17px Tahoma, "Segoe UI", Verdana, sans-serif !important;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 0 #6b1d05, 0 0 3px #5a1704;
  box-shadow: 0 0 0 1px #2a0e04, inset 0 0 0 1px rgba(255, 236, 170, 0.55), inset 0 -4px 6px rgba(80, 15, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}
body[data-ui-skin="fsweb"] .fs-win-close {
  position: absolute;
  right: -13px !important;
  top: -13px !important;
  transform: none !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  border: 2px solid #b8923f !important;
  background: linear-gradient(#3a3224, #17130c) !important;
  color: #f0d9a0 !important;
  font: 700 13px/1 Tahoma, sans-serif !important;
  box-shadow: 0 0 0 1px #000 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
}
body[data-ui-skin="fsweb"] .fs-win-close:hover {
  border-color: #ffd870 !important;
  color: #fff !important;
}
body[data-ui-skin="fsweb"] .fs-win-body {
  max-height: calc(100dvh - 64px);
  overflow-y: auto;
}
