/* ── Win95 Mode ───────────────────────────────────── */

/* Toggle button (always visible) */
.win95-toggle {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 9999;
  background: #c0c0c0;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid #000;
  border-bottom: 2px solid #000;
  outline: 1px solid #808080;
  cursor: pointer;
  padding: 3px 5px;
  line-height: 0;
  display: flex;
  align-items: center;
}
.win95-toggle:active {
  border-top: 2px solid #000;
  border-left: 2px solid #000;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
}
.win95-toggle img {
  width: 20px;
  height: 20px;
  image-rendering: pixelated;
}
.win95-dismiss {
  display: none;
  position: absolute;
  top: -8px;
  right: -8px;
  width: 16px;
  height: 16px;
  background: #c0c0c0;
  border: 1px solid #808080;
  border-radius: 50%;
  font-size: 10px;
  line-height: 14px;
  text-align: center;
  cursor: pointer;
  color: #000;
  z-index: 10000;
}
.win95-toggle:hover .win95-dismiss {
  display: block;
}

/* ── When active ──────────────────────────────────── */
body.win95-mode {
  background: #008080;
  font-family: Tahoma, "MS Sans Serif", sans-serif;
  font-weight: normal;
  display: block;
  overflow: hidden;
}
body.win95-mode .sidebar { display: none; }
body.win95-mode .content-wrapper { display: none; }
body.win95-mode .win95-toggle,
body.win95-mode .win95-dismiss { display: none !important; }

@media (max-width: 1100px) {
  .win95-toggle,
  .win95-dismiss { display: none !important; }
}

/* ── Desktop ──────────────────────────────────────── */
.win95-shell { display: none; }
body.win95-mode .win95-shell {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 500;
}

.win95-desktop {
  position: absolute;
  inset: 0;
  bottom: 34px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
}

/* ── Desktop Icons ────────────────────────────────── */
.win95-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 72px;
  padding: 4px;
  cursor: default;
  user-select: none;
  text-align: center;
}
.win95-icon:hover .win95-icon-label {
  background: #000080;
  color: #fff;
}
.win95-icon-img {
  width: 64px;
  height: 64px;
  margin-bottom: 4px;
  image-rendering: pixelated;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}
.win95-icon-img img {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}
.win95-icon-label {
  font-size: 11px;
  color: #fff;
  text-shadow: 1px 1px 1px #000;
  padding: 1px 2px;
  line-height: 1.2;
}

/* ── Taskbar ──────────────────────────────────────── */
.win95-taskbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 34px;
  background: #c0c0c0;
  border-top: 2px solid #fff;
  display: flex;
  align-items: center;
  padding: 2px 4px;
  gap: 4px;
  z-index: 600;
}

.win95-start-btn {
  font-family: Tahoma, "MS Sans Serif", sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  background: #c0c0c0;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid #000;
  border-bottom: 2px solid #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  flex-shrink: 0;
}
.win95-start-btn:active,
.win95-start-btn.active {
  border-top: 2px solid #000;
  border-left: 2px solid #000;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
}
.win95-start-btn img {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}
.win95-start-logo {
  display: inline-grid;
  grid-template-columns: 7px 7px;
  grid-template-rows: 7px 7px;
  gap: 1px;
  flex-shrink: 0;
}
.win95-start-logo span:nth-child(1) { background: #ff0000; }
.win95-start-logo span:nth-child(2) { background: #00aa00; }
.win95-start-logo span:nth-child(3) { background: #0000ff; }
.win95-start-logo span:nth-child(4) { background: #ffaa00; }

.win95-taskbar-windows {
  flex: 1;
  display: flex;
  gap: 2px;
  overflow: hidden;
  min-width: 0;
}

.win95-taskbar-btn {
  font-family: Tahoma, "MS Sans Serif", sans-serif;
  font-size: 11px;
  padding: 2px 8px;
  background: #c0c0c0;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid #000;
  border-bottom: 2px solid #000;
  cursor: pointer;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  height: 26px;
  flex-shrink: 0;
}
.win95-taskbar-btn.active {
  border-top: 2px solid #000;
  border-left: 2px solid #000;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  background: #d4d0c8;
  font-weight: 700;
}

.win95-clock {
  font-size: 11px;
  padding: 2px 8px;
  height: 26px;
  display: flex;
  align-items: center;
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  flex-shrink: 0;
}

/* ── Start Menu ───────────────────────────────────── */
.win95-start-menu {
  display: none;
  position: absolute;
  bottom: 34px;
  left: 4px;
  background: #c0c0c0;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid #000;
  border-bottom: 2px solid #000;
  z-index: 700;
  min-width: 180px;
  flex-direction: row;
}
.win95-start-menu.open {
  display: flex;
}

.win95-start-sidebar {
  width: 24px;
  background: linear-gradient(to top, #000080, #1084d0);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
}
.win95-start-sidebar span {
  color: #c0c0c0;
  font-size: 14px;
  font-weight: 700;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 1px;
}

.win95-start-items {
  list-style: none;
  padding: 4px 0;
  flex: 1;
}
.win95-start-items li {
  padding: 6px 24px 6px 8px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.win95-start-items li img {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.win95-start-items li:hover {
  background: #000080;
  color: #fff;
}
.win95-start-items hr {
  border: none;
  border-top: 1px solid #808080;
  border-bottom: 1px solid #fff;
  margin: 2px 4px;
}

/* ── Window ───────────────────────────────────────── */
.win95-window {
  position: absolute;
  background: #c0c0c0;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid #000;
  border-bottom: 2px solid #000;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  min-height: 100px;
  box-shadow: 2px 2px 0 rgba(0,0,0,.3);
}

/* Resize handles */
.win95-resize {
  position: absolute;
  z-index: 1;
}
.win95-resize-e { top: 8px; right: -3px; width: 8px; bottom: 8px; cursor: e-resize; }
.win95-resize-s { bottom: -3px; left: 8px; right: 8px; height: 8px; cursor: s-resize; }
.win95-resize-se { bottom: -3px; right: -3px; width: 16px; height: 16px; cursor: se-resize; }
.win95-resize-w { top: 8px; left: -3px; width: 8px; bottom: 8px; cursor: w-resize; }
.win95-resize-n { top: -3px; left: 8px; right: 8px; height: 8px; cursor: n-resize; }
.win95-resize-nw { top: -3px; left: -3px; width: 16px; height: 16px; cursor: nw-resize; }
.win95-resize-ne { top: -3px; right: -3px; width: 16px; height: 16px; cursor: ne-resize; }
.win95-resize-sw { bottom: -3px; left: -3px; width: 16px; height: 16px; cursor: sw-resize; }

.win95-titlebar {
  background: linear-gradient(to right, #000080, #1084d0);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: default;
  user-select: none;
  flex-shrink: 0;
}
.win95-window.inactive .win95-titlebar {
  background: linear-gradient(to right, #808080, #b0b0b0);
}

.win95-titlebar-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  padding-left: 2px;
}

.win95-titlebar-controls {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.win95-titlebar-controls button {
  font-family: Tahoma, "MS Sans Serif", sans-serif;
  width: 18px;
  height: 16px;
  font-size: 10px;
  line-height: 1;
  padding: 0;
  background: #c0c0c0;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid #000;
  border-bottom: 2px solid #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.win95-titlebar-controls button:active {
  border-top: 2px solid #000;
  border-left: 2px solid #000;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
}

.win95-window-body {
  flex: 1;
  background: #fff;
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  margin: 2px;
  overflow: auto;
  padding: 12px 16px;
  font-size: 12px;
  line-height: 1.5;
  color: #000;
}
.win95-window-body a { color: #0000ff; }
.win95-window-body h1 { font-size: 16px; margin: 0 0 8px; }
.win95-window-body h2 { font-size: 14px; margin: 12px 0 6px; }
.win95-window-body h3 { font-size: 13px; margin: 8px 0 4px; }
.win95-window-body p { margin-bottom: 8px; }
.win95-window-body ul { padding-left: 20px; margin-bottom: 8px; }
.win95-window-body li { margin-bottom: 4px; }
.win95-window-body table { border-collapse: collapse; width: 100%; font-size: 11px; }
.win95-window-body th,
.win95-window-body td { padding: 2px 6px; border: 1px solid #c0c0c0; text-align: left; }
.win95-window-body th { background: #c0c0c0; font-weight: 700; }

/* tier list overrides inside win95 */
.win95-window-body .tier-list { border-color: #808080; border-radius: 0; }
.win95-window-body .tier-row { border-color: #808080; }
.win95-window-body .tier-items { border-color: #808080; }
.win95-window-body .tier-item { border-color: #c0c0c0; font-size: 11px; }
.win95-window-body .tier-label { font-size: 12px; }
.win95-window-body .grade { border-radius: 0; font-size: 10px; }
.win95-window-body .tier-table { font-size: 11px; }
.win95-window-body .tier-table th { background: #c0c0c0; border: 1px solid #808080; }
.win95-window-body .tier-table td { border: 1px solid #c0c0c0; }
.win95-window-body .tier-controls { gap: 2px; }
.win95-window-body .tier-btn {
  background: #c0c0c0;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid #000;
  border-bottom: 2px solid #000;
  border-radius: 0;
  font-family: Tahoma, "MS Sans Serif", sans-serif;
  font-size: 11px;
  color: #000;
}
/* ── Menu bar (for games etc.) ──────────────────────── */
.win95-menu-bar {
  background: #c0c0c0;
  font-size: 11px;
  padding: 2px 0;
  display: flex;
  gap: 0;
  flex-shrink: 0;
  border-bottom: 1px solid #808080;
}
.win95-menu-item {
  padding: 2px 8px;
  cursor: default;
}
.win95-menu-item:hover {
  background: #000080;
  color: #fff;
}

/* ── Game window (iframe) ──────────────────────────── */
.win95-game-body {
  padding: 0 !important;
  overflow: hidden !important;
  position: relative;
}
.win95-game-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #000;
}

/* ── Notepad-style text window ──────────────────────── */
.win95-notepad {
  font-family: "Fixedsys", "Courier New", monospace !important;
  font-size: 13px !important;
  white-space: pre !important;
  line-height: 1.3 !important;
  padding: 4px 8px !important;
}

/* ── Explorer window ───────────────────────────────── */
.win95-explorer {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
}
.win95-explorer-bar {
  font-size: 11px;
  padding: 3px 6px;
  background: #fff;
  border-bottom: 1px solid #808080;
  color: #000;
  flex-shrink: 0;
}
.win95-explorer-files {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  overflow: auto;
}
.win95-folder-icon {
  width: 80px;
}
.win95-folder-icon .win95-icon-label {
  color: #000 !important;
  text-shadow: none !important;
}
.win95-folder-icon:hover .win95-icon-label {
  background: #000080 !important;
  color: #fff !important;
}

.win95-window-body .bento { display: flex; flex-direction: column; gap: 4px; }
.win95-window-body .bento-card {
  background: #fff;
  border: 1px solid #808080;
  border-radius: 0;
  padding: 8px;
}
.win95-window-body .bento-card h3 { font-size: 12px; }
.win95-window-body .bento-card p { font-size: 11px; }
.win95-window-body .bento-emoji { font-size: 16px; margin-bottom: 4px; }

/* ── Tooltip overrides (note-toast) ────────────────── */
body.win95-mode .note-toast {
  font-family: Tahoma, "MS Sans Serif", sans-serif;
  background: #ffffe1;
  border: 1px solid #000;
  border-radius: 0;
  box-shadow: 2px 2px 0 rgba(0,0,0,.3);
  color: #000;
  font-size: 11px;
  line-height: 1.4;
  padding: 4px 6px;
  max-width: 300px;
  bottom: 42px;
  right: 8px;
  transition: none;
}
body.win95-mode .note-toast strong {
  font-family: Tahoma, "MS Sans Serif", sans-serif;
  color: #000;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 1px;
}
body.win95-mode .note-toast .note-sub {
  font-size: 11px;
  color: #000;
  line-height: 1.4;
}
body.win95-mode .note-toast .note-sub.muted {
  color: #444;
  font-size: 11px;
}
body.win95-mode .note-toast p {
  font-size: 11px;
  line-height: 1.4;
  margin: 0;
}
body.win95-mode .note-toast a {
  color: #0000ff;
}
