/* ============================================================
   WINDOW MANAGER — strawbebby228-style window chrome(Glorous King or Queen)
============================================================ */
.win {
  position: absolute;
  min-width: 280px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  z-index: 100;
  background: #fff;
  border: 3.5px solid #006dff;
  border-radius: 12px;
  box-shadow:
    0 4px 18px rgba(0, 40, 120, 0.35),
    0 1px 4px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  resize: both;
  transition: box-shadow 0.15s;
}
.win.focused {
  z-index: 200;
  border-color: #006dff;
  box-shadow:
    0 6px 28px rgba(0, 80, 200, 0.45),
    0 2px 8px rgba(0, 0, 0, 0.25);
}
.win:not(.focused) {
  border-color: #1a4a9a;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
@keyframes winOpen {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes winClose {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.85);
  }
}
.win.opening {
  animation: winOpen 0.25s ease forwards;
}
.win.closing {
  animation: winClose 0.18s ease forwards;
}

/* Title bar */
.win-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px 0 8px;
  height: 30px;
  flex-shrink: 0;
  background: linear-gradient(to bottom, #0050d8 0%, #fff 5%, #006dff 15%, #0044bb 100%);
  cursor: grab;
  user-select: none;
  border-bottom: 2px solid #ccc;
  border-radius: 8px 8px 0 0;
}
.win-bar:active {
  cursor: grabbing;
}
.win-bar-svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.92;
}
.win-title {
  font-size: 7px;
  letter-spacing: 1.5px;
  color: #fff;
  flex: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Press Start 2P", monospace;
}

/* Control buttons */
.win-btns {
  display: flex;
  align-items: center;
  gap: 0;
}
.win-btn {
  width: 20px;
  height: 20px;
  border: none;
  color: #fff;
  font-size: 15px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  border-radius: 3px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2) 0%, rgba(0, 0, 0, 0) 100%);
  box-shadow: 0 0 2px #fff4;
  margin: 3px 2px;
  transition: background-color 0.15s;
  padding: 0;
  font-family: Arial, sans-serif;
  font-weight: bold;
}
.win-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}
.win-btn.win-close {
  background: linear-gradient(to bottom, #e9121e 0%, #ff9399 15%, #e9121e 100%);
  font-size: 13px;
}
.win-btn.win-close:hover {
  background: linear-gradient(to top, #e9121e 0%, #ff9399 15%, #e9121e 100%);
}
.win-btn.win-min {
  font-size: 18px;
  padding-bottom: 3px;
}
.win-btn.win-max {
  font-size: 12px;
}

/* Window body */
.win-body {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: #0a1628;
  border-top: 2px solid #1a3a6a;
  border-radius: 0 0 8px 8px;
}
.win-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  scrollbar-width: thin;
  scrollbar-color: #006dff #071020;
  font-family: "Press Start 2P", monospace;
  background: #0a1628;
  color: #9ac8f6;
}
.win-scroll::-webkit-scrollbar {
  width: 8px;
  background: #071020;
}
.win-scroll::-webkit-scrollbar-thumb {
  background: #006dff;
  border-radius: 4px;
}
.win-scroll::-webkit-scrollbar-track {
  background: #071020;
}

/* Resize grip */
.win-resize {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  cursor: se-resize;
  z-index: 10;
  background-image: radial-gradient(circle, #006dff 1.2px, transparent 1.2px),
    radial-gradient(circle, #006dff 1.2px, transparent 1.2px), radial-gradient(circle, #006dff 1.2px, transparent 1.2px),
    radial-gradient(circle, #006dff 1.2px, transparent 1.2px), radial-gradient(circle, #006dff 1.2px, transparent 1.2px),
    radial-gradient(circle, #006dff 1.2px, transparent 1.2px);
  background-size: 5px 5px;
  background-position:
    0 0,
    5px 0,
    10px 0,
    5px 5px,
    10px 5px,
    10px 10px;
  background-repeat: no-repeat;
  opacity: 0.5;
}
.win-resize:hover {
  opacity: 1;
}
