/* ═══════════════════════════════════════════════════════════════
   Desktop surface — Academy City terminal
   ═══════════════════════════════════════════════════════════════ */

body {
  position: relative;
  z-index: 0;
  background:
    radial-gradient(circle at 70% 8%, rgba(31, 54, 88, 0.32), transparent 34%),
    linear-gradient(165deg, #050a13 0%, #091321 52%, #050a12 100%);
  transition: background var(--transition-slow) var(--ease-smooth);
}

#desktop {
  position: fixed;
  inset: 0;
  z-index: auto;
  background: transparent;
}

/* ─── Icon area on the academy panel ─── */
#desktop-icons {
  position: absolute;
  top: 0;
  left: 0;
  width: 250px;
  height: calc(100% - var(--taskbar-height));
  padding: 28px 24px;
  z-index: 3;
}

.desktop-icon {
  position: absolute;
  width: 92px;
  min-height: 82px;
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-rows: 42px;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.desktop-icon::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 5px;
  width: 2px;
  height: 0;
  background: var(--p3r-cyan);
  box-shadow: 0 0 12px rgba(64, 200, 224, 0.75);
  transition: height 180ms ease;
}

.desktop-icon:hover,
.desktop-icon.selected {
  background: linear-gradient(90deg, rgba(7, 13, 25, 0.55), rgba(7, 13, 25, 0.08));
  border-color: rgba(255, 243, 215, 0.16);
  transform: translateX(5px);
}

.desktop-icon:hover::before,
.desktop-icon.selected::before { height: 54px; }

.desktop-icon .icon-image {
  position: relative;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(12% 0, 100% 0, 86% 100%, 0 100%);
  background: rgba(7, 13, 25, 0.76);
  color: var(--shokuhou-gold);
  font: 700 12px/1 'Consolas', monospace;
  letter-spacing: 0.08em;
  box-shadow: inset 0 0 0 1px rgba(255, 231, 184, 0.18);
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.desktop-icon:hover .icon-image,
.desktop-icon.selected .icon-image {
  color: #fff;
  background: rgba(11, 26, 43, 0.9);
  box-shadow: inset 0 0 0 1px rgba(64, 200, 224, 0.52), 0 0 18px rgba(64, 200, 224, 0.16);
}

.desktop-icon .icon-label {
  color: rgba(255, 250, 235, 0.95);
  font-size: 12px;
  line-height: 1.25;
  text-align: left;
  word-break: keep-all;
  text-shadow: 0 2px 8px rgba(54, 24, 0, 0.72);
  white-space: nowrap;
}

#selection-rect {
  position: absolute;
  border: 1px solid rgba(64, 200, 224, 0.65);
  background: rgba(64, 200, 224, 0.08);
  box-shadow: inset 0 0 18px rgba(64, 200, 224, 0.07);
  z-index: 70;
  pointer-events: none;
  display: none;
}

.mental-scan-pulse {
  position: fixed;
  z-index: 96;
  width: 24px;
  height: 24px;
  border: 1px solid var(--p3r-cyan);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: mental-scan-expand 1050ms cubic-bezier(.16,.82,.26,1) forwards;
}
.mental-scan-pulse::before,
.mental-scan-pulse::after {
  content: '';
  position: absolute;
  inset: 50%;
  border: 1px solid rgba(242,198,109,0.66);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: mental-scan-ring 900ms ease-out 80ms forwards;
}
.mental-scan-pulse::after { animation-delay: 220ms; }
@keyframes mental-scan-expand {
  to { width: 270px; height: 270px; opacity: 0; }
}
@keyframes mental-scan-ring {
  to { width: 150px; height: 150px; opacity: 0; }
}

@media (max-width: 760px) {
  #desktop-icons { width: 200px; padding-left: 12px; }
  .desktop-icon { width: 82px; grid-template-columns: 36px 1fr; gap: 6px; }
  .desktop-icon .icon-image { width: 36px; height: 36px; }
  .desktop-icon .icon-label { font-size: 10px; }
}
