:root {
  --raw-sai-top: env(safe-area-inset-top, 0px);
  --raw-sai-left: env(safe-area-inset-left, 0px);
  --raw-sai-right: env(safe-area-inset-right, 0px);
  --raw-sai-bottom: env(safe-area-inset-bottom, 0px);
  --stage-scale: 1;
  --ui-safe-t: 0px;
  --ui-safe-x: 0px;
  --ui-safe-b: 0px;
}

@media (pointer: coarse) and (orientation: landscape) {
  :root {
    --ui-safe-t: 0px;
    --ui-safe-x: clamp(12px, calc(max(24px, var(--raw-sai-left), var(--raw-sai-right)) / var(--stage-scale)), 96px);
    --ui-safe-b: clamp(6px, calc(max(8px, var(--raw-sai-bottom)) / var(--stage-scale)), 64px);
  }
}

@media (pointer: coarse) and (orientation: portrait) {
  :root {
    --ui-safe-t: clamp(0px, calc(var(--raw-sai-top) / var(--stage-scale)), 96px);
    --ui-safe-b: clamp(6px, calc(max(8px, var(--raw-sai-bottom)) / var(--stage-scale)), 64px);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  scrollbar-width: thin;
  scrollbar-color: #3b82f6 rgba(9, 17, 34, 0.72);
}

*::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

*::-webkit-scrollbar-track {
  background: rgba(9, 17, 34, 0.72);
  border-radius: 6px;
  border: 1px solid rgba(90, 140, 220, 0.16);
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  border-radius: 6px;
  border: 1px solid rgba(190, 224, 255, 0.35);
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ffd32a, #d4a648);
  border-color: #fff3b0;
}

img,
canvas,
a,
button {
  -webkit-user-drag: none;
  user-drag: none;
}

#anti-inspect-lock {
  position: fixed;
  inset: 0;
  background: #05080f;
  color: #ff6b6b;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  font-size: 18px;
  gap: 10px;
}

html,
body {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #070b12;
  color: #fff;
  font-family: 'Sarabun', Tahoma, "Segoe UI", system-ui, sans-serif;
  touch-action: none;
}

#viewport-probe {
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  pointer-events: none;
  visibility: hidden;
}

button,
input,
select,
textarea {
  font-family: 'Sarabun', Tahoma, "Segoe UI", system-ui, sans-serif;
}

#viewport {
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #070b12;
}

/* Dynamically sized in main.js (uniform scale, height=640+, zero stretching across all viewports) */
#stage {
  position: relative;
  width: 960px;
  height: 640px;
  flex-shrink: 0;
  overflow: hidden;
  isolation: isolate;
  background: #0b111d;
  transform-origin: center center;
}

#game-gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  image-rendering: auto;
  z-index: 1;
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  display: block;
  z-index: 2;
}

#stage #game {
  background: transparent;
}

#stage #hud {
  z-index: 10;
  isolation: isolate;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

#stage #game.smooth-hidpi {
  image-rendering: auto;
}

#stage #game.smooth-classic {
  image-rendering: pixelated;
}

#hud-names-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

#hud-tower-banner {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(10, 18, 36, 0.88);
  border: 1.5px solid #ffd32a;
  color: #fff6cf;
  font-size: 12.5px;
  font-weight: 800;
  text-shadow: 1px 1px 0 #000;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.65);
  z-index: 8;
  pointer-events: none;
  white-space: nowrap;
}

html.forced-landscape {
  --ui-safe-t: 0px;
  --ui-safe-x: clamp(12px, calc(max(14px, var(--raw-sai-top), var(--raw-sai-bottom)) / var(--stage-scale)), 96px);
  --ui-safe-b: clamp(6px, calc(max(8px, var(--raw-sai-left), var(--raw-sai-right)) / var(--stage-scale)), 64px);
}

.hidden {
  display: none !important;
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  overflow: hidden;
  isolation: isolate;
  touch-action: none;
}

.screen.active {
  display: block;
}

#screen-title.active {
  z-index: 25;
}

.layer-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: auto;
}

.ro-960-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 960px;
  height: 640px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}

.ro-img-btn,
.ro-back-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.ro-img-btn:active img,
.ro-back-btn:active img {
  transform: scale(0.94);
}

/* ==================== TITLE SCREEN ==================== */
#title-valk {
  position: absolute;
  right: -20px;
  top: -36px;
  width: 948px;
  height: 804px;
  pointer-events: none;
}

#title-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 70px;
  width: 688px;
  height: 384px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 6px 18px rgba(8, 22, 54, 0.78)) drop-shadow(0 0 14px rgba(255, 224, 118, 0.45));
}

#title-ver {
  position: absolute;
  left: calc(16px + var(--ui-safe-x));
  top: 10px;
  font-size: 20px;
  font-weight: 800;
  color: #fff6c9;
  text-shadow: -1.5px -1.5px 0 #0b1f48, 1.5px -1.5px 0 #0b1f48, -1.5px 1.5px 0 #0b1f48, 1.5px 1.5px 0 #0b1f48, 0 2px 6px rgba(0, 0, 0, .9);
  pointer-events: none;
}

#title-touch {
  position: absolute;
  left: 322px;
  top: 534px;
  width: 316px;
  height: 52px;
  pointer-events: none;
  animation: pulseTouch 1.4s ease-in-out infinite;
}

@keyframes pulseTouch {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}

#title-copy {
  position: absolute;
  left: calc(110px + var(--ui-safe-x));
  right: calc(110px + var(--ui-safe-x));
  bottom: calc(14px + var(--ui-safe-b));
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-shadow: -1.5px -1.5px 0 #000, 1.5px -1.5px 0 #000, -1.5px 1.5px 0 #000, 1.5px 1.5px 0 #000;
  pointer-events: none;
}

#btn-title-touch-area {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: transparent;
  border: none;
  cursor: pointer;
}

#btn-title-newid {
  position: absolute;
  left: calc(12px + var(--ui-safe-x));
  bottom: calc(10px + var(--ui-safe-b));
  width: 112px;
  height: 108px;
  z-index: 10;
}

#btn-title-newid img {
  width: 112px;
  height: 108px;
}

#btn-title-fb {
  position: absolute;
  right: calc(12px + var(--ui-safe-x));
  bottom: calc(122px + var(--ui-safe-b));
  width: 110px;
  height: 108px;
  z-index: 3;
}

#btn-title-fb img {
  width: 110px;
  height: 108px;
}

#btn-title-opt {
  position: absolute;
  right: calc(12px + var(--ui-safe-x));
  bottom: calc(10px + var(--ui-safe-b));
  width: 112px;
  height: 108px;
  z-index: 10;
}

#btn-title-opt img {
  width: 112px;
  height: 108px;
}

#lang-switcher {
  position: absolute;
  top: calc(14px + var(--ui-safe-t));
  right: calc(16px + var(--ui-safe-x));
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(10, 18, 34, 0.82);
  border: 1.5px solid rgba(255, 211, 42, 0.55);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
}

.lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: #cbd5e1;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}

.lang-pill:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.lang-pill.active {
  background: linear-gradient(180deg, #3b6fd8, #234999);
  border-color: #ffd32a;
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 111, 216, 0.45);
}

.login-lang-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(11, 22, 46, 0.88);
  border: 1px solid rgba(255, 211, 42, 0.35);
}

.login-lang-lbl {
  font-size: 12px;
  font-weight: 700;
  color: #ffe28a;
}

.login-lang-pills {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.login-lang-pills .lang-pill {
  padding: 3px 9px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(148, 163, 184, 0.25);
}

/* Common Dialog / Account Popup */
.modal-backdrop {
  position: absolute;
  inset: 0;
  padding: 12px calc(12px + var(--ui-safe-x)) calc(12px + var(--ui-safe-b));
  background: rgba(0, 0, 0, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
}

.ro-acc-box {
  width: 748px;
  max-width: 92%;
  min-height: 388px;
  padding: 36px 46px 32px;
  background: url('assets/pak/account_bg.png?v=71') center / 100% 100% no-repeat;
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: #0e1e36;
}

.ro-acc-title {
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  color: #0e2446;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.ro-field-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ro-field-wrap label {
  font-size: 22px;
  font-weight: 700;
  width: 150px;
  color: #0e2446;
}

.ro-field-wrap input {
  flex: 1;
  height: 68px;
  padding: 0 40px;
  border: none;
  background: url('assets/pak/login_txtfield2.png?v=71') center / 100% 100% no-repeat;
  color: #111;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  outline: none;
}

.royal-acc-box {
  min-height: 446px;
  padding: 20px 44px 22px;
  gap: 10px;
}

.ro-acc-head-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.ro-acc-head-brand img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.ro-acc-sub {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #1f4478;
}

.ro-acc-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ro-acc-tab {
  height: 40px;
  border-radius: 10px;
  border: 2px solid #4877c4;
  background: rgba(255, 255, 255, 0.58);
  color: #0e2446;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

.ro-acc-tab.active {
  background: linear-gradient(180deg, #2d74e6, #14439c);
  border-color: #ffd32a;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
}

.ro-acc-pane {
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}

.qty-ctrl-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

#qty-modal,
#invite-modal,
#trade-modal {
  z-index: 85;
}

#wait-invite-modal {
  z-index: 86;
}

#inp-qty {
  width: 78px;
  height: 34px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  color: #fffa65;
  background: #0a1528;
  border: 2px solid #4d72b5;
  border-radius: 6px;
}

.royal-acc-box .ro-acc-title {
  color: #ffe28a;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.88);
}

.royal-acc-box .ro-acc-sub {
  color: #c7e0ff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.88);
}

.royal-acc-box .ro-field-wrap label {
  font-size: 19px;
  font-weight: 800;
  color: #e8f3ff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.92);
}

.royal-acc-box .ro-field-wrap input {
  height: 54px;
  font-size: 20px;
  padding: 0 38px;
  color: #ffffff;
  text-align: center;
  text-shadow: 1px 1px 0 #081a3d;
}

.royal-acc-box .ro-field-wrap input::placeholder {
  color: rgba(226, 244, 255, 0.85);
  text-align: center;
}

.royal-acc-box .ro-remember-row {
  color: #dbeafe;
  font-size: 16px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.92);
}

.royal-acc-box #login-err,
.royal-acc-box #reg-msg {
  color: #ff8090;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.92);
}

.royal-acc-box #login-err.ok,
.royal-acc-box #reg-msg.ok {
  color: #7bed9f;
}

.ro-remember-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 2px;
  font-size: 18px;
  font-weight: 700;
  color: #0b2248;
  cursor: pointer;
  user-select: none;
}

.ro-remember-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: #1b64e0;
  cursor: pointer;
  flex-shrink: 0;
}

#login-err,
#reg-msg {
  color: #a80000;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  min-height: 24px;
}

#login-err.ok,
#reg-msg.ok {
  color: #0a6e28;
}

.ro-acc-btns {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-top: auto;
}

.ro-btn-192 {
  width: 340px;
  height: 64px;
  border: none;
  background: url('assets/pak/button_192.png?v=71') center / 100% 100% no-repeat;
  color: #0a1426;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
}

.ro-btn-192:hover,
.ro-btn-192-active {
  background-image: url('assets/pak/button_192_sel.png?v=71');
  color: #fff;
  text-shadow: 1px 1px 0 #000;
}

.ro-btn-116 {
  width: 232px;
  height: 62px;
  border: none;
  background: url('assets/pak/button_116.png?v=71') center / 100% 100% no-repeat;
  color: #0a1426;
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
}

.ro-btn-116:hover {
  filter: brightness(1.1);
}

.ro-btn-116:disabled {
  opacity: 0.45;
  cursor: default;
}

.ro-opt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 22px;
  font-weight: 700;
}

.ro-opt-row input[type=range] {
  width: 320px;
  height: 28px;
}

/* ==================== SERVER SELECT ==================== */
.ro-main-border {
  position: absolute;
  left: 50px;
  top: 4px;
  width: 860px;
  height: 604px;
  pointer-events: none;
}

.ro-royal-top-emblem {
  position: absolute;
  left: 50%;
  top: -18px;
  transform: translateX(-50%);
  width: 246px;
  height: 138px;
  object-fit: contain;
  pointer-events: none;
  z-index: 3;
  filter: drop-shadow(0 4px 12px rgba(6, 18, 45, 0.85)) drop-shadow(0 0 10px rgba(255, 224, 118, 0.4));
}

.srv-royal-logo {
  position: absolute;
  left: 50%;
  top: 6px;
  transform: translateX(-50%);
  width: 248px;
  height: 168px;
  object-fit: contain;
  pointer-events: none;
  z-index: 4;
  filter: drop-shadow(0 6px 16px rgba(4, 12, 34, 0.88)) drop-shadow(0 0 18px rgba(255, 214, 102, 0.45));
}

.char-royal-logo {
  top: 12px;
}

#srv-ticker {
  position: absolute;
  left: 50%;
  bottom: calc(12px + var(--ui-safe-b));
  transform: translateX(-50%);
  padding: 4px 20px;
  border-radius: 999px;
  background: rgba(8, 22, 54, 0.72);
  border: 1px solid rgba(255, 215, 110, 0.4);
  backdrop-filter: blur(4px);
  white-space: nowrap;
  z-index: 6;
  pointer-events: none;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #f8e8b0;
  text-shadow: 1px 1px 0 #040d22;
}

#srv-panel-bg {
  position: absolute;
  left: 128px;
  top: 170px;
  width: 704px;
  height: 416px;
  pointer-events: none;
  filter: drop-shadow(0 12px 28px rgba(4, 10, 28, 0.75));
}

#srv-hdr {
  position: absolute;
  left: 162px;
  top: 181px;
  width: 616px;
  display: grid;
  grid-template-columns: 230px 140px 1fr;
  text-align: center;
  font-size: 25px;
  font-weight: 800;
  color: #fff;
  text-shadow: 2px 2px 0 #001a4d, -1px -1px 0 #001a4d;
  pointer-events: none;
}

#server-list {
  position: absolute;
  left: 152px;
  top: 240px;
  width: 656px;
  height: 326px;
  overflow-y: auto;
  pointer-events: auto;
}

.srv-row {
  height: 62px;
  display: grid;
  grid-template-columns: 240px 150px 1fr;
  align-items: center;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
}

.srv-row:hover,
.srv-row.selected {
  background: url('assets/pak/serverselect_cursor.png?v=71') left center / 100% 56px no-repeat;
}

.srv-smooth {
  color: #36c419;
}

.srv-busy {
  color: #dec803;
}

.srv-maint {
  color: #ff3030;
}

.ro-back-btn {
  position: absolute;
  left: calc(8px + var(--ui-safe-x));
  bottom: calc(8px + var(--ui-safe-b));
  width: 112px;
  height: 108px;
  z-index: 8;
}

.ro-back-btn img {
  width: 112px;
  height: 108px;
}

/* ==================== CHARACTER SELECT ==================== */
#char-stage-bg {
  position: absolute;
  left: 90px;
  top: 184px;
  width: 780px;
  height: 224px;
  pointer-events: none;
  border: 2px solid rgba(255, 214, 102, 0.72);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(4, 10, 28, 0.72);
}

#char-preview-canvas {
  position: absolute;
  left: 90px;
  top: 184px;
  width: 780px;
  height: 224px;
  image-rendering: pixelated;
  pointer-events: none;
}

#char-slot-hits {
  position: absolute;
  left: 90px;
  top: 184px;
  width: 780px;
  height: 224px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  pointer-events: auto;
}

.char-slot-hit {
  position: relative;
  cursor: pointer;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.char-slot-hit:hover {
  background: rgba(255, 255, 255, 0.08);
}

.char-slot-hit.selected {
  background: linear-gradient(180deg, rgba(255, 215, 102, 0.03) 0%, rgba(255, 215, 102, 0.18) 100%);
  border-bottom-color: #ffd32a;
}

.char-slot-badge {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 6px;
  padding: 2px 4px;
  border-radius: 5px;
  background: rgba(8, 16, 36, 0.78);
  border: 1px solid rgba(255, 214, 102, 0.35);
  color: #eaf3ff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 1px 1px 0 #000;
}

.char-slot-hit.empty-slot .char-slot-badge {
  color: #9bb4d8;
  border-color: rgba(140, 175, 230, 0.25);
}

.char-slot-hit.selected .char-slot-badge {
  background: rgba(20, 42, 86, 0.92);
  border-color: #ffd32a;
  color: #fffa87;
}

#char-info-bar {
  position: absolute;
  left: 202px;
  top: 414px;
  width: 556px;
  height: 96px;
  background: url('assets/pak/character_info_border.png?v=71') center / 100% 100% no-repeat;
  pointer-events: none;
}

#char-action-bar {
  position: absolute;
  left: 50%;
  top: 516px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
  z-index: 6;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

#char-action-bar.hidden {
  display: none;
}

#char-action-bar .char-action-btns {
  display: flex;
  gap: 14px;
  justify-content: center;
}

#cs-name {
  position: absolute;
  left: 160px;
  top: 20px;
  width: 224px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: #0b1422;
}

#cs-lv {
  position: absolute;
  left: 422px;
  top: 20px;
  width: 68px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: #0b1422;
}

#cs-exp-track {
  position: absolute;
  left: 154px;
  top: 64px;
  width: 320px;
  height: 8px;
  overflow: hidden;
}

#cs-exp-fill {
  width: 0%;
  height: 100%;
  background: url('assets/pak/exp_gage_ink.png?v=71') left center / 320px 8px no-repeat;
}

.ro-sel-popup {
  position: relative;
  width: 526px;
  background: url('assets/pak/sel_back.png?v=71') center / 100% 100% no-repeat;
  padding: 18px 40px;
  margin-bottom: 92px;
  opacity: 0.94;
}

.ro-sel-popup.small {
  width: 520px;
  text-align: center;
}

.ro-sel-border-top {
  position: absolute;
  left: -12px;
  top: -14px;
  width: calc(100% + 24px);
  height: 24px;
}

.ro-sel-border-bot {
  position: absolute;
  left: -12px;
  bottom: -14px;
  width: calc(100% + 24px);
  height: 24px;
}

.ro-sel-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#del-confirm-msg {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
  padding: 14px 0;
}

.row-2btn {
  display: flex;
  gap: 18px;
  justify-content: center;
}

/* Character Create */
#cc-panel {
  width: 780px;
  max-width: 94%;
  background: url('assets/pak/account_bg.png?v=71') center / 100% 100% no-repeat;
  padding: 24px 32px;
  color: #0b1c36;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cc-head {
  font-size: 24px;
  font-weight: 800;
  text-align: center;
}

.cc-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
}

.cc-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.cc-preview-box {
  width: 200px;
  height: 200px;
  border: 2px solid #2b4a78;
  border-radius: 10px;
  background: url('assets/pak/chapter_bg.png?v=71') center bottom / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}

#cc-canvas {
  width: 200px;
  height: 200px;
  image-rendering: pixelated;
}

.cc-hair-row,
.cc-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.cc-name-row input {
  flex: 1;
  height: 42px;
  padding: 0 10px;
  font-size: 18px;
  font-weight: 700;
  border: 2px solid #2b4a78;
  border-radius: 6px;
}

.ro-mini-sq {
  width: 42px;
  height: 42px;
  border: 1.5px solid #16325c;
  border-radius: 6px;
  background: #2f69c2;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

.cc-jobs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.cc-job {
  padding: 8px 6px;
  border-radius: 6px;
  border: 1.5px solid #244675;
  background: #d7e8ff;
  color: #0e2446;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.cc-job.active {
  background: #1e62d0;
  color: #fff;
}

.cc-genders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.cc-gender {
  padding: 7px 8px;
  border-radius: 6px;
  border: 1.5px solid #244675;
  background: #e6f0ff;
  color: #0e2446;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.cc-gender.male.active {
  background: #1e62d0;
  border-color: #ffd32a;
  color: #fff;
}

.cc-gender.female.active {
  background: #d63384;
  border-color: #ffd32a;
  color: #fff;
}

.cc-stat-row {
  display: grid;
  grid-template-columns: 70px 40px 1fr 40px 44px;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 700;
}

.cc-stat-bar {
  height: 14px;
  background: #2c4a7a;
  border-radius: 7px;
  overflow: hidden;
}

.cc-stat-bar>div {
  height: 100%;
  background: #4cd137;
}

.cc-pts {
  font-size: 18px;
  font-weight: 700;
  text-align: right;
  margin-top: 6px;
}

.cc-foot {
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* ==================== IN-GAME HUD (Edge-pinned inside responsive #stage, safe-area inset on touch landscape) ==================== */
#hud {
  position: absolute;
  top: var(--ui-safe-t, 0px);
  left: var(--ui-safe-x, 0px);
  right: var(--ui-safe-x, 0px);
  bottom: var(--ui-safe-b, 0px);
  pointer-events: none;
}

#hud>*,
#hotkey-wrap,
#hud-minimap-wrap,
#joy-zone,
#chat-input-bar {
  pointer-events: auto;
}

/* Top-Left: character_top */
#hud-top-left {
  position: absolute;
  left: 0;
  top: -2px;
  width: 306px;
  height: 104px;
  cursor: pointer;
}

#hud-exp-bar-bg {
  position: absolute;
  left: 72px;
  top: 8px;
  width: 220px;
  height: 28px;
  background: rgba(0, 0, 0, 0.62);
  border-radius: 4px;
}

#hud-bexp,
#hud-jlv,
#hud-jexp {
  position: absolute;
  top: 7px;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
  white-space: nowrap;
  text-shadow: 1px 1px 0 #000;
}

#hud-bexp {
  left: 4px;
  width: 66px;
  text-align: right;
  color: #fff;
}

#hud-jlv {
  left: 116px;
  top: 5px;
  width: 26px;
  font-size: 15px;
  text-align: center;
  color: #ff4444;
}

#hud-jexp {
  left: 144px;
  width: 74px;
  text-align: left;
  color: #fff;
}

#hud-top-frame {
  position: absolute;
  left: 0;
  top: 0;
  width: 306px;
  height: 104px;
}

#hud-lv {
  position: absolute;
  left: 20px;
  top: 32px;
  width: 56px;
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
}

#hp-wrap,
#sp-wrap {
  position: absolute;
  left: 96px;
  width: 170px;
  height: 16px;
  overflow: hidden;
}

#hp-wrap {
  top: 46px;
}

#sp-wrap {
  top: 68px;
}

#bar-hp {
  width: 100%;
  height: 100%;
  background: url('assets/pak/character_top_hp_ink.png?v=71') left top / 170px 16px no-repeat;
}

#bar-sp {
  width: 100%;
  height: 100%;
  background: url('assets/pak/character_top_mp_ink.png?v=71') left top / 170px 16px no-repeat;
}

.hud-bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
  letter-spacing: 0.2px;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
}

#skill-aim-banner {
  position: absolute;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(10, 22, 48, 0.92);
  border: 2px solid #ffd32a;
  color: #fff6b8;
  font-size: 13px;
  font-weight: 700;
  text-shadow: 0 1px 2px #000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
  z-index: 20;
  cursor: pointer;
  pointer-events: auto;
  white-space: nowrap;
}

#hud-special-time {
  position: absolute;
  left: 230px;
  top: 108px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(84, 42, 6, 0.92), rgba(32, 22, 54, 0.92));
  border: 1px solid #f59e0b;
  color: #fef08a;
  font-size: 11.5px;
  font-weight: 800;
  text-shadow: 0 1px 2px #000;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.48);
  z-index: 22;
  cursor: pointer;
  pointer-events: auto;
  white-space: nowrap;
}

#hud-special-time:hover {
  border-color: #fde047;
  filter: brightness(1.1);
}

#btn-autofarm {
  position: absolute;
  right: 29px;
  top: 150px;
  width: 58px;
  height: 58px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  z-index: 24;
  pointer-events: auto;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.72));
}

#btn-autofarm:active {
  transform: scale(0.94);
}

#btn-autofarm img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

#btn-autofarm.af-on img {
  filter: drop-shadow(0 0 8px rgba(52, 211, 153, 0.92)) brightness(1.06);
}

#btn-autofarm .af-hud-badge {
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  display: none;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(6, 78, 59, 0.96);
  border: 1px solid #34d399;
  color: #d1fae5;
  font-size: 9.5px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}

#btn-autofarm.af-on .af-hud-badge {
  display: inline-block;
}

.af-mode-bar {
  background: rgba(10, 20, 40, 0.88);
  border: 1px solid rgba(147, 197, 253, 0.25);
  border-radius: 8px;
  padding: 9px 11px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.af-mode-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.af-mode-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
}

.af-mode-radios label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.af-follow-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 640px) {
  .af-follow-row {
    grid-template-columns: 1fr;
  }
}

.af-check-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11.5px;
  color: #cbd5e1;
}

.af-check-strip label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.af-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 680px) {
  .af-grid-2col {
    grid-template-columns: 1fr;
  }
}

.af-card {
  background: rgba(10, 20, 40, 0.88);
  border: 1px solid rgba(147, 197, 253, 0.26);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.af-card-title {
  font-size: 12.5px;
  font-weight: 900;
  color: #fde047;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.af-card-head-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.af-count-pill {
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(30, 58, 138, 0.72);
  border: 1px solid rgba(96, 165, 250, 0.45);
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 800;
}

.af-edit-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #60a5fa;
  background: linear-gradient(180deg, #1d4ed8, #1e3a8a);
  color: #eff6ff;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.af-edit-btn:hover {
  filter: brightness(1.14);
}

.af-scroll-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  height: 175px;
  overflow-y: auto;
  padding: 4px;
  border-radius: 6px;
  background: rgba(6, 12, 26, 0.65);
  border: 1px solid rgba(71, 85, 105, 0.4);
}

.af-pot-subbox {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 7px;
  border-radius: 6px;
  background: rgba(15, 26, 52, 0.62);
  border: 1px solid rgba(96, 165, 250, 0.16);
}

.af-pot-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.af-pot-thresh {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
}

.af-pct-inp {
  width: 68px !important;
  min-width: 68px !important;
  flex: 0 0 68px !important;
  text-align: center;
  padding: 4px 6px !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  color: #fef08a !important;
  box-sizing: border-box;
  -moz-appearance: textfield;
}

.af-pct-inp::-webkit-outer-spin-button,
.af-pct-inp::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.af-scroll-sub {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 76px;
  overflow-y: auto;
  padding: 3px;
  border-radius: 5px;
  background: rgba(6, 12, 26, 0.6);
  border: 1px solid rgba(71, 85, 105, 0.35);
}

.af-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 7px;
  border-radius: 5px;
  background: rgba(15, 29, 58, 0.92);
  border: 1px solid rgba(96, 165, 250, 0.22);
  font-size: 11.5px;
  color: #e2e8f0;
  flex-shrink: 0;
}

.af-row-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.af-row-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.af-row-btns {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.af-scope-pill {
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.5);
  background: rgba(8, 47, 73, 0.85);
  color: #7dd3fc;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.af-mini-btn {
  padding: 2px 6px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid rgba(148, 163, 184, 0.42);
  background: rgba(30, 41, 59, 0.94);
  color: #e2e8f0;
  cursor: pointer;
}

.af-mini-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.af-mini-btn.danger {
  border-color: #f87171;
  color: #fecaca;
}

.af-empty {
  margin: auto;
  padding: 10px 6px;
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
}

/* Dedicated Edit/Add Picker Popup */
#af-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(2, 6, 23, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#af-picker-box {
  width: min(840px, 95vw);
  max-height: 86vh;
  background: linear-gradient(180deg, #0f1e3d, #081226);
  border: 2px solid #60a5fa;
  border-radius: 10px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.78);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #f8fafc;
}

.af-picker-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(90deg, #1d4ed8, #1e3a8a);
  border-bottom: 1px solid rgba(147, 197, 253, 0.35);
}

.af-picker-title {
  font-size: 14px;
  font-weight: 900;
  color: #fef9c3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.af-picker-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: rgba(15, 29, 58, 0.75);
  border-bottom: 1px solid rgba(96, 165, 250, 0.22);
}

.af-picker-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 14px 12px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

@media (max-width: 680px) {
  .af-picker-cols {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}

.af-picker-pane {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  background: rgba(7, 14, 30, 0.7);
  border: 1px solid rgba(96, 165, 250, 0.24);
  border-radius: 8px;
  padding: 8px;
}

.af-picker-pane-hdr {
  font-size: 12px;
  font-weight: 800;
  color: #93c5fd;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.af-picker-list {
  flex: 1;
  min-height: 220px;
  max-height: 52vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-right: 3px;
}

.af-pick-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(15, 29, 58, 0.92);
  border: 1px solid rgba(96, 165, 250, 0.2);
  flex-shrink: 0;
}

.af-pick-item.added {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(6, 78, 59, 0.32);
}

.af-pick-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.af-pick-name {
  font-size: 12px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.af-pick-sub {
  font-size: 10.5px;
  color: #93c5fd;
}

.af-tag-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(30, 64, 175, 0.7);
  border: 1px solid rgba(96, 165, 250, 0.4);
  color: #dbeafe;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
}

#restart-countdown-pill {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(122, 24, 14, 0.94);
  border: 1.5px solid #ffd32a;
  color: #fff5c0;
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 1px 2px #000;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.55);
  z-index: 36;
  cursor: pointer;
  pointer-events: auto;
  white-space: nowrap;
}

#restart-notice-modal {
  z-index: 95;
}

#restart-notice-box {
  width: 480px;
  max-width: 92%;
  padding: 22px 26px 20px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(16, 30, 56, 0.98), rgba(9, 17, 34, 0.98));
  border: 2px solid #ffd32a;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.78), 0 0 24px rgba(255, 211, 42, 0.28);
  color: #eef6ff;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
}

.restart-notice-badge {
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(255, 193, 7, 0.16);
  border: 1px solid rgba(255, 211, 42, 0.6);
  color: #ffd32a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
}

#restart-notice-title {
  font-size: 21px;
  font-weight: 800;
  color: #fff6c2;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

#restart-notice-timer {
  padding: 5px 18px;
  border-radius: 999px;
  background: rgba(231, 76, 60, 0.24);
  border: 1.5px solid #ff7675;
  color: #ffe2e2;
  font-size: 17px;
  font-weight: 800;
}

#restart-notice-body {
  font-size: 14px;
  line-height: 1.55;
  color: #e6f0ff;
  white-space: pre-line;
}

.restart-notice-hint {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(126, 249, 255, 0.45);
  color: #baf6ff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.restart-notice-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 4px;
}

#btn-restart-hard-refresh {
  padding: 9px 18px;
  border-radius: 8px;
  border: 1.5px solid #ffeaa7;
  background: linear-gradient(180deg, #f6b93b, #e58e26);
  color: #1e1304;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(246, 185, 59, 0.38);
}

#btn-restart-notice-close {
  min-width: 112px;
  padding: 9px 20px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

#hud.is-ally-aiming #party-hud {
  pointer-events: auto;
}

#hud.is-ally-aiming .party-hud-row.ally-pickable {
  cursor: pointer;
  pointer-events: auto;
  border-color: #2ed573;
  box-shadow: 0 0 10px rgba(46, 213, 115, 0.55);
}

#hud-buffs {
  position: absolute;
  left: 8px;
  top: 102px;
  display: flex;
  flex-wrap: wrap;
  max-width: 296px;
  gap: 4px;
  pointer-events: auto;
  z-index: 16;
}

#hud-chat-bubbles {
  position: absolute;
  top: 0;
  left: calc(-1 * var(--ui-safe-x));
  right: calc(-1 * var(--ui-safe-x));
  bottom: calc(-1 * var(--ui-safe-b));
  pointer-events: none;
  overflow: hidden;
  z-index: 4;
}

.overhead-chat-bubble {
  position: absolute;
  transform: translate(-50%, -100%);
  max-width: 290px;
  padding: 5px 11px;
  border-radius: 8px;
  background: rgba(14, 18, 28, 0.9);
  border: 2px solid #f5d87e;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  color: #fffdf0;
  font-family: 'Sarabun', "Segoe UI", Tahoma, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.32;
  text-align: center;
  text-shadow: 1px 1px 0 #000;
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-font-smoothing: antialiased;
}

.overhead-chat-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #f5d87e;
}

.buff-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1.5px solid #ffd32a;
  border-radius: 5px;
  background-color: rgba(12, 24, 48, 0.9);
  background-image: url('assets/pak/icon_buff.png?v=71');
  background-repeat: no-repeat;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
  cursor: pointer;
}

.buff-icon.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px #ffd32a, 0 2px 8px rgba(0, 0, 0, 0.8);
}

.buff-icon.is-debuff {
  border: 2px solid #ff2d2d;
  background-color: rgba(60, 8, 8, 0.92);
  background-image: none;
  box-shadow: 0 0 6px rgba(255, 45, 45, 0.75), inset 0 0 4px rgba(255, 45, 45, 0.5);
  color: #ff7675;
  font-size: 9px;
  font-weight: 900;
}

.buff-icon.bp-vip {
  border-color: #ffe072;
  box-shadow: 0 0 7px rgba(255, 215, 75, 0.8), 0 2px 6px rgba(0, 0, 0, 0.7);
}

.buff-icon.bp-free {
  border-color: #62b6ff;
  box-shadow: 0 0 6px rgba(98, 182, 255, 0.68), 0 2px 6px rgba(0, 0, 0, 0.7);
}

@keyframes ev-buff-orbit {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.buff-icon.ev-special {
  position: relative;
  overflow: hidden;
  border: none;
  padding: 0;
  background: #0c1428;
  background-image: none;
}

.buff-icon.ev-special::before {
  content: '';
  position: absolute;
  inset: -60%;
  background: conic-gradient(from 0deg, transparent 0deg 220deg, rgba(255, 240, 150, 0.95) 295deg, #ffffff 335deg, transparent 360deg);
  animation: ev-buff-orbit 2.1s linear infinite;
  pointer-events: none;
  z-index: 0;
}

.buff-icon.ev-special .ev-buff-face {
  position: absolute;
  inset: 2px;
  border-radius: 3.5px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 1;
}

.buff-icon.ev-zeny {
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.78), 0 2px 6px rgba(0, 0, 0, 0.72);
}

.buff-icon.ev-zeny::before {
  background: conic-gradient(from 0deg, transparent 0deg 205deg, #f59e0b 270deg, #fff3b0 330deg, transparent 360deg);
}

.buff-icon.ev-boss {
  box-shadow: 0 0 8px rgba(255, 71, 87, 0.8), 0 2px 6px rgba(0, 0, 0, 0.72);
}

.buff-icon.ev-boss::before {
  background: conic-gradient(from 0deg, transparent 0deg 205deg, #ff4757 270deg, #ffe066 330deg, transparent 360deg);
}

.buff-icon.ev-exp {
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.82), 0 2px 6px rgba(0, 0, 0, 0.72);
}

.buff-icon.ev-exp::before {
  background: conic-gradient(from 0deg, transparent 0deg 205deg, #38bdf8 265deg, #fde047 322deg, #e0f7ff 345deg, transparent 360deg);
}

.buff-icon.ev-special.active {
  box-shadow: 0 0 0 2px #fff, 0 0 11px rgba(255, 224, 102, 0.92);
}

#buff-tooltip {
  position: absolute;
  left: 8px;
  top: calc(104px + var(--hud-buffs-h, 34px));
  max-width: 290px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 2px solid #ffd32a;
  background: rgba(12, 24, 52, 0.94);
  color: #f3f7ff;
  font-size: 13px;
  line-height: 1.38;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.72);
  pointer-events: none;
  z-index: 32;
}

#buff-tooltip.interactive {
  pointer-events: auto;
}

#buff-tooltip .bt-title {
  font-weight: 800;
  color: #fffa65;
  font-size: 14px;
}

#buff-tooltip .bt-desc {
  color: #d9e8ff;
  margin-top: 2px;
}

#buff-tooltip .bt-sched {
  color: #7ef9ff;
  font-size: 11.5px;
  font-weight: 700;
  margin-top: 3px;
}

#buff-tooltip .bt-rem {
  color: #7bed9f;
  font-weight: 800;
  margin-top: 4px;
  font-size: 13px;
}

#buff-tooltip .bt-more-btn {
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid #d4a144;
  background: linear-gradient(180deg, #3f2b12 0%, #241707 100%);
  color: #ffe799;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}

#buff-tooltip .bt-more-btn:hover {
  border-color: #ffe28a;
  filter: brightness(1.12);
}

/* Top-Left WIKI Button (right of HP/SP #hud-top-left, clear gap before #hud-chat-box) */
#btn-wiki {
  position: absolute;
  left: 312px;
  top: 6px;
  width: 62px;
  height: 62px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  z-index: 25;
  pointer-events: auto;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.72));
}

#btn-wiki:active {
  transform: scale(0.94);
}

#btn-wiki img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  display: block;
}

#btn-battlepass {
  position: absolute;
  left: 380px;
  top: 6px;
  width: 62px;
  height: 62px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  z-index: 25;
  pointer-events: auto;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.72));
}

#btn-battlepass:active {
  transform: scale(0.94);
}

#btn-battlepass img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  display: block;
}

#btn-event-exp,
#btn-event-topup {
  position: absolute;
  top: 6px;
  width: 62px;
  height: 62px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  z-index: 25;
  pointer-events: auto;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.72));
}

#btn-event-exp { left: 448px; }
#btn-event-topup { left: 516px; }

#btn-event-exp:active,
#btn-event-topup:active {
  transform: scale(0.94);
}

#btn-event-exp img,
#btn-event-topup img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  display: block;
}

.bp-hud-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ef4444, #b91c1c);
  border: 1.5px solid #fde047;
  color: #fff;
  font-size: 10.5px;
  font-weight: 900;
  line-height: 15px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.bp-hud-badge.hidden {
  display: none;
}

/* Top-Center Ornate RPG Chat Box with Bilingual Filter Tabs & Click-to-Type Bar */
#hud-chat-box {
  position: absolute;
  right: 160px;
  top: 1px;
  width: clamp(300px, calc(100% - 750px), 500px);
  display: flex;
  flex-direction: column;
  border: 2px solid #c9973e;
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(16, 15, 14, 0.94) 0%, rgba(8, 9, 12, 0.92) 100%);
  box-shadow:
    inset 0 0 0 1px #4c310d,
    inset 0 1px 0 rgba(255, 224, 150, 0.3),
    0 0 0 1.5px #1d1206,
    0 6px 18px rgba(0, 0, 0, 0.82);
  pointer-events: auto;
  z-index: 24;
}

#chat-top-gem {
  position: absolute;
  left: 50%;
  top: -3px;
  transform: translateX(-50%);
  width: 34px;
  height: 16px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.85));
  z-index: 6;
}

#chat-tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
  padding: 4px 5px 3px;
  border-bottom: 1.5px solid #8a6427;
  background: linear-gradient(180deg, rgba(36, 26, 15, 0.96) 0%, rgba(16, 12, 8, 0.96) 100%);
  border-radius: 5px 5px 0 0;
  z-index: 2;
}

.chat-tab {
  height: 24px;
  padding: 0 3px;
  border-radius: 4px;
  border: 1px solid #6b4e23;
  background: linear-gradient(180deg, rgba(38, 29, 20, 0.92) 0%, rgba(18, 14, 10, 0.96) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 225, 160, 0.14);
  color: #a89982;
  font-family: 'Sarabun', sans-serif;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.14s ease, filter 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.chat-tab svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.chat-tab:not(.active) {
  opacity: 0.42;
  filter: grayscale(0.55);
  border-color: #463722;
  box-shadow: none;
}

.chat-tab:not(.active):hover {
  opacity: 0.72;
}

.chat-tab.active[data-ch="public"] {
  border-color: #62b6ff;
  background: linear-gradient(180deg, #1d57b8 0%, #0d2b63 100%);
  color: #eaf5ff;
  box-shadow: inset 0 1px 0 rgba(185, 226, 255, 0.45), 0 0 6px rgba(45, 130, 255, 0.45);
}

.chat-tab.active[data-ch="system"] {
  border-color: #f4b740;
  background: linear-gradient(180deg, #624212 0%, #312007 100%);
  color: #ffd372;
  box-shadow: inset 0 1px 0 rgba(255, 224, 150, 0.35);
}

.chat-tab.active[data-ch="party"] {
  border-color: #6dd853;
  background: linear-gradient(180deg, #1d5920 0%, #0e3010 100%);
  color: #9bf57f;
  box-shadow: inset 0 1px 0 rgba(190, 255, 175, 0.3);
}

.chat-tab.active[data-ch="guild"] {
  border-color: #bc7bff;
  background: linear-gradient(180deg, #4b236c 0%, #26103a 100%);
  color: #ddb4ff;
  box-shadow: inset 0 1px 0 rgba(232, 195, 255, 0.3);
}

.chat-tab.active[data-ch="whisper"] {
  border-color: #ff7ab8;
  background: linear-gradient(180deg, #632245 0%, #331024 100%);
  color: #ffb6d8;
  box-shadow: inset 0 1px 0 rgba(255, 195, 226, 0.3);
}

#chat-log-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 0 0 5px 5px;
  cursor: text;
}

#hud-chat-box.input-open #chat-log-wrap {
  border-radius: 0;
}

#chat-log-wrap::before {
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 84px;
  height: 110px;
  background: url('assets/pak/chat_watermark_crest.png?v=71') center / contain no-repeat;
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
}

#chat-log {
  position: relative;
  height: 92px;
  padding: 4px 8px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.38;
  font-weight: 600;
  color: #f3f1ec;
  text-shadow: 0 1px 2px #000;
  word-break: break-word;
  transition: height 0.14s ease;
  z-index: 1;
}

#hud-chat-box.input-open #chat-log {
  height: 136px;
}

#chat-log::-webkit-scrollbar {
  width: 6px;
}

#chat-log::-webkit-scrollbar-track {
  background: rgba(16, 14, 12, 0.72);
  border-radius: 3px;
}

#chat-log::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #b88533, #6f4b18);
  border-radius: 3px;
}

.chat-row {
  margin-bottom: 1.5px;
}

.chat-tag {
  font-weight: 800;
  margin-right: 4px;
}

.chat-sender {
  font-weight: 800;
  margin-right: 4px;
}

.chat-row.chat-normal .chat-tag,
.chat-row.chat-normal .chat-sender {
  color: #55b8ff;
}

.chat-row.chat-sys .chat-tag,
.chat-row.chat-sys .chat-sender {
  color: #f7b731;
}

.chat-row.chat-party .chat-tag,
.chat-row.chat-party .chat-sender {
  color: #6cd950;
}

.chat-row.chat-guild .chat-tag,
.chat-row.chat-guild .chat-sender {
  color: #c288ff;
}

.chat-row.chat-whisper .chat-tag,
.chat-row.chat-whisper .chat-sender {
  color: #ff80bf;
}

.chat-row.chat-forge .chat-tag {
  color: #f7b731;
}

.chat-row.chat-forge .chat-body {
  color: #ffb86c;
}

.chat-row.chat-lvup .chat-tag {
  color: #f7b731;
}

.chat-row.chat-lvup .chat-body {
  color: #a3ff78;
}

.chat-row.chat-boss .chat-tag {
  color: #ff6b81;
}

.chat-row.chat-boss .chat-body {
  color: #ffd1d8;
}

.chat-row.chat-err .chat-tag {
  color: #ff6b6b;
}

.chat-row.chat-err .chat-body {
  color: #ffb3b3;
}

#chat-input-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 6px;
  border-top: 1.5px solid #8a6427;
  border-radius: 0 0 5px 5px;
  background: linear-gradient(180deg, rgba(24, 19, 14, 0.96) 0%, rgba(12, 10, 8, 0.98) 100%);
  z-index: 3;
}

#chat-input-bar.hidden {
  display: none;
}

#chat-input-bar select,
#chat-input-bar input {
  height: 30px;
  border-radius: 4px;
  border: 1px solid #6e5025;
  background: rgba(10, 11, 14, 0.92);
  color: #f5efe0;
  font-size: 13px;
  padding: 0 6px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.75);
}

#chat-kind {
  width: 72px;
  font-weight: 700;
  color: #f4d68c;
  cursor: pointer;
}

#inp-whisper-to {
  width: 74px;
}

.chat-inp-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

#inp-chat {
  width: 100%;
  min-width: 0;
  padding-right: 42px;
}

#chat-char-cnt {
  position: absolute;
  right: 6px;
  font-size: 10px;
  font-weight: 800;
  color: #cbb089;
  pointer-events: none;
}

#chat-char-cnt.warn {
  color: #ffb347;
}

#chat-char-cnt.full {
  color: #ff6b6b;
}

#chat-input-bar button {
  height: 30px;
  padding: 0 8px;
  border-radius: 4px;
  border: 1px solid #b58333;
  background: linear-gradient(180deg, #3c2b17 0%, #22170c 100%);
  color: #f7dfa0;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  flex-shrink: 0;
}

#btn-send-chat {
  border-color: #7cc0ff;
  background: linear-gradient(180deg, #2564c9 0%, #103780 100%);
  color: #fff6dc;
  padding: 0 10px;
  box-shadow: inset 0 1px 0 rgba(185, 224, 255, 0.45);
}

#btn-emot-toggle,
#btn-chat-close {
  width: 28px;
  padding: 0;
}

#emoticon-grid {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  width: 344px;
  max-width: 100%;
  padding: 7px;
  background: rgba(14, 17, 26, 0.96);
  border: 2px solid #b58333;
  border-radius: 7px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.85);
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  z-index: 30;
}

#emoticon-grid.hidden {
  display: none;
}

.emot-btn {
  width: 36px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Top-Right: Minimap + ch0 + antenna + crisp -/+ collapse + SHOP & LOCK */
#hud-minimap-wrap {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 148px;
  height: 142px;
  border: 3px solid #914319;
  outline: 2px solid #e7b54a;
  background: #0d1522;
  overflow: hidden;
  border-radius: 3px;
}

#hud-minimap-wrap.collapsed {
  width: 148px;
  height: 38px;
  border: none;
  outline: none;
  background: transparent;
}

#hud-minimap-wrap.collapsed #mm-header {
  background: transparent;
}

#hud-minimap-wrap.collapsed #minimap,
#hud-minimap-wrap.collapsed #mm-map-badge {
  display: none;
}

#mm-header {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  z-index: 3;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.68), transparent);
}

#mm-header img {
  width: 32px;
  height: 28px;
}

#mm-perf {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  line-height: 1.02;
  font-size: 11px;
  font-weight: 800;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000;
  min-width: 44px;
}

#hud-ping {
  color: #7bed9f;
}

#hud-fps {
  color: #70a1ff;
}

#hud-ch {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  text-shadow: 1.5px 1.5px 0 #000, -1px -1px 0 #000;
}

#btn-mm-toggle {
  width: 34px;
  height: 34px;
  border: none;
  background: url('assets/pak/mini_map_button01.png?v=71') center / 100% 100% no-repeat;
  cursor: pointer;
  flex-shrink: 0;
}

#hud-minimap-wrap.collapsed #btn-mm-toggle {
  background-image: url('assets/pak/mini_map_button00.png?v=71');
}

#minimap {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  cursor: pointer;
}

#mm-map-badge {
  position: absolute;
  left: 4px;
  bottom: 2px;
  font-size: 14px;
  font-weight: 700;
  color: #ffeaa7;
  text-shadow: 1px 1px 0 #000;
  pointer-events: none;
}

#btn-home {
  display: none !important;
  position: absolute;
  right: 158px;
  top: 150px;
  width: 64px;
  height: 64px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  pointer-events: auto;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.72));
}

#btn-home:active {
  transform: scale(0.94);
}

#btn-home img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
}

#btn-shop {
  position: absolute;
  right: 98px;
  top: 150px;
  width: 58px;
  height: 58px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.72));
}

#btn-shop:active {
  transform: scale(0.94);
}

#btn-shop img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Right Collapsible 6-Slot Ornate RPG Hotkey Bar */
#hotkey-wrap {
  position: absolute;
  right: 4px;
  top: 212px;
  width: 205px;
  height: 274px;
  transition: transform 0.16s ease;
  touch-action: none;
  z-index: 23;
}

#hotkey-wrap.collapsed {
  transform: translateX(184px);
}

#hk-frame {
  position: absolute;
  left: 25px;
  top: 0;
  width: 180px;
  height: 274px;
  background: none;
  border: none;
  box-sizing: border-box;
  z-index: 3;
  transition: opacity 0.14s ease;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.78));
}

#hotkey-wrap.collapsed #hk-frame {
  opacity: 0;
  pointer-events: none;
}

#hk-frame-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  display: block;
}

#hk-gems {
  position: absolute;
  left: 0;
  top: 24px;
  width: 28px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 2;
  transition: opacity 0.14s ease;
}

#hotkey-wrap.collapsed #hk-gems {
  opacity: 0;
  pointer-events: none;
}

.hk-gem {
  width: 28px;
  height: 38px;
  padding: 0 3px 0 0;
  border: none;
  background: url('assets/pak/hotkey_tab_idle.png?v=71') center / 100% 100% no-repeat;
  color: #cbb089;
  font-family: 'Sarabun', sans-serif;
  font-size: 13px;
  font-weight: 800;
  text-shadow: 0 1px 2px #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  filter: drop-shadow(-2px 2px 3px rgba(0, 0, 0, 0.55));
}

.hk-gem:hover {
  color: #fff2cf;
  filter: brightness(1.1) drop-shadow(-2px 2px 3px rgba(0, 0, 0, 0.55));
}

.hk-gem.active {
  background-image: url('assets/pak/hotkey_tab_active.png?v=71');
  color: #ffe799;
  filter: drop-shadow(-2px 2px 5px rgba(32, 108, 255, 0.45));
}

#hk-collapse {
  position: absolute;
  left: 0;
  bottom: 34px;
  width: 28px;
  height: 38px;
  padding: 0;
  border: none;
  background: url('assets/pak/hotkey_tab_collapse.png?v=71') center / 100% 100% no-repeat;
  cursor: pointer;
  touch-action: none;
  z-index: 2;
  filter: drop-shadow(-2px 2px 4px rgba(0, 0, 0, 0.68));
}

#hk-collapse:hover {
  filter: brightness(1.12) drop-shadow(-2px 2px 4px rgba(0, 0, 0, 0.68));
}

#hotkey-wrap.collapsed #hk-collapse {
  filter: brightness(1.15) drop-shadow(-2px 2px 6px rgba(247, 211, 120, 0.45));
}

#hk-slots {
  position: absolute;
  left: 31px;
  top: 30px;
  width: 121px;
  height: 211px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: 58fr 56fr 55fr;
  column-gap: 16px;
  row-gap: 21px;
  z-index: 2;
}

.hk-btn {
  position: relative;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}

.hk-btn:hover {
  box-shadow: inset 0 0 10px rgba(247, 211, 120, 0.24);
}

.hk-btn:active {
  background: rgba(255, 220, 120, 0.22);
  box-shadow: inset 0 0 12px rgba(255, 220, 120, 0.45);
}

.hk-btn > .icon-skill-30 {
  transform: scale(0.88);
}

.hk-num {
  position: absolute;
  right: 2px;
  bottom: 2px;
  min-width: 14px;
  height: 14px;
  padding: 0 2px;
  border-radius: 3px;
  background: rgba(10, 12, 18, 0.92);
  border: 1px solid #b58333;
  color: #f6e7c1;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 12px;
  text-align: center;
  pointer-events: none;
  z-index: 4;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.hk-cnt {
  position: absolute;
  left: 3px;
  bottom: 2px;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  text-shadow: 1.5px 1.5px 0 #000, -1px -1px 0 #000;
  z-index: 4;
}

.hk-btn.is-casting {
  border-color: #7ef9ff;
  box-shadow: inset 0 0 0 2px #0e4a6b, 0 0 8px rgba(126, 249, 255, 0.8);
}

.hk-cd-mask {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background: rgba(5, 10, 22, 0.72);
  pointer-events: none;
  z-index: 2;
}

.hk-cd-txt {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: #fffa65;
  text-shadow: -1.5px -1.5px 0 #000, 1.5px -1.5px 0 #000, -1.5px 1.5px 0 #000, 1.5px 1.5px 0 #000;
  pointer-events: none;
  z-index: 3;
}

.hk-cd-txt.active {
  display: flex;
}

/* Bottom-Left: Joystick */
#joy-zone {
  position: absolute;
  left: 54px;
  bottom: 20px;
  width: 148px;
  height: 156px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

#joy-pad {
  position: absolute;
  inset: 0;
  width: 148px;
  height: 156px;
  pointer-events: none;
}

#joy-knob {
  position: relative;
  width: 64px;
  height: 68px;
  pointer-events: none;
}

#btn-stick-toggle {
  position: absolute;
  left: 4px;
  bottom: 4px;
  width: 56px;
  height: 52px;
  border: none;
  background: none;
  cursor: pointer;
}

#btn-stick-toggle img {
  width: 56px;
  height: 52px;
}

/* Top-Left Target Nameplate (directly below attached Player Buffs bar) */
#target-plate {
  position: absolute;
  left: 6px;
  top: calc(106px + var(--hud-buffs-h, 0px));
  width: 192px;
  min-height: 42px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(18, 22, 30, 0.88);
  border: 2px solid #8a94a6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  pointer-events: auto;
  z-index: 25;
}

#target-plate.is-player {
  cursor: pointer;
  border-color: #70a1ff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

#target-plate.is-player:hover {
  border-color: #ffd32a;
}

#target-plate.no-hp {
  min-height: 26px;
}

#tp-hp-bg.hidden {
  display: none;
}

#tp-buffs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 2px;
}

.tp-buff-icon {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1.5px solid #ffd32a;
  border-radius: 4px;
  background-color: rgba(12, 18, 30, 0.92);
  background-repeat: no-repeat;
  color: #fff;
  font-size: 7.5px;
  font-weight: 900;
  line-height: 17px;
  text-align: center;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}

.tp-buff-icon.is-debuff {
  border: 2px solid #ff2d2d;
  background-color: rgba(60, 8, 8, 0.92);
  box-shadow: 0 0 6px rgba(255, 45, 45, 0.75), inset 0 0 4px rgba(255, 45, 45, 0.5);
}

.tp-buff-icon.active {
  transform: scale(1.1);
  border-color: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.85);
}

#target-buff-tooltip {
  position: absolute;
  left: 6px;
  top: 158px;
  max-width: 250px;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1.5px solid #fffa65;
  background: rgba(12, 24, 52, 0.96);
  color: #f3f7ff;
  font-size: 12.5px;
  line-height: 1.38;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.78);
  pointer-events: none;
  z-index: 33;
}

#target-buff-tooltip .bt-title {
  font-weight: 800;
  color: #fffa65;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 5px;
}

#target-buff-tooltip .bt-desc {
  color: #d9e8ff;
  margin-top: 2px;
}

#target-buff-tooltip .bt-rem {
  color: #7bed9f;
  font-weight: 800;
  margin-top: 4px;
  font-size: 12px;
}

.tbt-badge {
  display: inline-block;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.3px;
}

.tbt-badge.buff {
  background: rgba(52, 211, 153, 0.2);
  border: 1px solid #34d399;
  color: #6ee7b7;
}

.tbt-badge.debuff {
  background: rgba(255, 71, 87, 0.25);
  border: 1px solid #ff4757;
  color: #ff8a96;
}

#party-hud {
  position: absolute;
  left: 6px;
  top: calc(106px + var(--hud-buffs-h, 0px));
  width: 168px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
  z-index: 12;
}

#hud.has-target #party-hud {
  top: calc(112px + var(--hud-buffs-h, 0px) + var(--target-plate-h, 42px));
}

.party-hud-row {
  background: rgba(12, 22, 36, 0.84);
  border: 1px solid rgba(123, 237, 159, 0.5);
  border-radius: 6px;
  padding: 3px 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.party-hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.party-hud-name-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.party-hud-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7f8c8d;
  flex-shrink: 0;
}

.party-hud-dot.same-map {
  background: #2ed573;
  box-shadow: 0 0 5px #2ed573;
}

.party-hud-name {
  font-size: 12px;
  font-weight: 700;
  color: #eafff0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.party-hud-lv {
  font-size: 10.5px;
  color: #ffd32a;
  font-weight: 700;
  flex-shrink: 0;
}

.party-hud-bar {
  height: 6px;
  background: #1a2d22;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 2px;
  border: 1px solid rgba(0, 0, 0, 0.6);
}

.party-hud-fill {
  height: 100%;
  background: linear-gradient(90deg, #26de81, #20bf6b);
  transition: width 0.2s;
}

.party-hud-fill.low {
  background: linear-gradient(90deg, #ff6b81, #ff4757);
}

.party-hud-hp-txt {
  font-size: 9.5px;
  color: #c8f7dc;
  text-align: right;
  line-height: 1.1;
  margin-top: 1px;
}

#player-ctx-menu {
  position: absolute;
  left: 6px;
  top: 144px;
  width: 196px;
  background: rgba(14, 21, 35, 0.96);
  border: 2px solid #e7b54a;
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 60;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.78);
}

#player-ctx-menu button {
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  border: 1px solid rgba(112, 161, 255, 0.35);
  border-radius: 6px;
  background: rgba(25, 45, 82, 0.85);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

#player-ctx-menu button:hover {
  background: #2f5aa8;
  border-color: #ffd32a;
}

#tp-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  font-size: 13px;
  line-height: 1.15;
  font-weight: 700;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#tp-name span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp-guild-emblem {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid rgba(255, 215, 90, 0.85);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.75);
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(10, 14, 24, 0.85);
}

#tp-hp-bg {
  position: relative;
  width: 100%;
  height: 14px;
  background: #2b0c0c;
  border: 1px solid #000;
  border-radius: 3px;
  overflow: hidden;
}

#tp-hp-fill {
  width: 100%;
  height: 100%;
  background: #d92626;
}

#tp-hp-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 800;
  color: #fff;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
  pointer-events: none;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* Bottom-Right Action Cluster */
#btn-pick {
  position: absolute;
  right: 276px;
  bottom: 12px;
  width: 84px;
  height: 84px;
  border: none;
  background: none;
  cursor: pointer;
  touch-action: none;
}

#btn-pick img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#btn-target {
  position: absolute;
  right: 180px;
  bottom: 12px;
  width: 84px;
  height: 84px;
  border: none;
  background: none;
  cursor: pointer;
  touch-action: none;
}

#btn-target img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#btn-atk {
  position: absolute;
  right: 10px;
  bottom: 4px;
  width: 164px;
  height: 148px;
  border: none;
  background: none;
  cursor: pointer;
  touch-action: none;
}

#btn-atk img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#btn-pick:active,
#btn-target:active,
#btn-atk:active {
  transform: scale(0.93);
}

/* ==================== IN-GAME MENU DRAWER (Authentic RO Silver Bevel + Poring Sky Backdrop + Right Quick Bar) ==================== */
#menu-drawer {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 45;
  padding: 12px calc(12px + var(--ui-safe-x)) calc(12px + var(--ui-safe-b));
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
}

#menu-frame-wrap {
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: 936px;
  max-width: 98%;
  height: 576px;
  max-height: 95%;
}

#menu-shell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

#top-menu-bar {
  position: relative;
  height: 76px;
  padding: 6px 10px 4px;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, #64abff 0%, #2468db 42%, #0f3f9e 58%, #1e59c7 100%);
  border: 3px solid #161d29;
  border-bottom: none;
  box-shadow: inset 0 2px 0 #d9e8ff, inset 0 -2px 0 #092660, 0 4px 16px rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

#top-menu-bar button[data-menu] {
  position: relative;
  flex: 1;
  height: 64px;
  border: 2px solid transparent;
  border-radius: 9px 9px 4px 4px;
  background: transparent;
  color: #e9f3ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  text-shadow: 1.5px 1.5px 0 #081838, -1px -1px 0 #081838;
  transition: transform 0.1s ease;
}

#top-menu-bar button[data-menu]:hover {
  background: rgba(255, 255, 255, 0.14);
}

#top-menu-bar button[data-menu] img {
  width: 68px;
  height: 54px;
  margin-top: 0;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.65));
}

#top-menu-bar button[data-menu] span {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

#top-menu-bar button[data-menu].active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(114, 186, 255, 0.25));
  border-color: #ffffff;
  color: #fff;
  box-shadow: 0 0 12px rgba(190, 232, 255, 0.72), inset 0 1px 0 #fff;
  transform: translateY(-2px);
}

#top-menu-bar button[data-menu].active span {
  color: #fff;
  text-shadow: 0 0 8px #70c8ff, 1.5px 1.5px 0 #072255;
}

#menu-window {
  flex: 1;
  min-height: 0;
  border-radius: 0 0 12px 12px;
  background: url('assets/pak/gp_menu_system.png?v=71') center / 100% 100% no-repeat;
  border: 4px solid #161d29;
  box-shadow: inset 0 0 0 3px #eef3fb, inset 0 0 0 6px #6b7b94, 0 12px 30px rgba(0, 0, 0, 0.75);
  padding: 16px;
  color: #fff;
  overflow: hidden;
}

/* Right Quick Action Vertical Sidebar (Close / Message Board / Look For Party / Daily Spin) */
#menu-right-bar {
  width: 86px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding-top: 4px;
}

.menu-side-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  text-align: center;
  transition: transform 0.12s ease;
}

.menu-side-btn:hover {
  transform: scale(1.06);
}

.menu-side-btn:active {
  transform: scale(0.95);
}

.menu-side-btn img {
  width: 68px;
  height: 66px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.8));
}

.menu-side-btn span {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 0.2px;
  color: #fff;
  text-shadow: -1.5px -1.5px 0 #000, 1.5px -1.5px 0 #000, -1.5px 1.5px 0 #000, 1.5px 1.5px 0 #000;
}

.spin-icon-ring {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  padding: 5px;
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, #8fa1ba 35%, #233044 80%, #101620 100%);
  border: 2.5px solid #161d29;
  box-shadow: inset 0 0 0 2px #dce5f2, 0 3px 8px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.spin-icon-ring img {
  width: 48px !important;
  height: 48px !important;
  border-radius: 50%;
}

/* Authentic System Screen with Toggle Cards + Classic Buttons over Poring Sky Backdrop */
.ro-sys-btn-list {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  overflow-y: auto;
}

.ro-sys-toggles {
  width: min(560px, 94%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 2px;
}

.ro-sys-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1.5px solid #598be0;
  background: linear-gradient(180deg, rgba(16, 40, 88, 0.94), rgba(10, 24, 58, 0.96));
  color: #e6f2ff;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.42);
}

.ro-sys-toggle-card.is-on {
  border-color: #7bed9f;
  background: linear-gradient(180deg, rgba(18, 66, 62, 0.94), rgba(10, 40, 42, 0.96));
}

.ro-sys-toggle-info {
  min-width: 0;
  flex: 1;
}

.ro-sys-toggle-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 800;
  color: #fff;
}

.ro-sys-toggle-sub {
  font-size: 11px;
  color: #b7d3ff;
  margin-top: 2px;
  line-height: 1.25;
}

.ro-sys-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  flex-shrink: 0;
  background: rgba(120, 32, 32, 0.85);
  border: 1px solid #ff7f7f;
  color: #ffe2e2;
}

.ro-sys-toggle-card.is-on .ro-sys-pill {
  background: rgba(20, 118, 64, 0.92);
  border-color: #7bed9f;
  color: #eafff2;
}

.ro-sys-grid {
  width: min(560px, 94%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 14px;
}

.ro-sys-big-btn {
  width: 100%;
  height: 50px;
  border: none;
  background: url('assets/pak/button_192.png?v=71') center / 100% 100% no-repeat;
  color: #0b1830;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.42));
  transition: transform 0.1s ease;
}

.ro-sys-big-btn:hover,
.ro-sys-big-btn:active {
  background-image: url('assets/pak/button_192_sel.png?v=71');
  color: #fff;
  text-shadow: 1px 1px 0 #000;
  transform: translateY(-1px);
}

.gm-skill-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.ro-win-grid-2 {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  grid-template-rows: minmax(0, 1fr);
  gap: 12px;
  height: 100%;
  min-height: 0;
}

.ro-win-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.ro-subcard {
  background: rgba(11, 28, 62, 0.86);
  border: 2px solid #82b8ff;
  box-shadow: inset 0 0 0 1px #193870, 0 3px 10px rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 10px 12px;
}

.ro-card-title {
  font-size: 16px;
  font-weight: 800;
  color: #fffa65;
  margin-bottom: 4px;
  text-shadow: 1px 1px 0 #000;
}

/* Status window */
.gm-hero-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gm-hero-cvs {
  background: url('assets/pak/chapter_bg.png?v=71') center / cover no-repeat;
  border: 2px solid #6ba4ff;
  border-radius: 8px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.gm-hero-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gm-hero-name {
  font-size: 20px;
  font-weight: 800;
  color: #fffa65;
}

.gm-hero-job {
  font-size: 15px;
  font-weight: 700;
  color: #7ef9ff;
}

.gm-lv-row {
  display: grid;
  grid-template-columns: 88px 1fr 44px;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

.gm-exp-bar {
  height: 10px;
  background: #0c182c;
  border: 1px solid #4d78ba;
  border-radius: 5px;
  overflow: hidden;
}

.gm-exp-bar>div {
  height: 100%;
  background: #26de81;
}

.gm-exp-bar.gold>div {
  background: #fed330;
}

.gm-stats-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.gm-st-row {
  display: grid;
  grid-template-columns: 1fr auto 34px 56px;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.gm-st-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.gm-st-lbl {
  font-size: 15px;
  font-weight: 800;
  color: #7ef9ff;
  line-height: 1.1;
}

.gm-st-desc {
  font-size: 11px;
  font-weight: 600;
  color: #b7d3ff;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gm-st-val {
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}

.gm-st-val b {
  color: #7bed9f;
}

.gm-plus-btn {
  height: 30px;
  border: 2px solid #8fc0ff;
  border-radius: 6px;
  background: #2568d8;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.gm-plus-btn:disabled {
  opacity: 0.32;
  cursor: default;
}

.gm-st-cost {
  font-size: 13px;
  text-align: right;
  color: #cde2ff;
}

.gm-pt-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  border-top: 1px solid rgba(140, 190, 255, 0.35);
  font-size: 17px;
  font-weight: 800;
}

.gm-pt-footer b {
  color: #fffa65;
  font-size: 20px;
}

.gm-combat-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.gm-kv-row b .gm-bonus,
.gm-kv-row .gm-bonus {
  color: #7bed9f;
  margin-left: 4px;
}

.gm-kv-row .gm-bonus.neg {
  color: #ff7675;
}

.gm-kv-row .gm-debuff-val {
  color: #ff6b6b;
  font-weight: 800;
}

.gm-kv-row.gm-kv-debuff {
  background: rgba(255, 71, 87, 0.14);
  border-radius: 4px;
}

.gm-kv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 6px;
  font-size: 14px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#hk-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 10, 24, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 95;
}

.hk-picker-card {
  width: min(520px, 94vw);
  background: linear-gradient(180deg, #16294b 0%, #0d1930 100%);
  border: 3px solid #6ba6ff;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.75);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hk-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hk-picker-title {
  font-size: 16px;
  font-weight: 800;
  color: #fffa65;
}

.hk-picker-sub {
  font-size: 12.5px;
  color: #b7d3ff;
}

.hk-picker-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.hk-picker-row {
  display: grid;
  grid-template-columns: 78px repeat(6, 1fr);
  align-items: center;
  gap: 6px;
}

.hk-picker-page {
  font-size: 13px;
  font-weight: 800;
  color: #9fc5ff;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  text-align: center;
}

.hk-picker-page.active {
  color: #ffd32a;
  border: 1px solid #ffd32a;
  background: rgba(255, 211, 42, 0.14);
}

.hk-picker-cell {
  position: relative;
  height: 54px;
  border-radius: 7px;
  border: 2px solid #3c6dc2;
  background: #0a1b39;
  color: #cfe4ff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  transition: transform 0.08s ease, border-color 0.12s ease;
}

.hk-picker-cell:hover {
  border-color: #ffd32a;
  background: #17366d;
  transform: translateY(-1px);
}

.hk-picker-cell.occupied {
  border-color: #d4931b;
  background: #142544;
}

.hk-picker-idx {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 10px;
  font-weight: 800;
  color: #9fc5ff;
  line-height: 1;
  text-shadow: 0 1px 2px #000;
}

.gm-kv-row.zeny b {
  color: #fffa65;
  font-size: 18px;
}

.gm-kv-row.ruby b {
  color: #ff6b81;
  font-size: 18px;
}

/* Equip window */
.gm-equip-layout {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding-right: 0;
}

.gm-equip-top.gm-eq-v2-top {
  display: grid;
  grid-template-columns: 46% 1fr;
  gap: 8px;
  flex: 1 1 0;
  min-height: 0;
}

.gm-eq-v2-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  padding: 6px 8px;
  overflow: hidden;
}

.gm-eq-v2-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  flex-shrink: 0;
}

.gm-eq-v2-tab {
  height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1.5px solid #4877c4;
  background: rgba(8, 22, 52, 0.85);
  color: #b7d3ff;
  font-size: 12.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}

.gm-eq-v2-tab.active {
  background: linear-gradient(180deg, #4b8bff 0%, #2457bd 100%);
  border-color: #93c5fd;
  color: #fff;
  box-shadow: 0 0 8px rgba(75, 139, 255, 0.45);
}

.gm-eq-v2-paperdoll {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 112px 1fr 112px;
  gap: 6px;
}

.gm-eq-v2-paperdoll .gm-eq-col {
  display: grid;
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: 4px;
  min-height: 0;
}

.gm-eq-v2-paperdoll .gm-eq-box {
  height: 100%;
  min-height: 0;
  padding: 2px 6px;
}

.gm-eq-v2-paperdoll .gm-eq-tag {
  font-size: 10.5px;
}

.gm-eq-v2-stage {
  height: 100%;
  min-height: 0;
  border-radius: 8px;
  border: 1.5px solid #3c6ab8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.gm-eq-v2-stats-pane {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  padding: 4px 6px;
  background: rgba(8, 20, 46, 0.55);
  border-radius: 8px;
  border: 1px solid rgba(72, 119, 196, 0.55);
}

.gm-eq-v2-stats-list {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.gm-eq-v2-stats-list .gm-kv-row {
  padding: 2px 2px;
  font-size: 12px;
  line-height: 1.25;
}

.gm-eq-v2-stat-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  flex-shrink: 0;
  margin-top: 0;
  padding-top: 4px;
}

.gm-eq-v2-stat-btns .ro-action-btn {
  padding: 4px 6px;
  font-size: 12px;
}

.gm-eq-v2-bag-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-shrink: 0;
}

.gm-eq-v2-bag-title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 800;
  color: #e6f2ff;
  white-space: nowrap;
}

.gm-eq-v2-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1.5px solid #4877c4;
  background: rgba(8, 22, 52, 0.85);
  color: #cde1ff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.gm-eq-v2-switch {
  width: 24px;
  height: 14px;
  border-radius: 999px;
  background: #334e80;
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  transition: background 0.15s;
}

.gm-eq-v2-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.15s;
}

.gm-eq-v2-filter-toggle.on {
  border-color: #38bdf8;
  color: #fff;
}

.gm-eq-v2-filter-toggle.on .gm-eq-v2-switch {
  background: #0ea5e9;
}

.gm-eq-v2-filter-toggle.on .gm-eq-v2-switch::after {
  left: 12px;
}

.gm-eq-v2-bag-grid {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: 44px;
  gap: 5px;
  overflow-y: auto;
  padding-right: 2px;
}

.gm-eq-v2-cell {
  height: 44px;
  min-height: 44px;
}

.gm-eq-v2-cell.unusable {
  opacity: 0.55;
}

.gm-eq-v2-bag-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 2px;
}

.gm-eq-v2-cap {
  font-size: 13px;
  font-weight: 800;
  color: #cfe3ff;
}

.gm-eq-v2-foot-btns {
  display: flex;
  gap: 6px;
}

.gm-eq-v2-foot-btn {
  padding: 3px 9px !important;
  font-size: 12px !important;
  min-height: 26px !important;
}

.gm-equip-top {
  display: grid;
  grid-template-columns: 150px 1fr 150px 190px;
  gap: 8px;
  flex: 0 1 auto;
  min-height: 0;
}

.gm-eq-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

.gm-eq-center {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gm-eq-preview {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('assets/pak/chapter_bg.png?v=71') center / cover no-repeat;
}

.gm-hero-cvs-lg {
  image-rendering: pixelated;
}

.gm-eq-acc-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.gm-eq-acc-row .gm-eq-box {
  height: 42px;
}

.gm-eq-box {
  height: 50px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(8, 20, 46, 0.85);
  border: 2px solid #4877c4;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.gm-eq-box.selected {
  border-color: #ffd32a;
  background: rgba(45, 95, 185, 0.65);
}

.gm-eq-tag {
  font-size: 12px;
  font-weight: 800;
  color: #9fc5ff;
  max-width: 58%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gm-eq-ref {
  font-size: 14px;
  font-weight: 800;
  color: #fffa65;
}

.gm-eq-box .gm-eq-ref {
  position: absolute;
  top: 2px;
  right: 4px;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(8, 20, 46, 0.88);
  border: 1px solid rgba(255, 211, 42, 0.45);
  font-size: 12px;
  line-height: 15px;
  z-index: 2;
  pointer-events: none;
}

.gm-eq-stats {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.gm-eq-strip-new {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  height: 58px;
}

/* Item window */
.gm-item-layout {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
}

.gm-item-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gm-bags-strip {
  display: flex;
  gap: 6px;
}

.gm-bag-mini {
  position: relative;
  width: 48px;
  height: 44px;
  border-radius: 7px;
  background: #0a1a38;
  border: 2px solid #497cd0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  color: #fff;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.1s ease;
}

.gm-bag-mini:hover {
  border-color: #8cc2ff;
  background: #122a57;
}

.gm-bag-mini.active {
  background: linear-gradient(180deg, #2557ad, #163b7a);
  border-color: #ffd32a;
  box-shadow: 0 0 0 1.5px #ffd32a;
}

.gm-bag-mini.empty {
  border-style: dashed;
  border-color: rgba(89, 142, 230, 0.42);
  background: rgba(8, 18, 38, 0.55);
  opacity: 0.7;
}

.gm-bag-num {
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 10px;
  font-weight: 800;
  color: #9fc5ff;
  line-height: 1;
  text-shadow: 0 1px 2px #000;
}

.gm-bag-mini.active .gm-bag-num {
  color: #fffa65;
}

.gm-bag-cnt {
  position: absolute;
  bottom: 1px;
  right: 2px;
  padding: 0 3px;
  border-radius: 4px;
  background: rgba(5, 12, 28, 0.85);
  font-size: 9.5px;
  font-weight: 800;
  color: #dff0ff;
  line-height: 1.15;
}

.gm-bag-info-pill {
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(12, 30, 66, 0.82);
  border: 1.5px solid #497cd0;
  color: #dbeeff;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.gm-page-btns {
  display: flex;
  gap: 6px;
}

.ro-pill-btn {
  width: 52px;
  height: 40px;
  border-radius: 8px;
  border: 2px solid #598ee6;
  background: #13316b;
  color: #cde2ff;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.ro-pill-btn.active {
  background: #3b82f6;
  border-color: #ffd32a;
  color: #fff;
}

.gm-carry-pill {
  margin-left: auto;
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(8, 20, 46, 0.78);
  border: 2px solid #497cd0;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 16px;
  font-weight: 700;
}

.gm-carry-pill b {
  color: #fffa65;
}

.gm-bag-grid-new {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
  min-height: 0;
}

.gm-slot-dark {
  position: relative;
  border-radius: 8px;
  background: #0b2144;
  border: 2px solid #3868b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gm-slot-dark.selected {
  border-color: #ffd32a;
  box-shadow: inset 0 0 0 2px #ffd32a;
  background: #193e7a;
}

.gm-slot-dark.locked {
  background: rgba(55, 62, 74, 0.72);
  border-color: #6b7280;
  opacity: 0.72;
  cursor: default;
}

.gm-slot-dark.move-src {
  border-color: #7bed9f;
  box-shadow: inset 0 0 0 2px #7bed9f;
}

#trade-box {
  width: 680px;
  max-width: 96%;
  max-height: 92%;
  background: linear-gradient(180deg, #1b2842 0%, #0f182a 100%);
  border: 3px solid #e7b54a;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#trade-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: linear-gradient(180deg, #334e80, #1f3359);
  border-bottom: 2px solid #e7b54a;
  font-size: 18px;
  font-weight: 800;
  color: #fffa65;
}

#btn-trade-close {
  background: none;
  border: none;
  cursor: pointer;
}

#btn-trade-close img {
  width: 28px;
  height: 28px;
}

#trade-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.trade-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.trade-panel {
  background: rgba(9, 15, 28, 0.78);
  border: 1.5px solid #4669a3;
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.trade-panel.locked {
  border-color: #7bed9f;
  box-shadow: inset 0 0 0 1px #7bed9f;
}

.trade-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  min-height: 96px;
}

.gm-seal-tag {
  position: absolute;
  left: 4px;
  top: 3px;
  font-size: 11px;
  font-weight: 800;
  background: #c0392b;
  color: #fff;
  padding: 1px 4px;
  border-radius: 4px;
}

.gm-desc-bar {
  height: 76px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(8, 20, 46, 0.85);
  border: 2px solid #497cd0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gm-desc-txt {
  font-size: 15px;
  line-height: 1.3;
  white-space: pre-line;
  color: #eef5ff;
  overflow-y: auto;
  max-height: 100%;
}

.gm-desc-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.ro-action-btn {
  padding: 8px 14px;
  border: 2px solid #8fc0ff;
  border-radius: 8px;
  background: #235ec4;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.gm-sk-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(11, 28, 62, 0.86);
  border: 1.5px solid #699ee8;
}

.gm-sk-cls {
  font-size: 13.5px;
  font-weight: 800;
  color: #fffa65;
}

.gm-sk-item.locked {
  opacity: 0.62;
}

.npc-storage-sec-hdr {
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(24, 54, 112, 0.92);
  border: 1px solid #ffd32a;
  color: #fffa65;
  font-size: 14px;
  font-weight: 800;
  position: sticky;
  top: 0;
  z-index: 2;
}

.ro-action-btn:hover:not(:disabled) {
  filter: brightness(1.12);
}

.ro-action-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.ro-action-btn.danger {
  background: #a82828;
  border-color: #ff9c9c;
}

/* Skill & Quest lists inside windows */
.gm-scroll-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

.gm-detail-grow {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

.gm-quest-detail {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  gap: 6px;
}

.gm-quest-head {
  flex-shrink: 0;
}

.gm-quest-desc {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  font-size: 14.5px;
  line-height: 1.45;
  color: #eef5ff;
  white-space: pre-wrap;
  background: rgba(5, 14, 34, 0.55);
  border: 1px solid rgba(112, 161, 255, 0.28);
  border-radius: 7px;
  padding: 8px 10px;
}

.gm-quest-actions {
  flex-shrink: 0;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(143, 192, 255, 0.3);
  display: flex;
  gap: 8px;
}

.gm-quest-actions .ro-action-btn {
  flex: 1;
  padding: 9px 10px;
  font-size: 15px;
  text-align: center;
}

.gm-quest-tabs .ro-tab-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 0 14px;
}

.gm-sk-item {
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  text-align: left;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid transparent;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.gm-sk-item.selected {
  border-color: #ffd32a;
  background: rgba(75, 139, 255, 0.35);
}

.gm-sk-name {
  font-size: 16px;
  font-weight: 800;
}

.gm-sk-sub {
  font-size: 13px;
  color: #bde0ff;
}

.gm-sk-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 14px;
  flex-shrink: 0;
}

.gm-sk-footer .ro-action-btn {
  padding: 6px 10px;
  font-size: 13.5px;
}

.gm-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 15px;
}

/* ==================== NPC WINDOW (Ornate RO Bronze/Bevel Frame + Shop Split Detail View) ==================== */
#npc-window {
  position: relative;
  width: 850px;
  max-width: 95%;
  height: 548px;
  max-height: 92%;
  border-radius: 14px;
  background: linear-gradient(180deg, #8b5c54 0%, #6d4743 52%, #523331 100%);
  border: 4px solid #24130e;
  box-shadow: inset 0 0 0 3px #e3b87e, inset 0 0 0 6px #4a2a1d, 0 12px 30px rgba(0, 0, 0, 0.78);
  padding: 20px 22px;
  color: #fff;
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 12px;
}

#npc-window.shop-mode {
  grid-template-columns: 1fr;
}

#npc-window.shop-mode #npc-right,
#npc-window.shop-mode #btn-npc-quest {
  display: none;
}

.npc-shop-split {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 12px;
}

.npc-shop-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding-right: 4px;
  min-height: 0;
}

.npc-shop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(24, 12, 12, 0.56);
  border: 2px solid #8d6152;
  color: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.1s ease, background 0.1s ease;
}

.npc-shop-row:hover {
  background: rgba(54, 28, 24, 0.72);
  border-color: #d49b6a;
}

.npc-shop-row.selected {
  background: rgba(112, 58, 22, 0.78);
  border-color: #ffd32a;
  box-shadow: 0 0 0 1.5px #ffd32a;
}

.npc-shop-row-l {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.npc-shop-row-name {
  font-size: 16px;
  font-weight: 800;
  color: #fff8ea;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.npc-shop-row-price {
  font-size: 15px;
  font-weight: 800;
  color: #fffa65;
  white-space: nowrap;
  flex-shrink: 0;
}

.npc-shop-detail-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.npc-shop-detail-card {
  flex: 1;
  min-height: 0;
  border-radius: 10px;
  border: 2px solid #d49b6a;
  background: rgba(26, 13, 13, 0.78);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.npc-shop-d-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(235, 185, 130, 0.45);
}

.npc-shop-d-title {
  font-size: 19px;
  font-weight: 800;
  color: #fffa65;
}

.npc-shop-d-sub {
  font-size: 14px;
  font-weight: 700;
  color: #9ee7ff;
  margin-top: 2px;
}

.npc-shop-d-desc {
  font-size: 15.5px;
  line-height: 1.45;
  color: #fff4df;
  white-space: pre-wrap;
}

.npc-shop-d-stats {
  font-size: 14px;
  font-weight: 700;
  color: #7bed9f;
}

.npc-shop-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 2px solid #d49b6a;
  background: rgba(24, 12, 12, 0.84);
}

.npc-shop-wallet {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
  font-weight: 700;
  color: #ffeaa7;
}

.npc-shop-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.npc-shop-actions .ro-action-btn {
  padding: 7px 11px;
  font-size: 14px;
  white-space: nowrap;
}

/* ==================== RO SUBMODAL (Daily Spin / Rankings / Channels / Message Board / LFP / Options) ==================== */
#ro-submodal {
  z-index: 75;
}

#bigmap-modal {
  z-index: 65;
}

#bigmap-box {
  width: 876px;
  max-width: 97%;
  height: 566px;
  max-height: 95%;
  border-radius: 12px;
  background: url('assets/pak/gp_menu_system.png?v=71') center / 100% 100% no-repeat;
  border: 4px solid #161d29;
  box-shadow: inset 0 0 0 3px #eef3fb, inset 0 0 0 6px #6b7b94, 0 14px 36px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#bigmap-head {
  height: 52px;
  padding: 0 14px 0 18px;
  background: linear-gradient(180deg, #5ca5ff 0%, #2468db 52%, #1346a8 100%);
  border-bottom: 3px solid #161d29;
  box-shadow: inset 0 2px 0 #d9e8ff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

#bigmap-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  text-shadow: 1.5px 1.5px 0 #081a3d;
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#btn-bigmap-close {
  width: 44px;
  height: 42px;
  border: none;
  background: none;
  cursor: pointer;
}

#btn-bigmap-close img {
  width: 42px;
  height: 40px;
}

#bigmap-body {
  flex: 1;
  min-height: 0;
  padding: 12px;
  display: flex;
  gap: 12px;
}

#bigmap-canvas-wrap {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

#bigmap-canvas {
  max-width: 100%;
  max-height: calc(100% - 26px);
  cursor: crosshair;
  border: 2px solid #e7b54a;
  border-radius: 6px;
  background: #0a1220;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

#bigmap-hint {
  font-size: 13px;
  font-weight: 700;
  color: #ffeaa7;
  text-shadow: 1px 1px 0 #000;
}

#bigmap-side {
  width: 318px;
  flex-shrink: 0;
  min-height: 0;
  background: rgba(10, 22, 48, 0.88);
  border: 2px solid #6b9ce8;
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bigmap-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(15, 36, 78, 0.82);
  border: 1px solid rgba(112, 161, 255, 0.35);
  flex-shrink: 0;
}

.bigmap-filter-chk {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 800;
  color: #e2e8f0;
  cursor: pointer;
  user-select: none;
}

.bigmap-filter-chk input {
  accent-color: #ffd32a;
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.bigmap-mob-card {
  padding: 6px 7px;
  border-radius: 7px;
  border: 1.5px solid rgba(112, 161, 255, 0.35);
  background: rgba(16, 36, 74, 0.88);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.bigmap-mob-card.boss {
  border-color: rgba(255, 107, 129, 0.65);
  background: linear-gradient(180deg, rgba(64, 20, 44, 0.82), rgba(24, 18, 52, 0.9));
}

.bigmap-mob-head {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  color: #fff;
  width: 100%;
}

.bigmap-mob-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(6, 14, 30, 0.85);
  flex-shrink: 0;
  image-rendering: pixelated;
}

.bigmap-mob-meta {
  flex: 1;
  min-width: 0;
}

.bigmap-mob-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bigmap-mob-sub {
  font-size: 11px;
  color: #93c5fd;
  display: flex;
  gap: 6px;
  align-items: center;
}

.bigmap-drop-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.bigmap-drop-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 5px;
  border-radius: 5px;
  border: 1px solid rgba(125, 211, 252, 0.35);
  background: rgba(8, 20, 46, 0.9);
  color: #e2e8f0;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

.bigmap-drop-chip:hover {
  border-color: #ffd32a;
  background: rgba(34, 70, 138, 0.95);
}

.bigmap-drop-chip.card {
  border-color: rgba(255, 211, 42, 0.6);
  color: #ffeaa7;
}

.ro-item-art-showcase {
  flex-direction: column;
}

.ro-item-drop-src {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 11.5px;
  align-items: center;
}

.ro-drop-mob-pill {
  background: rgba(25, 58, 112, 0.82);
  border: 1px solid rgba(125, 211, 252, 0.35);
  border-radius: 5px;
  padding: 1px 6px;
  color: #dbeafe;
  font-size: 11px;
}

.boss-member-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0;
}

.boss-member-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(8, 20, 46, 0.65);
  color: #dbeafe;
}

.boss-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid #f59e0b;
  color: #fde68a;
  font-size: 11px;
  font-weight: 800;
}

.boss-wait-banner {
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(234, 179, 8, 0.16);
  border: 1px solid #eab308;
  color: #fef08a;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.bigmap-side-title {
  font-size: 14px;
  font-weight: 800;
  color: #ffd32a;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(112, 161, 255, 0.3);
}

#bigmap-npc-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.bigmap-npc-btn {
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(112, 161, 255, 0.35);
  background: rgba(24, 48, 92, 0.78);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.bigmap-npc-btn:hover {
  background: #2f5aa8;
  border-color: #ffd32a;
}

#ro-submodal-box {
  width: 820px;
  max-width: 95%;
  max-height: 92%;
  border-radius: 12px;
  background: url('assets/pak/gp_menu_system.png?v=71') center / 100% 100% no-repeat;
  border: 4px solid #161d29;
  box-shadow: inset 0 0 0 3px #eef3fb, inset 0 0 0 6px #6b7b94, 0 14px 36px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #fff;
}

#ro-submodal-head {
  height: 56px;
  padding: 0 14px 0 18px;
  background: linear-gradient(180deg, #5ca5ff 0%, #2468db 52%, #1346a8 100%);
  border-bottom: 3px solid #161d29;
  box-shadow: inset 0 2px 0 #d9e8ff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#ro-submodal-title {
  font-size: 21px;
  font-weight: 800;
  color: #fff;
  text-shadow: 1.5px 1.5px 0 #081a3d;
}

#btn-submodal-close {
  width: 44px;
  height: 42px;
  border: none;
  background: none;
  cursor: pointer;
}

#btn-submodal-close img {
  width: 42px;
  height: 40px;
}

#ro-submodal-body {
  padding: 12px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 360px;
  max-height: 540px;
}

/* Daily Spin Roulette */
.spin-banner {
  width: 100%;
  max-width: 520px;
  height: 52px;
  object-fit: contain;
  margin: 0 auto;
  display: block;
}

.spin-stage {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 16px;
  align-items: center;
}

.spin-wheel-wrap {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto;
}

.spin-wheel {
  position: relative;
  width: 280px;
  height: 280px;
  background: url('assets/pak/imgroulette08.png?v=71') center / 100% 100% no-repeat;
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
  transition: transform 2.8s cubic-bezier(0.12, 0.85, 0.18, 1);
}

.spin-slice-item {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.82);
  border: 2px solid #6b4100;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
}

.spin-pointer {
  position: absolute;
  left: 50%;
  top: -12px;
  transform: translateX(-50%);
  width: 44px;
  height: 50px;
  z-index: 4;
  pointer-events: none;
}

.spin-info-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spin-info-col .ro-sys-big-btn {
  height: 50px;
  font-size: 20px;
}

.spin-prize-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.spin-prize-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(11, 28, 62, 0.84);
  border: 1.5px solid #699ee8;
  font-size: 13px;
  font-weight: 700;
}

.spin-prize-chip.won {
  border-color: #fffa65;
  background: rgba(45, 110, 210, 0.85);
}

#spin-won-banner {
  padding: 9px 14px;
  border-radius: 9px;
  border: 2px solid #ffd32a;
  background: rgba(11, 28, 68, 0.92);
  color: #fffa65;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.48);
}

.ro-tab-row {
  display: flex;
  gap: 8px;
}

.ro-tab-btn {
  flex: 1;
  height: 38px;
  border-radius: 8px;
  border: 2px solid #7fb3ff;
  background: rgba(11, 28, 62, 0.84);
  color: #dbeaff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.ro-tab-btn.active {
  background: linear-gradient(180deg, #4b94ff, #1f5fd6);
  border-color: #ffd32a;
  color: #fff;
}

.ro-input-dark {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 2px solid #699ee8;
  background: rgba(8, 18, 42, 0.9);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  user-select: text;
  -webkit-user-select: text;
}

#btn-npc-x {
  position: absolute;
  right: -16px;
  top: -18px;
  width: 64px;
  height: 62px;
  border: none;
  background: none;
  cursor: pointer;
  z-index: 6;
}

#btn-npc-x img {
  width: 64px;
  height: 62px;
}

#npc-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  z-index: 2;
}

#npc-name {
  font-size: 26px;
  font-weight: 800;
  color: #ffd32a;
  text-shadow: 2px 2px 0 #000;
}

#npc-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.npc-msg {
  font-size: 21px;
  line-height: 1.42;
  white-space: pre-wrap;
  color: #fff8ea;
  text-shadow: 1.5px 1.5px 0 #000;
  background: rgba(34, 18, 18, 0.42);
  border-radius: 10px;
  padding: 12px 14px;
}

.npc-menu-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.npc-menu-btn {
  min-height: 48px;
  height: 48px;
  border: none;
  padding: 0 16px;
  text-align: center;
  background: url('assets/pak/npc_button_nonselect.png?v=71') center / 100% 100% no-repeat;
  color: #1f0e00;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.npc-menu-btn:hover {
  background-image: url('assets/pak/npc_button_select.png?v=71');
  color: #fff;
  text-shadow: 1px 1px 0 #000;
}

.npc-shop-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  flex: 1;
}

#npc-right {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  overflow: hidden;
  pointer-events: none;
}

#npc-ill {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: right bottom;
}

#btn-npc-quest {
  position: absolute;
  right: 14px;
  bottom: 12px;
  width: 124px;
  height: 112px;
  border: none;
  background: none;
  cursor: pointer;
  z-index: 6;
  animation: questBookPulse 1.35s ease-in-out infinite;
}

#btn-npc-quest img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#btn-npc-quest:hover {
  animation-play-state: paused;
  transform: scale(1.18);
  filter: drop-shadow(0 0 18px rgba(255, 235, 110, 1));
}

#btn-npc-quest:active {
  transform: scale(0.95);
}

@keyframes questBookPulse {

  0%,
  100% {
    transform: scale(0.96) translateY(0px);
    filter: drop-shadow(0 0 8px rgba(255, 210, 60, 0.72));
  }

  50% {
    transform: scale(1.15) translateY(-6px);
    filter: drop-shadow(0 0 20px rgba(255, 240, 120, 1));
  }
}

/* Skills sub-tabs (SKILL / ACTION / EMOTICON) */
.gm-sk-shell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 0;
}

.gm-sk-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  flex-shrink: 0;
}

.gm-sk-tab {
  height: 40px;
  border-radius: 10px;
  border: 2px solid #7fb3ff;
  background: linear-gradient(180deg, #1b4ea8, #0f3273);
  color: #dbeaff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.4px;
  cursor: pointer;
  text-shadow: 1px 1px 0 #000;
}

.gm-sk-tab.active {
  background: linear-gradient(180deg, #4b94ff, #1f5fd6);
  border-color: #ffd32a;
  color: #fff;
  box-shadow: 0 0 8px rgba(255, 211, 42, 0.45);
}

.gm-sk-body {
  flex: 1;
  min-height: 0;
}

.gm-emot-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  align-content: start;
}

.gm-emot-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 8px;
  border: 2px solid #497cd0;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}

.gm-emot-card.selected {
  border-color: #ffd32a;
  background: rgba(75, 139, 255, 0.35);
}

.gm-emot-name {
  font-size: 12px;
  font-weight: 700;
  color: #dbeaff;
  text-align: center;
}

.gm-emot-badge {
  width: 44px;
  height: 36px;
  border-radius: 8px;
  border: 1.5px solid #6b4e35;
  background: #fffdf5;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
}

.gm-emot-sprite {
  background-image: url('assets/pak/img_emoticon.png?v=71');
  background-repeat: no-repeat;
  image-rendering: pixelated;
}

.gm-action-icon {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  border: 1.5px solid #6ba4ff;
  background-image: url('assets/pak/icon_action.png?v=71');
  background-repeat: no-repeat;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.emot-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  background: #fffdf5 !important;
}

/* ==================== OPEN BOOK MODAL (questmenu01.png: Help & NPC Quest Book) ==================== */
#book-window {
  position: relative;
  width: 840px;
  max-width: 95%;
  height: 560px;
  max-height: 92%;
  background: url('assets/pak/questmenu01.png?v=71') center / 100% 100% no-repeat;
  padding: 34px 48px 54px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  color: #2b1808;
}

#btn-book-x {
  position: absolute;
  right: 46px;
  top: 26px;
  width: 48px;
  height: 48px;
  border: none;
  background: none;
  cursor: pointer;
  z-index: 5;
}

#btn-book-x img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#book-left,
#book-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 18px 8px 6px;
}

#book-left-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 6px;
  background: rgba(252, 236, 192, 0.94);
  box-shadow: inset 0 0 8px rgba(130, 82, 32, 0.16);
}

.book-item-btn {
  width: 100%;
  min-height: 46px;
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  border-bottom: 1px dashed rgba(95, 55, 22, 0.4);
  color: #241305;
  font-size: 17px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

.book-item-btn.active {
  background: linear-gradient(90deg, rgba(102, 72, 46, 0.85), rgba(102, 72, 46, 0.96) 20%, rgba(102, 72, 46, 0.96) 80%, rgba(102, 72, 46, 0.85));
  color: #fff;
  text-shadow: 1px 1px 0 #000;
}

#book-right-title {
  font-size: 21px;
  font-weight: 800;
  color: #5c3a21;
  margin-bottom: 8px;
  padding-right: 46px;
}

#book-right-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  font-size: 17px;
  line-height: 1.46;
  color: #3a2310;
  white-space: pre-wrap;
  padding: 4px 6px 8px 0;
}

#book-right-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px dashed rgba(95, 55, 22, 0.3);
}

/* Cash Shop ornate gold/crimson bevel */
#cash-window {
  position: relative;
  width: 860px;
  max-width: 95%;
  height: 556px;
  max-height: 92%;
  padding: 14px 16px 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffda58 0%, #f5a618 14%, #ffeaa7 14.5%, #ffd266 100%);
  border: 4px solid #2b1800;
  box-shadow: inset 0 0 0 3px #fff1a8, inset 0 0 0 5px #9b6008, 0 12px 32px rgba(0, 0, 0, 0.76);
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: #2b1800;
}

#btn-cash-close {
  position: absolute;
  right: -14px;
  top: -16px;
  width: 60px;
  height: 58px;
  border: none;
  background: none;
  cursor: pointer;
  z-index: 6;
}

#btn-cash-close img {
  width: 100%;
  height: 100%;
}

#cash-tabs {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 0 54px 0 8px;
  height: 66px;
}

#cash-tabs button {
  flex: 1;
  height: 62px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

#cash-tabs button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#cash-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 14px;
  background: #fdf0b3;
  border: 3px solid #6b4100;
  border-radius: 10px;
  padding: 10px;
}

#cash-left-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

#cash-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.cash-row {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  border: 2.5px solid #965b0a;
  background: linear-gradient(180deg, #fff5c0, #ffd866);
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
}

.cash-row.selected {
  border-color: #d61c00;
  box-shadow: 0 0 0 2px #ffdf40;
}

.cash-row-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: linear-gradient(90deg, #fff7cc, #ffe58f);
}

.cash-icon-box {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: rgba(90, 50, 0, 0.14);
  border: 1.5px solid #b57b1b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cash-qty {
  position: absolute;
  right: 2px;
  bottom: 0;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  text-shadow: 1.5px 1.5px 0 #000, -1px -1px 0 #000;
}

.cash-item-name {
  font-size: 17px;
  font-weight: 800;
  color: #1f1200;
}

.cash-row-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 12px;
  background: linear-gradient(180deg, #f39c12, #d37000);
  color: #1f1200;
  font-size: 16px;
  font-weight: 800;
}

.cash-row-price img {
  width: 14px;
  height: 18px;
}

#btn-buy-rubies {
  width: 100%;
  height: 48px;
  border: 2px solid #f7ca48;
  border-radius: 8px;
  background: linear-gradient(180deg, #9a1a0e, #540903);
  padding: 3px 6px;
  cursor: pointer;
  flex-shrink: 0;
}

#btn-buy-rubies img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#cash-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

#cash-detail-card {
  flex: 1;
  min-height: 0;
  border-radius: 8px;
  border: 2.5px solid #784804;
  background: #fff4bc;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

#cash-detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 800;
  color: #2b1800;
}

#cash-desc {
  font-size: 17px;
  line-height: 1.45;
  white-space: pre-line;
  color: #3d2200;
  background: rgba(255, 244, 188, 0.72);
  border-radius: 6px;
  padding: 6px;
}

#cash-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cash-stat-bar {
  height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  border: 2px solid #784804;
  background: linear-gradient(180deg, #f39c12, #d37000);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 20px;
  font-weight: 800;
  color: #1f1200;
}

.cash-stat-bar img {
  width: 20px;
  height: 26px;
}

.cash-bottom-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  height: 46px;
}

.cash-inv-pill {
  border-radius: 8px;
  border: 2px solid #784804;
  background: linear-gradient(180deg, #f7b731, #e18b07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 18px;
  font-weight: 800;
}

.cash-inv-pill img {
  width: 28px;
  height: 28px;
}

#btn-cash-buy {
  border-radius: 8px;
  border: 2.5px solid #401a00;
  background: linear-gradient(180deg, #ff793f, #e55039);
  color: #fff;
  text-shadow: 1px 1px 0 #000;
  font-size: 21px;
  font-weight: 800;
  cursor: pointer;
}

#btn-cash-buy:disabled {
  opacity: 0.45;
  cursor: default;
}

/* Death & Loading */
#dead-box {
  width: 428px;
  height: 392px;
  background: url('assets/pak/deadpopup_bg.png?v=71') center / 100% 100% no-repeat;
  border: 6px solid #1e3f6e;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 28px 20px;
}

.dead-title {
  font-size: 26px;
  font-weight: 800;
  color: #ff4757;
  text-shadow: 2px 2px 0 #000;
}

#loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#loading-anim {
  width: 82px;
  height: 78px;
  image-rendering: pixelated;
}

#loading-txt {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
}

#toast {
  position: absolute;
  left: 50%;
  bottom: 126px;
  transform: translateX(-50%);
  padding: 10px 24px;
  border-radius: 14px;
  background: rgba(8, 12, 22, 0.9);
  border: 2px solid #ffd32a;
  color: #ffeaa7;
  font-size: 20px;
  font-weight: 700;
  z-index: 60;
  pointer-events: none;
}

.icon-24 {
  width: 44px;
  height: 44px;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.icon-skill-30 {
  width: 52px;
  height: 52px;
  background-image: url('assets/pak/icon_skill.png?v=71');
  background-size: 208px 1040px;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  flex-shrink: 0;
}

/* ==================== SHOP BUY CALC & SELL STAGING CART ==================== */
.npc-buy-calc {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed rgba(235, 185, 130, 0.45);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.npc-qty-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.npc-qty-lbl {
  font-size: 14px;
  font-weight: 800;
  color: #ffeaa7;
  margin-right: 2px;
}

.npc-qty-btn {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1.5px solid #d49b6a;
  background: rgba(65, 34, 24, 0.9);
  color: #fff6df;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.npc-qty-btn:hover {
  background: rgba(120, 62, 34, 0.95);
  border-color: #ffd32a;
}

.npc-qty-input {
  width: 52px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1.5px solid #ffd32a;
  background: rgba(12, 8, 8, 0.9);
  color: #fffa65;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}

.npc-calc-summary {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(14, 8, 8, 0.72);
  border: 1px solid rgba(212, 155, 106, 0.5);
}

.npc-calc-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  color: #f5e6d3;
}

.npc-calc-line b.gold {
  color: #fffa65;
}

.npc-calc-line.ok b {
  color: #7bed9f;
}

.npc-calc-line.err {
  color: #ff9f9f;
}

.npc-calc-line.err b {
  color: #ff6b6b;
}

.npc-shop-row.in-cart {
  background: rgba(34, 78, 52, 0.65);
  border-color: #7bed9f;
}

.npc-cart-badge {
  padding: 1px 6px;
  border-radius: 999px;
  background: #2ecc71;
  color: #0b1b10;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.npc-sell-cart-card {
  gap: 6px;
}

.npc-cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 16px;
  font-weight: 800;
  color: #fffa65;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(235, 185, 130, 0.45);
}

.npc-cart-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.npc-cart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(44, 24, 20, 0.8);
  border: 1px solid rgba(212, 155, 106, 0.45);
}

.npc-cart-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff6df;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.npc-cart-r {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.npc-cart-rm {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid #ff7675;
  background: rgba(140, 28, 28, 0.85);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.npc-cart-rm:hover {
  background: #d63031;
}

.ro-action-btn.confirm-sell {
  background: linear-gradient(180deg, #27ae60, #1e8449);
  border-color: #7bed9f;
}

/* ==================== EQUIP STATS HEADER & ITEM DETAIL POPUP ==================== */
.gm-eq-stats-hdr {
  font-size: 12.5px;
  font-weight: 800;
  color: #ffd32a;
  text-align: center;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(120, 175, 255, 0.35);
  margin-bottom: 2px;
}

.gm-slot-dark.selected {
  border-color: #ffd32a;
  box-shadow: 0 0 0 1.5px #ffd32a;
  background: rgba(45, 95, 185, 0.65);
}

.gm-eq-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 24, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
  border-radius: 10px;
}

.gm-eq-popup-card {
  width: 430px;
  max-width: 94%;
  max-height: 94%;
  overflow-y: auto;
  border-radius: 12px;
  border: 2.5px solid #ffd32a;
  background: linear-gradient(180deg, #10254a, #0a1732);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.75);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #eef6ff;
}

.gm-eq-popup-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(145, 190, 255, 0.45);
}

.gm-eq-popup-title {
  font-size: 18px;
  font-weight: 800;
  color: #fffa65;
  line-height: 1.2;
}

.gm-eq-popup-badge {
  display: inline-block;
  margin-top: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
}

.gm-eq-popup-badge.equipped {
  background: #2ecc71;
  color: #082012;
}

.gm-eq-popup-badge.bag {
  background: #54a0ff;
  color: #071933;
}

.gm-eq-popup-x {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1.5px solid #82b4ff;
  background: rgba(16, 36, 74, 0.9);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}

.gm-eq-popup-sec-lbl {
  font-size: 12.5px;
  font-weight: 800;
  color: #9fc5ff;
}

.gm-eq-popup-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gm-eq-stat-pill {
  padding: 3px 9px;
  border-radius: 7px;
  background: rgba(20, 46, 94, 0.9);
  border: 1px solid #4877c4;
  font-size: 13.5px;
  font-weight: 800;
  color: #7bed9f;
}

.gm-eq-stat-pill.gold {
  color: #fffa65;
  border-color: #ffd32a;
}

.gm-eq-stat-pill.warn {
  color: #ff7979;
  border-color: #ff6b6b;
}

.gm-eq-popup-cards {
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(14, 30, 62, 0.85);
  border: 1px solid rgba(130, 180, 255, 0.35);
  font-size: 13px;
  color: #dff0ff;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.gm-eq-popup-cmp {
  font-size: 13px;
  font-weight: 700;
  color: #ffd32a;
  background: rgba(45, 36, 12, 0.55);
  border: 1px solid rgba(255, 211, 42, 0.4);
  border-radius: 7px;
  padding: 5px 9px;
}

.gm-eq-popup-desc {
  font-size: 14.5px;
  line-height: 1.45;
  color: #eaf3ff;
  white-space: pre-wrap;
  background: rgba(6, 15, 36, 0.65);
  border-radius: 8px;
  padding: 8px 10px;
}

.gm-eq-popup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}

.gm-card-dot {
  position: absolute;
  top: 2px;
  right: 3px;
  padding: 0 4px;
  border-radius: 5px;
  background: rgba(9, 25, 58, 0.9);
  border: 1px solid #54a0ff;
  color: #7bed9f;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
  pointer-events: none;
}

.gm-slot-dark .gm-eq-ref {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 11px;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}

.gm-eq-cards-hdr {
  font-size: 12px;
  font-weight: 800;
  color: #9fc5ff;
  margin-bottom: 2px;
}

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

.gm-card-stat-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(16, 62, 46, 0.85);
  border: 1px solid #2ecc71;
  color: #7bed9f;
  font-size: 12px;
  font-weight: 800;
}

.gm-card-empty {
  color: #829ec7;
  font-size: 12.5px;
}

.smith-opts-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: rgba(8, 22, 52, 0.85);
  border: 1px solid #4877c4;
}

.smith-opt-chk {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #e6f2ff;
  cursor: pointer;
}

.smith-row {
  align-items: center;
  gap: 10px;
}

.smith-title-line {
  font-size: 14px;
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.smith-req-line {
  font-size: 12.5px;
  color: #b8d4ff;
  margin-top: 2px;
}

.smith-tier-badge {
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
  background: #36599c;
  color: #e6f2ff;
}

.smith-tier-badge.s {
  background: #6c35de;
  color: #fff;
}

.smith-tier-badge.s2 {
  background: linear-gradient(90deg, #b71540, #e58e26);
  color: #fff;
}

.smith-have,
.smith-step {
  font-size: 12px;
  color: #ffd32a;
}

.ok {
  color: #7bed9f;
  font-weight: 700;
}

.short {
  color: #ff7979;
  font-weight: 700;
}

.card-pick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.card-pick-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 8px;
  border: 1.5px solid #4877c4;
  background: rgba(8, 22, 52, 0.88);
  color: #e6f2ff;
  font-size: 12.5px;
  cursor: pointer;
}

.card-pick-chip.selected {
  border-color: #ffd32a;
  background: rgba(45, 95, 185, 0.72);
}

/* ==================== HUD: MOUNT, AUTO-ATK, PVP TIMER & QUEST READY DOCK ==================== */
#duel-timer-pill {
  position: absolute;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 28;
  padding: 4px 14px;
  border-radius: 999px;
  border: 2px solid #ff6b6b;
  background: rgba(36, 10, 18, 0.92);
  color: #ffe066;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-shadow: 1px 1px 0 #000;
  box-shadow: 0 3px 12px rgba(255, 71, 87, 0.45);
  pointer-events: none;
}

#quest-ready-dock {
  position: absolute;
  left: 8px;
  bottom: 186px;
  width: 244px;
  max-height: 152px;
  overflow-y: auto;
  z-index: 26;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.q-ready-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1.5px solid #ffd32a;
  background: linear-gradient(180deg, rgba(22, 46, 88, 0.95) 0%, rgba(10, 22, 48, 0.95) 100%);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.55);
  color: #fff;
}

.q-ready-title {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 800;
  color: #fff3bf;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.q-ready-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.q-ready-submit {
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #ffd32a;
  background: linear-gradient(180deg, #ff9f43 0%, #ee5a24 100%);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.7);
}

.q-ready-warp {
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid #70a1ff;
  background: rgba(30, 64, 128, 0.92);
  color: #fff;
  font-size: 11.5px;
  cursor: pointer;
}

#btn-ride {
  position: absolute;
  right: 278px;
  bottom: 98px;
  width: 68px;
  height: 68px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: none;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.7));
  transition: transform 0.1s ease, filter 0.15s ease;
}

#btn-ride img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

#btn-ride.mounted {
  filter: drop-shadow(0 0 12px rgba(46, 213, 115, 0.9));
}

#btn-ride.no-mount,
#btn-ride.hidden {
  display: none !important;
}

#btn-ride:active {
  transform: scale(0.93);
}

#btn-atk.auto-on {
  filter: drop-shadow(0 0 12px rgba(255, 211, 42, 0.92));
}

.cart-weight-bar {
  width: 100%;
  height: 8px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.cart-weight-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #eab308, #f97316);
  transition: width 0.2s ease;
}

/* ==================== EQUIP CARD PIPS, DETAIL, SOCKETS & ELEMENT MODAL ==================== */
.gm-eq-pips {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1px;
  pointer-events: none;
}

.gm-pip {
  font-size: 10px;
  line-height: 1;
  color: #8ea9cf;
  text-shadow: 0 1px 2px #000;
}

.gm-pip.filled {
  color: #ffd32a;
}

.gm-eq-2h-tag {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 10px;
  font-weight: 800;
  color: #93c5fd;
  text-shadow: 1px 1px 0 #000;
}

.gm-eq-2h-sub {
  font-size: 11px;
  color: #93c5fd;
  opacity: 0.72;
  margin-top: 10px;
}

.gm-eq-strip-pager {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gm-eq-strip-pager .gm-eq-strip-new {
  flex: 1;
}

.gm-strip-nav {
  width: 30px;
  height: 44px;
  border-radius: 7px;
  border: 1.5px solid #598be0;
  background: linear-gradient(180deg, #2b5cb8, #14326d);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}

.gm-strip-nav:disabled {
  opacity: 0.4;
  cursor: default;
}

.gm-strip-next-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.gm-strip-count {
  font-size: 10.5px;
  font-weight: 800;
  color: #ffe082;
}

.gm-eq-detail-panel {
  flex: 0 0 124px;
  height: 124px;
  min-height: 124px;
  max-height: 124px;
  padding: 7px 12px 8px;
  margin-bottom: 0;
  overflow: hidden;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  box-sizing: border-box;
}

.gm-eq-det-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex: 1 1 0;
  min-height: 0;
}

.gm-eq-det-info {
  flex: 1;
  min-width: 0;
  max-height: 100%;
  overflow-y: auto;
  padding-right: 4px;
}

.gm-eq-det-title {
  font-size: 15px;
  font-weight: 800;
  color: #ffd32a;
}

.gm-eq-det-meta {
  font-size: 13px;
  color: #e6f2ff;
}

.gm-eq-det-bonus {
  font-size: 13px;
  font-weight: 700;
  color: #ffdd87;
  margin-top: 2px;
}

.gm-eq-det-cards {
  font-size: 12.5px;
  font-weight: 700;
  color: #7bed9f;
  margin-top: 2px;
}

.gm-eq-det-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.gm-eq-sockets-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.gm-socket-btn {
  flex: 1;
  min-width: 112px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 2px solid #5e8de0;
  background: linear-gradient(180deg, rgba(24, 54, 110, 0.94), rgba(14, 34, 72, 0.96));
  color: #dbeafe;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.gm-socket-btn.filled {
  border-color: #ffd32a;
  color: #fff3bf;
  background: linear-gradient(180deg, rgba(42, 86, 168, 0.95), rgba(22, 52, 114, 0.96));
}

.gm-elem-modal {
  width: min(680px, 95%);
  background: linear-gradient(180deg, #163a7a 0%, #0d234d 100%);
  border: 3px solid #9cc5ff;
  border-radius: 12px;
  padding: 14px;
  color: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8);
}

.gm-elem-hdr {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.gm-elem-title {
  font-size: 17px;
  font-weight: 800;
  color: #ffd32a;
}

.gm-elem-sub {
  font-size: 12px;
  color: #dbeafe;
  margin-top: 2px;
}

.gm-elem-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.gm-elem-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1.5px solid rgba(112, 161, 255, 0.45);
  background: rgba(8, 20, 48, 0.72);
}

.gm-elem-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 800;
}

.gm-elem-ico {
  font-size: 17px;
}

.gm-elem-vals {
  text-align: right;
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.35;
}

.gm-elem-vals .hi {
  color: #7bed9f;
}

.gm-elem-tip {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(7, 16, 38, 0.8);
  border: 1px solid rgba(112, 161, 255, 0.3);
  font-size: 12.5px;
  color: #dbeafe;
}

.gm-elem-foot {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

/* Card Sockets Overview & Full Card Illustration Modal */
.ro-svg-ico {
  display: inline-block;
  vertical-align: -2px;
  flex-shrink: 0;
}

.gm-elem-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(15, 36, 78, 0.9);
  border: 1px solid rgba(156, 197, 255, 0.35);
  font-size: 13px;
  font-weight: 800;
}

.gm-card-sockets-overview {
  width: min(560px, 95%);
}

.gm-card-mini-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 8px;
}

.gm-card-mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1.5px solid #3c62a6;
  background: rgba(10, 24, 56, 0.86);
}

.gm-card-mini-thumb {
  width: 34px;
  height: 44px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #8ab4f8;
  background: #061228;
  flex-shrink: 0;
}

.gm-card-mini-thumb.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  border-style: dashed;
}

.ro-card-illust-backdrop {
  position: absolute;
  inset: 0;
  z-index: 95;
  background: rgba(3, 8, 20, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.ro-card-illust-box {
  width: min(560px, 95%);
  background: linear-gradient(180deg, #1d4ed8 0%, #10327a 14%, #0b2254 100%);
  border: 3px solid #9ec5ff;
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.88), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  padding: 10px 14px 12px;
  color: #fff;
}

.ro-card-illust-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1.5px solid rgba(158, 197, 255, 0.4);
  font-size: 16px;
  font-weight: 800;
}

.ro-card-illust-x {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.ro-card-illust-x img {
  width: 100%;
  height: 100%;
  display: block;
}

.ro-card-illust-body {
  display: flex;
  gap: 14px;
  align-items: stretch;
}

.ro-card-art-frame {
  width: 146px;
  min-height: 196px;
  padding: 6px;
  border-radius: 10px;
  border: 2px solid #7fb3ff;
  background: linear-gradient(180deg, #07142e, #0d2452);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ro-card-art-img {
  width: 100%;
  height: auto;
  max-height: 184px;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

.ro-card-info-card {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid rgba(127, 179, 255, 0.48);
  background: rgba(8, 22, 54, 0.85);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ro-card-illust-name {
  font-size: 17px;
  font-weight: 800;
  color: #ffb86c;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ro-card-rank-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #ffe28a;
}

.ro-card-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #ff6b6b;
}

.ro-card-sep {
  color: rgba(255, 255, 255, 0.35);
}

.ro-card-equip-ref {
  font-size: 12px;
  color: #93c5fd;
}

.ro-card-prop-lbl {
  font-size: 12.5px;
  font-weight: 700;
  color: #7dd3fc;
  margin-top: 2px;
}

.ro-card-prop-val {
  font-size: 14.5px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.ro-card-fee {
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px dashed rgba(140, 190, 255, 0.3);
  font-size: 12.5px;
  color: #cbd5e1;
}

.ro-card-illust-foot {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.ro-card-back-btn {
  min-width: 170px;
  padding: 0 14px;
}

.gm-job-quest {
  border-color: #ffd32a !important;
  background: linear-gradient(180deg, rgba(115, 76, 12, 0.82), rgba(58, 34, 6, 0.88)) !important;
}

/* ==================== WORLD MAP & BOSS PARTY ROOM IN #bigmap-box ==================== */
#bigmap-tabs {
  display: flex;
  flex-shrink: 0;
  gap: 5px;
}

.bigmap-tab-btn {
  padding: 5px 9px;
  border-radius: 7px;
  border: 1.5px solid #9cc5ff;
  background: rgba(12, 32, 76, 0.78);
  color: #dbeafe;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.bigmap-tab-btn.active {
  border-color: #ffd32a;
  background: linear-gradient(180deg, #ffbe3b, #e07a0b);
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.65);
}

#bigmap-world-pane,
#bigmap-boss-pane {
  flex: 1;
  min-height: 0;
  padding: 12px;
  display: flex;
  gap: 12px;
}

#bigmap-sd-pane {
  flex: 1;
  min-height: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

#bigmap-sd-pane .sd-card-grid {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding-right: 4px;
}

.worldmap-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.worldmap-subtabs {
  display: flex;
  gap: 6px;
}

.worldmap-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  border: 2px solid #e7b54a;
  border-radius: 8px;
  background: #081226;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.worldmap-canvas {
  position: relative;
  aspect-ratio: 480 / 320;
  max-width: 100%;
  max-height: 100%;
  flex: 0 0 auto;
}

.worldmap-canvas img {
  width: 100%;
  height: 100%;
  display: block;
}

.worldmap-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #ff6b35;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.85);
  cursor: pointer;
  padding: 0;
}

.worldmap-pin.town {
  background: #2ed573;
  width: 16px;
  height: 16px;
}

.worldmap-pin.dun {
  background: #9b59b6;
}

.worldmap-pin.cur {
  border-color: #ffd32a;
  box-shadow: 0 0 12px #ffd32a;
  transform: translate(-50%, -50%) scale(1.25);
}

.worldmap-pin.sel {
  outline: 3px solid #ffd32a;
}

.boss-cat-list,
.boss-party-side {
  flex: 1;
  min-height: 0;
  background: rgba(10, 22, 48, 0.88);
  border: 2px solid #6b9ce8;
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.boss-list-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.boss-card {
  padding: 7px 9px;
  border-radius: 8px;
  border: 1.5px solid rgba(112, 161, 255, 0.4);
  background: rgba(18, 40, 82, 0.82);
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #fff;
}

.boss-card.sel {
  border-color: #ffd32a;
  background: rgba(34, 68, 134, 0.92);
}

.boss-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 800;
  color: #ffe082;
}

.boss-drops-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.boss-card-acts {
  display: flex;
  gap: 6px;
  margin-top: 2px;
  flex-wrap: wrap;
}

#quest-ready-dock.hidden,
#bigmap-world-pane.hidden,
#bigmap-boss-pane.hidden,
#bigmap-body.hidden,
#duel-timer-pill.hidden,
#reconnect-overlay.hidden,
#version-lock-modal.hidden {
  display: none !important;
}

/* ==================== NETWORK RECONNECT OVERLAY ==================== */
#reconnect-overlay {
  z-index: 95000;
  background: rgba(5, 10, 20, 0.72);
  backdrop-filter: blur(2px);
}

#reconnect-card {
  width: 360px;
  max-width: 90%;
  padding: 22px 24px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(14, 28, 54, 0.98), rgba(8, 16, 32, 0.98));
  border: 2px solid #7ef9ff;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8), 0 0 20px rgba(126, 249, 255, 0.25);
  color: #eef6ff;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.reconn-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3.5px solid rgba(126, 249, 255, 0.25);
  border-top-color: #ffd32a;
  animation: reconnSpin 0.85s linear infinite;
}

@keyframes reconnSpin {
  to {
    transform: rotate(360deg);
  }
}

#reconnect-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff6c2;
}

#reconnect-status-text {
  font-size: 14px;
  color: #bae6fd;
  font-weight: 600;
}

/* ==================== VERSION LOCK / HARD REFRESH MODAL ==================== */
#version-lock-modal {
  z-index: 99999;
  background: rgba(4, 8, 18, 0.86);
  backdrop-filter: blur(4px);
}

#version-lock-box {
  width: 460px;
  max-width: 92%;
  padding: 26px 28px 24px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(18, 34, 66, 0.99), rgba(9, 18, 38, 0.99));
  border: 2.5px solid #ffd32a;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85), 0 0 32px rgba(255, 211, 42, 0.35);
  color: #eef6ff;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.ver-lock-badge {
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(255, 193, 7, 0.2);
  border: 1px solid rgba(255, 211, 42, 0.7);
  color: #ffd32a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
}

#version-lock-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff6c2;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

#version-lock-body {
  font-size: 14.5px;
  line-height: 1.55;
  color: #e2eeff;
}

#version-lock-tag {
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(126, 249, 255, 0.45);
  color: #7ef9ff;
  font-size: 13px;
  font-weight: 800;
}

#btn-hard-refresh {
  margin-top: 6px;
  padding: 12px 26px;
  border-radius: 10px;
  border: 2px solid #ffeaa7;
  background: linear-gradient(180deg, #f6b93b, #e58e26);
  color: #1e1304;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(246, 185, 59, 0.45);
  transition: transform 0.12s ease, filter 0.15s ease;
}

#btn-hard-refresh:hover {
  filter: brightness(1.08);
}

#btn-hard-refresh:active {
  transform: scale(0.96);
}

.gm-req-ok {
  color: #7bed9f;
  font-weight: 700;
}

.gm-req-bad {
  color: #ff6b81;
  font-weight: 800;
}

.gm-eq-stat-pill.ok {
  border-color: rgba(123, 237, 159, 0.55);
  color: #7bed9f;
}

.gm-eq-stat-pill.warn {
  border-color: rgba(255, 107, 129, 0.7);
  background: rgba(255, 71, 87, 0.18);
  color: #ff9aa9;
}

.ro-action-btn.disabled {
  opacity: 0.65;
  border-color: rgba(255, 107, 129, 0.55);
  color: #ffb8c0;
}

#hud-ch {
  cursor: pointer;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid rgba(255, 226, 138, 0.45);
  background: rgba(15, 23, 42, 0.72);
}

#hud-ch:hover {
  background: rgba(30, 58, 138, 0.85);
}

/* ---------------- WIKI & HOME SANCTUARY MODALS ---------------- */
#wiki-box {
  width: min(936px, 95vw);
  height: min(568px, 88vh);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 2.5px solid #d4a648;
  background: linear-gradient(180deg, rgba(16, 28, 52, 0.98), rgba(8, 15, 30, 0.99));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  color: #eef6ff;
}

#home-box {
  width: min(936px, 95vw);
  height: min(584px, 90vh);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 2.5px solid #d4a648;
  background: linear-gradient(180deg, rgba(16, 28, 52, 0.98), rgba(8, 15, 30, 0.99));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  color: #eef6ff;
}

#wiki-head,
#home-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: linear-gradient(90deg, #1b3158, #12213d);
  border-bottom: 1.5px solid rgba(212, 166, 72, 0.55);
  font-size: 16px;
  font-weight: 800;
  color: #ffe28a;
  flex-shrink: 0;
}

#btn-wiki-close,
#btn-home-close {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}

#btn-wiki-close img,
#btn-home-close img {
  width: 28px;
  height: 28px;
}

#wiki-modal-body {
  padding: 10px 12px 12px;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#home-modal-body {
  padding: 10px 12px 12px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.wiki-main-nav {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: rgba(7, 13, 26, 0.82);
  border: 1.5px solid rgba(96, 165, 250, 0.35);
  border-radius: 10px;
  flex-shrink: 0;
  overflow-x: auto;
}

.wiki-main-tab {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: #cbd5e1;
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}

.wiki-main-tab:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #fff;
}

.wiki-main-tab.active {
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  border-color: #ffd32a;
  color: #fff8dc;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.45);
}

.wiki-sub-toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 9px;
  background: rgba(9, 18, 36, 0.88);
  border: 1px solid rgba(148, 197, 255, 0.25);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.wiki-sub-toolbar .ro-input-dark {
  height: 30px;
  padding: 2px 7px;
  font-size: 12px;
  min-width: 0;
}

.wiki-sub-toolbar select.ro-input-dark {
  flex: 0 0 auto;
  width: auto !important;
  max-width: 155px;
}

.wiki-count-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(30, 58, 138, 0.65);
  border: 1px solid rgba(147, 197, 253, 0.35);
  color: #ffe28a;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.wiki-split {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(255px, 34%) 1fr;
  gap: 10px;
  overflow: hidden;
}

.wiki-list-pane,
.wiki-detail-pane,
.wiki-scroll-pane {
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow-y: auto;
  flex: 1;
}

.wiki-detail-head {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 8px;
}

.wiki-src-sec {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 7px;
}

.wiki-src-lbl {
  font-size: 12px;
  font-weight: 800;
  color: #ffd32a;
  margin-bottom: 5px;
}

.wiki-src-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  font-size: 12.5px;
  flex-wrap: wrap;
}

.wiki-link-btn {
  background: none;
  border: none;
  color: #7ef9ff;
  cursor: pointer;
  padding: 0;
  font-size: 12.5px;
  text-align: left;
}

.wiki-build-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12.5px;
  margin: 6px 0;
  color: #dbeafe;
}

.wiki-build-row b {
  color: #93c5fd;
  font-size: 12px;
}

.wiki-guide-text {
  white-space: pre-line;
  font-size: 13px;
  line-height: 1.62;
  color: #e2eeff;
}

/* Home Sanctuary Hub (matching Valhalla Hall layout) */
.home-hub-stage {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 360px;
  aspect-ratio: 900 / 490;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #c69a3f;
  background: #140d07;
}

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

.home-hub-cur {
  position: absolute;
  top: 8px;
  right: 12px;
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}

.home-cur-img {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(12, 18, 32, 0.88);
  border: 1.5px solid #e6b85c;
  color: #ffeaa7;
  font-size: 12.5px;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6);
}

.home-cur-img.ruby {
  border-color: #70d6ff;
  color: #e0f7ff;
}

.home-cur-img.cash-btn {
  cursor: pointer;
  background: none;
  border: none;
  padding: 2px 4px;
  box-shadow: none;
}

.home-cur-img.cash-btn:hover {
  transform: scale(1.06);
}

.home-hub-left {
  position: absolute;
  left: 12px;
  top: 46px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.home-hub-right {
  position: absolute;
  right: 12px;
  top: 48px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
}

.home-ico-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 7px;
  border: none;
  background: rgba(10, 16, 28, 0.42);
  border-radius: 10px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  text-shadow: -1.5px -1.5px 0 #000, 1.5px -1.5px 0 #000, -1.5px 1.5px 0 #000, 1.5px 1.5px 0 #000;
  transition: transform 0.12s ease, background 0.12s ease;
}

.home-ico-btn:hover {
  transform: scale(1.07);
  background: rgba(25, 42, 74, 0.72);
}

.home-ico-btn img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.85));
}

.home-corner-btn {
  position: absolute;
  bottom: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 4px 8px;
  border: none;
  background: none;
  color: #fff8dc;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  text-shadow: -1.5px -1.5px 0 #000, 1.5px -1.5px 0 #000, -1.5px 1.5px 0 #000, 1.5px 1.5px 0 #000;
  transition: transform 0.12s ease;
}

.home-corner-btn:hover {
  transform: scale(1.06);
}

.home-corner-btn.left {
  left: 10px;
}

.home-corner-btn.right {
  right: 10px;
}

.home-corner-btn img {
  width: 68px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.88));
}

.home-bottom-dock {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 8px;
  display: flex;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 14px;
  background: rgba(15, 22, 36, 0.72);
  border: 1.5px solid rgba(255, 232, 165, 0.55);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.home-bottom-dock button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 3px 6px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  transition: transform 0.12s ease, background 0.12s ease;
}

.home-bottom-dock button:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
}

.home-bottom-dock button img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.8));
}

/* Authentic Jackpot Stage */
.jp-layout {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.jp-machine-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: radial-gradient(circle at 50% 35%, #2b1d4a 0%, #140f29 75%, #0c0918 100%);
  border: 2px solid #eab308;
  border-radius: 12px;
  padding: 10px;
  position: relative;
  overflow: hidden;
}

.jp-banner {
  width: 240px;
  max-width: 100%;
  height: auto;
}

.jp-wheel-box {
  position: relative;
  width: 204px;
  height: 204px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.jp-wheel-rays {
  position: absolute;
  inset: -16px;
  width: calc(100% + 32px);
  height: calc(100% + 32px);
  opacity: 0.32;
  pointer-events: none;
  animation: jpSpinSlow 14s linear infinite;
}

.jp-wheel-img {
  width: 184px;
  height: 184px;
  object-fit: contain;
  transition: transform 1.25s cubic-bezier(0.15, 0.85, 0.25, 1);
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.85));
}

.jp-wheel-ptr {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 34px;
  z-index: 3;
  filter: drop-shadow(0 2px 4px #000);
}

.jp-poring-hub {
  position: absolute;
  width: 58px;
  height: 58px;
  object-fit: contain;
  z-index: 2;
  pointer-events: none;
}

@keyframes jpSpinSlow {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.jp-spin-imgbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 2px solid #ffd32a;
  background: linear-gradient(180deg, #ff7b00, #c83e00);
  color: #fff;
  font-size: 13.5px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 120, 0, 0.45);
}

.jp-spin-imgbtn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.jp-prize-catalog {
  overflow-y: auto;
  max-height: 410px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 6px;
}

.jp-prize-tile {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(148, 197, 255, 0.22);
  background: rgba(12, 22, 44, 0.84);
  color: #eef6ff;
  text-align: left;
  cursor: pointer;
}

.jp-prize-tile.won {
  border-color: #ffd32a;
  background: rgba(120, 74, 10, 0.55);
  box-shadow: 0 0 12px rgba(255, 211, 42, 0.4);
}

.jp-won-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1.5px solid #ffd32a;
  background: rgba(34, 22, 6, 0.9);
}

/* Authentic Fishing Pond Stage */
.fish-pond-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #d4a648;
  background: #0a1f36;
}

#fish-pond-canvas {
  width: 100%;
  height: 228px;
  display: block;
}

.fish-gauge-overlay {
  position: relative;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(16, 24, 38, 0.96), rgba(9, 14, 24, 0.98));
  border-top: 1.5px solid rgba(212, 166, 72, 0.55);
}

.fish-result-overlay {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  width: 280px;
  min-height: 112px;
  padding: 12px 16px;
  background: url('assets/pak/imgfishingresult02.png?v=71') center / 100% 100% no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #3a1f07;
  font-weight: 900;
  text-align: center;
  z-index: 6;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.8));
}

.fish-auto-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 9px;
  border: 1.5px solid #60a5fa;
  background: rgba(15, 32, 66, 0.92);
  color: #e0f2fe;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}

.fish-auto-btn.on {
  border-color: #7bed9f;
  background: rgba(18, 86, 48, 0.92);
  color: #eafff2;
}

.sd-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 8px;
  max-height: 430px;
  overflow-y: auto;
}

.sd-boss-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 9px;
  border: 1.5px solid rgba(212, 166, 72, 0.5);
  background: rgba(12, 22, 44, 0.82);
}

.sd-boss-card.cleared {
  border-color: #7bed9f;
}

.sd-boss-art {
  position: relative;
  height: 82px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sd-boss-art img {
  max-height: 82px;
  object-fit: contain;
}

.sd-clear-tag {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 2px 6px;
  border-radius: 5px;
  background: #2ecc71;
  color: #06210f;
  font-size: 10px;
  font-weight: 900;
}

.sd-drops {
  display: flex;
  gap: 4px;
  margin-top: 5px;
  flex-wrap: wrap;
}

.daily-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.daily-cal-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(14, 26, 52, 0.72);
}

.daily-cal-cell.got {
  opacity: 0.55;
  border-color: #2ecc71;
}

.daily-cal-cell.today {
  border: 2px solid #ffd32a;
  box-shadow: 0 0 10px rgba(255, 211, 42, 0.45);
}

.fish-bar-wrap {
  position: relative;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #c69a3f;
  background: #0d1b34;
}

.fish-bar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.75;
}

.fish-sweet-zone {
  position: absolute;
  left: 38%;
  width: 24%;
  top: 0;
  bottom: 0;
  background: rgba(46, 213, 115, 0.42);
  border-left: 2px solid #7bed9f;
  border-right: 2px solid #7bed9f;
}

.fish-cursor {
  position: absolute;
  left: 0%;
  top: 2px;
  bottom: 2px;
  width: 6px;
  margin-left: -3px;
  border-radius: 3px;
  background: #ffd32a;
  box-shadow: 0 0 8px #ffd32a;
}

/* Equip & Card Socket responsive clarity */
@media (max-width: 960px),
(max-height: 580px) {
  #menu-window {
    padding: 10px 12px;
  }

  .gm-equip-layout {
    gap: 5px;
  }

  .gm-equip-top {
    grid-template-columns: 126px 1fr 126px 168px;
    gap: 6px;
  }

  .gm-eq-box {
    height: 44px;
    padding: 3px 6px;
  }

  .gm-eq-acc-row .gm-eq-box {
    height: 38px;
  }

  .gm-eq-strip-pager .gm-slot-dark,
  .gm-strip-nav {
    height: 40px;
  }

  .gm-eq-detail-panel {
    padding: 7px 10px 9px;
    min-height: 66px;
    margin-bottom: 2px;
  }

  .gm-eq-sockets-row {
    gap: 6px;
  }

  .gm-socket-btn {
    min-height: 30px;
    padding: 4px 8px;
    font-size: 12px;
  }
}

/* Cash Shop PET Sub-Tabs */
.cash-subtabs {
  display: flex;
  gap: 6px;
  padding: 4px 2px 6px;
  flex-wrap: wrap;
}

.cash-subtab-btn {
  padding: 5px 12px;
  border-radius: 7px;
  border: 1.5px solid #4877c4;
  background: rgba(12, 26, 56, 0.85);
  color: #cfe3ff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.cash-subtab-btn.active {
  border-color: #ffd32a;
  background: linear-gradient(180deg, #2b5cb8, #14326d);
  color: #fffa65;
}

/* Jackpot 70-Prize Chasing-Light Arcade Board (10x7) */
.jp-board-70 {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(8, 16, 34, 0.92);
  border: 2px solid #598be0;
}

.jp-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  padding: 3px 2px;
  border-radius: 6px;
  background: rgba(20, 42, 86, 0.72);
  border: 1.5px solid rgba(110, 164, 255, 0.35);
  transition: transform 0.08s, border-color 0.08s, box-shadow 0.08s;
}

.jp-cell .jp-cell-num {
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 8.5px;
  color: #93c5fd;
  font-weight: 800;
}

.jp-cell .jp-cell-lbl {
  font-size: 9px;
  line-height: 1.05;
  color: #e2e8f0;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jp-cell.chasing {
  border: 2px solid #ffd32a;
  background: rgba(255, 204, 42, 0.28);
  box-shadow: 0 0 12px rgba(255, 211, 42, 0.9), inset 0 0 8px rgba(255, 240, 128, 0.55);
  transform: scale(1.06);
  z-index: 2;
}

.jp-cell.won {
  border: 2px solid #2ecc71;
  background: rgba(46, 204, 113, 0.32);
  box-shadow: 0 0 14px rgba(46, 213, 115, 0.95);
  transform: scale(1.07);
  z-index: 3;
}

/* Guild War Pre-War Roster */
.gw-roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 6px;
  max-height: 195px;
  overflow-y: auto;
  padding: 4px 2px;
}

.gw-roster-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(14, 28, 58, 0.85);
  border: 1.5px solid rgba(110, 164, 255, 0.35);
  color: #e2e8f0;
  font-size: 12px;
  cursor: pointer;
}

.gw-roster-chip.checked {
  border-color: #ffd32a;
  background: rgba(34, 74, 150, 0.82);
  color: #fff;
}

/* Account Pet Auto-Loot Search & Keybind/Gamepad UI */
.ro-action-btn.ro-loot-toggle-on {
  background: linear-gradient(180deg, #27ae60, #197a42);
  border-color: #7bed9f;
  color: #ffffff;
}

.ro-loot-picked {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(7, 16, 36, 0.78);
  border: 1.5px solid rgba(255, 211, 42, 0.35);
}

.ro-loot-picked-title {
  font-size: 12px;
  font-weight: 800;
  color: #ffd32a;
}

.ro-loot-picked-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 76px;
  overflow-y: auto;
}

.ro-loot-picked-empty {
  font-size: 11.5px;
  color: #93c5fd;
  padding: 2px 0;
}

.ro-loot-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px 3px 5px;
  border-radius: 999px;
  background: rgba(22, 68, 46, 0.85);
  border: 1px solid #2ecc71;
  color: #ecfdf5;
  font-size: 11.5px;
  font-weight: 700;
  max-width: 210px;
}

.ro-loot-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ro-loot-chip-x {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.4);
  color: #ffb3ba;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.ro-loot-chip-x:hover {
  background: #e11d48;
  color: #fff;
}

.ro-loot-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 6px;
  max-height: 185px;
  overflow-y: auto;
  padding: 4px 2px;
}

.ro-loot-item-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(12, 26, 54, 0.85);
  border: 1.5px solid rgba(110, 164, 255, 0.3);
  color: #e2e8f0;
  font-size: 12px;
  cursor: pointer;
}

.ro-loot-item-row.checked {
  border-color: #2ecc71;
  background: rgba(20, 74, 54, 0.72);
}

.ro-loot-cat-tag {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(30, 58, 110, 0.72);
  border: 1px solid rgba(126, 200, 255, 0.25);
  color: #93c5fd;
  font-size: 10.5px;
  font-weight: 700;
  flex-shrink: 0;
}

.ro-bind-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
}

.ro-bind-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 7px;
  background: rgba(14, 30, 62, 0.88);
  border: 1.5px solid #4877c4;
  color: #e2e8f0;
  font-size: 12.5px;
  cursor: pointer;
}

.ro-bind-btn.listening {
  border-color: #ffd32a;
  background: rgba(180, 120, 12, 0.35);
  color: #fff3bf;
}

.ro-bind-key {
  padding: 2px 8px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(148, 197, 255, 0.4);
  color: #7ef9ff;
  font-weight: 800;
  font-size: 11.5px;
}

/* ==================== LOGIN / OPTIONS / CREATE CHARACTER HIGH-CONTRAST REDESIGN ==================== */
#screen-title .modal-backdrop,
#screen-char .modal-backdrop {
  background: radial-gradient(ellipse at center, rgba(6, 14, 34, 0.88) 0%, rgba(2, 6, 18, 0.95) 100%);
}

#login-dialog .ro-acc-box,
#title-opt-dialog .ro-acc-box,
#cc-panel,
#char-action-popup .ro-sel-popup,
#char-del-popup .ro-sel-popup {
  background: linear-gradient(180deg, #162b56 0%, #0b1836 58%, #071024 100%);
  border: 2px solid #d9b45a;
  border-radius: 16px;
  box-shadow: 0 0 0 3px rgba(9, 20, 48, 0.94), 0 0 0 5px rgba(86, 140, 235, 0.55), 0 18px 48px rgba(0, 0, 0, 0.76), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  color: #eaf3ff;
  opacity: 1;
}

#char-action-popup .ro-sel-border-top,
#char-action-popup .ro-sel-border-bot,
#char-del-popup .ro-sel-border-top,
#char-del-popup .ro-sel-border-bot {
  display: none;
}

#char-action-popup .ro-sel-popup,
#char-del-popup .ro-sel-popup {
  width: 390px;
  padding: 22px 26px;
  margin-bottom: 0;
}

#char-action-bar .ro-btn-192,
#char-del-popup .ro-btn-116 {
  width: 204px;
  height: 42px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(180deg, #243a66, #16264a);
  border: 2px solid #5b7fbf;
  color: #dce9ff;
  text-shadow: none;
}

#char-del-popup .ro-btn-116 {
  width: 100%;
  height: 46px;
}

#char-action-bar .ro-btn-192-active,
#char-del-popup #btn-del-yes {
  background: linear-gradient(180deg, #4a9bff, #1c5ad1);
  border-color: #ffd86b;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

#char-action-bar #btn-char-delete {
  background: linear-gradient(180deg, #7f1d32, #4c1120);
  border-color: #f87171;
  color: #ffe4e6;
}

#del-confirm-msg {
  font-size: 18px;
  color: #ffe48f;
  padding: 6px 0 8px;
  text-align: center;
}

.del-pw-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

#del-pw-lbl {
  font-size: 13px;
  font-weight: 700;
  color: #cfe0ff;
}

#inp-del-pw {
  width: 100%;
  box-sizing: border-box;
  height: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1.5px solid #5b7fbf;
  background: rgba(6, 12, 28, 0.9);
  color: #ffffff;
  font-size: 16px;
  outline: none;
}

#inp-del-pw:focus {
  border-color: #ffd86b;
  box-shadow: 0 0 0 2px rgba(255, 216, 107, 0.22);
}

#del-pw-err {
  min-height: 16px;
  font-size: 12.5px;
  font-weight: 700;
  color: #ff6b81;
  text-align: center;
}

#login-dialog .ro-acc-box {
  width: 560px;
  min-height: 0;
  padding: 18px 30px 20px;
  gap: 11px;
}

#title-opt-dialog .ro-acc-box {
  width: 490px;
  min-height: 0;
  padding: 22px 30px 24px;
  gap: 16px;
}

#login-dialog .ro-acc-head-brand {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(217, 180, 90, 0.35);
  justify-content: flex-start;
}

#login-dialog .ro-acc-head-brand img {
  width: 48px;
  height: 48px;
  border: 2px solid #d9b45a;
}

#login-dialog .ro-acc-title {
  text-align: left;
  font-size: 21px;
  letter-spacing: 0.5px;
  color: #ffe48f;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

#login-dialog .ro-acc-sub {
  text-align: left;
  font-size: 12.5px;
  color: #a9c6ee;
  text-shadow: none;
}

#title-opt-dialog .ro-acc-title {
  font-size: 22px;
  color: #ffe48f;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(217, 180, 90, 0.35);
}

#login-dialog .ro-acc-tabs {
  gap: 8px;
  padding: 4px;
  border-radius: 11px;
  background: rgba(4, 10, 26, 0.72);
}

#login-dialog .ro-acc-tab {
  height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #9db8e0;
  font-size: 15px;
  font-weight: 800;
}

#login-dialog .ro-acc-tab:hover {
  color: #fff;
  background: rgba(86, 140, 235, 0.18);
}

#login-dialog .ro-acc-tab.active {
  background: linear-gradient(180deg, #3b86f5, #1c55c7);
  border-color: #ffd86b;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  box-shadow: 0 2px 8px rgba(30, 90, 220, 0.5);
}

#login-dialog .ro-acc-pane {
  gap: 9px;
}

#login-dialog .ro-field-wrap {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

#login-dialog .ro-field-wrap label,
#login-dialog .royal-acc-box .ro-field-wrap label {
  width: auto;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #ffe48f;
  text-shadow: none;
}

#login-dialog .ro-field-wrap input,
#login-dialog .royal-acc-box .ro-field-wrap input {
  height: 41px;
  padding: 0 14px;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  color: #0b1c36;
  text-shadow: none;
  background: #f4f8ff;
  border: 2px solid #5b8fe0;
  border-radius: 10px;
  box-shadow: inset 0 2px 4px rgba(10, 30, 70, 0.16);
}

#login-dialog .ro-field-wrap input::placeholder {
  color: #6b81a6;
  text-align: left;
  font-weight: 600;
}

#login-dialog .ro-field-wrap input:focus {
  border-color: #ffd86b;
  box-shadow: 0 0 0 3px rgba(255, 216, 107, 0.35), inset 0 2px 4px rgba(10, 30, 70, 0.16);
}

#login-dialog .ro-remember-row,
#login-dialog .royal-acc-box .ro-remember-row {
  justify-content: flex-start;
  font-size: 13.5px;
  font-weight: 600;
  color: #cde0fa;
  text-shadow: none;
}

#login-dialog .ro-remember-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #3b86f5;
}

#login-dialog #login-err,
#login-dialog #reg-msg,
#login-dialog .royal-acc-box #login-err,
#login-dialog .royal-acc-box #reg-msg {
  font-size: 13.5px;
  min-height: 18px;
  text-align: left;
  color: #ff9aa8;
  text-shadow: none;
}

#login-dialog #login-err.ok,
#login-dialog #reg-msg.ok {
  color: #7bed9f;
}

#login-dialog .ro-acc-btns,
#title-opt-dialog .ro-acc-btns {
  gap: 12px;
  margin-top: 2px;
}

#login-dialog .ro-btn-192,
#title-opt-dialog .ro-btn-192 {
  flex: 1;
  width: auto;
  height: 44px;
  border-radius: 11px;
  font-size: 16px;
  font-weight: 800;
  background: linear-gradient(180deg, #243a66, #16264a);
  border: 2px solid #5b7fbf;
  color: #dce9ff;
  text-shadow: none;
}

#login-dialog .ro-btn-192:hover,
#title-opt-dialog .ro-btn-192:hover {
  filter: brightness(1.16);
}

#login-dialog .ro-btn-192-active,
#title-opt-dialog #btn-opt-title-close {
  background: linear-gradient(180deg, #4a9bff, #1c5ad1);
  border-color: #ffd86b;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  box-shadow: 0 3px 12px rgba(40, 110, 240, 0.55);
}

#title-opt-dialog .ro-opt-row {
  display: grid;
  grid-template-columns: 150px 1fr 48px;
  gap: 12px;
  align-items: center;
  font-size: 15.5px;
  font-weight: 800;
  color: #eaf3ff;
  text-shadow: none;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(4, 10, 26, 0.65);
  border: 1px solid rgba(91, 143, 224, 0.35);
}

#title-opt-dialog .ro-opt-val {
  text-align: right;
  font-size: 14px;
  font-weight: 800;
  color: #ffe48f;
}

#title-opt-dialog .ro-opt-row input[type=range] {
  width: 100%;
  height: 6px;
  accent-color: #ffd86b;
  cursor: pointer;
}

/* Character Create High-Contrast Redesign */
#cc-panel {
  width: 800px;
  padding: 18px 28px 20px;
  gap: 12px;
}

#cc-panel .cc-head {
  font-size: 21px;
  letter-spacing: 0.8px;
  color: #ffe48f;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.75);
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(217, 180, 90, 0.35);
}

#cc-panel .cc-body {
  grid-template-columns: 234px 1fr;
  gap: 22px;
}

#cc-panel .cc-preview-box {
  border: 2px solid #d9b45a;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
}

#cc-panel #cc-hair-lbl {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  color: #eaf3ff;
}

#cc-panel .cc-name-row input {
  height: 40px;
  padding: 0 12px;
  font-size: 15.5px;
  font-weight: 700;
  color: #0b1c36;
  background: #f4f8ff;
  border: 2px solid #5b8fe0;
  border-radius: 10px;
  outline: none;
}

#cc-panel .cc-name-row input::placeholder {
  color: #6b81a6;
}

#cc-panel .cc-name-row input:focus {
  border-color: #ffd86b;
  box-shadow: 0 0 0 3px rgba(255, 216, 107, 0.35);
}

#cc-panel .ro-mini-sq {
  width: 38px;
  height: 38px;
  background: linear-gradient(180deg, #3b86f5, #1c55c7);
  border: 1.5px solid #9cc0ff;
  color: #fff;
  border-radius: 9px;
}

#cc-panel .ro-mini-sq:hover:not(:disabled) {
  filter: brightness(1.15);
}

#cc-panel .ro-mini-sq:disabled {
  opacity: 0.35;
  cursor: default;
}

#cc-panel .cc-jobs {
  gap: 6px;
}

#cc-panel .cc-job {
  padding: 8px 4px;
  border-radius: 10px;
  border: 1.5px solid #3f64a8;
  background: #16274d;
  color: #cfe0fa;
  font-size: 13.5px;
  font-weight: 800;
}

#cc-panel .cc-job:hover {
  background: #1d3366;
  color: #fff;
}

#cc-panel .cc-job.active {
  background: linear-gradient(180deg, #3b86f5, #1c55c7);
  border-color: #ffd86b;
  color: #fff;
  box-shadow: 0 2px 10px rgba(40, 110, 240, 0.5);
}

#cc-panel .cc-gender {
  padding: 8px;
  border-radius: 10px;
  border: 1.5px solid #3f64a8;
  background: #16274d;
  color: #cfe0fa;
  font-size: 14px;
  font-weight: 800;
}

#cc-panel .cc-gender.male.active {
  background: linear-gradient(180deg, #3b86f5, #1c55c7);
  border-color: #ffd86b;
  color: #fff;
}

#cc-panel .cc-gender.female.active {
  background: linear-gradient(180deg, #ee5aa5, #c42a79);
  border-color: #ffd86b;
  color: #fff;
}

#cc-panel .cc-stat-row {
  grid-template-columns: 58px 32px 1fr 38px 38px;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 15.5px;
  font-weight: 800;
  color: #eaf3ff;
}

#cc-panel .cc-stat-row>span:first-child {
  color: #ffe48f;
  letter-spacing: 0.5px;
}

#cc-panel .cc-stat-row>span:nth-child(2) {
  text-align: center;
  color: #fff;
}

#cc-panel .cc-stat-bar {
  height: 12px;
  background: #0a1530;
  border: 1px solid #3f64a8;
  border-radius: 7px;
}

#cc-panel .cc-stat-bar>div {
  background: linear-gradient(90deg, #35c24a, #8cf06a);
}

#cc-panel .cc-pts {
  font-size: 15px;
  font-weight: 700;
  color: #cfe0fa;
  padding-top: 4px;
  border-top: 1px dashed rgba(91, 143, 224, 0.4);
}

#cc-panel .cc-pts b {
  color: #ffe48f;
  font-size: 18px;
}

#cc-panel .cc-foot {
  gap: 14px;
}

#cc-panel .ro-btn-116 {
  flex: 0 0 200px;
  width: 200px;
  height: 44px;
  border-radius: 11px;
  font-size: 16px;
  font-weight: 800;
  background: linear-gradient(180deg, #243a66, #16264a);
  border: 2px solid #5b7fbf;
  color: #dce9ff;
}

#cc-panel #btn-create-ok {
  background: linear-gradient(180deg, #4a9bff, #1c5ad1);
  border-color: #ffd86b;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  box-shadow: 0 3px 12px rgba(40, 110, 240, 0.55);
}

@media (max-width: 760px),
(max-height: 540px) {
  #login-dialog .ro-acc-box {
    width: 94%;
    padding: 12px 16px 14px;
    gap: 7px;
  }

  #login-dialog .ro-field-wrap input {
    height: 36px;
    font-size: 16px;
  }

  #cc-panel {
    width: 96%;
    padding: 12px 14px 14px;
    gap: 8px;
  }

  #cc-panel .cc-body {
    grid-template-columns: 170px 1fr;
    gap: 12px;
  }

  #cc-panel .cc-preview-box,
  #cc-panel #cc-canvas {
    width: 150px;
    height: 150px;
  }

  #cc-panel .cc-stat-row {
    margin-bottom: 4px;
    font-size: 14px;
  }

  #cc-panel .ro-btn-116 {
    flex-basis: 150px;
    width: 150px;
    height: 40px;
    font-size: 15px;
  }
}

/* Mobile GPU optimization: avoid full-screen WebGL framebuffer readback from backdrop-filter blur */
html.is-mobile *,
html.is-mobile *::before,
html.is-mobile *::after {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* 6.5.0 mercenary screen (Equip/Sell, Level up, Compound/Evolve, Summon) */
.merc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 8px;
}

.merc-card {
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 2px solid #888;
  border-radius: 8px;
  background: rgba(8, 15, 30, 0.75);
  align-items: flex-start;
}

.merc-card.sel {
  background: rgba(60, 90, 30, 0.55);
  box-shadow: 0 0 0 2px #7bed9f inset;
}

.merc-card.mat {
  background: rgba(120, 70, 20, 0.55);
  box-shadow: 0 0 0 2px #ffb03b inset;
}

.merc-pic {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  image-rendering: pixelated;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.06);
  display: inline-block;
}

.merc-info {
  min-width: 0;
  font-size: 12.5px;
}

.merc-grade {
  font-weight: 800;
  font-size: 11.5px;
  margin-left: 4px;
}

.merc-sub {
  font-size: 11.5px;
  color: #a9c4e8;
  margin-top: 2px;
}

.merc-ctl {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
  align-items: center;
}

.merc-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.merc-slot {
  border: 2px dashed #5b7aa8;
  border-radius: 8px;
  padding: 6px;
  text-align: center;
  font-size: 12px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: rgba(8, 15, 30, 0.6);
}

.merc-slot-t {
  color: #ffe28a;
  font-weight: 800;
}


/* ==================== PLAYER STORES (Vending / Buying Store / offline stores) ==================== */
#shop-window {
  width: min(680px, 95%);
  max-height: 89%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #13213f 0%, #0b152c 55%, #070e1f 100%);
  border: 2px solid #cfa54e;
  border-radius: 16px;
  box-shadow: 0 0 0 3px rgba(7, 15, 36, 0.94), 0 0 28px rgba(245, 180, 72, 0.22), 0 20px 54px rgba(0, 0, 0, 0.82);
  color: #eaf3ff;
  overflow: hidden;
}

#shop-window.shop-mode-buy {
  border-color: #36b9d0;
  box-shadow: 0 0 0 3px rgba(7, 18, 34, 0.94), 0 0 28px rgba(45, 200, 224, 0.22), 0 20px 54px rgba(0, 0, 0, 0.82);
}

#shop-window .shop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  background: linear-gradient(90deg, rgba(64, 41, 14, 0.96) 0%, rgba(26, 44, 86, 0.94) 68%, rgba(18, 32, 66, 0.96) 100%);
  border-bottom: 1.5px solid rgba(255, 211, 88, 0.65);
}

#shop-window.shop-mode-buy .shop-head {
  background: linear-gradient(90deg, rgba(12, 62, 78, 0.96) 0%, rgba(20, 44, 82, 0.94) 68%, rgba(14, 30, 60, 0.96) 100%);
  border-bottom-color: rgba(72, 216, 240, 0.65);
}

#shop-window .shop-head-l {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  flex: 1;
}

#shop-window .shop-head-ico {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 10px;
  background: #ffffff;
  border: 2px solid rgba(255, 216, 120, 0.85);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

#shop-window.shop-mode-buy .shop-head-ico {
  border-color: rgba(112, 232, 255, 0.85);
}

#shop-window .shop-head-ico img {
  width: 26px;
  height: 26px;
  image-rendering: pixelated;
  object-fit: contain;
}

#shop-window .shop-head-txt {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#shop-window .shop-head-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

#shop-window .shop-mode-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

#shop-window .shop-mode-pill.sell {
  background: linear-gradient(180deg, #f6ad3c, #c77416);
  color: #160c02;
}

#shop-window .shop-mode-pill.buy {
  background: linear-gradient(180deg, #3fd0e8, #148da6);
  color: #031920;
}

#shop-window .shop-sub-pill {
  font-size: 11px;
  font-weight: 700;
  color: #cbdcf5;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

#shop-window .shop-title {
  font-size: 17px;
  font-weight: 800;
  color: #fff6cf;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#shop-window.shop-mode-buy .shop-title {
  color: #dffaff;
}

#shop-window .shop-x {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 9px;
  border: 1.5px solid rgba(255, 190, 190, 0.55);
  background: linear-gradient(180deg, #c23939, #8d1c1c);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#shop-window .shop-x:hover {
  filter: brightness(1.12);
}

#shop-window .shop-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px 14px;
  overflow-y: auto;
}

#shop-window .shop-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(18, 34, 68, 0.85);
  border: 1px solid rgba(120, 165, 235, 0.28);
}

#shop-window .shop-meta-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#shop-window .shop-owner-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #dbeafe;
}

#shop-window .shop-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

#shop-window .shop-dot.on {
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
}

#shop-window .shop-dot.off {
  background: #fbbf24;
  box-shadow: 0 0 6px #fbbf24;
}

#shop-window .shop-off-tag,
#shop-window .shop-status-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
}

#shop-window .shop-off-tag,
#shop-window .shop-status-pill.off {
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(251, 191, 36, 0.5);
  color: #fde68a;
}

#shop-window .shop-status-pill.on {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(74, 222, 128, 0.5);
  color: #bbf7d0;
}

#shop-window .shop-stat-pill {
  font-size: 12px;
  font-weight: 700;
  color: #bae6fd;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
}

#shop-window .shop-zeny-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(245, 184, 58, 0.14);
  border: 1px solid rgba(255, 211, 88, 0.45);
}

#shop-window .shop-zeny-pill small {
  font-size: 11px;
  color: #fde68a;
}

#shop-window .shop-zeny-pill b {
  font-size: 14px;
  font-weight: 800;
  color: #ffea75;
}

#shop-window .shop-note {
  font-size: 12.5px;
  line-height: 1.45;
  color: #bfd6f6;
}

#shop-window .shop-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
}

#shop-window .shop-text,
#shop-window .shop-num {
  padding: 6px 8px;
  border: 1.5px solid #5384cc;
  border-radius: 7px;
  background: #0a1836;
  color: #fff;
  font-size: 13.5px;
}

#shop-window .shop-num {
  text-align: center;
  font-weight: 700;
  padding: 4px;
}

#shop-window .shop-text {
  flex: 1;
  min-width: 0;
}

#shop-window .shop-src-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

#shop-window .shop-src-tab {
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid rgba(110, 155, 230, 0.35);
  background: rgba(16, 34, 70, 0.8);
  color: #cbdcf5;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

#shop-window .shop-src-tab.active {
  background: linear-gradient(180deg, #2b64c0, #1c4488);
  border-color: #ffd56a;
  color: #fff;
}

#shop-window .shop-src-badge {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 800;
}

#shop-window .shop-src-badge.cart {
  background: rgba(245, 158, 11, 0.25);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.45);
}

#shop-window .shop-src-badge.bag {
  background: rgba(56, 189, 248, 0.2);
  color: #bae6fd;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

#shop-window .shop-list,
#shop-window .shop-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#shop-window .shop-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(24, 42, 82, 0.78), rgba(14, 26, 54, 0.9));
  border: 1px solid rgba(112, 154, 224, 0.28);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  transition: border-color 0.14s, background 0.14s;
}

#shop-window .shop-card:hover {
  border-color: rgba(255, 214, 102, 0.55);
  background: linear-gradient(180deg, rgba(30, 52, 98, 0.88), rgba(16, 30, 62, 0.94));
}

#shop-window .shop-card.tier-vvvs {
  border-color: rgba(251, 191, 36, 0.52);
}

#shop-window .shop-card.tier-vvs {
  border-color: rgba(192, 132, 252, 0.48);
}

#shop-window .shop-card.tier-vs,
#shop-window .shop-card.tier-s2 {
  border-color: rgba(56, 189, 248, 0.45);
}

#shop-window .shop-row-l {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

#shop-window .shop-ico-box {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1.5px solid rgba(125, 165, 230, 0.45);
  background: radial-gradient(circle at 50% 35%, rgba(45, 76, 138, 0.65), rgba(10, 18, 38, 0.92));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

#shop-window .shop-ico-box:hover {
  border-color: #ffd56a;
  transform: translateY(-1px);
}

#shop-window .shop-ico-box.tier-vvvs {
  border-color: #fbbf24;
}

#shop-window .shop-ico-box.tier-vvs {
  border-color: #c084fc;
}

#shop-window .shop-ico-box.tier-vs,
#shop-window .shop-ico-box.tier-s2 {
  border-color: #38bdf8;
}

#shop-window .shop-ref-badge {
  position: absolute;
  top: -5px;
  left: -5px;
  padding: 0 5px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 800;
  background: #d97706;
  color: #fff;
  border: 1px solid #fde68a;
}

#shop-window .shop-cnt-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  padding: 0 5px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  background: #0f172a;
  color: #93c5fd;
  border: 1px solid rgba(147, 197, 253, 0.55);
}

#shop-window .shop-row-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#shop-window .shop-row-name {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

#shop-window .shop-name-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: #f1f5f9;
  font-size: 14.5px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#shop-window .shop-name-link:hover {
  text-decoration: underline;
  color: #ffe28a;
}

#shop-window .shop-name-link.tier-vvvs {
  color: #ffd44d;
}

#shop-window .shop-name-link.tier-vvs {
  color: #d8b4fe;
}

#shop-window .shop-name-link.tier-vs,
#shop-window .shop-name-link.tier-s2 {
  color: #7dd3fc;
}

#shop-window .shop-name-link.tier-s {
  color: #6ee7b7;
}

#shop-window .shop-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

#shop-window .shop-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

#shop-window .shop-tag.atk {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.14);
}

#shop-window .shop-tag.matk {
  color: #d8b4fe;
  background: rgba(168, 85, 247, 0.16);
}

#shop-window .shop-tag.def {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.15);
}

#shop-window .shop-tag.opt {
  color: #7bed9f;
  background: rgba(34, 197, 94, 0.14);
}

#shop-window .shop-tag.sock {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.14);
}

#shop-window .shop-row-sub {
  font-size: 11.5px;
  color: #7bed9f;
}

#shop-window .shop-row-r,
#shop-window .shop-trade-box {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

#shop-window .shop-trade-box {
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

#shop-window .shop-unit-price {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

#shop-window .shop-unit-price b {
  font-size: 15px;
  font-weight: 800;
  color: #ffea75;
}

#shop-window .shop-unit-price small {
  font-size: 11px;
  color: #9fb8e0;
}

#shop-window .shop-ctrl-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

#shop-window .shop-qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: rgba(8, 18, 42, 0.85);
  border: 1px solid rgba(90, 138, 214, 0.45);
}

#shop-window .shop-step-btn {
  min-width: 22px;
  height: 24px;
  border: none;
  border-radius: 5px;
  background: rgba(52, 92, 168, 0.65);
  color: #eaf3ff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  padding: 0 5px;
}

#shop-window .shop-step-btn:hover {
  background: rgba(76, 128, 224, 0.9);
}

#shop-window .shop-step-btn.max {
  font-size: 10px;
  background: rgba(217, 119, 6, 0.55);
  color: #fef3c7;
}

#shop-window .shop-subtotal {
  font-size: 11px;
  font-weight: 700;
  color: #bae6fd;
}

#shop-window .shop-subtotal.over-budget {
  color: #fca5a5;
}

#shop-window .shop-have-pill,
#shop-window .shop-stock-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

#shop-window .shop-have-pill.has,
#shop-window .shop-stock-pill {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
  border: 1px solid rgba(74, 222, 128, 0.35);
}

#shop-window .shop-have-pill.none {
  background: rgba(148, 163, 184, 0.14);
  color: #94a3b8;
}

#shop-window .shop-act-btn {
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 800;
  border-radius: 8px;
}

#shop-window .shop-act-btn.buy {
  background: linear-gradient(180deg, #f59e0b, #b45309);
  border-color: #fde68a;
  color: #fff;
}

#shop-window .shop-act-btn.sell {
  background: linear-gradient(180deg, #0ea5e9, #0369a1);
  border-color: #bae6fd;
  color: #fff;
}

#shop-window .shop-results {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 150px;
  overflow-y: auto;
}

#shop-window .shop-result {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border: 1px solid #3f6bb8;
  border-radius: 6px;
  background: rgba(24, 54, 112, 0.7);
  color: #fff;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

#shop-window .shop-result:hover {
  background: rgba(59, 111, 216, 0.8);
}

#shop-window .shop-empty {
  padding: 16px;
  text-align: center;
  color: #9fb8e0;
  font-size: 13.5px;
}

#shop-window .shop-stat {
  font-size: 13.5px;
  font-weight: 700;
  color: #fffa65;
}

#shop-window .shop-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 6px;
  border-top: 1px solid rgba(110, 155, 230, 0.22);
  /* pinned action bar: stays visible at the bottom while the item list scrolls */
  position: sticky;
  bottom: 0;
  z-index: 2;
  flex-shrink: 0;
  margin: 0 -14px -14px;
  padding: 10px 14px 12px;
  background: linear-gradient(180deg, #0b152c 0%, #070e1f 100%);
  box-shadow: 0 -8px 12px rgba(7, 14, 31, 0.85);
}

#shop-window .shop-hint-l {
  margin-right: auto;
  font-size: 11.5px;
  color: #93b4e0;
}

#shop-window .shop-counter {
  margin-right: auto;
  font-size: 13px;
  color: #cfe3ff;
}

@media (max-width: 600px) {
  #shop-window .shop-card {
    flex-direction: column;
    align-items: stretch;
  }

  #shop-window .shop-trade-box {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }
}

#cs-shop-note {
  position: absolute;
  left: 202px;
  top: 568px;
  width: 556px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  line-height: 1.35;
  pointer-events: none;
}

#cs-shop-note.open {
  background: rgba(122, 62, 14, 0.9);
  border: 1.5px solid #ffd56a;
  color: #fff4cf;
}

#cs-shop-note.report {
  background: rgba(14, 84, 96, 0.9);
  border: 1.5px solid #8cf0ff;
  color: #dffaff;
}

#cs-shop-note.hidden,
#char-shop-warn.hidden {
  display: none;
}

#char-shop-warn {
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(122, 62, 14, 0.92);
  border: 1.5px solid #ffd56a;
  color: #fff4cf;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

/* ==================== BAG COMPACT PILL, CART BUTTON & CART GRID UI ==================== */
.gm-carry-pill.gm-carry-compact {
  padding: 4px 9px;
  border-width: 1.5px;
  gap: 8px;
  font-size: 12px;
  border-color: rgba(73, 124, 208, 0.72);
  background: rgba(8, 20, 46, 0.68);
}

.gm-carry-pill.gm-carry-compact span {
  color: #9fc5ff;
  font-size: 11px;
  font-weight: 700;
}

.gm-cart-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 2px solid #f5be48;
  background: linear-gradient(180deg, #9a5b14 0%, #683b0a 100%);
  color: #fff6dc;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 232, 160, 0.35);
  transition: transform 0.1s ease, filter 0.12s ease, border-color 0.12s ease;
}

.gm-cart-open-btn:hover {
  filter: brightness(1.14);
  border-color: #ffe28a;
  transform: translateY(-1px);
}

.gm-cart-cnt-pill {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(12, 22, 44, 0.72);
  border: 1px solid rgba(255, 213, 106, 0.5);
  color: #ffd56a;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
}

/* Shop setup source filter & badges */
#shop-window .shop-src-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

#shop-window .shop-src-tab {
  padding: 4px 10px;
  border-radius: 7px;
  border: 1.5px solid #4874c4;
  background: rgba(16, 36, 78, 0.85);
  color: #cfe3ff;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

#shop-window .shop-src-tab.active {
  border-color: #ffd32a;
  background: linear-gradient(180deg, #2758b5, #163a7d);
  color: #fff;
}

.shop-src-badge {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
}

.shop-src-badge.cart {
  background: rgba(180, 105, 18, 0.85);
  border: 1px solid #f5be48;
  color: #fff3cc;
}

.shop-src-badge.bag {
  background: rgba(34, 88, 178, 0.85);
  border: 1px solid #7fb3ff;
  color: #e6f2ff;
}

/* Inventory-style Pushcart modal inside #npc-window */
#npc-window.cart-mode {
  background: linear-gradient(180deg, #1b3161 0%, #102044 58%, #0a142d 100%);
  border-color: #162447;
  box-shadow: inset 0 0 0 3px #d9b45a, inset 0 0 0 6px #2a4885, 0 12px 30px rgba(0, 0, 0, 0.82);
}

#npc-window.cart-mode #npc-left {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#npc-window.cart-mode #npc-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.gm-cart-topbar {
  flex-wrap: wrap;
  gap: 7px;
}

.gm-cart-tabs {
  display: flex;
  gap: 5px;
  align-items: center;
}

.gm-cart-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1.5px solid #4d7cd0;
  background: #0c1f45;
  color: #cfe3ff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.gm-cart-tab-btn.active {
  background: linear-gradient(180deg, #b87018, #7b480a);
  border-color: #ffd56a;
  color: #fff9e6;
  box-shadow: 0 0 0 1px rgba(255, 213, 106, 0.65);
}

.gm-cart-tab-btn.bag-tab.active {
  background: linear-gradient(180deg, #2b63c6, #183f88);
  border-color: #93c5fd;
  color: #fff;
}

.gm-cart-page-strip {
  display: flex;
  gap: 4px;
}

.gm-cart-pg-btn {
  min-width: 28px;
  height: 30px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1.5px solid #497cd0;
  background: #0c1f45;
  color: #cfe3ff;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}

.gm-cart-pg-btn.active {
  background: #2557ad;
  border-color: #ffd32a;
  color: #fff;
}

.gm-cart-topbar .ro-action-btn {
  padding: 5px 10px;
  font-size: 12.5px;
}

.gm-cart-weight-mini {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 150px;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(8, 20, 46, 0.78);
  border: 1.5px solid #497cd0;
  font-size: 11px;
  font-weight: 700;
  color: #dbeeff;
}

.gm-cart-weight-mini-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.gm-cart-weight-mini-row b {
  color: #ffd56a;
}

.gm-cart-weight-mini .cart-weight-bar {
  margin-top: 1px;
  height: 5px;
}

.gm-cart-layout .gm-desc-bar {
  height: 82px;
}

.gm-cart-layout .gm-desc-actions .ro-action-btn {
  padding: 6px 10px;
  font-size: 13px;
}

/* ---- Field MVP list (big map tab "MVP") ---- */
#bigmap-mvp-pane {
  flex: 1;
  min-height: 0;
  padding: 10px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#bigmap-mvp-pane.hidden {
  display: none !important;
}

.mvp-pane-head {
  color: #cbd5e1;
  font-size: 12px;
  margin-bottom: 4px;
}

.mvp-row {
  display: grid;
  grid-template-columns: 54px minmax(110px, 1.2fr) minmax(120px, 1.4fr) 70px 130px;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 12px;
}

.mvp-row.here {
  border-color: rgba(251, 191, 36, 0.7);
}

.mvp-lv {
  color: #ff6b81;
  font-weight: 700;
}

.mvp-name {
  color: #fde68a;
  font-weight: 700;
}

.mvp-map {
  color: #cbd5e1;
}

.mvp-every {
  color: #94a3b8;
}

.mvp-ready {
  color: #7bed9f;
  font-weight: 700;
}

.mvp-wait {
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
}

/* boss room rules + MVP timers on the boss cards */
.boss-room-rule {
  margin-top: 3px;
  font-size: 11px;
  color: #fca5a5;
}

.boss-mvp-row {
  margin-top: 2px;
  font-size: 11px;
  color: #fde68a;
}

/* Circular loading overlay for NPC bulk sell */
@keyframes roSpin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

#sell-progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 9600;
  background: rgba(2, 6, 23, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.sell-prog-card {
  width: min(330px, 90vw);
  padding: 18px 20px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(17, 32, 68, 0.98), rgba(9, 18, 40, 0.98));
  border: 2px solid #f59e0b;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #f8fafc;
  text-align: center;
}

.ro-spin-ring {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid rgba(251, 191, 36, 0.22);
  border-top-color: #fde047;
  border-right-color: #38bdf8;
  animation: roSpin 0.85s linear infinite;
}

.sell-prog-title {
  font-size: 14px;
  font-weight: 900;
  color: #fde68a;
}

.sell-prog-count {
  font-size: 15px;
  font-weight: 900;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.sell-prog-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(147, 197, 253, 0.3);
  overflow: hidden;
}

.sell-prog-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f59e0b, #fde047);
  transition: width 0.12s linear;
}

.sell-prog-sub {
  font-size: 11.5px;
  color: #93c5fd;
  font-variant-numeric: tabular-nums;
}

.npc-job-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.npc-job-row .npc-menu-btn {
  flex: 1;
}

.npc-job-preview-btn {
  flex: 0 0 auto !important;
  min-width: 96px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1.5px solid #4877c4;
  background: rgba(14, 38, 86, 0.92);
  color: #9fd0ff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.npc-job-preview-btn:hover {
  border-color: #93c5fd;
  color: #fff;
  background: rgba(34, 78, 160, 0.95);
}

.npc-job-skill-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 225px;
  overflow-y: auto;
  padding: 6px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: rgba(10, 18, 36, 0.78);
  border: 1px solid rgba(120, 165, 240, 0.35);
}

.npc-job-skill-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(20, 36, 70, 0.68);
  border: 1px solid rgba(110, 160, 235, 0.25);
}

.npc-job-skill-meta {
  flex: 1;
  min-width: 0;
}

.npc-job-skill-name {
  font-size: 13.5px;
  font-weight: 800;
  color: #ffe082;
}

.npc-job-skill-sub {
  font-size: 11.5px;
  color: #7dd3fc;
  margin-top: 1px;
}

.npc-job-skill-desc {
  font-size: 12px;
  color: #e2eeff;
  line-height: 1.38;
  margin-top: 3px;
}

.npc-job-confirm-box {
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: rgba(15, 26, 52, 0.86);
  border: 1.5px solid rgba(250, 204, 21, 0.55);
  color: #f8fafc;
}

.npc-job-confirm-title {
  font-size: 16px;
  font-weight: 800;
  color: #fde047;
  margin-bottom: 6px;
}

.npc-job-confirm-warn {
  font-size: 13px;
  color: #fca5a5;
  margin-top: 6px;
}

/* ==================== iOS ANTI-ZOOM, LOGIN OVERLAP GUARD & AUDIO OPTIONS ==================== */
#viewport,
#stage,
#game,
#hud,
#hotkey-wrap,
#hk-slots,
.hk-btn,
#btn-atk,
#btn-pick,
#btn-target,
#btn-ride,
#btn-shop,
#btn-autofarm,
#btn-wiki,
#btn-battlepass,
#joy-zone,
#btn-stick-toggle {
  touch-action: none;
}

button,
a,
label,
input,
select {
  touch-action: manipulation;
}

html.is-mobile #inp-chat,
html.is-mobile #inp-whisper-to,
html.is-mobile #inp-newname,
html.is-mobile #inp-qty {
  font-size: 16px;
}

#screen-title.auth-modal-open .ro-960-center,
#screen-title.auth-modal-open #btn-title-touch-area,
#screen-title.auth-modal-open #btn-title-newid,
#screen-title.auth-modal-open #btn-title-opt {
  visibility: hidden;
  pointer-events: none;
}

#login-dialog,
#title-opt-dialog {
  z-index: 120;
  overflow-y: auto;
  touch-action: pan-y;
}

#login-dialog .ro-acc-box,
#title-opt-dialog .ro-acc-box {
  max-height: calc(100% - 12px);
  overflow-y: auto;
  flex-shrink: 0;
}

.sys-audio-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.3fr) minmax(110px, 1.6fr) 48px auto;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(8, 17, 36, 0.55);
  border: 1px solid rgba(110, 155, 225, 0.24);
}

.sys-audio-row input[type="range"] {
  width: 100%;
  accent-color: #3b82f6;
  cursor: pointer;
}

.sys-audio-val {
  text-align: right;
  font-weight: 800;
  font-size: 13.5px;
  color: #fde047;
  font-variant-numeric: tabular-nums;
}

.sys-audio-mute-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 68px;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 7px;
  border: 1px solid rgba(130, 175, 245, 0.45);
  background: rgba(24, 46, 88, 0.85);
  color: #e6f0ff;
  cursor: pointer;
}

.sys-audio-mute-btn.muted {
  border-color: rgba(248, 113, 113, 0.7);
  background: rgba(127, 29, 50, 0.85);
  color: #ffe4e6;
}

.sys-audio-master-btn.muted {
  background: linear-gradient(180deg, #991b1b, #7f1d1d);
  border-color: #fca5a5;
  color: #fff1f2;
}

/* ==================== PC / DESKTOP CHAT POLISH ==================== */
html:not(.is-mobile) #chat-log {
  height: 92px;
  font-size: 13.5px;
  line-height: 1.4;
}

html:not(.is-mobile) #hud-chat-box.input-open #chat-log {
  height: 156px;
}

html:not(.is-mobile) .chat-tab {
  height: 26px;
  font-size: 11.5px;
}

/* ==================== BATTLE PASS MODAL (ANTIQUE GOLD HYBRID RPG) ==================== */
#bp-modal {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 16, 0.74);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  z-index: 64;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
}

#bp-modal.hidden {
  display: none;
}

.bp-win {
  width: min(860px, 96%);
  max-height: min(600px, 92%);
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  border: 2.5px solid #d4a144;
  background: linear-gradient(180deg, #161d2e 0%, #0d121d 100%);
  box-shadow: inset 0 0 0 1.5px #4e3510, 0 0 0 2px #1a1006, 0 18px 46px rgba(0, 0, 0, 0.9);
  color: #eef2ff;
  font-family: 'Sarabun', sans-serif;
  overflow: hidden;
}

.bp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #2c2112 0%, #17120c 100%);
  border-bottom: 1.5px solid #966d29;
  flex-wrap: wrap;
}

.bp-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bp-head-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

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

.bp-season-sub {
  font-size: 11.5px;
  color: #cbd5e1;
}

.bp-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bp-ruby-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #d4a144;
  color: #fda4af;
  font-size: 12.5px;
  font-weight: 800;
}

.bp-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1.5px solid #c9973e;
  background: linear-gradient(180deg, #4b1d24, #280d12);
  color: #ffe4e6;
  font-weight: 900;
  cursor: pointer;
}

.bp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(11, 15, 26, 0.92);
  border-bottom: 1px solid rgba(212, 161, 68, 0.3);
  flex-wrap: wrap;
}

.bp-tabs {
  display: flex;
  gap: 6px;
}

.bp-tab-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #6b4e23;
  background: linear-gradient(180deg, #272017, #15110d);
  color: #cbb692;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.bp-tab-btn.active {
  border-color: #ffd36e;
  background: linear-gradient(180deg, #255bc2, #102e6b);
  color: #fff6d6;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.bp-tab-dot {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}

.bp-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
}

.bp-poster-hero {
  position: relative;
  border-radius: 9px;
  overflow: hidden;
  border: 2px solid #d4a144;
  margin-bottom: 12px;
  min-height: 218px;
  background: #0a0f1c;
}

.bp-poster-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  pointer-events: none;
}

.bp-poster-content {
  position: relative;
  z-index: 2;
  max-width: 470px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bp-season-pill {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(212, 161, 68, 0.22);
  border: 1px solid #f5c85b;
  color: #fde68a;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.4px;
}

.bp-poster-title {
  font-size: 21px;
  font-weight: 900;
  color: #fff7dc;
  text-shadow: 0 2px 6px #000;
  line-height: 1.2;
}

.bp-poster-desc {
  font-size: 12.5px;
  color: #dbeafe;
  line-height: 1.45;
  text-shadow: 0 1px 3px #000;
}

.bp-timer-box {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(7, 11, 22, 0.84);
  border: 1px solid rgba(253, 224, 71, 0.42);
  font-size: 12px;
  color: #e2e8f0;
  align-self: flex-start;
}

.bp-timer-val {
  color: #34d399;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.bp-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
}

.bp-sub-btn {
  padding: 8px 16px;
  border-radius: 7px;
  border: 1.5px solid #ffe08a;
  background: linear-gradient(180deg, #c78b24, #7c4f0d);
  color: #fffbeb;
  font-size: 13.5px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.65);
}

.bp-sub-btn:hover {
  filter: brightness(1.1);
}

.bp-sub-btn.active-vip {
  border-color: #34d399;
  background: linear-gradient(180deg, #065f46, #064e3b);
  color: #d1fae5;
}

.bp-benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 9px;
}

.bp-benefit-card {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(212, 161, 68, 0.42);
  background: linear-gradient(180deg, rgba(24, 32, 52, 0.92), rgba(13, 18, 30, 0.96));
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bp-benefit-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 900;
  color: #fde68a;
}

.bp-benefit-head img {
  width: 24px;
  height: 24px;
  border-radius: 4px;
}

.bp-benefit-desc {
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.4;
}

.bp-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px 11px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.25);
  flex-wrap: wrap;
}

.bp-claim-all-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1.5px solid #ffe08a;
  background: linear-gradient(180deg, #1d57b8, #0d2b63);
  color: #fff;
  font-size: 12.5px;
  font-weight: 900;
  cursor: pointer;
}

.bp-claim-all-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bp-daily-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 8px;
}

.bp-day-card {
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 22, 38, 0.88);
  padding: 7px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bp-day-card.unlocked {
  border-color: rgba(212, 161, 68, 0.65);
}

.bp-day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 900;
  color: #fde68a;
}

.bp-tier-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 6px;
  background: rgba(9, 13, 24, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.bp-tier-slot.paid {
  border-color: rgba(245, 158, 11, 0.42);
  background: linear-gradient(180deg, rgba(46, 32, 12, 0.65), rgba(18, 14, 10, 0.88));
}

.bp-tier-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
  cursor: pointer;
  border-radius: 5px;
  padding: 2px;
  transition: background 0.12s;
}

.bp-tier-info:hover {
  background: rgba(253, 224, 71, 0.12);
}

.bp-tier-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bp-tier-lbl {
  font-size: 9.5px;
  font-weight: 900;
  text-transform: uppercase;
  color: #93c5fd;
  white-space: nowrap;
}

.bp-tier-slot.paid .bp-tier-lbl {
  color: #fbbf24;
}

.bp-tier-name {
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bp-mini-btn {
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid #facc15;
  background: #1d4ed8;
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}

.bp-mini-btn.done {
  border-color: #34d399;
  background: rgba(6, 78, 59, 0.72);
  color: #a7f3d0;
  cursor: default;
}

.bp-mini-btn.locked {
  border-color: #475569;
  background: rgba(30, 41, 59, 0.75);
  color: #94a3b8;
  cursor: default;
}

.bp-quest-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bp-quest-card {
  border-radius: 8px;
  border: 1px solid rgba(212, 161, 68, 0.42);
  background: rgba(15, 22, 38, 0.9);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.bp-quest-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bp-quest-prog-bg {
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.bp-quest-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #f59e0b);
}

.bp-quest-tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px;
}

.bp-buff-thumb {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Custom Guild Emblem (120x120) & Castle Flag Modal */
.guild-emblem-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(251, 191, 36, 0.34);
  background: linear-gradient(135deg, rgba(16, 26, 48, 0.9), rgba(28, 38, 64, 0.85));
}

.guild-emblem-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.guild-emblem-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  border: 2px solid rgba(251, 191, 36, 0.72);
  background: rgba(8, 13, 24, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  color: #fbbf24;
}

.guild-emblem-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.guild-emblem-preview-120 {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  border: 2px solid rgba(251, 191, 36, 0.85);
  background: rgba(8, 12, 24, 0.92);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.guild-emblem-preview-120 img,
.guild-emblem-preview-120 canvas {
  width: 120px;
  height: 120px;
  display: block;
}

.guild-emblem-name-sim {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  font-size: 13px;
  font-weight: 800;
  color: #8ce8ff;
  text-shadow: 1px 1px 0 #000;
}

.guild-emblem-name-sim img {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  border: 1px solid rgba(255, 215, 90, 0.75);
}

.castle-flag-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.gm-req-ok {
  color: #4ade80 !important;
  font-weight: 700;
}

.gm-req-bad {
  color: #f87171 !important;
  font-weight: 700;
}

/* ==================== WELCOME EVENTS & PROMPTPAY TOP-UP MODAL ==================== */
#welcome-events-modal {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 18, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  z-index: 66;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
}

#welcome-events-modal.hidden {
  display: none;
}

.wev-win {
  width: min(920px, 97%);
  max-height: min(630px, 93%);
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  border: 2.5px solid #d4a144;
  background: linear-gradient(180deg, #131c31 0%, #090e1a 100%);
  box-shadow: inset 0 0 0 1.5px #4e3510, 0 0 0 2px #1a1006, 0 20px 52px rgba(0, 0, 0, 0.92);
  color: #eef2ff;
  font-family: 'Sarabun', sans-serif;
  overflow: hidden;
}

.wev-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  background: linear-gradient(180deg, #2d2010 0%, #17120c 100%);
  border-bottom: 1.5px solid #916a29;
}

.wev-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.wev-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 6px;
  border: 1px solid rgba(212, 161, 68, 0.45);
  background: rgba(15, 23, 42, 0.75);
  color: #cbd5e1;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

.wev-tab.active {
  background: linear-gradient(180deg, #b87e22, #784f10);
  border-color: #fde047;
  color: #fff;
}

.wev-body {
  flex: 1;
  min-height: 0;
  padding: 12px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wev-banner {
  position: relative;
  min-height: 185px;
  border-radius: 9px;
  overflow: hidden;
  border: 1.5px solid rgba(251, 191, 36, 0.55);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
}

.wev-banner-overlay {
  width: 100%;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(6, 10, 22, 0.18) 0%, rgba(6, 10, 22, 0.88) 60%, rgba(6, 10, 22, 0.96) 100%);
}

.wev-pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(198px, 1fr));
  gap: 9px;
}

.wev-pack-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  border: 1.5px solid rgba(96, 165, 250, 0.35);
  background: rgba(13, 21, 40, 0.92);
}

.wev-pack-card.best {
  border-color: rgba(250, 204, 21, 0.78);
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.16);
}

.wev-pack-art {
  width: 100%;
  aspect-ratio: 480 / 220;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid rgba(250, 204, 21, 0.35);
  background: #0a1020;
  flex-shrink: 0;
}

.wev-pack-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wev-promo-note {
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(251, 191, 36, 0.55);
  background: linear-gradient(90deg, rgba(180, 83, 9, 0.25), rgba(30, 58, 138, 0.28));
  color: #fef3c7;
  font-size: 12.5px;
  line-height: 1.48;
}

.wev-qr-box {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  border: 1.5px solid rgba(250, 204, 21, 0.65);
  background: rgba(11, 18, 35, 0.95);
}

.wev-qr-img-wrap {
  background: #fff;
  padding: 8px;
  border-radius: 8px;
  text-align: center;
}

.wev-qr-img-wrap img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.wev-section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 2px;
  font-size: 13px;
  font-weight: 900;
  color: #fde047;
  letter-spacing: 0.3px;
}

.wev-section-divider::before,
.wev-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.15), rgba(250, 204, 21, 0.65), rgba(250, 204, 21, 0.15));
}

@media (max-width: 640px) {
  .wev-qr-box { grid-template-columns: 1fr; }
}
