/*
 * Retro Desktop Portfolio - Windows 95/98 Style
 * Author: Cihan Asci
 * Course: INST0007 Web Technologies
 */

/* ==========================================================================
   1. CSS Variables & Reset
   ========================================================================== */

:root {
  /* Windows 95/98 Colors */
  --win-bg: #008080;
  --win-gray: #c0c0c0;
  --win-gray-dark: #808080;
  --win-gray-light: #dfdfdf;
  --win-white: #ffffff;
  --win-black: #000000;
  --win-blue: #000080;
  --win-blue-light: #1084d0;
  --win-titlebar: linear-gradient(90deg, #000080, #1084d0);
  --win-titlebar-inactive: linear-gradient(90deg, #808080, #b0b0b0);

  /* Fonts */
  --font-system: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-pixel: 'Courier New', Courier, monospace;

  /* Spacing */
  --taskbar-height: 30px;
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-system);
  font-size: 11px;
  background: var(--win-bg);
  color: var(--win-black);
  user-select: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==========================================================================
   2. Desktop
   ========================================================================== */

.desktop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--taskbar-height);
  background: var(--win-bg);
  background-image: url('../assets/wallpaper.png');
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

/* Desktop Icons */
.desktop-icons {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px 16px;
  padding: 16px;
  height: calc(100% - 32px);
  max-width: 300px;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 75px;
  height: 70px;
  padding: 6px 4px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
}

.desktop-icon:hover {
  background: rgba(0, 0, 128, 0.3);
}

.desktop-icon:focus {
  background: rgba(0, 0, 128, 0.5);
  border: 1px dotted var(--win-white);
  outline: none;
}

.desktop-icon__img {
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
  image-rendering: pixelated;
}

.desktop-icon__label {
  font-size: 11px;
  color: var(--win-white);
  text-align: center;
  text-shadow: 1px 1px 1px var(--win-black);
  word-wrap: break-word;
  max-width: 100%;
}

/* ==========================================================================
   3. Windows
   ========================================================================== */

.window {
  position: absolute;
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--win-gray-light) var(--win-gray-dark) var(--win-gray-dark) var(--win-gray-light);
  box-shadow: 1px 1px 0 var(--win-black);
  display: flex;
  flex-direction: column;
  min-width: 200px;
  min-height: 100px;
}

.window--hidden {
  display: none;
}

.window--minimized {
  display: none;
}

.window--maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: calc(100vh - var(--taskbar-height)) !important;
  transform: none !important;
}

.window--active {
  z-index: 100;
}

/* Window Titlebar */
.window__titlebar {
  display: flex;
  align-items: center;
  height: 20px;
  padding: 2px 3px;
  background: var(--win-titlebar);
  color: var(--win-white);
  font-weight: bold;
  font-size: 11px;
  cursor: move;
}

.window:not(.window--active) .window__titlebar {
  background: var(--win-titlebar-inactive);
}

.window__titlebar-icon {
  width: 16px;
  height: 16px;
  margin-right: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.window__titlebar-icon img,
.window__titlebar-icon svg {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

.window__title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window__controls {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.window__btn {
  width: 16px;
  height: 14px;
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--win-gray-light) var(--win-gray-dark) var(--win-gray-dark) var(--win-gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: bold;
  cursor: pointer;
}

.window__btn:active {
  border-color: var(--win-gray-dark) var(--win-gray-light) var(--win-gray-light) var(--win-gray-dark);
}

.window__btn--minimize::before {
  content: '';
  width: 8px;
  height: 2px;
  background: var(--win-black);
  margin-top: 6px;
}

.window__btn--maximize::before {
  content: '';
  width: 9px;
  height: 8px;
  border: 1px solid var(--win-black);
  border-top-width: 2px;
}

.window__btn--close::before {
  content: '×';
  font-size: 14px;
  line-height: 1;
  margin-top: -2px;
}

/* Window Menubar */
.window__menubar {
  display: flex;
  background: var(--win-gray);
  padding: 2px 0;
  border-bottom: 1px solid var(--win-gray-dark);
}

.window__menu-item {
  padding: 2px 8px;
  cursor: pointer;
}

.window__menu-item:hover {
  background: var(--win-blue);
  color: var(--win-white);
}

/* Window Toolbar */
.window__toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px;
  background: var(--win-gray);
  border-bottom: 1px solid var(--win-gray-dark);
}

.toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 2px 4px;
  background: var(--win-gray);
  border: 1px solid transparent;
}

.toolbar-btn:not(:disabled):hover {
  border-color: var(--win-gray-light) var(--win-gray-dark) var(--win-gray-dark) var(--win-gray-light);
}

.toolbar-btn:not(:disabled):active {
  border-color: var(--win-gray-dark) var(--win-gray-light) var(--win-gray-light) var(--win-gray-dark);
}

.toolbar-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.toolbar-btn img,
.toolbar-icon {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

.toolbar-btn--text {
  padding: 2px 8px;
}

.toolbar-separator {
  width: 2px;
  height: 20px;
  margin: 0 4px;
  border-left: 1px solid var(--win-gray-dark);
  border-right: 1px solid var(--win-white);
}

.toolbar-address {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.toolbar-address--wide {
  flex: 1;
}

.toolbar-address__label {
  font-size: 11px;
}

.toolbar-address__input {
  flex: 1;
  padding: 2px 4px;
  background: var(--win-white);
  border: 2px solid;
  border-color: var(--win-gray-dark) var(--win-gray-light) var(--win-gray-light) var(--win-gray-dark);
  font-family: var(--font-system);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Window Content */
.window__content {
  flex: 1;
  overflow: auto;
  background: var(--win-white);
  border: 2px solid;
  border-color: var(--win-gray-dark) var(--win-gray-light) var(--win-gray-light) var(--win-gray-dark);
  margin: 2px;
}

/* Window Statusbar */
.window__statusbar {
  display: flex;
  justify-content: space-between;
  padding: 2px 4px;
  background: var(--win-gray);
  border-top: 1px solid var(--win-gray-dark);
  font-size: 11px;
}

.window__statusbar span {
  padding: 1px 4px;
  border: 1px solid;
  border-color: var(--win-gray-dark) var(--win-white) var(--win-white) var(--win-gray-dark);
}

/* ==========================================================================
   4. Window Content Types
   ========================================================================== */

/* Notepad */
.window__content--notepad {
  background: var(--win-white);
  padding: 4px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.4;
}

.notepad-text {
  font-family: inherit;
  font-size: inherit;
  white-space: pre-wrap;
}

/* Terminal */
.window__content--terminal {
  background: var(--win-black);
  color: #c0c0c0;
  padding: 4px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.3;
}

.terminal-text {
  font-family: inherit;
  font-size: inherit;
  white-space: pre-wrap;
}

/* Explorer */
.window__content--explorer {
  background: var(--win-white);
  padding: 8px;
}

.explorer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.explorer-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
}

.explorer-item:hover {
  background: rgba(0, 0, 128, 0.1);
}

.explorer-item:focus {
  background: var(--win-blue);
  color: var(--win-white);
  outline: none;
}

.explorer-item__icon {
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
  image-rendering: pixelated;
}

.explorer-item__name {
  font-size: 11px;
  word-wrap: break-word;
  max-width: 100%;
}

/* About */
.window__content--about {
  background: var(--win-gray);
  padding: 12px;
  overflow-y: auto;
}

.about-card {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--win-white);
  border: 2px solid;
  border-color: var(--win-gray-dark) var(--win-gray-light) var(--win-gray-light) var(--win-gray-dark);
}

.about-card__avatar {
  width: 80px;
  height: 80px;
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--win-gray-dark) var(--win-gray-light) var(--win-gray-light) var(--win-gray-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.about-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-card__info {
  flex: 1;
}

.about-card__name {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 4px;
}

.about-card__role {
  color: var(--win-gray-dark);
  margin-bottom: 8px;
}

.detail-row {
  display: flex;
  gap: 8px;
  margin-bottom: 2px;
  font-size: 11px;
}

.detail-label {
  font-weight: bold;
  min-width: 60px;
}

.about-section {
  margin-bottom: 12px;
}

.section-header {
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 4px;
  padding: 2px 4px;
  background: var(--win-gray);
}

.inset-panel {
  padding: 8px;
  background: var(--win-white);
  border: 2px solid;
  border-color: var(--win-gray-dark) var(--win-gray-light) var(--win-gray-light) var(--win-gray-dark);
  font-size: 11px;
  line-height: 1.5;
}

.inset-panel p {
  margin-bottom: 8px;
}

.inset-panel p:last-child {
  margin-bottom: 0;
}

.inset-panel h3 {
  font-size: 11px;
  margin: 8px 0 4px;
}

.inset-panel h3:first-child {
  margin-top: 0;
}

.inset-panel ul {
  margin-left: 16px;
  list-style: disc;
}

.inset-panel li {
  margin-bottom: 2px;
}

.text-muted {
  color: var(--win-gray-dark);
}

/* Mail */
.window__content--mail {
  background: var(--win-gray);
  padding: 0;
}

.mail-form {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.mail-field {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  border-bottom: 1px solid var(--win-gray-dark);
}

.mail-field__label {
  width: 60px;
  font-weight: bold;
  font-size: 11px;
}

.mail-field__input {
  flex: 1;
  padding: 2px 4px;
  border: 2px solid;
  border-color: var(--win-gray-dark) var(--win-gray-light) var(--win-gray-light) var(--win-gray-dark);
  font-family: var(--font-system);
  font-size: 11px;
}

.mail-body {
  flex: 1;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
}

.mail-body__textarea {
  flex: 1;
  min-height: 120px;
  padding: 4px;
  border: 2px solid;
  border-color: var(--win-gray-dark) var(--win-gray-light) var(--win-gray-light) var(--win-gray-dark);
  font-family: var(--font-system);
  font-size: 11px;
  resize: none;
}

.mail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--win-gray);
  border-top: 1px solid var(--win-gray-dark);
}

.mail-success {
  color: #008000;
  font-weight: bold;
}

/* Help */
.window__content--help {
  display: flex;
  background: var(--win-gray);
}

.help-sidebar {
  width: 140px;
  border-right: 2px solid;
  border-color: var(--win-gray-dark) var(--win-gray-light) var(--win-gray-light) var(--win-gray-dark);
  background: var(--win-white);
}

.help-sidebar__header {
  padding: 4px 8px;
  background: var(--win-gray);
  font-weight: bold;
  border-bottom: 1px solid var(--win-gray-dark);
}

.help-sidebar__list {
  list-style: none;
}

.help-sidebar__item {
  padding: 4px 8px;
  cursor: pointer;
}

.help-sidebar__item:hover {
  background: var(--win-blue);
  color: var(--win-white);
}

.help-sidebar__item--active {
  background: var(--win-blue);
  color: var(--win-white);
}

.help-content {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
}

.help-content__title {
  font-size: 14px;
  margin-bottom: 8px;
}

/* Help Panels */
.help-panel {
  display: none;
}

.help-panel--active {
  display: block;
}

/* Browser */
.window__content--browser {
  padding: 0;
  background: var(--win-white);
}

.browser-frame {
  width: 100%;
  height: 100%;
  border: none;
}

/* ==========================================================================
   5. Taskbar
   ========================================================================== */

.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--taskbar-height);
  background: var(--win-gray);
  border-top: 2px solid var(--win-gray-light);
  display: flex;
  align-items: center;
  padding: 2px 2px;
  z-index: 1000;
}

/* Start Button */
.start-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  height: 22px;
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--win-gray-light) var(--win-gray-dark) var(--win-gray-dark) var(--win-gray-light);
  font-weight: bold;
  font-size: 11px;
}

.start-btn:active,
.start-btn.active {
  border-color: var(--win-gray-dark) var(--win-gray-light) var(--win-gray-light) var(--win-gray-dark);
}

.start-btn__icon {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

.start-btn__text {
  font-weight: bold;
}

.taskbar__divider {
  width: 2px;
  height: 22px;
  margin: 0 4px;
  border-left: 1px solid var(--win-gray-dark);
  border-right: 1px solid var(--win-white);
}

/* Taskbar Windows */
.taskbar__windows {
  display: flex;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
}

.taskbar__window-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  height: 22px;
  min-width: 120px;
  max-width: 180px;
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--win-gray-light) var(--win-gray-dark) var(--win-gray-dark) var(--win-gray-light);
  font-size: 11px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.taskbar__window-btn--active {
  border-color: var(--win-gray-dark) var(--win-gray-light) var(--win-gray-light) var(--win-gray-dark);
  background: linear-gradient(180deg, var(--win-gray) 0%, var(--win-gray-light) 100%);
}

.taskbar__window-btn img,
.taskbar__window-icon {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.taskbar__window-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* System Tray */
.taskbar__tray {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  height: 22px;
  margin-left: auto;
  border: 2px solid;
  border-color: var(--win-gray-dark) var(--win-gray-light) var(--win-gray-light) var(--win-gray-dark);
}

.tray-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tray-icon img,
.tray-icon svg {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

.taskbar__clock {
  font-size: 11px;
  padding: 0 4px;
}

/* ==========================================================================
   6. Start Menu
   ========================================================================== */

.start-menu {
  position: fixed;
  bottom: var(--taskbar-height);
  left: 0;
  display: flex;
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--win-gray-light) var(--win-gray-dark) var(--win-gray-dark) var(--win-gray-light);
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 1001;
}

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

.start-menu__sidebar {
  width: 24px;
  background: var(--win-gray-dark);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 8px 4px;
}

.start-menu__brand {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: var(--win-gray-light);
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 1px;
}

.start-menu__content {
  display: flex;
  flex-direction: column;
  min-width: 180px;
  padding: 2px;
}

.start-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: transparent;
  border: none;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.start-menu__item:hover {
  background: var(--win-blue);
  color: var(--win-white);
}

.start-menu__icon {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

.start-menu__divider {
  height: 1px;
  margin: 2px 4px;
  background: var(--win-gray-dark);
  border-bottom: 1px solid var(--win-white);
}

/* ==========================================================================
   7. Buttons
   ========================================================================== */

.btn-retro {
  padding: 4px 16px;
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--win-gray-light) var(--win-gray-dark) var(--win-gray-dark) var(--win-gray-light);
  font-family: var(--font-system);
  font-size: 11px;
  cursor: pointer;
}

.btn-retro:active {
  border-color: var(--win-gray-dark) var(--win-gray-light) var(--win-gray-light) var(--win-gray-dark);
}

.btn-retro:focus {
  outline: 1px dotted var(--win-black);
  outline-offset: -4px;
}

/* ==========================================================================
   8. Scrollbars (Retro Style)
   ========================================================================== */

::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}

::-webkit-scrollbar-track {
  background: repeating-conic-gradient(var(--win-gray-light) 0% 25%, var(--win-white) 0% 50%) 50% / 2px 2px;
}

::-webkit-scrollbar-thumb {
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--win-gray-light) var(--win-gray-dark) var(--win-gray-dark) var(--win-gray-light);
}

::-webkit-scrollbar-button {
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--win-gray-light) var(--win-gray-dark) var(--win-gray-dark) var(--win-gray-light);
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   9. Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
  .desktop-icons {
    padding: 8px;
    gap: 4px;
  }

  .desktop-icon {
    width: 60px;
  }

  .desktop-icon__img {
    width: 24px;
    height: 24px;
  }

  .desktop-icon__label {
    font-size: 10px;
  }

  .window {
    min-width: 280px;
  }

  .window--maximized {
    width: 100% !important;
    height: calc(100vh - var(--taskbar-height)) !important;
    top: 0 !important;
    left: 0 !important;
  }

  .taskbar__window-btn {
    min-width: 40px;
    max-width: 100px;
  }

  .taskbar__window-btn span {
    display: none;
  }

  .start-menu__content {
    min-width: 160px;
  }

  .explorer-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  }
}

@media (max-width: 480px) {
  .desktop-icons {
    padding: 4px;
  }

  .desktop-icon {
    width: 50px;
  }

  .desktop-icon__label {
    font-size: 9px;
  }

  .window__toolbar {
    flex-wrap: wrap;
  }

  .toolbar-address {
    order: 10;
    width: 100%;
    margin-top: 4px;
  }
}

/* ==========================================================================
   10. Resize Handles
   ========================================================================== */

.window__resize {
  position: absolute;
  background: transparent;
}

.window__resize--e {
  right: -4px;
  top: 0;
  width: 8px;
  height: 100%;
  cursor: e-resize;
}

.window__resize--s {
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 8px;
  cursor: s-resize;
}

.window__resize--se {
  right: -4px;
  bottom: -4px;
  width: 16px;
  height: 16px;
  cursor: se-resize;
}

/* ==========================================================================
   11. Animations
   ========================================================================== */

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.terminal-text::after {
  content: '_';
  animation: blink 1s infinite;
}

/* ==========================================================================
   12. Boot Sequence
   ========================================================================== */

.booting .desktop,
.booting .taskbar,
.booting .start-menu {
  display: none !important;
}

.boot-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

body:not(.booting) .boot-screen {
  display: none;
}

.boot-bios {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px;
  display: flex;
  align-items: flex-start;
}

.boot-bios__text {
  color: #aaa;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre;
}

.boot-bios--hidden {
  display: none;
}

.boot-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.boot-loading--active {
  display: flex;
}

.boot-logo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: 80px;
  height: 80px;
  animation: bootPulse 1.5s ease-in-out infinite;
}

.boot-logo__flag {
  border-radius: 2px;
}

.boot-logo__flag--red { background: #ff0000; }
.boot-logo__flag--green { background: #00ff00; }
.boot-logo__flag--blue { background: #0000ff; }
.boot-logo__flag--yellow { background: #ffff00; }

@keyframes bootPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.boot-text {
  color: #fff;
  font-size: 14px;
  font-family: var(--font-system);
}

.boot-progress {
  width: 300px;
  height: 20px;
  background: #333;
  border: 2px solid #555;
  padding: 2px;
}

.boot-progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #000080, #1084d0);
  transition: width 0.1s linear;
}

.boot-hint {
  color: #888;
  font-size: 11px;
  font-style: italic;
}

/* ==========================================================================
   13. CRT Effect
   ========================================================================== */

.crt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 9000;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.1) 0px,
      rgba(0, 0, 0, 0.1) 1px,
      transparent 1px,
      transparent 2px
    );
}

.crt-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.15) 100%);
}

/* ==========================================================================
   14. Screensaver
   ========================================================================== */

.screensaver {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  z-index: 8000;
  display: none;
  cursor: none;
}

.screensaver--active {
  display: flex;
}

.screensaver__logo {
  position: absolute;
  padding: 20px 30px;
  background: linear-gradient(135deg, #ff0000, #00ff00, #0000ff, #ffff00);
  background-size: 400% 400%;
  animation: rainbowBg 3s ease infinite, bounce 10s linear infinite;
  border-radius: 4px;
}

.screensaver__text {
  font-size: 32px;
  font-weight: bold;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  font-family: 'Impact', sans-serif;
}

@keyframes rainbowBg {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes bounce {
  0% { top: 10%; left: 10%; }
  25% { top: 60%; left: 80%; }
  50% { top: 80%; left: 20%; }
  75% { top: 20%; left: 70%; }
  100% { top: 10%; left: 10%; }
}

/* ==========================================================================
   15. BSOD
   ========================================================================== */

.bsod {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #0000aa;
  z-index: 9500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.bsod--active {
  display: flex;
}

.bsod__content {
  color: #fff;
  font-family: 'Courier New', monospace;
  font-size: 16px;
  line-height: 1.6;
  max-width: 600px;
}

.bsod__content h1 {
  background: #aaa;
  color: #0000aa;
  display: inline-block;
  padding: 2px 12px;
  margin-bottom: 20px;
  font-size: 16px;
}

/* ==========================================================================
   16. Clippy Assistant
   ========================================================================== */

.clippy {
  position: fixed;
  bottom: 60px;
  right: 20px;
  z-index: 500;
  display: none;
}

.clippy--active {
  display: block;
  animation: clippyBounce 0.5s ease;
}

@keyframes clippyBounce {
  0% { transform: translateY(100px); opacity: 0; }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0); opacity: 1; }
}

.clippy__bubble {
  background: #ffffcc;
  border: 2px solid #000;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
  max-width: 200px;
  position: relative;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.clippy__bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 30px;
  border: 5px solid transparent;
  border-top-color: #000;
}

.clippy__close {
  position: absolute;
  top: 4px;
  right: 8px;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #666;
}

.clippy__close:hover {
  color: #000;
}

#clippy-text {
  font-size: 11px;
  line-height: 1.4;
  margin: 0;
}

.clippy__character {
  display: flex;
  justify-content: flex-end;
  padding-right: 20px;
}

.clippy__body {
  width: 50px;
  height: 70px;
  background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
  border: 2px solid #666;
  border-radius: 25px 25px 15px 15px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 15px;
  gap: 8px;
}

.clippy__eye {
  width: 8px;
  height: 12px;
  background: #000;
  border-radius: 50%;
  position: relative;
  animation: clippyBlink 3s infinite;
}

.clippy__eye::after {
  content: '';
  position: absolute;
  width: 3px;
  height: 3px;
  background: #fff;
  border-radius: 50%;
  top: 2px;
  left: 2px;
}

@keyframes clippyBlink {
  0%, 90%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}

.clippy__eyebrow {
  position: absolute;
  width: 10px;
  height: 3px;
  background: #666;
  top: 10px;
  border-radius: 2px;
}

.clippy__eyebrow--left { left: 10px; transform: rotate(-10deg); }
.clippy__eyebrow--right { right: 10px; transform: rotate(10deg); }

/* ==========================================================================
   17. Context Menu
   ========================================================================== */

.context-menu {
  position: fixed;
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--win-gray-light) var(--win-gray-dark) var(--win-gray-dark) var(--win-gray-light);
  box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  min-width: 180px;
  z-index: 2000;
  display: none;
  padding: 2px;
}

.context-menu--active {
  display: block;
}

.context-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px 24px 4px 8px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 11px;
}

.context-menu__item:hover {
  background: var(--win-blue);
  color: var(--win-white);
}

.context-menu__icon {
  width: 16px;
  text-align: center;
}

.context-menu__divider {
  height: 1px;
  margin: 2px 4px;
  background: var(--win-gray-dark);
  border-bottom: 1px solid var(--win-white);
}

/* ==========================================================================
   18. Properties Window
   ========================================================================== */

.window__content--properties {
  background: var(--win-gray);
  padding: 0;
  display: flex;
  flex-direction: column;
}

.properties-tabs {
  display: flex;
  padding: 4px 4px 0;
  gap: 2px;
}

.properties-tab {
  padding: 4px 12px;
  background: var(--win-gray);
  border: 1px solid var(--win-gray-dark);
  border-bottom: none;
  cursor: pointer;
  font-size: 11px;
}

.properties-tab--active {
  background: var(--win-gray);
  position: relative;
  border-color: var(--win-gray-dark) var(--win-gray-dark) var(--win-gray);
  z-index: 1;
}

.properties-content {
  background: var(--win-gray);
  border: 1px solid var(--win-gray-dark);
  margin: 0 4px 4px;
  padding: 16px;
  flex: 1;
}

.properties-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.properties-logo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  width: 60px;
  height: 60px;
}

.properties-logo__flag {
  border-radius: 2px;
}

.properties-logo__flag--red { background: #ff0000; }
.properties-logo__flag--green { background: #00ff00; }
.properties-logo__flag--blue { background: #0000ff; }
.properties-logo__flag--yellow { background: #ffff00; }

.properties-brand h2 {
  font-size: 18px;
  margin: 0;
}

.properties-brand p {
  margin: 2px 0;
  font-size: 11px;
}

.properties-divider {
  height: 1px;
  background: var(--win-gray-dark);
  border-bottom: 1px solid var(--win-white);
  margin: 12px 0;
}

.properties-specs {
  font-size: 11px;
}

.spec-row {
  display: flex;
  margin-bottom: 4px;
}

.spec-label {
  width: 100px;
  flex-shrink: 0;
}

.spec-value {
  flex: 1;
}

.properties-footer {
  margin-top: 16px;
  text-align: right;
}

/* Properties Panels (tabs content) */
.properties-panel {
  display: none;
  background: var(--win-gray);
  border: 1px solid var(--win-gray-dark);
  margin: 0 4px 4px;
  padding: 16px;
}

.properties-panel--active {
  display: block;
}

.properties-section-title {
  font-size: 12px;
  margin: 0 0 12px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--win-gray-dark);
}

/* Hardware List */
.hardware-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hardware-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: var(--win-white);
  border: 1px solid var(--win-gray-dark);
}

.hardware-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.hardware-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
}

.hardware-info strong {
  font-size: 11px;
}

.hardware-info span {
  color: var(--win-gray-dark);
}

/* Performance Meters */
.performance-meters {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.performance-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.performance-label {
  width: 120px;
  font-size: 11px;
  flex-shrink: 0;
}

.performance-bar {
  flex: 1;
  height: 16px;
  background: var(--win-white);
  border: 2px solid;
  border-color: var(--win-gray-dark) var(--win-gray-light) var(--win-gray-light) var(--win-gray-dark);
}

.performance-fill {
  height: 100%;
  background: linear-gradient(180deg, #00aa00, #008800);
}

.performance-fill--warning {
  background: linear-gradient(180deg, #ffaa00, #cc8800);
}

.performance-fill--danger {
  background: linear-gradient(180deg, #00aa00, #008800);
}

.performance-fill--insanity {
  background: linear-gradient(90deg, #ff0000, #ff00ff, #0000ff, #00ffff, #00ff00, #ffff00, #ff0000);
  background-size: 200% 100%;
  animation: insanityPulse 1s linear infinite;
}

@keyframes insanityPulse {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.performance-value--insanity {
  color: #ff0000;
  animation: insanityText 0.5s ease infinite alternate;
}

@keyframes insanityText {
  0% { color: #ff0000; transform: scale(1); }
  100% { color: #ff00ff; transform: scale(1.1); }
}

.performance-value {
  width: 40px;
  font-size: 11px;
  text-align: right;
  font-weight: bold;
}

/* ==========================================================================
   19. Game Window
   ========================================================================== */

.window__content--game {
  background: #000;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-container {
  position: relative;
}

#snake-canvas {
  display: block;
  background: #000;
  border: 2px solid #333;
}

.game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
}

.game-overlay--hidden {
  display: none;
}

.game-overlay h3 {
  font-size: 32px;
  margin: 0;
}

.game-overlay p {
  margin: 0;
  font-size: 12px;
  color: #aaa;
}

.game-score {
  position: absolute;
  top: 10px;
  right: 10px;
  color: #0f0;
  font-family: 'Courier New', monospace;
  font-size: 14px;
}

/* ==========================================================================
   20. Recycle Bin
   ========================================================================== */

.recycle-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  gap: 8px;
  color: var(--win-gray-dark);
}

.recycle-empty svg {
  opacity: 0.5;
}

.recycle-empty p {
  margin: 0;
  font-size: 11px;
}

/* Recycle bin now flows with other icons */

/* ==========================================================================
   21. Wallpaper Picker
   ========================================================================== */

.window__content--wallpaper {
  background: var(--win-gray);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wallpaper-preview {
  height: 120px;
  background: var(--win-bg);
  border: 2px solid;
  border-color: var(--win-gray-dark) var(--win-gray-light) var(--win-gray-light) var(--win-gray-dark);
}

.wallpaper-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 150px;
  overflow-y: auto;
  background: var(--win-white);
  border: 2px solid;
  border-color: var(--win-gray-dark) var(--win-gray-light) var(--win-gray-light) var(--win-gray-dark);
  padding: 2px;
}

.wallpaper-option {
  padding: 4px 8px;
  background: none;
  border: 1px solid transparent;
  text-align: left;
  cursor: pointer;
  font-size: 11px;
}

.wallpaper-option:hover {
  background: var(--win-blue);
  color: var(--win-white);
}

.wallpaper-option--active {
  background: var(--win-blue);
  color: var(--win-white);
}

.wallpaper-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Matrix wallpaper pattern */
.desktop--matrix {
  background: #000 !important;
  position: relative;
  overflow: hidden;
}

.desktop--matrix::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    repeating-linear-gradient(
      180deg,
      transparent 0px,
      rgba(0, 255, 0, 0.03) 2px,
      transparent 4px
    );
  animation: matrixRain 20s linear infinite;
}

@keyframes matrixRain {
  0% { background-position: 0 0; }
  100% { background-position: 0 1000px; }
}

/* Clouds wallpaper pattern */
.desktop--clouds {
  background: linear-gradient(180deg, #87ceeb 0%, #e0f4ff 100%) !important;
}

/* ==========================================================================
   22. Konami Code Easter Egg
   ========================================================================== */

.konami-message {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.konami-content {
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--win-gray-light) var(--win-gray-dark) var(--win-gray-dark) var(--win-gray-light);
  padding: 32px;
  text-align: center;
  animation: popIn 0.3s ease;
}

@keyframes popIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.konami-content h1 {
  font-size: 24px;
  margin: 0 0 16px;
  color: var(--win-blue);
}

.konami-content p {
  margin: 8px 0;
}

.party-mode {
  animation: partyColors 0.5s infinite;
}

@keyframes partyColors {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

.confetti {
  position: fixed;
  top: -10px;
  width: 10px;
  height: 10px;
  z-index: 10001;
  animation: confettiFall 3s linear forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ==========================================================================
   23. Glitch Effect for Boot
   ========================================================================== */

.boot-bios__text {
  position: relative;
}

.boot-logo:hover {
  animation: glitchLogo 0.3s ease;
}

@keyframes glitchLogo {
  0%, 100% { transform: translate(0); filter: none; }
  20% { transform: translate(-2px, 2px); filter: hue-rotate(90deg); }
  40% { transform: translate(2px, -2px); filter: hue-rotate(180deg); }
  60% { transform: translate(-2px, -2px); filter: hue-rotate(270deg); }
  80% { transform: translate(2px, 2px); filter: hue-rotate(360deg); }
}

/* ==========================================================================
   24. Desktop Icon Hover Effects
   ========================================================================== */

.desktop-icon:active {
  transform: scale(0.95);
}

.desktop-icon__img {
  transition: transform 0.1s ease;
}

.desktop-icon:hover .desktop-icon__img {
  transform: scale(1.1);
}

/* ==========================================================================
   25. Window Open Animation
   ========================================================================== */

.window:not(.window--hidden):not(.window--minimized) {
  animation: windowOpen 0.15s ease-out;
}

@keyframes windowOpen {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ==========================================================================
   26. Taskbar Button Hover
   ========================================================================== */

.taskbar__window-btn:hover:not(.taskbar__window-btn--active) {
  background: linear-gradient(180deg, var(--win-gray-light) 0%, var(--win-gray) 100%);
}

.start-btn:hover:not(.active) {
  background: linear-gradient(180deg, var(--win-gray-light) 0%, var(--win-gray) 100%);
}

/* ==========================================================================
   27. Explorer Item Animations
   ========================================================================== */

.explorer-item {
  transition: transform 0.1s ease, background 0.1s ease;
}

.explorer-item:active {
  transform: scale(0.95);
}

/* ==========================================================================
   28. Signature Cursor Trail (optional toggle)
   ========================================================================== */

.cursor-trail {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--win-blue);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.5;
  animation: trailFade 0.5s ease-out forwards;
}

@keyframes trailFade {
  to {
    opacity: 0;
    transform: scale(0);
  }
}

/* ==========================================================================
   29. Tray Popups (Easter Eggs)
   ========================================================================== */

.tray-icon--clickable {
  cursor: pointer;
}

.tray-icon--clickable:hover {
  background: rgba(255, 255, 255, 0.2);
}

.taskbar__clock {
  cursor: pointer;
}

.taskbar__clock:hover {
  background: rgba(255, 255, 255, 0.1);
}

.tray-popup {
  position: fixed;
  bottom: calc(var(--taskbar-height) + 4px);
  right: 4px;
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--win-gray-light) var(--win-gray-dark) var(--win-gray-dark) var(--win-gray-light);
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
  min-width: 200px;
  z-index: 1002;
  animation: popupSlide 0.2s ease;
}

.tray-popup--hidden {
  display: none;
}

@keyframes popupSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tray-popup__header {
  background: var(--win-titlebar);
  color: white;
  padding: 4px 8px;
  font-weight: bold;
  font-size: 11px;
}

.tray-popup__content {
  padding: 12px;
  font-size: 11px;
}

.tray-popup__content p {
  margin: 4px 0;
}

/* ==========================================================================
   30. Recycle Bin Items
   ========================================================================== */

.recycle-items {
  padding: 8px;
}

.recycle-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  margin-bottom: 4px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 11px;
}

.recycle-item:hover {
  background: rgba(0, 0, 128, 0.1);
}

.recycle-item:focus {
  background: var(--win-blue);
  color: var(--win-white);
  outline: none;
}

.recycle-item__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  opacity: 0.6;
}

.recycle-item__name {
  font-size: 11px;
}

/* ==========================================================================
   31. Start Menu Secret
   ========================================================================== */

.start-menu__secret {
  display: none;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: var(--win-gray-light);
  font-size: 8px;
  opacity: 0.7;
  margin-top: 8px;
}

.start-menu__sidebar:hover .start-menu__secret {
  display: block;
  animation: secretReveal 0.3s ease;
}

.start-menu__sidebar:hover .start-menu__brand {
  display: none;
}

@keyframes secretReveal {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.7;
  }
}

/* ==========================================================================
   32. Responsive Design
   ========================================================================== */

/* Tablet styles (768px and below) */
@media screen and (max-width: 768px) {
  :root {
    --taskbar-height: 40px;
  }

  /* Desktop icons in a row on tablets */
  .desktop-icons {
    flex-direction: row;
    flex-wrap: wrap;
    align-content: flex-start;
    max-width: 100%;
    height: auto;
    padding: 12px;
    gap: 8px;
  }

  .desktop-icon {
    width: 70px;
    height: 75px;
  }

  .desktop-icon__img {
    width: 40px;
    height: 40px;
  }

  .desktop-icon__label {
    font-size: 10px;
  }

  /* Windows take full width on tablets */
  .window {
    width: 95% !important;
    max-width: 600px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    top: 5% !important;
    max-height: 80vh;
  }

  .window--maximized {
    width: 100% !important;
    height: calc(100% - var(--taskbar-height)) !important;
    max-width: 100% !important;
    max-height: 100% !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
  }

  /* Larger touch targets */
  .window__btn {
    width: 20px;
    height: 18px;
  }

  .toolbar-btn {
    min-width: 36px;
    min-height: 32px;
    padding: 6px;
  }

  /* Start menu */
  .start-menu {
    width: 280px;
  }

  .start-menu__item {
    padding: 10px 12px;
  }

  /* Taskbar */
  .taskbar {
    height: var(--taskbar-height);
  }

  .start-btn {
    padding: 4px 12px;
  }

  .taskbar__clock {
    padding: 0 12px;
    font-size: 12px;
  }

  /* Explorer grid */
  .explorer-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }

  /* Terminal text */
  .terminal-text {
    font-size: 10px;
  }

  /* Notepad text */
  .notepad-text {
    font-size: 10px;
  }

  /* Hide Clippy on tablets */
  .clippy {
    display: none !important;
  }

  /* Boot screen */
  .boot-bios__text {
    font-size: 10px;
  }

  .boot-logo {
    font-size: 16px;
  }
}

/* Mobile styles (480px and below) */
@media screen and (max-width: 480px) {
  :root {
    --taskbar-height: 48px;
  }

  body {
    font-size: 12px;
  }

  /* Desktop icons grid for mobile */
  .desktop-icons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 8px;
    max-width: 100%;
  }

  .desktop-icon {
    width: 100%;
    height: auto;
    min-height: 70px;
    padding: 8px 4px;
  }

  .desktop-icon__img {
    width: 36px;
    height: 36px;
  }

  .desktop-icon__label {
    font-size: 9px;
    text-align: center;
    word-break: break-word;
  }

  /* Windows are nearly full screen on mobile */
  .window {
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    top: 0 !important;
    height: calc(100vh - var(--taskbar-height)) !important;
    max-height: calc(100vh - var(--taskbar-height)) !important;
    border-radius: 0;
  }

  .window__titlebar {
    padding: 6px 8px;
  }

  .window__title {
    font-size: 12px;
  }

  .window__btn {
    width: 24px;
    height: 22px;
  }

  .window__controls {
    gap: 4px;
  }

  /* Hide minimize button on mobile - only close */
  .window__btn--minimize,
  .window__btn--maximize {
    display: none;
  }

  .window__content {
    padding: 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Toolbar adjustments */
  .window__toolbar {
    flex-wrap: wrap;
    padding: 4px;
    gap: 4px;
  }

  .toolbar-btn {
    min-width: 40px;
    min-height: 36px;
  }

  .toolbar-address {
    flex: 1 1 100%;
    order: 10;
  }

  .toolbar-address__input {
    font-size: 11px;
  }

  /* Start menu full width on mobile */
  .start-menu {
    width: 100%;
    left: 0;
    bottom: var(--taskbar-height);
    max-height: 70vh;
  }

  .start-menu__sidebar {
    width: 40px;
    padding: 8px 4px;
  }

  .start-menu__brand {
    font-size: 10px;
  }

  .start-menu__item {
    padding: 12px 10px;
    font-size: 13px;
  }

  .start-menu__icon {
    width: 28px;
    height: 28px;
  }

  /* Taskbar */
  .taskbar {
    height: var(--taskbar-height);
  }

  .start-btn {
    padding: 8px 16px;
    font-size: 13px;
  }

  .start-btn__icon {
    width: 20px;
    height: 20px;
  }

  .taskbar__windows {
    display: none; /* Hide taskbar windows on mobile */
  }

  .taskbar__clock {
    padding: 0 16px;
    font-size: 13px;
  }

  .tray-icon {
    width: 28px;
    height: 28px;
  }

  /* Explorer grid 2 columns on mobile */
  .explorer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px;
  }

  .explorer-item {
    padding: 12px 8px;
  }

  .explorer-item__icon {
    width: 36px;
    height: 36px;
  }

  .explorer-item__name {
    font-size: 11px;
  }

  /* About card */
  .about-card {
    flex-direction: column;
    text-align: center;
  }

  .about-card__avatar {
    margin-bottom: 12px;
  }

  /* Mail form */
  .mail-field__label {
    width: 50px;
  }

  .mail-field__input {
    font-size: 14px;
    padding: 8px;
  }

  .mail-body__textarea {
    min-height: 120px;
    font-size: 14px;
  }

  /* Terminal/notepad text smaller */
  .terminal-text {
    font-size: 9px;
    line-height: 1.3;
  }

  .notepad-text {
    font-size: 9px;
    line-height: 1.3;
  }

  /* Hide Clippy on mobile */
  .clippy {
    display: none !important;
  }

  /* Context menu */
  .context-menu {
    width: 200px;
  }

  .context-menu__item {
    padding: 10px 12px;
    font-size: 13px;
  }

  /* Tray popups */
  .tray-popup {
    width: calc(100% - 16px);
    right: 8px;
    left: 8px;
  }

  /* Boot screen */
  .boot-bios__text {
    font-size: 8px;
    padding: 8px;
  }

  .boot-logo {
    font-size: 12px;
    padding: 4px;
  }

  .boot-loading__text {
    font-size: 14px;
  }

  /* Properties tabs */
  .properties-tab {
    padding: 6px 10px;
    font-size: 11px;
  }

  /* Hardware list */
  .hardware-item {
    padding: 8px;
  }

  .hardware-icon {
    width: 28px;
    height: 28px;
  }

  /* Game canvas */
  #game-canvas {
    max-width: 100%;
    height: auto !important;
  }

  .game-container {
    padding: 8px;
  }

  /* Help window */
  .help-sidebar {
    width: 100px;
  }

  .help-sidebar__item {
    padding: 8px 6px;
    font-size: 10px;
  }

  /* Recycle items */
  .recycle-item {
    padding: 10px 8px;
  }

  .recycle-item__icon {
    width: 28px;
    height: 28px;
  }

  .recycle-item__name {
    font-size: 12px;
  }

  /* Wallpaper picker */
  .wallpaper-options {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Konami message */
  .konami-content {
    padding: 20px;
    margin: 16px;
  }

  .konami-content h1 {
    font-size: 18px;
  }
}

/* Small mobile (360px and below) */
@media screen and (max-width: 360px) {
  .desktop-icons {
    grid-template-columns: repeat(3, 1fr);
  }

  .desktop-icon__label {
    font-size: 8px;
  }

  .start-menu__sidebar {
    display: none;
  }

  .start-menu__content {
    width: 100%;
  }

  .terminal-text,
  .notepad-text {
    font-size: 8px;
  }

  .boot-bios__text {
    font-size: 7px;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .desktop-icon {
    min-height: 80px;
  }

  .window__btn {
    width: 28px;
    height: 26px;
  }

  .toolbar-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .start-menu__item {
    min-height: 48px;
  }

  .explorer-item {
    min-height: 80px;
  }

  .recycle-item {
    min-height: 48px;
  }

  .context-menu__item {
    min-height: 44px;
  }

  /* Disable hover effects that don't work on touch */
  .desktop-icon:hover {
    background: transparent;
  }

  .desktop-icon:active {
    background: rgba(0, 0, 128, 0.3);
  }

  /* Remove drag cursor hints */
  .window__titlebar {
    cursor: default;
  }
}

/* Landscape mobile */
@media screen and (max-width: 768px) and (orientation: landscape) {
  .desktop-icons {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    max-height: calc(100vh - var(--taskbar-height) - 16px);
    overflow-y: auto;
  }

  .window {
    max-height: 90vh !important;
  }

  .start-menu {
    max-height: 80vh;
  }
}

/* Print styles */
@media print {
  .boot-screen,
  .taskbar,
  .start-menu,
  .clippy,
  .context-menu,
  .screensaver {
    display: none !important;
  }

  .desktop {
    position: static;
    background: white;
  }

  .window {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
    page-break-inside: avoid;
  }

  .window--hidden {
    display: block !important;
  }
}

/* ==========================================================================
   33. Winamp Music Player
   ========================================================================== */

.window__titlebar--winamp {
  background: linear-gradient(180deg, #3a3a3a 0%, #1a1a1a 100%);
}

.winamp-display {
  background: #000;
  padding: 8px;
  border: 2px solid;
  border-color: #1a1a1a #4a4a4a #4a4a4a #1a1a1a;
  margin: 4px;
}

.winamp-visualizer {
  height: 40px;
  background: #000;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding: 4px;
  margin-bottom: 8px;
}

.winamp-visualizer-bar {
  width: 4px;
  background: linear-gradient(180deg, #00ff00, #ffff00, #ff0000);
  transition: height 0.1s ease;
}

.winamp-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.winamp-title {
  color: #00ff00;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.winamp-time {
  color: #00ff00;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  margin-left: 8px;
}

.winamp-progress {
  height: 8px;
  background: #1a1a1a;
  border: 1px solid #333;
  cursor: pointer;
}

.winamp-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(180deg, #00cc00, #009900);
  transition: width 0.1s linear;
}

.winamp-controls {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  background: #2a2a2a;
}

.winamp-btn {
  width: 32px;
  height: 20px;
  background: linear-gradient(180deg, #4a4a4a, #2a2a2a);
  border: 1px solid;
  border-color: #5a5a5a #1a1a1a #1a1a1a #5a5a5a;
  color: #ccc;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.winamp-btn:hover {
  background: linear-gradient(180deg, #5a5a5a, #3a3a3a);
}

.winamp-btn:active {
  border-color: #1a1a1a #5a5a5a #5a5a5a #1a1a1a;
}

.winamp-btn--active {
  background: linear-gradient(180deg, #3a3a3a, #1a1a1a);
  color: #00ff00;
}

.winamp-playlist {
  background: #1a1a2a;
  border: 2px solid;
  border-color: #1a1a1a #4a4a4a #4a4a4a #1a1a1a;
  margin: 0 4px;
  max-height: 100px;
  overflow-y: auto;
}

.winamp-track {
  padding: 2px 8px;
  color: #00ff00;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  cursor: pointer;
}

.winamp-track:hover {
  background: #2a2a3a;
}

.winamp-track--active {
  background: #000080;
  color: #fff;
}

.winamp-volume {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: #2a2a2a;
  color: #ccc;
  font-size: 10px;
}

.winamp-volume input[type="range"] {
  flex: 1;
  height: 8px;
  -webkit-appearance: none;
  background: #1a1a1a;
  border: 1px solid #333;
}

.winamp-volume input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 16px;
  background: linear-gradient(180deg, #4a4a4a, #2a2a2a);
  border: 1px solid #5a5a5a;
  cursor: pointer;
}

/* ==========================================================================
   34. Minesweeper
   ========================================================================== */

.window__content--minesweeper {
  background: var(--win-gray);
  padding: 8px;
}

.minesweeper-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background: var(--win-gray);
  border: 3px solid;
  border-color: var(--win-gray-dark) var(--win-gray-light) var(--win-gray-light) var(--win-gray-dark);
  margin-bottom: 8px;
}

.minesweeper-counter {
  background: #000;
  color: #f00;
  font-family: 'Courier New', monospace;
  font-size: 20px;
  font-weight: bold;
  padding: 2px 4px;
  min-width: 50px;
  text-align: center;
  border: 2px solid;
  border-color: var(--win-gray-dark) var(--win-gray-light) var(--win-gray-light) var(--win-gray-dark);
}

.minesweeper-face {
  width: 32px;
  height: 32px;
  background: var(--win-gray);
  border: 3px solid;
  border-color: var(--win-gray-light) var(--win-gray-dark) var(--win-gray-dark) var(--win-gray-light);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.minesweeper-face:active {
  border-color: var(--win-gray-dark) var(--win-gray-light) var(--win-gray-light) var(--win-gray-dark);
}

.minesweeper-grid {
  display: grid;
  grid-template-columns: repeat(9, 20px);
  gap: 0;
  border: 3px solid;
  border-color: var(--win-gray-dark) var(--win-gray-light) var(--win-gray-light) var(--win-gray-dark);
  background: var(--win-gray);
}

.minesweeper-cell {
  width: 20px;
  height: 20px;
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--win-gray-light) var(--win-gray-dark) var(--win-gray-dark) var(--win-gray-light);
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.minesweeper-cell:active:not(.minesweeper-cell--revealed) {
  border-color: var(--win-gray-dark);
  border-width: 1px;
}

.minesweeper-cell--revealed {
  border: 1px solid var(--win-gray-dark);
  background: var(--win-gray-light);
  cursor: default;
}

.minesweeper-cell--mine {
  background: #f00;
}

.minesweeper-cell--flagged::before {
  content: '🚩';
  font-size: 12px;
}

.minesweeper-cell[data-num="1"] { color: #0000ff; }
.minesweeper-cell[data-num="2"] { color: #008000; }
.minesweeper-cell[data-num="3"] { color: #ff0000; }
.minesweeper-cell[data-num="4"] { color: #000080; }
.minesweeper-cell[data-num="5"] { color: #800000; }
.minesweeper-cell[data-num="6"] { color: #008080; }
.minesweeper-cell[data-num="7"] { color: #000000; }
.minesweeper-cell[data-num="8"] { color: #808080; }

/* ==========================================================================
   35. Interactive Terminal
   ========================================================================== */

.window__content--terminal-interactive {
  background: #000;
  color: #c0c0c0;
  padding: 8px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  min-height: 300px;
}

.terminal-output {
  flex: 1;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.4;
}

.terminal-output div {
  margin: 0;
}

.terminal-input-line {
  display: flex;
  align-items: center;
  margin-top: 4px;
}

.terminal-prompt {
  color: #c0c0c0;
  white-space: nowrap;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #c0c0c0;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  outline: none;
  caret-color: #c0c0c0;
}

.terminal-input::selection {
  background: #0000aa;
  color: #fff;
}

/* ==========================================================================
   36. Mobile Styles for New Features
   ========================================================================== */

/* Tablet (768px and below) */
@media screen and (max-width: 768px) {
  /* Winamp Player */
  .winamp-display {
    padding: 6px;
  }

  .winamp-visualizer {
    height: 30px;
  }

  .winamp-controls {
    gap: 6px;
    padding: 10px 4px;
  }

  .winamp-btn {
    width: 40px;
    height: 28px;
    font-size: 14px;
  }

  .winamp-track {
    padding: 6px 8px;
    font-size: 11px;
  }

  .winamp-playlist {
    max-height: 120px;
  }

  /* Minesweeper */
  .minesweeper-grid {
    grid-template-columns: repeat(9, 24px);
  }

  .minesweeper-cell {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }

  .minesweeper-face {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }

  .minesweeper-counter {
    font-size: 18px;
    padding: 4px 6px;
  }

  /* Terminal */
  .window__content--terminal-interactive {
    min-height: 250px;
    font-size: 11px;
  }

  .terminal-input {
    font-size: 14px;
    padding: 4px 0;
  }

}

/* Mobile (480px and below) */
@media screen and (max-width: 480px) {
  /* Winamp Player - full width */
  #window-winamp {
    width: 100% !important;
  }

  .winamp-display {
    padding: 8px;
    margin: 2px;
  }

  .winamp-visualizer {
    height: 50px;
    margin-bottom: 10px;
  }

  .winamp-visualizer-bar {
    width: 6px;
  }

  .winamp-title {
    font-size: 12px;
  }

  .winamp-time {
    font-size: 11px;
  }

  .winamp-progress {
    height: 12px;
  }

  .winamp-controls {
    gap: 8px;
    padding: 12px 8px;
  }

  .winamp-btn {
    width: 48px;
    height: 36px;
    font-size: 16px;
  }

  .winamp-playlist {
    max-height: 150px;
    margin: 4px 2px;
  }

  .winamp-track {
    padding: 10px 12px;
    font-size: 12px;
  }

  .winamp-volume {
    padding: 10px 8px;
    font-size: 12px;
  }

  .winamp-volume input[type="range"] {
    height: 12px;
  }

  .winamp-volume input[type="range"]::-webkit-slider-thumb {
    width: 20px;
    height: 24px;
  }

  /* Minesweeper - Responsive grid */
  #window-minesweeper {
    width: 100% !important;
  }

  .window__content--minesweeper {
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .minesweeper-header {
    width: 100%;
    max-width: 280px;
    padding: 8px 12px;
    margin-bottom: 12px;
  }

  .minesweeper-counter {
    font-size: 22px;
    padding: 4px 8px;
    min-width: 55px;
  }

  .minesweeper-face {
    width: 44px;
    height: 44px;
    font-size: 24px;
  }

  .minesweeper-grid {
    grid-template-columns: repeat(9, 28px);
  }

  .minesweeper-cell {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .minesweeper-cell--flagged::before {
    font-size: 14px;
  }

  /* Terminal - Better mobile input */
  #window-terminal {
    width: 100% !important;
  }

  .window__content--terminal-interactive {
    min-height: 200px;
    padding: 10px;
    font-size: 11px;
  }

  .terminal-output {
    font-size: 10px;
    line-height: 1.5;
  }

  .terminal-input-line {
    margin-top: 8px;
    padding: 8px 0;
    border-top: 1px solid #333;
  }

  .terminal-prompt {
    font-size: 11px;
  }

  .terminal-input {
    font-size: 16px; /* Prevent iOS zoom on focus */
    padding: 8px 4px;
  }

}

/* Small mobile (360px and below) */
@media screen and (max-width: 360px) {
  /* Smaller Minesweeper grid */
  .minesweeper-grid {
    grid-template-columns: repeat(9, 24px);
  }

  .minesweeper-cell {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .minesweeper-header {
    max-width: 240px;
  }

  .minesweeper-counter {
    font-size: 18px;
    min-width: 45px;
  }

  .minesweeper-face {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

  /* Winamp smaller buttons */
  .winamp-btn {
    width: 40px;
    height: 32px;
    font-size: 14px;
  }

  .winamp-track {
    padding: 8px 10px;
    font-size: 11px;
  }
}

/* Touch device optimizations for new features */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .winamp-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .winamp-track {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .minesweeper-cell {
    min-width: 32px;
    min-height: 32px;
  }

  .minesweeper-face {
    min-width: 48px;
    min-height: 48px;
  }

  /* Terminal scroll improvements */
  .terminal-output {
    -webkit-overflow-scrolling: touch;
  }

  /* Prevent text selection on game elements */
  .minesweeper-grid,
  .winamp-controls,
  .winamp-playlist {
    -webkit-user-select: none;
    user-select: none;
  }
}

/* Landscape mobile - adjust heights */
@media screen and (max-width: 768px) and (orientation: landscape) {
  .winamp-playlist {
    max-height: 80px;
  }

  .winamp-visualizer {
    height: 25px;
  }

  .window__content--terminal-interactive {
    min-height: 150px;
  }

  .window__content--minesweeper {
    padding: 4px;
  }

  .minesweeper-header {
    margin-bottom: 4px;
    padding: 2px 8px;
  }

  .minesweeper-grid {
    grid-template-columns: repeat(9, 22px);
  }

  .minesweeper-cell {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }
}
