/* owner 2026-11-16: VIP window themes (Codex, ArtInbox/vip-window-themes-20261116). Every game window gets .vip-<tier>
   while the account's VIP lasts (Client/js/hud.js open). Loaded after compact-hud and mobile-compact. */
/* PROPOSAL ONLY. Load after compact-hud.css. Resolve URLs against final asset location.
   Apply one tier class to every .panel only while VIP is active; remove on expiry.
   No VIP class = existing normal panel. No generated text in runtime images. */
.panel.vip-leaf {
  --vip-header:#deeee4; --vip-title:#285743; --vip-edge:#86b6a0;
  --vip-primary:#366d57; --vip-frame:url('../assets/gen/vip/theme/leaf/frame-9slice.png');
  --vip-close:url('../assets/gen/vip/theme/leaf/close.png');
}
.panel.vip-lotus {
  --vip-header:#f5e2e8; --vip-title:#754459; --vip-edge:#c69a78;
  --vip-primary:#895169; --vip-frame:url('../assets/gen/vip/theme/lotus/frame-9slice.png');
  --vip-close:url('../assets/gen/vip/theme/lotus/close.png');
}
.panel.vip-moon {
  --vip-header:linear-gradient(115deg,#435777 0%,#344566 48%,#344566 100%);
  --vip-title:#f5f1ea; --vip-edge:#9baac8;
  --vip-primary:#40577e; --vip-frame:url('../assets/gen/vip/theme/moon/frame-9slice.png');
  --vip-close:url('../assets/gen/vip/theme/moon/close.png');
}
.panel:is(.vip-leaf,.vip-lotus,.vip-moon) {
  background:#fffcf3; color:#53576c;
  border:2px solid var(--vip-edge); border-radius:16px;
  isolation:isolate; /* frame overlay stays inside panel stacking context */
}
.panel:is(.vip-leaf,.vip-lotus,.vip-moon)::after {
  content:''; position:absolute; inset:-2px; z-index:3; pointer-events:none;
  border:48px solid transparent;
  border-image-source:var(--vip-frame); border-image-slice:48;
  border-image-width:48px; border-image-repeat:stretch;
  /* no fill: cream content remains untouched; ornament stays 36px at all sizes */
}
.panel:is(.vip-leaf,.vip-lotus,.vip-moon) > header {
  background:var(--vip-header); color:var(--vip-title);
  border-bottom:1px solid var(--vip-edge); border-radius:14px 14px 0 0;
  min-height:64px; box-sizing:border-box; padding:8px 12px 8px 50px;
}
.panel:is(.vip-leaf,.vip-lotus,.vip-moon) > header .x {
  width:44px; height:44px; flex:none; border:0; border-radius:12px;
  background:var(--vip-close) center / 44px 44px no-repeat;
  color:transparent; font-size:0; /* keep button aria-label="ปิด" */
}
.panel:is(.vip-leaf,.vip-lotus,.vip-moon) > .body {
  background:#fffcf3; color:#53576c; border-radius:0 0 14px 14px;
  border-top:1px solid var(--vip-edge); min-height:0; overflow:auto;
}
.panel:is(.vip-leaf,.vip-lotus,.vip-moon) .tabs button.on {
  background:var(--vip-header); color:var(--vip-title);
  box-shadow:inset 0 -2px var(--vip-edge);
}
.panel:is(.vip-leaf,.vip-lotus,.vip-moon) .btn.primary {
  background:var(--vip-primary); color:#fffcf3; border-color:var(--vip-primary);
}
.panel:is(.vip-leaf,.vip-lotus,.vip-moon) :is(button,a):focus-visible {
  outline:2px solid var(--vip-primary); outline-offset:2px;
}
@media(max-width:600px),(max-height:480px) {
  .panel:is(.vip-leaf,.vip-lotus,.vip-moon) > header { min-height:64px; }
  .panel:is(.vip-leaf,.vip-lotus,.vip-moon) .tabs button { min-height:44px; }
}
/* Preserve existing positioning, drag handle, panel sizing and body scrolling.
   Audit any exceptional panel header markup when integrating. No header PNG needed.
   UI controls/layout are native; only tiny ornaments are illustrated. */

/* phones: keep the compact header (mobile-compact.css) under the theme */
html[data-ui="mobile"] #panel-layer .panel:is(.vip-leaf,.vip-lotus,.vip-moon) > header { min-height: 46px; padding: 6px 10px 4px 44px; }
html[data-ui="mobile"] #panel-layer .panel:is(.vip-leaf,.vip-lotus,.vip-moon) > header .x { width: 36px; height: 36px; background-size: 36px 36px; }
html[data-ui="mobile"] #panel-layer .panel:is(.vip-leaf,.vip-lotus,.vip-moon) .tabs button { min-height: 30px; }

/* owner 2026-11-17: "ทำไมไม่เปลี่ยน UI ด้วยเลย" - the game-screen HUD wears the tier colours too (html[data-vip], set in
   Client/js/hud.js). A quiet tint: coloured rings and edges, light tinted chips; the world stays clear. Codex is making the
   decorated set (Documentation/codex-requests-20261117/CODEX_VIP_HUD_THEMES.md). */
html[data-vip="leaf"]  { --vh-edge: #4f9a74; --vh-strong: #2f6b50; --vh-tint: #d9efe2; --vh-glow: rgba(79, 154, 116, .45); }
html[data-vip="lotus"] { --vh-edge: #c96f93; --vh-strong: #8a3f62; --vh-tint: #f8dbe6; --vh-glow: rgba(201, 111, 147, .45); }
html[data-vip="moon"]  { --vh-edge: #5f78b8; --vh-strong: #2c3c63; --vh-tint: #dbe3f6; --vh-glow: rgba(95, 120, 184, .5); }
html[data-vip] #hud .sq-btn, html[data-vip] #hud .menu-btn, html[data-vip] #hud-gold, html[data-vip] #hud .map-pill,
html[data-vip] #hud-quick .slot, html[data-vip] #hud-actions > button, html[data-vip] #hud-trackers > * {
  background-color: var(--vh-tint) !important; box-shadow: 0 0 0 2.5px var(--vh-edge) inset, 0 3px 12px var(--vh-glow) !important; }
html[data-vip] #hud-character, html[data-vip] #hud-status > :first-child { box-shadow: 0 0 0 2px var(--vh-edge) inset, 0 4px 14px var(--vh-glow) !important; }
html[data-vip] #hud-minimap { box-shadow: 0 0 0 3px var(--vh-edge), 0 6px 18px var(--vh-glow) !important; }
html[data-vip] #hud-bar .slot.skill { box-shadow: 0 0 0 3px var(--vh-edge), 0 4px 12px var(--vh-glow) !important; }
html[data-vip] #hud-bar .act.big, html[data-vip] #hud-actions .act.big { box-shadow: 0 0 0 4px var(--vh-edge), 0 6px 18px var(--vh-glow) !important; }
html[data-vip] #hud-exp-fill { background: linear-gradient(90deg, var(--vh-edge), var(--vh-strong)) !important; }
html[data-vip] #hud-character, html[data-vip] #hud-status > :first-child { background-color: var(--vh-tint) !important; }
html[data-vip] #hud-hp-t, html[data-vip] #hud-name { color: var(--vh-strong) !important; }
/* owner 2026-11-17: the chat box keeps its normal colours under every VIP tier (no tint, no ornaments) */
