/* ============================================================
   Paint.exe / Gallery.exe / Featured Art — Mashpit Win98 chrome
   Vaporwave-tinted MS Paint look. Tahoma, gray (#d4d0c8) chrome.
   ============================================================ */

/* --- Window sizes --- */
.win98-window.window-paint {
  width: 1080px;
  max-width: 96vw;
  min-height: 720px;
  resize: both;
  overflow: hidden;
}
.win98-window.window-gallery {
  width: 800px;
  max-width: 96vw;
  min-height: 580px;
  resize: both;
  overflow: hidden;
}
.win98-window.window-featured {
  width: 780px;
  max-width: 96vw;
  min-height: 620px;
  resize: both;
  overflow: hidden;
}

/* --- Tabs (Paint window) --- */
.paint-tabs {
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 4px 4px 0 4px;
  background: #d4d0c8;
  border-bottom: 1px solid #808080;
}
.paint-tab {
  font-family: Tahoma, "MS Sans Serif", sans-serif;
  font-size: 11px;
  padding: 4px 14px 6px;
  background: #d4d0c8;
  color: #000;
  border: 1px solid #808080;
  border-bottom: none;
  border-radius: 2px 2px 0 0;
  cursor: pointer;
  box-shadow: inset 1px 1px 0 #ffffff;
  margin-bottom: -1px;
  position: relative;
  top: 1px;
}
.paint-tab:hover { background: #e0dcd4; }
.paint-tab.active {
  background: linear-gradient(180deg, #ffffff 0%, #e8e4dc 100%);
  font-weight: bold;
  padding-bottom: 7px;
  z-index: 2;
  border-bottom: 1px solid #e8e4dc;
}
.paint-tab-spacer { flex: 1; }
.paint-tab-id {
  font-family: VT323, monospace;
  font-size: 13px;
  color: #6a2c91;
  padding: 4px 8px 0;
  letter-spacing: 1px;
  white-space: nowrap;
}

.paint-tab-panel {
  background: #d4d0c8;
  padding: 6px;
}

/* --- Drawing stage layout --- */
.paint-stage {
  display: flex;
  gap: 4px;
  align-items: flex-start;
}
.paint-tools {
  width: 96px;
  flex: 0 0 96px;
  padding: 4px;
  background: #d4d0c8;
  border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  box-shadow: inset 1px 1px 0 #dfdcd2;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.paint-tools-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
.paint-tool-btn {
  font-family: Tahoma, "MS Sans Serif", sans-serif;
  font-size: 16px;
  width: 42px;
  height: 36px;
  background: #d4d0c8;
  color: #000;
  border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  box-shadow: inset 1px 1px 0 #dfdcd2;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}
.paint-tool-btn:hover { background: #e0dcd4; }
.paint-tool-btn.active {
  border-color: #808080 #ffffff #ffffff #808080;
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.25);
  background: #c4c0b8;
}
.paint-tool-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.paint-tools-section-label {
  font-family: Tahoma, sans-serif;
  font-size: 10px;
  color: #404040;
  text-align: center;
  margin-top: 2px;
  border-top: 1px solid #808080;
  padding-top: 4px;
}

.paint-size-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.paint-size-slider {
  flex: 1;
  width: 100%;
}
.paint-size-readout {
  font-family: VT323, monospace;
  font-size: 13px;
  color: #6a2c91;
  min-width: 22px;
  text-align: right;
}
.paint-current-color {
  width: 100%;
  height: 26px;
  border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.2);
  background: #1c1c1c;
}
.paint-palette {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
}
.paint-swatch {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  cursor: pointer;
  padding: 0;
  position: relative;
}
.paint-swatch:hover { outline: 1px solid #ff2bd6; outline-offset: -1px; }
.paint-swatch.active {
  border-color: #808080 #ffffff #ffffff #808080;
  outline: 2px solid #ff2bd6;
  outline-offset: -2px;
}

/* --- Canvas area --- */
.paint-canvas-wrap {
  flex: 1;
  min-width: 0;
  background: #d4d0c8;
  border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
}
.paint-status-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, #e8e4dc 0%, #d4d0c8 100%);
  padding: 4px 8px;
  border-bottom: 1px solid #808080;
  font-family: Tahoma, sans-serif;
  font-size: 11px;
}
.paint-status-text { color: #000; }
.paint-status-spacer { flex: 1; }
.paint-status-pos {
  font-family: VT323, monospace;
  font-size: 13px;
  color: #6a2c91;
}
.paint-mini-btn {
  font-family: Tahoma, sans-serif;
  font-size: 11px;
  background: #d4d0c8;
  border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  padding: 2px 8px;
  cursor: pointer;
  color: #000;
}
.paint-mini-btn:hover { background: #e0dcd4; }

.paint-canvas-scroll {
  overflow: auto;
  background:
    repeating-conic-gradient(#ddd 0 25%, #fff 0 50%) 0 0 / 16px 16px;
  padding: 8px;
  flex: 1;
  min-height: 480px;
}
.paint-canvas-scroll canvas {
  background: #ffffff;
  border: 1px solid #808080;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.25);
  display: block;
  cursor: crosshair;
  touch-action: none;
}
.paint-canvas-scroll canvas.tool-eraser { cursor: cell; }
.paint-canvas-scroll canvas.tool-fill { cursor: copy; }

.paint-action-btn { margin-left: 4px; }
.paint-action-primary {
  background: linear-gradient(180deg, #ff2bd6 0%, #a855f7 100%);
  color: #fff;
  font-weight: bold;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
}
.paint-action-primary:hover { filter: brightness(1.05); }

/* --- Subview (drafts list / locked grid) --- */
.paint-subview { padding: 4px; }
.paint-subview-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  background: #d4d0c8;
  border-bottom: 1px solid #808080;
}
.paint-subview-info {
  font-family: Tahoma, sans-serif;
  font-size: 11px;
  color: #404040;
}
.paint-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: #606060;
  font-family: Tahoma, sans-serif;
  font-size: 12px;
  font-style: italic;
}
.paint-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  padding: 10px 6px;
  max-height: 600px;
  overflow: auto;
  background: #d4d0c8;
}
.paint-thumb {
  background: #fff;
  border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.paint-thumb-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #efefef;
  border: 1px solid #808080;
  display: block;
  cursor: pointer;
}
.paint-thumb-meta {
  font-family: Tahoma, sans-serif;
  font-size: 10px;
  color: #404040;
  line-height: 1.3;
}
.paint-thumb-meta strong { color: #6a2c91; }
.paint-thumb-actions {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.paint-thumb-actions .win98-button {
  font-size: 10px;
  padding: 2px 6px;
  flex: 1;
  min-width: 0;
}
.paint-thumb-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ff2bd6, #00e0ff);
  color: #fff;
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  padding: 2px 5px;
  margin-left: 4px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
  letter-spacing: 1px;
}

/* --- Gallery window --- */
.gallery-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #d4d0c8;
  border-bottom: 1px solid #808080;
}
.gallery-status,
.gallery-page {
  font-family: Tahoma, sans-serif;
  font-size: 11px;
  color: #404040;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  padding: 10px;
  max-height: 540px;
  overflow: auto;
  background: #d4d0c8;
}

/* Lightbox */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-lightbox-inner {
  background: #d4d0c8;
  border: 2px solid;
  border-color: #ffffff #404040 #404040 #ffffff;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.4);
  padding: 0;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  min-width: 320px;
}
.gallery-lightbox-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  overflow: auto;
}
.gallery-lightbox-body img {
  max-width: 80vw;
  max-height: 70vh;
  border: 2px solid #404040;
  background: #fff;
  display: block;
}
.gallery-lightbox-meta {
  font-family: Tahoma, sans-serif;
  font-size: 12px;
  color: #1c1c1c;
  text-align: center;
}
.gallery-lightbox-meta strong { color: #6a2c91; }

/* --- Featured Art slideshow --- */
.featured-frame {
  background: #d4d0c8;
  padding: 12px;
}
.featured-slot {
  position: relative;
  background:
    linear-gradient(135deg, #6a2c91 0%, #ff2bd6 45%, #ff80c0 70%, #00e0ff 100%);
  padding: 14px;
  min-height: 420px;
  border: 2px solid;
  border-color: #404040 #ffffff #ffffff #404040;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.featured-img {
  position: absolute;
  inset: 14px;
  margin: auto;
  max-width: calc(100% - 28px);
  max-height: calc(100% - 28px);
  width: auto;
  height: auto;
  object-fit: contain;
  background: #fff;
  border: 4px solid #fff;
  box-shadow: 0 0 30px rgba(255,43,214,0.6), 4px 4px 0 rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 800ms ease-in-out;
}
.featured-img.is-on { opacity: 1; }
.featured-empty {
  color: #fff;
  font-family: Tahoma, sans-serif;
  font-size: 13px;
  text-align: center;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
  padding: 20px;
}
.featured-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  background: #d4d0c8;
  border-top: 2px solid #808080;
}
.featured-meta {
  font-family: Tahoma, sans-serif;
  font-size: 11px;
  color: #404040;
}
.featured-meta strong { color: #6a2c91; }

/* --- BBS art picker overlay --- */
.bbs-picker {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.bbs-picker-window {
  position: static;
  width: 720px;
  max-width: 96vw;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.bbs-picker .paint-thumb-grid {
  max-height: 68vh;
}

/* BBS composer button row addition */
.forum-btn-row .bbs-insert-art-btn {
  margin-left: auto;
}

/* BBS art embed (rendered when forum post contains [art:title](url)) */
.forum-art-embed {
  display: inline-block;
  margin: 6px 0;
  padding: 4px;
  background: #fff;
  border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  max-width: 360px;
}
.forum-art-embed img {
  display: block;
  max-width: 100%;
  max-height: 280px;
  border: 1px solid #808080;
  background: #efefef;
}
.forum-art-caption {
  font-family: Tahoma, sans-serif;
  font-size: 10px;
  color: #6a2c91;
  text-align: center;
  margin-top: 3px;
}

/* --- Mobile / touch tweaks --- */
@media (max-width: 1024px), (pointer: coarse) {
  body.force-mobile .win98-window.window-paint,
  body.force-mobile .win98-window.window-gallery,
  body.force-mobile .win98-window.window-featured {
    width: 96vw;
    min-height: auto;
  }
  .paint-stage { flex-direction: column; }
  .paint-tools {
    width: 100%;
    flex: 0 0 auto;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }
  .paint-tools-row { display: flex; flex-wrap: wrap; gap: 2px; }
  .paint-tool-btn { width: 38px; height: 38px; }
  .paint-palette {
    grid-template-columns: repeat(8, 1fr);
    flex: 1;
    min-width: 200px;
  }
  .paint-canvas-scroll { min-height: 320px; max-height: 50vh; }
  .featured-slot { min-height: 280px; }
}

/* ============================================================ */
/* WELCOME.EXE — Site guide / sitemap window                    */
/* ============================================================ */
.window-welcome {
  width: 760px;
  height: 700px;
  top: 60px;
  left: 50%;
  margin-left: -380px;
  z-index: 100;
}

.welcome-body {
  flex: 1;
  background: #d4d0c8;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: Tahoma, Geneva, sans-serif;
  font-size: 11px;
}

.welcome-hero {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(135deg, #ff2bd6 0%, #6e2bff 50%, #2ad8ff 100%);
  color: #fff;
  border-bottom: 2px solid #000;
  flex-shrink: 0;
}

.welcome-hero-emoji {
  font-size: 32px;
  line-height: 1;
  text-shadow: 0 2px 6px rgba(0,0,0,0.35);
  flex-shrink: 0;
}

.welcome-hero-text {
  flex: 1;
  min-width: 0;
}

.welcome-hero-title {
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
  margin-bottom: 4px;
  font-family: 'Tahoma', Geneva, sans-serif;
}

.welcome-hero-sub {
  font-size: 11px;
  opacity: 0.95;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
}

.welcome-grid {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #d4d0c8;
}

.welcome-section {
  background: #ece9d8;
  border: 1px solid #808080;
  border-top-color: #fff;
  border-left-color: #fff;
  padding: 8px 10px;
  box-shadow: inset 1px 1px 0 #fff, 1px 1px 0 #404040;
}

.welcome-section-title {
  margin: 0 0 8px 0;
  font-size: 12px;
  font-weight: bold;
  color: #0a246a;
  border-bottom: 1px solid #808080;
  padding-bottom: 4px;
  font-family: Tahoma, Geneva, sans-serif;
}

.welcome-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.welcome-list li {
  margin-bottom: 8px;
  line-height: 1.4;
}

.welcome-list li:last-child {
  margin-bottom: 0;
}

.welcome-list li span {
  display: block;
  margin-top: 3px;
  color: #303030;
  font-size: 11px;
  line-height: 1.35;
}

.welcome-launch {
  display: inline-block;
  background: #d4d0c8;
  border: 1px solid;
  border-color: #fff #808080 #808080 #fff;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #404040;
  padding: 3px 10px;
  font-family: Tahoma, Geneva, sans-serif;
  font-size: 11px;
  color: #000;
  cursor: pointer;
  margin-right: 4px;
  margin-bottom: 3px;
  white-space: nowrap;
}

.welcome-launch:hover {
  background: #e8e4dc;
}

.welcome-launch:active {
  border-color: #404040 #fff #fff #404040;
  box-shadow: inset 1px 1px 0 #404040;
  padding: 4px 9px 2px 11px;
}

.welcome-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #d4d0c8;
  border-top: 1px solid #808080;
  box-shadow: inset 0 1px 0 #fff;
  flex-shrink: 0;
}

.welcome-startup-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #000;
  font-family: Tahoma, Geneva, sans-serif;
  cursor: pointer;
}

.welcome-startup-label input[type=checkbox] {
  margin: 0;
}

.welcome-footer-spacer {
  flex: 1;
}

.welcome-close-btn {
  background: #d4d0c8;
  border: 1px solid;
  border-color: #fff #808080 #808080 #fff;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #404040;
  padding: 4px 18px;
  font-family: Tahoma, Geneva, sans-serif;
  font-size: 11px;
  color: #000;
  cursor: pointer;
  min-width: 80px;
}

.welcome-close-btn:hover {
  background: #e8e4dc;
}

.welcome-close-btn:active {
  border-color: #404040 #fff #fff #404040;
  box-shadow: inset 1px 1px 0 #404040;
}

/* Mobile / narrow viewports — stack sections */
@media (max-width: 760px), (pointer: coarse) {
  .window-welcome {
    width: 92vw;
    height: 82vh;
    max-height: 82vh;
    left: 4vw;
    margin-left: 0;
    top: 30px;
  }
  .welcome-grid {
    grid-template-columns: 1fr;
  }
  .welcome-hero-emoji {
    font-size: 26px;
  }
  .welcome-hero-title {
    font-size: 15px;
  }
}

body.force-mobile .welcome-grid {
  grid-template-columns: 1fr;
}
