/* ==========================================================================
   App Styles — extracted from inline JS injection
   ========================================================================== */

/* --- Winamp --- */

/* Winamp 2.x skin */
.winamp {
  background: #3a3a3a;
  font-family: 'Arial', 'Helvetica', sans-serif;
  font-size: 11px;
  color: #00ff00;
  display: flex;
  flex-direction: column;
  height: 100%;
  user-select: none;
  overflow: hidden;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent, transparent 1px,
      rgba(255,255,255,0.02) 1px, rgba(255,255,255,0.02) 2px
    );
}

/* ---- Title bar area ---- */
.winamp-header {
  background: linear-gradient(180deg, #4a4a4a 0%, #3a3a3a 40%, #2e2e2e 100%);
  padding: 4px 6px 2px;
  border-bottom: 1px solid #222;
  flex-shrink: 0;
}

.winamp-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}

.winamp-brand {
  font-size: 9px;
  font-weight: bold;
  color: #888;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.winamp-kbps {
  font-size: 9px;
  color: #00cc00;
  font-family: 'Courier New', monospace;
}

/* ---- Display area ---- */
.winamp-display {
  background: #000;
  border: 2px inset #1a1a1a;
  margin: 0 6px 4px;
  padding: 4px 6px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.winamp-display-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.winamp-vis {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 20px;
  flex-shrink: 0;
}

.winamp-vis-bar {
  width: 4px;
  background: linear-gradient(180deg, #00ff00 0%, #00cc00 60%, #009900 100%);
  min-height: 1px;
  transition: height 0.08s linear;
}

.winamp-time {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  color: #00ff00;
  text-shadow: 0 0 4px rgba(0,255,0,0.4);
  line-height: 1;
  flex-shrink: 0;
  letter-spacing: 1px;
}

.winamp-marquee {
  overflow: hidden;
  white-space: nowrap;
  margin-top: 3px;
  height: 13px;
}

.winamp-marquee-inner {
  display: inline-block;
  color: #00ff00;
  font-size: 10px;
  font-family: 'Arial', sans-serif;
  text-shadow: 0 0 3px rgba(0,255,0,0.3);
  will-change: transform;
}

.winamp-status {
  font-size: 9px;
  color: #00aa00;
  margin-top: 2px;
  display: flex;
  justify-content: space-between;
}

/* ---- Seek bar ---- */
.winamp-seek-row {
  padding: 2px 6px 4px;
  flex-shrink: 0;
}

.winamp-seek {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: #1a1a1a;
  border: 1px inset #333;
  border-radius: 0;
  outline: none;
  cursor: pointer;
}

.winamp-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 10px;
  background: linear-gradient(180deg, #6a6a6a, #4a4a4a);
  border: 1px outset #777;
  border-radius: 0;
  cursor: pointer;
}

.winamp-seek::-moz-range-thumb {
  width: 14px;
  height: 10px;
  background: linear-gradient(180deg, #6a6a6a, #4a4a4a);
  border: 1px outset #777;
  border-radius: 0;
  cursor: pointer;
}

/* ---- Transport controls ---- */
.winamp-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 2px 6px;
  flex-shrink: 0;
}

.winamp-ctrl-btn {
  width: 28px;
  height: 20px;
  background: linear-gradient(180deg, #5a5a5a 0%, #444 40%, #3a3a3a 100%);
  border: 1px outset #666;
  color: #ccc;
  font-size: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: inherit;
  line-height: 1;
}

.winamp-ctrl-btn:active {
  border: 1px inset #444;
  background: linear-gradient(180deg, #3a3a3a 0%, #444 60%, #5a5a5a 100%);
}

.winamp-ctrl-btn.playing > span,
.winamp-ctrl-btn.playing { color: #00ff00; }

.winamp-ctrl-btn.paused > span,
.winamp-ctrl-btn.paused { color: #ffff00; }

/* Winamp transport glyphs drawn with CSS so they stay monochrome
   (unicode play/pause/stop chars render as colour-emoji on Linux). */
.winamp-ctrl-btn > span {
  display: inline-block;
  position: relative;
  width: 0; height: 0;
}
.winamp-ctrl-btn.glyph-play > span {
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent #ccc;
}
.winamp-ctrl-btn.glyph-stop > span {
  width: 9px; height: 9px;
  background: #ccc;
}
.winamp-ctrl-btn.glyph-pause > span {
  width: 8px; height: 9px;
  border-left: 3px solid #ccc;
  border-right: 3px solid #ccc;
  background: transparent;
}
/* Next: triangle pointing right with a vertical bar on its right edge. */
.winamp-ctrl-btn.glyph-next > span {
  border-style: solid;
  border-width: 4px 0 4px 7px;
  border-color: transparent transparent transparent #ccc;
}
.winamp-ctrl-btn.glyph-next > span::after {
  content: '';
  position: absolute;
  top: -4px;
  left: 1px;
  width: 2px;
  height: 8px;
  background: #ccc;
}
/* Prev: mirror of next — bar on the left, triangle pointing left. */
.winamp-ctrl-btn.glyph-prev > span {
  border-style: solid;
  border-width: 4px 7px 4px 0;
  border-color: transparent #ccc transparent transparent;
}
.winamp-ctrl-btn.glyph-prev > span::after {
  content: '';
  position: absolute;
  top: -4px;
  right: 1px;
  width: 2px;
  height: 8px;
  background: #ccc;
}
.winamp-ctrl-btn.playing.glyph-play > span { border-left-color: #00ff00; }
.winamp-ctrl-btn.paused.glyph-pause > span { border-left-color: #ffff00; border-right-color: #ffff00; }

/* ---- Volume ---- */
.winamp-volume-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px 4px;
  flex-shrink: 0;
}

.winamp-volume-label {
  font-size: 9px;
  color: #888;
  flex-shrink: 0;
}

.winamp-volume {
  flex: 1;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: #1a1a1a;
  border: 1px inset #333;
  border-radius: 0;
  outline: none;
  cursor: pointer;
}

.winamp-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  background: linear-gradient(180deg, #6a6a6a, #4a4a4a);
  border: 1px outset #777;
  border-radius: 0;
  cursor: pointer;
}

.winamp-volume::-moz-range-thumb {
  width: 10px;
  height: 10px;
  background: linear-gradient(180deg, #6a6a6a, #4a4a4a);
  border: 1px outset #777;
  border-radius: 0;
  cursor: pointer;
}

.winamp-volume-val {
  font-size: 9px;
  color: #00cc00;
  width: 26px;
  text-align: right;
  flex-shrink: 0;
  font-family: 'Courier New', monospace;
}

/* ---- Divider ---- */
.winamp-divider {
  height: 2px;
  background: linear-gradient(180deg, #222, #555);
  margin: 0 2px;
  flex-shrink: 0;
}

/* ---- Playlist ---- */
.winamp-playlist-header {
  background: linear-gradient(180deg, #4a4a4a, #3a3a3a);
  padding: 2px 6px;
  font-size: 9px;
  font-weight: bold;
  color: #aaa;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-top: 1px solid #555;
  border-bottom: 1px solid #222;
}

.winamp-playlist-grip {
  display: flex;
  gap: 1px;
}

.winamp-playlist-grip span {
  display: block;
  width: 2px;
  height: 2px;
  background: #666;
}

.winamp-playlist {
  flex: 1;
  background: #0a0a2a;
  overflow-y: auto;
  min-height: 0;
  border: 2px inset #111;
  margin: 0 2px 2px;
}

.winamp-pl-item {
  padding: 1px 6px;
  font-size: 10px;
  color: #00cc00;
  cursor: default;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
  font-family: 'Arial', sans-serif;
}

.winamp-pl-item:hover {
  background: rgba(0, 80, 200, 0.3);
}

.winamp-pl-item.selected {
  background: #000080;
  color: #ffffff;
}

.winamp-pl-item.playing {
  color: #ffffff;
  font-weight: bold;
}

.winamp-pl-item.playing.selected {
  background: #000080;
  color: #ffffff;
}

.winamp-pl-item .pl-num {
  color: #008800;
  margin-right: 4px;
}

.winamp-pl-item.playing .pl-num {
  color: #aaaaff;
}

/* Playlist scrollbar */
.winamp-playlist::-webkit-scrollbar {
  width: 10px;
}

.winamp-playlist::-webkit-scrollbar-track {
  background: #0a0a2a;
}

.winamp-playlist::-webkit-scrollbar-thumb {
  background: #333366;
  border: 1px solid #222244;
}

/* ---- Status bar ---- */
.winamp-statusbar {
  background: #2e2e2e;
  border-top: 1px solid #555;
  padding: 1px 6px;
  font-size: 9px;
  color: #888;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Override win-content for winamp */
[data-window-id="winamp"] .win-content {
  background: #3a3a3a;
  border: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* --- Solitaire --- */

.sol-container {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  /* Classic Windows Solitaire dark-teal felt (#008080 — same as the desktop) */
  background: #008080; overflow: hidden; user-select: none;
}
.sol-menubar {
  display: flex; background: #c0c0c0; border-bottom: 1px solid #808080;
  padding: 1px 0; flex-shrink: 0;
}
.sol-menu-trigger {
  padding: 2px 8px; font-size: 11px; font-family: Tahoma, sans-serif;
  cursor: default; position: relative;
}
.sol-menu-trigger:hover, .sol-menu-trigger.open { background: #000080; color: #fff; }
.sol-menu-dropdown {
  display: none; position: absolute; top: 100%; left: 0;
  background: #c0c0c0; border: 2px outset #dfdfdf; min-width: 140px;
  z-index: 9999; padding: 2px 0;
}
.sol-menu-trigger.open .sol-menu-dropdown { display: block; }
.sol-menu-item {
  padding: 3px 20px; font-size: 11px; font-family: Tahoma, sans-serif;
  cursor: default; white-space: nowrap;
}
.sol-menu-item:hover { background: #000080; color: #fff; }
.sol-menu-sep { border-top: 1px solid #808080; border-bottom: 1px solid #fff; margin: 2px; }
.sol-field { flex: 1; position: relative; overflow: hidden; min-height: 0; }
.sol-statusbar {
  background: #c0c0c0; border-top: 1px solid #808080; padding: 2px 6px;
  font-size: 11px; font-family: Tahoma, sans-serif; flex-shrink: 0;
  display: flex; justify-content: space-between;
}
.sol-card {
  position: absolute; width: 70px; height: 96px; border-radius: 4px;
  border: 1px solid #333; cursor: pointer;
  font-family: "Segoe UI", Tahoma, sans-serif; transition: box-shadow 0.1s;
}
.sol-card:hover { box-shadow: 0 0 4px rgba(255,255,255,0.4); }
.sol-card.face-up { background: #fff; }
/* Classic Win98 Solitaire "blue" deck — navy border, deep blue field,
   stylised diamond grid in lighter blue. The inset frame on ::after gives
   the original 1-pixel inner border the deck had. */
.sol-card.face-down {
  background: #000080;
  cursor: default;
  border-color: #000040;
  background-image:
    repeating-linear-gradient(45deg,
      transparent 0 5px,
      rgba(255,255,255,0.18) 5px 6px,
      transparent 6px 11px),
    repeating-linear-gradient(-45deg,
      transparent 0 5px,
      rgba(255,255,255,0.18) 5px 6px,
      transparent 6px 11px);
}
.sol-card.face-down::after {
  content: ""; position: absolute; inset: 3px;
  border: 1px solid rgba(255,255,255,0.55); border-radius: 2px;
}
.sol-card .sol-rank-tl, .sol-card .sol-rank-br {
  position: absolute; font-size: 12px; font-weight: bold; line-height: 1;
}
.sol-card .sol-rank-tl { top: 3px; left: 4px; }
.sol-card .sol-rank-br { bottom: 3px; right: 4px; transform: rotate(180deg); }
.sol-card .sol-suit-tl, .sol-card .sol-suit-br {
  position: absolute; font-size: 10px; line-height: 1;
}
.sol-card .sol-suit-tl { top: 15px; left: 5px; }
.sol-card .sol-suit-br { bottom: 15px; right: 5px; transform: rotate(180deg); }
.sol-card .sol-center-suit {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); font-size: 28px; opacity: 0.85;
}
.sol-card.red { color: #cc0000; }
.sol-card.black { color: #000; }
.sol-card.dragging {
  opacity: 0.85; z-index: 10000 !important;
  box-shadow: 3px 5px 10px rgba(0,0,0,0.4); pointer-events: none;
}
.sol-pile-placeholder {
  position: absolute; width: 70px; height: 96px; border-radius: 4px;
  border: 2px dashed rgba(255,255,255,0.25); background: rgba(0,0,0,0.08);
}
.sol-pile-placeholder.foundation {
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; opacity: 0.3;
}
.sol-pile-placeholder.stock {
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; font-size: 20px; color: rgba(255,255,255,0.3);
}
.sol-drop-highlight { box-shadow: 0 0 8px 2px rgba(255,255,200,0.7) !important; }
.sol-win-canvas {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 20000;
}
.sol-win-overlay {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 20001; text-align: center; color: #fff;
  font-family: Tahoma, sans-serif; text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}
.sol-win-overlay h2 { font-size: 28px; margin-bottom: 8px; }
.sol-win-overlay p { font-size: 14px; margin-bottom: 12px; }
.sol-win-btn {
  padding: 4px 16px; font-size: 12px; font-family: Tahoma, sans-serif;
  background: #c0c0c0; border: 2px outset #dfdfdf; cursor: pointer;
  color: #000; text-shadow: none;
}
.sol-win-btn:active { border-style: inset; }

/* --- Notepad --- */

/* Notepad menu bar */
.notepad-menubar {
  background: #c0c0c0;
  display: flex;
  padding: 0;
  flex-shrink: 0;
  font-size: 12px;
  position: relative;
  z-index: 10;
}
.notepad-menu-item {
  padding: 2px 8px;
  cursor: default;
  position: relative;
}
.notepad-menu-item:hover,
.notepad-menu-item.open {
  background: #000080;
  color: #ffffff;
}
.notepad-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  border: 2px outset #dfdfdf;
  min-width: 180px;
  padding: 2px 0;
  z-index: 1000;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}
.notepad-dropdown.open {
  display: block;
}
.notepad-dropdown-item {
  padding: 3px 24px 3px 8px;
  cursor: default;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  white-space: nowrap;
  color: #000000;
}
.notepad-dropdown-item:hover {
  background: #000080;
  color: #ffffff;
}
.notepad-dropdown-item.disabled {
  color: #808080;
}
.notepad-dropdown-item.disabled:hover {
  background: transparent;
  color: #808080;
}
.notepad-dropdown-item .shortcut {
  margin-left: 24px;
  font-size: 11px;
  color: inherit;
  opacity: 0.7;
}
.notepad-dropdown-item.checked::before {
  content: '\2713';
  position: absolute;
  left: 6px;
}
.notepad-dropdown-item.checked {
  position: relative;
  padding-left: 20px;
}
.notepad-dropdown-divider {
  border-top: 1px solid #808080;
  border-bottom: 1px solid #ffffff;
  margin: 2px 0;
}

/* Notepad textarea */
.notepad-textarea {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  resize: none;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  line-height: 1.4;
  padding: 2px 4px;
  background: #ffffff;
  color: #000000;
  display: block;
}
.notepad-textarea.wrap-on {
  white-space: pre-wrap;
  overflow-wrap: break-word;
  overflow-x: hidden;
}
.notepad-textarea.wrap-off {
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}

/* Notepad status bar */
.notepad-statusbar {
  background: #c0c0c0;
  border-top: 1px solid #808080;
  padding: 2px 6px;
  font-size: 11px;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
}

/* File picker dialog */
.notepad-file-list {
  border: 2px inset #808080;
  background: #ffffff;
  margin: 8px;
  flex: 1;
  overflow-y: auto;
  min-height: 120px;
}
.notepad-file-row {
  padding: 2px 6px;
  cursor: default;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
}
.notepad-file-row:hover {
  background: #000080;
  color: #ffffff;
}
.notepad-file-row.selected {
  background: #000080;
  color: #ffffff;
}
.notepad-file-empty {
  padding: 12px;
  text-align: center;
  color: #808080;
  font-size: 12px;
}
.notepad-dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 4px 8px 8px;
}
.notepad-dialog-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Save As / Find dialog */
.notepad-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 8px 4px;
  font-size: 12px;
}
.notepad-input-row input[type="text"] {
  flex: 1;
  border: 2px inset #808080;
  background: #ffffff;
  font-family: Tahoma, 'Segoe UI', sans-serif;
  font-size: 12px;
  padding: 2px 4px;
  color: #000000;
  outline: none;
}

/* Confirm dialog */
.notepad-confirm {
  padding: 16px 12px 8px;
  font-size: 12px;
  text-align: center;
}
.notepad-confirm p {
  margin-bottom: 16px;
}
.notepad-confirm-buttons {
  display: flex;
  justify-content: center;
  gap: 6px;
}

/* --- Paint --- */

.paint-container { display:flex; flex-direction:column; width:100%; height:100%; background:#c0c0c0; overflow:hidden; }
.paint-menubar { display:flex; gap:0; padding:1px 2px; background:#c0c0c0; border-bottom:1px solid #808080; flex-shrink:0; }
.paint-menu-item { position:relative; padding:1px 6px; font:11px "MS Sans Serif",Tahoma,sans-serif; cursor:default; user-select:none; }
.paint-menu-item:hover { background:#000080; color:#fff; }
.paint-menu-dropdown { display:none; position:absolute; top:100%; left:0; background:#c0c0c0; border:2px outset #dfdfdf; min-width:140px; z-index:1000; padding:2px 0; }
.paint-menu-item.open .paint-menu-dropdown { display:block; }
.paint-menu-dropdown-item { padding:3px 20px; font:11px "MS Sans Serif",Tahoma,sans-serif; cursor:default; white-space:nowrap; }
.paint-menu-dropdown-item:hover { background:#000080; color:#fff; }
.paint-menu-separator { height:1px; background:#808080; margin:2px 4px; }
.paint-body { display:flex; flex:1; min-height:0; }
.paint-toolbox { width:62px; flex-shrink:0; background:#c0c0c0; border-right:1px solid #808080; padding:2px; display:flex; flex-direction:column; gap:1px; }
.paint-tool-grid { display:grid; grid-template-columns:28px 28px; gap:1px; justify-content:center; }
.paint-tool-btn { width:28px; height:28px; border:1px solid #c0c0c0; background:#c0c0c0; cursor:pointer; display:flex; align-items:center; justify-content:center; padding:0; font-size:9px; line-height:1; }
.paint-tool-btn:hover { border:1px solid #808080; }
.paint-tool-btn.active { border-top:1px solid #404040; border-left:1px solid #404040; border-bottom:1px solid #dfdfdf; border-right:1px solid #dfdfdf; background:#b0b0b0; }
.paint-tool-btn canvas { image-rendering:pixelated; pointer-events:none; }
.paint-size-selector { display:flex; flex-direction:column; align-items:center; gap:1px; margin-top:4px; padding:2px; border-top:1px solid #808080; border-left:1px solid #808080; border-bottom:1px solid #dfdfdf; border-right:1px solid #dfdfdf; }
.paint-size-btn { width:22px; height:10px; display:flex; align-items:center; justify-content:center; border:1px solid #c0c0c0; background:#c0c0c0; cursor:pointer; padding:0; }
.paint-size-btn.active { border-top:1px solid #404040; border-left:1px solid #404040; border-bottom:1px solid #dfdfdf; border-right:1px solid #dfdfdf; background:#b0b0b0; }
.paint-size-dot { background:#000; border-radius:50%; }
.paint-canvas-area { flex:1; min-width:0; min-height:0; overflow:auto; background:#808080; padding:2px; display:flex; align-items:flex-start; justify-content:flex-start; }
.paint-canvas-wrap { border-top:1px solid #404040; border-left:1px solid #404040; border-bottom:1px solid #dfdfdf; border-right:1px solid #dfdfdf; flex-shrink:0; line-height:0; }
.paint-canvas-wrap canvas { display:block; cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='19' height='19'%3E%3Cline x1='9' y1='0' x2='9' y2='7' stroke='white' stroke-width='3'/%3E%3Cline x1='9' y1='12' x2='9' y2='19' stroke='white' stroke-width='3'/%3E%3Cline x1='0' y1='9' x2='7' y2='9' stroke='white' stroke-width='3'/%3E%3Cline x1='12' y1='9' x2='19' y2='9' stroke='white' stroke-width='3'/%3E%3Cline x1='9' y1='0' x2='9' y2='7' stroke='black'/%3E%3Cline x1='9' y1='12' x2='9' y2='19' stroke='black'/%3E%3Cline x1='0' y1='9' x2='7' y2='9' stroke='black'/%3E%3Cline x1='12' y1='9' x2='19' y2='9' stroke='black'/%3E%3C/svg%3E") 9 9, crosshair; }
.paint-bottom { display:flex; flex-direction:column; flex-shrink:0; }
.paint-palette-area { display:flex; align-items:center; gap:4px; padding:2px 4px; background:#c0c0c0; border-top:1px solid #dfdfdf; }
.paint-fg-bg { position:relative; width:28px; height:28px; flex-shrink:0; }
.paint-bg-swatch { position:absolute; right:0; bottom:0; width:18px; height:18px; border:1px solid #808080; }
.paint-fg-swatch { position:absolute; left:0; top:0; width:18px; height:18px; border:1px solid #808080; z-index:1; }
.paint-colors { display:grid; grid-template-columns:repeat(14,13px); grid-template-rows:13px 13px; gap:1px; border-top:1px solid #808080; border-left:1px solid #808080; border-bottom:1px solid #dfdfdf; border-right:1px solid #dfdfdf; padding:1px; }
.paint-color-swatch { width:13px; height:13px; border:1px solid #c0c0c0; cursor:pointer; box-sizing:border-box; }
.paint-color-swatch:hover { border-color:#000; }
.paint-statusbar { display:flex; background:#c0c0c0; border-top:1px solid #808080; padding:1px 4px; font:11px "MS Sans Serif",Tahoma,sans-serif; flex-shrink:0; }
.paint-status-section { border-top:1px solid #404040; border-left:1px solid #404040; border-bottom:1px solid #dfdfdf; border-right:1px solid #dfdfdf; padding:1px 6px; min-width:80px; }

/* --- Calculator --- */

.calc-container { display:flex; flex-direction:column; width:100%; height:100%; background:#c0c0c0; font:11px "MS Sans Serif",Tahoma,sans-serif; user-select:none; overflow:hidden; }
.calc-menubar { display:flex; gap:0; padding:1px 2px; background:#c0c0c0; border-bottom:1px solid #808080; flex-shrink:0; }
.calc-menu-item { position:relative; padding:1px 6px; cursor:default; }
.calc-menu-item:hover { background:#000080; color:#fff; }
.calc-menu-dropdown { display:none; position:absolute; top:100%; left:0; background:#c0c0c0; border:0; box-shadow:inset -1px -1px 0 #000,inset 1px 1px 0 #fff,inset -2px -2px 0 #808080,inset 2px 2px 0 #dfdfdf,2px 2px 0 rgba(0,0,0,0.3); min-width:120px; z-index:1000; padding:2px; }
.calc-menu-item.open .calc-menu-dropdown { display:block; }
.calc-menu-dropdown-item { padding:3px 20px; cursor:default; white-space:nowrap; }
.calc-menu-dropdown-item:hover { background:#000080; color:#fff; }
.calc-body { flex:1; display:flex; flex-direction:column; padding:8px; gap:6px; min-height:0; }
.calc-display-area { display:flex; align-items:stretch; gap:0; flex-shrink:0; background:#fff; box-shadow:inset 1px 1px 0 #808080,inset -1px -1px 0 #fff,inset 2px 2px 0 #000,inset -2px -2px 0 #c0c0c0; height:30px; }
.calc-memory-indicator { width:24px; display:flex; align-items:center; justify-content:center; font:bold 12px "MS Sans Serif",Tahoma,sans-serif; color:#000; background:transparent; flex-shrink:0; border-right:1px solid #c0c0c0; }
.calc-display { flex:1; height:auto; border:0; background:#fff; padding:0 6px; text-align:right; font:20px "Consolas","Courier New",monospace; line-height:30px; overflow:hidden; white-space:nowrap; box-sizing:border-box; }
.calc-display.error { font-size:13px; }
/* Top row uses the same 6-col layout as the main grid so Backspace/CE/C line up with the columns below. Backspace spans 4, CE and C are single-column. */
.calc-buttons-top { display:grid; grid-template-columns:repeat(6, 1fr); gap:4px; flex-shrink:0; }
.calc-buttons-top .calc-btn:nth-child(1) { grid-column: span 4; }
.calc-buttons { flex:1; display:grid; grid-template-columns:repeat(6, 1fr); grid-template-rows:repeat(4, 1fr); gap:4px; min-height:0; }
.calc-btn { border:0; background:#c0c0c0; box-shadow:inset -1px -1px 0 #000,inset 1px 1px 0 #fff,inset -2px -2px 0 #808080,inset 2px 2px 0 #dfdfdf; font:12px "MS Sans Serif",Tahoma,sans-serif; cursor:pointer; padding:0; text-align:center; outline:none; min-height:22px; }
.calc-btn:active, .calc-btn.pressed { box-shadow:inset 1px 1px 0 #000,inset -1px -1px 0 #fff,inset 2px 2px 0 #808080,inset -2px -2px 0 #dfdfdf; }
/* Authentic Win98 Calculator palette: dark-red operators + memory keys
   ("MC/MR/MS/M+"), navy-blue digits and function keys ("sqrt/%/1x"),
   red Backspace/CE/C. The dimmer 8B is closer to the real screenshot
   than the previous bright a00000/0000a0. */
.calc-btn.red { color:#8B0000; font-weight:bold; font-family: 'MS Sans Serif', Tahoma, sans-serif; }
.calc-btn.blue { color:#000080; font-weight:bold; font-family: 'MS Sans Serif', Tahoma, sans-serif; }
.calc-btn.num { font: bold 14px "MS Sans Serif",Tahoma,sans-serif; color:#000080; }
.calc-btn[disabled] { color:#808080; text-shadow:1px 1px 0 #fff; }

/* --- Chat --- */

.chat-container { display: flex; flex-direction: column; height: 100%; background: #c0c0c0; font: 11px "MS Sans Serif", Tahoma, sans-serif; }

/* Channel header bar */
.chat-channel-bar { background: #000080; color: #fff; font: bold 11px "MS Sans Serif", Tahoma, sans-serif; padding: 3px 8px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Main body: messages + user list */
.chat-body { display: flex; flex: 1; min-height: 0; padding: 2px 3px 0 3px; gap: 2px; }

/* Message area */
.chat-messages { flex: 1; min-width: 0; background: #fff; border-top: 1px solid #404040; border-left: 1px solid #404040; border-bottom: 1px solid #dfdfdf; border-right: 1px solid #dfdfdf; overflow-y: auto; overflow-x: hidden; padding: 2px 4px; font: 12px "Fixedsys", "Consolas", "Courier New", monospace; }
.chat-msg { padding: 1px 0; line-height: 1.4; word-wrap: break-word; }
.chat-msg-own { background: #e8e8ff; margin: 0 -4px; padding: 1px 4px; }
.chat-msg-system { color: #808080; font-style: italic; }
.chat-msg-time { color: #666; }
.chat-msg-nick { font-weight: bold; }
.chat-msg a { color: #0000ff; }
.chat-msg a:visited { color: #800080; }
.chat-empty { color: #808080; text-align: center; margin-top: 20px; font-style: italic; font: 11px "MS Sans Serif", Tahoma, sans-serif; }

/* User list sidebar */
.chat-users { width: 120px; flex-shrink: 0; background: #f0f0f0; border-top: 1px solid #404040; border-left: 1px solid #404040; border-bottom: 1px solid #dfdfdf; border-right: 1px solid #dfdfdf; overflow-y: auto; padding: 2px; }
.chat-users-header { font: bold 11px "MS Sans Serif", Tahoma, sans-serif; color: #000080; padding: 2px 4px 4px 4px; border-bottom: 1px solid #c0c0c0; margin-bottom: 2px; }
.chat-user { display: flex; align-items: center; gap: 4px; padding: 1px 4px; font: 11px "MS Sans Serif", Tahoma, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-user-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Input area */
.chat-input-area { display: flex; gap: 2px; padding: 3px; flex-shrink: 0; }
.chat-input { flex: 1; font: 12px "MS Sans Serif", Tahoma, sans-serif; padding: 2px 4px; border: 2px inset #808080; outline: none; }
.chat-send-btn { min-width: 60px; font: 11px "MS Sans Serif", Tahoma, sans-serif; padding: 2px 8px; border: 2px outset #dfdfdf; background: #c0c0c0; cursor: pointer; }
.chat-send-btn:active { border-style: inset; }
.chat-send-btn:disabled { color: #808080; }

/* Status bar */
.chat-statusbar { display: flex; justify-content: space-between; background: #c0c0c0; border-top: 1px solid #808080; padding: 1px 4px; font: 11px "MS Sans Serif", Tahoma, sans-serif; flex-shrink: 0; }
.chat-status-section { border-top: 1px solid #404040; border-left: 1px solid #404040; border-bottom: 1px solid #dfdfdf; border-right: 1px solid #dfdfdf; padding: 1px 6px; }
.chat-status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.chat-status-connected { background: #00aa00; }
.chat-status-disconnected { background: #cc0000; }

/* Nickname dialog */
.chat-nick-dialog { padding: 16px; font: 11px "MS Sans Serif", Tahoma, sans-serif; }
.chat-nick-dialog label { display: block; margin-bottom: 8px; }
.chat-nick-dialog input { width: 100%; box-sizing: border-box; font: 12px "MS Sans Serif", Tahoma, sans-serif; padding: 2px 4px; border: 2px inset #808080; margin-bottom: 12px; }
.chat-nick-dialog .chat-nick-error { color: #cc0000; font-size: 10px; margin-top: -8px; margin-bottom: 8px; display: none; }
.chat-nick-buttons { display: flex; justify-content: flex-end; gap: 6px; }
.chat-nick-buttons button { min-width: 70px; font: 11px "MS Sans Serif", Tahoma, sans-serif; padding: 3px 8px; border: 2px outset #dfdfdf; background: #c0c0c0; cursor: pointer; }
.chat-nick-buttons button:active { border-style: inset; }

/* --- Minesweeper --- */

.ms-container { background: #c0c0c0; display: flex; flex-direction: column; height: 100%; user-select: none; -webkit-user-select: none; }

/* Menu bar */
.ms-menubar { display: flex; padding: 1px 0; background: #c0c0c0; border-bottom: 1px solid #808080; font: 11px Tahoma, sans-serif; flex-shrink: 0; }
.ms-menu-item { position: relative; padding: 2px 6px; cursor: default; }
.ms-menu-item:hover { background: #000080; color: #fff; }
.ms-menu-dropdown { display: none; position: absolute; top: 100%; left: 0; background: #c0c0c0; border: 2px outset #dfdfdf; padding: 2px; min-width: 140px; z-index: 1000; }
.ms-menu-dropdown.open { display: block; }
.ms-menu-dropdown div { padding: 3px 20px 3px 8px; white-space: nowrap; font: 11px Tahoma, sans-serif; color: #000; }
.ms-menu-dropdown div:hover { background: #000080; color: #fff; }
.ms-menu-dropdown .ms-sep { height: 1px; background: #808080; margin: 2px 4px; padding: 0; pointer-events: none; }
.ms-menu-dropdown .ms-sep:hover { background: #808080; color: #000; }
.ms-menu-dropdown .ms-check { padding-left: 20px; }
.ms-menu-dropdown .ms-check::before { content: "\2713"; position: absolute; left: 6px; }

/* Header panel — proper Win98 inset bevel */
.ms-header { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px; margin: 6px 6px 4px; border: 0; box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #fff, inset 2px 2px 0 #000, inset -2px -2px 0 #c0c0c0; background: #c0c0c0; flex-shrink: 0; }

/* LED display — black background, red digital digits, inset frame */
.ms-led { background: #000; color: #f00; font-family: "Consolas", "Courier New", monospace; font-size: 20px; font-weight: bold; letter-spacing: 2px; padding: 1px 4px; border: 0; box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #fff; min-width: 42px; text-align: right; line-height: 1; }

/* Smiley button — layered bevel, larger glyph for the new text faces */
.ms-smiley { width: 26px; height: 26px; border: 0; background: #ffe97a; box-shadow: inset -1px -1px 0 #000, inset 1px 1px 0 #fff, inset -2px -2px 0 #808080, inset 2px 2px 0 #dfdfdf; cursor: pointer; font: bold 13px "MS Sans Serif", Tahoma, sans-serif; color: #000; line-height: 22px; text-align: center; padding: 0; }
.ms-smiley:active { box-shadow: inset 1px 1px 0 #000, inset -1px -1px 0 #fff, inset 2px 2px 0 #808080, inset -2px -2px 0 #dfdfdf; }

/* Grid wrapper — 3-pixel inset frame around the playfield */
.ms-grid-wrap { margin: 0 6px 6px 6px; border: 0; box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #fff, inset 2px 2px 0 #000, inset -2px -2px 0 #c0c0c0; padding: 3px; background: #c0c0c0; overflow: hidden; flex-shrink: 0; }

/* Grid */
.ms-grid { display: grid; background: #c0c0c0; }

/* Cells — unrevealed: outset bevel | revealed: thin top+left grid line */
.ms-cell { width: 16px; height: 16px; border: 0; background: #c0c0c0; box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #fff; font-size: 11px; font-weight: bold; text-align: center; line-height: 12px; cursor: default; padding: 0; box-sizing: border-box; display: flex; align-items: center; justify-content: center; }
.ms-cell.revealed { box-shadow: inset 1px 1px 0 #808080; background: #c0c0c0; }
.ms-cell.revealed.mine-hit { background: #f00; }
.ms-cell.flagged { }
.ms-cell.question { }

/* Number colors */
.ms-cell.n1 { color: #0000ff; }
.ms-cell.n2 { color: #008000; }
.ms-cell.n3 { color: #ff0000; }
.ms-cell.n4 { color: #000080; }
.ms-cell.n5 { color: #800000; }
.ms-cell.n6 { color: #008080; }
.ms-cell.n7 { color: #000000; }
.ms-cell.n8 { color: #808080; }

/* --- Claude Code --- */

.claude-terminal {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #0c0c0c;
}
.claude-output {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  font-family: "Courier New", monospace;
  font-size: 14px;
  color: #33ff33;
  line-height: 1.4;
  white-space: pre-wrap;
}
.claude-input-line {
  display: flex;
  align-items: center;
  padding: 4px 12px 8px;
  background: #0c0c0c;
  flex-shrink: 0;
  font-family: "Courier New", monospace;
  font-size: 14px;
  color: #33ff33;
}
.claude-input-line span { flex-shrink: 0; }
.claude-input-line input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #33ff33;
  font-family: inherit;
  font-size: inherit;
  caret-color: #33ff33;
}

/* --- Clippy --- */

/* Container */
.clippy-container {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 50;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.clippy-container * { pointer-events: auto; }

/* Speech bubble */
.clippy-bubble {
  background: #ffffcc;
  border: 1px solid #808080;
  border-radius: 6px;
  padding: 6px 22px 6px 8px;
  font: 11px Tahoma, "MS Sans Serif", sans-serif;
  color: #000;
  max-width: 200px;
  position: relative;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  opacity: 0;
  animation: clippy-fade-in 0.4s ease forwards;
  line-height: 1.35;
}

/* Bubble tail */
.clippy-bubble::after {
  content: "";
  position: absolute;
  bottom: -7px;
  right: 18px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #ffffcc;
}
.clippy-bubble::before {
  content: "";
  position: absolute;
  bottom: -9px;
  right: 17px;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 9px solid #808080;
}

/* Dismiss button */
.clippy-dismiss {
  position: absolute;
  top: 2px;
  right: 4px;
  background: none;
  border: none;
  font-size: 11px;
  cursor: pointer;
  color: #808080;
  padding: 0 2px;
  line-height: 1;
}
.clippy-dismiss:hover { color: #000; }

/* Clippy character */
.clippy-char {
  position: relative;
  cursor: default;
  animation: clippy-enter 0.5s ease-out;
}

.clippy-body {
  font-family: "Courier New", monospace;
  font-size: 10px;
  line-height: 1.1;
  color: #4070c0;
  white-space: pre;
  animation: clippy-wobble 3s ease-in-out infinite;
  text-shadow: 0 0 1px rgba(64,112,192,0.3);
  user-select: none;
}

/* Eyes */
.clippy-eyes {
  position: absolute;
  top: 3px;
  left: 5px;
  font-size: 10px;
  line-height: 1;
  letter-spacing: 1px;
  animation: clippy-blink 4s ease-in-out infinite;
}

/* Animations */
@keyframes clippy-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes clippy-enter {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes clippy-wobble {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(1.5deg); }
  75% { transform: rotate(-1.5deg); }
}

@keyframes clippy-blink {
  0%, 92%, 100% { opacity: 1; }
  95% { opacity: 0; }
}

@keyframes clippy-wave {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(8deg); }
  60% { transform: rotate(-4deg); }
  80% { transform: rotate(4deg); }
}

/* ==========================================================================
   My Computer — folder browser
   ========================================================================== */

.mc-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px;
  padding: 10px 8px;
  background: #ffffff;
  align-content: start;
  min-height: 100%;
}

.mc-folder-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px;
  cursor: default;
  border: 1px dotted transparent;
  user-select: none;
  outline: none;
}

.mc-folder-icon-img {
  font-size: 30px;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.mc-folder-icon-label {
  font-size: 11px;
  color: #000;
  margin-top: 4px;
  text-align: center;
  word-wrap: break-word;
  padding: 1px 3px;
  line-height: 1.2;
}

.mc-folder-icon.selected .mc-folder-icon-label {
  background: #000080;
  color: #ffffff;
}
.mc-folder-icon.selected {
  border: 1px dotted #000;
}
.mc-folder-icon.selected .mc-folder-icon-img {
  filter: brightness(0.55) contrast(1.1) sepia(1) hue-rotate(195deg) saturate(4);
}
