/* =====================================================
   WINDOWS 95: ПЛАВАЮЩИЕ ОКНА, ПАНЕЛЬ ЗАДАЧ, МЕНЮ «ПУСК»
   ===================================================== */

:root {
  --task-h: 34px;
}

body::after {
  content: "";
  display: block;
  height: var(--task-h);
}

#win-layer {
  position: fixed;
  inset: 0 0 var(--task-h) 0;
  z-index: 700;
  pointer-events: none;
}

.w95 {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  max-width: 100%;
  max-height: 100%;
  color: #000;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #000 #000 #fff;
  box-shadow: inset -1px -1px #808080, inset 1px 1px #dfdfdf, 4px 4px 0 #0008;
  font: 12px/1.3 Tahoma, "MS Sans Serif", Arial, sans-serif;
  pointer-events: auto;
}

.w95[hidden] { display: none; }

.w95.max {
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 100% !important;
  box-shadow: none;
}

.w95-title {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  margin: 2px;
  padding: 1px 2px 1px 3px;
  color: #c0c0c0;
  background: #808080;
  font-weight: bold;
  cursor: default;
  user-select: none;
  touch-action: none;
}

.w95.active .w95-title {
  color: #fff;
  background: linear-gradient(90deg, #000080, #1084d0);
}

.w95-title .icon { width: 16px; height: 16px; flex: none; image-rendering: pixelated; }
.w95-title .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.w95-btn {
  display: grid;
  place-items: center;
  width: 16px;
  height: 14px;
  padding: 0;
  color: #000;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #000 #000 #fff;
  box-shadow: inset -1px -1px #808080;
  cursor: pointer;
}

.w95-btn + .w95-btn { margin-left: 1px; }
.w95-btn.close { margin-left: 3px; }
.w95-btn:active { border-color: #000 #fff #fff #000; box-shadow: inset 1px 1px #808080; }
.w95-btn svg { width: 8px; height: 8px; fill: currentColor; shape-rendering: crispEdges; }

.w95-body {
  flex: 1;
  min-height: 0;
  margin: 0 2px 2px;
  overflow: auto;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #808080 #fff #fff #808080;
}

.w95-grip {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  touch-action: none;
  background: linear-gradient(135deg,
    transparent 45%, #808080 45% 55%, transparent 55% 68%,
    #808080 68% 78%, transparent 78%);
}

.w95.max .w95-grip { display: none; }

/* Содержимое окон */
.w95-body .cat-game-v3,
.w95-body .yarn-game-v4 {
  margin: 0;
  border: 0;
}

.w95-body canvas { max-height: 100%; }

.w95-body .player-box { margin: 0; }
.w95-body .player-label { padding: 4px 6px 0; color: #000; font: 11px Tahoma, Arial, sans-serif; }
.w95-body .player { margin: 4px; }

/* Ярлыки на «рабочем столе» (раздел «Игры») */
.desk-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px;
  background: #008080;
  border: 2px solid;
  border-color: #808080 #fff #fff #808080;
}

.desk-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 104px;
  padding: 6px 4px;
  color: #fff;
  background: none;
  border: 1px dotted transparent;
  font: 12px/1.25 Tahoma, Arial, sans-serif;
  text-align: center;
  cursor: pointer;
}

.desk-icon svg { width: 44px; height: 44px; image-rendering: pixelated; }
.desk-icon span { padding: 1px 3px; }
.desk-icon:hover, .desk-icon:focus-visible { border-color: #fff; }
.desk-icon:focus-visible span { background: #000080; }

.player-slot { margin-top: 6px; }
.player-slot .win-button { width: 100%; }

/* Панель задач */
.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 750;
  display: flex;
  align-items: stretch;
  gap: 4px;
  height: var(--task-h);
  padding: 3px 4px;
  color: #000;
  background: #c0c0c0;
  border-top: 2px solid #fff;
  box-shadow: inset 0 1px #dfdfdf;
  font: 12px Tahoma, Arial, sans-serif;
}

.task-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 0 8px;
  color: #000;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #000 #000 #fff;
  box-shadow: inset -1px -1px #808080;
  font: inherit;
  cursor: pointer;
}

.task-btn:active,
.task-btn.on {
  border-color: #000 #fff #fff #000;
  box-shadow: inset 1px 1px #808080;
}

.task-btn.on {
  background: repeating-conic-gradient(#c0c0c0 0 25%, #fff 0 50%) 0 0 / 2px 2px;
  font-weight: bold;
}

.task-btn svg { width: 16px; height: 16px; flex: none; image-rendering: pixelated; }
.task-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.start-btn { font-weight: bold; flex: none; }
.task-items { display: flex; flex: 1; gap: 3px; min-width: 0; overflow: hidden; }
.task-items .task-btn { flex: 0 1 160px; }

.tray {
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 2px solid;
  border-color: #808080 #fff #fff #808080;
}

.start-menu {
  position: fixed;
  left: 2px;
  bottom: var(--task-h);
  z-index: 760;
  display: flex;
  min-width: 220px;
  padding: 2px;
  color: #000;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #000 #000 #fff;
  box-shadow: inset -1px -1px #808080, 4px 4px 0 #0008;
  font: 12px Tahoma, Arial, sans-serif;
}

.start-menu[hidden] { display: none; }

.start-menu::before {
  content: "STAS 95";
  padding: 8px 4px;
  color: #fff;
  background: linear-gradient(0deg, #000080, #1084d0);
  font: bold 14px Tahoma, Arial, sans-serif;
  letter-spacing: 2px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.start-menu ul { flex: 1; margin: 0; padding: 0; list-style: none; }

.start-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 12px 7px 8px;
  color: inherit;
  background: none;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.start-menu button svg { width: 24px; height: 24px; image-rendering: pixelated; }
.start-menu button:hover,
.start-menu button:focus-visible { color: #fff; background: #000080; outline: 0; }
.start-menu hr { margin: 2px 4px; border: 0; border-top: 1px solid #808080; border-bottom: 1px solid #fff; }

@media (max-width: 700px) {
  .task-items .task-btn { flex-basis: 40px; }
  .task-items .task-btn span { display: none; }
  .task-btn.start-btn span { display: inline; }
}

/* =====================================================
   АДМИНКА: ЛЕВОЕ МЕНЮ С ГРУППАМИ
   ===================================================== */

.admin-window {
  display: flex;
  flex-direction: column;
  width: min(1120px, 100%);
  height: min(800px, calc(100vh - 24px));
  max-height: none;
  overflow: hidden;
}

.admin-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

.admin-nav {
  flex: 0 0 230px;
  padding: 6px 8px 10px;
  overflow-y: auto;
  background: #b4b4b4;
  border-right: 2px groove #eee;
}

.admin-nav h4 {
  margin: 12px 4px 5px;
  color: #000080;
  font: bold 11px Tahoma, Arial, sans-serif;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.admin-nav h4:first-child { margin-top: 4px; }

.admin-nav button {
  display: block;
  width: 100%;
  margin-bottom: 3px;
  text-align: left;
}

.admin-nav button.active {
  color: #000 !important;
  -webkit-text-fill-color: #000 !important;
  background: #fff !important;
  border-color: #404040 #fff #fff #404040;
  font-weight: bold;
}

.admin-layout .admin-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}

.admin-group {
  margin: 0 0 18px;
  padding: 10px 12px 2px;
  border: 2px groove #eee;
}

.admin-group legend {
  padding: 0 6px;
  color: #000080;
  font-weight: bold;
}

#textFields.admin-groups,
#imageFields.admin-groups { display: block; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.photo-card {
  display: grid;
  gap: 6px;
  padding: 6px;
  border: 2px groove #eee;
  background: #d4d4d4;
}

.photo-card img {
  width: 100%;
  height: 115px;
  object-fit: cover;
  background: #222;
  border: 2px inset #eee;
}

.photo-card input { width: 100%; min-width: 0; padding: 4px; }
.photo-card-buttons { display: flex; flex-wrap: wrap; gap: 4px; }

.link-form,
.link-item { display: grid; gap: 7px; }

.link-form input,
.link-item input { width: 100%; min-width: 0; padding: 6px; }

.link-items { display: grid; gap: 10px; }

.icon-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.icon-picker input[type="file"] { max-width: 100%; }

@media (max-width: 760px) {
  .admin-layout { flex-direction: column; }
  .admin-nav {
    flex: 0 0 auto;
    max-height: 34%;
    border-right: 0;
    border-bottom: 2px groove #eee;
  }
}

/* =====================================================
   ФОТКИ И ПОДБОРКИ ССЫЛОК НА САЙТЕ
   ===================================================== */

.link-ico {
  display: grid;
  flex: none;
  width: 32px;
  height: 32px;
  place-items: center;
}

.link-ico img { width: 32px; height: 32px; object-fit: contain; }
.link-ico svg { width: 28px; height: 28px; image-rendering: pixelated; }

.photo-viewer {
  margin: 12px 0 16px;
  background: #030305;
  border: 3px ridge #a6bdd2;
}

.photo-viewer:focus-visible { outline: 2px dashed #ffd23f; outline-offset: 3px; }

.pv-stage {
  display: block;
  width: 100%;
  height: min(430px, 62vh);
  padding: 0;
  background: #030305;
  border: 0;
  cursor: zoom-in;
}

.pv-stage img { width: 100%; height: 100%; object-fit: contain; }

.pv-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  color: #111;
  background: silver;
  font: 11px Tahoma, Arial, sans-serif;
}

.pv-caption { flex: 1; text-align: center; overflow-wrap: anywhere; }

.pv-strip {
  display: flex;
  gap: 6px;
  padding: 8px;
  overflow-x: auto;
  background: #08080c;
}

.pv-thumb {
  flex: none;
  width: 78px;
  height: 58px;
  padding: 0;
  background: #000;
  border: 2px outset #a2abc7;
  opacity: .65;
  cursor: pointer;
}

.pv-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pv-thumb.on { border: 2px solid #ffd23f; opacity: 1; }
.pv-thumb:hover { opacity: 1; }

.link-list { margin-top: 18px; display: grid; gap: 14px; }

.link-group {
  background: #09080f;
  border: 2px ridge #9b9ec1;
}

.link-group h3 {
  margin: 0;
  padding: 5px 10px;
  color: #fff;
  background: linear-gradient(90deg, #000080, #1084d0);
  font: bold 13px Tahoma, Arial, sans-serif;
}

.link-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px dotted #4b4560;
}

.link-row:last-child { border-bottom: 0; }
.link-text { min-width: 0; }

.link-text a {
  color: #8fd3ff;
  font: bold 15px "Courier New", monospace;
  overflow-wrap: anywhere;
}

.link-text a:hover { color: #ffd23f; }

.link-text p {
  margin: 3px 0 0;
  color: #baa8cb;
  font: 12px/1.45 "Courier New", monospace;
  overflow-wrap: anywhere;
}

/* =====================================================
   МУЗЫКА: КОМПАКТНЫЙ СПИСОК В ДУХЕ ПРОВОДНИКА WINDOWS 95
   ===================================================== */

.tracklist {
  margin-top: 14px;
  color: #000;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #000 #000 #fff;
  box-shadow: inset -1px -1px #808080, 4px 4px 0 #0008;
  font: 12px Tahoma, "MS Sans Serif", Arial, sans-serif;
}

.tl-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px;
  padding: 2px 6px;
  color: #fff;
  background: linear-gradient(90deg, #000080, #1084d0);
  font-weight: bold;
}

.tl-title svg { width: 16px; height: 16px; }

.tl-bar { padding: 5px 6px 0; }

.tl-bar input {
  width: 100%;
  padding: 3px 6px;
  color: #000;
  background: #fff;
  border: 2px solid;
  border-color: #808080 #fff #fff #808080;
  font: 12px Tahoma, Arial, sans-serif;
}

.tl-list {
  position: relative;
  max-height: min(330px, 52vh);
  margin: 5px 4px 4px;
  overflow-y: auto;
  background: #fff;
  border: 2px solid;
  border-color: #808080 #fff #fff #808080;
}

.tl-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 1px 6px;
  color: #000;
  background: none;
  border: 1px solid transparent;
  font: 12px/18px Tahoma, Arial, sans-serif;
  text-align: left;
  cursor: default;
}

.tl-row[hidden] { display: none; }
.tl-row:nth-child(even) { background: #f2f2f2; }
.tl-row:hover { background: #dce6ff; }
.tl-row:focus-visible { outline: 1px dotted #000; outline-offset: -2px; }

.tl-row.sel,
.tl-row.sel:hover { color: #fff; background: #000080; }

.tl-ico svg { display: block; width: 16px; height: 16px; }
.tl-num { width: 20px; color: #666; font-variant-numeric: tabular-nums; }
.tl-row.sel .tl-num { color: #cdd6ff; }
.tl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-state { flex: none; width: 10px; height: 10px; }

.tl-row.playing .tl-state {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 9px;
  border-color: transparent transparent transparent #00a000;
}

.tl-row.sel.playing .tl-state { border-left-color: #7cff4f; }

.tl-status { display: flex; gap: 4px; margin: 0 4px 4px; }

.tl-status span {
  flex: 1;
  min-width: 0;
  padding: 2px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid;
  border-color: #808080 #fff #fff #808080;
}

/* =====================================================
   НИЗ САЙТА
   ===================================================== */

.footer-collage {
  min-height: 178px;
  border-top: 3px ridge #7f8fb8;
  background:
    radial-gradient(ellipse at 9% 118%, #ffba00, #f32d0050 26%, transparent 46%),
    radial-gradient(ellipse at 91% 118%, #ff5000, #c8100040 28%, transparent 44%),
    radial-gradient(1.5px 1.5px at 7% 24%, #fff, transparent),
    radial-gradient(1px 1px at 19% 61%, #cfe, transparent),
    radial-gradient(1.5px 1.5px at 31% 18%, #fff, transparent),
    radial-gradient(1px 1px at 44% 70%, #fcf, transparent),
    radial-gradient(1.5px 1.5px at 58% 28%, #fff, transparent),
    radial-gradient(1px 1px at 69% 64%, #cff, transparent),
    radial-gradient(1.5px 1.5px at 83% 20%, #fff, transparent),
    radial-gradient(1px 1px at 94% 56%, #fec, transparent),
    linear-gradient(#050212, #190b3b 64%, #2c0f2a) !important;
}

.footer-image { height: 100%; opacity: .32; }

.footer-grid {
  min-height: 178px;
  align-items: center;
  justify-content: space-evenly;
  gap: 14px 18px;
  padding: 20px 16px 38px;
}

.footer-cat {
  width: 110px;
  height: 126px;
  padding: 4px;
  background: #e6e6e6;
  border: 2px outset #fff;
  box-shadow: 4px 5px 0 #0009;
  transform: rotate(-4deg);
}

.paper {
  position: relative;
  padding: 9px 10px;
  box-shadow: 3px 4px 0 #0009;
  transform: rotate(-5deg);
}

.paper::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 30%;
  width: 40%;
  height: 14px;
  background: #f0e9b8b8;
  border: 1px solid #ffffff60;
  transform: rotate(3deg);
}

.mini-window {
  width: 190px;
  border: 2px solid;
  border-color: #fff #000 #000 #fff;
  box-shadow: inset -1px -1px #808080, 4px 5px 0 #0009;
}

.mini-title {
  margin: 2px;
  padding: 2px 5px;
  background: linear-gradient(90deg, #000080, #1084d0);
  font-weight: bold;
}

.mini-content { padding: 14px 10px 12px; }

.mini-content .win-button { min-width: 64px; margin-top: 10px; }

.game-over { transform: rotate(-7deg); filter: drop-shadow(2px 3px 0 #000a); }

.alien-sign { transform: rotate(7deg); }

/* Строка состояния: отдельные утопленные панели, как в Windows 95 */
.statusbar {
  gap: 3px;
  padding: 2px;
  border: 0;
  border-top: 2px groove #eee;
}

.statusbar > span {
  padding: 2px 8px;
  border: 1px solid;
  border-color: #808080 #fff #fff #808080;
}

.statusbar > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 700px) {
  .footer-grid { padding-bottom: 34px; }
  .footer-cat { width: 92px; height: 106px; }
  .mini-window { width: 168px; }
  .game-over { font-size: 32px; }
  .alien-sign { font-size: 19px; padding: 16px 7px; }
}
