/* ==========================================================================
   Rust++ — iOS 27 Liquid Glass & Motion layer
   Loaded after apple_ios27.css. Adds materials, ambient light, spring
   motion, sliding indicators and the mobile (tab bar) layout.
   ========================================================================== */

/* ─── 1. EXTRA TOKENS ─── */
:root {
  /* iOS sheet / navigation curves */
  --ios-curve-sheet:   cubic-bezier(0.32, 0.72, 0, 1);
  --ios-curve-bounce:  cubic-bezier(0.34, 1.36, 0.64, 1);
  --ios-curve-snappy:  cubic-bezier(0.2, 0.9, 0.1, 1);

  --ios-dur-fast:      0.18s;
  --ios-dur:           0.32s;
  --ios-dur-slow:      0.55s;

  /* Liquid Glass material */
  --ios-glass-fill:    linear-gradient(180deg, rgba(255,255,255,0.055) 0%, rgba(255,255,255,0.018) 100%);
  --ios-glass-bg:      rgba(22, 22, 26, 0.62);
  --ios-glass-edge:    inset 0 1px 0 rgba(255,255,255,0.09), inset 0 -1px 0 rgba(255,255,255,0.025);
  --ios-glass-rim:     inset 0 0 0 1px rgba(255,255,255,0.06);

  --ios-focus-ring:    0 0 0 3px rgba(167, 139, 250, 0.38);
}

::selection {
  background: rgba(167, 139, 250, 0.35);
  color: #fff;
}

/* ─── 2. AMBIENT LIGHT (slow drifting aurora behind glass) ─── */
body {
  background: var(--ios-bg) !important;
}
body::before {
  content: "";
  position: fixed;
  inset: -20vmax;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(38vmax 38vmax at 18% 12%, rgba(139, 92, 246, 0.14), transparent 62%),
    radial-gradient(34vmax 34vmax at 86% 22%, rgba(96, 165, 250, 0.08), transparent 60%),
    radial-gradient(42vmax 42vmax at 62% 96%, rgba(167, 139, 250, 0.07), transparent 64%);
  filter: saturate(120%);
  animation: ios27Aurora 38s ease-in-out infinite alternate;
}
body::after {
  /* fine film grain so gradients never band */
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@keyframes ios27Aurora {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50%  { transform: translate3d(-3vmax, 2vmax, 0) rotate(8deg) scale(1.06); }
  100% { transform: translate3d(2vmax, -2vmax, 0) rotate(-6deg) scale(1.02); }
}

.app-layout {
  background: transparent !important;
  z-index: 1 !important;
}

/* ─── 3. LIQUID GLASS MATERIALS ─── */
.sidebar,
.rs-sidebar,
.top-header,
.rs-top-header {
  background: var(--ios-glass-fill), var(--ios-glass-bg) !important;
  backdrop-filter: blur(40px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(40px) saturate(190%) !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  box-shadow: var(--ios-glass-edge), 0 18px 48px rgba(0, 0, 0, 0.45) !important;
}

.header-capsule,
.rs-header-capsule,
.server-selector,
.rs-server-selector,
.subtabs-pill,
.search-bar,
.rs-search-bar {
  background: var(--ios-glass-fill), rgba(30, 30, 35, 0.55) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  box-shadow: var(--ios-glass-edge), 0 4px 14px rgba(0, 0, 0, 0.25) !important;
}

.rs-section-card,
.rs-user-card,
.device-card,
.stat-cell,
.server-card,
.search-player-card,
.ncard,
.ts-item,
.tracking-event-card,
.combat-speedo-card,
.ts-level-card,
.settings-wrap,
.rs-settings-wrap {
  box-shadow: var(--ios-glass-edge), 0 6px 22px rgba(0, 0, 0, 0.28) !important;
  transition:
    transform var(--ios-dur) var(--ios-curve-snappy),
    background-color var(--ios-dur) ease,
    border-color var(--ios-dur) ease,
    box-shadow var(--ios-dur) ease !important;
}

/* Pointer-tracked specular spotlight (coords set by ios27_motion.js) */
.ios-spot {
  --mx: 50%;
  --my: 50%;
}
.ios-spot:hover {
  background-image: radial-gradient(420px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.055), transparent 45%) !important;
  border-color: var(--ios-border-hover) !important;
}

/* Interactive cards lift gently */
.device-card:hover,
.server-card:hover,
.search-player-card:hover,
.ncard:hover,
.tracking-event-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: var(--ios-glass-edge), 0 16px 36px rgba(0, 0, 0, 0.42) !important;
}

/* ─── 4. PRESS FEEDBACK (spring scale like UIKit highlight) ─── */
button,
.nav-item,
.stab,
.cap-item.clickable,
.rm-toggle-btn,
.mode-btn,
.server-selector {
  transition:
    transform var(--ios-dur-fast) var(--ios-curve-bounce),
    background-color var(--ios-dur) ease,
    color var(--ios-dur) ease,
    border-color var(--ios-dur) ease,
    box-shadow var(--ios-dur) ease,
    opacity var(--ios-dur) ease !important;
}
button:active:not(:disabled),
.nav-item:active,
.stab:active,
.cap-item.clickable:active,
.rm-toggle-btn:active,
.mode-btn:active,
.server-selector:active {
  transform: scale(0.955) !important;
  transition-duration: 0.08s !important;
}
.device-card:active,
.server-card:active,
.search-player-card:active,
.ncard:active {
  transform: scale(0.985) !important;
  transition-duration: 0.1s !important;
}

/* Accessible focus ring */
:focus { outline: none; }
:focus-visible {
  outline: none !important;
  box-shadow: var(--ios-focus-ring) !important;
  border-radius: 12px;
}

/* Inputs glow on focus */
input[type="text"],
input[type="search"],
input[type="number"],
input[type="password"],
input:not([type]),
textarea,
select,
.rs-input {
  transition: border-color var(--ios-dur) ease, box-shadow var(--ios-dur) ease, background-color var(--ios-dur) ease !important;
  caret-color: var(--ios-accent);
}
input:focus,
textarea:focus,
select:focus,
.rs-input:focus {
  border-color: var(--ios-border-active) !important;
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.14) !important;
}
.search-bar:focus-within,
.rs-search-bar:focus-within {
  border-color: var(--ios-border-active) !important;
  box-shadow: var(--ios-glass-edge), 0 0 0 4px rgba(167, 139, 250, 0.12), 0 8px 24px rgba(0, 0, 0, 0.3) !important;
}
.search-bar input:focus,
.rs-search-bar input:focus {
  box-shadow: none !important;
}

/* ─── 5. TAB TRANSITIONS & STAGGERED ENTRANCE ─── */
.tab-content.active {
  animation: ios27TabIn var(--ios-dur-slow) var(--ios-curve-sheet) both !important;
}
@keyframes ios27TabIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); filter: blur(6px); }
  to   { opacity: 1; transform: none;                         filter: blur(0); }
}

.ios-enter {
  animation: ios27Rise 0.6s var(--ios-curve-sheet) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
@keyframes ios27Rise {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* ─── 6. SLIDING INDICATORS (nav + segmented controls) ─── */
.nav-menu.ios-has-indicator,
.subtabs-pill.ios-has-thumb {
  position: relative !important;
  isolation: isolate;
}
.ios-nav-indicator,
.ios-seg-thumb {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  pointer-events: none;
  will-change: transform, width, height;
  transition:
    transform 0.5s var(--ios-curve-bounce),
    width 0.5s var(--ios-curve-bounce),
    height 0.5s var(--ios-curve-bounce),
    opacity 0.2s ease;
}
.ios-nav-indicator {
  border-radius: var(--ios-r-btn-sm);
  background:
    linear-gradient(180deg, rgba(167, 139, 250, 0.22), rgba(139, 92, 246, 0.12));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 0 0 1px rgba(167, 139, 250, 0.22),
    0 6px 20px rgba(139, 92, 246, 0.18);
}
.ios-seg-thumb {
  border-radius: var(--ios-r-pill);
  background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.07));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), 0 3px 10px rgba(0,0,0,0.35);
}
.ios-no-anim { transition: none !important; }

.nav-menu.ios-has-indicator .nav-item.active,
.subtabs-pill.ios-has-thumb .stab.active {
  background: transparent !important;
  box-shadow: none !important;
}
.nav-menu.ios-has-indicator .nav-item::after,
.nav-menu.ios-has-indicator .nav-item::before {
  display: none !important;
}
.nav-item.active .icon {
  animation: ios27IconPop 0.45s var(--ios-curve-bounce);
}
@keyframes ios27IconPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.22); }
  100% { transform: scale(1.08); }
}

/* ─── 7. STATUS & LIVE INDICATORS ─── */
.server-dot.online,
.dot-status.online {
  animation: ios27Breathe 2.4s ease-in-out infinite;
}
@keyframes ios27Breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45); }
  50%      { box-shadow: 0 0 0 5px rgba(52, 211, 153, 0); }
}

/* Numbers in the capsule tick smoothly */
.cap-val {
  font-variant-numeric: tabular-nums;
  transition: color var(--ios-dur) ease;
}
.cap-val.ios-tick {
  animation: ios27Tick 0.45s var(--ios-curve-bounce);
}
@keyframes ios27Tick {
  0%   { transform: translateY(-40%); opacity: 0; filter: blur(2px); }
  100% { transform: none;             opacity: 1; filter: none; }
}

/* Skeleton shimmer utility */
.ios-skeleton {
  position: relative;
  overflow: hidden;
  color: transparent !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border-radius: 8px;
}
.ios-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  animation: ios27Shimmer 1.4s ease-in-out infinite;
}
@keyframes ios27Shimmer {
  to { transform: translateX(100%); }
}

/* ─── 8. SWITCHES (stretchy thumb like UISwitch) ─── */
.ios-switch-slider::before {
  transition:
    transform 0.38s var(--ios-curve-bounce),
    width 0.2s var(--ios-curve-snappy),
    background-color 0.2s ease !important;
}
.ios-switch:active .ios-switch-slider::before {
  width: 30px !important;
}
.ios-switch:active input:checked + .ios-switch-slider::before {
  transform: translateX(14px) !important;
}
.ios-switch input:checked + .ios-switch-slider {
  box-shadow: 0 0 18px rgba(167, 139, 250, 0.3) !important;
}

/* ─── 9. DRAWERS, MODALS & TOASTS ─── */
.drawer-backdrop {
  background: rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(14px) saturate(120%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(120%) !important;
  transition: opacity 0.4s var(--ios-curve-sheet) !important;
}

.drawer,
.rs-drawer {
  top: 12px !important;
  height: calc(100% - 24px) !important;
  border-radius: 28px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: var(--ios-glass-fill), rgba(20, 20, 24, 0.78) !important;
  backdrop-filter: blur(48px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(48px) saturate(200%) !important;
  box-shadow: var(--ios-glass-edge), 0 30px 80px rgba(0, 0, 0, 0.7) !important;
  overflow: hidden !important;
  right: -440px !important;
  transition: right 0.55s var(--ios-curve-sheet) !important;
}
.drawer.open,
.rs-drawer.open {
  right: 12px !important;
}
.drawer.open > * {
  animation: ios27Rise 0.5s var(--ios-curve-sheet) both;
}
.drawer.open > *:nth-child(2) { animation-delay: 60ms; }
.drawer.open > *:nth-child(3) { animation-delay: 110ms; }

.alarm-call-backdrop {
  backdrop-filter: blur(20px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(140%) !important;
  animation: ios27Fade 0.3s ease both;
}
.alarm-call-box,
#ts-modal-backdrop > * {
  animation: ios27Pop 0.5s var(--ios-curve-bounce) both;
}
@keyframes ios27Fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ios27Pop {
  from { opacity: 0; transform: scale(0.88) translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* Dynamic Island-style toasts */
.top-toast-container {
  top: 14px !important;
}
.top-toast {
  background: rgba(14, 14, 16, 0.86) !important;
  backdrop-filter: blur(30px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(30px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 26px !important;
  box-shadow: var(--ios-glass-edge), 0 18px 50px rgba(0, 0, 0, 0.6) !important;
  animation: ios27Island 0.6s var(--ios-curve-bounce) both !important;
  transform-origin: top center;
  transition: opacity 0.25s ease, transform 0.3s var(--ios-curve-sheet) !important;
}
.top-toast.alarm {
  border-color: rgba(248, 113, 113, 0.45) !important;
  box-shadow: var(--ios-glass-edge), 0 18px 50px rgba(248, 113, 113, 0.22) !important;
}
.top-toast.fade-out {
  opacity: 0 !important;
  transform: translateY(-14px) scale(0.9) !important;
}
@keyframes ios27Island {
  0%   { opacity: 0; transform: translateY(-18px) scaleX(0.42) scaleY(0.6); border-radius: 40px; }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: none; }
}

/* ─── 10. SCROLL EDGE EFFECT (content fades under glass edges) ─── */
.content-area {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 18px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 18px), transparent 100%);
  scroll-behavior: smooth;
}

/* ─── 11. TABLET ─── */
@media (max-width: 1100px) {
  .sidebar,
  .rs-sidebar {
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
  }
  .search-layout {
    flex-direction: column !important;
  }
  .search-layout > * {
    width: 100% !important;
    max-width: none !important;
  }
}

/* ─── 12. PHONE: floating Liquid Glass tab bar ─── */
@media (max-width: 768px) {
  html, body { font-size: 14px; }

  .app-layout {
    flex-direction: column !important;
    height: 100dvh !important;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 0 !important;
    gap: 10px !important;
  }

  .sidebar,
  .rs-sidebar {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    top: auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 66px !important;
    padding: 6px !important;
    border-radius: 33px !important;
    z-index: 1000 !important;
    flex-direction: row !important;
    align-items: center !important;
    overflow: hidden !important;
    background: var(--ios-glass-fill), rgba(24, 24, 28, 0.6) !important;
    backdrop-filter: blur(30px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(200%) !important;
  }
  .rs-user-card,
  .sidebar > *:not(.rs-nav-card) {
    display: none !important;
  }
  .rs-nav-card {
    flex: 1 !important;
    height: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 0 !important;
    scrollbar-width: none;
  }
  .rs-nav-card::-webkit-scrollbar { display: none; }

  .nav-menu {
    flex-direction: row !important;
    height: 100% !important;
    gap: 2px !important;
    min-width: max-content;
  }
  .nav-item {
    flex: 0 0 auto !important;
    width: 68px !important;
    height: 100% !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 3px !important;
    padding: 4px 2px !important;
    border-radius: 27px !important;
    text-align: center !important;
  }
  .nav-item .label {
    flex: 0 0 auto !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
  }
  .nav-item .icon svg {
    width: 21px !important;
    height: 21px !important;
  }
  .ios-nav-indicator {
    border-radius: 27px;
  }

  .main-wrapper {
    width: 100% !important;
    gap: 10px !important;
  }
  .content-area {
    padding: 0 0 calc(96px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .top-header,
  .rs-top-header {
    flex-wrap: nowrap !important;
    gap: 8px !important;
    padding: 8px !important;
    border-radius: 24px !important;
    overflow-x: auto !important;
    scrollbar-width: none;
  }
  .top-header::-webkit-scrollbar { display: none; }
  .server-selector,
  .header-capsule {
    flex-shrink: 0 !important;
  }
  .btn-desktop-notif { display: none !important; }

  .search-layout {
    flex-direction: column !important;
  }
  .devices-grid {
    grid-template-columns: 1fr !important;
  }

  .drawer,
  .rs-drawer {
    width: auto !important;
    left: 8px !important;
    right: 8px !important;
    top: auto !important;
    bottom: -110% !important;
    height: 82dvh !important;
    border-radius: 30px 30px 0 0 !important;
    transition: bottom 0.55s var(--ios-curve-sheet) !important;
  }
  .drawer.open,
  .rs-drawer.open {
    right: 8px !important;
    bottom: 0 !important;
  }
  .drawer::before {
    /* grabber */
    content: "";
    display: block;
    width: 38px;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.22);
    margin: 8px auto 0;
    flex-shrink: 0;
  }

  .top-toast-container {
    width: calc(100% - 24px) !important;
    top: calc(10px + env(safe-area-inset-top, 0px)) !important;
  }
}

/* ─── 14. LAYOUT ROBUSTNESS & PROFILE FIXES ─── */
html, body { overflow: hidden !important; }
.app-layout {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  height: 100dvh !important;
}
.main-wrapper, .content-area, .tab-content, .profile-view,
.profile-grid-top, .stats-grid-wrap, .combat-stats-grid, .combat-right-wrap {
  min-width: 0 !important;
  max-width: 100% !important;
}
.stats-grid-4col,
.combat-top-cards,
.combat-weapons-grid,
.resource-stats-grid {
  min-width: 0 !important;
}
.stats-grid-4col > *,
.combat-top-cards > *,
.combat-weapons-grid > * {
  min-width: 0 !important;
}
.stat-cell-title {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Empty values read as quiet placeholders, not as data */
.stat-cell-title.is-empty,
.speedo-val-center.is-empty {
  color: var(--ios-text-3) !important;
  font-weight: 600 !important;
}

/* Gauges: value sits inside the arc, never on top of it */
.speedo-val-center {
  bottom: 4px !important;
  font-size: 17px !important;
  letter-spacing: -0.02em !important;
  white-space: nowrap !important;
  padding: 0 18px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.speedo-progress {
  transition: stroke-dashoffset 1.1s var(--ios-curve-sheet), opacity 0.3s ease;
  filter: drop-shadow(0 0 6px rgba(167, 139, 250, 0.45));
}

/* Profile icon buttons: stroke icons render as outlines */
.user-profile-btns {
  display: flex !important;
  gap: 10px !important;
  justify-content: center !important;
}
.user-btn-icon {
  width: 44px !important;
  height: 44px !important;
  flex: 0 0 auto !important;
}
.user-btn-icon.is-stroke svg {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.9 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

@media (max-width: 1120px) {
  .profile-grid-top,
  .combat-stats-grid {
    grid-template-columns: 220px minmax(0, 1fr) !important;
  }
  .stats-grid-4col,
  .combat-top-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 900px) {
  .profile-grid-top,
  .combat-stats-grid {
    display: flex !important;
    flex-direction: column !important;
  }
  .combat-weapons-grid,
  .banner-row {
    grid-template-columns: 1fr !important;
    display: grid !important;
  }
  .stat-cell[style*="span 2"] { grid-column: 1 / -1 !important; }
}

/* ─── 15. MAP: glass overlays, accent, panel ─── */
#map-viewport { background: #08080A !important; }

.map-mode-pill,
.rs-map-pill {
  display: inline-flex !important;
  gap: 2px !important;
  padding: 4px !important;
  border-radius: var(--ios-r-pill) !important;
  background: var(--ios-glass-fill), rgba(22, 22, 26, 0.62) !important;
  backdrop-filter: blur(28px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: var(--ios-glass-edge), 0 10px 30px rgba(0, 0, 0, 0.45) !important;
}
.map-mode-pill .mode-btn {
  padding: 7px 16px !important;
  border-radius: var(--ios-r-pill) !important;
  border: none !important;
  background: transparent !important;
  color: var(--ios-text-2) !important;
  font-family: var(--ios-font) !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  box-shadow: none !important;
}
.map-mode-pill .mode-btn:hover { color: var(--ios-text-1) !important; }
.map-mode-pill .mode-btn.active {
  color: #fff !important;
  background: transparent !important;
}
.map-mode-pill:not(.ios-has-thumb) .mode-btn.active {
  background: rgba(167, 139, 250, 0.28) !important;
}
.map-mode-pill .ios-seg-thumb {
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.42), rgba(139, 92, 246, 0.3));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 4px 14px rgba(139, 92, 246, 0.35);
}

.map-icon-btn {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--ios-glass-fill), rgba(22, 22, 26, 0.62) !important;
  backdrop-filter: blur(28px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: var(--ios-glass-edge), 0 8px 24px rgba(0, 0, 0, 0.4) !important;
  color: var(--ios-text-1) !important;
  cursor: pointer !important;
}
.map-icon-btn:hover { color: var(--ios-accent) !important; }
.map-icon-btn svg {
  width: 19px !important;
  height: 19px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
}

#map-coord-text {
  bottom: 104px !important;
  background: rgba(22, 22, 26, 0.7) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border-radius: var(--ios-r-pill) !important;
  color: var(--ios-text-2) !important;
  font-family: var(--ios-font-mono) !important;
  font-size: 11.5px !important;
  box-shadow: var(--ios-glass-edge) !important;
}
#map-tooltip {
  background: rgba(22, 22, 26, 0.86) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border-radius: 14px !important;
  box-shadow: var(--ios-glass-edge), 0 12px 30px rgba(0, 0, 0, 0.5) !important;
  font-family: var(--ios-font) !important;
}

#rustmaps-panel {
  left: 12px !important;
  right: 12px !important;
  bottom: 12px !important;
  border-radius: 22px !important;
  overflow: hidden !important;
  background: var(--ios-glass-fill), rgba(20, 20, 24, 0.66) !important;
  backdrop-filter: blur(32px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(32px) saturate(190%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: var(--ios-glass-edge), 0 14px 40px rgba(0, 0, 0, 0.5) !important;
}
#rustmaps-panel > div {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-top: none !important;
}
#rustmaps-panel > div + div {
  border-top: 1px solid var(--ios-divider) !important;
}
#rustmaps-status {
  color: var(--ios-text-2) !important;
  font-family: var(--ios-font) !important;
  font-size: 12px !important;
}
#rustmaps-panel button:not(.rm-toggle-btn) {
  border-radius: var(--ios-r-pill) !important;
  background: rgba(255, 255, 255, 0.07) !important;
  border: 1px solid var(--ios-border) !important;
  color: var(--ios-text-1) !important;
  padding: 4px 12px !important;
  font-family: var(--ios-font) !important;
}
#rustmaps-toggles {
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  scrollbar-width: none;
}
#rustmaps-toggles::-webkit-scrollbar { display: none; }
#rustmaps-toggles .rm-toggle-btn { flex-shrink: 0 !important; }

@media (max-width: 768px) {
  #tab-map { margin: 0 !important; height: calc(100dvh - 190px) !important; border-radius: 24px; overflow: hidden; }
  .map-overlay-center { top: 10px !important; max-width: calc(100% - 70px); left: 10px !important; transform: none !important; }
  .map-mode-pill .mode-btn { padding: 6px 11px !important; font-size: 11.5px !important; }
  .map-overlay-tr { top: 10px !important; right: 10px !important; }
  #map-coord-text { display: none !important; }
  #rustmaps-panel { left: 8px !important; right: 8px !important; bottom: 8px !important; }
}

/* ─── 16. ACTIVITY PROFILE & WIPE STATS ─── */
.act-card {
  background: var(--ios-glass-fill), var(--ios-surface-1);
  border: 1px solid var(--ios-border);
  border-radius: var(--ios-r-card);
  padding: 18px 20px;
  box-shadow: var(--ios-glass-edge), 0 6px 22px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.act-tz { font-weight: 500; color: var(--ios-text-3); text-transform: none; letter-spacing: 0; margin-left: 6px; }
.act-empty { align-items: flex-start; gap: 6px; }
.act-empty-title { font-size: 15px; font-weight: 700; color: var(--ios-text-1); }
.act-empty-sub { font-size: 13px; color: var(--ios-text-2); max-width: 560px; }

.act-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.act-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: var(--ios-r-pill);
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--ios-border);
  font-size: 12.5px; font-weight: 600; color: var(--ios-text-1);
}
.act-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--ios-text-3); }
.act-chip.on { background: var(--ios-green-tint); border-color: rgba(52, 211, 153, 0.3); color: #A7F3D0; }
.act-chip.on i { background: var(--ios-green); animation: ios27Breathe 2.4s ease-in-out infinite; }
.act-chip.off i { background: var(--ios-text-3); }
.act-chip.sleep { background: var(--ios-accent-tint); border-color: rgba(167, 139, 250, 0.3); color: #DDD6FE; }

.act-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 22px; }
.act-block { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.act-block-title { font-size: 12px; font-weight: 700; color: var(--ios-text-2); text-transform: uppercase; letter-spacing: 0.05em; }
.act-block-title small { font-weight: 500; color: var(--ios-text-3); text-transform: none; letter-spacing: 0; margin-left: 4px; }

.act-bars { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; height: 120px; align-items: end; }
.act-bar { height: 100%; display: flex; align-items: flex-end; border-radius: 6px; position: relative; }
.act-bar.sleep { background: rgba(167, 139, 250, 0.07); }
.act-bar-fill {
  width: 100%; border-radius: 5px;
  background: linear-gradient(180deg, #C4B5FD, #8B5CF6);
  transform-origin: bottom;
  animation: ios27BarGrow 0.8s var(--ios-curve-sheet) both;
}
.act-bar:nth-child(3n) .act-bar-fill { animation-delay: 40ms; }
.act-bar:nth-child(3n+1) .act-bar-fill { animation-delay: 80ms; }
.act-bar.sleep .act-bar-fill { background: rgba(255, 255, 255, 0.18); }
.act-bar.now::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: var(--ios-accent);
}
@keyframes ios27BarGrow { from { transform: scaleY(0); opacity: 0; } to { transform: none; opacity: 1; } }
.act-bar-labels { display: grid; grid-template-columns: repeat(24, 1fr); font-size: 10px; color: var(--ios-text-3); font-variant-numeric: tabular-nums; margin-top: 4px; }

.act-heat { display: flex; flex-direction: column; gap: 3px; }
.act-heat-row { display: grid; grid-template-columns: 22px repeat(24, 1fr); gap: 2px; align-items: center; }
.act-heat-day { font-size: 10.5px; color: var(--ios-text-3); font-weight: 600; }
.act-heat-row.today .act-heat-day { color: var(--ios-accent); }
.act-heat-row i {
  display: block; aspect-ratio: 1; border-radius: 3px;
  background: rgba(167, 139, 250, calc(0.06 + var(--v) * 0.94));
}

.act-sessions { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.act-session {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.04);
  font-size: 12px; color: var(--ios-text-2); font-variant-numeric: tabular-nums;
}
.act-session span:last-child { color: var(--ios-text-1); font-weight: 600; }

.ws-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.ws-title { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; color: var(--ios-text-1); }
.ws-sub { font-size: 13px; color: var(--ios-text-2); margin-top: 2px; }
.ws-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.ws-kpi {
  background: var(--ios-glass-fill), var(--ios-surface-1); border: 1px solid var(--ios-border);
  border-radius: var(--ios-r-card-sm); padding: 16px 18px; box-shadow: var(--ios-glass-edge);
}
.ws-kpi-val { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; color: var(--ios-text-1); font-variant-numeric: tabular-nums; }
.ws-kpi-label { font-size: 12px; color: var(--ios-text-3); margin-top: 2px; }
.ws-grid-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.ws-list { display: flex; flex-direction: column; gap: 6px; }
.ws-row {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 10px 12px; border-radius: 16px; transition: background var(--ios-dur) ease;
}
.ws-row:hover { background: rgba(255, 255, 255, 0.04); }
.ws-rank {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: #0B0B0E; background: var(--c);
  box-shadow: 0 0 16px color-mix(in srgb, var(--c) 40%, transparent);
}
.ws-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ws-name { font-size: 14px; font-weight: 700; color: var(--ios-text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-online { font-size: 11px; font-weight: 600; color: #A7F3D0; background: var(--ios-green-tint); padding: 2px 8px; border-radius: 999px; margin-left: 6px; }
.ws-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.ws-bar > div { height: 100%; border-radius: 3px; animation: ios27BarX 0.9s var(--ios-curve-sheet) both; transform-origin: left; }
@keyframes ios27BarX { from { transform: scaleX(0); } to { transform: none; } }
.ws-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-grid { font-size: 11px; font-weight: 600; color: #FECACA; background: var(--ios-red-tint); padding: 2px 8px; border-radius: 999px; font-family: var(--ios-font-mono); }
.ws-muted { font-size: 11.5px; color: var(--ios-text-3); }
.ws-nums { text-align: right; }
.ws-time { font-size: 15px; font-weight: 700; color: var(--ios-text-1); font-variant-numeric: tabular-nums; }
.ws-deaths { font-size: 12px; color: var(--ios-text-2); }
.ws-map-wrap { width: 100%; border-radius: 18px; overflow: hidden; background: #0B0B0E; aspect-ratio: 1; }
.ws-map-wrap canvas { display: block; }
.ws-legend { display: flex; flex-wrap: wrap; gap: 10px; }
.ws-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ios-text-2); }
.ws-legend-item i { width: 9px; height: 9px; border-radius: 50%; }

@media (max-width: 1000px) {
  .act-grid, .ws-grid-2 { grid-template-columns: 1fr; }
  .ws-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ─── 13. ACCESSIBILITY: reduced motion / transparency ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  body::before { animation: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .sidebar, .rs-sidebar, .top-header, .rs-top-header, .drawer, .rs-drawer, .top-toast {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: var(--ios-surface-1) !important;
  }
}
