/* ==========================================================================
   GameForge v5.0 — @gameforge/ui Boutique H5 UI Design System
   Modern DOM/CSS/SVG commercial casual UI + 100% offline SIL-OFL .woff2 fonts
   ========================================================================== */

@font-face {
  font-family: "Fredoka";
  src: url("./fonts/Fredoka-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fredoka";
  src: url("./fonts/Fredoka-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lilita One";
  src: url("./fonts/LilitaOne-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("./fonts/Nunito-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("./fonts/Nunito-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --gf-font-display: "Lilita One", "Fredoka", "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --gf-font-ui: "Fredoka", "Nunito", "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --gf-font-body: "Nunito", "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  /* Sunlit Mediterranean / Royal Studio Palette */
  --gf-parchment: #FFF9EE;
  --gf-parchment-2: #F6E9D2;
  --gf-parchment-recess: #EEDBBF;
  --gf-card-bg: #FFFFFF;
  --gf-card-rim: #E7D5B8;
  --gf-card-lip: #D4BE9B;

  --gf-ink-dark: #3B2414;
  --gf-ink-mid: #6E4C34;
  --gf-ink-soft: #967258;

  --gf-gold-light: #FFE678;
  --gf-gold-mid: #F6B92E;
  --gf-gold-deep: #D28312;
  --gf-gold-shadow: #A15C08;

  --gf-emerald-light: #6CE478;
  --gf-emerald-mid: #28BA46;
  --gf-emerald-deep: #158D31;
  --gf-emerald-shadow: #0D6421;

  --gf-sky-light: #6DD2FF;
  --gf-sky-mid: #2B96F3;
  --gf-sky-deep: #1668C4;
  --gf-sky-shadow: #0F4B91;

  --gf-coral-light: #FF8274;
  --gf-coral-mid: #EE483B;
  --gf-coral-deep: #C5251E;
  --gf-coral-shadow: #8E1510;

  --gf-plum-light: #BC84FF;
  --gf-plum-mid: #8546E3;
  --gf-plum-deep: #6228BA;
  --gf-plum-shadow: #44168B;

  --gf-glass-bg: rgba(255, 250, 240, 0.90);
  --gf-glass-dark: rgba(34, 24, 46, 0.78);
  --gf-radius-sm: 12px;
  --gf-radius-md: 18px;
  --gf-radius-lg: 26px;
  --gf-radius-pill: 999px;
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* Base Boutique 3D Tactile Buttons */
.gf-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px solid rgba(255, 255, 255, 0.65);
  border-radius: 18px;
  padding: 11px 20px;
  font-family: var(--gf-font-ui);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: #FFFFFF;
  cursor: pointer;
  pointer-events: auto;
  text-shadow: 0 1.5px 0 rgba(0, 0, 0, 0.28);
  transition: transform 0.1s cubic-bezier(0.22, 1, 0.36, 1), filter 0.12s ease, box-shadow 0.1s ease;
  outline: none;
  white-space: nowrap;
}

.gf-btn:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.gf-btn:active:not(:disabled) {
  transform: translateY(3px);
}

.gf-btn:disabled {
  opacity: 0.52;
  cursor: default;
  filter: grayscale(0.25);
}

.gf-btn-emerald {
  background: linear-gradient(180deg, var(--gf-emerald-light) 0%, var(--gf-emerald-mid) 46%, var(--gf-emerald-deep) 100%);
  border-color: #A6F8AD;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.45),
    0 5px 0 var(--gf-emerald-shadow),
    0 9px 18px rgba(13, 100, 33, 0.32);
}
.gf-btn-emerald:active:not(:disabled) {
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.35),
    0 2px 0 var(--gf-emerald-shadow),
    0 4px 8px rgba(13, 100, 33, 0.28);
}

.gf-btn-gold {
  background: linear-gradient(180deg, var(--gf-gold-light) 0%, var(--gf-gold-mid) 50%, var(--gf-gold-deep) 100%);
  border-color: #FFF3AE;
  color: #4D2804;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.65),
    0 5px 0 var(--gf-gold-shadow),
    0 9px 18px rgba(161, 92, 8, 0.30);
}
.gf-btn-gold:active:not(:disabled) {
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.45),
    0 2px 0 var(--gf-gold-shadow),
    0 4px 8px rgba(161, 92, 8, 0.26);
}

.gf-btn-sky {
  background: linear-gradient(180deg, var(--gf-sky-light) 0%, var(--gf-sky-mid) 48%, var(--gf-sky-deep) 100%);
  border-color: #B4E9FF;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.45),
    0 5px 0 var(--gf-sky-shadow),
    0 9px 18px rgba(15, 75, 145, 0.30);
}
.gf-btn-sky:active:not(:disabled) {
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.35),
    0 2px 0 var(--gf-sky-shadow),
    0 4px 8px rgba(15, 75, 145, 0.24);
}

.gf-btn-coral {
  background: linear-gradient(180deg, var(--gf-coral-light) 0%, var(--gf-coral-mid) 48%, var(--gf-coral-deep) 100%);
  border-color: #FFC0B8;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.42),
    0 5px 0 var(--gf-coral-shadow),
    0 9px 18px rgba(142, 21, 16, 0.30);
}
.gf-btn-coral:active:not(:disabled) {
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.32),
    0 2px 0 var(--gf-coral-shadow),
    0 4px 8px rgba(142, 21, 16, 0.25);
}

.gf-btn-plum {
  background: linear-gradient(180deg, var(--gf-plum-light) 0%, var(--gf-plum-mid) 48%, var(--gf-plum-deep) 100%);
  border-color: #DFC2FF;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.42),
    0 5px 0 var(--gf-plum-shadow),
    0 9px 18px rgba(68, 22, 139, 0.30);
}
.gf-btn-plum:active:not(:disabled) {
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.32),
    0 2px 0 var(--gf-plum-shadow),
    0 4px 8px rgba(68, 22, 139, 0.24);
}

.gf-btn-cream {
  background: linear-gradient(180deg, #FFFFFF 0%, #F8EBD7 100%);
  border: 2px solid var(--gf-card-rim);
  color: var(--gf-ink-dark);
  text-shadow: none;
  box-shadow:
    inset 0 2px 0 #FFFFFF,
    0 4px 0 var(--gf-card-lip),
    0 6px 12px rgba(59, 36, 20, 0.14);
}
.gf-btn-cream:active:not(:disabled) {
  box-shadow:
    inset 0 2px 0 #FFFFFF,
    0 1.5px 0 var(--gf-card-lip),
    0 3px 6px rgba(59, 36, 20, 0.14);
}

/* Currency & Status Pills */
.gf-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px 0 8px;
  border-radius: var(--gf-radius-pill);
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.96) 0%, rgba(244, 230, 205, 0.95) 100%);
  border: 2px solid #E8D2AF;
  box-shadow:
    inset 0 1.5px 0 #FFFFFF,
    0 3px 0 rgba(168, 128, 76, 0.45),
    0 6px 14px rgba(32, 18, 6, 0.20);
  color: var(--gf-ink-dark);
  font-family: var(--gf-font-ui);
  font-weight: 700;
  font-size: 14px;
  pointer-events: auto;
}

.gf-glass {
  background: var(--gf-glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.78);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.8),
    0 8px 24px rgba(45, 24, 10, 0.18);
}

/* Pulsing Notification Badge */
.gf-badge-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #FF5E52 0%, #DA1F18 100%);
  border: 2px solid #FFFFFF;
  color: #FFFFFF;
  font-family: var(--gf-font-ui);
  font-size: 11px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(218, 31, 24, 0.45);
  animation: gfBadgePulse 1.6s ease-in-out infinite;
  pointer-events: none;
}

/* Compact Content-Fit Modal Backdrop & Dialog (ZERO Giant Empty Boxes!) */
.gf-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(28, 18, 10, 0.58);
  pointer-events: auto;
}

.gf-modal {
  position: relative;
  width: min(430px, 100%);
  height: auto;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  border-radius: 26px;
  background: linear-gradient(180deg, var(--gf-parchment) 0%, var(--gf-parchment-2) 100%);
  border: 3px solid #F6C548;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.9),
    0 7px 0 #C48118,
    0 22px 48px rgba(18, 10, 4, 0.48);
  color: var(--gf-ink-dark);
  animation: gfPopIn 0.24s cubic-bezier(0.22, 1.28, 0.36, 1);
  overflow: visible;
}

.gf-modal-ribbon {
  position: relative;
  margin: -18px auto 6px;
  padding: 8px 28px;
  min-width: 58%;
  max-width: 84%;
  text-align: center;
  border-radius: 999px;
  background: linear-gradient(180deg, #4997FA 0%, #1F68D8 55%, #164DA8 100%);
  border: 2.5px solid #FFE27A;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.42),
    0 4px 0 #0F3578,
    0 8px 16px rgba(15, 53, 120, 0.32);
  font-family: var(--gf-font-display);
  font-size: 22px;
  letter-spacing: 0.03em;
  color: #FFFFFF;
  text-shadow: 0 2px 0 rgba(10, 26, 68, 0.6);
}

.gf-modal-ribbon.ribbon-gold {
  background: linear-gradient(180deg, #FFE066 0%, #F4A91D 55%, #C8780C 100%);
  border-color: #FFF7CA;
  color: #4A2404;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.65),
    0 4px 0 #8E4F04,
    0 8px 16px rgba(142, 79, 4, 0.28);
}

.gf-modal-ribbon.ribbon-emerald {
  background: linear-gradient(180deg, #5CE069 0%, #22B241 55%, #15822C 100%);
  border-color: #D2FFD6;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    0 4px 0 #0C5A1D,
    0 8px 16px rgba(12, 90, 29, 0.28);
}

.gf-modal-ribbon.ribbon-coral {
  background: linear-gradient(180deg, #FF7D6F 0%, #E73B30 55%, #B81F18 100%);
  border-color: #FFD0CA;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.45),
    0 4px 0 #80100B,
    0 8px 16px rgba(128, 16, 11, 0.28);
}

.gf-modal-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2.5px solid #FFFFFF;
  background: linear-gradient(180deg, #FF7568 0%, #DE2C22 100%);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 3px 0 #951610, 0 6px 14px rgba(0, 0, 0, 0.28);
  transition: transform 0.1s ease;
  z-index: 3;
}
.gf-modal-close:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #951610;
}

.gf-modal-body {
  padding: 8px 18px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gf-card {
  background: var(--gf-card-bg);
  border: 2px solid var(--gf-card-rim);
  border-radius: 18px;
  padding: 12px;
  box-shadow:
    inset 0 1.5px 0 #FFFFFF,
    0 3px 0 var(--gf-card-lip);
}

.gf-card-recessed {
  background: var(--gf-parchment-recess);
  border: 1.5px solid #D9C09A;
  border-radius: 16px;
  padding: 10px;
  box-shadow: inset 0 2px 5px rgba(92, 58, 22, 0.14);
}

.gf-progress-track {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: #DFCBB0;
  border: 1.5px solid #C8B08E;
  box-shadow: inset 0 2px 3px rgba(70, 42, 16, 0.18);
  overflow: hidden;
}

.gf-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, #8CF57A 0%, #32C44B 55%, #1A9732 100%);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.55);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes gfFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes gfBadgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.13); }
}
