/* ==========================================================================
 * Phong Than Online — Authentic fsnhanroi.xyz Responsive H5 UI Suite
 * Covers: Login -> Character Select / Create -> Multi-Mode HUD -> All Modals
 * Supports: PC (up to 4K), Mobile Portrait (1-hand), Mobile Landscape
 * ========================================================================== */

@font-face {
  font-family: DemoSerif;
  src: url('../assets/fs/fonts/NotoSerif-700.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: FSSkillTitle;
  src: url('../assets/fs/fonts/NotoSerif-600.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: DemoBody;
  src: url('../assets/fs/fonts/RobotoCondensed-VF.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'PT Overhead';
  src: url('../assets/fs/overhead/pt-pc-v11-14.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

/* --------------------------------------------------------------------------
 * 1. Crisp fsweb/atlas.webp Sprite Icons (256x91)
 * -------------------------------------------------------------------------- */
.fsweb-hud-icon {
  display: block;
  flex: none;
  width: calc(var(--aw, 26px) * var(--s, 1));
  height: calc(var(--ah, 40px) * var(--s, 1));
  background-image: url('../assets/fs/ui/fsweb/atlas.webp');
  background-repeat: no-repeat;
  background-size: calc(256px * var(--s, 1)) calc(91px * var(--s, 1));
  background-position: calc(var(--ax, 0px) * var(--s, 1)) calc(var(--ay, 0px) * var(--s, 1));
  image-rendering: auto;
  pointer-events: none;
}
.fsweb-hud-icon-f2     { --aw: 49px; --ah: 49px; --ax: 0px;    --ay: 0px; }
.fsweb-hud-icon-bag    { --aw: 26px; --ah: 40px; --ax: -51px;  --ay: 0px; }
.fsweb-hud-icon-char   { --aw: 26px; --ah: 40px; --ax: -79px;  --ay: 0px; }
.fsweb-hud-icon-friend { --aw: 26px; --ah: 40px; --ax: -107px; --ay: 0px; }
.fsweb-hud-icon-guild  { --aw: 26px; --ah: 40px; --ax: -135px; --ay: 0px; }
.fsweb-hud-icon-horse  { --aw: 26px; --ah: 40px; --ax: -163px; --ay: 0px; }
.fsweb-hud-icon-i_pk   { --aw: 26px; --ah: 40px; --ax: -191px; --ay: 0px; }
.fsweb-hud-icon-info   { --aw: 26px; --ah: 40px; --ax: -219px; --ay: 0px; }
.fsweb-hud-icon-mining { --aw: 26px; --ah: 40px; --ax: 0px;    --ay: -51px; }
.fsweb-hud-icon-quest  { --aw: 26px; --ah: 40px; --ax: -28px;  --ay: -51px; }
.fsweb-hud-icon-skill  { --aw: 26px; --ah: 40px; --ax: -56px;  --ay: -51px; }
.fsweb-hud-icon-sys    { --aw: 26px; --ah: 40px; --ax: -84px;  --ay: -51px; }
.fsweb-hud-icon-team   { --aw: 26px; --ah: 40px; --ax: -112px; --ay: -51px; }
.fsweb-hud-icon-auto   { --aw: 67px; --ah: 29px; --ax: -140px; --ay: -51px; }

/* Subtle Settings Gear Launcher (Login / CharSelect / HUD) */
.fs-gear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 10px;
  border: 1px solid #a78a4e;
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(65, 48, 30, 0.92), rgba(22, 21, 15, 0.95) 68%, rgba(48, 34, 20, 0.94));
  box-shadow: inset 0 0 0 1px #21190e, 0 2px 6px rgba(0, 0, 0, 0.7);
  color: #f3dfb0;
  font-family: DemoBody, Arial, sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.fs-gear-btn:hover {
  border-color: #f4d88e;
  filter: brightness(1.1);
}
.fs-gear-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px #000);
}

/* --------------------------------------------------------------------------
 * 2. Map & Login Transition Loading Overlay (bg_fsweb_p.webp)
 * -------------------------------------------------------------------------- */
.tg-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 95;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(10, 18, 16, 0.58), rgba(4, 6, 5, 0.90) 76%),
    #070d0c url('../assets/fs/ui/fsweb/bg_fsweb_p.webp') center / cover no-repeat;
  color: #f4ead0;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.tg-loading-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.tg-loading-ring {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 3px solid rgba(201, 162, 74, 0.25);
  border-top-color: #f0c96a;
  box-shadow: 0 0 18px rgba(240, 201, 106, 0.3);
  animation: tg-spin 1s linear infinite;
}
.tg-loading-ring::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 2px solid rgba(201, 162, 74, 0.2);
  border-bottom-color: #b57e27;
  animation: tg-spin 1.5s linear infinite reverse;
}
@keyframes tg-spin {
  to { transform: rotate(360deg); }
}
.tg-loading-overlay h2 {
  font: 700 19px/1.25 DemoSerif, Georgia, serif;
  color: #ffe094;
  letter-spacing: 0.06em;
  text-shadow: 0 2px 8px #000;
}
.tg-loading-overlay p {
  font-size: 13px;
  color: #e4d9bc;
  text-shadow: 0 1px 4px #000;
}

/* --------------------------------------------------------------------------
 * 3. Authentic fsnhanroi Login Screen (login-fs-h5.css)
 * -------------------------------------------------------------------------- */
.pt-auth-backdrop {
  position: absolute;
  inset: 0;
  z-index: 50;
  width: 100%;
  height: 100%;
  background: #10201e url('../assets/fs/login/fs-h5-landscape-v1.webp') center center / cover no-repeat;
  display: grid;
  grid-template-columns: 52% 48%;
  grid-template-rows: auto 1fr auto;
  padding: max(20px, 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));
  overflow-y: auto;
  isolation: isolate;
  transition: opacity 0.25s ease;
}
.pt-auth-backdrop::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, transparent 30%, rgba(6, 19, 16, 0.35) 52%, rgba(7, 21, 18, 0.72) 100%),
    linear-gradient(0deg, rgba(4, 12, 11, 0.65), transparent 40%);
  pointer-events: none;
}
.pt-auth-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}
.pt-auth-top-tools {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 4;
  display: flex;
  gap: 8px;
}
.pt-auth-shell {
  grid-column: 2;
  grid-row: 1 / 4;
  align-self: center;
  justify-self: center;
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pt-hero-header {
  text-align: center;
}
.pt-hero-kicker {
  display: block;
  color: #e6d8b4;
  font: 700 10.5px/1.4 system-ui, sans-serif;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  text-shadow: 0 2px 8px #000;
}
.pt-hero-title {
  margin-top: 4px;
  font-family: DemoSerif, Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.1;
  background: linear-gradient(180deg, #fff6d5 15%, #e4c784 48%, #9e6c30 75%, #f3d498 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 #382410) drop-shadow(0 4px 12px #06120e);
}
.pt-hero-divider {
  width: 150px;
  height: 1px;
  margin: 8px auto 0;
  background: linear-gradient(90deg, transparent, #c19b56, transparent);
}
.pt-auth-card {
  position: relative;
  border: 1px solid rgba(171, 135, 74, 0.65);
  border-radius: 4px;
  background: linear-gradient(145deg, rgba(19, 35, 34, 0.94), rgba(9, 19, 17, 0.97));
  padding: 15px 18px 16px;
  box-shadow: 0 16px 55px rgba(0, 0, 0, 0.72), inset 0 0 0 3px rgba(8, 18, 15, 0.55), inset 0 1px rgba(229, 208, 155, 0.22);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.pt-auth-card::before,
.pt-auth-card::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: #d7b66b;
  border-style: solid;
  pointer-events: none;
}
.pt-auth-card::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.pt-auth-card::after  { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

.pt-cluster-section {
  margin-bottom: 10px;
}
.pt-section-label {
  display: block;
  font: 700 10.5px/1.2 system-ui, sans-serif;
  letter-spacing: 0.08em;
  color: #dfd0a8;
  margin-bottom: 5px;
  text-transform: uppercase;
}
.pt-cluster-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.pt-cluster-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3px;
  padding: 7px 9px;
  border: 1px solid rgba(172, 138, 80, 0.48);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(18, 38, 37, 0.9), rgba(10, 22, 22, 0.95));
  text-align: left;
  cursor: pointer;
}
.pt-cluster-card[aria-checked="true"] {
  border-color: #ffd97d;
  background: linear-gradient(180deg, rgba(94, 59, 21, 0.95), rgba(45, 27, 11, 0.96));
  box-shadow: 0 0 12px rgba(255, 196, 77, 0.28), inset 0 0 0 1px rgba(238, 194, 100, 0.4);
}
.pt-cluster-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.pt-cluster-info strong {
  font-size: 12.5px;
  color: #ffeab4;
}
.pt-cluster-info small {
  display: block;
  font-size: 10.5px;
  color: #cfcbb8;
  line-height: 1.25;
}
.pt-cluster-status {
  padding: 1px 6px;
  border-radius: 999px;
  font: 700 9.5px/1.3 system-ui, sans-serif;
  background: rgba(32, 230, 70, 0.14);
  border: 1px solid rgba(110, 226, 122, 0.55);
  color: #7bf088;
  white-space: nowrap;
}

.pt-auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid rgba(197, 167, 104, 0.25);
  margin-bottom: 11px;
}
.pt-auth-tabs button {
  padding: 6px 4px 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #a3afa6;
  font: 600 12.5px/1.3 system-ui, sans-serif;
  cursor: pointer;
}
.pt-auth-tabs button[aria-selected="true"] {
  color: #f5dea4;
  font-weight: 700;
  border-bottom-color: #e8c77a;
}
.pt-field {
  margin-bottom: 9px;
}
.pt-field label {
  display: block;
  margin-bottom: 4px;
  font: 600 12px/1.3 system-ui, sans-serif;
  color: #d4d6c6;
}
.pt-field input {
  width: 100%;
  height: 41px;
  padding: 8px 11px;
  background: rgba(6, 17, 14, 0.88);
  border: 1px solid rgba(110, 128, 112, 0.6);
  border-radius: 3px;
  color: #f7efda;
  font: 400 16px/1.3 system-ui, sans-serif !important;
  user-select: text;
  -webkit-user-select: text;
}
.pt-field input:focus {
  outline: none;
  border-color: #dfbf79;
  box-shadow: 0 0 0 2px rgba(226, 188, 94, 0.18);
}
.pt-remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 11px;
  font: 400 12px/1.3 system-ui, sans-serif;
  color: #bfc7b9;
}
.pt-remember-row label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}
.pt-remember-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #b69855;
}
.pt-cta-btn {
  display: block;
  width: 100%;
  min-height: 45px;
  padding: 10px;
  border: 1px solid #e4c37d;
  border-radius: 3px;
  background: linear-gradient(120deg, #d9bb77, #f1d69b 48%, #be934e);
  color: #28180c;
  font: 800 13.5px/1.3 system-ui, sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: inset 0 1px rgba(255, 243, 203, 0.55), 0 5px 18px rgba(0, 0, 0, 0.45);
}
.pt-cta-btn:hover:not(:disabled) {
  background: linear-gradient(120deg, #e7ce94, #fff0bd 48%, #d4ae6b);
}
.pt-cta-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}
.pt-auth-msg {
  min-height: 17px;
  margin-top: 7px;
  text-align: center;
  font: 600 12px/1.35 system-ui, sans-serif;
  color: #ffdf9a;
}
.pt-auth-msg[data-tone="error"] { color: #ff9c8b; }
.pt-auth-msg[data-tone="ok"]    { color: #7ef08b; }

.pt-boot-box {
  padding: 7px 11px;
  border: 1px solid rgba(186, 143, 67, 0.35);
  border-radius: 4px;
  background: rgba(7, 15, 14, 0.84);
}
.pt-boot-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid #6e5220;
  border-radius: 999px;
  overflow: hidden;
}
.pt-boot-fill {
  width: 8%;
  height: 100%;
  background: linear-gradient(90deg, #8f631d 0%, #e2b857 65%, #fff0b8 100%);
  transition: width 0.22s ease;
}
.pt-boot-status {
  margin-top: 4px;
  font: 11px/1.3 system-ui, sans-serif;
  color: #dcd5c2;
  text-align: center;
}
.pt-shell-footer {
  padding: 8px 12px;
  border-top: 1px solid rgba(199, 168, 106, 0.4);
  background: linear-gradient(90deg, transparent, rgba(7, 18, 15, 0.85) 20%, rgba(7, 18, 15, 0.85) 80%, transparent);
  text-align: center;
  font: 11px/1.4 system-ui, sans-serif;
  color: #d6d0be;
}
.pt-shell-footer strong {
  display: block;
  color: #f1d395;
  letter-spacing: 0.12em;
  font-size: 11.5px;
}

/* Portrait Login Layout (matches both JS data-orientation="portrait" AND narrow phones before JS runs!) */
body[data-orientation="portrait"] .pt-auth-backdrop {
  background-image: url('../assets/fs/login/fs-h5-portrait-v1.webp');
  background-position: center top;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(max(14px, env(safe-area-inset-bottom)) + var(--kb-height, 0px));
}
body[data-orientation="portrait"] .pt-auth-backdrop::before {
  background: linear-gradient(0deg, rgba(3, 13, 11, 0.78) 0%, rgba(3, 13, 11, 0.22) 55%, rgba(3, 13, 11, 0.45) 100%);
}
body[data-orientation="portrait"] .pt-auth-shell {
  width: min(390px, 100%);
  margin: auto;
}
body[data-orientation="portrait"] .pt-cluster-grid {
  grid-template-columns: 1fr;
}

@media (max-width: 680px) {
  body:not([data-force-landscape-rotate="true"]) .pt-auth-backdrop {
    background-image: url('../assets/fs/login/fs-h5-portrait-v1.webp');
    background-position: center top;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: max(16px, env(safe-area-inset-top)) 16px calc(max(14px, env(safe-area-inset-bottom)) + var(--kb-height, 0px));
  }
  body:not([data-force-landscape-rotate="true"]) .pt-auth-backdrop::before {
    background: linear-gradient(0deg, rgba(3, 13, 11, 0.78) 0%, rgba(3, 13, 11, 0.22) 55%, rgba(3, 13, 11, 0.45) 100%);
  }
  body:not([data-force-landscape-rotate="true"]) .pt-auth-shell {
    width: min(390px, 100%);
    margin: auto;
  }
  body:not([data-force-landscape-rotate="true"]) .pt-cluster-grid {
    grid-template-columns: 1fr;
  }
}

/* Keep Character Create & In-Game Chat comfortable above mobile virtual keyboard without squishing! */
body[data-kb-open="true"] .fs-cs-backdrop {
  align-items: flex-start;
  overflow-y: auto;
  padding-bottom: calc(16px + var(--kb-height, 0px));
}
body[data-kb-open="true"] .fs-chat-group:focus-within {
  bottom: calc(var(--kb-height, 0px) + 8px) !important;
  z-index: 88 !important;
}

/* Short Mobile Landscape Login (e.g. 844x390 — strictly landscape width >= 600px, never portrait + keyboard!) */
@media (max-height: 520px) and (min-width: 600px) {
  .pt-auth-backdrop {
    padding: 8px 16px;
  }
  .pt-hero-kicker, .pt-hero-divider, .pt-shell-footer {
    display: none;
  }
  .pt-hero-title {
    font-size: 24px;
  }
  .pt-auth-card {
    padding: 10px 14px;
  }
  .pt-field {
    margin-bottom: 6px;
  }
  .pt-field input {
    height: 35px;
  }
  .pt-cta-btn {
    min-height: 38px;
    padding: 6px;
  }
}

/* --------------------------------------------------------------------------
 * 4. Authentic fsnhanroi Character Select & Character Create (#fs-charselect)
 * -------------------------------------------------------------------------- */
.fs-cs-backdrop {
  position: absolute;
  inset: 0;
  z-index: 48;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 40%, #2a434d 0%, #0d1519 72%),
    #0d1519;
  color: #f6e6bf;
  font-family: DemoBody, Arial, sans-serif;
  overflow: hidden;
}
.fs-cs-backdrop[hidden] {
  display: none !important;
}

.character-selection {
  --floor-y: 64%;
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #355066;
  box-shadow: 0 0 70px rgba(0, 0, 0, 0.8);
}
.character-selection .cs-scenery {
  position: absolute;
  z-index: -2;
  inset: 0;
  background-image:
    linear-gradient(180deg, rgba(16, 43, 68, 0.25), transparent 35%, rgba(16, 17, 26, 0.1) 65%, rgba(8, 12, 21, 0.72)),
    url('../assets/fs/previews/character-portrait-v1/mountain-platform.png');
  background-size: cover;
  background-position: 50% 50%;
  pointer-events: none;
}

/* Portrait card mode vs Wide PC/Landscape mode */
body[data-orientation="portrait"] .character-selection {
  max-width: 440px;
}

.cs-topbar {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 14px;
  right: 14px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cs-small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  padding: 5px 11px;
  border: 1px solid #a47932;
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(67, 50, 29, 0.92), rgba(28, 23, 16, 0.95));
  box-shadow: inset 0 0 0 2px #0f0e0a, 0 2px 5px rgba(0, 0, 0, 0.5);
  color: #f6dfad;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.cs-small-button:hover:not(:disabled) {
  border-color: #f7dd98;
  filter: brightness(1.08);
}
.cs-small-button.cs-danger {
  color: #f4bdb0;
  border-color: #9e5a44;
}
.cs-brand {
  font-size: 12px;
  letter-spacing: 1.4px;
  color: #fff0bc;
  text-align: center;
  font-weight: 800;
  text-shadow: 0 2px 4px #092332;
}
.cs-brand small {
  display: block;
  font-size: 9px;
  letter-spacing: 1.8px;
  color: #d7e6e8;
}

.cs-dragon-title {
  position: relative;
  isolation: isolate;
  height: 58px;
  margin: 0 auto;
  width: min(400px, calc(100% - 16px));
  display: grid;
  place-items: center;
  font: 700 23px DemoSerif, Georgia, serif;
  color: #ffdfa1;
  text-shadow: 0 2px 2px #080601, 0 0 8px rgba(190, 108, 43, 0.45);
  filter: drop-shadow(0 2px 4px rgba(7, 32, 45, 0.6));
}
.cs-dragon-title::before,
.cs-dragon-action::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 13px 22px;
  background: linear-gradient(180deg, #402411, #20130b 55%, #392213);
  border: 1px solid #be8740;
  border-radius: 4px;
}
.cs-dragon-title::after,
.cs-dragon-action::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url('../assets/fs/previews/character-portrait-v1/dragon-frame.png') center / 100% auto no-repeat;
  pointer-events: none;
}

.cs-dragon-action {
  position: relative;
  isolation: isolate;
  display: block;
  width: 100%;
  height: 62px;
  padding: 0 36px;
  border: 0;
  background: none;
  color: #fff0b1;
  font: 700 21px DemoSerif, Georgia, serif;
  text-shadow: 0 2px 2px #49220a;
  cursor: pointer;
  filter: drop-shadow(0 3px 5px rgba(7, 12, 16, 0.6));
}
.cs-dragon-action::before {
  inset: 14px 22px;
  background: linear-gradient(180deg, #df9729, #a44e10 55%, #532705);
  border-color: #eec264;
  box-shadow: inset 0 3px 8px rgba(255, 224, 157, 0.28);
}
.cs-dragon-action:hover:not(:disabled)::before {
  background: linear-gradient(180deg, #f4b748, #bc6916 55%, #71360b);
}
.cs-dragon-action:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* Responsive CS Layout: Portrait Stack vs Landscape 2-Column */
.cs-layout {
  position: absolute;
  inset: 52px 14px max(12px, env(safe-area-inset-bottom)) 14px;
  display: grid;
  grid-template-columns: 1.08fr minmax(320px, 410px);
  gap: 16px;
  align-items: center;
}
body[data-orientation="portrait"] .cs-layout {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

/* Hero Preview Stage */
.cs-hero-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
body[data-orientation="portrait"] .cs-hero-stage {
  flex: 1 1 auto;
  min-height: 190px;
  padding-top: 58px;
}
.cs-hero-heading {
  text-align: center;
  text-shadow: 0 2px 4px #102430;
  margin-bottom: 4px;
}
.cs-hero-heading span {
  display: block;
  font-size: 12px;
  color: #f6f5dc;
  letter-spacing: 1px;
  font-weight: 700;
}
.cs-hero-heading h2 {
  font: 700 25px DemoSerif, Georgia, serif;
  color: #ffe29a;
  margin: 2px 0;
}
.cs-hero-canvas-wrap {
  position: relative;
  width: min(300px, 68vw);
  height: min(270px, 38vh);
  display: flex;
  align-items: center;
  justify-content: center;
}
body[data-orientation="landscape"] .cs-hero-canvas-wrap {
  width: min(360px, 42vw);
  height: min(340px, 64vh);
}
#cs-hero-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(8, 22, 30, 0.75));
}
.cs-floor-glow {
  position: absolute;
  left: 50%;
  bottom: 14%;
  width: 148px;
  height: 28px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(181, 255, 246, 0.42), rgba(101, 219, 213, 0.22) 48%, transparent 74%);
  box-shadow: 0 0 24px rgba(92, 230, 209, 0.22);
  z-index: -1;
}
.cs-class-arrow {
  position: absolute;
  top: 52%;
  transform: translateY(-50%);
  width: 42px;
  height: 48px;
  border: 0;
  background: none;
  padding: 6px;
  pointer-events: auto;
  cursor: pointer;
  color: #ffc864;
  font-size: 28px;
  font-weight: 900;
  text-shadow: 0 2px 6px #000;
}
.cs-class-arrow.cs-prev { left: 8px; }
.cs-class-arrow.cs-next { right: 8px; }
.cs-hometown-badge {
  margin-top: 2px;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(9, 24, 32, 0.72);
  border: 1px solid rgba(196, 166, 102, 0.45);
  font-size: 11.5px;
  color: #ecead8;
}

/* Right / Controls Column */
.cs-controls-pane {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 4;
}

.cs-class-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.cs-class-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 46px;
  padding: 5px;
  border: 1px solid #ac8a50;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(38, 60, 67, 0.94), rgba(19, 39, 47, 0.95));
  color: #e2e7df;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
}
.cs-class-tabs button img {
  width: 28px;
  height: 32px;
  object-fit: cover;
  object-position: top;
  border: 1px solid #b4a074;
  border-radius: 3px;
}
.cs-class-tabs button[aria-selected="true"] {
  color: #ffedba;
  border-color: #ffd477;
  background: linear-gradient(180deg, rgba(105, 65, 29, 0.96), rgba(57, 32, 15, 0.96));
  box-shadow: inset 0 0 0 2px #5a330d, 0 0 10px rgba(255, 187, 78, 0.45);
}
.cs-class-description {
  padding: 7px 11px;
  border-block: 1px solid rgba(187, 169, 118, 0.65);
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(9, 38, 53, 0.35), rgba(10, 37, 53, 0.88) 20%, rgba(10, 37, 53, 0.88) 80%, rgba(9, 38, 53, 0.35));
  text-align: center;
  color: #e9f1e9;
}
.cs-class-description strong {
  display: block;
  font-size: 11px;
  letter-spacing: 0.8px;
  color: #f4d18c;
}
.cs-class-description p {
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 1.35;
}

.cs-gender-choices {
  display: flex;
  justify-content: center;
  gap: 18px;
}
.cs-gender-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 4px 14px;
  border: 1px solid rgba(188, 161, 104, 0.4);
  border-radius: 4px;
  background: rgba(16, 28, 32, 0.72);
  color: #f8e4af;
  font: 700 15px DemoSerif, Georgia, serif;
  cursor: pointer;
}
.cs-gender-btn i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #bf914c;
  background: #0d1a1a;
}
.cs-gender-btn[aria-pressed="true"] {
  border-color: #f5d17a;
  background: rgba(74, 48, 20, 0.82);
}
.cs-gender-btn[aria-pressed="true"] i {
  background: radial-gradient(#fff0a4, #ffbd4c 48%, #714713 65%);
  box-shadow: 0 0 8px rgba(255, 203, 94, 0.65);
}

.cs-name-box {
  padding: 9px 11px;
  border: 1px solid #ba9652;
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(23, 34, 38, 0.92), rgba(11, 22, 29, 0.94));
  box-shadow: inset 0 0 0 2px #07131e, 0 3px 8px rgba(0, 0, 0, 0.45);
}
.cs-name-box label {
  display: block;
  margin-bottom: 5px;
  font-size: 11.5px;
  color: #dccb9a;
}
.cs-name-row {
  display: flex;
  gap: 8px;
}
.cs-name-row input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 5px 10px;
  border: 1px solid #806f4c;
  border-radius: 3px;
  background: rgba(9, 20, 25, 0.85);
  color: #fff0c8;
  font-size: 16px !important;
  user-select: text;
  -webkit-user-select: text;
}
.cs-dice-btn {
  width: 40px;
  height: 38px;
  border: 1px solid #bd9651;
  border-radius: 4px;
  background: linear-gradient(180deg, #4a3822, #211c13);
  color: #ffdb80;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.cs-dice-btn:hover {
  border-color: #ffe394;
  filter: brightness(1.12);
}

.cs-character-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.cs-character-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 60px;
  padding: 7px 9px;
  border: 1px solid #9a8c63;
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(21, 52, 65, 0.92), rgba(13, 37, 49, 0.95));
  text-align: left;
  color: #fff0c4;
  cursor: pointer;
}
.cs-character-card img {
  width: 36px;
  height: 42px;
  border: 1px solid #ad8f50;
  border-radius: 3px;
  object-fit: cover;
  object-position: top;
  flex: none;
}
.cs-character-card span {
  min-width: 0;
  flex: 1;
}
.cs-character-card strong {
  display: block;
  font: 700 13px DemoSerif, Georgia, serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-character-card small {
  display: block;
  font-size: 11px;
  color: #dedbc7;
  margin-top: 2px;
}
.cs-character-card[aria-pressed="true"] {
  border-color: #ffe69c;
  background: linear-gradient(180deg, rgba(112, 73, 25, 0.95), rgba(49, 32, 13, 0.96));
  box-shadow: 0 0 10px rgba(255, 200, 81, 0.42), inset 0 0 0 1px #b27a36;
}
.cs-character-card.cs-create-slot {
  justify-content: center;
  border-style: dashed;
  color: #ffe094;
  font-weight: 700;
}

.cs-selection-box {
  padding: 10px 10px 8px;
  border: 1px solid #b2904a;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(30, 28, 20, 0.94), rgba(13, 21, 25, 0.95));
  box-shadow: inset 0 0 0 2px #101617, 0 5px 16px rgba(0, 0, 0, 0.5);
}
.cs-selected-summary {
  display: grid;
  grid-template-columns: 1.5fr 0.65fr 1fr;
  padding: 2px 6px 8px;
  border-bottom: 1px solid #7e713c;
  margin-bottom: 6px;
}
.cs-selected-summary > div { min-width: 0; }
.cs-selected-summary > div + div {
  border-left: 1px solid #686044;
  text-align: center;
  padding-left: 6px;
}
.cs-selected-summary span {
  display: block;
  font-size: 10.5px;
  color: #c7c8ad;
}
.cs-selected-summary strong {
  display: block;
  font: 700 14px DemoSerif, Georgia, serif;
  color: #ffe6a5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-secondary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.cs-form-message {
  min-height: 16px;
  text-align: center;
  font-size: 11.5px;
  color: #f0e2be;
}
.cs-form-message.cs-error {
  color: #ff9c8a;
  font-weight: 700;
}

/* Compact Short Mobile Landscape (e.g. 844x390) */
@media (max-height: 500px) {
  .cs-topbar { top: 6px; }
  .cs-layout { inset: 42px 12px 6px 12px; gap: 10px; }
  .cs-dragon-title { height: 42px; font-size: 18px; }
  .cs-dragon-title::before { inset: 8px 18px; }
  .cs-class-tabs button { height: 38px; font-size: 13px; }
  .cs-class-description { padding: 4px 8px; }
  .cs-class-description strong { display: none; }
  .cs-dragon-action { height: 48px; font-size: 18px; }
  .cs-dragon-action::before { inset: 10px 20px; }
  .cs-name-box { padding: 6px 8px; }
  .cs-name-box label { display: none; }
  .cs-name-row input, .cs-dice-btn { height: 33px; }
  .cs-character-card { min-height: 48px; padding: 5px 7px; }
}

/* --------------------------------------------------------------------------
 * 5. Authentic 1:1 fsnhanroi.xyz In-Game HUD (#fs-hud-root)
 * -------------------------------------------------------------------------- */
#fs-hud-root,
.fs-hud-root {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  font-family: 'PT Overhead', Tahoma, Arial, sans-serif;
  --toolbar-scale: 1;
  --toolbar-width: 482px;
  --bottom-bar-height: 56px;
  --game-hud-scale: 1;
  --effect-top: 86px;
  --joy-size: 92px;
  --joy-left: 12px;
  --chat-right: 6px;
  --chat-width: 230px;
  --chat-content-height: 108px;
}
#fs-hud-root[hidden],
.fs-hud-root[hidden] {
  display: none !important;
}
#fs-hud-root button,
#fs-hud-root input,
#fs-hud-root select,
.fs-hud-interactive {
  pointer-events: auto;
}

/* 5A. Top-Left Winged Dragon Player Frame (entry-hud-Main.png 242x75) */
.fs-player-frame {
  position: absolute;
  top: max(6px, env(safe-area-inset-top));
  left: max(6px, env(safe-area-inset-left));
  width: 242px;
  height: 80px;
  background: url('../assets/fs/ui/entry-hud-Main.png') left top / 242px 75px no-repeat;
  transform: scale(var(--game-hud-scale, 1));
  transform-origin: top left;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.8));
  cursor: pointer;
  z-index: 22;
}
.fs-avatar-btn {
  position: absolute;
  left: 3px;
  top: 4px;
  width: 64px;
  height: 64px;
  padding: 1px;
  border: 1px solid #9b751f;
  border-radius: 50%;
  background: #1b1711;
  box-shadow: 0 0 0 1px #30230d;
  cursor: pointer;
  overflow: visible;
}
.fs-avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 50%;
  display: block;
}
.fs-avatar-level {
  position: absolute;
  left: 39px;
  bottom: -8px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 2px;
  background: url('../assets/fs/ui/entry-hud-Level.png') center / 100% 100% no-repeat;
  font: 700 11.5px/1 Tahoma, Arial, sans-serif;
  color: #fff3ca;
  text-shadow: 0 1px 2px #000;
}
.fs-status-info {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.fs-status-info > strong {
  position: absolute;
  left: 75px;
  top: 5px;
  width: 145px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px 1px;
  font: 700 12px/1 Tahoma, Arial, sans-serif;
  color: #f6edd2;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fs-entry-bar {
  position: absolute;
  height: 10px;
  width: 142px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.fs-entry-bar.is-hp { left: 78px; top: 25px; }
.fs-entry-bar.is-mp { left: 75px; top: 36px; }
.fs-entry-bar.is-xp { left: 72px; top: 46px; }
.fs-entry-bar > i {
  position: absolute;
  left: 0;
  top: 1.5px;
  bottom: 1.5px;
  width: 100%;
  transition: width 100ms linear;
}
.fs-entry-bar.is-hp > i {
  background:
    url('../assets/fs/ui/entry-hud-Life_Image.png') left center / 100% 7px no-repeat,
    linear-gradient(180deg, #f23c32, #9b0c08);
}
.fs-entry-bar.is-mp > i {
  background:
    url('../assets/fs/ui/entry-hud-Mana_Image.png') left center / 100% 7px no-repeat,
    linear-gradient(180deg, #4b8ff7, #14439c);
}
.fs-entry-bar.is-xp > i {
  top: 2px;
  bottom: 2px;
  background: linear-gradient(90deg, #c99d3b, #f0cb69);
  opacity: 0.85;
}
.fs-entry-bar > span {
  position: relative;
  z-index: 1;
  font: 700 9.5px/1 Tahoma, Arial, sans-serif;
  color: #ffffff;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 0 1px 2px #000;
  font-variant-numeric: tabular-nums;
}
.fs-status-rank {
  position: absolute;
  left: 70px;
  top: 57px;
  width: 141px;
  height: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 10.5px/1 Tahoma, Arial, sans-serif;
  color: #ead69b;
  text-shadow: 1px 1px 0 #000;
}

/* Sub-HUD under Player Frame: Active Effect Icons + Point Alerts + Target HUD */
.fs-left-subhud {
  position: absolute;
  top: calc(max(6px, env(safe-area-inset-top)) + var(--effect-top, 84px) - 6px);
  left: max(8px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  z-index: 21;
}
.fs-effect-bar {
  display: flex;
  align-items: center;
  gap: 4px;
}
.fs-effect-icon {
  width: 26px;
  height: 26px;
  border: 1px solid #45f66b;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.78);
  background: #101610;
  object-fit: cover;
  display: block;
}
.fs-point-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.fs-alert-chip {
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #f5d16e;
  background: linear-gradient(180deg, #6e4914, #3b2508);
  color: #fff3bd;
  font: 700 10px/1.2 Arial, sans-serif;
  cursor: pointer;
  animation: fs-pulse 1.6s ease-in-out infinite;
}
.fs-alert-chip[hidden] { display: none !important; }
@keyframes fs-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.22); }
}

.pk-target-hud {
  min-width: 158px;
  max-width: 226px;
  padding: 4px 7px 5px;
  background: rgba(15, 20, 14, 0.94);
  border: 1px solid #d4b159;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.82), inset 0 0 0 1px #44391f;
  color: #fff;
  pointer-events: auto;
}
.pk-target-hud[data-locked="1"] {
  border-color: #ffe07d;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.85), 0 0 6px rgba(255, 208, 92, 0.28), inset 0 0 0 1px #5c4b22;
}
.pk-target-hud[hidden] { display: none !important; }
.pk-target-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 1px;
}
.pk-target-hud small {
  display: block;
  font: 700 9.5px/1.15 Arial, sans-serif;
  color: #e7cb85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pk-target-close {
  flex: none;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid rgba(212, 177, 89, 0.55);
  border-radius: 3px;
  background: rgba(38, 22, 18, 0.85);
  color: #ffd9a8;
  font: 700 9.5px/14px Arial, sans-serif;
  cursor: pointer;
}
.pk-target-close:hover,
.pk-target-close:active {
  background: #8f241e;
  color: #fff;
}
.pk-target-hud strong {
  display: block;
  font: 700 12px/1.25 Arial, sans-serif;
  color: #fff2cc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pk-target-health {
  height: 13px;
  margin-top: 3px;
  position: relative;
  border: 1px solid #b59a51;
  background: #15130e;
  border-radius: 2px;
  overflow: hidden;
}
.pk-target-health > i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(180deg, #ff3b3b, #c40000 55%, #780000);
  transition: width 80ms linear;
}
.pk-target-health[data-tone="ally"] > i {
  background: linear-gradient(180deg, #43e97b, #1ca64c 58%, #0e632b);
}
.pk-target-health[data-tone="npc"] > i {
  background: linear-gradient(180deg, #ffd86f, #bd8b22 60%, #73510d);
}
.pk-target-health > span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 700 9px/12px Arial, sans-serif;
  color: #fff;
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
}
.pk-target-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}
.pk-target-actions:empty {
  display: none;
}
.pk-tgt-btn {
  padding: 2px 5px;
  border: 1px solid rgba(208, 174, 88, 0.72);
  border-radius: 3px;
  background: linear-gradient(180deg, #2d3826, #182015);
  color: #f7e6b5;
  font: 700 9.5px/1.2 Tahoma, Arial, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.pk-tgt-btn.is-atk {
  border-color: #e06d53;
  background: linear-gradient(180deg, #6e2219, #3d110c);
  color: #ffe5dc;
}
.pk-tgt-btn.is-talk {
  border-color: #dfbe62;
  background: linear-gradient(180deg, #524118, #2d230b);
  color: #fff1bf;
}
.pk-tgt-btn:active {
  transform: scale(0.95);
  filter: brightness(1.18);
}

/* 5B. Top-Right Sơn Mài Minimap + Right-Edge Vertical Quick Column */
.fs-map-hud {
  position: absolute;
  top: max(6px, env(safe-area-inset-top));
  right: max(6px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  z-index: 23;
}
.fs-minimap-card {
  position: relative;
  width: 172px;
  padding: 4px;
  border-radius: 6px;
  background:
    radial-gradient(circle at 50% 0%, rgba(196, 150, 58, 0.16), transparent 62%),
    linear-gradient(180deg, #161c13 0%, #0b110b 60%, #080d08 100%);
  border: 1.5px solid #c8a455;
  box-shadow: 0 0 0 1.5px #261c0f, 0 8px 20px rgba(0, 0, 0, 0.78);
  transition: width 140ms ease;
}
.fs-minimap-card.is-expanded {
  width: min(302px, calc(100vw - 16px)) !important;
}
.fs-map-title {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 2px 22px 2px 6px;
  margin-bottom: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, #431b13 0%, #63281b 50%, #33150f 100%);
  border: 1px solid rgba(214, 174, 88, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 232, 172, 0.22);
}
.fs-map-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #47ef79;
  box-shadow: 0 0 5px #47ef79;
  flex: none;
}
.fs-map-title strong {
  flex: 1;
  min-width: 0;
  font: 700 11.5px/1.2 DemoSerif, Georgia, serif;
  color: #ffe8a6;
  text-shadow: 0 1px 2px #000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fs-map-collapse {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  padding: 0;
  border: 1px solid rgba(232, 198, 118, 0.42);
  border-radius: 3px;
  background: rgba(15, 10, 8, 0.52);
  color: #f3d689;
  font: 700 11px/15px Georgia, serif;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.fs-mini-wrap {
  position: relative;
  width: 100%;
  height: 104px;
  border-radius: 4px;
  border: 1px solid #8a6f36;
  background: radial-gradient(circle at 50% 50%, #352d1f 0%, #1c1810 85%);
  overflow: hidden;
  cursor: pointer;
  transition: height 140ms ease;
}
.fs-minimap-card.is-expanded .fs-mini-wrap {
  height: 192px !important;
}
.fs-mini-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.fs-mini-north {
  position: absolute;
  top: 3px;
  left: 3px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(8, 12, 9, 0.8);
  border: 1px solid rgba(209, 173, 92, 0.5);
  font: 700 8px/1.1 Arial, sans-serif;
  color: #f2cf78;
  pointer-events: none;
}
.fs-mini-coords {
  position: absolute;
  right: 4px;
  bottom: 3px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(7, 12, 9, 0.85);
  border: 1px solid rgba(198, 162, 82, 0.58);
  font: 700 9.5px/1.2 Consolas, monospace;
  color: #f8e5a6;
  cursor: pointer;
}
.fs-map-goto-bar {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
.fs-map-goto-bar[hidden] { display: none !important; }
.fs-map-goto-bar input {
  flex: 1;
  min-width: 0;
  height: 24px;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid #b59247;
  background: rgba(10, 12, 9, 0.92);
  color: #fff2c6;
  font: 700 11.5px/1 Consolas, monospace !important;
  user-select: text;
  -webkit-user-select: text;
}
.fs-map-goto-bar button {
  height: 24px;
  padding: 0 8px;
  border-radius: 3px;
  border: 1px solid #e0be70;
  background: linear-gradient(180deg, #6b4918, #36230a);
  color: #fff2be;
  font: 700 11px/1 Arial, sans-serif;
  cursor: pointer;
}
.fs-minimap-card.is-collapsed .fs-mini-wrap,
.fs-minimap-card.is-collapsed .fs-map-goto-bar {
  display: none !important;
}

.fs-map-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin-top: 4px;
}
.fs-mm-btn-train,
.fs-mm-btn-town {
  width: 100%;
  height: 25px;
  padding: 0 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font: 700 11px/1 DemoSerif, Georgia, serif;
  cursor: pointer;
  white-space: nowrap;
}
.fs-mm-btn-train {
  border: 1px solid #cfa855;
  background: linear-gradient(180deg, #352915 0%, #1d160b 58%, #151008 100%);
  box-shadow: inset 0 1px 0 rgba(255, 232, 168, 0.25), 0 1px 2px rgba(0, 0, 0, 0.65);
  color: #ffe7a3;
}
.fs-mm-btn-town {
  border: 1px solid #d49d52;
  background: linear-gradient(90deg, #3c1712 0%, #612419 50%, #3c1712 100%);
  box-shadow: inset 0 1px 0 rgba(255, 220, 162, 0.25), 0 1px 2px rgba(0, 0, 0, 0.65);
  color: #ffe3ba;
}
.fs-mm-btn-train:hover,
.fs-mm-btn-town:hover {
  filter: brightness(1.14);
}
.fs-mm-ico {
  width: 12px;
  height: 12px;
  flex: none;
}

/* 5C. Right-Edge Vertical Quick Column (Potions [1][2] + 6 Shortcuts) */
.fs-quick-col {
  margin-top: 5px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.fs-quick-potion,
.fs-side-shortcut {
  position: relative;
  width: 36px;
  height: 36px;
  padding: 2px;
  border-radius: 4px;
  border: 1px solid #c29d4c;
  background: radial-gradient(circle at 38% 28%, #352917, #11150e 76%);
  box-shadow: inset 0 0 0 1px #3e311b, 0 2px 5px rgba(0, 0, 0, 0.72);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.fs-quick-potion:hover,
.fs-side-shortcut:hover {
  border-color: #f7db8a;
  filter: brightness(1.12);
}
.fs-quick-potion small {
  position: absolute;
  left: 2px;
  top: 1px;
  font: 700 8.5px/1 Arial, sans-serif;
  color: #ffe699;
  text-shadow: 0 1px 2px #000;
  z-index: 2;
}
.fs-quick-potion img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.85));
}
.fs-quick-potion.is-empty img {
  opacity: 0.85;
}
.fs-quick-potion b {
  position: absolute;
  right: 2px;
  bottom: 1px;
  font: 700 9px/1 Arial, sans-serif;
  color: #ffffff;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000;
  z-index: 2;
}
.fs-side-shortcut img {
  width: 25px;
  height: 25px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.85));
}
.fs-side-shortcut.is-activity {
  padding: 0;
  overflow: hidden;
  background: #141822;
}
.fs-side-shortcut.is-activity img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fs-side-shortcut > span {
  position: absolute;
  inset: auto 0 0 0;
  background: rgba(8, 10, 8, 0.82);
  color: #fff0be;
  font: 700 7px/10px Tahoma, Arial, sans-serif;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}
.fs-welfare-sprite {
  display: block;
  width: 26px;
  height: 26px;
  background-image: url('../assets/fs/ui/welfare-ranking-v2.png');
  background-repeat: no-repeat;
  background-size: 307.66% 124.84%;
  pointer-events: none;
}
.fs-welfare-sprite.is-welfare { background-position: 11.14% 48.43%; }
.fs-welfare-sprite.is-ranking { background-position: 88.41% 48.43%; }
.fs-notify-dot {
  position: absolute;
  right: -3px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3b30;
  border: 1px solid #ffe5b4;
  box-shadow: 0 0 5px #ff3b30;
}

/* 5D. Bottom-Left Translucent Double-Ring Touch Joystick */
.fs-joystick {
  position: absolute;
  left: max(var(--joy-left, 10px), env(safe-area-inset-left));
  bottom: calc(var(--bottom-bar-height, 56px) + max(10px, env(safe-area-inset-bottom)));
  width: var(--joy-size, 92px);
  height: var(--joy-size, 92px);
  border-radius: 50%;
  border: 1.5px solid rgba(236, 214, 158, 0.32);
  background: radial-gradient(circle, rgba(255, 245, 220, 0.08) 0%, rgba(16, 18, 14, 0.26) 72%);
  box-shadow: inset 0 0 0 6px rgba(255, 244, 214, 0.04), 0 2px 10px rgba(0, 0, 0, 0.35);
  touch-action: none;
  z-index: 22;
}
.fs-joystick.is-active {
  border-color: rgba(255, 224, 142, 0.62);
  background: radial-gradient(circle, rgba(255, 232, 168, 0.14) 0%, rgba(18, 22, 15, 0.38) 74%);
}
.fs-joystick .joy-tick {
  position: absolute;
  width: 5px;
  height: 5px;
  border-top: 1.5px solid rgba(242, 220, 164, 0.38);
  border-right: 1.5px solid rgba(242, 220, 164, 0.38);
  pointer-events: none;
}
.fs-joystick .joy-tick.is-up    { top: 7px; left: 50%; transform: translateX(-50%) rotate(-45deg); }
.fs-joystick .joy-tick.is-right { right: 7px; top: 50%; transform: translateY(-50%) rotate(45deg); }
.fs-joystick .joy-tick.is-down  { bottom: 7px; left: 50%; transform: translateX(-50%) rotate(135deg); }
.fs-joystick .joy-tick.is-left  { left: 7px; top: 50%; transform: translateY(-50%) rotate(-135deg); }
.fs-joystick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 38%;
  height: 38%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid rgba(248, 226, 166, 0.55);
  background: radial-gradient(circle at 36% 32%, rgba(255, 246, 218, 0.58), rgba(168, 142, 88, 0.36) 72%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
body[data-orientation="landscape"][data-touch-joy="off"] .fs-joystick {
  display: none;
}

/* 5E. Bottom-Right Chat Box + Floating AUTO / Horse / Meditate / Chat Row */
.fs-chat-group {
  position: absolute;
  right: max(var(--chat-right, 6px), env(safe-area-inset-right));
  bottom: calc(var(--bottom-bar-height, 56px) + max(6px, env(safe-area-inset-bottom)));
  width: var(--chat-width, 232px);
  max-width: calc(100% - max(var(--chat-right, 6px), env(safe-area-inset-right)) - 8px);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 22;
}
.fs-chat-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  min-height: 32px;
  padding: 0 1px;
}
.fs-chat-left-acts {
  display: flex;
  align-items: center;
  gap: 5px;
}
.fs-target-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 26px;
  padding: 0 7px;
  border: 1px solid #d4af59;
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(64, 24, 18, 0.94), rgba(29, 12, 10, 0.96));
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.78), inset 0 0 0 1px rgba(255, 220, 130, 0.16);
  color: #ffe8b0;
  font: 700 10.5px/1 Tahoma, Arial, sans-serif;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform 0.1s ease, filter 0.12s ease;
}
.fs-target-switch-btn[data-mode="player"] {
  border-color: #63d8ff;
  background: linear-gradient(180deg, rgba(16, 48, 66, 0.94), rgba(10, 26, 38, 0.96));
  color: #d6f7ff;
}
.fs-target-switch-btn:active,
.fs-target-switch-btn.is-holding {
  transform: scale(0.94);
  filter: brightness(1.2);
}
.fs-target-reticle {
  font-size: 11px;
  line-height: 1;
}
.fs-auto-pill {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  --s: 0.84;
  filter: brightness(0.78) saturate(0.82) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.88));
  transition: transform 0.12s ease, filter 0.12s ease;
}
.fs-auto-pill[aria-pressed="true"] {
  filter: brightness(1.18) saturate(1.18) drop-shadow(0 0 7px #6dff8f) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.88));
}
.fs-auto-pill.is-holding {
  transform: scale(0.95);
  filter: brightness(1.22) drop-shadow(0 0 7px #ffd866);
}
.fs-chat-right-acts {
  display: flex;
  align-items: center;
  gap: 5px;
}
.fs-act-horse {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  --s: 0.82;
  filter: brightness(0.9) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.88));
}
.fs-act-horse[aria-pressed="true"] {
  filter: brightness(1.18) drop-shadow(0 0 6px rgba(255, 215, 0, 0.85));
}
.fs-act-round {
  width: 27px;
  height: 27px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: transparent;
  background-repeat: no-repeat;
  background-size: 300% 100%;
  background-position: 0% 0%;
  cursor: pointer;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.88));
}
.fs-act-round.is-meditate {
  background-image: url('../assets/fs/ui/native-ui3/Meditate-source.png');
}
.fs-act-round.is-chat {
  background-image: url('../assets/fs/ui/native-ui3/Chat-source.png');
}
.fs-act-round:hover {
  background-position: 100% 0%;
}
.fs-act-round:active,
.fs-act-round[aria-pressed="true"] {
  background-position: 50% 0%;
  filter: brightness(1.15) drop-shadow(0 0 5px rgba(255, 216, 102, 0.75));
}

.fs-chat-panel {
  border: 1px solid rgba(185, 142, 68, 0.76);
  border-radius: 3px;
  background: linear-gradient(135deg, rgba(24, 30, 18, 0.80), rgba(11, 15, 10, 0.86));
  box-shadow: inset 0 0 0 1px rgba(62, 48, 24, 0.5), 0 4px 14px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}
.fs-chat-panel.is-minimized .fs-chat-messages,
.fs-chat-panel.is-minimized .fs-pc-chat-tabs {
  display: none;
}
.fs-chat-messages {
  height: var(--chat-content-height, 104px);
  overflow-y: auto;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font: 11px/1.38 'PT Overhead', Tahoma, Arial, sans-serif;
  color: #eee8d4;
  text-shadow: 1px 1px 0 #000;
}
.fs-chat-line { word-break: break-word; }
.fs-chat-line strong { color: #f6d868; }
.fs-chat-line[data-ch="system"] { color: #ffd479; }
.fs-chat-line[data-ch="party"]  { color: #8ad8ff; }
.fs-chat-line[data-ch="guild"]  { color: #8cff9e; }
.fs-chat-line[data-ch="private"]{ color: #ebb6ff; }
.fs-chat-badge {
  display: inline-block;
  padding: 0 3px;
  margin-right: 4px;
  border-radius: 2px;
  font: 700 9px/13px Tahoma, Arial, sans-serif;
  color: #ffffff;
  border: 1px solid #79bacc;
  background: linear-gradient(180deg, #438a9e, #225268);
  vertical-align: baseline;
}
.fs-chat-badge[data-ch="nearby"]  { background: linear-gradient(#5f946c, #2c5439); border-color: #a5c48e; }
.fs-chat-badge[data-ch="system"]  { background: linear-gradient(#b46e38, #67371e); border-color: #e6b17a; }
.fs-chat-badge[data-ch="private"] { background: linear-gradient(#a378b5, #5e376d); border-color: #d1b4e0; }
.fs-chat-badge[data-ch="party"]   { background: linear-gradient(#447da3, #244962); border-color: #93bddc; }
.fs-chat-badge[data-ch="guild"]   { background: linear-gradient(#a36c1e, #54340b); border-color: #f0c469; }

.fs-pc-chat-tabs {
  display: grid;
  grid-template-columns: 1.35fr 0.72fr 0.72fr 0.72fr 0.85fr 1.45fr;
  gap: 1px;
  padding: 1px 2px;
  background: rgba(20, 26, 15, 0.94);
  border-top: 1px solid rgba(126, 102, 54, 0.75);
  border-bottom: 1px solid rgba(84, 70, 38, 0.75);
}
.fs-pc-chat-tabs button {
  min-width: 0;
  height: 21px;
  padding: 0 1px;
  border: 0;
  background: transparent;
  color: #bcb38b;
  font: 700 9.5px/20px Tahoma, Arial, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.fs-pc-chat-tabs button[aria-selected="true"] {
  color: #ffe7a4;
  background: rgba(81, 66, 37, 0.58);
  box-shadow: inset 0 -2px 0 #e6bb55;
}
.fs-chat-form {
  display: flex;
  align-items: center;
  height: 25px;
  background: rgba(14, 18, 12, 0.95);
}
.fs-chat-form select {
  width: 60px;
  height: 100%;
  padding: 0 2px;
  border: 0;
  border-right: 1px solid rgba(130, 108, 58, 0.5);
  background: #1d2214;
  color: #f2d98d;
  font: 700 10px/1 Tahoma, Arial, sans-serif;
}
.fs-chat-form input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: #fff2cf;
  font: 11.5px/1 Tahoma, Arial, sans-serif !important;
  user-select: text;
  -webkit-user-select: text;
}
.fs-chat-emoji-btn {
  width: 24px;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
}
.fs-chat-form button[type="submit"] {
  width: 36px;
  height: 100%;
  padding: 0 2px;
  border: 0;
  border-left: 1px solid rgba(130, 108, 58, 0.5);
  background: #241d11;
  color: #ffe49c;
  font: 700 10px/1 Tahoma, Arial, sans-serif;
  cursor: pointer;
}

/* 5F. Bottom 11-Slot Native Toolbar (482x56 scaled via --toolbar-scale) */
.fs-native-toolbar {
  position: absolute;
  left: 50%;
  bottom: max(2px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: var(--toolbar-width, min(482px, calc(100% - 8px)));
  height: var(--bottom-bar-height, 56px);
  z-index: 25;
}
.fs-native-toolbar-viewport {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.fs-native-toolbar-scene {
  width: 482px;
  min-width: 482px;
  height: 56px;
  padding: 2px 4px;
  box-sizing: border-box;
  transform: scale(var(--toolbar-scale, 1));
  transform-origin: top left;
}
.fs-native-toolbar-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 52px;
  width: max-content;
}
.fs-nt-btn {
  position: relative;
  width: 34px;
  height: 52px;
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
  --s: 1.3;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.85));
}
.fs-nt-btn:hover {
  filter: brightness(1.14) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9));
}
.fs-nt-btn:active {
  transform: translateY(1px);
}
.fs-nt-btn.is-ibshop {
  width: 52px;
  height: 52px;
  --s: 1.0612;
}
.fs-nt-btn.is-pk .fs-pk-led {
  position: absolute;
  right: 2px;
  bottom: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid #fff;
  background: #38f26a;
  box-shadow: 0 0 5px #38f26a;
}
.fs-nt-btn.is-pk .fs-pk-led[data-pk="1"] {
  background: #ffbf3c;
  box-shadow: 0 0 5px #ffbf3c;
}
.fs-nt-btn.is-pk .fs-pk-led[data-pk="2"] {
  background: #ff4238;
  box-shadow: 0 0 6px #ff4238;
}
.fs-nt-btn.fs-settings-launcher {
  flex-direction: column;
  gap: 1px;
  padding: 2px 0;
  border: 1px solid #a78a4e;
  border-radius: 3px;
  background: linear-gradient(180deg, #41301e, #16150f 65%, #3a2818);
  box-shadow: inset 0 0 0 1px #21190e, 0 1px 3px rgba(0, 0, 0, 0.85);
}
.fs-nt-btn.fs-settings-launcher img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  pointer-events: none;
}
.fs-nt-btn.fs-settings-launcher .fs-settings-caption {
  font: 700 9.5px/11px DemoBody, Arial, sans-serif;
  color: #e8cf91;
  white-space: nowrap;
}

/* Left & Right Skill Sockets inside Bottom Toolbar */
.fs-native-skill-cell {
  position: relative;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid #b59246;
  border-radius: 3px;
  background: #0d1210;
  box-shadow: inset 0 0 0 1px #2b2111, 0 2px 4px rgba(0, 0, 0, 0.82);
  overflow: hidden;
  cursor: pointer;
  flex: none;
}
.fs-native-skill-cell:hover {
  border-color: #f5d680;
  filter: brightness(1.1);
}
.fs-native-skill-cell:active,
.fs-native-skill-cell.is-casting {
  transform: scale(0.93);
  border-color: #ffe588;
  box-shadow: 0 0 8px rgba(255, 214, 96, 0.72), inset 0 0 0 1px #ffd86b;
}
.fs-skill-swap-tag {
  position: absolute;
  top: 1px;
  right: 1px;
  z-index: 3;
  width: 15px;
  height: 14px;
  display: grid;
  place-items: center;
  border-radius: 2px;
  border: 1px solid rgba(220, 184, 98, 0.7);
  background: rgba(12, 16, 12, 0.86);
  color: #ffe294;
  font: 700 9px/1 Tahoma, Arial, sans-serif;
  pointer-events: auto;
}
.fs-skill-swap-tag:hover {
  background: #4e3c16;
  color: #fff;
}
.fs-skill-socket-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}
.fs-hand-skill-icon {
  position: absolute;
  inset: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  object-fit: cover;
  pointer-events: none;
  z-index: 1;
}
.fs-skill-side-tag {
  position: absolute;
  left: 3px;
  bottom: 2px;
  z-index: 2;
  padding: 0 3px;
  border-radius: 2px;
  background: rgba(8, 10, 8, 0.72);
  color: #ffffff;
  font: 700 9.5px/12px Tahoma, Arial, sans-serif;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000;
  pointer-events: none;
}

/* Floating Quick Skill Picker Tray above Bottom Toolbar */
.fs-quick-skill-tray {
  position: absolute;
  left: 50%;
  bottom: calc(var(--bottom-bar-height, 56px) + max(8px, env(safe-area-inset-bottom)));
  transform: translateX(-50%);
  max-width: calc(100% - 16px);
  padding: 6px 8px;
  border-radius: 5px;
  border: 1.5px solid #caa452;
  background: rgba(14, 18, 13, 0.95);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.88), inset 0 0 0 1px #3b2d16;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 35;
}
.fs-quick-skill-tray[hidden] { display: none !important; }
.fs-tray-skill-btn {
  width: 38px;
  height: 38px;
  padding: 2px;
  border-radius: 4px;
  border: 1px solid #7d6636;
  background: #131812;
  cursor: pointer;
}
.fs-tray-skill-btn.is-selected,
.fs-tray-skill-btn:hover {
  border-color: #ffe07d;
  box-shadow: 0 0 8px rgba(255, 214, 98, 0.55);
}
.fs-tray-skill-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fs-tray-more-btn {
  height: 38px;
  padding: 0 10px;
  border-radius: 4px;
  border: 1px solid #b89448;
  background: linear-gradient(180deg, #3c2d17, #1c150b);
  color: #ffe59e;
  font: 700 11px/1 DemoBody, Arial, sans-serif;
  cursor: pointer;
}

/* HUD Toast Notification */
.fs-hud-toast {
  position: absolute;
  top: max(96px, calc(env(safe-area-inset-top) + 92px));
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid #d7b259;
  background: rgba(14, 18, 12, 0.92);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.78);
  color: #ffeaab;
  font: 700 12px/1.3 Tahoma, Arial, sans-serif;
  white-space: nowrap;
  z-index: 45;
  pointer-events: none;
}
.fs-hud-toast[hidden] { display: none !important; }

/* Portrait & Compact Mobile Refinements (matching minimap-v2.css & pc-chat.css) */
body[data-orientation="portrait"] .fs-minimap-card {
  width: 142px;
  padding: 3px;
}
body[data-orientation="portrait"] .fs-map-title {
  min-height: 20px;
  padding: 1px 19px 1px 5px;
  margin-bottom: 3px;
}
body[data-orientation="portrait"] .fs-map-title strong {
  font-size: 10.5px;
}
body[data-orientation="portrait"] .fs-mini-wrap {
  height: 80px;
}
body[data-orientation="portrait"] .fs-mm-btn-train,
body[data-orientation="portrait"] .fs-mm-btn-town {
  height: 23px;
  font-size: 10.5px;
}
body[data-orientation="portrait"] .fs-quick-col {
  gap: 3px;
}
body[data-orientation="portrait"] .fs-quick-potion,
body[data-orientation="portrait"] .fs-side-shortcut {
  width: 34px;
  height: 34px;
}
body[data-orientation="portrait"] .fs-auto-pill {
  --s: 0.78;
}
body[data-orientation="portrait"] .fs-target-switch-btn {
  height: 24px;
  padding: 0 6px;
  font-size: 9.5px;
}
body[data-orientation="portrait"] .pk-target-hud {
  max-width: 196px;
}

@media (min-width: 1024px) and (min-height: 600px) {
  .fs-chat-group {
    width: 310px;
  }
  .fs-chat-messages {
    height: 152px;
    font-size: 12px;
  }
}

/* --------------------------------------------------------------------------
 * 6. Authentic In-Game Modals & Settings (#fs-modals-root)
 * -------------------------------------------------------------------------- */
.fs-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 60;
  background: rgba(4, 7, 6, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}
.fs-modal-backdrop[hidden] {
  display: none !important;
}

.fs-window {
  position: relative;
  width: min(460px, calc(100% - 8px));
  max-height: calc(100% - 16px);
  display: flex;
  flex-direction: column;
  border: 1.5px solid #c29e52;
  border-radius: 5px;
  background: linear-gradient(160deg, #1d1a12 0%, #0d110d 65%, #12150f 100%);
  box-shadow: inset 0 0 0 2px #362916, 0 14px 44px rgba(0, 0, 0, 0.9);
  color: #ebddba;
  font-family: DemoBody, Arial, sans-serif;
  overflow: hidden;
}
.fs-window.is-wide {
  width: min(640px, calc(100% - 8px));
}
.fs-win-header {
  position: relative;
  min-height: 42px;
  padding: 6px 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #9d8045;
  background:
    url('../assets/fs/ui/ktc-pc/header-pc-v2.png') center / 100% 100% no-repeat,
    linear-gradient(90deg, #3c1912, #61281b 50%, #2f140f);
}
.fs-win-header strong {
  font: 700 17px/1.2 DemoSerif, Georgia, serif;
  color: #ffe39b;
  text-shadow: 0 2px 4px #000;
}
.fs-win-close {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 1px solid #a78a4e;
  border-radius: 3px;
  background: #271d11;
  color: #f4e2b4;
  font: 700 20px/1 Georgia, serif;
  cursor: pointer;
}
.fs-win-body {
  padding: 10px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Settings Sections */
.fs-set-group {
  padding: 9px 10px;
  border: 1px solid #5e4b29;
  border-radius: 4px;
  background: rgba(18, 16, 11, 0.85);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fs-set-group h3 {
  font: 700 13px/1.2 DemoSerif, Georgia, serif;
  color: #f5d689;
  border-bottom: 1px solid rgba(156, 124, 62, 0.35);
  padding-bottom: 4px;
}
.fs-seg-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.fs-seg-btn {
  min-height: 34px;
  padding: 4px 6px;
  border: 1px solid #7d6436;
  border-radius: 4px;
  background: linear-gradient(180deg, #2b2215, #16120b);
  color: #dfd0a6;
  font: 700 12px/1.2 DemoBody, Arial, sans-serif;
  cursor: pointer;
}
.fs-seg-btn[aria-pressed="true"] {
  border-color: #ffd978;
  background: linear-gradient(180deg, #6e4a19, #3b260b);
  color: #fff5c8;
  box-shadow: 0 0 8px rgba(255, 206, 92, 0.35);
}
.fs-set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}
.fs-set-row select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid #96783f;
  border-radius: 4px;
  background: #12100b;
  color: #ffe8a8;
  font-weight: 700;
}
.fs-toggle-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.fs-toggle-check input {
  width: 18px;
  height: 18px;
  accent-color: #d9ac4a;
}

/* Character Status & 12-Slot Equipment Paperdoll */
.fs-char-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 10px;
}
body[data-orientation="portrait"] .fs-char-grid {
  grid-template-columns: 1fr;
}
.fs-paperdoll {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid #6b562e;
  border-radius: 4px;
  background: #0c0f0b;
}
.fs-eq-slot {
  position: relative;
  min-height: 54px;
  padding: 4px;
  border: 1px solid #755f34;
  border-radius: 4px;
  background-color: #131711;
  background-position: center;
  background-size: 42px 42px;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  cursor: pointer;
}
.fs-eq-slot.is-equipped {
  border-color: #d9b45b;
  background-color: #241f12;
}
.fs-eq-slot span {
  font-size: 10px;
  line-height: 1.15;
  color: #f4e3b2;
  background: rgba(8, 10, 8, 0.78);
  padding: 1px 3px;
  border-radius: 2px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fs-stat-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border: 1px solid #6b562e;
  border-radius: 4px;
  background: #10140e;
  font-size: 12.5px;
}
.fs-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 0;
  border-bottom: 1px dashed rgba(140, 114, 62, 0.25);
}
.fs-stat-btns {
  display: inline-flex;
  gap: 4px;
}
.fs-mini-add {
  padding: 2px 7px;
  border: 1px solid #cfa54e;
  border-radius: 3px;
  background: linear-gradient(180deg, #5e4116, #2d1e09);
  color: #fff0b5;
  font: 700 11px/1.2 Arial, sans-serif;
  cursor: pointer;
}

/* Inventory / StoreBox / Shop Grid + Rich Phong Than Tooltip */
.fs-inv-tabs {
  display: flex;
  gap: 6px;
}
.fs-inv-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 10px;
}
body[data-orientation="portrait"] .fs-inv-layout {
  grid-template-columns: 1fr;
}
.fs-bag-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  padding: 6px;
  border: 1px solid #8a703b;
  border-radius: 4px;
  background: #080b07;
  max-height: 290px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #a18648 #0c100a;
}
.fs-bag-grid::-webkit-scrollbar,
.fs-win-body::-webkit-scrollbar,
.fs-chat-messages::-webkit-scrollbar {
  width: 6px;
}
.fs-bag-grid::-webkit-scrollbar-track,
.fs-win-body::-webkit-scrollbar-track,
.fs-chat-messages::-webkit-scrollbar-track {
  background: #0c100a;
}
.fs-bag-grid::-webkit-scrollbar-thumb,
.fs-win-body::-webkit-scrollbar-thumb,
.fs-chat-messages::-webkit-scrollbar-thumb {
  background: #9a7d40;
  border-radius: 3px;
}
.fs-item-cell {
  position: relative;
  aspect-ratio: 1;
  min-height: 42px;
  padding: 3px;
  border: 1.5px solid #453c24;
  border-radius: 3px;
  background: linear-gradient(145deg, #131911, #090d08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
}
.fs-item-cell.is-selected {
  outline: 2px solid #fff0b0;
  background: #2e2914;
}
.fs-item-cell[data-rarity="green"]  { border-color: #4ee86e; box-shadow: inset 0 0 8px rgba(78, 232, 110, 0.22); }
.fs-item-cell[data-rarity="gold"]   { border-color: #ffd84d; box-shadow: inset 0 0 8px rgba(255, 216, 77, 0.25); }
.fs-item-cell[data-rarity="purple"] { border-color: #df7cff; }
.fs-item-cell[data-rarity="blue"]   { border-color: #6997ff; }
.fs-item-cell span {
  font-size: 9.5px;
  line-height: 1.15;
  color: #f2e6c2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fs-item-cell b {
  position: absolute;
  right: 2px;
  bottom: 1px;
  font-size: 9.5px;
  color: #fff5be;
  background: rgba(0, 0, 0, 0.72);
  padding: 0 3px;
  border-radius: 2px;
}

.fs-tooltip-card {
  padding: 10px;
  border: 1px solid #bda052;
  border-radius: 4px;
  background: linear-gradient(145deg, #18140c, #080a07);
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}
.fs-tt-title {
  font: 700 14.5px/1.3 DemoSerif, Georgia, serif;
  color: #ffe28a;
  text-align: center;
}
.fs-tt-lines {
  font: 12px/1.45 Tahoma, Arial, sans-serif;
  color: #e8dec0;
  white-space: pre-line;
  text-align: center;
}
.fs-tt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

/* Skills List */
.fs-skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
body[data-orientation="portrait"] .fs-skill-grid {
  grid-template-columns: 1fr;
}
.fs-skill-card-icon {
  width: 34px;
  height: 34px;
  border: 1px solid #b59247;
  border-radius: 3px;
  object-fit: cover;
  flex: none;
}
.fs-skill-card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid #6b5b36;
  border-radius: 4px;
  background: linear-gradient(110deg, #24291b, #111811);
  text-align: left;
  cursor: pointer;
}
.fs-skill-card.is-selected {
  border-color: #f0cc73;
  background: linear-gradient(110deg, #4a3d22, #1d2215);
}
.fs-skill-card strong {
  display: block;
  font-size: 13px;
  color: #ffe7a8;
}
.fs-skill-card small {
  font-size: 11px;
  color: #b7c4a8;
}

/* NPC Dialog Modal */
.fs-npc-speech {
  padding: 10px 12px;
  border: 1px solid #6b562e;
  border-radius: 4px;
  background: rgba(10, 14, 10, 0.9);
  font: 13.5px/1.55 Tahoma, Arial, sans-serif;
  color: #f2e8c9;
  white-space: pre-line;
}
.fs-npc-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fs-npc-opt-btn {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #b38f45;
  border-radius: 4px;
  background: linear-gradient(180deg, #382a16, #1b150c);
  color: #ffe59e;
  font: 700 13px/1.3 DemoBody, Arial, sans-serif;
  text-align: left;
  cursor: pointer;
}
.fs-npc-opt-btn:hover {
  border-color: #ffe28c;
  background: linear-gradient(180deg, #593f1d, #291e0f);
}

/* --------------------------------------------------------------------------
 * 7. Authentic 1:1 fsnhanroi.xyz Feature Modals (Paperdoll, Bag, Skills, Auto, KTC, Activities)
 * -------------------------------------------------------------------------- */
.fs-sub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(176, 140, 68, 0.34);
}
.fs-sub-tabs button {
  flex: 1 1 auto;
  min-height: 31px;
  padding: 4px 10px;
  border: 1px solid #6e572c;
  border-radius: 4px;
  background: linear-gradient(180deg, #241d12, #120f09);
  color: #d6c598;
  font: 700 12px/1.2 Tahoma, Arial, sans-serif;
  cursor: pointer;
}
.fs-sub-tabs button[aria-selected="true"] {
  border-color: #f6d576;
  background: linear-gradient(180deg, #694415, #342109);
  color: #fff4c4;
  box-shadow: 0 0 8px rgba(246, 204, 92, 0.32);
}

/* Pixel-Accurate 221x340 VNG 12-Slot Equipment Paperdoll Stage */
.fs-vng-paperdoll-stage {
  position: relative;
  width: 221px;
  height: 340px;
  margin: 0 auto;
  flex: none;
  border: 1px solid #6b562e;
  border-radius: 5px;
  background:
    radial-gradient(circle at 50% 44%, rgba(212, 165, 68, 0.14), transparent 62%),
    linear-gradient(180deg, #15120c 0%, #0b0e0a 100%);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.85);
}
.fs-vng-equip-slot {
  position: absolute;
  padding: 2px;
  border: 1px solid rgba(150, 120, 60, 0.65);
  border-radius: 3px;
  background-color: rgba(16, 19, 14, 0.85);
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}
.fs-vng-equip-slot.is-equipped {
  border-color: #dab256;
  background-color: rgba(34, 28, 15, 0.92);
}
.fs-vng-equip-slot.is-selected {
  outline: 2px solid #fff2a8;
  z-index: 3;
}
.fs-vng-equip-slot[data-rarity="green"]  { border-color: #4ee86e; box-shadow: inset 0 0 9px rgba(78, 232, 110, 0.28); }
.fs-vng-equip-slot[data-rarity="gold"]   { border-color: #ffd84d; box-shadow: inset 0 0 9px rgba(255, 216, 77, 0.32); }
.fs-vng-equip-slot[data-rarity="blue"]   { border-color: #6997ff; box-shadow: inset 0 0 8px rgba(105, 151, 255, 0.25); }
.fs-vng-equip-slot[data-rarity="purple"] { border-color: #df7cff; }

.fs-spr-item-img {
  max-width: calc(100% - 4px);
  max-height: calc(100% - 4px);
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.9));
  pointer-events: none;
}
.fs-item-cell.has-spr-img .fs-cell-fallback-lbl {
  display: none;
}
.fs-slot-empty-lbl {
  position: absolute;
  bottom: 2px;
  left: 1px;
  right: 1px;
  font: 600 8.5px/1.1 Arial, sans-serif;
  color: rgba(218, 200, 155, 0.62);
  text-align: center;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fs-slot-eq-name {
  position: absolute;
  bottom: 1px;
  left: 1px;
  right: 1px;
  padding: 1px 2px;
  background: rgba(6, 8, 6, 0.78);
  font: 700 8.5px/1.1 Arial, sans-serif;
  color: #ffeab0;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Dual-Pane Inventory Layout (Left 221x340 Paperdoll + Right 6x5 Bag Grid) */
.fs-inv-dual-stage {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
body[data-orientation="portrait"] .fs-inv-dual-stage {
  flex-direction: column;
  align-items: stretch;
}
.fs-inv-paperdoll-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: none;
}
.fs-pane-kicker {
  font: 700 11px/1.2 DemoSerif, Georgia, serif;
  color: #f4d382;
  letter-spacing: 0.05em;
}
.fs-inv-bag-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fs-equip-inspect-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}
body[data-orientation="portrait"] .fs-equip-inspect-wrap {
  grid-template-columns: 1fr;
}
.fs-inv-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fs-inv-act-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.fs-inv-money-bar {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 6px;
}
.fs-money-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 9px;
  border: 1px solid #6b552a;
  border-radius: 4px;
  background: #0d110c;
  font-size: 12px;
}
.fs-money-pill span {
  color: #bfb392;
}
.fs-money-pill b {
  color: #ffe596;
  font-variant-numeric: tabular-nums;
}

/* Tooltip Head with Live SPR Icon */
.fs-tt-head {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(180, 148, 76, 0.28);
  padding-bottom: 6px;
}
.fs-tt-icon-box {
  width: 46px;
  height: 46px;
  flex: none;
  border: 1.5px solid #8c7038;
  border-radius: 4px;
  background: #0d110c;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fs-tt-icon-box[data-rarity="green"] { border-color: #4ee86e; }
.fs-tt-icon-box[data-rarity="gold"]  { border-color: #ffd84d; }
.fs-tt-icon-box[data-rarity="blue"]  { border-color: #6997ff; }
.fs-tt-title-col {
  flex: 1;
  min-width: 0;
}
.fs-tt-head .fs-tt-title {
  text-align: left;
}
.fs-tt-meta {
  display: block;
  font-size: 11px;
  color: #b7c2a6;
  margin-top: 2px;
}
.fs-seg-btn.is-danger {
  border-color: #9e4b3c;
  color: #ffb8aa;
}

/* Character Status (`NHÂN VẬT` F3 — 1:1 `chunk-5LUPWUOY.mjs`) */
.fs-cs-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #755d30;
  border-radius: 5px;
  background: linear-gradient(105deg, #251d12, #111510);
}
.fs-cs-identity > img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1.5px solid #d4ab50;
  object-fit: cover;
  object-position: top;
  background: #14110b;
  flex: none;
}
.fs-cs-id-meta {
  flex: 1;
  min-width: 0;
}
.fs-cs-id-meta strong {
  display: block;
  font: 700 15px/1.2 DemoSerif, Georgia, serif;
  color: #fff0be;
}
.fs-cs-id-meta p {
  font-size: 12px;
  color: #d0c4a2;
  margin-top: 2px;
}
.fs-cs-power-row {
  margin-top: 3px;
  font: 700 11.5px/1.2 Tahoma, Arial, sans-serif;
  color: #7ef296;
}
.fs-cs-summary {
  padding: 8px 10px;
  border: 1px solid #665129;
  border-radius: 4px;
  background: #10140e;
}
.fs-cs-sum-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(164, 134, 68, 0.3);
}
.fs-cs-sum-cols span {
  display: block;
  font-size: 11px;
  color: #bdb293;
}
.fs-cs-sum-cols b {
  font: 700 14px/1.3 Tahoma, Arial, sans-serif;
  color: #ffe598;
}
.fs-cs-sum-exp {
  display: flex;
  justify-content: space-between;
  padding-top: 6px;
  font-size: 12px;
}
.fs-cs-sum-exp span { color: #bdb293; }
.fs-cs-sum-exp b { color: #8af09d; font-variant-numeric: tabular-nums; }

.fs-cs-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}
.fs-cs-stat-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid rgba(132, 106, 54, 0.45);
  border-radius: 4px;
  background: #0e120d;
  font-size: 12px;
}
.fs-cs-stat-cell span { color: #c7bca0; }
.fs-cs-stat-cell b { color: #ffe7a0; font-variant-numeric: tabular-nums; }

/* Skills Hint Bar, Painted Daily Activities, KTC & Guild Banner */
.fs-skill-hint-bar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: #d6caa8;
  padding: 2px 2px 0;
}
.fs-painted-act-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fs-painted-act-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 78px;
  padding: 10px 12px;
  border: 1px solid #b59148;
  border-radius: 5px;
  background-position: right center;
  background-size: cover;
  background-repeat: no-repeat;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
}
.fs-painted-act-card:hover {
  border-color: #ffe394;
}
.fs-painted-act-copy strong {
  display: block;
  font: 700 14px/1.25 DemoSerif, Georgia, serif;
  color: #ffe8a2;
  text-shadow: 0 1px 3px #000;
}
.fs-painted-act-copy em {
  display: block;
  font: normal 700 11px/1.3 Tahoma, Arial, sans-serif;
  color: #7ef296;
  margin-top: 2px;
}
.fs-painted-act-copy small {
  display: block;
  font-size: 11.5px;
  color: #e6dec8;
  margin-top: 3px;
  text-shadow: 0 1px 2px #000;
}
.fs-painted-act-cta {
  flex: none;
  padding: 5px 10px;
  border: 1px solid #dfb75c;
  border-radius: 4px;
  background: rgba(58, 38, 12, 0.9);
  color: #fff2be;
  font: 700 11.5px/1 Arial, sans-serif;
}

.fs-ktc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
body[data-orientation="portrait"] .fs-ktc-grid {
  grid-template-columns: 1fr;
}
.fs-ktc-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid #755c2f;
  border-radius: 5px;
  background: linear-gradient(120deg, #211a10, #0f130e);
}
.fs-ktc-ico {
  width: 36px;
  height: 36px;
  border: 1px solid #b89347;
  border-radius: 4px;
  background: #0b0e0a;
  object-fit: contain;
  flex: none;
}
.fs-ktc-info {
  flex: 1;
  min-width: 0;
}
.fs-ktc-info strong {
  display: block;
  font-size: 12.5px;
  color: #ffe69c;
}
.fs-ktc-info small {
  display: block;
  font-size: 11px;
  color: #c8bfa4;
  line-height: 1.3;
}
.fs-ktc-info em {
  display: block;
  font: normal 700 11.5px/1.3 Tahoma, Arial, sans-serif;
  color: #7ef296;
  margin-top: 2px;
}

.fs-guild-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #8f7139;
  border-radius: 5px;
  background: linear-gradient(110deg, #2b1f11, #121510);
}
.fs-guild-totem {
  width: 48px;
  height: 48px;
  flex: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}
.fs-guild-meta strong {
  display: block;
  font: 700 14px/1.25 DemoSerif, Georgia, serif;
  color: #ffe8a0;
}
.fs-guild-meta small {
  display: block;
  font-size: 11.5px;
  color: #d4cab0;
  line-height: 1.4;
  margin-top: 3px;
}
.fs-go-tag {
  padding: 2px 7px;
  border-radius: 3px;
  background: #3e2b11;
  border: 1px solid #c9a24e;
  color: #ffe69b;
  font: 700 10.5px/1.2 Arial, sans-serif;
  white-space: nowrap;
}
.fs-spot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #5a4826;
  border-radius: 4px;
  background: #121610;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.fs-spot-row.is-clickable {
  cursor: pointer;
}
.fs-spot-row.is-clickable:hover {
  border-color: #e6c164;
  background: #1b2217;
}
.fs-spot-row.is-recommended {
  border-color: #c9a24e;
  background: linear-gradient(90deg, rgba(64, 46, 16, 0.45), rgba(18, 22, 16, 0.95));
}

/* --------------------------------------------------------------------------
 * 7. Left-HUD Quest Tracker (#fs-quest-tracker) & Smart Auto-Navigation Pill
 * -------------------------------------------------------------------------- */
.fs-quest-tracker {
  width: 236px;
  max-width: min(236px, calc(100vw - 196px));
  border: 1px solid rgba(196, 157, 76, 0.72);
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(20, 18, 12, 0.84), rgba(10, 13, 10, 0.80));
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.68), inset 0 0 0 1px rgba(255, 224, 148, 0.08);
  overflow: hidden;
  pointer-events: auto;
  backdrop-filter: blur(2px);
}
.fs-qt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 3px 6px;
  background: linear-gradient(90deg, rgba(72, 50, 18, 0.88), rgba(30, 24, 12, 0.86));
  border-bottom: 1px solid rgba(180, 142, 64, 0.45);
}
.fs-qt-title {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #ffe596;
  font: 700 11px/1.2 Tahoma, Arial, sans-serif;
  text-shadow: 0 1px 2px #000;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
}
.fs-qt-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}
.fs-qt-btn {
  border: 1px solid rgba(204, 166, 82, 0.65);
  border-radius: 3px;
  background: rgba(24, 20, 11, 0.85);
  color: #ffe6a1;
  font: 700 9.5px/1.1 Tahoma, Arial, sans-serif;
  padding: 2px 5px;
  cursor: pointer;
}
.fs-qt-btn:hover {
  border-color: #ffe28a;
  background: rgba(66, 48, 18, 0.92);
}
.fs-qt-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 4px 6px;
  background: linear-gradient(90deg, rgba(22, 58, 30, 0.90), rgba(14, 34, 20, 0.88));
  border-bottom: 1px solid rgba(92, 214, 122, 0.45);
  color: #b7ffca;
  font: 700 10.5px/1.25 Tahoma, Arial, sans-serif;
  text-shadow: 0 1px 2px #000;
}
.fs-qt-nav[hidden] {
  display: none !important;
}
.fs-qt-nav span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fs-qt-stop {
  flex: none;
  border: 1px solid #ff9c8b;
  border-radius: 3px;
  background: rgba(88, 22, 18, 0.88);
  color: #ffd8d1;
  font: 700 9.5px/1.1 Tahoma, Arial, sans-serif;
  padding: 2px 5px;
  cursor: pointer;
}
.fs-qt-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px 5px;
  max-height: 156px;
  overflow-y: auto;
}
.fs-quest-tracker.is-collapsed .fs-qt-body {
  display: none;
}
.fs-qt-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  text-align: left;
  padding: 4px 6px;
  border: 1px solid rgba(132, 108, 56, 0.38);
  border-radius: 4px;
  background: rgba(18, 22, 16, 0.76);
  color: #e2f8cb;
  font: 400 11px/1.32 Tahoma, Arial, sans-serif;
  text-shadow: 0 1px 2px #000;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.fs-qt-item:hover {
  background: rgba(44, 38, 18, 0.86);
  border-color: #dfb960;
}
.fs-qt-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.fs-qt-item-head strong {
  color: #ffd96a;
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fs-qt-item-go {
  flex: none;
  color: #7ef59b;
  font-size: 9.5px;
  font-weight: 700;
}
.fs-qt-item-desc {
  color: #d8f3c2;
  font-size: 10.5px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Portrait phone compact sizing so Quest Tracker never collides with right Minimap */
body[data-orientation="portrait"] .fs-quest-tracker {
  width: 186px;
  max-width: calc(100vw - 188px);
}
body[data-orientation="portrait"] .fs-qt-body {
  max-height: 112px;
  padding: 3px 4px;
}
body[data-orientation="portrait"] .fs-qt-item {
  padding: 3px 5px;
  font-size: 10px;
}
body[data-orientation="portrait"] .fs-qt-item-head strong {
  font-size: 10px;
}
body[data-orientation="portrait"] .fs-qt-item-desc {
  font-size: 9.5px;
  -webkit-line-clamp: 2;
}

/* Quest Log Modal (F11) Cards & Token Bar */
.fs-token-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.fs-token-btn {
  flex: 1 1 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid #c9a24e;
  border-radius: 4px;
  background: linear-gradient(180deg, #3c2b12, #1d160a);
  color: #ffe79e;
  font: 700 11.5px/1.2 Tahoma, Arial, sans-serif;
  cursor: pointer;
}
.fs-token-btn:hover {
  border-color: #ffdf85;
  filter: brightness(1.1);
}
.fs-quest-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #5e4b27;
  border-radius: 4px;
  background: #131811;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.fs-quest-card:hover {
  border-color: #e6c164;
  background: #1c2318;
}
.fs-quest-card-main {
  flex: 1;
  min-width: 0;
}
.fs-quest-card-main strong {
  display: block;
  color: #ffe294;
  font-size: 12.5px;
  margin-bottom: 2px;
}
.fs-quest-card-main small {
  display: block;
  color: #d6ceb6;
  font-size: 11.2px;
  line-height: 1.38;
}
.fs-quest-badge {
  display: inline-block;
  padding: 1px 5px;
  margin-right: 5px;
  border-radius: 3px;
  background: rgba(82, 58, 20, 0.85);
  border: 1px solid #b58f40;
  color: #ffd978;
  font-size: 10px;
  font-weight: 700;
}

/* Mobile GPU Compositor Saver: disable expensive per-frame Gaussian blur & multi-pass drop-shadows over live WebGL canvas */
@media (pointer: coarse), (max-width: 900px) {
  #fs-hud-root *,
  #fs-hud-root *::before,
  #fs-hud-root *::after,
  .fs-quest-tracker {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
  }
  #fs-btn-auto[aria-pressed="true"] {
    outline: 1.5px solid #6dff8f;
    box-shadow: 0 0 8px rgba(109, 255, 143, 0.65);
  }
  #fs-btn-ride[aria-pressed="true"],
  #fs-btn-sit[aria-pressed="true"] {
    outline: 1.5px solid #ffd866;
    box-shadow: 0 0 7px rgba(255, 216, 102, 0.6);
  }
}
