:root {
  --bg-root: #080b12;
  --bg-sidebar: #06090f;
  --bg-surface: #0e1422;
  --bg-card: #121a2b;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --amber-glow: rgba(245, 158, 11, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at 60% 0%, #131c31 0%, #080b12 70%);
  color: #f1f5f9;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  height: 100vh;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 158, 11, 0.45);
}

.faber-card {
  background: rgba(18, 26, 43, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.faber-card:hover {
  border-color: rgba(245, 158, 11, 0.35);
}

.markdown-body pre {
  background: #06090f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0.85rem;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  color: #fde68a;
  margin: 0.6rem 0;
}

.markdown-body code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.12rem 0.35rem;
  border-radius: 0.35rem;
  font-size: 0.82em;
  color: #fcd34d;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  color: #ffffff;
  font-weight: 700;
  margin-top: 0.75rem;
  margin-bottom: 0.35rem;
}

.markdown-body ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0.4rem 0;
}


/* ============================================================
   3D HERO AVATAR & MOBA WAR STYLES (LAND OF DAWN THEME)
   ============================================================ */
.hero-3d-avatar {
  transform: perspective(600px) translateZ(10px);
  box-shadow: 
    0 8px 18px -2px rgba(0, 0, 0, 0.7),
    0 0 16px rgba(245, 158, 11, 0.35),
    inset 0 2px 4px rgba(255, 255, 255, 0.4),
    inset 0 -3px 6px rgba(0, 0, 0, 0.7);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hero-3d-avatar:hover {
  transform: perspective(600px) translateZ(22px) scale(1.08) rotate(-2deg);
  box-shadow: 
    0 14px 28px -4px rgba(0, 0, 0, 0.8),
    0 0 24px rgba(245, 158, 11, 0.7),
    inset 0 2px 5px rgba(255, 255, 255, 0.6);
}
.hero-card-war {
  position: relative;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(7, 10, 19, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
  transition: all 0.25s ease;
}
.hero-card-war:hover {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 12px 30px -5px rgba(245, 158, 11, 0.25);
  transform: translateY(-2px);
}
.hero-card-war.is-war-active {
  border-color: #fbbf24;
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.65), inset 0 0 20px rgba(245, 158, 11, 0.2);
  animation: moba-war-pulse 2s infinite alternate;
}
@keyframes moba-war-pulse {
  0% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.4), inset 0 0 10px rgba(245, 158, 11, 0.1); }
  100% { box-shadow: 0 0 40px rgba(245, 158, 11, 0.8), inset 0 0 25px rgba(245, 158, 11, 0.3); }
}
.moba-hp-bar {
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}
.moba-mana-bar {
  background: linear-gradient(90deg, #06b6d4 0%, #38bdf8 100%);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.6);
}
.war-banner-anim {
  animation: war-slam 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes war-slam {
  0% { transform: scale(1.6); opacity: 0; filter: blur(8px); }
  100% { transform: scale(1); opacity: 1; filter: blur(0); }
}

/* Virtual Office Desk Platform Styles */
.desk-platform {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.88), rgba(8, 12, 22, 0.96));
  border-color: rgba(255, 255, 255, 0.08);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.desk-platform:hover {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 10px 25px -4px rgba(245, 158, 11, 0.35);
  transform: translateY(-3px);
}
.desk-platform.is-active-work {
  border-color: #fbbf24;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.5), inset 0 0 15px rgba(245, 158, 11, 0.15);
  animation: moba-war-pulse 2s infinite alternate;
}

/* ============================================================
   MOBILE LEGENDS BATTLE COMBAT AURA & HERO WORKSTATION
   ============================================================ */
.moba-battle-card {
  position: relative;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(8, 12, 22, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  transition: all 0.3s ease;
  overflow: hidden;
}

.moba-battle-card:hover {
  border-color: rgba(245, 158, 11, 0.35);
  transform: translateY(-2px);
}

.moba-battle-card.is-combat {
  border-color: #f59e0b;
  box-shadow: 
    0 0 22px rgba(245, 158, 11, 0.6),
    0 0 45px rgba(239, 68, 68, 0.35),
    inset 0 0 15px rgba(245, 158, 11, 0.2);
  animation: mlbb-combat-border 1.6s infinite ease-in-out alternate;
}

.moba-battle-card.is-assigned {
  border-color: #38bdf8;
  box-shadow: 
    0 0 20px rgba(56, 189, 248, 0.55),
    0 0 35px rgba(245, 158, 11, 0.35),
    inset 0 0 12px rgba(56, 189, 248, 0.18);
  animation: mlbb-assigned-glow 2s infinite ease-in-out alternate;
}

@keyframes mlbb-assigned-glow {
  0% {
    border-color: #38bdf8;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.45), 0 0 25px rgba(245, 158, 11, 0.25), inset 0 0 10px rgba(56, 189, 248, 0.12);
  }
  100% {
    border-color: #fbbf24;
    box-shadow: 0 0 26px rgba(251, 191, 36, 0.65), 0 0 40px rgba(56, 189, 248, 0.35), inset 0 0 16px rgba(251, 191, 36, 0.2);
  }
}

@keyframes mlbb-combat-border {
  0% {
    border-color: #f59e0b;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.5), 0 0 30px rgba(239, 68, 68, 0.25), inset 0 0 10px rgba(245, 158, 11, 0.15);
  }
  50% {
    border-color: #ef4444;
    box-shadow: 0 0 28px rgba(239, 68, 68, 0.7), 0 0 50px rgba(245, 158, 11, 0.45), inset 0 0 18px rgba(239, 68, 68, 0.25);
  }
  100% {
    border-color: #eab308;
    box-shadow: 0 0 22px rgba(234, 179, 8, 0.65), 0 0 40px rgba(249, 115, 22, 0.4), inset 0 0 14px rgba(234, 179, 8, 0.2);
  }
}

/* Spinning Battle Skill Ring around 3D Hero Avatar */
.moba-hero-combat-ring {
  position: absolute;
  inset: -4px;
  border-radius: 9999px;
  border: 2px dashed rgba(245, 158, 11, 0.9);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.85);
  animation: mlbb-spin-skill-ring 3.5s linear infinite;
  pointer-events: none;
}

@keyframes mlbb-spin-skill-ring {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Top-Right Corner Energy Flare (Underneath text) */
.moba-battle-spark {
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.3) 0%, rgba(239, 68, 68, 0.15) 50%, transparent 75%);
  pointer-events: none;
  z-index: 1;
}

/* Protected Task Content Container (Zero Obscurity) */
.moba-task-box {
  position: relative;
  z-index: 10;
  background: rgba(6, 9, 15, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.55rem;
  backdrop-filter: blur(8px);
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

/* ============================================================
   IOS PWA & LIQUID GLASS SPECIFICATION (APPLE SF / VISIONOS)
   ============================================================ */
:root {
  --ios-safe-top: env(safe-area-inset-top, 0px);
  --ios-safe-bottom: env(safe-area-inset-bottom, 0px);
  --ios-safe-left: env(safe-area-inset-left, 0px);
  --ios-safe-right: env(safe-area-inset-right, 0px);
  --liquid-glass-bg: rgba(18, 26, 42, 0.65);
  --liquid-glass-border: rgba(255, 255, 255, 0.14);
  --liquid-glass-specular: rgba(255, 255, 255, 0.28);
}

/* Full Screen iOS Standalone Shell - STRICT NO HORIZONTAL BOUNCE / SLIDE */
html, body {
  width: 100vw;
  max-width: 100vw;
  height: 100%;
  height: -webkit-fill-available;
  overflow: hidden !important;
  overflow-x: hidden !important;
  overscroll-behavior-x: none !important;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
  position: fixed;
  inset: 0;
}

#main-stage, main {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden !important;
  overscroll-behavior-x: none !important;
}

/* Pull to Refresh Indicator */
#ios-pull-refresh {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  pointer-events: none;
  transform: translateY(-120%);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pull-refresh-pill {
  margin-top: calc(env(safe-area-inset-top, 0px) + 12px);
  padding: 8px 18px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #f59e0b;
}

/* Liquid Frosted Glass Panels */
.liquid-glass {
  background: rgba(12, 18, 30, 0.72) !important;
  backdrop-filter: blur(32px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(32px) saturate(200%) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow:
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 1px 0 rgba(0, 0, 0, 0.35),
    0 12px 36px 0 rgba(0, 0, 0, 0.45);
}

.liquid-glass-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(12, 17, 29, 0.72) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  box-shadow:
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.25),
    0 10px 28px -4px rgba(0, 0, 0, 0.5);
}

/* Tactile iOS Haptic Press */
.ios-touch-active {
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.18s ease;
}
.ios-touch-active:active {
  transform: scale(0.96);
  opacity: 0.88;
}

/* iOS Native Liquid Glass Navigation Header */
.ios-liquid-header {
  width: 100%;
  padding-top: max(calc(env(safe-area-inset-top, 0px) + 6px), 48px) !important;
  padding-bottom: 10px !important;
  min-height: max(calc(env(safe-area-inset-top, 0px) + 54px), 96px) !important;
  background: rgba(10, 16, 28, 0.74) !important;
  backdrop-filter: blur(36px) saturate(210%) !important;
  -webkit-backdrop-filter: blur(36px) saturate(210%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13) !important;
  box-shadow:
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.08),
    0 10px 30px rgba(0, 0, 0, 0.35);
}

@media (min-width: 768px) {
  .ios-liquid-header {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    min-height: 3.5rem !important;
    height: 3.5rem !important;
  }
}

/* iOS Native Liquid Glass Docked Bottom Tab Bar */
.ios-liquid-tabbar {
  position: fixed;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  transform: none !important;
  z-index: 50;
  width: 100% !important;
  max-width: 100% !important;
  height: calc(max(env(safe-area-inset-bottom, 0px), 32px) + 50px) !important;
  border-top-left-radius: 26px;
  border-top-right-radius: 26px;
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  padding-top: 6px !important;
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 32px) !important;
  padding-left: max(env(safe-area-inset-left, 0px), 16px);
  padding-right: max(env(safe-area-inset-right, 0px), 16px);
  background: rgba(10, 16, 28, 0.76) !important;
  backdrop-filter: blur(40px) saturate(220%) !important;
  -webkit-backdrop-filter: blur(40px) saturate(220%) !important;
  border-top: 0.5px solid rgba(255, 255, 255, 0.22) !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: none !important;
  box-shadow:
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.35),
    0 -12px 40px 0 rgba(0, 0, 0, 0.65);
}

/* Dynamic Island / iOS Safe Area Spacing */
.ios-safe-pt {
  padding-top: max(calc(env(safe-area-inset-top, 0px) + 8px), 48px);
}
.ios-safe-pb {
  padding-bottom: calc(max(env(safe-area-inset-bottom, 0px), 32px) + 68px);
}
