/* ==========================================
   WINDOWS XP UI STYLES
   ========================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { height: 100%; }

body {
  font-family: 'Tahoma', 'Microsoft YaHei', sans-serif;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  user-select: none;
}

/* ---- Boot Screen ---- */
.boot-screen {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  z-index: 99999;
  transition: opacity 1.5s ease;
}
.boot-screen.fade-out { opacity: 0; }
.boot-logo { text-align: center; }
.xp-logo-text {
  color: #fff;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 1px;
  margin-bottom: 30px;
  font-family: 'Franklin Gothic Medium', 'Tahoma', sans-serif;
}
.boot-bar-container {
  width: 200px; height: 16px;
  background: #1a1a3a;
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
  margin: 0 auto;
}
.boot-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #0055ea, #4488ff, #0055ea);
  background-size: 200% 100%;
  animation: bootLoad 2.5s ease forwards, bootShimmer 1s linear infinite;
  border-radius: 8px;
}
@keyframes bootLoad { to { width: 100%; } }
@keyframes bootShimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ---- Desktop ---- */
.desktop {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 100vh;
  background: url('/xp-wallpaper.jpeg') center/cover no-repeat;
  padding: 15px;
  z-index: 1;
  transition: filter 0.5s;
}
.desktop.ocd-dreamy {
  filter: blur(0.5px) saturate(0.8) brightness(0.95);
}

/* ---- Desktop Icons ---- */
.desktop-icon {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: 75px;
  padding: 5px;
  cursor: pointer;
  border-radius: 3px;
  margin-bottom: 5px;
  vertical-align: top;
}
.desktop-icon:hover {
  background: rgba(11, 97, 255, 0.25);
  outline: 1px dotted rgba(255,255,255,0.5);
}
.icon-img {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin-bottom: 3px;
}
.icon-label {
  color: #fff;
  font-size: 11px;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  line-height: 1.3;
  word-break: break-all;
}

/* ---- Taskbar ---- */
.taskbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 36px;
  background: linear-gradient(180deg, #245edb 0%, #3c7be3 4%, #245edb 6%, #1941a5 100%);
  display: flex;
  align-items: center;
  z-index: 10000;
  border-top: 1px solid #0c3e9e;
}
.start-btn {
  display: flex; align-items: center;
  height: 100%;
  padding: 0 12px 0 6px;
  background: linear-gradient(180deg, #3c9c3c 0%, #2d8c2d 50%, #1c7c1c 100%);
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  border-right: 1px solid #1a6b1a;
  border-radius: 0 8px 8px 0;
}
.start-btn:hover { filter: brightness(1.1); }
.start-btn span { margin-left: 4px; }
.taskbar-items {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 5px;
  gap: 2px;
  overflow: hidden;
}
.taskbar-item {
  display: flex; align-items: center;
  padding: 2px 10px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 3px;
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  max-width: 160px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.taskbar-item.active {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.4);
}
.taskbar-item span { margin-right: 4px; }
.system-tray {
  display: flex; align-items: center; gap: 6px;
  padding: 0 10px;
  border-left: 1px solid rgba(255,255,255,0.2);
  height: 100%;
  color: #fff;
  font-size: 12px;
}
.network-disconnected { color: #ff6666; }
.network-connected { color: #66ff66; }
.mute-btn {
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  transition: opacity 0.2s;
  padding: 0 2px;
}
.mute-btn:hover {
  opacity: 0.7;
}

/* ---- Start Menu ---- */
.start-menu {
  position: fixed;
  bottom: 36px; left: 0;
  width: 250px;
  background: #fff;
  border: 2px solid #1941a5;
  border-radius: 8px 8px 0 0;
  box-shadow: 2px -2px 10px rgba(0,0,0,0.3);
  z-index: 10001;
  overflow: hidden;
}
.start-menu-item {
  padding: 8px 15px;
  font-size: 12px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}
.start-menu-item:hover {
  background: #245edb;
  color: #fff;
}
.start-menu-divider {
  height: 1px;
  background: #ccc;
  margin: 2px 0;
}

/* ---- XP Window ---- */
.xp-window {
  position: absolute;
  background: #ece9d8;
  border: 2px solid #0054e3;
  border-radius: 8px 8px 0 0;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.3);
  display: none;
  min-width: 300px;
  overflow: hidden;
}
.xp-window.visible { display: block; }

.xp-titlebar, .title-bar {
  background: linear-gradient(180deg, #0058ee 0%, #3a8cf4 8%, #0058ee 40%, #0050d8 88%, #003cba 100%);
  color: #fff;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: move;
  font-size: 12px;
  font-weight: bold;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.4);
}
.xp-title, .title-bar-text {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.xp-titlebar-btns, .title-bar-controls {
  display: flex; gap: 2px;
}
.xp-titlebar-btn, .title-bar-controls button {
  width: 22px; height: 22px;
  border: 1px solid rgba(255,255,255,0.4);
  background: linear-gradient(180deg, #4992f5, #1c5fcb);
  color: #fff;
  font-size: 10px;
  cursor: pointer;
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.xp-titlebar-btn:hover, .title-bar-controls button:hover {
  background: linear-gradient(180deg, #6aafff, #2d70e0);
}
.close-btn, .btn-close {
  background: linear-gradient(180deg, #e0855a, #c73e1d) !important;
}
.close-btn:hover, .btn-close:hover {
  background: linear-gradient(180deg, #f09570, #d74e2d) !important;
}

.window-body {
  padding: 0;
  overflow: auto;
}

/* Maximized window */
.xp-window.maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: calc(100vh - 36px) !important;
  border-radius: 0;
}

/* ---- Toolbar ---- */
.xp-toolbar {
  background: #ece9d8;
  border-bottom: 1px solid #aaa;
  padding: 3px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.toolbar-btn {
  background: none;
  border: 1px solid transparent;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
  border-radius: 3px;
}
.toolbar-btn:hover {
  border-color: #aaa;
  background: #f5f3eb;
}
.toolbar-address {
  display: flex; align-items: center; gap: 4px;
  flex: 1;
  font-size: 11px;
}
.address-bar {
  flex: 1;
  border: 1px solid #7f9db9;
  padding: 2px 5px;
  font-size: 11px;
  background: #fff;
}

/* ---- XP Button ---- */
.xp-btn {
  background: linear-gradient(180deg, #fff 0%, #ece9d8 100%);
  border: 1px solid #003c74;
  padding: 4px 16px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 3px;
  font-family: 'Tahoma', sans-serif;
}
.xp-btn:hover { background: linear-gradient(180deg, #fff 0%, #ddd8c8 100%); }
.xp-btn:active { background: #d4d0c8; }
.xp-btn.primary {
  background: linear-gradient(180deg, #5ea5ff 0%, #1c5fcb 100%);
  color: #fff;
  border-color: #003c74;
}
.xp-btn.primary:hover {
  background: linear-gradient(180deg, #6eb5ff 0%, #2c6fdb 100%);
}

/* ---- IE Offline Page ---- */
.ie-offline-page {
  padding: 30px;
  font-size: 13px;
  color: #333;
}
.ie-offline-page h2 { color: #003399; font-size: 16px; margin-bottom: 10px; }
.ie-offline-page p { margin-bottom: 8px; line-height: 1.6; }
.ie-offline-page hr { border: none; border-top: 1px solid #ccc; margin: 15px 0; }

/* ---- Notepad ---- */
.notepad-content {
  background: #fff;
  padding: 15px;
  font-family: 'Fixedsys', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.8;
  height: calc(100% - 30px);
  min-height: 300px;
  overflow-y: auto;
}
.notepad-text p { margin-bottom: 4px; }
.family-clue { color: #0055aa; font-weight: bold; }
.family-clue-redacted {
  background: #333;
  color: #333;
  padding: 0 3px;
  border-radius: 2px;
}

/* ---- Dial-up ---- */
.dialup-content {
  background: #ece9d8;
}
.dialup-banner img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.dialup-form {
  padding: 15px;
}
.dialup-field {
  margin-bottom: 10px;
}
.dialup-field label {
  display: block;
  font-size: 12px;
  margin-bottom: 3px;
}
.dialup-field input {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid #7f9db9;
  font-size: 12px;
}
.dialup-save {
  margin: 10px 0;
  font-size: 11px;
}
.dialup-radio {
  margin: 3px 0 3px 20px;
}
.dialup-btns {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 15px;
}
.dialup-status {
  font-size: 12px;
  color: #333;
  margin-bottom: 8px;
  text-align: center;
}
.dialup-bar {
  width: 100%;
  height: 16px;
  background: #fff;
  border: 1px solid #7f9db9;
  border-radius: 2px;
  overflow: hidden;
}
.dialup-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #0058ee, #4488ff);
  transition: width 0.1s;
}
.dialup-success {
  text-align: center;
  font-size: 14px;
  color: #008800;
  padding: 10px;
  font-weight: bold;
}
.dialup-stats {
  font-size: 11px;
  color: #666;
  padding: 5px 15px;
  line-height: 1.8;
}

/* ---- Modal Overlay ---- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
}
.modal-box {
  background: #ece9d8;
  border: 2px solid #0054e3;
  border-radius: 8px 8px 0 0;
  width: 420px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 3px 3px 15px rgba(0,0,0,0.4);
}
.modal-header {
  background: linear-gradient(180deg, #0058ee 0%, #0050d8 88%, #003cba 100%);
  color: #fff;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: bold;
}
.modal-close {
  background: linear-gradient(180deg, #e0855a, #c73e1d);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  width: 20px; height: 20px;
  cursor: pointer;
  border-radius: 3px;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.modal-body {
  padding: 15px;
  font-size: 13px;
  line-height: 1.6;
}

/* ---- Puzzle Input ---- */
.puzzle-input {
  width: 200px;
  padding: 5px 8px;
  border: 1px solid #7f9db9;
  font-size: 13px;
  margin-top: 5px;
}

/* ---- Sequence Puzzle ---- */
.seq-option {
  padding: 6px 10px;
  margin: 4px 0;
  background: #f5f3eb;
  border: 1px solid #ccc;
  cursor: pointer;
  font-size: 12px;
  border-radius: 3px;
  transition: background 0.2s;
}
.seq-option:hover { background: #e8e4d8; }
.seq-option.selected {
  background: #c8daf8;
  border-color: #4488ff;
}

/* ---- Find Differences ---- */
.find-diff-area {
  display: flex;
  gap: 15px;
  margin: 10px 0;
}
.diff-panel { text-align: center; }

/* ---- Message Board ---- */
.mb-messages {
  min-height: 100px;
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.mb-msg {
  margin-bottom: 12px;
  max-width: 80%;
}
.mb-msg-other { margin-right: auto; }
.mb-msg-self { margin-left: auto; text-align: right; }
.mb-msg-id {
  font-size: 11px;
  color: #888;
  margin-bottom: 3px;
}
.mb-msg-text {
  background: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid #e0e0e0;
  display: inline-block;
  text-align: left;
}
.mb-msg-self .mb-msg-text {
  background: #d4e8ff;
  border-color: #a0c4ff;
}
.mb-reply {
  margin-top: 10px;
}
.mb-reply textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  font-size: 12px;
  resize: none;
  border-radius: 4px;
  margin-bottom: 8px;
}
.mb-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.choice-a {
  background: linear-gradient(180deg, #ff9999, #cc3333) !important;
  color: #fff !important;
  border-color: #990000 !important;
}
.choice-b {
  background: linear-gradient(180deg, #99ccff, #3366cc) !important;
  color: #fff !important;
  border-color: #003399 !important;
}

/* ---- Calming ---- */
.calming-box { width: 520px; }
.calming-body { text-align: center; }
.calming-hint {
  font-size: 12px;
  color: #666;
  margin-bottom: 10px;
}
#calming-canvas {
  border: 1px solid #333;
  border-radius: 4px;
  margin: 0 auto;
  display: block;
}
.calming-thought {
  font-size: 14px;
  color: #a78bfa;
  margin: 10px 0;
  min-height: 24px;
  transition: opacity 0.5s;
}
.calming-btn { margin: 10px 0; }
.calming-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.calming-bar {
  flex: 1;
  height: 14px;
  background: #333;
  border-radius: 7px;
  overflow: hidden;
}
.calming-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #a78bfa, #66d9a0);
  transition: width 0.3s;
  border-radius: 7px;
}

/* ---- Ending Overlays ---- */
.ending-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30000;
  cursor: pointer;
}
.bad-ending-content {
  background: radial-gradient(ellipse at center, #1a1a3a 0%, #0a0a1a 100%);
}
.good-ending-content {
  background: radial-gradient(ellipse at center, #1a2a1a 0%, #0a1a0a 100%);
}
.ending-content {
  padding: 40px;
  max-width: 600px;
  text-align: center;
  color: rgba(200, 200, 255, 0.8);
  font-size: 14px;
  line-height: 2;
}
.diary-content {
  background: #f5f0e0 !important;
  border-radius: 0;
}
.diary-page {
  background: #fffef5;
  padding: 30px;
  border: 1px solid #ddd;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.1);
  max-width: 500px;
  font-family: 'Kaiti', 'STKaiti', serif;
  text-align: left;
  color: #333;
  font-size: 14px;
  line-height: 2;
}
.diary-date {
  font-size: 12px;
  color: #888;
  margin-bottom: 15px;
}
.diary-sign {
  text-align: right;
  margin-top: 15px;
  color: #666;
}
.diary-new-text {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px dashed #ccc;
  color: #7c3aed;
  font-size: 14px;
  line-height: 2;
}

/* ---- Blink cursor ---- */
.blink-cursor {
  display: inline-block;
  width: 2px;
  height: 14px;
  background: #7c3aed;
  animation: blink 1s infinite;
  vertical-align: middle;
  margin-right: 3px;
}
@keyframes blink { 0%,50%{opacity:1} 51%,100%{opacity:0} }

/* ==========================================
   DEVELOPER MODE PANEL
   ========================================== */
.dev-panel {
  position: fixed;
  top: 50px;
  right: 20px;
  width: 280px;
  max-height: 80vh;
  background: #1a1a2e;
  border: 2px solid #00ff00;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
  z-index: 99999;
  font-family: 'Consolas', 'Monaco', monospace;
  overflow: hidden;
}

.dev-panel-header {
  background: linear-gradient(180deg, #2d2d4e 0%, #1a1a2e 100%);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #00ff00;
  color: #00ff00;
  font-size: 13px;
  font-weight: bold;
}

.dev-panel-body {
  padding: 12px;
  max-height: calc(80vh - 40px);
  overflow-y: auto;
}

.dev-section {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #333;
}

.dev-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.dev-section-title {
  color: #00ff00;
  font-size: 11px;
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.dev-btn {
  display: inline-block;
  padding: 4px 8px;
  margin: 2px;
  background: #2d2d4e;
  border: 1px solid #444;
  border-radius: 3px;
  color: #ccc;
  font-size: 11px;
  font-family: 'Consolas', 'Monaco', monospace;
  cursor: pointer;
  transition: all 0.2s;
}

.dev-btn:hover {
  background: #00ff00;
  color: #000;
  border-color: #00ff00;
}

.dev-panel-body::-webkit-scrollbar {
  width: 6px;
}

.dev-panel-body::-webkit-scrollbar-track {
  background: #1a1a2e;
}

.dev-panel-body::-webkit-scrollbar-thumb {
  background: #00ff00;
  border-radius: 3px;
}
