/* ============================================
   JubJub.app — v1.0 Stylesheet
   ============================================ */

/* Self-hosted Win95 font: put the files in /fonts */
@font-face {
  font-family: 'Pixelated MS Sans Serif';
  src: url('fonts/ms_sans_serif.woff2') format('woff2'), url('fonts/ms_sans_serif.woff') format('woff');
  font-weight: normal; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Pixelated MS Sans Serif';
  src: url('fonts/ms_sans_serif_bold.woff2') format('woff2'), url('fonts/ms_sans_serif_bold.woff') format('woff');
  font-weight: bold; font-style: normal; font-display: swap;
}

:root {
  --win-bg: #008080;
  --win-gray: #c0c0c0;
  --win-dark: #808080;
  --win-darker: #404040;
  --win-light: #dfdfdf;
  --win-white: #ffffff;
  --win-black: #000000;
  --win-blue: #000080;
  --win-blue-light: #1084d0;
  --title-active: linear-gradient(90deg, #000080, #1084d0);
  --title-inactive: linear-gradient(90deg, #808080, #b0b0b0);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Pixelated MS Sans Serif', 'MS Sans Serif', Tahoma, Geneva, sans-serif;
  font-size: 11px; overflow: hidden; height: 100vh; height: 100dvh; width: 100vw;
  user-select: none; background: var(--win-bg);
  touch-action: manipulation; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }

/* CRT SCANLINE */
#crt-overlay {
  position: fixed; inset: 0; z-index: 99998; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px);
  opacity: 0.5;
}

/* DESKTOP */
#desktop {
  position: absolute; inset: 0; bottom: 38px; padding: 16px;
  display: flex; flex-direction: column; flex-wrap: wrap;
  align-content: flex-start; gap: 6px; cursor: default;
}
.desktop-icon {
  display: flex; flex-direction: column; align-items: center;
  width: 75px; padding: 4px; cursor: pointer; border: 1px solid transparent;
}
.desktop-icon:hover { background: rgba(255,255,255,0.08); }
.desktop-icon.selected { background: rgba(0,0,128,0.35); border: 1px dotted #fff; }
.desktop-icon .icon { width: 32px; height: 32px; margin-bottom: 4px; image-rendering: pixelated; }
.desktop-icon span { color: #fff; text-align: center; font-size: 11px; text-shadow: 1px 1px 1px rgba(0,0,0,0.8); word-break: break-word; line-height: 1.3; }

/* BORDERS */
.raised { border-top: 2px solid var(--win-white); border-left: 2px solid var(--win-white); border-bottom: 2px solid var(--win-darker); border-right: 2px solid var(--win-darker); }
.sunken { border-top: 2px solid var(--win-darker); border-left: 2px solid var(--win-darker); border-bottom: 2px solid var(--win-white); border-right: 2px solid var(--win-white); }
.sunken-thin { border-top: 1px solid var(--win-dark); border-left: 1px solid var(--win-dark); border-bottom: 1px solid var(--win-white); border-right: 1px solid var(--win-white); }

/* WINDOW */
.window {
  position: absolute; background: var(--win-gray);
  min-width: 280px; min-height: 180px;
  display: flex; flex-direction: column;
  box-shadow: inset 1px 1px 0 var(--win-white), inset -1px -1px 0 var(--win-black), 2px 2px 8px rgba(0,0,0,0.35);
  border: 2px solid var(--win-gray);
  opacity: 0; transform: scale(0.85);
  animation: windowOpen 0.2s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
@keyframes windowOpen { 0%{transform:scale(0.85);opacity:0} 60%{transform:scale(1.02);opacity:1} 100%{transform:scale(1);opacity:1} }
.window.closing { animation: windowClose 0.15s ease-in forwards; }
@keyframes windowClose { from{transform:scale(1);opacity:1} to{transform:scale(0.8) translateY(20px);opacity:0} }
.window.minimizing { animation: windowMinimize 0.2s ease-in forwards; }
@keyframes windowMinimize { from{transform:scale(1);opacity:1} to{transform:scale(0.3) translateY(100vh);opacity:0} }
.window.restoring { animation: windowRestore 0.2s cubic-bezier(0.22, 0.61, 0.36, 1) forwards; }
@keyframes windowRestore { from{transform:scale(0.3) translateY(100vh);opacity:0} to{transform:scale(1) translateY(0);opacity:1} }
.window.maximized { top:0!important; left:0!important; width:100vw!important; height:calc(100vh - 38px)!important; height:calc(100dvh - 38px)!important; animation:none; transform:none; opacity:1; }
.window.minimized { display: none !important; }

.title-bar { background: var(--title-active); padding: 2px 3px; display: flex; align-items: center; gap: 3px; cursor: grab; flex-shrink: 0; touch-action: none; }
.title-bar.inactive { background: var(--title-inactive); }
.title-bar .title-icon { width: 16px; height: 16px; }
.title-bar .title-text { flex: 1; color: #fff; font-weight: bold; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 2px; }
.title-bar-controls { display: flex; gap: 2px; }
.title-btn { width: 16px; height: 14px; background: var(--win-gray); border-top: 1px solid var(--win-white); border-left: 1px solid var(--win-white); border-bottom: 1px solid var(--win-darker); border-right: 1px solid var(--win-darker); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 9px; font-weight: bold; padding-bottom: 1px; color: var(--win-black); }
.title-btn:active { border-top: 1px solid var(--win-darker); border-left: 1px solid var(--win-darker); border-bottom: 1px solid var(--win-white); border-right: 1px solid var(--win-white); padding-top:1px; padding-left:1px; }

.menu-bar { display: flex; gap: 0; padding: 1px 2px; background: var(--win-gray); border-bottom: 1px solid var(--win-dark); flex-shrink: 0; }
.menu-item { padding: 2px 6px; cursor: pointer; font-size: 11px; position: relative; }
.menu-item.open { background: var(--win-blue); color: #fff; }
.menu-dropdown { display: none; position: absolute; top: 100%; left: 0; background: var(--win-gray); min-width: 160px; z-index: 999; border: 2px solid var(--win-gray); box-shadow: inset 1px 1px 0 var(--win-white), inset -1px -1px 0 var(--win-black), 2px 2px 4px rgba(0,0,0,0.3); }
.menu-item.open .menu-dropdown { display: block; }
.menu-dropdown-item { padding: 4px 20px; font-size: 11px; cursor: pointer; white-space: nowrap; color: #000; }
.menu-dropdown-item:hover { background: var(--win-blue); color: #fff; }
.menu-dropdown-sep { height: 1px; margin: 2px 4px; border-top: 1px solid var(--win-dark); border-bottom: 1px solid var(--win-white); }

.window-body { flex: 1; margin: 3px; overflow: auto; }
.status-bar { display: flex; padding: 2px 4px; gap: 2px; flex-shrink: 0; }
.status-bar .status-section { padding: 1px 4px; font-size: 11px; flex: 1; }

/* TOOLBAR */
.toolbar { display: flex; gap: 2px; padding: 2px 4px; background: var(--win-gray); border-bottom: 1px solid var(--win-dark); flex-shrink: 0; }
.toolbar-btn { width: 24px; height: 22px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 14px; background: var(--win-gray); border: 1px solid transparent; }
.toolbar-btn:hover { border-top: 1px solid var(--win-white); border-left: 1px solid var(--win-white); border-bottom: 1px solid var(--win-darker); border-right: 1px solid var(--win-darker); }
.toolbar-sep { width: 2px; margin: 2px 3px; border-left: 1px solid var(--win-dark); border-right: 1px solid var(--win-white); }
.address-bar { display: flex; align-items: center; gap: 4px; padding: 2px 6px; background: var(--win-gray); border-bottom: 1px solid var(--win-dark); font-size: 11px; }
.address-bar input { flex: 1; font-family: inherit; font-size: 11px; padding: 1px 4px; border-top: 1px solid var(--win-darker); border-left: 1px solid var(--win-darker); border-bottom: 1px solid var(--win-white); border-right: 1px solid var(--win-white); background: #fff; outline: none; }

/* TASKBAR */
#taskbar { position: fixed; bottom: 0; left: 0; right: 0; height: 38px; background: var(--win-gray); border-top: 2px solid var(--win-white); display: flex; align-items: center; padding: 2px 3px; z-index: 10000; gap: 2px; }
#start-btn { height: 30px; padding: 2px 6px; display: flex; align-items: center; gap: 4px; font-weight: bold; font-size: 11px; cursor: pointer; background: var(--win-gray); min-width: 64px; }
#start-btn:active, #start-btn.active { border-top: 2px solid var(--win-darker); border-left: 2px solid var(--win-darker); border-bottom: 2px solid var(--win-white); border-right: 2px solid var(--win-white); }
.taskbar-divider { width: 2px; height: 26px; border-left: 1px solid var(--win-dark); border-right: 1px solid var(--win-white); margin: 0 2px; }
#task-buttons { flex: 1; min-width: 0; display: flex; gap: 2px; overflow: hidden; padding: 0 2px; }
.task-btn { height: 26px; flex: 0 1 160px; min-width: 36px; padding: 2px 6px; display: flex; align-items: center; gap: 4px; font-size: 11px; cursor: pointer; background: var(--win-gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-btn.active { border-top: 1px solid var(--win-darker); border-left: 1px solid var(--win-darker); border-bottom: 1px solid var(--win-white); border-right: 1px solid var(--win-white); background: #dfdfdf; font-weight: bold; }
#sys-tray { display: flex; align-items: center; gap: 6px; padding: 0 6px; height: 26px; }
.tray-icon { display: inline-flex; cursor: pointer; opacity: 0.85; }
.tray-icon:hover { opacity: 1; }
#clock { padding: 2px 8px; font-size: 11px; height: 26px; display: flex; align-items: center; min-width: 72px; justify-content: center; }

/* TOOLTIP */
#tooltip { position: fixed; background: #ffffe1; border: 1px solid #000; padding: 2px 6px; font-size: 11px; z-index: 99999; pointer-events: none; display: none; box-shadow: 1px 1px 2px rgba(0,0,0,0.2); }

/* START MENU */
#start-menu { position: fixed; bottom: 38px; left: 0; width: 220px; background: var(--win-gray); box-shadow: inset 1px 1px 0 var(--win-white), inset -1px -1px 0 var(--win-black), 2px -2px 8px rgba(0,0,0,0.3); border: 2px solid var(--win-gray); z-index: 10001; display: none; flex-direction: column; transform-origin: bottom left; }
#start-menu.visible { display: flex; animation: menuSlide 0.15s ease-out; }
@keyframes menuSlide { from{transform:scaleY(0.5);opacity:0} to{transform:scaleY(1);opacity:1} }
.start-sidebar { position: absolute; left: 0; top: 0; bottom: 0; width: 26px; background: linear-gradient(to top, #000080, #1084d0); display: flex; align-items: flex-end; padding-bottom: 6px; justify-content: center; }
.start-sidebar span { writing-mode: vertical-rl; transform: rotate(180deg); color: #c0c0c0; font-weight: bold; font-size: 15px; letter-spacing: 2px; }
.start-menu-items { margin-left: 26px; display: flex; flex-direction: column; padding: 2px 0; }
.start-menu-item { display: flex; align-items: center; gap: 8px; padding: 7px 14px; cursor: pointer; font-size: 11px; }
.start-menu-item:hover { background: var(--win-blue); color: #fff; }
.start-sep { height: 1px; margin: 2px 26px 2px 30px; border-top: 1px solid var(--win-dark); border-bottom: 1px solid var(--win-white); }

/* RIGHT CLICK MENU */
#context-menu { position: fixed; background: var(--win-gray); min-width: 160px; z-index: 50001; box-shadow: inset 1px 1px 0 var(--win-white), inset -1px -1px 0 var(--win-black), 2px 2px 4px rgba(0,0,0,0.3); border: 2px solid var(--win-gray); display: none; padding: 2px 0; }
.ctx-item { padding: 4px 24px; font-size: 11px; cursor: pointer; white-space: nowrap; }
.ctx-item:hover { background: var(--win-blue); color: #fff; }
.ctx-sep { height: 1px; margin: 2px 4px; border-top: 1px solid var(--win-dark); border-bottom: 1px solid var(--win-white); }
.ctx-item.disabled { color: var(--win-dark); pointer-events: none; }

/* CONTENT STYLES */
.notepad-content { background: #fff; padding: 6px 8px; font-family: 'Courier New', monospace; font-size: 13px; line-height: 1.6; white-space: pre-wrap; height: 100%; overflow: auto; color: #000; outline: none; }
.notepad-content:focus { background: #fffff8; }

.explorer-content { background: #fff; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, 96px); gap: 8px; height: 100%; overflow: auto; align-content: start; }
.folder-item { display: flex; flex-direction: column; align-items: center; cursor: pointer; padding: 6px 4px; border: 1px solid transparent; text-align: center; }
.folder-item:hover { background: #e8e8f0; }
.folder-item.selected { background: var(--win-blue); color: #fff; }
.folder-item .fi-icon { width: 32px; height: 32px; margin-bottom: 4px; transition: transform 0.1s; }
.folder-item:hover .fi-icon { transform: scale(1.12); }
.folder-item span { font-size: 11px; word-break: break-word; line-height: 1.2; }

.win-btn { padding: 4px 18px; background: var(--win-gray); font-size: 11px; font-family: inherit; color: #000; cursor: pointer; margin: 2px; }
.win-btn.raised:active:not(:disabled) { border-top: 2px solid var(--win-darker); border-left: 2px solid var(--win-darker); border-bottom: 2px solid var(--win-white); border-right: 2px solid var(--win-white); }
.win-btn:focus-visible, .win-btn:focus { outline: 1px dotted #000; outline-offset: -5px; }
.win-btn:disabled { color: var(--win-dark); text-shadow: 1px 1px 0 var(--win-white); cursor: default; }

/* Win95 checkbox + dropdown */
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 13px; height: 13px; flex-shrink: 0; margin: 0; background: #fff;
  box-shadow: inset 1px 1px 0 var(--win-dark), inset -1px -1px 0 var(--win-white), inset 2px 2px 0 var(--win-darker), inset -2px -2px 0 var(--win-light);
}
input[type="checkbox"]:checked { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13'%3E%3Cpath d='M3 5v2l2 2 5-5V2L5 7z' fill='%23000'/%3E%3C/svg%3E") no-repeat center; }
.win-select { font-family: inherit; font-size: 11px; padding: 2px 4px; background: #fff; color: #000; border-top: 1px solid var(--win-darker); border-left: 1px solid var(--win-darker); border-bottom: 1px solid var(--win-white); border-right: 1px solid var(--win-white); border-radius: 0; outline: none; min-width: 110px; }

/* PROJECT DETAIL */
.project-detail { background: #fff; padding: 20px; height: 100%; overflow: auto; font-size: 12px; line-height: 1.7; color: #000; }
.project-detail h2 { font-size: 18px; margin-bottom: 10px; color: var(--win-blue); border-bottom: 2px solid var(--win-blue); padding-bottom: 6px; }
.project-detail .tag { display: inline-block; background: var(--win-gray); border: 1px solid var(--win-dark); padding: 2px 8px; margin: 2px; font-size: 10px; }
.project-links { margin-top: 16px; display: flex; gap: 4px; flex-wrap: wrap; }

.about-sys { padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; height: 100%; justify-content: center; }
.about-sys .logo { line-height: 0; }
.about-sys h2 { font-size: 16px; font-weight: bold; }
.about-sys p { font-size: 11px; line-height: 1.7; max-width: 380px; }

/* DIALOG */
.dialog-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.2); z-index: 50000; display: flex; align-items: center; justify-content: center; animation: dialogFade 0.1s ease; }
@keyframes dialogFade { from{opacity:0} to{opacity:1} }
.dialog-box { background: var(--win-gray); min-width: 320px; max-width: 420px; box-shadow: inset 1px 1px 0 var(--win-white), inset -1px -1px 0 var(--win-black), 3px 3px 10px rgba(0,0,0,0.4); border: 2px solid var(--win-gray); animation: dialogPop 0.15s ease-out; }
@keyframes dialogPop { from{transform:scale(0.9)} to{transform:scale(1)} }
.dialog-body { padding: 20px; display: flex; gap: 16px; align-items: flex-start; font-size: 12px; line-height: 1.6; }
.dialog-icon { width: 32px; height: 32px; flex-shrink: 0; }
.dialog-buttons { padding: 8px 20px 14px; display: flex; justify-content: center; gap: 8px; }

.resize-handle { position: absolute; bottom: 0; right: 0; width: 16px; height: 16px; cursor: nwse-resize; touch-action: none; background: linear-gradient(135deg, transparent 50%, var(--win-dark) 50%, var(--win-dark) 57%, transparent 57%, transparent 64%, var(--win-dark) 64%, var(--win-dark) 71%, transparent 71%, transparent 78%, var(--win-dark) 78%, var(--win-dark) 86%, transparent 86%); }

/* SCROLLBAR */
::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-track { background: #dfdfdf; }
::-webkit-scrollbar-thumb { background: var(--win-gray); border-top: 2px solid var(--win-white); border-left: 2px solid var(--win-white); border-bottom: 2px solid var(--win-darker); border-right: 2px solid var(--win-darker); }

/* BOOT */
#boot-screen { position: fixed; inset: 0; background: #000; z-index: 99999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; transition: opacity 0.6s; }
#boot-screen.hidden { opacity: 0; pointer-events: none; }
.boot-logo { font-size: 42px; color: #fff; font-family: 'VT323', monospace; letter-spacing: 5px; }
.boot-sub { color: #aaa; font-family: 'VT323', monospace; font-size: 16px; }
.boot-bar-outer { width: 320px; height: 22px; border: 2px solid #555; background: #222; overflow: hidden; }
.boot-bar-outer { max-width: 80vw; }
.boot-bar-inner { height: 100%; width: 0%; background: repeating-linear-gradient(90deg, #000080 0px, #000080 8px, #0000a0 8px, #0000a0 10px); transition: width 0.15s; }
.power-off { position: fixed; inset: 0; background: #000; display: flex; align-items: center; justify-content: center; padding: 16px; text-align: center; color: #ff8800; font-family: 'VT323', monospace; font-size: 28px; letter-spacing: 3px; }

.fade-in { animation: fadeIn 0.5s ease-out forwards; opacity: 0; }
@keyframes fadeIn { to { opacity: 1; } }
.fade-in-delay-1 { animation-delay: 0.15s; }
.fade-in-delay-2 { animation-delay: 0.3s; }
.fade-in-delay-3 { animation-delay: 0.45s; }
.fade-in-delay-4 { animation-delay: 0.6s; }

/* ============================================
   CONTROL PANEL
   ============================================ */
.cp-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: 16px; height: 100%; overflow: auto; align-content: start;
}
.cp-section {
  background: var(--win-gray); padding: 12px;
  border-top: 1px solid var(--win-white); border-left: 1px solid var(--win-white);
  border-bottom: 1px solid var(--win-darker); border-right: 1px solid var(--win-darker);
}
.cp-section h3 { font-size: 12px; color: var(--win-blue); margin-bottom: 8px; border-bottom: 1px solid var(--win-dark); padding-bottom: 4px; }
.cp-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 11px; }
.cp-row label { min-width: 70px; }
.cp-color-grid { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0; }
.cp-color-swatch {
  width: 28px; height: 28px; cursor: pointer;
  border: 2px solid var(--win-darker);
}
.cp-color-swatch:hover { border-color: var(--win-black); }
.cp-color-swatch.active { border: 2px solid #fff; outline: 2px solid var(--win-black); }
.cp-checkbox { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 11px; margin: 4px 0; }
.cp-checkbox input[type="checkbox"] { cursor: pointer; }
.cp-datetime { font-family: 'Courier New', monospace; font-size: 22px; text-align: center; padding: 12px; letter-spacing: 2px; }
.cp-date { font-size: 12px; text-align: center; color: var(--win-darker); margin-top: 4px; }

/* ============================================
   RECYCLE BIN
   ============================================ */
.recycle-content { background: #fff; padding: 12px; height: 100%; overflow: auto; }
.recycle-empty-msg { text-align: center; color: var(--win-dark); padding: 40px 16px; font-size: 12px; }
.recycle-item {
  display: flex; align-items: center; gap: 8px; padding: 4px 8px;
  font-size: 11px; cursor: pointer; border: 1px solid transparent;
}
.recycle-item:hover { background: #e8e8f0; }
.recycle-item.selected { background: var(--win-blue); color: #fff; }
.recycle-item .ri-icon { width: 16px; height: 16px; flex-shrink: 0; }
.recycle-item .ri-name { flex: 1; }
.recycle-item .ri-date { color: var(--win-dark); font-size: 10px; }
.recycle-toolbar { display: flex; gap: 4px; padding: 4px; margin-bottom: 8px; }

/* ============================================
   BLUE SCREEN OF DEATH
   ============================================ */
#bsod {
  position: fixed; inset: 0; z-index: 999999;
  background: #0000aa; color: #ffffff;
  font-family: 'Courier New', monospace;
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px; text-align: center;
  cursor: default;
}
#bsod.visible { display: flex; }
#bsod .bsod-title {
  background: #aaaaaa; color: #0000aa;
  padding: 2px 12px; font-size: 16px;
  font-weight: bold; margin-bottom: 24px;
  letter-spacing: 3px;
}
#bsod .bsod-text {
  font-size: 14px; line-height: 1.8;
  max-width: 600px; text-align: left;
}
#bsod .bsod-blink {
  margin-top: 24px; font-size: 14px;
  animation: bsodBlink 1s step-end infinite;
}
@keyframes bsodBlink { 0%,50%{opacity:1} 51%,100%{opacity:0} }

/* ============================================
   KONAMI CODE EASTER EGG
   ============================================ */
.konami-active {
  animation: konamiRainbow 2s linear infinite;
}
@keyframes konamiRainbow {
  0%   { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}
.konami-toast {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: #000; color: #0f0;
  font-family: 'VT323', monospace;
  font-size: 28px; padding: 24px 48px;
  z-index: 99999; border: 3px solid #0f0;
  box-shadow: 0 0 30px rgba(0,255,0,0.5), inset 0 0 30px rgba(0,255,0,0.1);
  text-align: center; letter-spacing: 2px;
  animation: konamiPop 0.4s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
@keyframes konamiPop {
  0%   { transform: translate(-50%, -50%) scale(0) rotate(-10deg); }
  60%  { transform: translate(-50%, -50%) scale(1.1) rotate(2deg); }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
}

/* ============================================
   CLIPPY
   ============================================ */
#clippy {
  position: fixed; right: 12px; bottom: 46px; z-index: 20000;
  display: flex; flex-direction: column; align-items: flex-end;
  animation: clippyIn 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}
#clippy.leaving { animation: clippyOut 0.3s ease-in forwards; }
@keyframes clippyIn { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes clippyOut { to { transform: translateY(40px); opacity: 0; } }
.clippy-bubble {
  position: relative; width: 250px; max-width: calc(100vw - 24px); margin-bottom: 12px; margin-right: 18px;
  background: #ffffe1; border: 1px solid #000; border-radius: 8px; padding: 10px 12px 8px;
  font-size: 11px; line-height: 1.55; color: #000; box-shadow: 2px 2px 0 rgba(0,0,0,0.25);
}
.clippy-bubble::after {
  content: ''; position: absolute; bottom: -11px; right: 28px; width: 16px; height: 11px;
  background: #ffffe1; border-right: 1px solid #000; clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.clippy-bubble::before {
  content: ''; position: absolute; bottom: -12px; right: 27px; width: 18px; height: 12px;
  background: #000; clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.clippy-bubble.pop { animation: bubblePop 0.18s ease-out; }
@keyframes bubblePop { from { transform: scale(0.94); opacity: 0.4; } to { transform: none; opacity: 1; } }
.clippy-actions { display: flex; justify-content: flex-end; align-items: center; gap: 2px; margin-top: 8px; }
.clippy-actions:empty { display: none; }
.clippy-actions .win-btn { padding: 2px 10px; }
.clippy-link { margin-right: auto; background: none; border: none; padding: 0; font: inherit; font-size: 11px; color: var(--win-blue); text-decoration: underline; cursor: pointer; }
.clippy-body { cursor: pointer; line-height: 0; animation: clippyBob 3s ease-in-out infinite; }
.clippy-body.boing { animation: clippyBoing 0.5s ease-out; }
@keyframes clippyBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes clippyBoing { 0% { transform: scale(1,1); } 30% { transform: scale(1.15,0.85); } 60% { transform: scale(0.92,1.1) translateY(-8px); } 100% { transform: scale(1,1); } }
.clippy-eyes { transform-box: fill-box; transform-origin: center; animation: clippyBlink 4.5s infinite; }
@keyframes clippyBlink { 0%,94%,100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }
.clippy-brow-sass { animation: clippySass 6s ease-in-out infinite; }
@keyframes clippySass { 0%,70%,100% { transform: translateY(0); } 75%,85% { transform: translateY(-3px); } }

/* ============================================
   SCREENSAVER
   ============================================ */
#screensaver { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 99997; background: #000; cursor: none; }

/* ============================================
   MOBILE / TOUCH
   ============================================ */
@media (hover: none) {
  .title-btn { width: 22px; height: 20px; font-size: 11px; }
  .title-bar-controls { gap: 4px; }
  .resize-handle { width: 24px; height: 24px; }
  .menu-item { padding: 4px 9px; }
  .menu-dropdown-item { padding: 8px 20px; }
  .start-menu-item { padding: 10px 14px; }
  .ctx-item { padding: 8px 24px; }
  .toolbar-btn { width: 30px; height: 26px; }
}
@media (max-width: 600px) {
  .dialog-box { min-width: 0 !important; width: calc(100vw - 32px); }
  .cp-grid { grid-template-columns: 1fr; }
  .recycle-item .ri-date { display: none; }
  .explorer-content { grid-template-columns: repeat(auto-fill, 84px); }
  .notepad-content { font-size: 12px; }
  #clippy { right: 6px; }
}
