/* Screen-reader only — visible to crawlers/assistive tech, not display:none */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* HODL Desktop - Desktop & Icons */
#desktop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--taskbar-height);
  background:
    /* Subtle stars/particles */
    radial-gradient(1px 1px at 10% 15%, rgba(255,149,0,0.4) 50%, transparent 50%),
    radial-gradient(1px 1px at 85% 25%, rgba(0,212,255,0.3) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 45% 8%, rgba(255,149,0,0.3) 50%, transparent 50%),
    radial-gradient(1px 1px at 70% 60%, rgba(0,212,255,0.25) 50%, transparent 50%),
    radial-gradient(1px 1px at 25% 75%, rgba(255,149,0,0.2) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 90% 80%, rgba(0,212,255,0.3) 50%, transparent 50%),
    radial-gradient(1px 1px at 55% 45%, rgba(255,149,0,0.15) 50%, transparent 50%),
    radial-gradient(1px 1px at 15% 55%, rgba(0,212,255,0.2) 50%, transparent 50%),
    /* "Hills" at bottom - evoking XP Bliss */
    radial-gradient(ellipse 120% 60% at 25% 105%, rgba(255,149,0,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 100% 50% at 75% 115%, rgba(0,212,255,0.08) 0%, transparent 60%),
    /* Grid subtle texture */
    linear-gradient(rgba(255,255,255,0.01) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.01) 1px, transparent 1px),
    /* Dark gradient base */
    linear-gradient(180deg, #0d1117 0%, #161b22 40%, #0d1117 100%);
  background-size:
    300px 300px, 300px 300px, 300px 300px, 300px 300px,
    300px 300px, 300px 300px, 300px 300px, 300px 300px,
    100% 100%, 100% 100%,
    50px 50px, 50px 50px,
    100% 100%;
  overflow: hidden;
}

/* Background layer — separate from #desktop so CSS filter doesn't affect icons/windows */
#desktop-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
  pointer-events: none;
}

/* Background watermark — real DOM so rocket is clickable */
#desktop-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: clamp(18px, 6vw, 72px);
  font-weight: 700;
  color: rgba(255, 149, 0, 0.06);
  pointer-events: none;
  z-index: 0;
  letter-spacing: 2px;
  user-select: none;
  max-width: 90vw;
  text-align: center;
  line-height: 1.2;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

#desktop-watermark .watermark-rocket {
  pointer-events: auto;
  cursor: pointer;
  transition: color 0.3s, filter 0.3s, transform 0.3s;
  display: inline-block;
}

#desktop-watermark .watermark-rocket:hover {
  color: rgba(255, 149, 0, 0.5);
  filter: drop-shadow(0 0 12px rgba(255,149,0,0.6)) drop-shadow(0 0 30px rgba(255,149,0,0.3));
  transform: scale(1.2);
}

#desktop-watermark .watermark-rocket:active {
  transform: scale(1.05);
}

#desktop-icons {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px;
  max-height: calc(100vh - var(--taskbar-height) - 20px);
  z-index: var(--z-desktop);
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 72px;
  padding: 6px 4px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 3px;
  text-align: center;
  transition: background 0.1s;
}

.desktop-icon:hover {
  background: rgba(255, 149, 0, 0.12);
  border-color: rgba(255, 149, 0, 0.25);
}

.desktop-icon.selected {
  background: rgba(255, 149, 0, 0.2);
  border-color: rgba(255, 149, 0, 0.4);
}

.desktop-icon svg,
.desktop-icon img {
  width: 32px;
  height: 32px;
  filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.6));
}

.desktop-icon span {
  font-size: 11px;
  color: #fff;
  text-shadow: 1px 1px 2px #000, -1px -1px 2px #000, 1px -1px 2px #000, -1px 1px 2px #000;
  max-width: 72px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  line-height: 1.2;
}

.desktop-icon.selected span {
  -webkit-line-clamp: unset;
  overflow: visible;
}

#windows-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* Right-click context menu */
.context-menu {
  position: fixed;
  background: #fff;
  border: 1px solid #808080;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  padding: 2px 0;
  z-index: var(--z-context-menu);
  min-width: 160px;
}

.context-menu-item {
  padding: 4px 24px;
  font-size: 11px;
  font-family: var(--font-system);
  cursor: pointer;
  white-space: nowrap;
}

.context-menu-item:hover {
  background: #0a246a;
  color: #fff;
}

.context-menu-separator {
  height: 1px;
  background: #c0c0c0;
  margin: 2px 0;
}

/* Mobile: compact icons so they wrap to next column instead of overflowing */
@media (max-width: 600px) {
  #desktop-icons {
    gap: 2px;
    top: 6px;
    left: 6px;
    max-height: calc(100vh - var(--taskbar-height) - 14px);
  }

  .desktop-icon {
    width: 64px;
    padding: 4px 2px;
    gap: 2px;
  }

  .desktop-icon svg,
  .desktop-icon img {
    width: 28px;
    height: 28px;
  }

  .desktop-icon span {
    font-size: 10px;
    max-width: 60px;
    -webkit-line-clamp: 2;
  }

  .desktop-icon-emoji {
    font-size: 28px !important;
  }
}

/* ── Exchange Ticker Bar ── */
.exchange-bar {
  position: absolute;
  z-index: 1;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(15,10,0,0.7) 0%, rgba(0,0,0,0.55) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(245, 149, 0, 0.2);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4), inset 0 -1px 0 rgba(245,149,0,0.08);
}

/* ── Top position (horizontal) ── */
.exchange-bar-top {
  top: 0;
  left: 0;
  right: 0;
  height: 32px;
}

.exchange-bar-top .exchange-bar-track {
  display: flex;
  white-space: nowrap;
  animation: exchange-scroll-h 30s linear infinite;
  height: 100%;
}

.exchange-bar-top .exchange-bar-set {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.exchange-bar-top .exchange-bar-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 18px;
  height: 32px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11.5px;
  font-family: var(--font-system);
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
  border-right: 1px solid rgba(245, 149, 0, 0.08);
}

.exchange-bar-top .exchange-bar-item:hover {
  color: #f59500;
  background: rgba(245, 149, 0, 0.12);
}

.exchange-bar-top .exchange-bar-item img {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(245,149,0,0.3));
}

/* Announcement in the middle of the scroll */
.exchange-bar-top .exchange-bar-announcement {
  display: inline-flex;
  align-items: center;
  padding: 0 28px;
  height: 32px;
  white-space: nowrap;
  font-family: var(--font-system);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #f59500;
  text-shadow: 0 0 8px rgba(245,149,0,0.4), 0 0 20px rgba(245,149,0,0.15);
  border-left: 1px solid rgba(245,149,0,0.15);
  border-right: 1px solid rgba(245,149,0,0.15);
  background: linear-gradient(90deg, transparent, rgba(245,149,0,0.06) 30%, rgba(245,149,0,0.06) 70%, transparent);
}

@keyframes exchange-scroll-h {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Right position (vertical) ── */
.exchange-bar-right {
  top: 0;
  right: 0;
  bottom: 0;
  width: 36px;
  border-bottom: none;
  border-left: 1px solid rgba(245, 149, 0, 0.2);
  box-shadow: -2px 0 12px rgba(0,0,0,0.4), inset 1px 0 0 rgba(245,149,0,0.08);
}

.exchange-bar-right .exchange-bar-track {
  display: flex;
  flex-direction: column;
  animation: exchange-scroll-v 25s linear infinite;
}

.exchange-bar-right .exchange-bar-set {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.exchange-bar-right .exchange-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 4px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 8px;
  font-weight: 500;
  font-family: var(--font-system);
  letter-spacing: 0.3px;
  text-align: center;
  transition: color 0.2s, background 0.2s;
  writing-mode: horizontal-tb;
  border-bottom: 1px solid rgba(245,149,0,0.06);
}

.exchange-bar-right .exchange-bar-item:hover {
  color: #f59500;
  background: rgba(245, 149, 0, 0.12);
}

.exchange-bar-right .exchange-bar-item img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(245,149,0,0.3));
}

.exchange-bar-right .exchange-bar-announcement {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 4px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  white-space: nowrap;
  font-family: var(--font-system);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #f59500;
  text-shadow: 0 0 8px rgba(245,149,0,0.4);
  border-top: 1px solid rgba(245,149,0,0.15);
  border-bottom: 1px solid rgba(245,149,0,0.15);
  background: linear-gradient(180deg, transparent, rgba(245,149,0,0.06) 30%, rgba(245,149,0,0.06) 70%, transparent);
}

@keyframes exchange-scroll-v {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

/* ── Mobile ── */
@media (max-width: 600px) {
  .exchange-bar-top {
    height: 28px;
  }
  .exchange-bar-top .exchange-bar-item {
    padding: 0 12px;
    font-size: 10px;
    height: 28px;
    gap: 5px;
  }
  .exchange-bar-top .exchange-bar-item img {
    width: 15px;
    height: 15px;
  }
  .exchange-bar-top .exchange-bar-announcement {
    padding: 0 16px;
    font-size: 10px;
    height: 28px;
  }
  .exchange-bar-right {
    width: 30px;
  }
  .exchange-bar-right .exchange-bar-item {
    font-size: 7px;
    padding: 8px 3px;
  }
  .exchange-bar-right .exchange-bar-item img {
    width: 16px;
    height: 16px;
  }
}
