/* ============================================================
   retro.css — Retro Experience Layer for mashpit.net
   All CSS for 14 retro features
   ============================================================ */

/* ─── 1. BIOS Boot Screen ─────────────────────────────────── */
#bootScreen {
  position: fixed;
  inset: 0;
  background: #000;
  color: #00cc00;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  line-height: 1.6;
  padding: 24px 28px;
  z-index: 99999;
  white-space: pre-wrap;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: opacity 0.5s ease;
}

#bootScreen.fade-out {
  opacity: 0;
  pointer-events: none;
}

#bootText {
  flex: 1;
}

/* ─── 2. Dial-Up Sign-On Progress ──────────────────────────── */
#dialupOverlay {
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 14px;
  background: #d4d0c8;
}

#dialupOverlay.active {
  display: flex;
}

#dialupStatus {
  font-family: Tahoma, 'MS Sans Serif', Arial, sans-serif;
  font-size: 11px;
  color: #000;
}

#dialupBarWrap {
  width: 100%;
  height: 18px;
  background: #fff;
  border: 2px inset #808080;
  position: relative;
  overflow: hidden;
}

#dialupBar {
  height: 100%;
  width: 0%;
  background: #000080;
  transition: width 0.25s linear;
  position: relative;
}

#dialupBarText {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 10px;
  color: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
}

/* ─── 3. My Computer Window ─────────────────────────────────── */
#win-mycomputer {
  width: 520px;
  top: 80px;
  left: 280px;
  display: none;
  flex-direction: column;
}

.mycomp-toolbar {
  background: #d4d0c8;
  border-bottom: 1px solid #808080;
  padding: 2px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
  flex-shrink: 0;
}

.mycomp-toolbar-btn {
  background: #d4d0c8;
  border: 1px solid transparent;
  font-size: 11px;
  font-family: Tahoma, Arial, sans-serif;
  padding: 2px 6px;
  cursor: default;
}

.mycomp-toolbar-btn:hover {
  border-top-color: #fff;
  border-left-color: #fff;
  border-right-color: #808080;
  border-bottom-color: #808080;
}

.mycomp-body {
  display: flex;
  flex: 1;
  min-height: 300px;
  overflow: hidden;
}

.mycomp-tree {
  width: 160px;
  min-width: 140px;
  border-right: 1px solid #808080;
  overflow-y: auto;
  background: #fff;
  flex-shrink: 0;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 12px;
  padding: 4px 0;
}

.mycomp-tree-item {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 4px;
  cursor: default;
  white-space: nowrap;
  user-select: none;
  color: #000;
}

.mycomp-tree-item:hover {
  background: #cce8ff;
}

.mycomp-tree-item.selected {
  background: #000080;
  color: #fff;
}

.mycomp-tree-toggle {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid #808080;
  background: #fff;
  font-size: 9px;
  line-height: 10px;
  text-align: center;
  cursor: pointer;
  font-family: monospace;
  flex-shrink: 0;
  color: #000;
}

.mycomp-tree-toggle.expanded::after { content: '−'; }
.mycomp-tree-toggle.collapsed::after { content: '+'; }
.mycomp-tree-toggle.leaf { visibility: hidden; }

.mycomp-tree-icon {
  font-size: 13px;
  flex-shrink: 0;
}

.mycomp-tree-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mycomp-tree-children {
  padding-left: 18px;
}

.mycomp-files {
  flex: 1;
  overflow-y: auto;
  background: #fff;
  padding: 4px;
}

.mycomp-files-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-content: flex-start;
}

.mycomp-file-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
  padding: 6px 4px;
  cursor: default;
  text-align: center;
  border: 1px solid transparent;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
  word-break: break-word;
  user-select: none;
}

.mycomp-file-item:hover {
  background: #cce8ff;
  border-color: #3399ff;
}

.mycomp-file-item:active,
.mycomp-file-item.selected {
  background: #000080;
  color: #fff;
}

.mycomp-file-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 4px;
}

.mycomp-file-name {
  font-size: 10px;
  line-height: 1.2;
  max-width: 78px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.mycomp-statusbar {
  background: #d4d0c8;
  border-top: 1px solid #808080;
  padding: 2px 8px;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
  color: #000;
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

/* ─── 4. Stoner Clippy ──────────────────────────────────────── */
#retroClippy {
  position: fixed;
  bottom: 60px;
  right: 20px;
  z-index: 9000;
  display: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  pointer-events: none;
}

#retroClippy.visible {
  display: flex;
  pointer-events: auto;
  animation: clippyBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes clippyBounce {
  0% { transform: translateY(40px) scale(0.7); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

#clippySpeech {
  background: #ffffe1;
  border: 1px solid #000;
  border-radius: 3px;
  padding: 8px 10px;
  font-family: Tahoma, 'MS Sans Serif', Arial, sans-serif;
  font-size: 11px;
  max-width: 220px;
  line-height: 1.4;
  position: relative;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

#clippySpeech::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 28px;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 8px solid #000;
}

#clippySpeech::before {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 29px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #ffffe1;
  z-index: 1;
}

#clippyDismiss {
  position: absolute;
  top: 2px;
  right: 3px;
  width: 14px;
  height: 14px;
  font-size: 9px;
  line-height: 14px;
  text-align: center;
  cursor: pointer;
  background: #d4d0c8;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  font-family: Tahoma, Arial, sans-serif;
  color: #000;
  padding: 0;
}

/* Clippy SVG character container */
#clippyChar {
  width: 52px;
  height: 70px;
  position: relative;
  flex-shrink: 0;
}

/* Smoke animation */
.clippy-smoke {
  position: absolute;
  bottom: 10px;
  right: 4px;
  width: 8px;
  opacity: 0.6;
}

.smoke-wisp {
  width: 4px;
  height: 16px;
  background: linear-gradient(to top, rgba(180,180,180,0.8), transparent);
  border-radius: 4px;
  margin: 0 auto;
  animation: smokeFloat 2s ease-in-out infinite;
  transform-origin: bottom center;
}

.smoke-wisp:nth-child(2) {
  animation-delay: 0.7s;
  opacity: 0.5;
}

@keyframes smokeFloat {
  0% { transform: translateY(0) scaleX(1); opacity: 0.6; }
  50% { transform: translateY(-8px) scaleX(1.5) rotate(5deg); opacity: 0.4; }
  100% { transform: translateY(-16px) scaleX(0.5) rotate(-5deg); opacity: 0; }
}

/* ─── 5. BSOD ───────────────────────────────────────────────── */
#bsodOverlay {
  position: fixed;
  inset: 0;
  background: #0000AA;
  color: #fff;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  line-height: 1.8;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99990;
  padding: 40px;
  text-align: left;
  cursor: pointer;
}

#bsodOverlay.active {
  display: flex;
}

#bsodContent {
  max-width: 600px;
}

#bsodContent h2 {
  font-size: 14px;
  font-weight: normal;
  margin-bottom: 24px;
  font-family: 'Courier New', Courier, monospace;
  background: #fff;
  color: #0000AA;
  padding: 2px 6px;
  display: inline-block;
}

#bsodContent p {
  margin: 0 0 12px 0;
}

.bsod-blink {
  animation: bsodBlink 1s step-end infinite;
}

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

/* Fake reboot flash */
#bsodReboot {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 99991;
  display: none;
}

#bsodReboot.active {
  display: block;
}

/* ─── 6. Screensaver (Starfield) ────────────────────────────── */
#screensaverOverlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 99980;
  display: none;
  cursor: none;
}

#screensaverOverlay.active {
  display: block;
}

#screensaverCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

#screensaverLabel {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.3);
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 18px;
  letter-spacing: 4px;
  pointer-events: none;
  animation: ssLabelPulse 3s ease-in-out infinite;
}

@keyframes ssLabelPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* ─── 7. Subliminal Flash Messages ──────────────────────────── */
#subliminalFlash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9500;
  overflow: hidden;
}

.sublim-word {
  position: absolute;
  font-family: 'VT323', 'Press Start 2P', monospace;
  font-size: 72px;
  color: #fff;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.08s ease;
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(255,255,255,0.3);
}

/* ─── 8. Cursor Trail ───────────────────────────────────────── */
#cursorTrailCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9800;
}

/* ─── 9. Right-Click Context Menu ───────────────────────────── */
#retroContextMenu {
  position: fixed;
  background: #d4d0c8;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  z-index: 99500;
  min-width: 180px;
  display: none;
  padding: 2px 0;
  font-family: Tahoma, 'MS Sans Serif', Arial, sans-serif;
  font-size: 11px;
}

#retroContextMenu.active {
  display: block;
}

.ctx-item {
  padding: 4px 24px 4px 12px;
  cursor: default;
  white-space: nowrap;
  color: #000;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ctx-item:hover {
  background: #000080;
  color: #fff;
}

.ctx-separator {
  height: 1px;
  background: #808080;
  margin: 2px 4px;
}

.ctx-item.disabled {
  color: #808080;
  pointer-events: none;
}

/* ─── 10. Chat system message (door sounds) ─────────────────── */
.chat-system-msg {
  font-style: italic;
  color: #666;
  text-align: center;
  font-size: 11px;
  font-family: Tahoma, Arial, sans-serif;
  padding: 2px 8px;
  display: block;
}

/* ─── 11. Vinyl Crackle toggle indicator ────────────────────── */
#vinylToggle {
  position: fixed;
  bottom: 46px;
  right: 80px;
  z-index: 9000;
  background: #d4d0c8;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  font-size: 14px;
  padding: 3px 7px;
  cursor: pointer;
  font-family: Tahoma, Arial, sans-serif;
  line-height: 1;
  opacity: 0.7;
  title: 'Toggle Vinyl Crackle';
}

#vinylToggle:hover {
  opacity: 1;
}

#vinylToggle.active {
  background: #808080;
  color: #fff;
  border-top-color: #808080;
  border-left-color: #808080;
  border-right-color: #fff;
  border-bottom-color: #fff;
}

/* ─── 12. You've Got Mail taskbar badge ─────────────────────── */
#mailBadge {
  display: none;
  animation: mailBounce 0.5s ease infinite alternate;
  font-size: 16px;
  line-height: 1;
  cursor: default;
  padding: 0 4px;
}

#mailBadge.visible {
  display: inline-block;
}

@keyframes mailBounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

/* ─── 13. Fake Popup Ads ────────────────────────────────────── */
.retro-popup-ad {
  position: fixed;
  width: 260px;
  background: #d4d0c8;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.4);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  font-family: Tahoma, 'MS Sans Serif', Arial, sans-serif;
}

.retro-popup-ad .win98-titlebar {
  background: linear-gradient(90deg, #8b0000 0%, #cc0000 100%);
  cursor: default;
}

.retro-popup-body {
  padding: 12px 14px;
  font-size: 11px;
  line-height: 1.5;
  color: #000;
  min-height: 60px;
}

.retro-popup-footer {
  display: flex;
  justify-content: flex-end;
  padding: 6px 8px;
  border-top: 1px solid #808080;
  background: #d4d0c8;
  gap: 4px;
}

/* ─── 14. Away Message ──────────────────────────────────────── */
#awayModal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99000;
  display: none;
  align-items: center;
  justify-content: center;
}

#awayModal.active {
  display: flex;
}

#awayModalWin {
  width: 320px;
  background: #d4d0c8;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
}

.away-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
}

.away-presets {
  width: 100%;
  height: 100px;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
  border: 2px inset #808080;
  background: #fff;
  resize: none;
  overflow-y: auto;
}

.away-label {
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
  font-weight: bold;
  color: #000;
}

.away-custom {
  width: 100%;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
  border: 2px inset #808080;
  padding: 3px;
  box-sizing: border-box;
}

.away-preset-list {
  width: 100%;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
  border: 2px inset #808080;
  background: #fff;
  padding: 2px;
  box-sizing: border-box;
}

.away-preset-list option {
  padding: 2px 4px;
}

.away-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid #808080;
}

/* Away indicator in buddy list */
#awayIndicator {
  display: none;
  padding: 3px 8px 3px 8px;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 10px;
  color: #888;
  font-style: italic;
  border-top: 1px solid #c0c0c0;
  background: #e8e8e0;
}

#awayIndicator.active {
  display: block;
}

.away-icon {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #cccc00;
  border: 1px solid #888800;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

/* Away button in online tab */
#awayBtn {
  margin: 4px 8px;
  font-size: 10px;
  font-family: Tahoma, Arial, sans-serif;
  padding: 3px 10px;
  cursor: pointer;
  background: #d4d0c8;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  color: #000;
}

#awayBtn:hover {
  background: #c0bdb4;
}

#awayBtn.away-active {
  background: #808080;
  border-top-color: #808080;
  border-left-color: #808080;
  border-right-color: #fff;
  border-bottom-color: #fff;
}

/* ─── Retro Dialog (generic Win98-style modal) ──────────────── */
.retro-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 98000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.retro-dialog {
  background: #d4d0c8;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.4);
  min-width: 220px;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
}

.retro-dialog-body {
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  line-height: 1.5;
}

.retro-dialog-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.retro-dialog-text {
  flex: 1;
  white-space: pre-wrap;
  word-break: break-word;
}

.retro-dialog-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid #808080;
}

/* ─── "View Source" fake popup ──────────────────────────────── */
#viewSourceWin {
  position: fixed;
  top: 60px;
  left: 60px;
  width: 500px;
  max-height: 70vh;
  background: #d4d0c8;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.4);
  z-index: 97000;
  display: none;
  flex-direction: column;
}

#viewSourceWin.active {
  display: flex;
}

#viewSourceBody {
  overflow-y: auto;
  padding: 8px;
  flex: 1;
  background: #fff;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  line-height: 1.5;
  color: #000;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ─── Desktop Properties fake dialog ───────────────────────── */
#deskPropsWin {
  position: fixed;
  top: 80px;
  left: 80px;
  width: 320px;
  background: #d4d0c8;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.4);
  z-index: 97000;
  display: none;
  flex-direction: column;
}

#deskPropsWin.active {
  display: flex;
}

.deskprops-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #808080;
  background: #d4d0c8;
  padding: 4px 4px 0;
  flex-shrink: 0;
}

.deskprops-tab {
  background: #d4d0c8;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  padding: 3px 12px;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
  cursor: default;
  margin-bottom: -1px;
}

.deskprops-tab.active {
  border-bottom-color: #d4d0c8;
  z-index: 1;
  font-weight: bold;
}

.deskprops-body {
  padding: 12px;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
  line-height: 1.6;
  flex: 1;
}

.deskprops-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  border-bottom: 1px dotted #c0c0c0;
}

.deskprops-label {
  color: #444;
}

.deskprops-val {
  font-weight: bold;
  color: #000;
}

/* ─── Ensure signed-off hides retro overlays except bootscreen ─ */
body.signed-off #retroClippy,
body.signed-off #vinylToggle,
body.signed-off #screensaverOverlay,
body.signed-off #cursorTrailCanvas,
body.signed-off #retroContextMenu {
  display: none !important;
}

/* ─── Mobile: hide desktop-only retro features ──────────────── */
body.mobile #bootScreen,
body.mobile #cursorTrailCanvas,
body.mobile #retroContextMenu,
body.mobile #screensaverOverlay {
  display: none !important;
}
