/*
 * GUNNY OFFLINE PRO - GIAO DIỆN CHIBI BẮN SÚNG TỌA ĐỘ 2D (DỰA TRÊN GUNNY MOBI 6.1.1.0)
 * Thiết kế chuẩn RPG 2D màu cam-vàng-hổ phách hoàng gia, bo góc nổi 3D, thế giới Sảnh Chính sống động.
 */
@font-face {
  font-family: 'GunnyTahoma';
  src: url('../assets/fonts/Tahoma.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

:root {
  --gold-bright: #facc15;
  --gold-deep: #d97706;
  --wood-dark: #3b1906;
  --wood-mid: #5c280b;
  --wood-light: #7c3711;
  --panel-cream: #fef3c7;
  --panel-warm: #fde68a;
  --btn-orange-top: #fb923c;
  --btn-orange-bot: #c2410c;
  --btn-green-top: #4ade80;
  --btn-green-bot: #15803d;
  --btn-blue-top: #38bdf8;
  --btn-blue-bot: #0369a1;
  --btn-red-top: #f87171;
  --btn-red-bot: #b91c1c;
}

* {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

html, body, #game-root, .game-screen, .window-body {
  touch-action: manipulation;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #140902;
  font-family: 'GunnyTahoma', Tahoma, 'Segoe UI', sans-serif;
  color: #fffbeb;
}

#game-root {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* MÀN HÌNH CHÍNH (SCREENS) */
.game-screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
}

.game-screen.active {
  display: flex;
}

/* 1. MÀN HÌNH START */
#screen-start {
  background-image: url('../assets/ui/public/bg/login_bg.jpg');
}

#screen-start::before {
  content: '';
  position: absolute;
  z-index: 0;
  top: clamp(34px, 8.8vh, 64px);
  left: 50%;
  width: min(380px, 88vw);
  aspect-ratio: 800 / 250;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 249, 216, 1) 0%, rgba(255, 237, 177, 1) 62%, rgba(255, 218, 123, 0.98) 82%, rgba(255, 218, 123, 0) 100%);
  filter: blur(3px);
  pointer-events: none;
}

.screen-brand-logo {
  position: absolute;
  z-index: 0;
  top: clamp(38px, 9.4vh, 68px);
  left: 50%;
  width: min(300px, 78vw);
  height: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 5px 10px rgba(58, 25, 5, 0.5));
  pointer-events: none;
}

.start-top-tools {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 20;
}

.start-overlay-card {
  position: relative;
  z-index: 1;
  background: radial-gradient(circle at top, rgba(92, 40, 11, 0.93), rgba(28, 10, 2, 0.96));
  border: 4px solid var(--gold-bright);
  border-radius: 28px;
  padding: 24px 36px;
  max-width: 610px;
  width: 92%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.82), inset 0 0 26px rgba(250, 204, 21, 0.28);
}

.start-logo {
  max-width: 390px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.75));
  margin-bottom: 6px;
}

.start-badge {
  display: inline-block;
  background: linear-gradient(180deg, #ef4444, #991b1b);
  border: 2px solid #fde047;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 10px;
  text-shadow: 0 1px 2px #000;
}

.phoenix-dev-credit {
  margin: 6px 0 12px;
  color: #ffedbc;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  text-shadow: 0 2px 3px #000;
}

.start-save-box {
  background: rgba(20, 8, 2, 0.78);
  border: 2px solid #b45309;
  border-radius: 16px;
  padding: 12px 16px;
  margin: 10px 0 16px;
  font-size: 14px;
  color: #fde68a;
}

/* NÚT BẤM PHONG CÁCH CHIBI 3D GUNNY */
.gunny-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 3px solid #fef08a;
  background: linear-gradient(180deg, var(--btn-orange-top), var(--btn-orange-bot));
  color: #ffffff;
  font-weight: 900;
  font-size: 15px;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.85);
  box-shadow: 0 5px 0 #7c2d12, 0 8px 16px rgba(0,0,0,0.5);
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.15s ease;
}

.gunny-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.gunny-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #7c2d12;
}

.gunny-btn.green {
  background: linear-gradient(180deg, var(--btn-green-top), var(--btn-green-bot));
  box-shadow: 0 5px 0 #14532d, 0 8px 16px rgba(0,0,0,0.5);
}

.gunny-btn.blue {
  background: linear-gradient(180deg, var(--btn-blue-top), var(--btn-blue-bot));
  box-shadow: 0 5px 0 #0c4a6e, 0 8px 16px rgba(0,0,0,0.5);
}

.gunny-btn.red {
  background: linear-gradient(180deg, var(--btn-red-top), var(--btn-red-bot));
  box-shadow: 0 5px 0 #7f1d1d, 0 8px 16px rgba(0,0,0,0.5);
}

.gunny-btn.sm {
  padding: 6px 14px;
  font-size: 12px;
  border-width: 2px;
}

/* 2 & 3. MÀN HÌNH CHỌN NHÂN VẬT NAM/NỮ & NHẬP TÊN */
#screen-role-select, #screen-name-input {
  background-image: url('../assets/ui/public/bg/login_bg2.jpg');
}

.role-select-stage {
  background: linear-gradient(180deg, rgba(67, 26, 5, 0.93), rgba(28, 10, 2, 0.96));
  border: 4px solid var(--gold-bright);
  border-radius: 28px;
  padding: 24px 32px;
  max-width: 780px;
  width: 94%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.82);
}

.gender-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 18px 0;
}

.gender-card {
  background: radial-gradient(circle at center, rgba(251, 191, 36, 0.2), rgba(40, 16, 4, 0.88));
  border: 3px solid #92400e;
  border-radius: 22px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gender-card.selected {
  border-color: #facc15;
  background: radial-gradient(circle at center, rgba(250, 204, 21, 0.36), rgba(92, 40, 11, 0.95));
  box-shadow: 0 0 25px rgba(250, 204, 21, 0.55);
  transform: scale(1.02);
}

.gender-card img.char-art {
  height: 210px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.7));
}

.gender-card img.gender-label-img {
  height: 36px;
  margin-top: 8px;
}

.gunny-input {
  width: 100%;
  max-width: 340px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 3px solid var(--gold-bright);
  background: #1c0a02;
  color: #fef08a;
  font-size: 17px;
  font-weight: 800;
  text-align: center;
  outline: none;
}

/* 4. MÀN HÌNH SẢNH CHÍNH (MAINLAND WORLD ISLAND) */
#screen-mainland {
  background-image: url('../assets/ui/mainland/bj-1.jpg');
  justify-content: space-between;
}

.mainland-top-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  background: linear-gradient(180deg, rgba(28, 10, 2, 0.92), rgba(28, 10, 2, 0.32));
  border-bottom: 2px solid rgba(250, 204, 21, 0.45);
  z-index: 15;
  flex-wrap: wrap;
  gap: 10px;
}

.player-hud-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(90deg, #451a03, #78350f);
  border: 3px solid var(--gold-bright);
  border-radius: 999px;
  padding: 5px 18px 5px 10px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.65);
  transition: transform 0.15s ease;
}

.player-hud-pill:hover {
  transform: scale(1.02);
}

.level-orb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle, #facc15, #b45309);
  border: 2px solid #fff;
  color: #270e02;
  font-weight: 900;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exp-bar-wrap {
  width: 130px;
  height: 9px;
  background: #1c0a02;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 3px;
}

.exp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #84cc16);
  width: 0%;
  transition: width 0.25s ease;
}

.power-banner {
  background: linear-gradient(90deg, #7f1d1d, #dc2626, #7f1d1d);
  border: 2px solid #fde047;
  border-radius: 999px;
  padding: 6px 18px;
  font-weight: 900;
  color: #fef08a;
  font-size: 15px;
  text-shadow: 0 2px 3px #000;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.45);
}

.currency-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.currency-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(24, 9, 2, 0.88);
  border: 2px solid #f59e0b;
  border-radius: 999px;
  padding: 5px 12px;
  font-weight: 800;
  font-size: 13px;
  color: #fef3c7;
}

/* KHU VỰC GIỮA SẢNH CHÍNH: CÔNG TRÌNH 3D & NHÂN VẬT TRUNG TÂM */
.mainland-stage {
  position: relative;
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.building-hotspot {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.22s ease, filter 0.22s ease;
  z-index: 10;
}

.building-hotspot:hover {
  transform: scale(1.09) translateY(-5px);
  filter: drop-shadow(0 0 18px rgba(250, 204, 21, 0.95));
}

.building-hotspot .b-building-img {
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.72));
}

.building-hotspot .b-nameplate-img {
  height: 28px;
  width: auto;
  object-fit: contain;
  margin-top: -10px;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.85));
}

.building-hotspot .b-sub-caption {
  margin-top: 2px;
  background: rgba(24, 9, 2, 0.82);
  border: 1px solid rgba(250, 204, 21, 0.75);
  border-radius: 999px;
  padding: 1px 9px;
  font-weight: 800;
  font-size: 10px;
  color: #fde68a;
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
}

.mainland-center-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 16px;
  border-radius: 28px;
  cursor: pointer;
  z-index: 12;
  transition: transform 0.2s ease;
}

.mainland-center-avatar:hover {
  transform: scale(1.03);
}

.center-avatar-tag {
  background: linear-gradient(90deg, rgba(69, 26, 3, 0.92), rgba(120, 53, 15, 0.92), rgba(69, 26, 3, 0.92));
  border: 2px solid #facc15;
  border-radius: 999px;
  padding: 4px 16px;
  font-size: 12px;
  font-weight: 800;
  color: #fef08a;
  box-shadow: 0 4px 12px rgba(0,0,0,0.75);
  margin-top: -6px;
}

/* THANH DOCK DƯỚI CÙNG SẢNH CHÍNH (12 CỬA SỔ CẤP CAO, KHÔNG TRÙNG LẶP) */
.mainland-bottom-dock {
  width: 100%;
  background: linear-gradient(0deg, rgba(24, 8, 2, 0.95), rgba(59, 25, 6, 0.82));
  border-top: 3px solid var(--gold-bright);
  padding: 7px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  z-index: 15;
}

.dock-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 5px 10px;
  background: linear-gradient(180deg, #7c2d12, #3b1205);
  border: 2px solid #fbbf24;
  border-radius: 15px;
  color: #fef3c7;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  position: relative;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 8px rgba(0,0,0,0.55);
}

.dock-btn:hover {
  transform: translateY(-4px);
  background: linear-gradient(180deg, #b45309, #78350f);
  box-shadow: 0 6px 14px rgba(250, 204, 21, 0.45);
}

.dock-btn img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  margin-bottom: 2px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.65));
}

.dock-btn-combat {
  background: linear-gradient(180deg, #dc2626, #7f1d1d);
  border-color: #fef08a;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.65);
}

.badge-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  border: 2px solid #fff;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  border-radius: 999px;
  padding: 1px 5px;
}

/* CỬA SỔ CHỨC NĂNG (MODALS) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 4, 1, 0.78);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 14px;
}

.modal-backdrop.open {
  display: flex;
}

.gunny-window {
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  background: linear-gradient(180deg, #5c280b, #2e1203);
  border: 4px solid var(--gold-bright);
  border-radius: 24px;
  box-shadow: 0 22px 60px rgba(0,0,0,0.9), inset 0 0 18px rgba(250, 204, 21, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: linear-gradient(90deg, #78350f, #b45309, #78350f);
  border-bottom: 3px solid var(--gold-bright);
}

.window-title {
  font-size: 19px;
  font-weight: 900;
  color: #fef08a;
  text-shadow: 0 2px 4px #000;
  display: flex;
  align-items: center;
  gap: 10px;
}

.window-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #fef08a;
  background: linear-gradient(180deg, #ef4444, #991b1b);
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  cursor: pointer;
}

.window-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

/* LƯỚI Ô TÚI ĐỒ & TRANG BỊ */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 10px;
}

.item-slot {
  position: relative;
  height: 76px;
  background: radial-gradient(circle, #451a03, #1f0b01);
  border: 2px solid #92400e;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.15s ease;
}

.item-slot:hover, .item-slot.selected {
  border-color: #facc15;
  transform: scale(1.04);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.55);
}

.item-slot.q-3 { border-color: #38bdf8; }
.item-slot.q-4 { border-color: #c084fc; }
.item-slot.q-5 { border-color: #facc15; background: radial-gradient(circle, #78350f, #270e02); }

.item-slot img.slot-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.item-slot .slot-qty {
  position: absolute;
  bottom: 3px;
  right: 5px;
  font-size: 11px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}

.item-slot .slot-str {
  position: absolute;
  top: 3px;
  left: 5px;
  background: rgba(220, 38, 38, 0.92);
  border: 1px solid #fde047;
  border-radius: 6px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 900;
  color: #fef08a;
}

.item-slot .slot-lock {
  position: absolute;
  top: 3px;
  right: 4px;
  font-size: 11px;
}

/* TABS TRONG CỬA SỔ */
.tab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid #b45309;
  background: #270e02;
  color: #fde68a;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  border-color: #facc15;
  color: #fff;
}

.tab-btn.active {
  background: linear-gradient(180deg, #f59e0b, #b45309);
  border-color: #fef08a;
  color: #fff;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.45);
}

/* MÀN HÌNH CHIẾN ĐẤU (SCREEN-BATTLE) */
#screen-battle {
  background: #090d16;
}

#battle-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.battle-top-hud {
  position: absolute;
  top: 8px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
  z-index: 25;
}

.battle-top-hud > * {
  pointer-events: auto;
}

.battle-team-hp-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.team-hp-pill {
  background: rgba(15, 23, 42, 0.88);
  border: 2px solid #facc15;
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 11px;
  min-width: 165px;
}

.mini-hp-track {
  width: 100%;
  height: 7px;
  background: #1e293b;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 3px;
}

.mini-hp-fill.ally {
  height: 100%;
  background: linear-gradient(90deg, #16a34a, #4ade80);
  transition: width 0.25s ease;
}

.mini-hp-fill.enemy {
  height: 100%;
  background: linear-gradient(90deg, #dc2626, #f87171);
  transition: width 0.25s ease;
}

.wind-box {
  background: linear-gradient(180deg, rgba(59, 25, 6, 0.92), rgba(24, 9, 2, 0.95));
  border: 3px solid #facc15;
  border-radius: 16px;
  padding: 6px 18px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.65);
}

.minimap-box {
  background: rgba(15, 23, 42, 0.92);
  border: 3px solid #facc15;
  border-radius: 12px;
  padding: 4px 6px;
}

.battle-bottom-hud {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(28, 10, 2, 0.88), rgba(18, 6, 1, 0.97));
  border-top: 3px solid #facc15;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  z-index: 25;
}

.power-gauge-track {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 22px;
  background: #1c0a02;
  border: 2px solid #facc15;
  border-radius: 999px;
  overflow: hidden;
}

.power-gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #eab308, #ef4444);
  width: 0%;
}

.power-last-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #38bdf8;
  box-shadow: 0 0 6px #38bdf8;
  z-index: 4;
}

.power-ruler-ticks {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  font-size: 9px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
  z-index: 3;
}

.combat-props-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.prop-btn {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 2px solid #f59e0b;
  background: #270e02;
  padding: 4px;
  cursor: pointer;
  position: relative;
  transition: transform 0.1s ease;
}

.prop-btn:hover {
  transform: scale(1.08);
  border-color: #fef08a;
}

.prop-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* THÔNG BÁO TOAST */
#toast-container {
  position: fixed;
  top: max(68px, calc(env(safe-area-inset-top, 0px) + 8px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: max-content;
  max-width: min(380px, calc(100% - 32px));
  pointer-events: none;
}

.gunny-toast {
  background: linear-gradient(90deg, #78350f, #b45309, #78350f);
  border: 2px solid #fef08a;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  overflow-wrap: anywhere;
  animation: phoenixToastFade var(--toast-duration, 4500ms) ease both;
}

@keyframes phoenixToastFade {
  0%, 100% { opacity: 0; }
  9%, 93% { opacity: 1; }
}

/* THẺ BÀI LẬT THƯỞNG SAU TRẬN ĐẤU */
.settlement-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 14px 0;
}

.flip-card {
  background: radial-gradient(circle, #78350f, #3b1906);
  border: 3px solid #facc15;
  border-radius: 16px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.flip-card:hover {
  transform: translateY(-4px);
}

/* Kết quả ải và lựa chọn lật thẻ. */
.gunny-window[data-modal-theme="modal-settlement"] {
  max-width: min(560px, 100%) !important;
  max-height: min(85vh, calc(var(--game-viewport-height, 100vh) - 24px)) !important;
}

.modal-backdrop.open .gunny-window[data-modal-theme="modal-settlement"] {
  animation: phoenixBattleNoticeIn 0.45s ease-out;
}

.gunny-window[data-modal-theme="modal-settlement"] .window-header {
  flex: 0 0 auto;
  gap: 10px;
  padding: 5px 12px !important;
}

.gunny-window[data-modal-theme="modal-settlement"] .window-title {
  min-width: 0;
  font-size: 16px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.gunny-window[data-modal-theme="modal-settlement"] .window-close-btn {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
}

.battle-settlement {
  text-align: center;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.battle-settlement-art {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 58px;
  margin: 0 auto;
  object-fit: contain;
}

.battle-settlement-summary,
.battle-settlement-card-tip {
  margin: 5px 0;
  color: #6a2e13;
  font-size: 14px;
  font-weight: 800;
}

.battle-settlement-rewards {
  display: grid;
  gap: 2px;
  padding: 6px 10px;
  margin: 6px auto;
  border: 1px solid #f59e0b;
  border-radius: 10px;
  background: #46220f;
  color: #fff3dc;
  font-size: 14px;
}

.battle-settlement .settlement-cards-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 6px 0;
}

.battle-settlement .flip-card {
  min-height: 92px;
  padding: 5px 3px;
  border-width: 2px;
  border-radius: 10px;
}

.battle-settlement .flip-card img {
  height: 52px;
  max-width: 100%;
  object-fit: contain;
}

.battle-settlement-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.battle-settlement-actions .gunny-btn {
  min-height: 44px;
  font-size: 14px;
}

@media (max-width: 380px) {
  .battle-settlement .settlement-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* === v3.0 Battle HUD & Lobby Polish === */
.battle-bottom-hud {
  gap: 10px !important;
  padding: 8px 14px !important;
}
.battle-props-box {
  flex-shrink: 0;
}
.prop-grid {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 5px !important;
}
.prop-btn {
  width: 36px !important;
  height: 36px !important;
  font-size: 11px !important;
  padding: 2px !important;
}
.map-building .b-img {
  max-width: 145px;
  max-height: 115px;
  object-fit: contain;
}

/* ============================================================================
   GUNNY MOBI AUTHENTIC UI OVERHAUL (MAINLAND, MODALS & BATTLE HUD)
   ============================================================================ */

/* 1. SẢNH CHÍNH ĐẢO BAY (MAINLAND STAGE 100% LOCKED TO bj-1.jpg SHADOWS) */
#screen-mainland {
  background: #0c192c !important;
  overflow: hidden;
}

.mainland-stage {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: url('../assets/ui/mainland/bj-1.jpg') no-repeat center center !important;
  background-size: 100% 100% !important;
  z-index: 1;
}

.building-hotspot {
  position: absolute !important;
  transform: translate(-50%, -55%) !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 5;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.22s ease !important;
  user-select: none;
}

.building-hotspot:hover {
  transform: translate(-50%, -59%) scale(1.08) !important;
  filter: drop-shadow(0 0 16px rgba(250, 204, 21, 0.95)) brightness(1.08) !important;
  z-index: 12;
}

.building-hotspot:active {
  transform: translate(-50%, -53%) scale(0.94) !important;
}

.b-building-img {
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55));
}

.b-nameplate-img {
  height: 28px !important;
  object-fit: contain;
  margin-top: -18px !important;
  pointer-events: none;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.85));
}

.b-glow-ring {
  position: absolute;
  bottom: 12px;
  width: 150px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(250, 204, 21, 0.42) 0%, rgba(245, 158, 11, 0.12) 60%, transparent 75%);
  pointer-events: none;
  animation: gmPulseRing 2.4s infinite ease-in-out;
}

@keyframes gmPulseRing {
  0%, 100% { transform: scale(0.95); opacity: 0.75; }
  50% { transform: scale(1.08); opacity: 1; }
}

.b-airship-float {
  animation: gmFloatShip 3.6s ease-in-out infinite;
}

@keyframes gmFloatShip {
  0%, 100% { margin-top: 0px; }
  50% { margin-top: -10px; }
}

/* 2. KHUNG AVATAR GÓC TRÊN-TRÁI SẢNH CHÍNH (ddzjm-1.png + mlxt-3.png) */
.gm-top-left-hud {
  position: absolute;
  top: calc(8px + env(safe-area-inset-top, 0px));
  left: calc(10px + env(safe-area-inset-left, 0px));
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gm-avatar-plate {
  width: 325px;
  height: 90px;
  background: url('../assets/extracted/mainland_hud/ddzjm-1.png') no-repeat left center / 100% 100%;
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.65));
}

.gm-avatar-plate:hover {
  transform: scale(1.03);
}

.gm-avatar-portrait-wrap {
  position: relative;
  width: 78px;
  height: 78px;
  margin-left: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#mainland-avatar-canvas {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #fef08a 0%, #b45309 65%, #451a03 100%);
  border: 2px solid #fde047;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.6);
}

.gm-level-badge {
  position: absolute;
  bottom: -2px;
  left: -2px;
  min-width: 24px;
  height: 24px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #facc15, #ca8a04);
  border: 2px solid #451a03;
  color: #1c0a02;
  font-weight: 900;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.gm-player-bars {
  flex: 1;
  padding: 6px 18px 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gm-player-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gm-player-name {
  font-weight: 900;
  font-size: 14px;
  color: #fef08a;
  text-shadow: 0 2px 3px #000;
}

.gm-title-pill {
  font-size: 10px;
  font-weight: 800;
  background: linear-gradient(180deg, #dc2626, #7f1d1d);
  border: 1px solid #facc15;
  color: #fef08a;
  padding: 1px 6px;
  border-radius: 999px;
}

.gm-bar-track {
  position: relative;
  height: 14px;
  background: rgba(15, 6, 2, 0.85);
  border: 1px solid #a16207;
  border-radius: 999px;
  overflow: hidden;
}

.gm-bar-Track.ap-track {
  width: 78%;
}

.gm-bar-fill.exp-fill {
  height: 100%;
  background: linear-gradient(90deg, #9333ea, #e879f9);
}

.gm-bar-fill.ap-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
}

.gm-bar-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
}

.gm-power-ribbon {
  width: 245px;
  height: 32px;
  margin-left: 14px;
  background: url('../assets/extracted/mainland_hud/mlxt-3.png') no-repeat left center / 100% 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  cursor: pointer;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.7));
}

.gm-power-title {
  font-size: 11px;
  font-weight: 900;
  color: #fde68a;
  text-shadow: 0 1px 2px #000;
}

.gm-power-digits {
  font-size: 16px;
  font-weight: 900;
  color: #facc15;
  text-shadow: 0 2px 3px #000, 0 0 8px rgba(250, 204, 21, 0.6);
  letter-spacing: 0.5px;
}

/* 3. GÓC TRÊN-PHẢI SẢNH CHÍNH: TIỀN TỆ & BIỂU TƯỢNG SỰ KIỆN */
.gm-top-right-hud {
  position: absolute;
  top: calc(8px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.gm-currency-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gm-currency-slot {
  min-width: 118px;
  height: 30px;
  background: rgba(24, 9, 2, 0.82);
  border: 2px solid #d97706;
  border-radius: 999px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: #fef08a;
  font-weight: 900;
  font-size: 13px;
  text-shadow: 0 1px 2px #000;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0,0,0,0.55);
  transition: transform 0.15s ease;
}

.gm-currency-slot:hover {
  transform: translateY(-2px);
  border-color: #facc15;
}

.gm-cur-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.gm-cur-plus {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.gm-top-event-icons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gm-round-icon-btn {
  position: relative;
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
}

.gm-round-icon-btn:hover {
  transform: translateY(-3px) scale(1.1);
  filter: drop-shadow(0 0 10px rgba(250, 204, 21, 0.9));
}

.gm-round-icon-btn:active {
  transform: scale(0.92);
}

.gm-icon-pic {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.65));
}

.gm-icon-txt {
  height: 17px;
  object-fit: contain;
  margin-top: -10px;
  filter: drop-shadow(0 2px 3px #000);
}

.gm-mini-label {
  margin-top: -8px;
  background: rgba(24, 9, 2, 0.88);
  border: 1px solid #facc15;
  color: #fef08a;
  font-size: 10px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 999px;
  text-shadow: 0 1px 2px #000;
}

/* 4. CỘT DỌC BÊN TRÁI SẢNH CHÍNH */
.gm-left-sidebar {
  position: absolute;
  left: 12px;
  top: 142px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 5. THANH DOCK BIỂU TƯỢNG TRÒN NỔI GÓC DƯỚI-PHẢI SẢNH CHÍNH */
.mainland-bottom-dock {
  position: absolute !important;
  right: 16px !important;
  bottom: 10px !important;
  left: auto !important;
  width: auto !important;
  background: rgba(24, 10, 3, 0.55) !important;
  backdrop-filter: blur(4px);
  border: 2px solid rgba(250, 204, 21, 0.55) !important;
  border-radius: 999px !important;
  padding: 6px 16px !important;
  display: flex !important;
  align-items: flex-end !important;
  gap: 12px !important;
  z-index: 20;
  box-shadow: 0 6px 18px rgba(0,0,0,0.65) !important;
}

.dock-btn {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  min-width: 58px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease !important;
}

.dock-btn:hover {
  transform: translateY(-6px) scale(1.12) !important;
  filter: drop-shadow(0 0 12px rgba(250, 204, 21, 0.95)) !important;
}

.dock-btn:active {
  transform: scale(0.92) !important;
}

.dock-pic {
  width: 56px !important;
  height: 56px !important;
  object-fit: contain;
}

.dock-pic-vs {
  width: 68px !important;
  height: 62px !important;
  object-fit: contain;
}

.dock-name-img {
  height: 18px !important;
  object-fit: contain;
  margin-top: -10px !important;
  filter: drop-shadow(0 2px 3px #000);
}

/* 6. HIỆU ỨNG CỬA SỔ CHỨC NĂNG ĐÀN HỒI & KHUNG CÁ NHÂN/TÚI ĐỒ + CƯỜNG HÓA */
.modal-backdrop.open .gunny-window {
  animation: gmWindowSpringIn 0.26s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes gmWindowSpringIn {
  0% { opacity: 0; transform: scale(0.84) translateY(18px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.gm-dual-bag-layout {
  display: grid;
  grid-template-columns: 375px 1fr;
  gap: 14px;
  align-items: stretch;
}

.gm-dollhouse-card {
  background: linear-gradient(180deg, #5c280b 0%, #2e1204 100%);
  border: 3px solid #f59e0b;
  border-radius: 18px;
  padding: 12px;
  position: relative;
  box-shadow: inset 0 0 22px rgba(0,0,0,0.65);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.gm-dollhouse-Arena {
  display: grid;
  grid-template-columns: 62px 1fr 62px;
  gap: 6px;
  align-items: center;
  margin: 6px 0;
}

.gm-equip-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.gm-equip-box {
  width: 56px;
  height: 56px;
  background: url('../assets/ui/bag/beibs.png') no-repeat center center / 100% 100%;
  background-color: #270e02;
  border: 2px solid #d97706;
  border-radius: 12px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.16s ease;
}

.gm-equip-box:hover {
  transform: scale(1.08);
  border-color: #fef08a;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.7);
}

.gm-equip-box .eq-slot-hint {
  font-size: 9px;
  color: #a16207;
  font-weight: 800;
  text-align: center;
}

.gm-bag-right-card {
  background: linear-gradient(180deg, #451a03 0%, #230c02 100%);
  border: 3px solid #f59e0b;
  border-radius: 18px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gm-bag-grid-with-vtabs {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
  align-items: start;
}

.gm-vertical-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gm-vtab-btn {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  padding: 10px 6px;
  border-radius: 0 10px 10px 0;
  background: linear-gradient(180deg, #78350f, #451a03);
  border: 2px solid #b45309;
  color: #fed7aa;
  font-weight: 900;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.gm-vtab-btn.active {
  background: linear-gradient(180deg, #84cc16, #15803d);
  border-color: #fef08a;
  color: #ffffff;
  transform: translateX(3px);
}

/* Giao diện Cường Hóa Nguyên Bản Gunny Mobi (qhjm-1.jpg .. qhjm-13.png) */
.gm-qhjm-board {
  background: url('../assets/ui/strengthen/qhjm-1.jpg') no-repeat center center / 100% 100%;
  border: 3px solid #facc15;
  border-radius: 18px;
  padding: 14px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.75);
}

.gm-qhjm-dual-stage {
  display: grid;
  grid-template-columns: 1fr 84px 1fr;
  align-items: center;
  gap: 10px;
}

.gm-qhjm-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.gm-qhjm-slot-cur {
  width: 96px;
  height: 96px;
  background: url('../assets/ui/strengthen/qhjm-7.png') no-repeat center center / 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.gm-qhjm-slot-next {
  width: 104px;
  height: 104px;
  background: url('../assets/ui/strengthen/qhjm-8.png') no-repeat center center / 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: gmPulseRing 2s infinite ease-in-out;
}

.gm-qhjm-stat-card-cur {
  width: 100%;
  max-width: 245px;
  background: url('../assets/ui/strengthen/qhjm-2.png') no-repeat center center / 100% 100%;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.65;
  color: #fef3c7;
  text-shadow: 0 1px 2px #000;
}

.gm-qhjm-stat-card-next {
  width: 100%;
  max-width: 245px;
  background: url('../assets/ui/strengthen/qhjm-3.png') no-repeat center center / 100% 100%;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.65;
  color: #e0f2fe;
  text-shadow: 0 1px 2px #000;
}

.gm-qhjm-fire-btn {
  width: 186px;
  height: 50px;
  background: url('../assets/ui/strengthen/qhjm-4.png') no-repeat center center / 100% 100%;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.16s ease;
}

.gm-qhjm-fire-btn:hover {
  transform: scale(1.07);
  filter: drop-shadow(0 0 14px rgba(250, 204, 21, 0.95));
}

.gm-qhjm-fire-btn:active {
  transform: scale(0.94);
}

/* ============================================================================
   7. MÀN HÌNH CHIẾN ĐẤU (HUD ĐÚNG 100% VỊ TRÍ CỦA GUNNY MOBI)
   ============================================================================ */
.gm-battle-top-left {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gm-pass-img-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.gm-pass-img-btn:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.85));
}

.gm-pass-img-btn img {
  height: 36px;
  object-fit: contain;
}

.gm-turn-pill {
  background: rgba(15, 23, 42, 0.78);
  border: 1.5px solid rgba(250, 204, 21, 0.7);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 800;
  color: #fef08a;
  text-shadow: 0 1px 2px #000;
}

/* Chính giữa-trên: Mũi tên Gió & Avatar 2 phe */
.gm-battle-top-center {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: none;
}

.gm-team-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.72);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  padding: 4px 8px;
}

.gm-head-box {
  position: relative;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gm-head-frame {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.gm-head-tag {
  position: absolute;
  font-size: 10px;
  font-weight: 900;
  color: #4ade80;
  text-shadow: 0 1px 2px #000;
}

.gm-head-tag.enemy {
  color: #f87171;
}

.gm-team-hp-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 95px;
}

.gm-team-hp-col.right {
  align-items: flex-end;
}

.gm-team-hp-num {
  font-size: 11px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 2px #000;
}

.gm-team-hp-bar {
  width: 95px;
  height: 8px;
  background: rgba(0,0,0,0.8);
  border: 1px solid #94a3b8;
  border-radius: 99px;
  overflow: hidden;
}

.gm-team-hp-fill.ally {
  height: 100%;
  background: linear-gradient(90deg, #16a34a, #4ade80);
}

.gm-team-hp-fill.enemy {
  height: 100%;
  background: linear-gradient(90deg, #dc2626, #f87171);
}

.gm-wind-center-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gm-wind-arrow-wrap {
  position: relative;
  width: 112px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gm-wind-arrow {
  width: 104px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.75));
  transition: transform 0.25s ease;
}

.gm-wind-val-overlay {
  position: absolute;
  font-size: 14px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 2px 4px #000, 0 0 6px #0284c7;
}

.gm-prev-wind-bar {
  position: relative;
  margin-top: -4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gm-prev-bg {
  height: 20px;
  object-fit: contain;
}

.gm-turn-timer-badge {
  background: rgba(24, 9, 2, 0.9);
  border: 1.5px solid #facc15;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 900;
  color: #facc15;
}

/* Góc trên-phải: Minimap chuẩn Gunny Mobi */
.gm-battle-top-right {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 25;
  width: 186px;
  background: rgba(15, 23, 42, 0.72);
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.65);
}

.gm-minimap-header {
  height: 28px;
  background: url('../assets/extracted/battle_hud/min_map_005.png') no-repeat center center / 100% 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 0 10px;
}

.gm-minimap-turn {
  font-size: 11px;
  font-weight: 900;
  color: #38bdf8;
  text-shadow: 0 1px 2px #000;
}

.gm-minimap-close-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: transform 0.15s ease;
}

.gm-minimap-close-btn:hover {
  transform: scale(1.1);
}

.gm-minimap-close-btn img {
  height: 22px;
  object-fit: contain;
}

.gm-minimap-frame {
  padding: 2px;
  display: flex;
  justify-content: center;
}

/* Góc dưới-trái: Vô lăng điều khiển 4 hướng chuẩn Gunny Mobi (steering_wheel_bg.png) */
.gm-steering-wheel-zone {
  position: absolute;
  left: 16px;
  bottom: 12px;
  z-index: 25;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.gm-steering-wheel {
  position: relative;
  width: 176px;
  height: 176px;
  user-select: none;
}

.gm-wheel-bg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  opacity: 0.92;
}

.gm-wheel-dir-btn {
  position: absolute;
  background: transparent;
  border: none;
  padding: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.gm-wheel-dir-btn .dir-n {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.gm-wheel-dir-btn .dir-s {
  display: none;
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.gm-wheel-dir-btn:hover .dir-n,
.gm-wheel-dir-btn:active .dir-n {
  display: none;
}

.gm-wheel-dir-btn:hover .dir-s,
.gm-wheel-dir-btn:active .dir-s {
  display: block;
}

.gm-wheel-dir-btn.up {
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
}

.gm-wheel-dir-btn.down {
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
}

.gm-wheel-dir-btn.left {
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
}

.gm-wheel-dir-btn.right {
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
}

.gm-wheel-center-angle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.gm-angle-title-img {
  height: 13px;
  object-fit: contain;
  margin-bottom: -2px;
}

.gm-angle-num {
  font-size: 20px;
  font-weight: 900;
  color: #38bdf8;
  text-shadow: 0 2px 4px #000, 0 0 8px rgba(56, 189, 248, 0.8);
}

.gm-jump-satellite-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #38bdf8, #0369a1 75%, #0c4a6e);
  border: 2.5px solid #fef08a;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.7);
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-bottom: 10px;
}

.gm-jump-satellite-btn:hover {
  transform: scale(1.1);
}

.gm-jump-satellite-btn span {
  font-size: 16px;
  line-height: 1;
}

.gm-jump-satellite-btn small {
  font-size: 9px;
  font-weight: 900;
}

/* Chính giữa-dưới: Thanh HP, Thể lực & Thước đo lực 0..100 chuẩn Gunny Mobi */
.gm-bottom-center-bars {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  width: 540px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: rgba(12, 18, 32, 0.62);
  backdrop-filter: blur(3px);
  border: 1.5px solid rgba(250, 204, 21, 0.45);
  border-radius: 14px;
  padding: 6px 12px 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.65);
}

.gm-hp-stamina-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gm-tube-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.gm-tube-label {
  height: 18px;
  object-fit: contain;
}

.gm-tube-track {
  position: relative;
  width: 128px;
  height: 15px;
  background: url('../assets/extracted/battle_hud/hp_ap3.png') no-repeat center center / 100% 100%;
  border-radius: 999px;
  overflow: hidden;
  padding: 2px;
}

.gm-tube-fill.hp {
  height: 100%;
  background: url('../assets/extracted/battle_hud/hp_ap4.png') no-repeat left center / cover;
  border-radius: 999px;
}

.gm-tube-fill.ap {
  height: 100%;
  background: url('../assets/extracted/battle_hud/hp_ap5.png') no-repeat left center / cover;
  border-radius: 999px;
}

.gm-tube-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}

.gm-quick-fire-mini {
  display: flex;
  align-items: center;
  gap: 5px;
}

.gm-numeric-power-label {
  color: #fef3c7;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.gm-quick-fire-mini input[type="number"] {
  box-sizing: border-box;
  width: 64px;
  min-width: 58px;
  min-height: 44px;
  padding: 5px 6px;
  border: 1px solid #d6b35b;
  border-radius: 8px;
  background: #101b2a;
  color: #fff5c4;
  font-family: inherit;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  touch-action: manipulation;
  appearance: textfield;
  -moz-appearance: textfield;
}

.gm-quick-fire-mini input[type="number"]::-webkit-inner-spin-button,
.gm-quick-fire-mini input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.gm-quick-fire-mini input[type="number"]:focus-visible {
  outline: 2px solid #7dd3fc;
  outline-offset: 2px;
}

.gm-mini-fire-btn {
  background: linear-gradient(180deg, #22c55e, #15803d);
  border: 1.5px solid #fef08a;
  color: #fff;
  font-weight: 900;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.gm-power-ruler-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gm-lidu-title {
  height: 20px;
  object-fit: contain;
}

.gm-lidu-track {
  flex: 1;
  height: 30px !important;
  background: rgba(8, 12, 22, 0.92) !important;
  border: 2px solid #94a3b8 !important;
  border-radius: 8px !important;
  position: relative;
  overflow: visible !important;
}

.gm-lidu-fill {
  height: 100% !important;
  background: url('../assets/extracted/battle_hud/lidu_benci.png') no-repeat left center / 500px 100% !important;
  border-radius: 6px;
  transition: width 0.04s linear;
}

.gm-lidu-ruler-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  z-index: 3;
}

.gm-lidu-pin {
  position: absolute;
  top: -8px !important;
  width: 24px !important;
  height: 36px !important;
  background: transparent !important;
  transform: translateX(-50%);
  z-index: 4;
  pointer-events: none;
}

.gm-lidu-pin img {
  width: 24px;
  height: 34px;
  object-fit: contain;
}

.gm-lidu-live-num {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  font-size: 12px;
  font-weight: 900;
  color: #fef08a;
  text-shadow: 0 1px 3px #000;
}

/* Cạnh phải & Góc dưới-phải: Cột Đạo Cụ + Nút POW + Nút BẮN tròn lớn */
.gm-right-combat-cluster {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.gm-props-vertical-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 48px) !important;
  gap: 6px !important;
  background: rgba(15, 23, 42, 0.58);
  border: 1.5px solid rgba(250, 204, 21, 0.45);
  border-radius: 14px;
  padding: 6px;
}

.gm-props-vertical-grid .prop-btn {
  width: 46px !important;
  height: 46px !important;
  background: url('../assets/extracted/battle_hud1/props_box_n.png') no-repeat center center / 100% 100% !important;
  border: none !important;
  padding: 4px !important;
  position: relative;
  cursor: pointer;
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.14s ease;
}

.gm-props-vertical-grid .prop-btn:hover {
  transform: scale(1.12);
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.95));
}

.gm-props-vertical-grid .prop-btn:active {
  transform: scale(0.92);
}

.gm-props-vertical-grid .prop-btn img {
  width: 36px !important;
  height: 36px !important;
  object-fit: contain;
}

.gm-fire-pow-dock {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.gm-pow-orb-btn {
  position: relative;
  width: 78px;
  height: 78px;
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gm-pow-orb-btn:hover {
  transform: scale(1.1);
}

.gm-pow-flame {
  position: absolute;
  width: 88px;
  height: 76px;
  object-fit: contain;
  top: -6px;
  pointer-events: none;
  animation: gmPulseRing 1.4s infinite ease-in-out;
}

.gm-pow-icon {
  position: relative;
  width: 64px;
  height: 64px;
  object-fit: contain;
  z-index: 2;
}

.gm-pow-pct {
  position: absolute;
  bottom: 2px;
  z-index: 3;
  background: rgba(24, 9, 2, 0.9);
  border: 1px solid #facc15;
  border-radius: 999px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 900;
  color: #fef08a;
}

.gm-fire-orb-btn {
  position: relative;
  width: 106px;
  height: 106px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.12s ease;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.75));
}

.gm-fire-orb-btn:hover {
  transform: scale(1.06);
  filter: drop-shadow(0 0 16px rgba(56, 189, 248, 0.95));
}

.gm-fire-orb-btn .fire-img-n,
.gm-fire-orb-btn .fire-img-s {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gm-fire-orb-btn .fire-img-s {
  display: none;
}

.gm-fire-orb-btn:active .fire-img-n,
.gm-fire-orb-btn.charging .fire-img-n {
  display: none;
}

.gm-fire-orb-btn:active .fire-img-s,
.gm-fire-orb-btn.charging .fire-img-s {
  display: block;
  transform: scale(0.95);
}

.gm-turn-pill { max-width: 245px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px !important; }

.gm-equip-box { width: 48px !important; height: 48px !important; }
.gm-equip-col { gap: 6px !important; }

/* ============================================================================
   ROUND 01 UPGRADE: ROLE SELECT (BUG-01), MAINLAND HERO & ENV (BUG-03, BUG-08),
   FIXED BAG SLOTS & ZERO NESTED SCROLL (BUG-04, BUG-07, BUG-10, BUG-11, BUG-13),
   PROMINENT JUMP BUTTON & POW CUT-IN (BUG-15, XIX)
   ============================================================================ */

/* 1. MÀN HÌNH CHỌN GIỚI TÍNH (BUG-01: Nhân vật được chọn phóng to > 1.12, không chọn thu nhỏ & giảm sáng) */
.gender-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin: 22px 12px;
  align-items: center;
}

.gender-card {
  position: relative;
  border: 3px solid #78350f;
  border-radius: 24px;
  padding: 16px 14px 14px;
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
              filter 0.28s ease,
              box-shadow 0.28s ease,
              border-color 0.28s ease,
              opacity 0.28s ease;
}

.gender-card.selected {
  transform: scale(1.13) translateY(-6px) !important;
  border: 4px solid #facc15 !important;
  background: radial-gradient(circle at 50% 42%, rgba(250, 204, 21, 0.45), rgba(120, 53, 15, 0.96) 65%, rgba(36, 14, 4, 0.98)) !important;
  box-shadow: 0 0 36px rgba(250, 204, 21, 0.85), 0 16px 32px rgba(0, 0, 0, 0.8), inset 0 0 22px rgba(250, 204, 21, 0.35) !important;
  filter: brightness(1.08) saturate(1.12);
  opacity: 1;
  z-index: 5;
}

.gender-card.unselected {
  transform: scale(0.88) translateY(6px) !important;
  border-color: #451a03 !important;
  background: radial-gradient(circle at center, rgba(67, 26, 5, 0.45), rgba(18, 7, 2, 0.92)) !important;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.6) !important;
  filter: brightness(0.55) saturate(0.72);
  opacity: 0.76;
  z-index: 1;
}

.gender-card.unselected:hover {
  filter: brightness(0.78) saturate(0.9);
  opacity: 0.9;
}

.gender-selected-pill {
  display: none;
  background: linear-gradient(90deg, #dc2626, #f59e0b, #dc2626);
  border: 2px solid #fef08a;
  color: #ffffff;
  font-weight: 900;
  font-size: 11px;
  padding: 3px 12px;
  border-radius: 999px;
  margin-bottom: 6px;
  text-shadow: 0 1px 2px #000;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.85);
  animation: gmPulseRing 1.5s infinite ease-in-out;
}

.gender-card.selected .gender-selected-pill {
  display: inline-block;
}

.gender-stage-wrap {
  position: relative;
  width: 210px;
  height: 215px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.char-art-backdrop {
  position: absolute;
  right: -6px;
  top: 6px;
  height: 118px;
  width: auto;
  object-fit: contain;
  opacity: 0.32;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.65));
}

.gender-card.selected .char-art-backdrop {
  opacity: 0.46;
}

.role-live-canvas {
  position: relative;
  z-index: 2;
  width: 200px;
  height: 215px;
}

.gender-card-title {
  font-weight: 900;
  font-size: 16px;
  color: #fef08a;
  margin-top: 4px;
  text-shadow: 0 2px 3px #000;
}

.gender-card-desc {
  font-size: 11px;
  color: #fed7aa;
  margin-top: 3px;
}

@keyframes gmDiceSpin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.18); }
  100% { transform: rotate(360deg) scale(1); }
}

.dice-rolling {
  animation: gmDiceSpin 0.36s ease-out;
}

/* 2. SẢNH CHÍNH: CANVAS MÔI TRƯỜNG & BỆ ĐỨNG NHÂN VẬT ĐỒNG BỘ (BUG-08) */
.mainland-env-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.mainland-hero-showcase {
  position: absolute !important;
  transform: translate(-50%, -62%) !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 14;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
}

.mainland-hero-showcase:hover {
  transform: translate(-50%, -65%) scale(1.06) !important;
  filter: drop-shadow(0 0 14px rgba(250, 204, 21, 0.95));
}

#mainland-hero-canvas {
  width: 175px;
  height: 175px;
  pointer-events: none;
}

.mainland-hero-tag {
  margin-top: -12px;
  background: linear-gradient(90deg, rgba(69, 26, 3, 0.92), rgba(146, 64, 14, 0.95), rgba(69, 26, 3, 0.92));
  border: 1.5px solid #facc15;
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 11px;
  font-weight: 900;
  color: #fef08a;
  text-shadow: 0 1px 2px #000;
  box-shadow: 0 3px 8px rgba(0,0,0,0.75);
  white-space: nowrap;
}

/* Túi dùng một vùng cuộn tự nhiên; không cắt mất kho hoặc hàng thao tác khi cửa sổ thấp. */
.window-body.bag-no-scroll {
  overflow: auto !important;
  padding: 12px 16px !important;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

.gm-dual-bag-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 12px;
  align-items: stretch;
  height: 100%;
  min-height: 0;
}

.gm-dollhouse-card {
  padding: 10px 12px !important;
  min-height: 0;
}

.gm-dollhouse-Arena {
  display: grid;
  grid-template-columns: 58px 1fr 58px;
  gap: 6px;
  align-items: center;
  margin: 4px 0;
}

.gm-equip-col {
  display: flex;
  flex-direction: column;
  gap: 6px !important;
  align-items: center;
}

/* Slot trang bị cố định tuyệt đối 54x54px, icon luôn căn tâm, nhãn +Lv nằm góc riêng (BUG-07, BUG-10) */
.gm-equip-box {
  width: 54px !important;
  height: 54px !important;
  min-width: 54px !important;
  max-width: 54px !important;
  min-height: 54px !important;
  max-height: 54px !important;
  box-sizing: border-box !important;
  padding: 0 !important;
  margin: 0 !important;
  position: relative !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.gm-equip-box img.slot-icon {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 38px !important;
  height: 38px !important;
  max-width: 38px !important;
  max-height: 38px !important;
  object-fit: contain !important;
  pointer-events: none !important;
  margin: 0 !important;
}

.gm-equip-box .slot-str {
  position: absolute !important;
  top: 2px !important;
  right: 2px !important;
  left: auto !important;
  z-index: 4 !important;
  background: rgba(220, 38, 38, 0.94) !important;
  border: 1px solid #fde047 !important;
  border-radius: 5px !important;
  padding: 0 3px !important;
  font-size: 9px !important;
  line-height: 1.15 !important;
  font-weight: 900 !important;
  color: #fef08a !important;
  pointer-events: none !important;
}

.gm-equip-box .slot-Sub-label {
  position: absolute !important;
  bottom: 1px !important;
  left: 2px !important;
  right: 2px !important;
  font-size: 8px !important;
  color: rgba(254, 243, 199, 0.85) !important;
  text-align: center !important;
  text-shadow: 0 1px 2px #000 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

/* Slot trong lưới túi đồ cũng cố định 72x72px, icon căn giữa tuyệt đối */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  grid-auto-rows: 68px;
  gap: 8px;
  padding: 4px;
}

.item-slot {
  width: 100%;
  height: 68px !important;
  min-height: 68px !important;
  max-height: 68px !important;
  position: relative !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.item-slot img.slot-icon {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 44px !important;
  height: 44px !important;
  object-fit: contain !important;
  pointer-events: none !important;
}

.gm-bag-right-card {
  padding: 10px 12px !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px !important;
  min-height: 0;
  overflow: hidden;
}

.gm-bag-grid-with-vtabs {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
  align-items: stretch;
}

.gm-bag-grid-with-vtabs .item-grid {
  height: 100%;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
}

.gm-bag-tips-box {
  flex-shrink: 0;
  background: rgba(16, 6, 2, 0.94);
  border: 2px solid #facc15;
  border-radius: 14px;
  padding: 8px 12px;
}

/* 4. NÚT NHẢY CHIẾN ĐẤU NỔI BẬT & HIỆU ỨNG POW CUT-IN / TIỆM RÈN (BUG-15, XIX) */
.gm-jump-satellite-btn {
  width: 64px !important;
  height: 64px !important;
  border-radius: 50% !important;
  background: radial-gradient(circle at 35% 30%, #38bdf8, #0284c7 65%, #0c4a6e) !important;
  border: 3px solid #facc15 !important;
  color: #ffffff !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 1px !important;
  cursor: pointer !important;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.75), 0 4px 10px rgba(0,0,0,0.8) !important;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.16s ease !important;
  margin-bottom: 12px !important;
}

.gm-jump-satellite-btn:hover {
  transform: scale(1.12) translateY(-2px) !important;
  filter: brightness(1.15) drop-shadow(0 0 12px #facc15) !important;
}

.gm-jump-satellite-btn:active {
  transform: scale(0.92) !important;
}

.gm-jump-satellite-btn small {
  font-size: 9px !important;
  font-weight: 900 !important;
  color: #fef08a !important;
  text-shadow: 0 1px 2px #000 !important;
}

.gm-turn-pill {
  max-width: 340px !important;
  white-space: normal !important;
  line-height: 1.3 !important;
}

/* Banner hoạt ảnh Đập Búa / Cường Hóa trong Tiệm Rèn */
.gm-smithy-fx-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 150;
  pointer-events: none;
  animation: gmSmithyFxPop 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.gm-smithy-fx-inner {
  background: radial-gradient(circle, rgba(120, 53, 15, 0.96), rgba(24, 9, 2, 0.98));
  border: 3px solid #facc15;
  border-radius: 22px;
  padding: 14px 28px;
  text-align: center;
  box-shadow: 0 0 40px rgba(250, 204, 21, 0.85), 0 12px 30px rgba(0,0,0,0.85);
}

.gm-smithy-fx-banner.fail .gm-smithy-fx-inner {
  border-color: #f87171;
  box-shadow: 0 0 36px rgba(239, 68, 68, 0.8);
}

.gm-smithy-fx-hammer {
  font-size: 36px;
  animation: gmHammerStrike 0.45s ease-out;
}

.gm-smithy-fx-text {
  font-size: 18px;
  font-weight: 900;
  color: #fef08a;
  text-shadow: 0 2px 4px #000;
  margin-top: 4px;
}

@keyframes gmHammerStrike {
  0% { transform: rotate(-45deg) scale(0.7); }
  50% { transform: rotate(20deg) scale(1.25); }
  100% { transform: rotate(0deg) scale(1); }
}

@keyframes gmSmithyFxPop {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.75); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(0.92); }
}

/* Cut-in Tuyệt Kỹ POW trong Chiến Đấu */
.gm-pow-cutin-overlay {
  position: absolute;
  top: 24%;
  left: 0;
  right: 0;
  z-index: 80;
  pointer-events: none;
  display: flex;
  justify-content: center;
  animation: gmPowCutinSlide 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.gm-pow-cutin-strip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(90deg, transparent 0%, rgba(153, 27, 27, 0.94) 18%, rgba(234, 88, 12, 0.96) 50%, rgba(153, 27, 27, 0.94) 82%, transparent 100%);
  border-top: 3px solid #fef08a;
  border-bottom: 3px solid #fef08a;
  padding: 10px 64px;
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.85);
}

.gm-pow-cutin-flame {
  width: 72px;
  height: 64px;
  object-fit: contain;
}

.gm-pow-cutin-badge {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px #facc15);
}

.gm-pow-cutin-sub {
  font-size: 12px;
  font-weight: 900;
  color: #fde68a;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px #000;
}

.gm-pow-cutin-main {
  font-size: 24px;
  font-weight: 900;
  color: #fef08a;
  text-shadow: 0 2px 4px #000, 0 0 14px #ef4444;
}

@keyframes gmPowCutinSlide {
  0% { opacity: 0; transform: translateX(-120px) scale(0.9); }
  18% { opacity: 1; transform: translateX(0) scale(1.04); }
  80% { opacity: 1; transform: translateX(0) scale(1); }
  100% { opacity: 0; transform: translateX(120px) scale(0.95); }
}

/* 5. ĐÁP ỨNG ĐA ĐỘ PHÂN GIẢI: 1920x1080, 1366x768, 1280x720 & CỬA SỔ NHỎ (BUG-13) */
@media (max-height: 780px) {
  .gunny-window {
    max-height: 94vh !important;
  }
  .window-header {
    padding: 8px 16px !important;
  }
  .gm-bag-grid-with-vtabs .item-grid {
    max-height: 195px !important;
  }
  .role-select-stage {
    padding: 16px 24px !important;
  }
  .gender-stage-wrap {
    height: 185px !important;
  }
  .role-live-canvas {
    height: 185px !important;
  }
}

@media (max-width: 1100px) {
  .gm-dual-bag-layout {
    grid-template-columns: 310px 1fr;
    gap: 10px;
  }
  .gm-bottom-center-bars {
    width: 460px;
  }
}

/* Visual Polish Pass after Screenshot Inspection */
.gender-cards-row {
  margin: 28px 18px 20px !important;
}
.gender-card.selected {
  transform: scale(1.11) translateY(-2px) !important;
}
.gm-vertical-tabs {
  gap: 4px !important;
}
.gm-vtab-btn {
  padding: 5px 5px !important;
  font-size: 11px !important;
}
.gm-turn-pill {
  max-width: 222px !important;
  font-size: 10px !important;
  padding: 3px 10px !important;
}

.gm-vertical-tabs {
  gap: 3px !important;
  max-height: 215px !important;
}
.gm-vtab-btn {
  padding: 3px 4px !important;
  font-size: 10px !important;
}

/* Clean Equipment Slot Frame without Padlock Graphic Overlap (v3.2.0) */
.gm-equip-box {
  background: radial-gradient(circle at 50% 45%, #451a03 0%, #1c0a02 100%) !important;
  border: 2px solid #f59e0b !important;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.85), 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}
.gm-equip-box .eq-slot-hint {
  font-size: 10px !important;
  color: #fde68a !important;
  font-weight: 800 !important;
  text-shadow: 0 1px 2px #000 !important;
  padding: 2px !important;
  line-height: 1.15 !important;
}


/* ============================================================================
   ROUND 02 DEEP UI REWORK:
   - BUG-17: SẢNH CHÍNH ĐA TẦNG CHIỀU SÂU & RESPONSIVE MOBILE NGANG / ĐA ĐỘ PHÂN GIẢI
   - BUG-18: HỆ THỐNG KHUNG GIAO DIỆN ĐẶC TRƯNG TỪNG CỬA SỔ CHẤT GUNNY MOBI
   - BUG-19 & BUG-20: KHUNG DOLLHOUSE 10 Ô TRANG BỊ ĐỘC LẬP (TÁCH RIÊNG TÓC, CÁNH & BỘ THỜI TRANG)
   ============================================================================ */

:root {
  --building-scale: 1;
  --ui-scale: 1;
}

/* 1. KÍCH THƯỚC CÔNG TRÌNH THEO TỶ LỆ --building-scale & PHÂN TẦNG Z-INDEX (BUG-17) */
.building-hotspot {
  transform: translate(-50%, -50%) scale(var(--building-scale, 1));
  transform-origin: center center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
}

.building-hotspot:hover {
  transform: translate(-50%, -53%) scale(calc(var(--building-scale, 1) * 1.08)) !important;
  filter: drop-shadow(0 0 18px rgba(250, 204, 21, 0.95));
  z-index: 42 !important;
}

.building-hotspot .b-building-img {
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.b-size-arena      { width: 205px; height: 165px; }
.b-size-smithy     { width: 162px; height: 118px; }
.b-size-expedition { width: 196px; height: 154px; }
.b-size-ranking    { width: 136px; height: 120px; }
.b-size-waterfall  { width: 116px; height: 116px; }
.b-size-tower      { width: 106px; height: 132px; }
.b-size-shop       { width: 138px; height: 142px; }
.b-size-pet        { width: 142px; height: 128px; }
.b-size-mount      { width: 146px; height: 114px; }
.b-size-airship    { width: 96px;  height: 128px; }

.building-hotspot .b-nameplate-img {
  height: 25px;
  max-width: 128px;
  width: auto;
  object-fit: contain;
  margin-top: -12px;
  pointer-events: none;
  position: relative;
  z-index: 35;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.92));
}

/* Thứ tự lớp HUD Sảnh chính luôn nằm trên Công trình (z-index: 50) và dưới Modal (z-index: 100) */
.gm-top-left-hud,
.gm-top-right-hud,
.gm-left-sidebar,
.mainland-bottom-dock {
  z-index: 50 !important;
  transform-origin: var(--hud-origin, top left);
}

.gm-top-left-hud { --hud-origin: top left; transform: scale(var(--ui-scale, 1)); }
.gm-top-right-hud { --hud-origin: top right; transform: scale(var(--ui-scale, 1)); }
.gm-left-sidebar { --hud-origin: left center; transform: translateY(-50%) scale(var(--ui-scale, 1)) !important; }
.mainland-bottom-dock { --hud-origin: bottom right; transform: scale(var(--ui-scale, 1)); }

.modal-backdrop {
  z-index: 100 !important;
}

/* Keep every existing dialog inside the screen's camera and gesture safe areas. */
#modal-overlay.modal-backdrop {
  box-sizing: border-box;
  padding: calc(8px + env(safe-area-inset-top, 0px)) calc(8px + env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) calc(8px + env(safe-area-inset-left, 0px));
}
#modal-overlay .gunny-window {
  min-width: 0;
  max-width: calc(100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 16px);
  max-height: calc(var(--game-viewport-height, 100dvh) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 16px);
}

/* 2. RESPONSIVE CHO MOBILE NGANG (844x390, 800x360, 667x375) & MÀN HÌNH THẤP (BUG-17) */
@media (max-height: 540px), (max-width: 960px) and (orientation: landscape) {
  :root {
    --building-scale: 0.54;
    --ui-scale: 0.72;
  }

  /* Tách giãn tọa độ các tòa nhà trên màn hình Mobile ngang để KHÔNG BAO GIỜ đè nhau */
  #b-airship-welfare  { left: 16.5% !important; top: 20.5% !important; }
  #b-secret-waterfall { left: 36.5% !important; top: 23.0% !important; }
  #b-labyrinth-tower  { left: 52.0% !important; top: 21.5% !important; }
  #b-ranking-hall     { left: 67.5% !important; top: 24.0% !important; }

  #b-smithy           { left: 24.5% !important; top: 44.5% !important; }
  #b-arena-hall       { left: 49.5% !important; top: 44.0% !important; }
  #b-expedition-port  { left: 74.5% !important; top: 46.5% !important; }

  #b-shop-castle      { left: 29.5% !important; top: 69.5% !important; }
  #b-pet-manor        { left: 46.5% !important; top: 75.0% !important; }
  #b-mount-stable     { left: 63.5% !important; top: 72.0% !important; }

  /* Thu gọn Modal & HUD Chiến đấu trên Mobile ngang */
  .gunny-window {
    width: 96vw !important;
    max-width: 96vw !important;
    max-height: 94vh !important;
    border-radius: 18px !important;
  }
  .window-header {
    padding: 5px 12px !important;
  }
  .window-title {
    font-size: 14px !important;
  }
  .window-body {
    padding: 8px 10px !important;
  }
  .gm-dual-bag-layout {
    grid-template-columns: 270px 1fr !important;
    gap: 8px !important;
  }
  .gm-steering-wheel-zone {
    transform: scale(0.72);
    transform-origin: bottom left;
    left: 8px !important;
    bottom: 6px !important;
  }
  .gm-bottom-center-bars {
    transform: translateX(-50%) scale(0.74) !important;
    transform-origin: bottom center;
    bottom: 4px !important;
  }
  .gm-right-combat-cluster {
    transform: scale(0.72);
    transform-origin: bottom right;
    right: 8px !important;
    bottom: 6px !important;
  }
  .gm-battle-top-center {
    transform: translateX(-50%) scale(0.76) !important;
    transform-origin: top center;
  }
  .gm-battle-top-left {
    transform: scale(0.76);
    transform-origin: top left;
  }
  .gm-battle-top-right {
    transform: scale(0.76);
    transform-origin: top right;
  }
}

/* 3. HỆ THỐNG KHUNG CỬA SỔ ĐẶC TRƯNG CHẤT GUNNY MOBI (BUG-18) */
.gunny-window {
  position: relative;
  border: 4px solid #facc15;
  border-radius: 26px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.88),
              0 0 0 3px #451a03,
              inset 0 0 24px rgba(250, 204, 21, 0.22);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.window-header {
  position: relative;
  background: linear-gradient(180deg, #b45309 0%, #78350f 48%, #451a03 100%);
  border-bottom: 3px solid #facc15;
  box-shadow: inset 0 2px 0 rgba(254, 240, 138, 0.65), 0 4px 10px rgba(0, 0, 0, 0.55);
}

.window-header-ornament {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(254, 240, 138, 0.35), transparent 68%);
  pointer-events: none;
}

/* Phân hóa màu sắc & chất liệu khung theo từng cửa sổ chức năng (BUG-18) */
.gunny-window[data-modal-theme="modal-bag"],
.gunny-window[data-modal-theme="modal-character"] {
  background: radial-gradient(circle at 25% 20%, rgba(120, 53, 15, 0.96), rgba(38, 15, 4, 0.98) 70%);
  border-color: #fbbf24;
}

.gunny-window[data-modal-theme="modal-smithy"] {
  background: linear-gradient(180deg, rgba(69, 26, 3, 0.97), rgba(24, 9, 2, 0.99));
  border-color: #f97316;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.9), 0 0 28px rgba(249, 115, 22, 0.38);
}
.gunny-window[data-modal-theme="modal-smithy"] .window-header {
  background: linear-gradient(180deg, #ea580c 0%, #9a3412 52%, #431407 100%);
}

.gunny-window[data-modal-theme="modal-dungeon"] {
  background: linear-gradient(180deg, rgba(20, 42, 22, 0.96), rgba(10, 22, 12, 0.98));
  border-color: #4ade80;
}
.gunny-window[data-modal-theme="modal-dungeon"] .window-header {
  background: linear-gradient(180deg, #15803d 0%, #166534 55%, #052e16 100%);
}

.gunny-window[data-modal-theme="modal-arena"] {
  background: linear-gradient(180deg, rgba(69, 10, 10, 0.96), rgba(24, 6, 6, 0.99));
  border-color: #f87171;
}
.gunny-window[data-modal-theme="modal-arena"] .window-header {
  background: linear-gradient(180deg, #dc2626 0%, #991b1b 55%, #450a0a 100%);
}

.gunny-window[data-modal-theme="modal-pet"],
.gunny-window[data-modal-theme="modal-mount"] {
  background: linear-gradient(180deg, rgba(59, 33, 12, 0.96), rgba(23, 12, 4, 0.98));
  border-color: #a3e635;
}

.gunny-window[data-modal-theme="modal-shop"],
.gunny-window[data-modal-theme="modal-activity"] {
  background: radial-gradient(circle at 50% 0%, rgba(146, 64, 14, 0.96), rgba(30, 11, 3, 0.99) 75%);
  border-color: #fde047;
}

/* Trạng thái nút bấm chuẩn 4 state: normal, hover, active, disabled (BUG-18) */
.gunny-btn:disabled,
.gunny-btn.disabled {
  filter: grayscale(0.85) brightness(0.7) !important;
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: 0 2px 0 #27272a !important;
}

/* Phẩm chất ô vật phẩm 5 bậc chuẩn Gunny Mobi (Q1 Trắng/Xám -> Q2 Lục -> Q3 Lam -> Q4 Tím -> Q5 Hoàng Kim) */
.item-slot.q-1, .gm-equip-box.q-1 { border-color: #94a3b8 !important; }
.item-slot.q-2, .gm-equip-box.q-2 { border-color: #4ade80 !important; box-shadow: inset 0 0 8px rgba(74, 222, 128, 0.25) !important; }
.item-slot.q-3, .gm-equip-box.q-3 { border-color: #38bdf8 !important; box-shadow: inset 0 0 10px rgba(56, 189, 248, 0.32) !important; }
.item-slot.q-4, .gm-equip-box.q-4 { border-color: #c084fc !important; box-shadow: inset 0 0 12px rgba(192, 132, 252, 0.42) !important; }
.item-slot.q-5, .gm-equip-box.q-5 {
  border-color: #facc15 !important;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.55), inset 0 0 14px rgba(250, 204, 21, 0.45) !important;
}

.item-slot.selected, .gm-equip-box.selected-slot {
  outline: 3px solid #4ade80 !important;
  outline-offset: -1px;
  transform: scale(1.04);
  z-index: 6;
}

/* 4. KHUNG DOLLHOUSE 10 SLOT TRANG BỊ (5 TRÁI + 5 PHẢI BAO QUANH NHÂN VẬT - BUG-19 & BUG-20) */
.gm-dollhouse-Arena.ten-slots {
  display: grid;
  grid-template-columns: 50px 1fr 50px;
  gap: 5px;
  align-items: center;
  margin: 4px 0;
}

.gm-dollhouse-Arena.ten-slots .gm-equip-col {
  display: flex;
  flex-direction: column;
  gap: 4px !important;
  align-items: center;
}

.gm-dollhouse-Arena.ten-slots .gm-equip-box {
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  max-width: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;
  border-radius: 10px !important;
  cursor: pointer !important;
}

.gm-dollhouse-Arena.ten-slots .gm-equip-box img.slot-icon {
  width: 34px !important;
  height: 34px !important;
  max-width: 34px !important;
  max-height: 34px !important;
}

.gm-dollhouse-Arena.ten-slots .gm-equip-box .eq-slot-hint {
  font-size: 9px !important;
}


/* ============================================================================
   ROUND 02 VISUAL POLISH: OVERRIDE !IMPORTANT TRANSFORM ON BUILDING HOTSPOTS & SIDEBAR
   ============================================================================ */
#screen-mainland .building-hotspot {
  transform: translate(-50%, -50%) scale(var(--building-scale, 1)) !important;
  transform-origin: center center !important;
}

#screen-mainland .building-hotspot:hover {
  transform: translate(-50%, -53%) scale(calc(var(--building-scale, 1) * 1.08)) !important;
  z-index: 45 !important;
}

/* Đẩy cột icon bên trái xuống dưới dải Lực Chiến để không bao giờ chạm Avatar HUD */
.gm-left-sidebar {
  top: 58% !important;
  left: calc(14px + env(safe-area-inset-left, 0px)) !important;
  transform: translateY(-50%) scale(var(--ui-scale, 1)) !important;
  transform-origin: left center !important;
}

/* Tinh chỉnh vị trí 10 tòa nhà trên PC để khoảng cách thoáng đãng như bản gốc Gunny Mobi */
#b-airship-welfare  { left: 17.5% !important; top: 22.0% !important; z-index: 11 !important; }
#b-secret-waterfall { left: 36.5% !important; top: 24.0% !important; z-index: 13 !important; }
#b-labyrinth-tower  { left: 51.5% !important; top: 18.5% !important; z-index: 12 !important; }
#b-ranking-hall     { left: 66.5% !important; top: 24.5% !important; z-index: 14 !important; }

#b-smithy           { left: 25.5% !important; top: 43.5% !important; z-index: 21 !important; }
#b-arena-hall       { left: 49.5% !important; top: 44.5% !important; z-index: 22 !important; }
#b-expedition-port  { left: 73.0% !important; top: 47.0% !important; z-index: 23 !important; }

#b-shop-castle      { left: 30.5% !important; top: 67.5% !important; z-index: 31 !important; }
#b-pet-manor        { left: 46.5% !important; top: 74.5% !important; z-index: 33 !important; }
#b-mount-stable     { left: 62.5% !important; top: 71.0% !important; z-index: 32 !important; }

@media (max-height: 540px), (max-width: 960px) and (orientation: landscape) {
  .gm-left-sidebar {
    --sidebar-top: calc(env(safe-area-inset-top, 0px) + 16px + 124px * var(--ui-scale, 1));
    top: var(--sidebar-top) !important;
    left: calc(8px + env(safe-area-inset-left, 0px)) !important;
    transform: scale(var(--ui-scale, 1)) !important;
    transform-origin: top left !important;
    max-height: max(72px, calc((var(--game-viewport-height, 100dvh) - var(--sidebar-top) - env(safe-area-inset-bottom, 0px) - 8px) / var(--ui-scale, 1)));
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    touch-action: pan-y;
    scrollbar-width: thin;
  }
}


/* === ROUND 03 AUTHENTIC GUNNY PC & MOBI UI ENHANCEMENTS === */
.gm-turn-order-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 3px;
  background: rgba(15, 6, 2, 0.84);
  border: 1px solid #f59e0b;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  color: #fef08a;
  white-space: nowrap;
  pointer-events: auto;
}
.turn-order-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 10px;
}
.turn-order-chip.ally {
  background: rgba(22, 163, 74, 0.35);
  border: 1px solid #4ade80;
  color: #bbf7d0;
}
.turn-order-chip.enemy {
  background: rgba(220, 38, 38, 0.35);
  border: 1px solid #f87171;
  color: #fecaca;
}
.turn-order-chip.active-now {
  box-shadow: 0 0 8px #facc15;
  border-color: #facc15;
  color: #fef08a;
}

.gm-props-vertical-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  background: rgba(15, 6, 2, 0.78);
  border: 1.5px solid #b45309;
  border-radius: 12px;
  padding: 6px;
  max-height: 360px;
}
.gm-props-group-label {
  font-size: 9px;
  font-weight: 900;
  color: #facc15;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: center;
  margin: 1px 0;
}
.gm-props-subgrid {
  display: grid;
  grid-template-columns: repeat(4, 38px);
  gap: 4px;
  justify-content: center;
}
.prop-btn {
  position: relative;
  width: 38px !important;
  height: 38px !important;
  padding: 2px !important;
  border-radius: 8px !important;
  border: 1.5px solid #d97706 !important;
  background: radial-gradient(circle, #451a03, #1c0a02) !important;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.prop-btn:hover {
  transform: scale(1.08);
  border-color: #fef08a !important;
}
.prop-btn.used-prop {
  border-color: #4ade80 !important;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.9) !important;
}
.prop-btn.disabled-prop {
  opacity: 0.58;
  border-color: #475569 !important;
}
.prop-btn img {
  width: 30px !important;
  height: 30px !important;
  object-fit: contain;
}
.prop-hotkey-tag {
  position: absolute;
  top: -3px;
  left: -3px;
  background: #0f172a;
  color: #fde047;
  border: 1px solid #f59e0b;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 900;
  padding: 0 3px;
  line-height: 11px;
}
.prop-cost-tag {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: rgba(2, 132, 199, 0.92);
  color: #fff;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 800;
  padding: 0 3px;
  line-height: 11px;
}

.gm-pet-skill-orb-btn {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2.5px solid #38bdf8;
  background: radial-gradient(circle, #0c4a6e, #082f49);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.75);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.gm-pet-skill-orb-btn.pet-ready {
  border-color: #4ade80;
  box-shadow: 0 0 14px rgba(74, 222, 128, 0.88);
  animation: pulsePetOrb 1.4s infinite alternate;
}
@keyframes pulsePetOrb {
  from { transform: scale(1); }
  to { transform: scale(1.07); }
}
.gm-pet-skill-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 50%;
}
.gm-pet-mp-tag {
  position: absolute;
  bottom: -5px;
  background: #0f172a;
  border: 1px solid #38bdf8;
  color: #7dd3fc;
  font-size: 9px;
  font-weight: 900;
  padding: 0 5px;
  border-radius: 999px;
}

.gunny-window[data-modal-theme="modal-guild"] {
  border-color: #38bdf8 !important;
  box-shadow: 0 18px 48px rgba(2, 132, 199, 0.45) !important;
}
.gunny-window[data-modal-theme="modal-marry"] {
  border-color: #f472b6 !important;
  box-shadow: 0 18px 48px rgba(236, 72, 153, 0.45) !important;
}

.gm-battle-top-left {
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 4px !important;
  max-width: 210px !important;
}
.gm-turn-pill {
  max-width: 205px !important;
  font-size: 11px !important;
  padding: 4px 8px !important;
}


/* ============================================================================
   ROUND 06 (v3.8.0): AUTHENTIC GUNNY UI FRAMES, BOXES, POPUPS, BUTTONS & BATTLE HUD
   Sử dụng trực tiếp các texture khung gỗ-vàng-da thuộc nguyên bản từ APK Gunny Mobi:
   - Cửa sổ chính: assets/ui/public/bg/dk-qpbk-2/dk-qp1.png & qfjl_01.png
   - Dải tiêu đề: assets/ui/public/bg/rj43.png
   - Nút Đóng [X] 3D: assets/ui/public/button/guanbi-1.png & guanbi-2.png
   - Khung Ô Vật Phẩm / Trang Bị: assets/extracted/ui_bag/bag_gezl-bb-1.png & bag_gezl-bb-2.png & jgg-47.png
   - Khung Bục Nhân Vật (Dollhouse): assets/extracted/ui_personal/personalnfo_SJ-8.png
   - Khung Popup / TIPS / Hộp Thoại: assets/ui/public/bg/dljm-dddr-1.png & toast_bg2.png
   ============================================================================ */

/* 1. KHUNG CỬA SỔ CHỨC NĂNG CHÍNH (.gunny-window) & TIÊU ĐỀ (.window-header) */
.gunny-window {
  background-image:
    linear-gradient(180deg, rgba(58, 23, 5, 0.90) 0%, rgba(28, 10, 2, 0.94) 100%),
    url('../assets/ui/public/bg/dk-qpbk-2/dk-qp1.png') !important;
  background-size: 100% 100%, 100% 100% !important;
  background-repeat: no-repeat !important;
  border: 4px solid #facc15 !important;
  border-radius: 24px !important;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.92),
    0 0 0 2px #78350f,
    inset 0 0 24px rgba(250, 204, 21, 0.25) !important;
}

.window-header {
  background-image:
    url('../assets/ui/public/bg/rj43.png'),
    linear-gradient(180deg, #c2410c 0%, #7c2d12 52%, #431407 100%) !important;
  background-size: 76% 92%, 100% 100% !important;
  background-position: center center, center center !important;
  background-repeat: no-repeat !important;
  border-bottom: 3px solid #facc15 !important;
  padding: 10px 18px !important;
}

.window-close-btn {
  width: 54px !important;
  height: 40px !important;
  border: none !important;
  border-radius: 10px !important;
  background: url('../assets/ui/public/button/guanbi-1.png') center / contain no-repeat transparent !important;
  color: transparent !important;
  font-size: 0 !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.window-close-btn:hover {
  filter: brightness(1.15) drop-shadow(0 0 6px #facc15);
  transform: scale(1.06);
}
.window-close-btn:active {
  background-image: url('../assets/ui/public/button/guanbi-2.png') !important;
  transform: scale(0.95);
}

/* 2. KHUNG TAB NGANG (.tab-btn) & TAB DỌC TÚI ĐỒ (.gm-vtab-btn) CHUẨN TEXTURE GUNNY */
.tab-btn {
  background-image:
    linear-gradient(180deg, rgba(92, 40, 11, 0.72), rgba(45, 18, 4, 0.85)),
    url('../assets/extracted/ui_public/jgg-27.png') !important;
  background-size: 100% 100% !important;
  border: 2px solid #b45309 !important;
  border-radius: 12px 12px 6px 6px !important;
  color: #fed7aa !important;
  font-weight: 900 !important;
  padding: 7px 14px !important;
  text-shadow: 0 2px 3px #000 !important;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.55) !important;
}
.tab-btn.active {
  background-image:
    linear-gradient(180deg, rgba(234, 88, 12, 0.55), rgba(154, 52, 18, 0.75)),
    url('../assets/extracted/ui_public/jgg-26.png') !important;
  border-color: #fef08a !important;
  color: #fef08a !important;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.65), inset 0 1px 0 #fff !important;
  transform: translateY(-2px);
}

.gm-vtab-btn {
  background-image:
    linear-gradient(90deg, rgba(69, 26, 3, 0.78), rgba(40, 14, 2, 0.88)),
    url('../assets/extracted/ui_bag/bag_gezl-bb-5.png') !important;
  background-size: 100% 100% !important;
  border: 2px solid #b45309 !important;
}
.gm-vtab-btn.active {
  background-image:
    linear-gradient(90deg, rgba(217, 119, 6, 0.65), rgba(146, 64, 14, 0.82)),
    url('../assets/extracted/ui_bag/bag_gezl-bb-4.png') !important;
  border-color: #fef08a !important;
  color: #fef08a !important;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.65) !important;
}

/* 3. KHUNG BOX Ô VẬT PHẨM, Ô TRANG BỊ & BỤC ĐỨNG NHÂN VẬT CHUẨN GUNNY */
.item-slot,
.bag-item-cell,
.gm-bag-cell,
.gm-equip-box,
.equip-slot-box {
  background-image:
    radial-gradient(circle at center, rgba(69, 26, 3, 0.65), rgba(20, 8, 2, 0.88)),
    url('../assets/extracted/ui_bag/bag_gezl-bb-1.png') !important;
  background-size: 100% 100% !important;
  background-repeat: no-repeat !important;
  border-radius: 12px !important;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.78), 0 3px 6px rgba(0, 0, 0, 0.45) !important;
}

.item-slot.selected,
.bag-item-cell.selected,
.gm-bag-cell.selected,
.gm-equip-box.selected-slot {
  background-image:
    radial-gradient(circle at center, rgba(250, 204, 21, 0.35), rgba(69, 26, 3, 0.85)),
    url('../assets/extracted/ui_bag/bag_gezl-bb-2.png') !important;
  box-shadow: 0 0 14px rgba(74, 222, 128, 0.85), inset 0 0 10px rgba(250, 204, 21, 0.55) !important;
}

#char-modal-canvas,
#bag-dollhouse-canvas {
  background-image:
    radial-gradient(circle at 50% 60%, rgba(250, 204, 21, 0.22), transparent 70%),
    url('../assets/extracted/ui_personal/personalnfo_SJ-8.png') !important;
  background-size: 100% 100%, 92% 96% !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  border-radius: 16px !important;
}

/* 4. KHUNG POPUP / HỘP TIPS / TOAST THÔNG BÁO / TOOLTIP NỔI CHUẨN GUNNY */
.gm-bag-tips-box,
.gm-qhjm-stat-card-cur,
.gm-qhjm-stat-card-next {
  background-image:
    linear-gradient(180deg, rgba(43, 17, 4, 0.90), rgba(22, 8, 2, 0.95)),
    url('../assets/ui/public/bg/dljm-dddr-1.png') !important;
  background-size: 100% 100% !important;
  border: 2px solid #f59e0b !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.72), inset 0 0 14px rgba(250, 204, 21, 0.18) !important;
}

#toast-container .toast-msg,
.gunny-toast,
.toast-item {
  background-image:
    linear-gradient(90deg, rgba(28, 10, 2, 0.82), rgba(92, 40, 11, 0.88), rgba(28, 10, 2, 0.82)),
    url('../assets/ui/public/other/toast_bg2.png') !important;
  background-size: 100% 100% !important;
  border: 2px solid #facc15 !important;
  border-radius: 999px !important;
  padding: 9px 26px !important;
  color: #fef08a !important;
  font-weight: 900 !important;
  text-shadow: 0 2px 4px #000 !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.85), 0 0 16px rgba(250, 204, 21, 0.45) !important;
}

#toast-container .gunny-toast {
  border-width: 1px !important;
  border-radius: 10px !important;
  padding: 6px 12px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

/* Khung Popup Tooltip Chi Tiết Vật Phẩm Nổi (#gm-item-popup-tooltip) */
.gm-item-popup-tooltip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  width: 286px;
  background-image:
    linear-gradient(180deg, rgba(35, 13, 3, 0.96), rgba(16, 6, 1, 0.98)),
    url('../assets/ui/public/bg/dljm-dddr-1.png');
  background-size: 100% 100%;
  border: 2.5px solid #facc15;
  border-radius: 16px;
  padding: 12px 14px;
  color: #fef3c7;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.92), 0 0 18px rgba(250, 204, 21, 0.42);
  transition: opacity 0.12s ease;
}
.gm-item-popup-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  background: url('../assets/ui/public/other/text-line.png') bottom center / 100% 2px no-repeat;
}
.gm-item-popup-icon-box {
  position: relative;
  width: 54px;
  height: 54px;
  background: url('../assets/extracted/ui_bag/bag_gezl-bb-2.png') center / 100% 100% no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.gm-item-popup-icon-box img.main-ic {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.gm-item-popup-icon-box img.str-badge {
  position: absolute;
  bottom: -5px;
  right: -4px;
  height: 18px;
}

/* 5. THANH MÁU BOSS ĐỈNH MÀN HÌNH (#battle-boss-hud-bar) CHUẨN GUNNY PC & MOBI */
.gm-boss-top-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 4px 12px 4px 6px;
  background:
    linear-gradient(90deg, rgba(69, 10, 10, 0.92), rgba(28, 6, 6, 0.94)),
    url('../assets/extracted/battle_hud1/boss_hp_bg.png') center / 100% 100% no-repeat;
  border: 2px solid #facc15;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.85), 0 0 14px rgba(239, 68, 68, 0.55);
  min-width: 320px;
  pointer-events: none;
}
.gm-boss-avatar-wrap {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #facc15;
  background: #450a0a;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.gm-boss-avatar-wrap img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.gm-boss-hp-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gm-boss-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 900;
}
.gm-boss-name-txt {
  color: #fef08a;
  text-shadow: 0 1px 3px #000;
}
.gm-boss-hp-digits {
  color: #fca5a5;
  font-size: 10px;
}
.gm-boss-hp-track {
  width: 100%;
  height: 11px;
  background: rgba(0, 0, 0, 0.78);
  border: 1px solid #f59e0b;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.gm-boss-hp-fill {
  height: 100%;
  background:
    url('../assets/extracted/battle_hud1/boss_hp.png') left center / cover no-repeat,
    linear-gradient(90deg, #ef4444, #f97316, #facc15);
  transition: width 0.22s ease;
}
.gm-boss-layer-pill {
  background: #991b1b;
  border: 1.5px solid #fde047;
  color: #fef08a;
  font-weight: 900;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  text-shadow: 0 1px 2px #000;
}

/* 6. ĐỒNG HỒ ĐẾM NGƯỢC BITMAP GIỮA MÀN HÌNH (#battle-center-countdown) & BĂNG RÔN LƯỢT (#battle-turn-banner) */
.gm-center-countdown {
  position: absolute;
  top: 122px;
  left: 50%;
  transform: translateX(-50%);
  width: 86px;
  height: 86px;
  z-index: 42;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.85));
}
.gm-countdown-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.gm-countdown-digits {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.gm-countdown-digits img {
  height: 36px;
  width: auto;
  object-fit: contain;
}
.gm-center-countdown.urgent {
  animation: pulseCountdownUrgent 0.45s infinite alternate;
}
@keyframes pulseCountdownUrgent {
  from { transform: translateX(-50%) scale(1); filter: drop-shadow(0 0 8px #ef4444); }
  to { transform: translateX(-50%) scale(1.14); filter: drop-shadow(0 0 18px #facc15); }
}

.gm-turn-sweep-banner {
  position: absolute;
  top: 34%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 65;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: max-content;
  max-width: min(320px, calc(100% - 32px));
  padding: 6px 12px;
  background: rgba(38, 17, 8, .94);
  border: 1px solid #c99846;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  animation: phoenixBattleNoticeIn 0.4s ease-out;
  overflow-wrap: anywhere;
}
@keyframes phoenixBattleNoticeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.gm-turn-banner-bg {
  display: none;
}
.gm-turn-banner-arrow {
  height: 24px;
  width: auto;
  object-fit: contain;
}
.gm-turn-banner-content {
  min-width: 0;
  line-height: 1.3;
}
.gm-turn-banner-sub {
  font-size: 12px;
  font-weight: 700;
  color: #fef3c7;
}
.gm-turn-banner-main {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 3px #000;
}

/* 7. Vạch nhớ lực dùng kim chỉ; ảnh lidu_shangci là thanh dài, không phải nhãn. */
.gm-lidu-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  top: -8px !important;
  z-index: 8;
}
.gm-lidu-cur-pin {
  position: absolute;
  bottom: -15px;
  transform: translateX(-50%);
  z-index: 9;
  pointer-events: none;
}
.gm-lidu-cur-pin .gm-lidu-tag-img {
  height: 14px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px #000);
}


/* ==========================================================================
   ROUND 07 (v3.9.0) – CHUẨN HÓA BẢNG MÀU HOÀNG KIM GUNNY, HIỆU ỨNG BÓNG 3D & BẢNG CĂN GÓC-LỰC
   ========================================================================== */
:root {
  --gunny-gold-bright: #fef08a;
  --gunny-gold-main: #facc15;
  --gunny-amber-warm: #f59e0b;
  --gunny-orange-fire: #f97316;
  --gunny-wood-deep: #3b1404;
  --gunny-wood-mid: #5c2208;
  --gunny-wood-warm: #78350f;
}

.gunny-window {
  background:
    linear-gradient(180deg, rgba(92, 34, 8, 0.96) 0%, rgba(59, 20, 4, 0.98) 55%, rgba(41, 13, 2, 0.99) 100%),
    url('../assets/ui/public/bg/dk-qpbk-2/dk-qp1.png') center / 100% 100% no-repeat !important;
  border: 3px solid #facc15 !important;
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.88),
    0 0 26px rgba(250, 204, 21, 0.36),
    inset 0 2px 0 rgba(254, 240, 138, 0.65),
    inset 0 0 22px rgba(245, 158, 11, 0.28) !important;
}

.window-header {
  background:
    linear-gradient(180deg, #dc2626 0%, #991b1b 48%, #6d1008 100%),
    url('../assets/ui/public/bg/rj43.png') center top / 74% 100% no-repeat !important;
  border-bottom: 2.5px solid #facc15 !important;
  box-shadow: inset 0 2px 3px rgba(254, 240, 138, 0.55), 0 4px 12px rgba(0, 0, 0, 0.65) !important;
}

.window-header h2, .window-header h3 {
  color: #fef08a !important;
  text-shadow: 0 2px 0 #78350f, 0 0 12px rgba(250, 204, 21, 0.75) !important;
  letter-spacing: 0.4px;
}

/* Nút bấm 3D bóng kính (Candy / Jelly Gloss) chuẩn Gunny Mobi & PC */
.btn-gunny, .bag-action-btn, .smithy-fire-btn {
  position: relative;
  overflow: hidden;
  border: 2px solid #fef08a !important;
  box-shadow:
    0 5px 12px rgba(0, 0, 0, 0.65),
    inset 0 2px 2px rgba(255, 255, 255, 0.55),
    inset 0 -3px 6px rgba(0, 0, 0, 0.35) !important;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.85) !important;
  transition: transform 0.14s ease, filter 0.14s ease !important;
}
.btn-gunny:hover, .bag-action-btn:hover, .smithy-fire-btn:hover {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.12) saturate(1.15);
}

/* Bảng Công Thức Bắn Gợi Ý Chuẩn Gunny trên Đỉnh Màn Hình Chiến Đấu (#battle-formula-helper) */
.gm-formula-helper-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
  padding: 4px 10px;
  background: linear-gradient(180deg, rgba(69, 26, 3, 0.94), rgba(38, 12, 2, 0.96));
  border: 1.5px solid #facc15;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.82), inset 0 1px 0 rgba(254, 240, 138, 0.45);
  pointer-events: auto;
  z-index: 48;
}
.gm-formula-dist-badge {
  font-size: 11px;
  font-weight: 900;
  color: #fef08a;
  padding: 2px 8px;
  background: rgba(180, 83, 9, 0.55);
  border: 1px solid rgba(250, 204, 21, 0.65);
  border-radius: 999px;
  text-shadow: 0 1px 2px #000;
}
.gm-formula-pill {
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 800;
  color: #ecfdf5;
  background: linear-gradient(180deg, #16a34a 0%, #15803d 55%, #14532d 100%);
  border: 1.5px solid #86efac;
  border-radius: 999px;
  padding: 2px 8px;
  text-shadow: 0 1px 2px #000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.gm-formula-pill.high {
  color: #fef08a;
  background: linear-gradient(180deg, #ea580c 0%, #c2410c 55%, #7c2d12 100%);
  border-color: #fde047;
}
.gm-formula-pill:hover {
  transform: translateY(-1px) scale(1.04);
  filter: brightness(1.15);
}


/* ==========================================================================
   ROUND 08 (v4.0.0) – GIAO DIỆN KHUNG VIỀN & MÀU NỀN VÀNG GOLD CHUẨN GUNNY,
   LƯỚI KHO ĐỒ 36 Ô FULL CHIỀU CAO & POPUP TRANG BỊ TƯƠNG TÁC KHI BẤM
   ========================================================================== */

/* 1. Khung Cửa Sổ Chính (.gunny-window) & Nền Vàng Gold Hoàng Kim Chuẩn Gunny */
.gunny-window {
  background:
    linear-gradient(180deg, #fde68a 0%, #fcd34d 18%, #fbbf24 58%, #f59e0b 100%) !important;
  border: 4px solid #fef08a !important;
  outline: 3px solid #b45309 !important;
  border-radius: 22px !important;
  box-shadow:
    0 22px 54px rgba(0, 0, 0, 0.85),
    0 0 32px rgba(250, 204, 21, 0.55),
    inset 0 3px 0 #ffffff,
    inset 0 0 18px rgba(217, 119, 6, 0.45) !important;
  color: #451a03 !important;
}

.window-header {
  background:
    url('../assets/ui/public/bg/rj43.png') center center / 72% 92% no-repeat,
    linear-gradient(180deg, #f59e0b 0%, #d97706 45%, #b45309 100%) !important;
  border-bottom: 3px solid #fef08a !important;
  box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.75), 0 4px 10px rgba(120, 53, 15, 0.45) !important;
}

.window-title,
.window-header h2,
.window-header h3 {
  color: #fffbeb !important;
  text-shadow: 0 2px 0 #78350f, 0 0 10px rgba(254, 240, 138, 0.85) !important;
  font-weight: 900 !important;
}

.window-body {
  background:
    linear-gradient(180deg, #fffbeb 0%, #fef3c7 52%, #fde68a 100%) !important;
  border: 2.5px solid #d97706 !important;
  border-radius: 16px !important;
  margin: 8px 10px 10px 10px !important;
  padding: 12px 14px !important;
  box-shadow: inset 0 2px 8px rgba(180, 83, 9, 0.22), 0 2px 0 #fef08a !important;
  color: #451a03 !important;
}

/* 2. Bố cục Túi Đồ Vàng Gold 2 Cột & Lưới Kho Đồ 36 Ô Full Chiều Cao (Không còn hộp TIPS đáy) */
.gm-dual-bag-layout.gm-gold-theme-bag {
  display: grid !important;
  grid-template-columns: 350px 1fr !important;
  gap: 14px !important;
  height: 495px !important;
  align-items: stretch !important;
}

.gm-gold-card,
.gm-dollhouse-card,
.gm-bag-right-card {
  background:
    linear-gradient(180deg, #fef9c3 0%, #fef08a 42%, #fde047 100%) !important;
  border: 3px solid #d97706 !important;
  border-radius: 18px !important;
  padding: 10px 12px !important;
  box-shadow:
    inset 0 2px 0 #ffffff,
    inset 0 0 14px rgba(217, 119, 6, 0.25),
    0 6px 14px rgba(120, 53, 15, 0.28) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  height: 100% !important;
  box-sizing: border-box !important;
}

.gm-gold-subbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(90deg, #fde68a, #fcd34d, #fde68a);
  border: 2px solid #d97706;
  border-radius: 12px;
  padding: 5px 10px;
  box-shadow: inset 0 1px 0 #fff;
}

.gm-gold-stats-footer {
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%) !important;
  border: 2px solid #d97706 !important;
  border-radius: 14px !important;
  padding: 8px 12px !important;
  box-shadow: inset 0 1px 0 #ffffff, 0 2px 6px rgba(180, 83, 9, 0.2) !important;
}

.gm-bag-top-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.gm-gold-currency-strip {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 12.5px;
  font-weight: 900;
  color: #78350f;
  background: linear-gradient(180deg, #fffbeb, #fde68a);
  border: 2px solid #d97706;
  padding: 5px 14px;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 #ffffff, 0 2px 5px rgba(180, 83, 9, 0.2);
}

/* Lưới Kho Đồ mở rộng toàn bộ chiều cao khung bên phải */
.gm-bag-grid-with-vtabs.gm-full-height-grid {
  display: grid !important;
  grid-template-columns: 1fr 48px !important;
  gap: 8px !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: calc(100% - 46px) !important;
}

.item-grid.gm-gold-slot-grid {
  display: grid !important;
  grid-template-columns: repeat(6, 1fr) !important;
  grid-auto-rows: 68px !important;
  gap: 8px !important;
  padding: 10px !important;
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%) !important;
  border: 2.5px solid #92400e !important;
  border-radius: 14px !important;
  box-shadow: inset 0 3px 8px rgba(69, 26, 3, 0.45), 0 1px 0 #fef08a !important;
  overflow-y: auto !important;
  height: 100% !important;
  max-height: none !important;
  box-sizing: border-box !important;
}

/* Ô Vật Phẩm & Ô Trang Bị Màu Vàng Gold Nổi 3D Chuẩn Gunny */
.item-slot,
.gm-equip-box {
  background:
    radial-gradient(circle at 50% 42%, #fffbeb 0%, #fef08a 58%, #f59e0b 100%) !important;
  border: 2.5px solid #b45309 !important;
  border-radius: 12px !important;
  box-shadow:
    inset 0 2px 2px #ffffff,
    inset 0 -2px 4px rgba(180, 83, 9, 0.45),
    0 3px 6px rgba(69, 26, 3, 0.35) !important;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease !important;
}

.item-slot:hover,
.gm-equip-box:hover {
  transform: translateY(-2px) scale(1.04);
  border-color: #dc2626 !important;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.95), inset 0 0 8px #ffffff !important;
}

.item-slot.empty-slot {
  background:
    radial-gradient(circle at 50% 50%, rgba(254, 243, 199, 0.72) 0%, rgba(251, 191, 36, 0.62) 100%) !important;
  border: 2px dashed rgba(146, 64, 14, 0.55) !important;
  box-shadow: inset 0 2px 5px rgba(120, 53, 15, 0.25) !important;
  cursor: default;
}
.item-slot.empty-slot:hover {
  transform: none;
  border-color: rgba(146, 64, 14, 0.75) !important;
  box-shadow: inset 0 2px 5px rgba(120, 53, 15, 0.25) !important;
}

.item-slot.selected,
.gm-equip-box.selected-slot {
  background:
    radial-gradient(circle at center, #ffffff 0%, #fde047 65%, #f97316 100%) !important;
  border: 3px solid #16a34a !important;
  box-shadow: 0 0 16px rgba(22, 163, 74, 0.85), inset 0 0 10px #ffffff !important;
}

.eq-slot-hint {
  color: #78350f !important;
  font-weight: 900 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

.slot-qty {
  color: #78350f !important;
  background: rgba(254, 240, 138, 0.92) !important;
  border: 1px solid #b45309 !important;
  border-radius: 6px !important;
  padding: 0 4px !important;
  font-weight: 900 !important;
  text-shadow: none !important;
}

/* Tab dọc bên phải Kho Đồ màu Vàng Gold */
.gm-vtab-btn {
  background: linear-gradient(90deg, #fde68a, #f59e0b) !important;
  border: 2px solid #b45309 !important;
  color: #78350f !important;
  font-weight: 900 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75) !important;
}
.gm-vtab-btn.active {
  background: linear-gradient(90deg, #dc2626, #ea580c) !important;
  border-color: #fef08a !important;
  color: #fffbeb !important;
  text-shadow: 0 1px 2px #000 !important;
}

/* 3. Khung Popup Trang Bị Tương Tác Vàng Gold Chuẩn Gunny (#gm-item-popup-tooltip) */
.gm-item-popup-tooltip {
  position: fixed;
  z-index: 9999;
  pointer-events: auto !important;
  width: 312px;
  background:
    linear-gradient(180deg, #fffbeb 0%, #fef08a 45%, #fde047 100%) !important;
  border: 3.5px solid #d97706 !important;
  outline: 2px solid #fef08a !important;
  border-radius: 18px !important;
  padding: 12px 14px !important;
  color: #451a03 !important;
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.88),
    0 0 24px rgba(250, 204, 21, 0.65),
    inset 0 2px 0 #ffffff !important;
}

.gm-popup-close-x {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #fef08a;
  background: linear-gradient(180deg, #ef4444, #b91c1c);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.45);
}

.gm-popup-stats-panel {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(255, 251, 235, 0.88);
  border: 2px solid #f59e0b;
  border-radius: 12px;
  font-size: 11.5px;
  line-height: 1.55;
  color: #451a03;
  font-weight: 700;
}

.gm-popup-skill-unlock-box {
  margin-top: 7px;
  padding: 6px 9px;
  background: linear-gradient(90deg, #fef3c7, #fde68a);
  border: 1.5px solid #d97706;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 900;
  color: #b45309;
}

.gm-popup-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 2px dashed rgba(180, 83, 9, 0.35);
  justify-content: center;
}

/* 4. Thẻ Cửa Hàng & Tiệm Rèn tông Vàng Gold đồng bộ */
.gm-gold-shop-card {
  background: linear-gradient(180deg, #fffbeb 0%, #fef08a 100%) !important;
  border: 2.5px solid #d97706 !important;
  border-radius: 16px !important;
  padding: 12px !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: inset 0 2px 0 #ffffff, 0 4px 10px rgba(120, 53, 15, 0.22) !important;
}
.gm-shop-icon-frame {
  width: 56px;
  height: 56px;
  background: radial-gradient(circle, #fffbeb, #fcd34d);
  border: 2px solid #b45309;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.smithy-left-list,
.smithy-stage,
.gm-qhjm-left-list,
.gm-qhjm-right-stage {
  background: linear-gradient(180deg, #fef9c3 0%, #fde68a 100%) !important;
  border: 2.5px solid #d97706 !important;
  color: #451a03 !important;
}


/* ==========================================================================
   ROUND 09 (v4.1.0) – NÚT BẤM SPRITE 2D GỐC (an-1..an-8), HÀNH TRANG CHUẨN
   TEXTURE BAG.PNG (jgg-47.png / bag_gezl-bb-2.png), PHÒNG CHỜ CHIẾN ĐẤU,
   MÀN HÌNH LOADING ĐỐI KHÁNG VS (bg001.jpg), HỆ THỐNG VIP & KHẾ ƯỚC VUA GÀ
   ========================================================================== */

/* 1. Nút Bấm Sprite 2D Chính Thống Gunny (an-1..an-8) – Loại bỏ nút thuần CSS/Canvas */
.gunny-btn {
  background: url('../assets/extracted/ui_public/an-1.png') center / 100% 100% no-repeat transparent !important;
  border: none !important;
  border-radius: 8px !important;
  color: #fffbeb !important;
  font-weight: 900 !important;
  text-shadow: 0 2px 3px #451a03, 0 0 6px rgba(0, 0, 0, 0.85) !important;
  box-shadow: none !important;
  padding: 8px 18px !important;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease !important;
}
.gunny-btn:hover {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.12) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.55));
}
.gunny-btn:active {
  background-image: url('../assets/extracted/ui_public/an-2.png') !important;
  transform: translateY(1px) scale(0.98);
}
.gunny-btn.green {
  background-image: url('../assets/extracted/ui_public/an-3.png') !important;
}
.gunny-btn.green:active {
  background-image: url('../assets/extracted/ui_public/an-4.png') !important;
}
.gunny-btn.red {
  background-image: url('../assets/extracted/ui_public/an-5.png') !important;
}
.gunny-btn.red:active {
  background-image: url('../assets/extracted/ui_public/an-6.png') !important;
}
.gunny-btn.blue {
  background-image: url('../assets/extracted/ui_public/an-7.png') !important;
}
.gunny-btn.blue:active {
  background-image: url('../assets/extracted/ui_public/an-8.png') !important;
}
.gunny-btn.sm {
  padding: 6px 14px !important;
  font-size: 12px !important;
}

/* 2. Hành Trang & Túi Đồ Chuẩn Texture Gốc bag.png (jgg-47.png + bag_gezl-bb-2.png + Nút Trang bị / Thời trang) */
.gm-dollhouse-card,
.gm-bag-right-card {
  background:
    linear-gradient(180deg, rgba(235, 215, 175, 0.92), rgba(208, 182, 136, 0.95)),
    url('../assets/extracted/ui_bag/bag_gezl-bb-2.png') center / 100% 100% no-repeat !important;
  border: 3px solid #854d0e !important;
  outline: 2px solid #facc15 !important;
  border-radius: 16px !important;
  box-shadow: inset 0 2px 0 #fef08a, 0 6px 16px rgba(69, 26, 3, 0.45) !important;
}

.gm-bag-sprite-mode-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
}
.gm-bag-sprite-tab {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
  opacity: 0.85;
}
.gm-bag-sprite-tab img {
  height: 34px;
  width: auto;
  object-fit: contain;
}
.gm-bag-sprite-tab.active,
.gm-bag-sprite-tab:hover {
  opacity: 1;
  transform: scale(1.06);
  filter: drop-shadow(0 0 8px #facc15);
}

.gm-bag-badge-btn {
  border: 1.5px solid #fef08a;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10.5px;
  font-weight: 900;
  cursor: pointer;
  color: #fffbeb;
  text-shadow: 0 1px 2px #000;
}
.gm-bag-badge-btn.vip {
  background: linear-gradient(180deg, #ef4444, #991b1b);
}
.gm-bag-badge-btn.cov {
  background: linear-gradient(180deg, #d97706, #78350f);
}

.gm-vip-mini-badge {
  background: linear-gradient(180deg, #ef4444, #b91c1c);
  border: 1.5px solid #fde047;
  color: #fef08a;
  font-size: 10px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* Ô Trang Bị & Ô Hành Trang sử dụng trực tiếp Sprite jgg-47.png & bag_gezl-bb-1.png */
.item-grid.gm-gold-slot-grid {
  background:
    linear-gradient(180deg, rgba(168, 142, 98, 0.94), rgba(138, 114, 74, 0.96)) !important;
  border: 2.5px solid #5c3a14 !important;
}

.item-slot,
.gm-equip-box {
  background: url('../assets/extracted/ui_public/jgg-47.png') center / 100% 100% no-repeat transparent !important;
  border: none !important;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.38) !important;
}
.item-slot.empty-slot {
  background: url('../assets/extracted/ui_public/jgg-47.png') center / 100% 100% no-repeat transparent !important;
  opacity: 0.72;
  border: none !important;
}
.item-slot.selected,
.gm-equip-box.selected-slot {
  background:
    url('../assets/extracted/ui_public/jgg-48.png') center / 106% 106% no-repeat,
    url('../assets/extracted/ui_public/jgg-47.png') center / 100% 100% no-repeat transparent !important;
  border: none !important;
  filter: drop-shadow(0 0 8px #4ade80);
}

/* 3. Sảnh Chuẩn Bị Chiến Đấu / Phòng Chờ Chiến Đấu (#screen-room-prep) */
#screen-room-prep {
  background:
    radial-gradient(circle at 50% 25%, rgba(251, 191, 36, 0.22), rgba(15, 23, 42, 0.88)),
    url('../assets/ui/vs/lrms_01.jpg') center / cover no-repeat;
}
.gm-room-prep-backdrop {
  width: 94%;
  max-width: 1220px;
  height: 90%;
  margin: auto;
  margin-top: 2.2%;
  background:
    linear-gradient(180deg, rgba(254, 243, 199, 0.96) 0%, rgba(253, 224, 71, 0.94) 55%, rgba(245, 158, 11, 0.96) 100%);
  border: 4px solid #fef08a;
  outline: 3px solid #92400e;
  border-radius: 24px;
  padding: 14px 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.88), inset 0 2px 0 #ffffff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
}
.gm-room-top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background:
    url('../assets/ui/public/bg/rj43.png') center / 68% 100% no-repeat,
    linear-gradient(90deg, #b45309, #d97706 50%, #b45309);
  border: 2.5px solid #fef08a;
  border-radius: 16px;
  padding: 8px 16px;
  box-shadow: 0 4px 12px rgba(69, 26, 3, 0.45);
}
.gm-room-title-banner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.gm-room-main-title {
  font-size: 18px;
  font-weight: 900;
  color: #fffbeb;
  text-shadow: 0 2px 4px #451a03;
}
.gm-room-sub-title {
  font-size: 12px;
  font-weight: 800;
  color: #fef08a;
}
.gm-room-main-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 14px;
  flex: 1;
  min-height: 0;
}
.gm-room-slots-panel,
.gm-room-config-panel {
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.92), rgba(254, 240, 138, 0.92));
  border: 2.5px solid #b45309;
  border-radius: 18px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}
.gm-room-section-head {
  font-size: 12.5px;
  font-weight: 900;
  color: #78350f;
  background: linear-gradient(90deg, #fde68a, #fcd34d);
  border: 1.5px solid #d97706;
  border-radius: 10px;
  padding: 4px 10px;
  margin-bottom: 6px;
}
.gm-room-section-head.enemy-head {
  background: linear-gradient(90deg, #fecaca, #fca5a5);
  border-color: #dc2626;
  color: #991b1b;
}
.gm-room-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.gm-room-player-card {
  background:
    radial-gradient(circle at 50% 45%, #fffbeb 0%, #fde68a 68%, #f59e0b 100%);
  border: 2.5px solid #b45309;
  border-radius: 16px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: inset 0 2px 0 #ffffff, 0 4px 10px rgba(69, 26, 3, 0.25);
}
.gm-room-slot-badge {
  font-size: 10.5px;
  font-weight: 900;
  color: #fffbeb;
  background: linear-gradient(90deg, #16a34a, #15803d);
  border: 1.5px solid #bbf7d0;
  border-radius: 999px;
  padding: 2px 10px;
  margin-bottom: 2px;
}
.gm-room-p-name {
  font-size: 14px;
  font-weight: 900;
  color: #451a03;
}
.gm-room-p-badges {
  display: flex;
  gap: 5px;
  margin: 2px 0;
}
.gm-room-mini-tag {
  font-size: 10px;
  font-weight: 900;
  padding: 1px 7px;
  border-radius: 999px;
  color: #fffbeb;
}
.gm-room-mini-tag.vip { background: #dc2626; border: 1px solid #fde047; }
.gm-room-mini-tag.cov { background: #b45309; border: 1px solid #fde047; }
.gm-room-p-wp {
  font-size: 11px;
  font-weight: 900;
  color: #b91c1c;
}
.gm-room-p-pwr {
  font-size: 11px;
  font-weight: 800;
  color: #78350f;
}
.gm-room-enemies-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}
.gm-room-enemy-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(90deg, #fff1f2, #ffe4e6);
  border: 2px solid #e11d48;
  border-radius: 12px;
  padding: 6px 10px;
}
.gm-room-en-pic {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: #fef2f2;
  border: 1.5px solid #f43f5e;
  border-radius: 10px;
}
.gm-room-box {
  background: rgba(255, 251, 235, 0.78);
  border: 2px solid #d97706;
  border-radius: 14px;
  padding: 8px 10px;
}
.gm-room-diff-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.room-diff-btn.active {
  filter: brightness(1.16) drop-shadow(0 0 8px #dc2626);
  transform: scale(1.05);
}
.gm-room-rewards-strip {
  margin-top: 6px;
  font-size: 11px;
  color: #451a03;
  background: #fef3c7;
  border: 1px dashed #b45309;
  border-radius: 8px;
  padding: 4px 8px;
}
.gm-room-wp-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  max-height: 128px;
  overflow-y: auto;
}
.gm-room-wp-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(180deg, #fffbeb, #fde68a);
  border: 2px solid #b45309;
  border-radius: 10px;
  padding: 4px 8px;
  cursor: pointer;
}
.gm-room-wp-chip.active {
  border-color: #16a34a;
  background: linear-gradient(180deg, #dcfce7, #bbf7d0);
}
.gm-room-wp-chip img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}
.gm-room-wp-status {
  margin-left: auto;
  font-size: 10px;
  font-weight: 900;
  color: #15803d;
}
.gm-room-skill-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
.gm-room-sk-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 8px;
  border: 1.5px solid #b45309;
  background: #fef3c7;
  color: #451a03;
}
.gm-room-sk-badge.locked {
  opacity: 0.48;
  filter: grayscale(0.8);
}
.gm-room-sk-badge img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}
.gm-room-start-footer {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}
.gm-room-giant-start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  padding: 10px 24px;
  background:
    url('../assets/extracted/ui_public/an-5.png') center / 100% 100% no-repeat transparent;
  border: none;
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.14s ease;
}
.gm-room-giant-start-btn:hover {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.14) drop-shadow(0 6px 14px rgba(220, 38, 38, 0.75));
}

/* 4. Màn Hình Loading Đối Kháng VS Chuẩn Gunny (#screen-battle-loading) */
.gm-vs-loading-screen {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.35), rgba(15, 23, 42, 0.65)),
    url('../assets/ui/vs/bg001.jpg') center / cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 24px 36px;
  box-sizing: border-box;
}
.gm-vs-stage-banner {
  background:
    url('../assets/ui/public/bg/rj43.png') center / 100% 100% no-repeat,
    linear-gradient(90deg, transparent, rgba(180, 83, 9, 0.95) 20%, rgba(220, 38, 38, 0.96) 50%, rgba(180, 83, 9, 0.95) 80%, transparent);
  border-top: 2.5px solid #fef08a;
  border-bottom: 2.5px solid #fef08a;
  padding: 8px 42px;
  font-size: 20px;
  font-weight: 900;
  color: #fffbeb;
  text-shadow: 0 2px 6px #000;
}
.gm-vs-fighters-arena {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 38px;
  width: 100%;
  max-width: 1120px;
}
.gm-vs-fighter-card {
  width: 340px;
  padding: 16px;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), inset 0 2px 0 rgba(255, 255, 255, 0.65);
}
.gm-vs-fighter-card.blue-team {
  background: linear-gradient(180deg, rgba(30, 64, 175, 0.92) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 3.5px solid #38bdf8;
}
.gm-vs-fighter-card.red-team {
  background: linear-gradient(180deg, rgba(153, 27, 27, 0.92) 0%, rgba(40, 10, 10, 0.95) 100%);
  border: 3.5px solid #facc15;
}
.gm-vs-team-tag {
  font-size: 11px;
  font-weight: 900;
  color: #fef08a;
  background: rgba(2, 132, 199, 0.85);
  border: 1.5px solid #7dd3fc;
  padding: 3px 14px;
  border-radius: 999px;
  margin-bottom: 6px;
}
.gm-vs-team-tag.red {
  background: rgba(185, 28, 28, 0.88);
  border-color: #fde047;
}
.gm-vs-boss-portrait-wrap {
  width: 180px;
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gm-vs-boss-portrait-wrap img {
  max-width: 165px;
  max-height: 175px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(248, 113, 113, 0.85));
}
.gm-vs-f-name {
  font-size: 17px;
  font-weight: 900;
  color: #fef08a;
  text-shadow: 0 2px 4px #000;
  margin-top: 4px;
}
.gm-vs-f-wp {
  font-size: 12.5px;
  font-weight: 800;
  color: #bae6fd;
  margin: 4px 0;
}
.gm-vs-f-pwr {
  font-size: 13px;
  font-weight: 900;
  color: #4ade80;
}
.gm-vs-ready-pill {
  margin-top: 8px;
  background: linear-gradient(90deg, #16a34a, #15803d);
  border: 1.5px solid #86efac;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  padding: 3px 16px;
  border-radius: 999px;
}
.gm-vs-center-emblem {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.gm-vs-main-logo {
  width: 155px;
  height: 155px;
  object-fit: contain;
  filter: drop-shadow(0 0 26px #facc15);
  animation: pulseVsEmblem 0.65s infinite alternate;
}
@keyframes pulseVsEmblem {
  from { transform: scale(0.96); filter: drop-shadow(0 0 18px #f97316); }
  to { transform: scale(1.08); filter: drop-shadow(0 0 32px #fef08a); }
}
.gm-vs-spark-text {
  font-size: 14px;
  font-weight: 900;
  color: #fef08a;
  text-shadow: 0 2px 6px #000;
  letter-spacing: 1.5px;
}
.gm-vs-bottom-loader {
  width: 100%;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.gm-vs-tip-text {
  font-size: 13px;
  font-weight: 800;
  color: #fef08a;
  background: rgba(20, 8, 2, 0.82);
  border: 1.5px solid #facc15;
  border-radius: 999px;
  padding: 5px 20px;
  text-shadow: 0 1px 2px #000;
}
.gm-vs-bar-frame {
  width: 100%;
  height: 44px;
  background: url('../assets/extracted/ui_loading/load_dl-loading-1.png') center / 100% 100% no-repeat;
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 32px;
  box-sizing: border-box;
}
.gm-vs-bar-fill {
  height: 24px;
  background:
    url('../assets/extracted/ui_loading/load_dl-loading-3.png') left center / 100% 100% no-repeat,
    linear-gradient(90deg, #f59e0b, #facc15, #4ade80);
  border-radius: 999px;
  transition: width 0.14s ease;
}
.gm-vs-bar-pct {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12.5px;
  font-weight: 900;
  color: #fffbeb;
  text-shadow: 0 2px 4px #000;
}

/* 5. Cửa Sổ Đặc Quyền VIP 1–12 & Khế Ước Vua Gà */
.gm-vip-top-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: linear-gradient(90deg, #fef08a, #fde047, #f59e0b);
  border: 2.5px solid #b45309;
  border-radius: 16px;
  padding: 10px 14px;
  margin-bottom: 10px;
}
.gm-vip-exp-bar-wrap {
  width: 290px;
  height: 24px;
  background: url('../assets/extracted/ui_vip/vip_vip-1-9.png') center / 100% 100% no-repeat;
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 4px;
  margin-top: 5px;
}
.gm-vip-exp-fill {
  height: 18px;
  background: url('../assets/extracted/ui_vip/vip_vip-1-10.png') left center / 100% 100% no-repeat;
  border-radius: 999px;
}
.gm-vip-exp-txt {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10.5px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 3px #000;
}
.gm-vip-priv-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gm-covenant-card {
  background: linear-gradient(180deg, #fffbeb 0%, #fef08a 100%);
  border: 2.5px solid #b45309;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: inset 0 2px 0 #ffffff, 0 4px 12px rgba(69, 26, 3, 0.25);
}
.gm-covenant-card.active {
  border: 3px solid #16a34a;
  box-shadow: 0 0 18px rgba(22, 163, 74, 0.45), inset 0 2px 0 #ffffff;
}

/* =====================================================================
   ROUND 10 (v4.2.0): 1:1 AUTHENTIC REFERENCE UI STYLES
   1. Cá nhân & Túi (gunny-mobi-3-1.jpg)
   2. Tiệm rèn 5 Tab Dọc Trái & 2 Lưới 6x2 Phải (02-cuong-hoa.jpg & ren-4.jpg)
   3. Shop & Phòng Thử Đồ (images.jpeg)
   4. Phòng Chờ 7029 (thumb-2.jpg)
   ===================================================================== */

/* --- Khung cửa sổ chung cho Modal Túi, Tiệm Rèn, Shop --- */
.gunny-window[data-modal-theme="modal-bag"],
.gunny-window[data-modal-theme="modal-smithy"],
.gunny-window[data-modal-theme="modal-shop"] {
  width: min(950px, 95vw) !important;
  max-height: min(610px, 93vh) !important;
  background: linear-gradient(180deg, #6b4423 0%, #4e2f14 100%) !important;
  border: 4px solid #c89d54 !important;
  border-radius: 16px !important;
  box-shadow: 0 18px 48px rgba(0,0,0,0.88), inset 0 0 0 2px #3b200a !important;
  overflow: visible !important;
}

.gunny-window[data-modal-theme="modal-bag"] .window-header,
.gunny-window[data-modal-theme="modal-shop"] .window-header {
  height: 42px !important;
  background: linear-gradient(180deg, #b88746 0%, #7c5121 50%, #593713 100%) !important;
  border-bottom: 2px solid #eab308 !important;
  padding: 0 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  border-radius: 12px 12px 0 0 !important;
}

.gunny-window[data-modal-theme="modal-bag"] .window-close-btn {
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  background: radial-gradient(circle at 35% 30%, #a3e635 0%, #4d7c0f 85%) !important;
  border: 2.5px solid #fef08a !important;
  color: #fff !important;
  font-weight: 900 !important;
  font-size: 17px !important;
  box-shadow: 0 3px 6px rgba(0,0,0,0.6) !important;
}

.r10-modal-main-title {
  font-size: 20px;
  font-weight: 900;
  color: #fffbeb;
  text-shadow: 0 2px 3px #000, 0 0 6px #78350f;
  letter-spacing: 0.5px;
}

/* =====================================================================
   1. GIAO DIỆN CÁ NHÂN & TÚI ĐỒ (gunny-mobi-3-1.jpg)
   ===================================================================== */
.r10-bag-master-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 8px 8px;
  background: #5a3818;
  border-radius: 0 0 12px 12px;
}

.r10-bag-top-subbar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #3d230c;
  border: 2px solid #8c6230;
  border-radius: 10px;
  padding: 4px 10px;
}

.r10-bag-tui-tab {
  position: relative;
  background: linear-gradient(180deg, #fde047 0%, #f59e0b 65%, #b45309 100%);
  border: 2px solid #fffbeb;
  border-radius: 8px;
  padding: 4px 24px 4px 16px;
  font-weight: 900;
  font-size: 15px;
  color: #fff;
  text-shadow: 0 1px 2px #78350f, 0 0 4px #000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.r10-loudspeaker-orb {
  position: absolute;
  right: -10px;
  top: -6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle, #22c55e, #14532d);
  border: 2px solid #facc15;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.r10-bag-marquee-bar {
  flex: 1;
  background: rgba(15, 7, 2, 0.72);
  border: 1.5px solid #9a6b32;
  border-radius: 6px;
  padding: 5px 12px;
  color: #fcd34d;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.r10-orange-help-btn {
  width: 30px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(180deg, #fb923c, #c2410c);
  border: 2px solid #fde68a;
  color: #fff;
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
}

.r10-bag-two-cols {
  display: grid;
  grid-template-columns: 410px 1fr;
  gap: 10px;
  align-items: stretch;
}

/* Khung Trái: Nền giấy da ấm #e4cda6 + Vòng Ma Pháp Đỏ */
.r10-bag-left-card {
  background: linear-gradient(180deg, #ecd8b4 0%, #dfc496 100%);
  border: 3px solid #a17439;
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: inset 0 0 12px rgba(107, 68, 35, 0.35);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.r10-bag-left-toprow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.r10-bag-char-Title {
  font-weight: 900;
  font-size: 14px;
  color: #7c2d12;
  background: rgba(255, 255, 255, 0.45);
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid #b48a52;
}

.r10-bag-pet-lv-pill {
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, #dc2626, #ef4444);
  border: 2px solid #facc15;
  border-radius: 999px;
  padding: 1px 12px 1px 4px;
  gap: 6px;
  color: #fff;
  font-weight: 900;
  font-size: 14px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.35);
}
.r10-bag-pet-lv-pill img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1e293b;
  border: 1.5px solid #fde047;
  object-fit: contain;
}

.r10-bag-an-btn {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 55%, #0369a1 100%);
  border: 2px solid #bae6fd;
  border-radius: 8px;
  padding: 3px 20px;
  color: #fff;
  font-weight: 900;
  font-size: 14px;
  text-shadow: 0 1px 2px #000;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

.r10-bag-stage-3col {
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  align-items: center;
  gap: 6px;
  margin: 2px 0;
}

.r10-bag-side-3slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

/* Ô Trang Bị Nền Xanh Sao Đêm #0d2142 Viền Vàng Đồng */
.r10-starry-slot {
  width: 68px;
  height: 68px;
  border-radius: 9px;
  background:
    radial-gradient(circle at 25% 25%, rgba(255,255,255,0.45) 1px, transparent 2px),
    radial-gradient(circle at 75% 65%, rgba(147,197,253,0.4) 1.5px, transparent 2.5px),
    radial-gradient(circle at 50% 50%, #173668 0%, #0a1936 85%);
  border: 2.5px solid #c89d54;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.85), 0 2px 4px rgba(0,0,0,0.35);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.r10-starry-slot:hover,
.r10-starry-slot.selected {
  border-color: #fde047;
  transform: scale(1.04);
  box-shadow: 0 0 10px #facc15, inset 0 0 8px rgba(0,0,0,0.85);
}
.r10-starry-slot .slot-icon {
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.7));
}
.r10-slot-watermark {
  font-size: 11px;
  font-weight: 800;
  color: rgba(148, 163, 184, 0.55);
  text-align: center;
}

/* Khu Nhân Vật & Vòng Ma Pháp Đỏ Chính Giữa */
.r10-bag-center-doll {
  position: relative;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.r10-bag-magic-circle {
  position: absolute;
  width: 215px;
  height: 215px;
  object-fit: contain;
  pointer-events: none;
  z-index: 1;
}
#bag-dollhouse-canvas {
  position: relative;
  z-index: 2;
}
.r10-bag-vip-silver-badge {
  position: absolute;
  left: 4px;
  top: 6px;
  z-index: 3;
  background: radial-gradient(circle, #475569, #0f172a);
  border: 2px solid #e2e8f0;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fde047;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.65);
}
.r10-bag-vip-silver-badge span { font-size: 13px; line-height: 1; }
.r10-bag-vip-silver-badge small { font-size: 8.5px; color: #fff; }

/* Hàng 4 ô dưới chân nhân vật */
.r10-bag-bottom-4row {
  display: grid;
  grid-template-columns: 108px 68px 68px 68px;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  padding-top: 4px;
}
.r10-bag-thoi-trang-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.r10-bag-thoi-trang-btn img {
  width: 106px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.r10-bag-thoi-trang-btn:hover { transform: scale(1.05); }

.r10-pay-slot {
  background: radial-gradient(circle, #334155 0%, #0f172a 90%) !important;
}
.r10-pay-img {
  width: 52px;
  height: 48px;
  object-fit: contain;
}

.r10-trang-suc-slot {
  width: 68px;
  height: 68px;
  border-radius: 9px;
  background: #b09975;
  border: 2.5px solid #e7d8be;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f8fafc;
  font-weight: 800;
  font-size: 12px;
  text-align: center;
  cursor: pointer;
}
.r10-trang-suc-slot .slot-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.r10-bag-power-footer {
  margin-top: 6px;
  background: linear-gradient(90deg, #4a2c11, #6b3f19, #4a2c11);
  border: 1.5px solid #b48a52;
  border-radius: 8px;
  padding: 4px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fde68a;
  font-size: 13px;
  font-weight: 900;
}
.r10-bag-power-footer b {
  color: #facc15;
  font-size: 15px;
}
.r10-bag-angle-pill {
  font-size: 11px;
  color: #fed7aa;
}

/* Khung Phải: 4 Tiền Tệ + Lưới 4x4 Ô Xanh Sao Đêm + 3 Tab Dọc */
.r10-bag-right-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

.r10-bag-currency-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #472b12;
  border: 2px solid #8c6230;
  border-radius: 10px;
  padding: 5px 10px;
}

.r10-bag-cur-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 18px;
  flex: 1;
}
.r10-cur-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #fef3c7;
}
.r10-cur-item b {
  font-weight: 900;
  color: #fff;
}

.r10-bag-sort-orange-btn {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  background: linear-gradient(180deg, #fb923c 0%, #ea580c 60%, #9a3412 100%);
  border: 2.5px solid #fed7aa;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0,0,0,0.45);
}

.r10-bag-grid-and-tabs {
  display: flex;
  align-items: stretch;
}

.r10-bag-cream-board {
  flex: 1;
  background: #f2e2c4;
  border: 3px solid #c89d54;
  border-radius: 12px 0 12px 12px;
  padding: 8px;
  box-shadow: inset 0 0 10px rgba(120, 53, 15, 0.25);
}

.r10-bag-4x4-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 72px);
  gap: 7px;
}

.r10-starry-bag-cell {
  width: 100% !important;
  height: 72px !important;
  border-radius: 9px !important;
  background:
    radial-gradient(circle at 20% 25%, rgba(255,255,255,0.45) 1px, transparent 2px),
    radial-gradient(circle at 80% 70%, rgba(147,197,253,0.4) 1.5px, transparent 2.5px),
    radial-gradient(circle at 50% 50%, #163566 0%, #091630 88%) !important;
  border: 2.5px solid #bfa065 !important;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.85) !important;
}
.r10-starry-bag-cell .slot-icon {
  width: 54px !important;
  height: 54px !important;
  object-fit: contain !important;
}

/* 3 Tab Dọc Nằm Mép Phải (Trang bị | Thời trang | Đạo cụ) */
.r10-bag-right-vtabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  margin-left: -3px;
}

.r10-bag-vtab {
  width: 34px;
  height: 98px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  border-radius: 0 10px 10px 0;
  background: linear-gradient(90deg, #4d7c0f 0%, #84cc16 100%);
  border: 2px solid #d9f99d;
  border-left: none;
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px #1a2e05;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 3px 2px 6px rgba(0,0,0,0.4);
}
.r10-bag-vtab.active {
  width: 38px;
  background: linear-gradient(90deg, #d97706 0%, #facc15 55%, #fef08a 100%);
  border-color: #fffbeb;
  color: #78350f;
  text-shadow: 0 1px 0 #fff;
}

.r10-bag-pagination-row {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 2px 0;
}

.r10-page-dots {
  display: flex;
  gap: 10px;
  align-items: center;
}
.r10-page-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #8c6d46;
  border: 1.5px solid #3d230c;
  cursor: pointer;
}
.r10-page-dot.active {
  background: #fffbeb;
  box-shadow: 0 0 6px #fde047;
  transform: scale(1.15);
}

.r10-bag-expand-mini {
  position: absolute;
  right: 4px;
  background: #3d230c;
  border: 1px solid #c89d54;
  color: #fde68a;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
}

/* =====================================================================
   2. GIAO DIỆN TIỆM RÈN 5 TAB DỌC TRÁI (02-cuong-hoa.jpg & ren-4.jpg)
   ===================================================================== */
.r10-smithy-scroll-header {
  display: inline-block;
  background: linear-gradient(180deg, #fef3c7 0%, #d6b272 100%);
  border: 2.5px solid #78350f;
  border-radius: 8px;
  padding: 2px 48px;
  color: #78350f;
  font-weight: 900;
  font-size: 20px;
  text-shadow: 0 1px 0 #fff;
  box-shadow: 0 3px 6px rgba(0,0,0,0.45);
}

.r10-smithy-master-wrap {
  display: flex;
  align-items: stretch;
  padding: 6px 8px 8px 4px;
  background: #d5ba8a;
  border-radius: 0 0 12px 12px;
  border: 3px solid #8c6230;
}

/* 5 Tab Dọc Nằm Mép Trái */
.r10-smithy-left-vtabs {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 8px;
  margin-right: -3px;
  z-index: 3;
}

.r10-sm-vtab {
  width: 44px;
  height: 76px;
  border-radius: 10px 0 0 10px;
  border: 2px solid #fde68a;
  border-right: none;
  color: #fff;
  font-weight: 900;
  font-size: 12px;
  line-height: 1.15;
  text-shadow: 0 1px 2px #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: -2px 2px 5px rgba(0,0,0,0.35);
}
.r10-sm-vtab.tab-cuonghoa { background: linear-gradient(180deg, #b91c1c, #7f1d1d); }
.r10-sm-vtab.tab-khamnam  { background: linear-gradient(180deg, #78350f, #451a03); }
.r10-sm-vtab.tab-hopthanh { background: linear-gradient(180deg, #4d7c0f, #365314); }
.r10-sm-vtab.tab-dichuyen { background: linear-gradient(180deg, #1d4ed8, #1e3a8a); }
.r10-sm-vtab.tab-dungluyen{ background: linear-gradient(180deg, #d97706, #92400e); }

.r10-sm-vtab.active {
  width: 48px;
  filter: brightness(1.22);
  border-color: #fffbeb;
  box-shadow: -3px 0 10px rgba(250, 204, 21, 0.75);
}

.r10-smithy-dual-body {
  flex: 1;
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 10px;
  background: #cbb082;
  border: 3px solid #784d22;
  border-radius: 10px;
  padding: 8px;
}

/* Khung Bàn Rèn Bên Trái */
.r10-forge-stage {
  height: 100%;
  border-radius: 10px;
  border: 2.5px solid #6b3e17;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

/* Nền Đỏ Gạch Hoa Văn Cường Hóa (02-cuong-hoa.jpg) */
.r10-forge-stage.theme-red-cuonghoa {
  background:
    radial-gradient(circle at 50% 45%, rgba(251, 146, 60, 0.22) 0%, transparent 65%),
    repeating-radial-gradient(circle at 50% 45%, rgba(0,0,0,0.08) 0px, rgba(0,0,0,0.08) 8px, transparent 8px, transparent 16px),
    linear-gradient(180deg, #9e331e 0%, #822514 55%, #691b0d 100%);
}

/* Nền Xanh Lá Hoa Văn Hợp Thành & Dung Luyện (ren-4.jpg) */
.r10-forge-stage.theme-green-hopthanh {
  background:
    radial-gradient(circle at 50% 48%, rgba(217, 249, 157, 0.35) 0%, transparent 62%),
    repeating-radial-gradient(circle at 50% 48%, rgba(254, 240, 138, 0.12) 0px, rgba(254, 240, 138, 0.12) 9px, transparent 9px, transparent 18px),
    linear-gradient(180deg, #6ca116 0%, #55840d 55%, #3f6308 100%);
}

.r10-forge-stage.theme-amber-khamnam {
  background: linear-gradient(180deg, #78350f 0%, #451a03 100%);
}
.r10-forge-stage.theme-blue-dichuyen {
  background: linear-gradient(180deg, #1e3a8a 0%, #0f172a 100%);
}

.r10-forge-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.r10-forge-main-heading {
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 3px #000;
}

.r10-vip-exp-pill {
  margin-top: 4px;
  background: rgba(67, 20, 7, 0.72);
  border: 1px solid #d97706;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 10.5px;
  color: #fde68a;
  font-weight: 700;
}

.r10-hammer-lv-badge {
  background: linear-gradient(180deg, #78350f, #451a03);
  border: 2px solid #f59e0b;
  border-radius: 8px;
  padding: 4px 10px;
  color: #fde047;
  font-weight: 900;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Khu 2 ô Cường Hóa & Thanh % ở giữa */
.r10-ch-center-slots {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0;
}

.r10-ch-ornate-equip-box {
  width: 98px;
  height: 98px;
  border-radius: 14px;
  background: radial-gradient(circle, #78350f 0%, #3b1606 90%);
  border: 3.5px solid #facc15;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.45), inset 0 0 10px #000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.r10-ch-slot-bg-txt {
  position: absolute;
  font-size: 11px;
  font-weight: 900;
  color: rgba(254, 240, 138, 0.32);
  text-align: center;
  pointer-events: none;
}
.r10-ch-eq-img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  position: relative;
  z-index: 2;
}
.r10-ch-eq-plus {
  position: absolute;
  right: 5px;
  top: 4px;
  z-index: 3;
  background: #dc2626;
  color: #fef08a;
  font-weight: 900;
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 6px;
  border: 1px solid #fde047;
}

.r10-ch-progress-pill {
  width: 118px;
  height: 22px;
  background: #451a03;
  border: 2px solid #fcd34d;
  border-radius: 999px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  margin-bottom: 6px;
}
.r10-ch-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, #16a34a, #84cc16);
}
.r10-ch-progress-txt {
  position: relative;
  z-index: 2;
  font-size: 11px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}

.r10-ch-stone-box {
  width: 82px;
  height: 82px;
  border-radius: 10px;
  background: radial-gradient(circle, #291509 0%, #090401 92%);
  border: 3px solid #d6d3d1;
  box-shadow: inset 0 0 8px #000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.r10-ch-stone-box img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}
.r10-ch-stone-qty {
  position: absolute;
  right: 5px;
  bottom: 3px;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 3px #000, 0 0 4px #000;
}

.r10-ch-mid-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
}

.r10-ch-mini-buy-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(180deg, #b45309, #78350f);
  border: 2px solid #fcd34d;
  border-radius: 7px;
  padding: 3px 12px;
  color: #fef3c7;
  font-weight: 900;
  font-size: 12px;
  cursor: pointer;
}
.r10-ch-mini-buy-btn img { width: 18px; height: 18px; object-fit: contain; }

.r10-ch-continuous-chk {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fde047;
  font-weight: 900;
  font-size: 13px;
  text-shadow: 0 1px 2px #000;
  cursor: pointer;
}
.r10-ch-continuous-chk input {
  width: 18px;
  height: 18px;
  accent-color: #d97706;
}

/* Bảng 4 Cột Điểm Cơ Bản | Guild | VIP | Tổng */
.r10-ch-4col-table {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: rgba(69, 26, 3, 0.72);
  border: 1.5px solid #b45309;
  border-radius: 8px;
  padding: 5px 6px;
  text-align: center;
}
.r10-ch-col-cell .lbl {
  font-size: 10px;
  color: #fde68a;
  font-weight: 700;
}
.r10-ch-col-cell .val {
  margin-top: 2px;
  background: rgba(20, 8, 2, 0.75);
  border: 1px solid #92400e;
  border-radius: 4px;
  padding: 2px 0;
  color: #fff;
  font-weight: 900;
  font-size: 12px;
}

.r10-forge-bottom-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.r10-gold-cuonghoa-btn {
  background: linear-gradient(180deg, #fde047 0%, #d97706 55%, #92400e 100%);
  border: 2.5px solid #fffbeb;
  border-radius: 9px;
  padding: 7px 34px;
  color: #fff;
  font-weight: 900;
  font-size: 16px;
  text-shadow: 0 2px 3px #451a03, 0 0 4px #000;
  box-shadow: 0 4px 10px rgba(0,0,0,0.55);
  cursor: pointer;
}

/* Hợp Thành 3 Ô Ngang (ren-4.jpg) */
.r10-synth-stat-summary {
  font-size: 11px;
  font-weight: 900;
  color: #fef08a;
  background: rgba(0,0,0,0.45);
  padding: 3px 8px;
  border-radius: 6px;
}
.r10-synth-stone-selector {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.r10-synth-pill {
  background: rgba(20, 40, 5, 0.68);
  border: 1.5px solid #bef264;
  border-radius: 6px;
  padding: 2px 7px;
  color: #ecfccb;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
}
.r10-synth-pill.active {
  background: #facc15;
  color: #451a03;
  border-color: #fff;
}

.r10-ht-three-slots {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  margin: 6px 0;
}
.r10-ht-slot-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.r10-ht-top-buy-btn {
  background: linear-gradient(180deg, #fb923c, #b45309);
  border: 1.5px solid #fde68a;
  border-radius: 6px;
  padding: 2px 10px;
  color: #fff;
  font-weight: 900;
  font-size: 11px;
  cursor: pointer;
}
.r10-ht-box {
  width: 78px;
  height: 78px;
  border-radius: 10px;
  background: #b8ab93;
  border: 3px solid #e7e5e4;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.45), 0 3px 6px rgba(0,0,0,0.35);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #57534e;
  font-weight: 900;
  font-size: 12px;
  text-align: center;
}
.r10-ht-box img { width: 54px; height: 54px; object-fit: contain; }
.r10-ht-box.equip-center {
  width: 84px;
  height: 84px;
  background: radial-gradient(circle, #0d9488 0%, #115e59 88%);
  border: 3px solid #fde047;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.65);
}
.r10-ht-box.dark-stone {
  background: radial-gradient(circle, #27272a 0%, #09090b 92%);
}

.r10-ht-rate-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
  font-size: 13px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}
.r10-ht-rate-row .rate-box {
  display: inline-block;
  background: rgba(20, 35, 5, 0.78);
  border: 1.5px solid #a3e635;
  border-radius: 6px;
  padding: 2px 12px;
  color: #fef08a;
  margin-left: 4px;
}

.r10-orange-hopthanh-btn {
  background: linear-gradient(180deg, #fb923c 0%, #ea580c 55%, #9a3412 100%);
  border: 2.5px solid #fde68a;
  border-radius: 999px;
  padding: 7px 36px;
  color: #fff;
  font-weight: 900;
  font-size: 16px;
  text-shadow: 0 2px 3px #000;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  cursor: pointer;
}
.r10-mini-help-txt {
  font-size: 12px;
  font-weight: 900;
  color: #fef08a;
  text-shadow: 0 1px 2px #000;
}

/* Khảm Nạm 4 Lỗ */
.r10-inlay-4sockets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.r10-inlay-socket-box {
  background: rgba(0,0,0,0.45);
  border: 2px solid #b45309;
  border-radius: 10px;
  padding: 6px;
  text-align: center;
  cursor: pointer;
}
.r10-inlay-socket-box.active { border-color: #4ade80; background: rgba(22, 101, 52, 0.45); }
.r10-inlay-socket-box img { width: 38px; height: 38px; object-fit: contain; }
.r10-inlay-socket-box .s-title { font-size: 10px; color: #fde68a; }
.r10-inlay-socket-box .s-name { font-size: 11px; font-weight: 800; color: #fff; }

/* Khung Phải Tiệm Rèn: 2 Lưới 6x2 Xếp Chồng + Tooltip Đen + 3 Ô Tiền Tệ */
.r10-smithy-right-col {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

.r10-smithy-sec-box {
  background: #b59b72;
  border: 2px solid #784d22;
  border-radius: 8px;
  overflow: hidden;
}

.r10-smithy-orange-bar {
  background: linear-gradient(90deg, #d97706 0%, #b45309 100%);
  padding: 3px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 12px;
}
.r10-smithy-orange-bar .num-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #facc15;
  color: #78350f;
  font-weight: 900;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.r10-smithy-orange-bar small {
  color: #fef08a;
  font-size: 10.5px;
}

.r10-smithy-6x2-wrap {
  display: flex;
  padding: 5px;
  gap: 4px;
}

.r10-smithy-6x2-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(2, 54px);
  gap: 4px;
}

.r10-smithy-grid-cell {
  background: #dfd7c8;
  border: 2px solid #8c7658;
  border-radius: 6px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.r10-smithy-grid-cell.selected {
  border-color: #ef4444;
  box-shadow: inset 0 0 0 2px #facc15;
  background: #fef3c7;
}
.r10-smithy-grid-cell img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}
.r10-smithy-grid-cell .cell-plus {
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 9.5px;
  font-weight: 900;
  color: #b91c1c;
}
.r10-smithy-grid-cell .cell-qty {
  position: absolute;
  bottom: 1px;
  right: 3px;
  font-size: 10.5px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
}

.r10-smithy-fake-scroll {
  width: 14px;
  background: #8c6d46;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
  font-size: 9px;
  color: #fef3c7;
}

/* Tooltip Đen Viền Vàng Chuẩn Ảnh ren-4.jpg */
.r10-ren-dark-tooltip {
  position: absolute;
  right: 18px;
  top: 72px;
  width: 240px;
  background: rgba(12, 12, 14, 0.94);
  border: 2px solid #ca8a04;
  border-radius: 8px;
  padding: 8px 10px;
  color: #f8fafc;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0,0,0,0.85);
  cursor: pointer;
}
.r10-ren-dark-tooltip .tt-title {
  font-weight: 900;
  font-size: 13.5px;
  color: #c084fc;
  margin-bottom: 4px;
}
.r10-ren-dark-tooltip .tt-row {
  font-size: 11px;
  color: #cbd5e1;
  display: flex;
  gap: 8px;
  margin-bottom: 2px;
}
.r10-ren-dark-tooltip .tt-purple { color: #c084fc; }
.r10-ren-dark-tooltip .tt-bound-stamp {
  position: absolute;
  right: 10px;
  top: 26px;
  border: 1.5px solid #dc2626;
  color: #ef4444;
  font-size: 10px;
  font-weight: 900;
  padding: 1px 6px;
}
.r10-ren-dark-tooltip .tt-green {
  color: #4ade80;
  font-weight: 900;
  font-size: 11.5px;
  margin: 4px 0;
}
.r10-ren-dark-tooltip .tt-desc {
  font-size: 11px;
  color: #f1f5f9;
  line-height: 1.35;
}
.r10-ren-dark-tooltip .tt-perm {
  margin-top: 5px;
  font-size: 11.5px;
  font-weight: 900;
  color: #fde047;
}

.r10-smithy-bottom-currencies {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.r10-sm-cur-box {
  background: #f8fafc;
  border: 2px solid #784d22;
  border-radius: 6px;
  padding: 3px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #1e293b;
}

/* =====================================================================
   3. GIAO DIỆN SHOP KÈM PHÒNG THỬ ĐỒ (images.jpeg)
   ===================================================================== */
.r10-shop-master-wrap {
  display: grid;
  grid-template-columns: 245px 1fr;
  gap: 10px;
  padding: 6px 8px 8px;
  background: #5a3818;
  border-radius: 0 0 12px 12px;
}

.r10-shop-left-fitting {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.r10-fitting-stage {
  position: relative;
  height: 335px;
  background: linear-gradient(180deg, #fef9c3 0%, #fde68a 58%, #d97706 100%);
  border: 3px solid #8c6230;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.r10-fitting-awning {
  width: 100%;
  height: 44px;
  object-fit: cover;
  position: relative;
  z-index: 3;
}

/* Sàn Caro 3D dưới chân nhân vật mặc thử */
.r10-fitting-checkered-floor {
  position: absolute;
  left: -15%;
  right: -15%;
  bottom: 0;
  height: 125px;
  background-color: #fef3c7;
  background-image:
    linear-gradient(45deg, #92400e 25%, transparent 25%),
    linear-gradient(-45deg, #92400e 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #92400e 75%),
    linear-gradient(-45deg, transparent 75%, #92400e 75%);
  background-size: 28px 28px;
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
  transform: perspective(180px) rotateX(42deg);
  opacity: 0.55;
  z-index: 1;
}

#shop-tryon-canvas {
  position: relative;
  z-index: 2;
  margin-top: -6px;
}

.r10-fitting-btns-row {
  position: relative;
  z-index: 3;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 10px 8px;
}

.r10-fit-undo-btn {
  width: 62px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(180deg, #38bdf8, #0284c7);
  border: 2px solid #bae6fd;
  color: #fde047;
  font-weight: 900;
  font-size: 18px;
  cursor: pointer;
}

.r10-fit-an-btn {
  width: 96px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(180deg, #84cc16, #4d7c0f);
  border: 2px solid #ecfccb;
  color: #fff;
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
}

.r10-shop-wallet-card {
  background: #dec397;
  border: 3px solid #8c6230;
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.r10-wallet-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #fff;
  text-shadow: 0 1px 2px #451a03;
}

/* Khung Phải Shop: 5 Tab Ngang + Lưới 2x3 Thẻ Sản Phẩm */
.r10-shop-right-catalog {
  display: flex;
  flex-direction: column;
}

.r10-shop-5tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 0 6px;
}

.r10-shop-tab-btn {
  height: 36px;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, #f97316 0%, #c2410c 100%);
  border: 2px solid #fdba74;
  border-bottom: none;
  color: #ffedd5;
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
}
.r10-shop-tab-btn.active {
  background: linear-gradient(180deg, #fef08a 0%, #facc15 55%, #d97706 100%);
  border-color: #fffbeb;
  color: #78350f;
  text-shadow: 0 1px 0 #fff;
}

.r10-shop-showcase-board {
  flex: 1;
  background: #61472e;
  border: 3px solid #a17439;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.r10-shop-sub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.r10-shop-sub-ribbon {
  background: linear-gradient(180deg, #fde047, #eab308);
  color: #78350f;
  font-weight: 900;
  font-size: 13px;
  padding: 3px 16px;
  border-radius: 6px 6px 0 0;
}
.r10-shop-sub-days {
  color: #f8fafc;
  font-weight: 800;
  font-size: 13px;
}

.r10-shop-2x3-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(3, 98px);
  gap: 8px;
  background: #dec397;
  border: 2px solid #8c6230;
  border-radius: 8px;
  padding: 8px;
}

.r10-shop-item-card {
  background: linear-gradient(180deg, #edd8b4 0%, #DFC394 100%);
  border: 2px solid #a17439;
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.r10-shop-item-card:hover,
.r10-shop-item-card.previewing {
  border-color: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.r10-shop-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: radial-gradient(circle, #3b1906 0%, #170802 90%);
  border: 2px solid #784d22;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.r10-shop-icon-wrap img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.r10-corner-tag {
  position: absolute;
  left: -4px;
  top: -4px;
  font-size: 10px;
  font-weight: 900;
  color: #fff;
  padding: 1px 7px;
  border-radius: 5px;
  border: 1px solid #fff;
}
.r10-corner-tag.tot { background: linear-gradient(180deg, #f97316, #c2410c); }
.r10-corner-tag.moi { background: linear-gradient(180deg, #06b6d4, #0284c7); }

.r10-shop-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 2px 0;
}
.r10-shop-item-name {
  font-weight: 900;
  font-size: 13.5px;
  color: #5c280b;
}

.r10-shop-green-buy-btn {
  width: 100%;
  height: 34px;
  border-radius: 7px;
  background: linear-gradient(180deg, #84cc16 0%, #4d7c0f 65%, #365314 100%);
  border: 2px solid #ecfccb;
  color: #fff;
  font-weight: 900;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

.r10-shop-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-left: 120px;
}

.r10-shop-cur-switch {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #fde047;
}
.r10-cur-sw-btn {
  padding: 4px 12px;
  font-weight: 900;
  font-size: 12px;
  border: none;
  cursor: pointer;
}
.r10-cur-sw-btn.xu { background: #facc15; color: #78350f; }
.r10-cur-sw-btn.hc { background: #0284c7; color: #fff; }

/* =====================================================================
   4. GIAO DIỆN PHÒNG CHỜ 7029 CHUẨN 1:1 ẢNH MẪU (thumb-2.jpg)
   ===================================================================== */
#screen-room-prep {
  background: linear-gradient(180deg, #3b220c 0%, #1f1105 100%) !important;
}

.r10-room7029-shell {
  width: 100%;
  height: 100%;
  padding: 8px 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  background: #6e4e2a;
  border: 4px solid #b48a52;
}

.r10-room7029-top {
  flex: 1;
  display: grid;
  grid-template-columns: 420px 1fr 275px;
  gap: 8px;
  min-height: 0;
}

/* Cột Trái: Lưới 2x2 = 4 Ô Vị Trí Người Chơi */
.r10-room-left-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  background: #8c6639;
  border: 3px solid #4a2c11;
  border-radius: 10px;
  padding: 8px;
}

.r10-slot-card {
  position: relative;
  border-radius: 10px;
  border: 3px solid #6b4423;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.r10-slot-card.host-active {
  background: radial-gradient(circle at 50% 50%, #fffbeb 0%, #e7d1a7 100%);
  padding: 5px 6px;
}

.r10-slot-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 3;
}
.r10-host-name {
  font-weight: 900;
  font-size: 13px;
  color: #fde047;
  text-shadow: 0 1px 3px #000, 0 0 4px #000;
}
.r10-host-mini-icons {
  font-size: 11px;
}

.r10-slot-magic-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.r10-slot-magic-ring {
  position: absolute;
  width: 156px;
  height: 156px;
  object-fit: contain;
  pointer-events: none;
}
#room-prep-player-canvas {
  position: relative;
  z-index: 2;
}

.r10-slot-right-badges {
  position: absolute;
  right: 5px;
  top: 26px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}
.r10-badge-gold {
  background: linear-gradient(180deg, #fde047, #ca8a04);
  border: 1.5px solid #78350f;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 11px;
  color: #451a03;
}
.r10-badge-vip {
  background: linear-gradient(180deg, #dc2626, #7f1d1d);
  border: 1.5px solid #fde047;
  border-radius: 6px;
  padding: 1px 5px;
  font-size: 9.5px;
  font-weight: 900;
  color: #fef08a;
}
.r10-badge-guild {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #3b0764;
  border: 1.5px solid #facc15;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.r10-slot-bottom-strip {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.r10-host-tag {
  font-weight: 900;
  font-size: 14px;
  color: #fff;
  text-shadow: 0 2px 3px #000, 0 0 5px #78350f;
}
.r10-host-lv {
  background: #451a03;
  border: 1.5px solid #facc15;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 900;
  color: #fde047;
}
.r10-host-wp-sub {
  position: relative;
  z-index: 3;
  font-size: 10px;
  font-weight: 800;
  color: #78350f;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ô 2 & Ô 3: Đang chờ...... ♡ */
.r10-slot-card.waiting-slot {
  background: radial-gradient(circle, #f5ead4 0%, #dfc9a3 100%);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.r10-waiting-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.r10-waiting-silhouette {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.r10-sil-icon {
  font-size: 46px;
  opacity: 0.18;
  filter: sepia(1);
}
.r10-waiting-txt {
  font-weight: 900;
  font-size: 16px;
  color: #fff;
  text-shadow: 0 1px 3px #78350f, 0 0 4px #451a03;
}
.r10-slot-invisible-btn {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.r10-ally-filled {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px;
}
.r10-ready-stamp {
  margin-top: 4px;
  background: #16a34a;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 99px;
}

/* Ô 4: Dấu X lớn Click chọn mở */
.r10-slot-card.closed-slot {
  background:
    radial-gradient(circle, #b58d59 0%, #8c6639 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.r10-closed-x-mark {
  font-size: 74px;
  font-weight: 900;
  color: #5c3a16;
  line-height: 1;
  opacity: 0.85;
}
.r10-closed-label {
  font-weight: 900;
  font-size: 17px;
  color: #e7d1a7;
  text-shadow: 0 2px 3px #291505;
}

/* Cột Giữa: Poster VS + Thông Tin Phòng */
.r10-room-center-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.r10-vs-poster-box {
  flex: 1;
  position: relative;
  border-radius: 10px;
  border: 3px solid #4a2c11;
  overflow: hidden;
  background: #0f172a;
}
.r10-vs-poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.r10-vs-rules-overlay {
  display: none; /* Poster gốc room_vs_poster.png đã có sẵn hộp Đấu Đội cực nét */
}

.r10-room-info-panel {
  height: 92px;
  background: #d8c29d;
  border: 3px solid #6b4423;
  border-radius: 10px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
}
.r10-room-info-vtitle {
  width: 28px;
  background: #8c6639;
  color: #fef3c7;
  writing-mode: vertical-rl;
  font-weight: 900;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 2px solid #6b4423;
}
.r10-room-info-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  gap: 10px;
}
.r10-all-star-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle, #fb923c 0%, #ea580c 75%);
  border: 3px solid #fde047;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  text-shadow: 0 2px 3px #7c2d12;
  box-shadow: 0 3px 6px rgba(0,0,0,0.35);
}
.r10-map-time-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.r10-map-name-pill {
  background: rgba(107, 68, 35, 0.22);
  border: 1.5px solid #8c6639;
  border-radius: 6px;
  padding: 4px 10px;
  font-weight: 900;
  font-size: 14px;
  color: #fff;
  text-shadow: 0 1px 3px #451a03;
  text-align: center;
}
.r10-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.r10-time-val {
  font-weight: 900;
  font-size: 14px;
  color: #fff;
  text-shadow: 0 1px 3px #000;
}
.r10-diff-mini-group {
  display: flex;
  gap: 4px;
}
.r10-diff-mini-group .room-diff-btn {
  background: #784d22;
  border: 1px solid #d6b272;
  color: #fef3c7;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
}
.r10-diff-mini-group .room-diff-btn.active {
  background: #facc15;
  color: #451a03;
  border-color: #fff;
}
.r10-gear-cfg-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fb923c, #c2410c);
  border: 2px solid #fde68a;
  font-size: 18px;
  cursor: pointer;
}

/* Cột Phải: Phòng 7029 + Z/X/C + Đạo cụ + Quan chiến + 3 Nút Vuông Lớn */
.r10-room-right-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.r10-right-wood-frame {
  flex: 1;
  background: #b58d59;
  border: 3px solid #4a2c11;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.r10-room-num-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.r10-room-lbl {
  font-weight: 900;
  font-size: 18px;
  color: #fde047;
  text-shadow: 0 2px 3px #000;
}
.r10-room-lbl b {
  color: #38bdf8;
  font-size: 20px;
}
.r10-channel-btn {
  background: #5c3a16;
  border: 1.5px solid #d6b272;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 900;
  color: #fef3c7;
}

.r10-mode-bar {
  background: #8c6639;
  border: 1.5px solid #5c3a16;
  border-radius: 6px;
  padding: 3px 0;
  text-align: center;
  font-weight: 900;
  font-size: 13px;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}

.r10-sec-label {
  font-weight: 900;
  font-size: 13px;
  color: #fef3c7;
  text-shadow: 0 1px 2px #000;
}

.r10-zxc-row {
  display: flex;
  gap: 8px;
}
.r10-zxc-box {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: linear-gradient(180deg, #84cc16, #4d7c0f);
  border: 2px solid #ecfccb;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.r10-zxc-box .zxc-key {
  position: absolute;
  left: 3px;
  top: 1px;
  font-weight: 900;
  font-size: 12px;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}
.r10-zxc-box img { width: 32px; height: 32px; object-fit: contain; }

.r10-daocu-scroll-box {
  height: 96px;
  background: #6b4423;
  border: 2px solid #3d230c;
  border-radius: 8px;
  padding: 5px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.r10-wp-mini-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.r10-daocu-wp-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 251, 235, 0.14);
  border: 1.5px solid transparent;
  border-radius: 6px;
  padding: 3px 6px;
  cursor: pointer;
}
.r10-daocu-wp-item.active {
  background: rgba(250, 204, 21, 0.25);
  border-color: #fde047;
}
.r10-daocu-wp-item img { width: 28px; height: 28px; object-fit: contain; }
.r10-daocu-wp-item .wp-txt {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  color: #fff;
}
.r10-daocu-wp-item .wp-txt small { font-size: 9.5px; color: #fde047; }

.r10-sk-mini-list {
  display: flex;
  gap: 4px;
  padding-top: 2px;
}
.r10-mini-sk-ico {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: #291505;
  border: 1px solid #d6b272;
}
.r10-mini-sk-ico.off { opacity: 0.35; filter: grayscale(1); }

.r10-spectator-btn {
  width: 100%;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(180deg, #784d22, #4a2c11);
  border: 2px solid #d6b272;
  color: #e7d1a7;
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
}

.r10-three-big-btns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  height: 86px;
}
.r10-big-sq-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.12s ease;
}
.r10-big-sq-btn img {
  width: 100%;
  height: 100%;
  object-fit: fill;
}
.r10-big-sq-btn:hover { transform: scale(1.04); }

/* Phần Đáy Phòng Chờ 7029: Khung Chat Trái + Thanh Dock Cổ Điển Phải */
.r10-room7029-bottom {
  height: 145px;
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 10px;
}

.r10-chat-panel {
  background: #3d2814;
  border: 2.5px solid #8c6639;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px 6px;
}
.r10-chat-tabs {
  display: flex;
  gap: 4px;
}
.r10-chat-tab {
  background: #6b4423;
  border: 1.5px solid #a17439;
  border-radius: 6px 6px 0 0;
  padding: 2px 12px;
  color: #e7d1a7;
  font-weight: 800;
  font-size: 11.5px;
  cursor: pointer;
}
.r10-chat-tab.active {
  background: #c89d54;
  color: #291505;
}
.r10-chat-messages {
  flex: 1;
  background: rgba(15, 8, 2, 0.65);
  border: 1px solid #6b4423;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11.5px;
  line-height: 1.42;
  overflow-y: auto;
}
.chat-tag {
  display: inline-block;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 900;
  background: #475569;
  color: #fff;
}
.chat-tag.c { background: #ca8a04; }
.chat-tag.up { background: #16a34a; }
.chat-tag.down { background: #d97706; }

.r10-chat-input-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
}
.r10-chat-cur-channel {
  background: #1e293b;
  color: #f8fafc;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
}
#room-prep-chat-input {
  flex: 1;
  background: #140c04;
  border: 1px solid #8c6639;
  border-radius: 4px;
  color: #fff;
  font-size: 11.5px;
  padding: 2px 8px;
}
.r10-chat-send-btn {
  background: #d97706;
  border: 1px solid #fde047;
  color: #fff;
  border-radius: 4px;
  padding: 1px 8px;
  cursor: pointer;
}

.r10-classic-dock {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 4px 8px;
  background: linear-gradient(180deg, rgba(92,58,22,0.35), rgba(41,21,5,0.75));
  border: 2px solid #8c6639;
  border-radius: 10px;
}
.r10-dock-napxu {
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, #fb923c, #dc2626);
  border: 2.5px solid #fde047;
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  text-shadow: 0 1px 2px #000;
  cursor: pointer;
}
.r10-dock-icon-btn {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  color: #fef3c7;
  font-weight: 900;
  font-size: 11px;
  text-shadow: 0 1px 2px #000;
}
.r10-dock-icon-btn img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,0.65));
}
.r10-dock-icon-btn:hover { transform: translateY(-3px); }

/* Fix 1: Xóa nền xanh cũ của #bag-dollhouse-canvas để lộ Vòng Ma Pháp Đỏ chuẩn gunny-mobi-3-1.jpg */
#bag-dollhouse-canvas {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Fix 2: Cân chỉnh chiều cao chuẩn khít 100% cho Phòng Chờ 7029 (thumb-2.jpg) không bị tràn khung dưới */
.r10-room7029-shell {
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  padding: 6px 8px !important;
  gap: 6px !important;
}
.r10-room7029-top {
  height: calc(100% - 134px) !important;
  max-height: calc(100% - 134px) !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
.r10-room-left-2x2,
.r10-room-center-col,
.r10-room-right-col {
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
.r10-slot-card {
  min-height: 0 !important;
  padding: 4px 6px !important;
}
.r10-slot-magic-wrap {
  min-height: 0 !important;
  max-height: 145px !important;
}
.r10-slot-magic-ring {
  width: 138px !important;
  height: 138px !important;
}
#room-prep-player-canvas {
  width: 138px !important;
  height: 142px !important;
}
.r10-vs-poster-box {
  height: calc(100% - 88px) !important;
  max-height: calc(100% - 88px) !important;
  min-height: 0 !important;
}
.r10-vs-poster-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: fill !important;
}
.r10-room-info-panel {
  height: 80px !important;
  flex-shrink: 0 !important;
}
.r10-right-wood-frame {
  height: calc(100% - 82px) !important;
  max-height: calc(100% - 82px) !important;
  min-height: 0 !important;
  padding: 6px 8px !important;
  gap: 3px !important;
}
.r10-zxc-box {
  width: 42px !important;
  height: 42px !important;
}
.r10-daocu-scroll-box {
  height: 78px !important;
  min-height: 0 !important;
}
.r10-spectator-btn {
  height: 28px !important;
  font-size: 13px !important;
}
.r10-three-big-btns {
  height: 74px !important;
  flex-shrink: 0 !important;
}
.r10-room7029-bottom {
  height: 126px !important;
  flex-shrink: 0 !important;
}

/* =====================================================================
   ROUND 11 (v4.3.0): TÁCH BIỆT TRANG BỊ VS THỜI TRANG & 6 BẬC VÒNG SÁNG VŨ KHÍ
   ===================================================================== */
.r11-aura-tier-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  background: rgba(69, 26, 3, 0.85);
  border: 1.5px solid #d97706;
  border-radius: 8px;
  padding: 3px 8px;
  margin-bottom: 3px;
  font-size: 11px;
  font-weight: 900;
  color: #fde68a;
}

.r11-aura-lv-btn {
  background: #451a03;
  border: 1.5px solid #b45309;
  border-radius: 5px;
  padding: 1px 6px;
  color: #fed7aa;
  font-weight: 900;
  font-size: 10.5px;
  cursor: pointer;
}
.r11-aura-lv-btn.active {
  background: linear-gradient(180deg, #fde047, #d97706);
  color: #451a03;
  border-color: #fff;
  box-shadow: 0 0 6px #facc15;
}

.r10-starry-slot.fashion-slot-border {
  border-color: #f472b6 !important;
  box-shadow: inset 0 0 8px rgba(131, 24, 67, 0.75), 0 2px 4px rgba(0,0,0,0.35) !important;
}

.slot-str.tt-tag {
  background: linear-gradient(180deg, #ec4899, #be185d) !important;
  border-color: #fbcfe8 !important;
  color: #fff !important;
  font-size: 9px !important;
}

.r11-slot-sublabel {
  position: absolute;
  bottom: 2px;
  left: 2px;
  right: 2px;
  text-align: center;
  font-size: 8.5px;
  font-weight: 900;
  color: #fde68a;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
  pointer-events: none;
}

.r11-bag-tab-indicator {
  background: linear-gradient(90deg, #451a03, #78350f, #451a03);
  border: 1.5px solid #b45309;
  border-radius: 6px;
  padding: 3px 8px;
  margin-bottom: 5px;
  color: #fef08a;
  font-size: 10.5px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.r10-bag-magic-circle {
  animation: r11SpinSlow 16s linear infinite;
}
@keyframes r11SpinSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Fix 3: Đảm bảo 3 Tab Dọc (Trang bị | Thời trang | Đạo cụ) luôn nằm gọn 100% trong khung Modal Cá Nhân */
.r10-bag-two-cols {
  grid-template-columns: 386px minmax(0, 1fr) !important;
}
.r10-bag-right-card,
.r10-bag-grid-and-tabs,
.r10-bag-cream-board {
  min-width: 0 !important;
}
.r10-bag-4x4-grid {
  grid-template-rows: repeat(4, 66px) !important;
  gap: 6px !important;
}
.r10-starry-bag-cell {
  height: 66px !important;
}

/* =====================================================================
   ROUND 12 (v4.4.0): KHẮC PHỤC TRIỆT ĐỂ LỖI TRÀN Ô TRANG BỊ/THỜI TRANG,
   THANH 4 NÚT ẨN THỜI TRANG CHUẨN GUNNY & BỐ CỤC PHÒNG CHỜ 7029 1:1 THUMB-2.JPG
   ===================================================================== */

/* 1. Khóa chặt kích thước & chống tràn 100% cho mọi ô Trang Bị & Thời Trang */
.r10-starry-slot,
.r10-starry-bag-cell,
.r10-trang-suc-slot {
  position: relative !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.r10-starry-slot .slot-str,
.r10-starry-bag-cell .slot-str {
  position: absolute !important;
  top: 3px !important;
  left: 3px !important;
  right: auto !important;
  z-index: 5 !important;
  background: rgba(220, 38, 38, 0.94) !important;
  border: 1px solid #fde047 !important;
  border-radius: 5px !important;
  padding: 0 4px !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  color: #fef08a !important;
  line-height: 1.25 !important;
  pointer-events: none !important;
  max-width: calc(100% - 8px) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.r10-starry-slot .slot-icon {
  position: relative !important;
  width: 42px !important;
  height: 42px !important;
  max-width: 42px !important;
  max-height: 42px !important;
  margin-bottom: 10px !important;
  object-fit: contain !important;
  z-index: 2 !important;
}

.r10-starry-bag-cell .slot-icon {
  width: 44px !important;
  height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  object-fit: contain !important;
}

.r11-slot-sublabel {
  position: absolute !important;
  bottom: 2px !important;
  left: 2px !important;
  right: 2px !important;
  background: rgba(9, 22, 48, 0.78) !important;
  border-radius: 0 0 6px 6px !important;
  padding: 1px 2px !important;
  font-size: 8.5px !important;
  font-weight: 900 !important;
  color: #fde68a !important;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  z-index: 4 !important;
}

/* Giữ Vòng Sáng & Cánh Nhân Vật nằm gọn trong khung giữa, không đè lên 2 cột ô trang bị */
.r10-bag-center-doll {
  position: relative !important;
  height: 206px !important;
  overflow: hidden !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.r10-bag-magic-circle {
  width: 162px !important;
  height: 162px !important;
  object-fit: contain !important;
}

/* 2. Thanh 4 Công Tắc Ẩn Thời Trang Chuẩn Gunny (Ẩn Nón | Ẩn Kính | Ẩn Bộ TT | Ẩn Cánh) */
.r12-hide-fashion-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  background: rgba(12, 74, 110, 0.88);
  border: 1.5px solid #38bdf8;
  border-radius: 8px;
  padding: 2.5px 6px;
  margin-bottom: 4px;
}

.r12-hide-lbl {
  font-size: 10px;
  font-weight: 900;
  color: #bae6fd;
}

.r12-hide-pill {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid #7dd3fc;
  border-radius: 5px;
  padding: 1px 6px;
  color: #e0f2fe;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.r12-hide-pill.active {
  background: linear-gradient(180deg, #38bdf8, #0284c7);
  color: #fff;
  border-color: #fef08a;
  box-shadow: 0 0 5px rgba(56, 189, 248, 0.75);
}

/* 3. BỐ CỤC PHÒNG CHỜ 7029 CHUẨN 1:1 ẢNH MẪU THUMB-2.JPG (CHIA 2 NỬA TRÁI - PHẢI) */
.r12-room7029-master {
  width: 100%;
  height: 100vh;
  max-height: 100vh;
  box-sizing: border-box;
  padding: 8px 10px;
  background: linear-gradient(180deg, #7c5832 0%, #5c3e1e 100%);
  border: 4px solid #b48a52;
  display: grid;
  grid-template-columns: 48.2% 1fr;
  gap: 8px;
  overflow: hidden;
}

/* Nửa Trái: Trên là Lưới 2x2 Ô Người Chơi (66%), Dưới là Khung Chat Hệ Thống (34%) */
.r12-room-left-half {
  display: grid;
  grid-template-rows: 66% 1fr;
  gap: 8px;
  height: 100%;
  min-height: 0;
}

.r12-left-slots-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  background: #8c6639;
  border: 3px solid #4a2c11;
  border-radius: 10px;
  padding: 8px;
  min-height: 0;
}

.r12-slot-card {
  position: relative;
  border-radius: 10px;
  border: 2.5px solid #5c3a16;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
}

.r12-slot-card.host-active {
  background: radial-gradient(circle at 50% 50%, #fffbeb 0%, #e7d1a7 100%);
  padding: 4px 7px;
}

.r12-slot-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 3;
}
.r12-host-name {
  font-weight: 900;
  font-size: 13px;
  color: #fde047;
  text-shadow: 0 1px 3px #000, 0 0 4px #000;
}
.r12-host-mini-icons { font-size: 11px; }

.r12-slot-magic-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.r12-slot-magic-ring {
  position: absolute;
  width: 132px;
  height: 132px;
  object-fit: contain;
  pointer-events: none;
  animation: r11SpinSlow 16s linear infinite;
}

.r12-slot-right-badges {
  position: absolute;
  right: 5px;
  top: 24px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
}

.r12-slot-bottom-strip {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.r12-host-tag {
  font-weight: 900;
  font-size: 13.5px;
  color: #fff;
  text-shadow: 0 2px 3px #000, 0 0 5px #78350f;
}
.r12-host-lv {
  background: #451a03;
  border: 1.5px solid #facc15;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 10.5px;
  font-weight: 900;
  color: #fde047;
}
.r12-host-wp-sub {
  position: relative;
  z-index: 3;
  font-size: 9.5px;
  font-weight: 800;
  color: #78350f;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ô 2 & Ô 3 dùng trực tiếp nền gốc room_slot_waiting.png từ thumb-2.jpg */
.r12-slot-card.waiting-slot {
  background: radial-gradient(circle at 50% 45%, #f9eed8 0%, #e4cda4 72%, #cfb07c 100%);
  cursor: pointer;
}
.r12-waiting-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.r12-waiting-inner:not(:empty) {
  background: radial-gradient(circle, #fffbeb 0%, #e7d1a7 100%);
}

/* Ô 4 dùng trực tiếp nền gốc room_slot_closed.png từ thumb-2.jpg */
.r12-slot-card.closed-slot {
  background: radial-gradient(circle at 50% 45%, #b38856 0%, #8f6537 75%, #6e4a23 100%);
  cursor: pointer;
}

.r12-chat-panel {
  background: #3d2814;
  border: 2.5px solid #8c6639;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px 6px;
  min-height: 0;
}

/* Nửa Phải: Trên là 2 nhánh [Poster VS + Thông tin phòng] và [Phòng 7029 + 3 Nút Lớn], Dưới là Thanh Dock */
.r12-room-right-half {
  display: grid;
  grid-template-rows: 1fr 78px;
  gap: 8px;
  height: 100%;
  min-height: 0;
}

.r12-right-upper-grid {
  display: grid;
  grid-template-columns: 54% 1fr;
  gap: 8px;
  min-height: 0;
}

.r12-center-subcol,
.r12-far-right-subcol {
  display: grid;
  grid-template-rows: 1fr 94px;
  gap: 8px;
  min-height: 0;
}

.r12-vs-poster-frame {
  border-radius: 10px;
  border: 3px solid #4a2c11;
  overflow: hidden;
  background: #0f172a;
  min-height: 0;
}
.r12-vs-poster-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.r12-room-info-card {
  background: #d8c29d;
  border: 3px solid #6b4423;
  border-radius: 10px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
}
.r12-info-vlabel {
  width: 26px;
  background: #8c6639;
  color: #fef3c7;
  writing-mode: vertical-rl;
  font-weight: 900;
  font-size: 10.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 2px solid #6b4423;
}
.r12-info-main-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  gap: 8px;
}
.r12-star-all {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle, #fb923c 0%, #ea580c 78%);
  border: 2.5px solid #fde047;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 16px;
  text-shadow: 0 2px 3px #7c2d12;
  flex-shrink: 0;
}
.r12-info-mid-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.r12-info-map-box {
  background: rgba(107, 68, 35, 0.25);
  border: 1.5px solid #8c6639;
  border-radius: 6px;
  padding: 3px 8px;
  font-weight: 900;
  font-size: 13px;
  color: #fff;
  text-shadow: 0 1px 3px #451a03;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.r12-info-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.r12-seven-sec {
  font-weight: 900;
  font-size: 13px;
  color: #fff;
  text-shadow: 0 1px 3px #000;
}
.r12-corner-gear-btn {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: linear-gradient(180deg, #fb923c, #c2410c);
  border: 2px solid #fde68a;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
}

.r12-room7029-wood-box {
  background: #b58d59;
  border: 3px solid #4a2c11;
  border-radius: 10px;
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
}

.r12-daocu-brown-well {
  flex: 1;
  min-height: 0;
  max-height: 112px;
  background: #6b4423;
  border: 2px solid #3d230c;
  border-radius: 8px;
  padding: 5px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.r12-three-big-btns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  height: 94px;
}

.r12-classic-bottom-dock {
  background: linear-gradient(180deg, #5c3a16 0%, #3b220c 100%);
  border: 2.5px solid #a17439;
  border-radius: 10px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.r12-dock-napxu-btn {
  height: 40px;
  padding: 0 14px;
  border-radius: 9px;
  background: linear-gradient(180deg, #fb923c 0%, #dc2626 100%);
  border: 2px solid #fde047;
  color: #fff;
  font-weight: 900;
  font-size: 14px;
  text-shadow: 0 1px 2px #000;
  cursor: pointer;
}

.r12-dock-item {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  cursor: pointer;
  color: #fef3c7;
  font-weight: 900;
  font-size: 10.5px;
  text-shadow: 0 1px 2px #000;
}
.r12-dock-item img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.65));
}
.r12-dock-item:hover { transform: translateY(-2px); }


/* ==========================================================================
   ROUND 13 (v4.5.0) – NATIVE INTERACTIVE ROOM 7029, SHOP AWNING & BATTLE WEAPON ANGLE BAR
   ========================================================================== */
.r12-slot-card {
  position: relative;
  border: 2.5px solid #6b4423;
  box-shadow: inset 0 0 0 2px rgba(254, 243, 199, 0.45), 0 3px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.r12-slot-card.waiting-slot:hover,
.r12-slot-card.closed-slot:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 2px #fde047, 0 5px 12px rgba(0, 0, 0, 0.48);
}

.r13-slot-compass-bg {
  position: absolute;
  inset: 10px;
  border: 1.5px dashed rgba(120, 53, 15, 0.25);
  border-radius: 10px;
  pointer-events: none;
}

.r13-waiting-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  padding: 8px;
  z-index: 2;
}
.r13-waiting-silhouette {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(146, 64, 14, 0.14);
  border: 2px dashed rgba(146, 64, 14, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #92400e;
}
.r13-waiting-text {
  font-weight: 900;
  font-size: 16px;
  color: #fffbeb;
  text-shadow: 0 2px 0 #78350f, -1px -1px 0 #78350f, 1px -1px 0 #78350f, -1px 1px 0 #78350f, 1px 1px 0 #78350f;
  letter-spacing: 0.4px;
}
.r13-waiting-sub {
  font-size: 10px;
  font-weight: 800;
  color: #78350f;
  background: rgba(254, 243, 199, 0.78);
  padding: 1px 7px;
  border-radius: 999px;
}

.r13-slot-action-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 4;
  background: linear-gradient(180deg, #fb923c, #c2410c);
  border: 1.5px solid #fde047;
  color: #fff;
  font-weight: 900;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  cursor: pointer;
  text-shadow: 0 1px 2px #000;
}

.r13-closed-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 2;
}
.r13-big-cross-x {
  font-size: 56px;
  line-height: 1;
  font-weight: 900;
  color: rgba(69, 26, 3, 0.68);
  text-shadow: 0 2px 0 rgba(254, 243, 199, 0.35);
}
.r13-closed-label {
  font-weight: 900;
  font-size: 16px;
  color: #fde68a;
  text-shadow: 0 2px 0 #451a03, -1px -1px 0 #451a03, 1px -1px 0 #451a03;
}

/* 3 Nút Vuông Lớn Phòng Chờ 7029 dựng bằng DOM/CSS thật */
.r13-native-big-btn {
  position: relative;
  border-radius: 11px;
  border: 2.5px solid #fde047;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.45), 0 4px 8px rgba(0, 0, 0, 0.5);
  transition: transform 0.12s ease, filter 0.12s ease;
  padding: 4px;
  overflow: hidden;
}
.r13-native-big-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}
.r13-native-big-btn:active {
  transform: translateY(1px);
}
.r13-native-big-btn.invite {
  background: radial-gradient(circle at 50% 30%, #38bdf8 0%, #0284c7 65%, #0369a1 100%);
}
.r13-native-big-btn.cross {
  background: radial-gradient(circle at 50% 30%, #94a3b8 0%, #475569 65%, #1e293b 100%);
}
.r13-native-big-btn.start {
  background: radial-gradient(circle at 50% 25%, #facc15 0%, #ea580c 62%, #991b1b 100%);
  border-color: #fef08a;
}
.r13-btn-flag-badge {
  font-size: 18px;
  line-height: 1;
}
.r13-btn-plus-icon {
  font-size: 22px;
  line-height: 1;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.6));
}
.r13-btn-server-ico {
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.65));
}
.r13-btn-vs-ico {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.75));
}
.r13-btn-main-txt {
  font-weight: 900;
  font-size: 13.5px;
  line-height: 1.05;
  color: #ffffff;
  text-align: center;
  text-shadow: 0 2px 0 #0f172a, -1px -1px 0 #0f172a, 1px -1px 0 #0f172a;
}
.r13-btn-main-txt.start-txt {
  font-size: 15px;
  color: #fef08a;
  text-shadow: 0 2px 0 #451a03, -1px -1px 0 #451a03, 1px -1px 0 #451a03;
}

/* Mái hiên Phòng Thử Đồ trong Shop dựng bằng CSS Sọc Xanh-Trắng sắc nét */
.r13-native-shop-awning {
  position: relative;
  width: 100%;
  height: 36px;
  background: repeating-linear-gradient(
    90deg,
    #0ea5e9 0px,
    #0ea5e9 18px,
    #e0f2fe 18px,
    #e0f2fe 36px
  );
  border-bottom: 3px solid #0284c7;
  border-radius: 8px 8px 6px 6px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 10px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35);
  z-index: 3;
}
.r13-awning-badge {
  background: linear-gradient(180deg, #0284c7, #0369a1);
  border: 2px solid #bae6fd;
  border-radius: 7px;
  padding: 2px 10px;
  font-weight: 900;
  font-size: 12.5px;
  color: #ffffff;
  text-shadow: 0 1px 2px #082f49;
}

/* Thanh Đổi Nhanh Vũ Khí Trong Trận (#battle-weapon-quick-bar) */
.r13-battle-wp-switcher {
  position: absolute;
  top: 56px;
  left: 150px;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  max-width: 580px;
  background: rgba(15, 23, 42, 0.82);
  border: 1.5px solid rgba(250, 204, 21, 0.78);
  border-radius: 9px;
  padding: 3px 7px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55);
}
.r13-bwp-lbl {
  font-size: 10px;
  font-weight: 900;
  color: #fde047;
  margin-right: 2px;
}
.r13-bwp-pill {
  background: linear-gradient(180deg, #1e293b, #0f172a);
  border: 1px solid #64748b;
  color: #e2e8f0;
  font-size: 9.8px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.r13-bwp-pill:hover {
  border-color: #fde047;
  color: #fef08a;
}
.r13-bwp-pill.active {
  background: linear-gradient(180deg, #ea580c, #b91c1c);
  border-color: #fde047;
  color: #ffffff;
  box-shadow: 0 0 6px rgba(250, 204, 21, 0.65);
}




/* === ROUND 13 CONTINUATION: ORIGINAL GUNNY TUI (B) 19-SLOT + 7x7 GRID + GLOBAL TOOLTIP + DRAG & DROP === */
.r13c-window-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-right: 8px;
}
.r13c-tui-b-title {
  color: #fff6d6;
  font-weight: 900;
  font-size: 16px;
  text-shadow: 0 1px 2px #000, 0 0 6px rgba(255,190,60,0.5);
}
.r13c-header-right-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}
.r13c-hdr-btn {
  height: 24px;
  padding: 0 10px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  color: #3d1d00;
  background: linear-gradient(180deg, #ffe999 0%, #f3b93a 55%, #cf8719 100%);
  border: 1.5px solid #fff1b8;
  box-shadow: 0 2px 3px rgba(0,0,0,0.45), inset 0 1px 0 #fff;
}
.r13c-hdr-btn:hover {
  filter: brightness(1.08);
}

.r13c-tui-b-master {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-width: 0;
  gap: 6px;
  background: linear-gradient(180deg, #986330 0%, #7d4d21 50%, #5e3614 100%);
  border: 2px solid #f7ca65;
  border-radius: 8px;
  padding: 6px 8px 8px 8px;
  box-shadow: inset 0 1px 0 #ffe9a6;
  user-select: none;
}

/* 1. Top Horizontal Tabs (Thông tin cá nhân, Thú cưng, Tu luyện, Thẻ bài, Hộp quà, Vật Tổ, Châu báu, Phụ kiện, Ma Thạch, Ẩn) */
.r13c-top-horiz-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  background: linear-gradient(180deg, #74441b 0%, #573110 100%);
  border: 1.5px solid #b88444;
  border-radius: 6px;
  overflow-x: auto;
}
.r13c-htab-btn {
  padding: 3px 10px;
  min-height: 28px;
  border-radius: 6px;
  background: linear-gradient(180deg, #8f5724 0%, #653a13 55%, #4a280a 100%);
  border: 1.5px solid #cd964c;
  color: #f9dfa1;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.05;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,230,165,0.4), 0 2px 3px rgba(0,0,0,0.45);
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
}
.r13c-htab-btn:hover {
  filter: brightness(1.12);
}
.r13c-htab-btn.active {
  background: linear-gradient(180deg, #ff9933 0%, #dd4b12 55%, #a52706 100%);
  border-color: #ffe38f;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(255,155,40,0.7), inset 0 1px 0 #ffd89b;
}
.r13c-htab-btn.an-right {
  margin-left: auto;
  background: linear-gradient(180deg, #7f8c9a 0%, #4b5763 55%, #2f3842 100%);
  border-color: #b7c4d1;
  color: #eef5fc;
}

/* 2. Two Main Panels Split */
.r13c-main-two-panels {
  display: grid;
  grid-template-columns: 462px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

/* Left Personal Panel */
.r13c-left-personal-panel {
  background: linear-gradient(180deg, #e7d8b5 0%, #dcc79b 60%, #ceb482 100%);
  border: 2px solid #693f18;
  border-radius: 7px;
  box-shadow: inset 0 0 0 1.5px #f7ebd2, 0 3px 8px rgba(0,0,0,0.45);
  padding: 5px 6px 6px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}
.r13c-section-ribbon-title {
  font-size: 12px;
  font-weight: 900;
  color: #fff3d1;
  background: linear-gradient(90deg, #653915 0%, #8d5424 65%, rgba(141,84,36,0) 100%);
  padding: 2px 8px;
  border-radius: 4px;
  text-shadow: 0 1px 2px #000;
}

/* Character Info Header */
.r13c-char-info-header {
  position: relative;
  background: linear-gradient(180deg, #b88446 0%, #98672e 50%, #7d5120 100%);
  border: 1.5px solid #5c3611;
  border-radius: 6px;
  padding: 4px 56px 4px 6px;
  box-shadow: inset 0 1px 0 rgba(255,235,180,0.5);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.r13c-info-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #f8e5b8;
  text-shadow: 0 1px 2px #000;
}
.r13c-orange-dot {
  font-size: 9px;
}
.r13c-title-select {
  height: 20px;
  max-width: 112px;
  background: linear-gradient(180deg, #fdf3d7 0%, #e4ca92 100%);
  border: 1px solid #593512;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 800;
  color: #3a1f06;
  padding: 0 3px;
}
.r13c-char-gold-name {
  font-size: 13px;
  font-weight: 900;
  color: #ffea6c;
  text-shadow: 0 1px 2px #000, 0 0 4px rgba(0,0,0,0.85);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.r13c-rank-txt b, .r13c-guild-txt b, .r13c-contrib-txt b {
  color: #ffffff;
  font-weight: 900;
}
.r13c-contrib-txt {
  margin-left: auto;
}
.r13c-hammer-emblem-btn {
  position: absolute;
  right: 4px;
  top: -3px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, #3a7bd5 0%, #16366f 65%, #091936 100%);
  border: 3px solid #f5c356;
  box-shadow: 0 3px 8px rgba(0,0,0,0.65), inset 0 0 6px #7ec0ff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 4px;
}
.r13c-hammer-emblem-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 19 Slots & Center Character Stage */
.r13c-paperdoll-and-19slots {
  display: grid;
  grid-template-columns: 46px 46px 1fr 46px 46px;
  gap: 4px;
  align-items: start;
  background: linear-gradient(180deg, #efe3c6 0%, #e4d2aa 100%);
  border: 1.5px solid #9c7a47;
  border-radius: 6px;
  padding: 5px;
  position: relative;
}
.r13c-slot-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.r13c-equip-slot {
  width: 46px;
  height: 46px;
  border-radius: 5px;
  background: linear-gradient(180deg, #dfd0b0 0%, #cbb68c 100%);
  border: 1.5px solid #96784a;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.22), 0 1px 0 rgba(255,255,255,0.65);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.1s, border-color 0.12s, box-shadow 0.12s;
}
.r13c-equip-slot.bottom-main-slot {
  width: 50px;
  height: 50px;
  border-width: 2px;
  border-color: #845e29;
}
.r13c-equip-slot.filled {
  background: radial-gradient(circle at 50% 45%, #314b7e 0%, #182747 72%, #0e172c 100%);
  border-color: #d6a449;
}
.r13c-equip-slot:hover, .r13c-equip-slot.selected {
  border-color: #ffcf4d;
  box-shadow: 0 0 8px rgba(255,205,70,0.85);
}
.r13c-slot-bg-label {
  font-size: 9px;
  font-weight: 800;
  color: #8b734b;
  text-align: center;
  line-height: 1.08;
  padding: 2px;
  pointer-events: none;
  z-index: 1;
}
.r13c-equip-slot.filled .r13c-slot-bg-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  font-size: 8px;
  color: #ffe8a3;
  background: rgba(12, 10, 8, 0.65);
  padding: 1px 0;
}
.r13c-slot-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.55));
}
.r13c-slot-str {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: 9.5px;
  font-weight: 900;
  color: #fff275;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
  z-index: 3;
  pointer-events: none;
}
.r13c-slot-lock {
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 9px;
  z-index: 3;
  pointer-events: none;
}
.r13c-slot-corner-badge {
  position: absolute;
  bottom: 1px;
  right: 2px;
  font-size: 10px;
  z-index: 3;
  pointer-events: none;
}

/* Center Character Stage */
.r13c-center-stage-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 196px;
}
.r13c-character-canvas-stage {
  position: relative;
  width: 100%;
  height: 142px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.r13c-stage-aura-ring {
  position: absolute;
  width: 132px;
  height: 132px;
  object-fit: contain;
  opacity: 0.9;
  pointer-events: none;
  animation: r13cAuraSpin 14s linear infinite;
}
@keyframes r13cAuraSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
#bag-dollhouse-canvas {
  position: relative;
  z-index: 2;
  width: 142px;
  height: 140px;
}
.r13c-stage-badges-right {
  position: absolute;
  left: 2px;
  top: 2px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 4;
}
.r13c-lv-gold-badge {
  background: linear-gradient(180deg, #ffd86b 0%, #cf8419 100%);
  border: 1.5px solid #fff3bd;
  color: #3b1b00;
  font-weight: 900;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  text-align: center;
}
.r13c-vip-mini-badge {
  background: linear-gradient(180deg, #f5f7fa 0%, #a3b1c6 100%);
  border: 1px solid #fff;
  color: #1f2d3d;
  font-weight: 900;
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 8px;
  cursor: pointer;
}
.r13c-stage-pet-float {
  position: absolute;
  right: 2px;
  top: 0;
  width: 44px;
  height: 44px;
  z-index: 4;
  cursor: pointer;
}
.r13c-stage-pet-float img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.55));
}
.r13c-aura-quick-dots {
  position: absolute;
  bottom: 0;
  right: 2px;
  display: flex;
  gap: 2px;
  z-index: 4;
}
.r13c-aura-dot {
  font-size: 8.5px;
  font-weight: 800;
  padding: 1px 3px;
  border-radius: 3px;
  background: rgba(40,25,10,0.75);
  color: #f5d78e;
  border: 1px solid #a67c38;
  cursor: pointer;
}
.r13c-aura-dot.active {
  background: #f39c12;
  color: #fff;
}
.r13c-bottom-3slots-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  margin-top: 2px;
}
.r13c-left-mini-orbs {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.r13c-mini-orb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #ffe494;
  background: radial-gradient(circle, #f39c12, #8e44ad);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.r13c-main-3slots-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 4 Hide Checkboxes Strip */
.r13c-hide-checkboxes-strip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: rgba(188, 159, 108, 0.55);
  border: 1px solid #967647;
  border-radius: 4px;
  padding: 2px 8px;
}
.r13c-an-title {
  font-size: 10px;
  font-weight: 900;
  color: #5b3811;
}
.r13c-an-chk {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 800;
  color: #3f2408;
  cursor: pointer;
}
.r13c-an-chk .chk-box {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  background: #fdf5e6;
  border: 1px solid #6e471b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #d35400;
  font-weight: 900;
}

/* 4.4. Bottom Attributes Board: EXP + LC + 6 Dark Boxes + 4 Colored Bars */
.r13c-attributes-bottom-board {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: linear-gradient(180deg, #d5c095 0%, #c2a878 100%);
  border: 1.5px solid #7e5a2b;
  border-radius: 6px;
  padding: 5px 6px;
}
.r13c-exp-lc-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}
.r13c-exp-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
}
.r13c-exp-wrap .exp-lbl {
  font-size: 10.5px;
  font-weight: 900;
  color: #4a2a08;
}
.r13c-exp-wrap .exp-bar-track {
  flex: 1;
  height: 13px;
  background: #2c1d0e;
  border: 1px solid #755329;
  border-radius: 7px;
  position: relative;
  overflow: hidden;
}
.r13c-exp-wrap .exp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f39c12 0%, #ffd84d 100%);
}
.r13c-exp-wrap .exp-bar-txt {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}
.r13c-lc-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #2c1b0b;
  border: 1.5px solid #b5853b;
  border-radius: 4px;
  padding: 1px 8px;
}
.r13c-lc-wrap .lc-lbl {
  font-size: 10.5px;
  font-weight: 900;
  color: #ffae42;
}
.r13c-lc-wrap .lc-val-box {
  font-size: 13px;
  font-weight: 900;
  color: #ffe97d;
  text-shadow: 0 1px 2px #000;
}

.r13c-stats-main-split {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  gap: 6px;
}
.r13c-left-6stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 6px;
}
.r13c-stat-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.r13c-stat-cell .s-lbl {
  font-size: 10px;
  font-weight: 800;
  color: #462809;
}
.r13c-stat-cell .s-val {
  min-width: 56px;
  height: 18px;
  background: #2d2114;
  border: 1px solid #8c6d43;
  border-radius: 3px;
  color: #fff6dc;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.75);
}

.r13c-right-4bars-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3px;
}
.r13c-bar-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  gap: 4px;
}
.r13c-bar-row .b-lbl {
  font-size: 10px;
  font-weight: 800;
  color: #462809;
  text-align: right;
}
.r13c-bar-row .b-track {
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.55);
  position: relative;
  overflow: hidden;
  background: #2b1e10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.r13c-bar-row .b-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
}
.r13c-bar-row .b-track.orange .b-fill { background: linear-gradient(180deg, #ffb347 0%, #e67e22 55%, #b85408 100%); }
.r13c-bar-row .b-track.blue .b-fill   { background: linear-gradient(180deg, #5bc0de 0%, #2980b9 55%, #16527a 100%); }
.r13c-bar-row .b-track.red .b-fill    { background: linear-gradient(180deg, #ff6b6b 0%, #d63031 55%, #8f1616 100%); }
.r13c-bar-row .b-track.green .b-fill  { background: linear-gradient(180deg, #88e060 0%, #4cd137 55%, #2b8a1b 100%); }
.r13c-bar-row .b-num {
  position: relative;
  z-index: 2;
  font-size: 11px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
}

/* Right Inventory Panel: 7x7 Grid + 3 Vertical Right Tabs + Action Buttons + Currencies */
.r13c-right-inventory-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(180deg, #dfd0b1 0%, #cfb98e 100%);
  border: 2px solid #693f18;
  border-radius: 7px;
  padding: 6px;
  box-shadow: inset 0 0 0 1.5px #f6ead1, 0 3px 8px rgba(0,0,0,0.45);
}
.r13c-grid-and-vtabs-wrap {
  display: grid;
  grid-template-columns: 1fr 40px;
  gap: 0;
  align-items: stretch;
}
.r13c-bag-grid-container {
  background: linear-gradient(180deg, #cbb58a 0%, #baa070 100%);
  border: 2px solid #7d592c;
  border-radius: 6px 0 6px 6px;
  padding: 5px;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.28);
}
.r13c-bag-7x7-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(7, 44px);
  gap: 4px;
}
.r13c-bag-grid-cell {
  position: relative;
  border-radius: 4px;
  background: linear-gradient(180deg, #e5d8bc 0%, #d4c29d 100%);
  border: 1.5px solid #8c6d42;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.22), 0 1px 0 rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}
.r13c-bag-grid-cell.filled {
  background: radial-gradient(circle at 50% 45%, #2b4470 0%, #16243f 72%, #0c1424 100%);
  border-color: #c59746;
}
.r13c-bag-grid-cell:hover, .r13c-bag-grid-cell.selected {
  border-color: #55efc4 !important;
  box-shadow: 0 0 8px rgba(85,239,196,0.85) !important;
}
.r13c-cell-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.5));
}
.r13c-cell-str {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: 9.5px;
  font-weight: 900;
  color: #ffe96b;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
  pointer-events: none;
}
.r13c-cell-qty {
  position: absolute;
  bottom: 1px;
  right: 2px;
  font-size: 9.5px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
  pointer-events: none;
}
.r13c-cell-lock {
  position: absolute;
  bottom: 1px;
  left: 2px;
  font-size: 9px;
  pointer-events: none;
}

/* 3 Vertical Tabs along Right Edge */
.r13c-right-vertical-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-left: -2px;
  padding-top: 4px;
}
.r13c-vtab {
  width: 40px;
  min-height: 102px;
  border-radius: 0 8px 8px 0;
  background: linear-gradient(90deg, #986836 0%, #784d22 100%);
  border: 2px solid #633b15;
  border-left: none;
  color: #f4dca6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 2px;
  cursor: pointer;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.35);
}
.r13c-vtab.active {
  background: linear-gradient(90deg, #e7d7b4 0%, #cfb889 100%);
  color: #462607;
  border-color: #7d592c;
  font-weight: 900;
  width: 42px;
  z-index: 3;
}
.r13c-vtab .vtab-ico {
  font-size: 14px;
}
.r13c-vtab .vtab-txt {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 11px;
  font-weight: 900;
}

/* Action Buttons & Page Switcher */
.r13c-action-buttons-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
}
.r13c-act-btn {
  flex: 1;
  height: 26px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.85);
  cursor: pointer;
  box-shadow: 0 2px 3px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.5);
}
.r13c-act-btn.blue {
  background: linear-gradient(180deg, #54c7ec 0%, #1c82b8 55%, #0f5682 100%);
  border: 1.5px solid #9be5ff;
}
.r13c-act-btn.red {
  background: linear-gradient(180deg, #ff7961 0%, #d93829 55%, #9c1c11 100%);
  border: 1.5px solid #ffb8ab;
}
.r13c-act-btn.gold {
  background: linear-gradient(180deg, #ffe373 0%, #df9922 55%, #a86408 100%);
  border: 1.5px solid #fff3b8;
  color: #3d1d00;
  text-shadow: 0 1px 0 rgba(255,255,255,0.65);
}
.r13c-page-switcher {
  display: flex;
  align-items: center;
  gap: 3px;
}
.r13c-page-btn {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: linear-gradient(180deg, #966634 0%, #6b431b 100%);
  border: 1.5px solid #c99651;
  color: #fbe5b4;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}
.r13c-page-btn.active {
  background: linear-gradient(180deg, #ffd766 0%, #d98218 100%);
  color: #3b1c00;
  border-color: #fff2b3;
}

/* Currency Footer Bar */
.r13c-currency-footer-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  margin-top: 5px;
  background: linear-gradient(180deg, #c6ae80 0%, #b49866 100%);
  border: 1.5px solid #7c5829;
  border-radius: 5px;
  padding: 4px 6px;
}
.r13c-cur-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  background: #332312;
  border: 1px solid #8c6a3c;
  border-radius: 4px;
  padding: 2px 6px;
  height: 22px;
}
.r13c-cur-box .c-val {
  font-size: 11.5px;
  font-weight: 900;
  color: #fff6dc;
}

/* === GLOBAL ITEM TOOLTIP (GC3.png Dark Semi-Transparent Style) === */
.gm-item-popup-tooltip {
  position: fixed;
  z-index: 15000;
  width: 296px;
  pointer-events: auto;
  max-height: calc(var(--game-viewport-height, 100dvh) - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.gm-tt-dark-card {
  background: rgba(16, 20, 28, 0.95);
  border: 2px solid #c99846;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.88), inset 0 0 0 1px rgba(255,235,175,0.22);
  color: #f1ebd8;
  padding: 9px 11px;
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 11.5px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gm-tt-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.14);
  padding-bottom: 5px;
}
.gm-tt-ico-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 5px;
  background: radial-gradient(circle, #2e4775 0%, #111b30 85%);
  border: 1.5px solid #d4a24c;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.gm-tt-ico {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.gm-tt-str-badge {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
}
.gm-tt-title-col {
  flex: 1;
  min-width: 0;
}
.gm-tt-name {
  font-size: 13px;
  font-weight: 900;
  text-shadow: 0 1px 2px #000;
}
.tt-str-num {
  color: #ffea6c;
  font-weight: 900;
}
.gm-tt-sub {
  font-size: 11px;
  color: #cbd5e1;
}
.gm-tt-status-line {
  font-size: 10.5px;
  margin-top: 1px;
}
.st-eq { color: #4ade80; font-weight: 800; }
.st-lock { color: #f87171; font-weight: 800; }
.st-bag { color: #38bdf8; font-weight: 800; }
.gm-tt-close-x {
  background: #dc2626;
  border: 1px solid #fca5a5;
  color: #fff;
  border-radius: 4px;
  width: 20px;
  height: 20px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}
.gm-tt-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 8px;
  background: rgba(255,255,255,0.04);
  border-radius: 5px;
  padding: 5px 7px;
}
.gm-tt-stats-grid .tt-span-2 {
  grid-column: span 2;
}
.gm-tt-stats-grid b.g { color: #4ade80; font-weight: 900; }
.gm-tt-stats-grid b.y { color: #facc15; font-weight: 900; }
.gm-tt-stats-grid b.b { color: #38bdf8; font-weight: 900; }
.tt-diff-up { color: #2ecc71; font-size: 10px; font-weight: 900; }
.tt-diff-down { color: #ff5e57; font-size: 10px; font-weight: 900; }
.gm-tt-compare-box {
  background: rgba(56, 189, 248, 0.1);
  border-left: 3px solid #38bdf8;
  padding: 4px 7px;
  border-radius: 4px;
  font-size: 10.5px;
}
.gm-tt-compare-box .up { color: #4ade80; font-weight: 900; }
.gm-tt-compare-box .down { color: #f87171; font-weight: 900; }
.gm-tt-skill-box {
  background: rgba(250, 204, 21, 0.1);
  border-left: 3px solid #facc15;
  padding: 4px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  color: #fef08a;
}
.gm-tt-desc {
  font-size: 11px;
  color: #cbd5e1;
  border-top: 1px dashed rgba(255,255,255,0.15);
  padding-top: 4px;
}
.gm-tt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.14);
  position: sticky;
  bottom: 0;
  background: #10141c;
  z-index: 1;
}

/* === DRAG & DROP GHOST & HIGHLIGHTS === */
.gm-drag-ghost {
  position: fixed;
  width: 52px;
  height: 52px;
  pointer-events: none;
  z-index: 16000;
  background: radial-gradient(circle, rgba(255,215,90,0.45) 0%, rgba(20,30,50,0.9) 80%);
  border: 2px solid #ffe67c;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(0,0,0,0.8);
}
.gm-drag-ghost img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.gm-drag-ghost .ghost-str {
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 10px;
  font-weight: 900;
  color: #fff275;
  text-shadow: 0 1px 2px #000;
}
.dragging-source {
  opacity: 0.4 !important;
  filter: grayscale(0.4);
}
.drag-valid-slot {
  border-color: #2ecc71 !important;
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.9), inset 0 0 6px rgba(46, 204, 113, 0.55) !important;
}
.drag-hover-valid {
  transform: scale(1.06) !important;
  border-color: #ffeaa7 !important;
  box-shadow: 0 0 14px rgba(255, 234, 167, 1) !important;
}
.drag-hover-invalid {
  border-color: #ff4757 !important;
  box-shadow: 0 0 10px rgba(255, 71, 87, 0.85) !important;
}

@media (max-width: 1024px), (max-height: 620px) {
  .r13c-main-two-panels {
    grid-template-columns: 420px 1fr;
    gap: 5px;
  }
  .r13c-bag-7x7-grid {
    grid-template-rows: repeat(7, 36px);
    gap: 3px;
  }
  .r13c-equip-slot {
    width: 40px;
    height: 40px;
  }
  .r13c-equip-slot.bottom-main-slot {
    width: 44px;
    height: 44px;
  }
  .r13c-paperdoll-and-19slots {
    grid-template-columns: 40px 40px 1fr 40px 40px;
  }
}


/* Fix 7x7 grid cell height so all 7 rows fit cleanly inside the right panel above action buttons */
.r13c-bag-grid-container {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  padding: 5px !important;
}
.r13c-bag-7x7-grid {
  grid-template-columns: repeat(7, 1fr) !important;
  grid-template-rows: repeat(7, 37px) !important;
  gap: 3px !important;
  height: auto !important;
}
.r13c-bag-grid-cell {
  height: 37px !important;
  min-height: 37px !important;
  max-height: 37px !important;
}

/* On narrow screens, stack the character and inventory instead of clipping the second panel.
   The modal body owns vertical scrolling, so a normal swipe never has to find an inner grid. */
@media (max-width: 800px) {
  .gunny-window[data-modal-theme="modal-bag"] {
    width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
  }
  .gunny-window[data-modal-theme="modal-bag"] .window-header { flex-shrink: 0; }
  .window-body.bag-no-scroll { padding: 8px !important; }
  .r13c-tui-b-master { padding: 6px; }
  .r13c-main-two-panels { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .r13c-top-horiz-tabs { flex-shrink: 0; touch-action: pan-x pan-y; }
  .r13c-htab-btn { min-height: 44px; }
  .r13c-left-personal-panel,
  .r13c-right-inventory-panel { min-width: 0; }
  .r13c-char-info-header { padding-right: 48px; }
  .r13c-info-row { flex-wrap: wrap; }
  .r13c-char-gold-name { flex-basis: 80px; }
  .r13c-paperdoll-and-19slots {
    grid-template-columns: 44px 44px minmax(0, 1fr) 44px 44px;
    gap: 3px;
    padding: 4px;
  }
  .r13c-equip-slot,
  .r13c-equip-slot.bottom-main-slot { width: 44px; height: 44px; }
  .r13c-center-stage-col { min-width: 0; }
  .r13c-character-canvas-stage { min-width: 0; }
  #bag-dollhouse-canvas { max-width: 100%; height: auto; }
  .r13c-stage-aura-ring { max-width: 100%; height: auto; }
  .r13c-stage-pet-float { width: 32px; height: 32px; }
  .r13c-aura-quick-dots { flex-wrap: wrap; justify-content: center; }
  .r13c-bottom-3slots-row,
  .r13c-main-3slots-group { flex-wrap: wrap; justify-content: center; }
  .r13c-hide-checkboxes-strip { flex-wrap: wrap; justify-content: center; }
  .r13c-grid-and-vtabs-wrap { grid-template-columns: minmax(0, 1fr) 44px; }
  .r13c-bag-7x7-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    grid-template-rows: none !important;
    grid-auto-rows: 44px;
  }
  .r13c-bag-grid-cell {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
  }
  .r13c-action-buttons-row { flex-wrap: wrap; gap: 6px; }
  .r13c-act-btn,
  .r13c-page-btn { min-height: 44px; }
  .r13c-page-switcher { flex-wrap: wrap; }
}
.r13c-cell-img {
  width: 31px !important;
  height: 31px !important;
}
.r13c-action-buttons-row {
  margin-top: 6px !important;
  position: relative;
  z-index: 3;
}


/* === ARGON 6.1.1.0 AUTHENTIC TEXTURE & SPRITE INTEGRATION === */
.r13c-equip-slot.empty, .r13c-bag-grid-cell.empty {
  background-image: url('../assets/extracted/argon_6110/bag/gezl-bb-1.png'), linear-gradient(180deg, #e5d8bc 0%, #d4c29d 100%) !important;
  background-size: 100% 100%, cover !important;
  background-repeat: no-repeat !important;
}
.r13c-equip-slot.filled, .r13c-bag-grid-cell.filled {
  background-image: url('../assets/extracted/argon_6110/bag/gezl-bb-2.png'), radial-gradient(circle at 50% 45%, #2b4470 0%, #16243f 72%, #0c1424 100%) !important;
  background-size: 100% 100%, cover !important;
  background-repeat: no-repeat !important;
}
.r13c-cur-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.65));
}
.r13c-title-badge-img {
  height: 18px;
  width: auto;
  max-width: 44px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
}
.gm-tt-top {
  border-bottom: none !important;
  background-image: url('../assets/tf_yellow_line.png');
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: 100% 2px;
  padding-bottom: 7px !important;
}
.toast-msg, .gunny-toast {
  background-image: url('../assets/toast_bg2.png');
  background-size: 100% 100%;
}

/* Native touch controls: avoid iOS text callouts on actions; keep form editing. */
button, .gender-card, .building-hotspot, canvas, [role="button"] {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
input, textarea, [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
#screen-start, #screen-role-select, #screen-name-input {
  justify-content: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 0;
}
#screen-start { padding-top: 64px; }
#screen-start > .start-overlay-card,
#screen-role-select > .role-select-stage,
#screen-name-input > .role-select-stage {
  margin-block: auto;
  flex-shrink: 0;
}
#screen-start button, #screen-role-select button, #screen-name-input button {
  min-height: 44px;
}
#btn-start-retry[hidden] { display: none; }

/* Keep the mainland dock inside the currently visible mobile viewport. */
#game-root { height: var(--game-viewport-height, 100vh); }
.mainland-bottom-dock {
  right: calc(16px + env(safe-area-inset-right, 0px)) !important;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
  padding-bottom: 10px !important;
}

.gm-settings-account {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 2px solid #f59e0b;
  border-radius: 16px;
  background: rgba(20, 8, 2, 0.85);
  color: #fef3c7;
}
.gm-settings-account > div { min-width: 0; overflow-wrap: anywhere; }
#settings-account-name { margin-top: 5px; font-size: 14px; color: #fed7aa; }
#btn-settings-logout {
  min-height: 44px;
  background-color: #991b1b;
  color: #fff;
}

/* Exact 40px frames from the original vip_state.png atlas (no replacement art). */
.gm-vip-icon {
  --vip-x: -2px;
  --vip-y: -128px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.gm-vip-icon::before {
  content: '';
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: url('../assets/ui/public/icon/vip_state.png') no-repeat var(--vip-x) var(--vip-y);
  transform: scale(1.3);
}
.gm-vip-banner-icon { width: 68px; height: 68px; }
.gm-vip-banner-icon::before { transform: scale(1.5); }
.gm-vip-icon[data-vip-level="0"] { --vip-x: -2px; --vip-y: -170px; }
.gm-vip-icon[data-vip-level="1"] { --vip-x: -86px; --vip-y: -128px; }
.gm-vip-icon[data-vip-level="2"] { --vip-x: -44px; --vip-y: -128px; }
.gm-vip-icon[data-vip-level="3"] { --vip-x: -2px; --vip-y: -128px; }
.gm-vip-icon[data-vip-level="4"] { --vip-x: -86px; --vip-y: -86px; }
.gm-vip-icon[data-vip-level="5"] { --vip-x: -44px; --vip-y: -86px; }
.gm-vip-icon[data-vip-level="6"] { --vip-x: -2px; --vip-y: -86px; }
.gm-vip-icon[data-vip-level="7"] { --vip-x: -86px; --vip-y: -44px; }
.gm-vip-icon[data-vip-level="8"] { --vip-x: -44px; --vip-y: -44px; }
.gm-vip-icon[data-vip-level="9"] { --vip-x: -2px; --vip-y: -44px; }
.gm-vip-icon[data-vip-level="10"] { --vip-x: -86px; --vip-y: -2px; }
.gm-vip-icon[data-vip-level="11"] { --vip-x: -44px; --vip-y: -2px; }
.gm-vip-icon[data-vip-level="12"] { --vip-x: -2px; --vip-y: -2px; }

/* Match the original333x92 portrait frame, rendered at325x90. */
.gm-avatar-plate .gm-player-bars {
  position: absolute;
  inset: 0;
  padding: 0;
  display: block;
  min-width: 0;
}
.gm-avatar-plate .gm-player-name-row {
  position: absolute;
  left: 86px;
  right: 8px;
  top: 6px;
  height: 26px;
  min-width: 0;
}
.gm-avatar-plate .gm-player-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gm-avatar-plate .gm-bar-track {
  position: absolute;
  height: 16.630px;
  border: 0;
  border-radius: 0;
  background: none;
}
.gm-avatar-plate .exp-track { left: 125.901px; top: 41.087px; width: 179.580px; }
.gm-avatar-plate .ap-track { left: 112.237px; top: 66.522px; width: 100.526px; }
.gm-avatar-plate .exp-fill {
  background: url('../assets/extracted/mainland_hud/ddzjm-1-3.png') no-repeat left top / 179.580px 16.630px;
}
.gm-avatar-plate .ap-fill {
  background: url('../assets/extracted/mainland_hud/ddzjm-1-4.png') no-repeat left top / 100.526px 16.630px;
}
.gm-avatar-plate .gm-bar-label { white-space: nowrap; }
.gm-avatar-plate .ap-track .gm-bar-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 16.630px;
  padding: 0 4px;
  text-align: center;
}

/* A quiet halo and occasional light sweep on the existing title surfaces. */
.gm-title-effect {
  --title-accent: #a7f3d0;
  --title-edge: #34d399;
  --title-glow: rgba(52, 211, 153, 0.45);
  display: inline-block;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  vertical-align: middle;
  max-width: 100%;
  padding: 4px 10px;
  border: 1px solid var(--title-edge);
  border-radius: 12px;
  background: linear-gradient(135deg, #35200e, #151422 65%, #35200e);
  color: var(--title-accent);
  font-weight: 900;
  line-height: 1.3;
  text-shadow: 0 1px 2px #000, 0 0 5px var(--title-glow);
  box-shadow: inset 0 0 5px var(--title-glow), 0 0 3px var(--title-glow);
  animation: gmTitleHalo 4.5s ease-in-out infinite;
}
.gm-title-effect::after {
  content: '';
  position: absolute;
  inset: -40% -55%;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.28) 50%, transparent 62%);
  transform: translateX(-80%);
  animation: gmTitleSweep 5.5s ease-in-out infinite;
}
.gm-title-azure { --title-accent: #bae6fd; --title-edge: #38bdf8; --title-glow: rgba(56,189,248,.5); }
.gm-title-violet { --title-accent: #f5d0fe; --title-edge: #c084fc; --title-glow: rgba(192,132,252,.5); }
.gm-title-gold { --title-accent: #fef08a; --title-edge: #fbbf24; --title-glow: rgba(251,191,36,.6); }
.gm-avatar-plate .gm-title-pill {
  flex: 0 1 auto;
  max-width: 142px;
  min-width: 0;
  padding: 2px 6px;
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}
.gm-title-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.gm-title-card { flex-wrap: wrap; gap: 12px; min-width: 0; }
.gm-title-card-description { min-width: 0; max-width: 100%; }
.gm-title-art { filter: drop-shadow(0 0 6px rgba(250,204,21,.3)); }
.gm-title-card[data-title-locked="true"] .gm-title-effect,
.gm-title-card[data-title-locked="true"] .gm-title-effect::after { animation: none; }
.gm-title-card[data-title-locked="true"] .gm-title-effect { filter: saturate(.65); }
.gm-title-card button { min-height: 44px; }
@keyframes gmTitleHalo {
  50% { box-shadow: inset 0 0 8px var(--title-glow), 0 0 7px var(--title-glow); }
}
@keyframes gmTitleSweep {
  0%, 50% { transform: translateX(-80%); }
  78%, 100% { transform: translateX(80%); }
}
@media (max-width: 480px) { .gm-title-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) and (orientation: portrait) {
  /* Keep event actions to the right instead of laying them over the portrait. */
  .gm-top-right-hud .gm-currency-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .gm-top-right-hud .gm-top-event-icons { display: grid; grid-template-columns: repeat(2, 58px); gap: 10px; }
}
@media (hover: none) {
  .gm-avatar-plate:hover, .gm-round-icon-btn:hover, .dock-btn:hover { transform: none !important; }
  .building-hotspot:hover { transform: translate(-50%, -50%) scale(var(--building-scale, 1)) !important; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select { font-size: max(16px, 1em); }
}
@media (prefers-reduced-motion: reduce) {
  .gm-title-effect, .gm-title-effect::after { animation: none !important; }
}

/* PvP shares the original controls, but only shows actions supported by the server. */
#online-battle-status { display: none; }
#screen-battle.online-battle {
  --pvp-edge-left: max(8px, env(safe-area-inset-left, 0px));
  --pvp-edge-right: max(8px, env(safe-area-inset-right, 0px));
  --pvp-edge-top: max(8px, env(safe-area-inset-top, 0px));
  --pvp-edge-bottom: max(8px, env(safe-area-inset-bottom, 0px));
}
#screen-battle.online-battle :is(#battle-formula-helper, #battle-turn-order-bar, #battle-weapon-quick-bar, #btn-jump-move, #battle-boss-hud-bar, #battle-stage-objective, #battle-center-countdown) {
  display: none !important;
}
#screen-battle.online-battle #battle-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(100vw, 177.7778vh);
  height: min(56.25vw, 100vh);
  transform: translate(-50%, -50%);
  object-fit: fill;
}
#screen-battle.online-battle #online-battle-status {
  display: block;
  position: absolute;
  top: calc(var(--pvp-edge-top) + 74px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 26;
  width: max-content;
  max-width: min(400px, calc(100% - var(--pvp-edge-left) - var(--pvp-edge-right)));
  padding: 5px 10px;
  border: 1px solid #c99846;
  border-radius: 8px;
  background: rgba(24, 9, 2, .9);
  color: #fef3c7;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
  pointer-events: none;
}
#screen-battle.online-battle #online-battle-status:empty { display: none; }
#screen-battle.online-battle #online-battle-status.is-result {
  top: 36%;
  z-index: 65;
  max-width: min(320px, calc(100% - var(--pvp-edge-left) - var(--pvp-edge-right)));
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(38, 17, 8, .96);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  font-size: 16px;
  line-height: 1.4;
  white-space: pre-line;
  animation: phoenixBattleNoticeIn 0.45s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  #toast-container .gunny-toast,
  .gm-turn-sweep-banner,
  .modal-backdrop.open .gunny-window[data-modal-theme="modal-settlement"],
  #screen-battle.online-battle #online-battle-status.is-result {
    animation: none;
  }
}

#screen-battle.online-battle .gm-battle-top-left { top: var(--pvp-edge-top); left: var(--pvp-edge-left); }
#screen-battle.online-battle .gm-battle-top-center { top: var(--pvp-edge-top); }
#screen-battle.online-battle .gm-battle-top-right { top: var(--pvp-edge-top); right: var(--pvp-edge-right); }
#screen-battle.online-battle .gm-minimap-header { min-height: 44px; }
#screen-battle.online-battle #btn-battle-leave {
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
}
#screen-battle.online-battle #btn-battle-pass { min-width: 44px; min-height: 44px; }
#screen-battle.online-battle :is(#btn-move-left, #btn-move-right) {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
#screen-battle.online-battle #btn-hold-fire { touch-action: none; }
#screen-battle.online-battle #slider-quick-power {
  width: 64px;
  height: 44px;
  min-width: 0;
  flex: 0 1 auto;
  touch-action: manipulation;
}
#screen-battle.online-battle #btn-quick-fire { min-width: 48px; min-height: 44px; font-size: 13px; }
#screen-battle.online-battle button:disabled,
#screen-battle.online-battle #slider-quick-power:disabled { opacity: .55; cursor: default; }
#screen-battle.online-battle .gm-turn-pill { overflow-wrap: anywhere; }
#screen-battle.online-battle #online-combat-stats {
  margin-top: 2px;
  color: #fde68a;
  font-size: 10px;
  line-height: 1.2;
  white-space: normal;
}
#screen-battle.online-battle #battle-turn-limit { font-size: inherit; opacity: .75; white-space: nowrap; }

@media (max-width: 1000px), (max-height: 540px) {
  #screen-battle.online-battle .gm-steering-wheel-zone {
    left: var(--pvp-edge-left) !important;
    bottom: var(--pvp-edge-bottom) !important;
    transform: none;
  }
  #screen-battle.online-battle .gm-steering-wheel { width: 144px; height: 144px; }
  #screen-battle.online-battle .gm-wheel-dir-btn { width: 48px; height: 48px; }
  #screen-battle.online-battle .gm-wheel-dir-btn.up { top: 0; }
  #screen-battle.online-battle .gm-wheel-dir-btn.down { bottom: 0; }
  #screen-battle.online-battle .gm-wheel-dir-btn.left { left: 0; }
  #screen-battle.online-battle .gm-wheel-dir-btn.right { right: 0; }
  #screen-battle.online-battle .gm-wheel-dir-btn .dir-s { width: 44px; height: 44px; }
  #screen-battle.online-battle .gm-right-combat-cluster {
    bottom: var(--pvp-edge-bottom) !important;
    right: var(--pvp-edge-right) !important;
    transform: none;
  }
  #screen-battle.online-battle #btn-hold-fire { width: 84px; height: 84px; }
  #screen-battle.online-battle .gm-bottom-center-bars {
    left: calc(var(--pvp-edge-left) + 150px);
    right: calc(var(--pvp-edge-right) + 90px);
    bottom: var(--pvp-edge-bottom) !important;
    width: auto;
    padding: 3px 8px 6px;
    transform: none !important;
  }
  #screen-battle.online-battle .gm-hp-stamina-row > .gm-tube-group:first-child { display: none; }
  #screen-battle.online-battle .gm-tube-track { width: 66px; }
  #screen-battle.online-battle .gm-quick-fire-mini { min-width: 0; flex: 1 1 auto; }
  #screen-battle.online-battle .gm-minimap-header { padding-inline: 6px 0; }
  #screen-battle.online-battle .gm-battle-top-right { width: max-content; }
  #screen-battle.online-battle .gm-minimap-frame { display: none; }
  #screen-battle.online-battle .gm-battle-top-left,
  #screen-battle.online-battle .gm-battle-top-right { transform: none; }
  #screen-battle.online-battle .gm-battle-top-center { gap: 6px; transform: translateX(-50%) !important; }
  #screen-battle.online-battle .gm-team-badge { padding: 4px; gap: 4px; }
  #screen-battle.online-battle .gm-team-hp-col { min-width: 0; }
  #screen-battle.online-battle .gm-team-hp-bar { width: 64px; }
  #screen-battle.online-battle .gm-battle-top-left { gap: 5px; }
  #screen-battle.online-battle .gm-battle-top-left .gm-turn-pill { max-width: 150px !important; padding: 4px 6px !important; font-size: 10px !important; }
  #screen-battle.online-battle :is(.gm-head-box, .gm-head-frame) { width: 24px; height: 24px; }
  #screen-battle.online-battle .gm-wind-arrow-wrap { width: 88px; height: 32px; }
  #screen-battle.online-battle .gm-wind-arrow { width: 86px; height: 32px; }
  #screen-battle.online-battle .gm-wind-val-overlay { font-size: 12px; white-space: nowrap; }
  #screen-battle.online-battle .gm-prev-bg { display: none; }
  #screen-battle.online-battle .gm-prev-wind-bar { margin-top: -1px; }
  #screen-battle.online-battle #online-battle-status { top: calc(var(--pvp-edge-top) + 56px); }
}

@media (max-width: 600px) and (orientation: portrait) {
  #screen-battle.online-battle .gm-battle-top-left {
    right: calc(var(--pvp-edge-right) + 52px);
    max-width: none !important;
    flex-direction: row !important;
    align-items: flex-start !important;
  }
  #screen-battle.online-battle #btn-battle-pass { flex: 0 0 44px; }
  #screen-battle.online-battle #btn-battle-pass img { max-width: 44px; }
  #screen-battle.online-battle .gm-turn-pill { flex: 1 1 auto; min-width: 0; }
  #screen-battle.online-battle .gm-battle-top-center { top: calc(var(--pvp-edge-top) + 78px); }
  #screen-battle.online-battle #online-battle-status { top: calc(var(--pvp-edge-top) + 136px); }
  #screen-battle.online-battle .gm-battle-top-left .gm-turn-pill { max-width: 235px !important; }
  #screen-battle.online-battle .gm-battle-top-center .gm-team-badge {
    flex-direction: column;
    padding: 2px;
    gap: 1px;
    border-radius: 8px;
  }
  #screen-battle.online-battle .gm-battle-top-center .gm-head-box,
  #screen-battle.online-battle .gm-battle-top-center .gm-head-frame { width: 18px; height: 18px; }
  #screen-battle.online-battle .gm-battle-top-center .gm-head-tag { font-size: 8px; }
  #screen-battle.online-battle .gm-battle-top-center .gm-team-hp-col { align-items: center; }
  #screen-battle.online-battle .gm-battle-top-center .gm-team-hp-num { font-size: 9px; white-space: nowrap; }
  #screen-battle.online-battle .gm-battle-top-center .gm-team-hp-bar { width: 58px; height: 6px; }
  #screen-battle.online-battle .gm-battle-top-center .gm-wind-center-widget { min-width: 74px; }
  #screen-battle.online-battle #battle-canvas {
    top: calc(var(--pvp-edge-top) + 176px);
    bottom: auto;
    left: 50%;
    width: min(100vw, 177.7778vh);
    height: min(56.25vw, 100vh);
    transform: translateX(-50%);
  }
  #screen-battle.online-battle .gm-steering-wheel-zone,
  #screen-battle.online-battle .gm-right-combat-cluster { bottom: calc(var(--pvp-edge-bottom) + 144px) !important; z-index: 28; }
  #screen-battle.online-battle .gm-bottom-center-bars { z-index: 25; }
  #screen-battle.online-battle .gm-bottom-center-bars { left: var(--pvp-edge-left); right: var(--pvp-edge-right); }
}

@media (hover: none) {
  #screen-battle.online-battle :is(#btn-hold-fire, #btn-battle-pass, #btn-battle-leave):hover { transform: none; }
}

#screen-battle.online-battle #online-battle-status.is-result { top: 36%; }

.gm-props-vertical-grid {
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  max-height: min(360px, calc(var(--game-viewport-height, 100vh) - 180px));
}
.gm-props-subgrid { grid-template-columns: repeat(4, 44px); gap: 5px; }
.gm-props-vertical-grid .prop-btn { width: 44px !important; height: 44px !important; }
.prop-btn:disabled { cursor: default; opacity: .55; }
.prop-btn:focus-visible { outline: 3px solid #7dd3fc; outline-offset: 2px; }
.battle-settlement .flip-card { font-family: inherit; color: #fff0c8; }
.battle-settlement [hidden] { display: none !important; }
.battle-settlement .flip-card:disabled { cursor: default; }
.battle-settlement-countdown { margin: 6px 0; font-size: 14px; line-height: 1.4; color: #6a2e13; }

@media (max-width: 1000px), (max-height: 540px) {
  #screen-battle .gm-right-combat-cluster { transform: none; }
  #screen-battle #battle-props-bar { max-height: max(106px, calc(var(--game-viewport-height, 100vh) - 245px)); }
  #screen-battle .gm-props-group-label { font-size: 11px; line-height: 1.3; }
}

.battle-settlement .flip-card.is-claimed { border-color: #4ade80; }
.battle-settlement .flip-card span { font-size: 12px; line-height: 1.4; }
.battle-settlement .flip-card small { color: #4ade80; font-size: 12px; }

/* Native POW/pet actions remain reachable without covering the numeric force input. */
#screen-battle.online-battle .gm-right-combat-cluster { pointer-events: none; }
#screen-battle.online-battle #battle-props-bar,
#screen-battle.online-battle .gm-fire-pow-dock > button { pointer-events: auto; }
#screen-battle.online-battle :is(#btn-battle-pow, #btn-battle-pet-skill):disabled { opacity: .55; cursor: default; }
@media (max-width: 1000px), (max-height: 540px) {
  #screen-battle.online-battle .gm-fire-pow-dock {
    display: grid;
    grid-template-columns: 60px 84px;
    grid-template-rows: 60px 84px;
    gap: 8px;
    align-items: end;
    justify-items: end;
    pointer-events: none;
  }
  #screen-battle.online-battle #btn-battle-pet-skill { grid-column: 1; grid-row: 1; width: 56px; height: 56px; }
  #screen-battle.online-battle #btn-battle-pow { grid-column: 2; grid-row: 1; width: 60px; height: 60px; }
  #screen-battle.online-battle #btn-battle-pow .gm-pow-icon { width: 50px; height: 50px; }
  #screen-battle.online-battle #btn-battle-pow .gm-pow-flame { width: 68px; height: 64px; }
  #screen-battle.online-battle #btn-hold-fire { grid-column: 2; grid-row: 2; }
}
