/* ============ KSeF Symulator — Windows XP Luna styling ============ */

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

html, body {
  width: 100%; height: 100%;
  font-family: "Tahoma", "Segoe UI", sans-serif;
  font-size: 11px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.hidden { display: none !important; }

/* ============ BOOT SCREEN ============ */
.boot-screen {
  position: fixed; inset: 0;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.boot-logo { display: flex; align-items: center; gap: 20px; margin-bottom: 40px; }
.win-logo {
  width: 80px; height: 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  transform: perspective(200px) rotateY(-20deg) skewY(-10deg);
}
.win-logo span { display: block; border-radius: 2px; }
.q1 { background: #ff3333; }
.q2 { background: #33cc33; }
.q3 { background: #3366ff; }
.q4 { background: #ffcc00; }
.boot-text { font-size: 28px; font-family: "Franklin Gothic", Tahoma; }
.boot-text b { font-weight: 800; }
.boot-text sup { font-size: 14px; vertical-align: super; }
.boot-bar {
  width: 220px; height: 14px;
  border: 1px solid #444;
  background: #000;
  padding: 2px;
  overflow: hidden;
}
.boot-bar-inner {
  height: 100%; width: 40px;
  background: linear-gradient(90deg, transparent, #3b7fe0, #6bafff, #3b7fe0, transparent);
  animation: bootslide 1.2s linear infinite;
}
@keyframes bootslide {
  from { transform: translateX(-60px); }
  to   { transform: translateX(220px); }
}
.boot-copyright { margin-top: 40px; color: #999; font-size: 10px; }

/* ============ INTRO ============ */
.intro-screen {
  position: fixed; inset: 0;
  background: #0a3a6e;
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  color: #fff;
}
.intro-box {
  background: #ece9d8;
  color: #000;
  border: 2px solid #0831d6;
  max-width: 520px;
  padding: 24px 28px;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.4);
}
.intro-box h1 { color: #0831d6; font-size: 22px; margin-bottom: 8px; }
.intro-box .subtitle { color: #666; font-style: italic; margin-bottom: 16px; }
.intro-box p { margin-bottom: 10px; font-size: 13px; line-height: 1.5; }
.intro-box .mission {
  background: #fff5c2; border: 1px dashed #b58900;
  padding: 10px; font-size: 14px;
}
.intro-box .warning { color: #a00; font-weight: bold; text-align: center; margin: 16px 0; }

/* ============ DESKTOP ============ */
.desktop {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at 30% 70%, #8ac63f 0%, #4a9123 40%, #2a6510 80%),
    linear-gradient(180deg, #6fbce8 0%, #a0d8f0 45%, #8ac63f 46%, #4a9123 100%);
  background-blend-mode: normal;
  overflow: hidden;
}
/* Bliss-ish: sky on top, hill on bottom */
.desktop::before {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, #5aa9dc 0%, #7fc1e8 40%, #a4d5ee 55%, transparent 56%),
    radial-gradient(ellipse 120% 60% at 50% 110%, #6bbd30 0%, #3b8a1a 60%, #2a6510 100%);
  pointer-events: none;
}

.desktop-icons {
  position: absolute;
  top: 10px; left: 10px;
  display: grid;
  grid-template-columns: 80px 80px;
  grid-template-rows: repeat(7, auto);
  grid-auto-flow: column;
  gap: 4px;
  z-index: 1;
}
.desktop-icon {
  width: 80px;
  text-align: center;
  padding: 4px;
  color: #fff;
  cursor: pointer;
  border: 1px dotted transparent;
}
.desktop-icon:hover { background: rgba(49,106,197,0.3); border-color: rgba(255,255,255,0.3); }
.desktop-icon.selected { background: rgba(49,106,197,0.6); border-color: rgba(255,255,255,0.5); }
.desktop-icon .icon-img {
  font-size: 36px;
  display: block;
  margin-bottom: 2px;
  filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.6));
}
.desktop-icon .icon-label {
  font-size: 11px;
  word-wrap: break-word;
  display: inline-block;
  padding: 1px 4px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 2px;
  color: #fff;
  /* Outline-like shadow dla maksymalnej czytelności na każdym tle */
  text-shadow:
    -1px -1px 0 #000,
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000,
     0    0   3px rgba(0,0,0,0.8);
}
.desktop-icon.selected .icon-label,
.desktop-icon:hover .icon-label {
  background: transparent;
}

/* ============ HUD ============ */
.hud {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: 1px solid #88aaff;
  border-radius: 4px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 5;
  min-width: 180px;
  font-size: 11px;
}
.hud-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hud-label { opacity: 0.9; }
.bar { width: 100px; height: 10px; background: #222; border: 1px solid #555; border-radius: 2px; overflow: hidden; }
.bar-fill { height: 100%; transition: width 0.3s, background 0.3s; }
.bar-fill.stress   { background: linear-gradient(90deg, #4caf50, #ff9800, #f44336); }
.bar-fill.patience { background: linear-gradient(90deg, #f44336, #ff9800, #4caf50); }

/* ============ WINDOWS ============ */
.xp-window {
  position: absolute;
  background: #ece9d8;
  border: 1px solid #0831d6;
  border-radius: 8px 8px 0 0;
  box-shadow: 3px 3px 12px rgba(0,0,0,0.4);
  min-width: 280px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.xp-window.inactive .title-bar { background: linear-gradient(180deg, #7a96df, #6a86cf); }
.title-bar {
  background: linear-gradient(180deg, #0058e6 0%, #3391ff 8%, #0058e6 40%, #0058e6 88%, #003bb3 100%);
  color: #fff;
  font-weight: bold;
  padding: 4px 4px 4px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: move;
  font-size: 12px;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.4);
  height: 26px;
}
.title-bar-icon { font-size: 14px; }
.title-bar-text { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.title-bar-controls { display: flex; gap: 2px; }
.tb-btn {
  width: 22px; height: 20px;
  border: 1px solid #003bb3;
  background: linear-gradient(180deg, #4a8ef2, #1966d4);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  border-radius: 2px;
}
.tb-btn.close { background: linear-gradient(180deg, #e06060, #a81616); border-color: #7a0d0d; }
.tb-btn:hover { filter: brightness(1.15); }
.tb-btn:active { filter: brightness(0.9); }

.window-body {
  flex: 1;
  background: #ece9d8;
  padding: 8px;
  overflow: auto;
  font-size: 12px;
}
.window-body.white { background: #fff; }

.menu-bar {
  background: #ece9d8;
  border-bottom: 1px solid #aca899;
  padding: 2px 4px;
  font-size: 11px;
  display: flex;
  gap: 2px;
}
.menu-bar span { padding: 2px 6px; cursor: pointer; border-radius: 2px; }
.menu-bar span:hover { background: #316ac5; color: #fff; }

.status-bar {
  background: #ece9d8;
  border-top: 1px solid #aca899;
  padding: 2px 6px;
  font-size: 10px;
  color: #444;
}

/* ============ TASKBAR ============ */
.taskbar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 30px;
  background: linear-gradient(180deg, #245edc 0%, #3a80f2 9%, #1e54ce 18%, #245edc 92%, #0d3ba8 100%);
  display: flex;
  align-items: center;
  z-index: 100;
  border-top: 1px solid #0d3ba8;
}
.start-button {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(180deg, #3c983c 0%, #55c455 10%, #2d7e2d 80%, #1f5f1f 100%);
  color: #fff;
  border: none;
  padding: 2px 18px 2px 10px;
  height: 30px;
  border-radius: 0 14px 14px 0;
  font-family: inherit;
  font-weight: bold;
  font-style: italic;
  font-size: 15px;
  cursor: pointer;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  box-shadow: inset 0 -3px 6px rgba(0,0,0,0.25);
}
.start-button:hover { filter: brightness(1.1); }
.start-button.active { filter: brightness(0.85); }
.start-flag { font-size: 18px; }

.taskbar-items {
  flex: 1;
  display: flex;
  gap: 3px;
  padding: 0 4px;
  overflow: hidden;
}
.taskbar-item {
  display: flex; align-items: center; gap: 4px;
  background: linear-gradient(180deg, #3b80f5, #1e54ce);
  color: #fff;
  padding: 3px 8px;
  height: 22px;
  min-width: 120px;
  max-width: 160px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  border: 1px solid rgba(0,0,0,0.2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.taskbar-item:hover { filter: brightness(1.1); }
.taskbar-item.active {
  background: linear-gradient(180deg, #1a45a8, #2d6bd6);
  box-shadow: inset 1px 1px 3px rgba(0,0,0,0.4);
}

.systray {
  background: linear-gradient(180deg, #0c59bc, #1773e3 20%, #0c59bc 100%);
  height: 30px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 6px;
  border-left: 1px solid #0d3ba8;
}
.systray-icon { font-size: 13px; }
.clock { color: #fff; font-size: 11px; margin-left: 4px; }

/* ============ START MENU ============ */
.start-menu {
  position: absolute;
  bottom: 30px;
  left: 0;
  width: 380px;
  background: #fff;
  border: 1px solid #0d3ba8;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  box-shadow: 2px 0 8px rgba(0,0,0,0.4);
  z-index: 200;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.start-header {
  background: linear-gradient(180deg, #1862e9, #2d79f5 50%, #0d47c7);
  color: #fff;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid #ff9c00;
}
.start-avatar {
  width: 42px; height: 42px;
  background: #ff9933;
  border: 2px solid #fff;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.start-username { font-weight: bold; font-size: 14px; text-shadow: 1px 1px 1px rgba(0,0,0,0.4); }
.start-body { display: flex; }
.start-column { flex: 1; padding: 6px; }
.start-column.left { background: #fff; border-right: 1px solid #ccc; }
.start-column.right { background: #d3e5fa; }
.start-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 2px;
}
.start-item:hover { background: #316ac5; color: #fff; }
.start-footer {
  display: flex; justify-content: flex-end; gap: 6px;
  background: linear-gradient(180deg, #d3e5fa, #b4cef0);
  padding: 6px 10px;
  border-top: 1px solid #7fa3d1;
}
.start-footer-btn {
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.start-footer-btn:hover { background: rgba(49,106,197,0.2); border-color: #7fa3d1; }

/* ============ BUTTONS / FORMS ============ */
.xp-button {
  background: linear-gradient(180deg, #f8f8f8, #d0d0c8);
  border: 1px solid #003c74;
  padding: 4px 14px;
  border-radius: 3px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  min-width: 75px;
}
.xp-button:hover { background: linear-gradient(180deg, #fff5d1, #f7d98b); }
.xp-button:active { background: #c0c0b8; }
.xp-button.primary { font-weight: bold; background: linear-gradient(180deg, #f8f8f8, #c5dcf3); }
.xp-button:disabled { color: #888; cursor: not-allowed; background: #ddd; }

input[type=text], input[type=password], input[type=number], textarea, select {
  font-family: inherit;
  font-size: 12px;
  padding: 3px 5px;
  border: 1px solid #7f9db9;
  background: #fff;
}
input:focus, textarea:focus { outline: 1px solid #0831d6; }

label { display: block; margin: 4px 0 2px; font-size: 12px; }

/* ============ TOASTS ============ */
.toasts {
  position: absolute;
  bottom: 40px; right: 10px;
  display: flex; flex-direction: column-reverse;
  gap: 6px;
  z-index: 300;
  max-width: 320px;
}
.toast {
  background: #fffbcc;
  border: 1px solid #b58900;
  padding: 8px 12px;
  font-size: 12px;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.3);
  animation: toastin 0.3s ease-out;
}
.toast.bad { background: #ffd0d0; border-color: #a00; }
.toast.good { background: #d8f5d0; border-color: #2a7a2a; }
@keyframes toastin {
  from { transform: translateX(340px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* ============ CLIPPY ============ */
.clippy {
  position: absolute;
  bottom: 50px; right: 20px;
  z-index: 250;
  animation: clippybob 3s ease-in-out infinite;
}
@keyframes clippybob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}
.clippy-body {
  background: #ffffcc;
  border: 1px solid #888;
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
}
.clippy-bubble {
  background: #ffffcc;
  border: 1px solid #000;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  max-width: 240px;
  margin-bottom: 8px;
  position: relative;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
.clippy-bubble:empty { display: none; }
.clippy-bubble::after {
  content: "";
  position: absolute;
  bottom: -8px; right: 30px;
  width: 0; height: 0;
  border: 8px solid transparent;
  border-top-color: #ffffcc;
  border-bottom: 0;
}

/* ============ BSOD ============ */
.bsod {
  position: fixed; inset: 0;
  background: #0000aa;
  color: #fff;
  font-family: "Lucida Console", Consolas, monospace;
  padding: 40px 60px;
  z-index: 99999;
}
.bsod-inner { max-width: 720px; }
.bsod-inner p { margin-bottom: 14px; font-size: 14px; }
#bsod-restart { margin-top: 20px; }

/* ============ APP-SPECIFIC ============ */

/* KSeF app */
.ksef-app { font-family: "Times New Roman", serif; }
.ksef-header {
  background: linear-gradient(180deg, #b11818, #8a0e0e);
  color: #fff;
  padding: 10px;
  font-weight: bold;
  text-align: center;
  border-bottom: 3px solid #ffcc00;
}
.ksef-header small { display: block; font-size: 10px; font-weight: normal; }
.ksef-content { padding: 12px; }
.ksef-field { margin-bottom: 8px; }
.ksef-field input, .ksef-field select { width: 100%; }
.ksef-captcha {
  background: repeating-linear-gradient(45deg, #ddd, #ddd 4px, #ccc 4px, #ccc 8px);
  padding: 8px;
  font-family: "Courier New", monospace;
  font-size: 22px;
  letter-spacing: 6px;
  text-align: center;
  font-style: italic;
  text-decoration: line-through;
  color: #444;
  margin: 6px 0;
  user-select: none;
  transform: skew(-5deg, 2deg);
}
.ksef-error {
  background: #ffe0e0;
  border: 1px solid #a00;
  padding: 6px 10px;
  margin: 6px 0;
  color: #a00;
  font-family: Tahoma;
  font-size: 11px;
}
.ksef-ok {
  background: #e0ffe0;
  border: 1px solid #080;
  padding: 6px 10px;
  margin: 6px 0;
  color: #060;
  font-family: Tahoma;
  font-size: 11px;
}
.loading-dots::after {
  content: "";
  display: inline-block;
  width: 20px;
  text-align: left;
  animation: dots 1s steps(4, end) infinite;
}
@keyframes dots { 0%{content:"";} 25%{content:".";} 50%{content:"..";} 75%{content:"...";} 100%{content:"";} }

/* Notepad */
.notepad-body { padding: 0; background: #fff; }
.notepad-body textarea {
  width: 100%; height: 100%;
  border: none; resize: none;
  font-family: "Lucida Console", monospace;
  font-size: 12px;
  padding: 6px;
  background: #fff;
}

/* Calculator */
.calc-body { padding: 4px; background: #ece9d8; }
.calc-display {
  background: #fff;
  border: 1px inset #999;
  padding: 4px 8px;
  text-align: right;
  font-family: "Lucida Console", monospace;
  font-size: 16px;
  margin-bottom: 4px;
  height: 26px;
}
.calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
.calc-btn {
  padding: 8px 4px;
  border: 1px solid #888;
  background: linear-gradient(180deg, #fff, #d8d4c0);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  font-weight: bold;
}
.calc-btn:hover { background: linear-gradient(180deg, #fff5d1, #f7d98b); }
.calc-btn.op { color: #a00; }
.calc-btn.eq { background: linear-gradient(180deg, #c5dcf3, #7da4d9); color: #002060; }

/* Minesweeper placeholder / Saper */
.saper-body { background: #bdbdbd; padding: 6px; }
.saper-header {
  background: #bdbdbd;
  border: 2px inset #fff;
  padding: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.saper-counter {
  background: #000; color: #f00;
  font-family: "Digital", monospace;
  font-weight: bold;
  padding: 2px 4px;
  min-width: 40px;
  text-align: center;
  font-size: 16px;
}
.saper-grid {
  display: grid;
  gap: 0;
  border: 2px inset #fff;
}
.saper-cell {
  width: 20px; height: 20px;
  background: #bdbdbd;
  border: 2px outset #fff;
  font-weight: bold;
  font-size: 13px;
  text-align: center;
  line-height: 16px;
  cursor: pointer;
  font-family: Tahoma;
}
.saper-cell.revealed { border: 1px solid #7b7b7b; background: #bdbdbd; }
.saper-cell.mine { background: #f00; }
.saper-cell[data-n="1"] { color: #0000ff; }
.saper-cell[data-n="2"] { color: #008000; }
.saper-cell[data-n="3"] { color: #ff0000; }
.saper-cell[data-n="4"] { color: #000080; }
.saper-cell[data-n="5"] { color: #800000; }

/* GaduGadu */
.gg-body { padding: 0; background: #f0f0f0; }
.gg-header { background: linear-gradient(180deg, #fff69a, #ffc000); padding: 6px; font-weight: bold; color: #663300; }
.gg-list { padding: 4px; }
.gg-contact { padding: 4px 8px; cursor: pointer; border-bottom: 1px dotted #ccc; display: flex; gap: 6px; }
.gg-contact:hover { background: #ffe08a; }
.gg-status { width: 10px; height: 10px; border-radius: 50%; background: #888; margin-top: 3px; }
.gg-status.online { background: #2dd62d; }
.gg-status.away { background: #ffa500; }
.gg-chat { padding: 6px; height: 220px; overflow-y: auto; background: #fff; border: 1px inset #999; margin: 4px; }
.gg-chat .msg { margin-bottom: 4px; font-size: 11px; }
.gg-chat .msg .who { font-weight: bold; }
.gg-input { display: flex; gap: 4px; padding: 4px; }
.gg-input input { flex: 1; }

/* Browser */
.ie-body { padding: 0; }
.ie-toolbar {
  background: #ece9d8;
  padding: 4px;
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #aca899;
  align-items: center;
}
.ie-toolbar input { flex: 1; }
.ie-page { padding: 12px; font-family: "Times New Roman", serif; font-size: 13px; background: #fff; min-height: 300px; overflow: auto; }
.ie-page h1 { margin-bottom: 8px; }
.ie-page a { color: #0000ee; text-decoration: underline; cursor: pointer; }
.ie-page a:visited { color: #551a8b; }

/* Winamp */
.winamp-body {
  background: linear-gradient(180deg, #2a2a2a, #111);
  color: #00ff00;
  font-family: "Lucida Console", monospace;
  padding: 8px;
  font-size: 11px;
}
.winamp-display {
  background: #000;
  border: 1px inset #555;
  padding: 4px 8px;
  margin-bottom: 6px;
  color: #00ff00;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}
.wa-marquee {
  display: inline-block;
  padding-left: 100%;
  animation: wa-marquee-scroll 14s linear infinite;
}
@keyframes wa-marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
.wa-display-static { display: inline-block; }
.wa-spotify-logo {
  vertical-align: -2px;
  margin-right: 4px;
}
.winamp-controls { display: flex; gap: 4px; margin-bottom: 6px; }
.winamp-controls button {
  background: #444; color: #0f0; border: 1px outset #888;
  padding: 2px 8px; font-family: inherit; cursor: pointer;
}
.winamp-playlist { background: #000; padding: 4px; max-height: 150px; overflow-y: auto; }
.winamp-track { padding: 2px 4px; cursor: pointer; }
.winamp-track.playing { background: #003366; color: #ffff00; }

/* Email */
.mail-body { padding: 0; background: #fff; }
.mail-list { border-bottom: 1px solid #aca899; }
.mail-row {
  padding: 4px 8px; border-bottom: 1px dotted #ccc; cursor: pointer; display: grid;
  grid-template-columns: 18px 140px 1fr 80px; gap: 6px; font-size: 11px;
}
.mail-row.unread { font-weight: bold; background: #eef4ff; }
.mail-row:hover { background: #d0e0ff; }
.mail-view { padding: 10px; font-size: 12px; max-height: 200px; overflow-y: auto; }

/* File explorer */
.fe-body { padding: 0; background: #fff; display: flex; }
.fe-sidebar { width: 140px; background: linear-gradient(180deg, #84a7f5, #638ae0); padding: 6px; color: #fff; font-size: 11px; }
.fe-sidebar h4 { background: #0831d6; padding: 3px 6px; margin-bottom: 4px; }
.fe-list { flex: 1; padding: 8px; display: grid; grid-template-columns: repeat(auto-fill, 80px); gap: 8px; align-content: start; }
.fe-file {
  width: 80px; text-align: center; cursor: pointer; padding: 2px;
}
.fe-file:hover { background: #316ac5; color: #fff; }
.fe-file .fe-icon { font-size: 28px; display: block; }
.fe-file .fe-name { font-size: 11px; word-wrap: break-word; }

/* Dialog */
.dialog-body { padding: 16px; text-align: center; }
.dialog-body .dialog-icon { font-size: 40px; margin-bottom: 10px; }
.dialog-body .dialog-buttons { margin-top: 16px; display: flex; gap: 8px; justify-content: center; }

/* ============ LISTA ZADAŃ (Quest log) ============ */
.quest-panel {
  position: absolute;
  top: 130px; right: 10px;
  width: 200px;
  background: #fffbcc;
  border: 1px solid #b58900;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.3);
  font-size: 11px;
  z-index: 5;
}
.quest-panel h3 {
  background: linear-gradient(180deg, #ffe37b, #e8b922);
  padding: 3px 6px;
  font-size: 11px;
  color: #5a3900;
  border-bottom: 1px solid #b58900;
}
.quest-list { padding: 6px 8px; }
.quest-item { padding: 2px 0; color: #333; }
.quest-item.done { color: #080; text-decoration: line-through; opacity: 0.7; }
.quest-item::before { content: "☐ "; }
.quest-item.done::before { content: "☑ "; color: #080; }

/* ============ ACHIEVEMENTS ============ */
.achievement-toast {
  background: linear-gradient(180deg, #4a8ef2, #1966d4);
  color: #fff;
  border: 1px solid #fff;
  box-shadow: 0 0 0 1px #003bb3, 2px 2px 8px rgba(0,0,0,0.4);
  padding: 10px 14px;
  min-width: 260px;
  animation: toastin 0.4s ease-out;
}
.achievement-toast .ach-title { font-weight: bold; font-size: 13px; margin-bottom: 2px; }
.achievement-toast .ach-name { font-size: 11px; opacity: 0.95; }

/* ============ GENERIC DIALOG POPUP ============ */
.popup-dialog {
  position: absolute;
  background: #ece9d8;
  border: 1px solid #0831d6;
  border-radius: 6px 6px 0 0;
  box-shadow: 3px 3px 10px rgba(0,0,0,0.5);
  min-width: 360px;
  max-width: 460px;
  z-index: 500;
  overflow: hidden;
}
.popup-dialog .title-bar { cursor: move; }
.popup-content { padding: 14px; display: flex; gap: 12px; align-items: flex-start; }
.popup-icon { font-size: 36px; flex-shrink: 0; }
.popup-text { flex: 1; font-size: 12px; line-height: 1.5; }
.popup-text b { color: #000; }
.popup-buttons {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 8px 14px 12px;
  background: #ece9d8;
}
.popup-dialog.error .title-bar { background: linear-gradient(180deg, #b11818, #8a0e0e); }
.popup-dialog.java .title-bar { background: linear-gradient(180deg, #d8b013, #9d7c00); }
.popup-dialog.messenger .title-bar { background: linear-gradient(180deg, #c93838, #8b1818); }

/* ============ AUTOMAT Z KAWĄ ============ */
.vending-body { padding: 0; background: #ece9d8; }
.vending-header {
  background: linear-gradient(180deg, #8b5a2b, #5b3a1a);
  color: #fff;
  padding: 10px;
  text-align: center;
  border-bottom: 2px solid #d4af37;
}
.vending-header h2 { font-size: 14px; margin-bottom: 2px; }
.vending-header small { font-size: 10px; opacity: 0.85; }
.vending-drink {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #ccc;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}
.vending-drink:hover { background: #d0e0ff; }
.vending-drink .vd-icon {
  font-size: 26px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f5f5e8;
  border: 1px solid #c0bfae;
  border-radius: 4px;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
  flex-shrink: 0;
  line-height: 1;
}
.vending-drink .vd-name { flex: 1; font-weight: bold; }
.vending-drink .vd-price { color: #a00; font-weight: bold; }
.vending-footer {
  background: #ece9d8;
  padding: 6px 12px;
  font-size: 11px;
  color: #444;
  border-top: 1px solid #aca899;
  text-align: right;
}

/* ============ WINAMP SPOTIFY PANEL ============ */
.wa-spotify {
  background: #1db954;
  color: #fff;
  padding: 6px 10px;
  font-size: 11px;
  margin: 4px;
  border-radius: 3px;
  text-align: center;
}
.wa-spotify.off { background: #444; color: #aaa; font-size: 10px; }
.wa-spotify.on { text-align: left; }
.wa-spotify button { font-size: 11px; }
.wa-sp-controls {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  justify-content: center;
}
.wa-sp-controls button {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 2px 8px;
  cursor: pointer;
  border-radius: 2px;
  font-size: 12px;
}
.wa-sp-controls button:hover { background: rgba(0,0,0,0.5); }

/* ============ LANGUAGE SWITCH ============ */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 12px;
  font-size: 12px;
  justify-content: center;
}
.lang-btn {
  background: linear-gradient(180deg, #f5f5f5, #d0d0d0);
  border: 1px solid #888;
  border-radius: 3px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}
.lang-btn:hover { background: linear-gradient(180deg, #fff, #ddd); }
.lang-btn.active {
  background: linear-gradient(180deg, #ffd54a, #f5a623);
  border-color: #c87a00;
  font-weight: bold;
}

/* ============ DRUNK STATES ============ */
#desktop {
  transition: filter 0.6s, transform 0.8s;
}
#desktop.drunk-1 {
  animation: drunk-sway 6s ease-in-out infinite;
}
#desktop.drunk-2 {
  filter: blur(0.6px) saturate(1.2);
  animation: drunk-sway 4s ease-in-out infinite;
}
#desktop.drunk-3 {
  filter: blur(1.2px) saturate(1.4) hue-rotate(-8deg);
  animation: drunk-sway 3s ease-in-out infinite;
}
#desktop.drunk-3 .xp-window,
#desktop.drunk-3 .desktop-icon,
#desktop.drunk-3 .start-button,
#desktop.drunk-3 .taskbar {
  text-shadow: 2px 0 0 rgba(255,0,0,0.5), -2px 0 0 rgba(0,255,255,0.5);
}
#desktop.drunk-4 {
  filter: blur(2px) saturate(1.5) hue-rotate(-15deg) contrast(1.1);
  animation: drunk-spin 2s ease-in-out infinite;
}
#desktop.falling-asleep {
  animation: fall-asleep 4.5s forwards !important;
}

@keyframes drunk-sway {
  0%, 100% { transform: rotate(-1deg) translateX(-2px); }
  50%      { transform: rotate(1deg) translateX(2px); }
}
@keyframes drunk-spin {
  0%   { transform: rotate(-2deg) translate(-4px, -2px); }
  25%  { transform: rotate(2deg) translate(4px, 2px); }
  50%  { transform: rotate(-1deg) translate(-2px, 4px); }
  75%  { transform: rotate(3deg) translate(3px, -3px); }
  100% { transform: rotate(-2deg) translate(-4px, -2px); }
}
@keyframes fall-asleep {
  0%   { filter: blur(2px) brightness(1); transform: rotate(0deg) scale(1); opacity: 1; }
  30%  { filter: blur(4px) brightness(0.7); transform: rotate(3deg) scale(0.99); }
  60%  { filter: blur(8px) brightness(0.4); transform: rotate(-2deg) scale(0.97); }
  85%  { filter: blur(14px) brightness(0.15); transform: rotate(1deg) scale(0.95); opacity: 0.7; }
  100% { filter: blur(20px) brightness(0); transform: rotate(0deg) scale(0.93); opacity: 0.2; }
}

/* ============ FAVORITES BAR (IE) ============ */
.ie-favbar {
  background: #ece9d8;
  border-bottom: 1px solid #aca899;
  padding: 2px 4px;
  display: flex;
  gap: 2px;
  font-size: 11px;
  flex-wrap: wrap;
}
.ie-favbar span {
  padding: 2px 6px;
  cursor: pointer;
  border-radius: 2px;
}
.ie-favbar span:hover { background: #316ac5; color: #fff; }

/* ============ JUTJUB VIDEO PAGE ============ */
.jutjub-brand { color: #cc0000; font-weight: bold; font-size: 18px; }
.jutjub-brand::before { content: "▶ "; }
.jutjub-video {
  background: #000;
  color: #fff;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Tahoma;
  margin: 10px 0;
  border: 1px solid #444;
  position: relative;
  overflow: hidden;
}
.jutjub-video::before {
  content: "🐊";
  font-size: 90px;
  filter: saturate(0.5) brightness(0.8);
}
.jutjub-video .play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: rgba(255,255,255,0.7);
}
.jutjub-title { font-size: 14px; font-weight: bold; margin: 6px 0; font-family: Tahoma; }
.jutjub-meta { font-size: 11px; color: #666; font-family: Tahoma; margin-bottom: 10px; }
.jutjub-comments { margin-top: 14px; font-family: Tahoma; font-size: 11px; }
.jutjub-comments h3 { font-size: 12px; margin-bottom: 8px; color: #333; }
.jutjub-comment { border-bottom: 1px dotted #ccc; padding: 6px 0; }
.jutjub-comment .user { color: #0000ee; font-weight: bold; }
.jutjub-comment .time { color: #888; font-size: 10px; }

/* ============ KSeF VALIDATION ERRORS ============ */
.ksef-errors {
  background: #fff0f0;
  border: 1px solid #a00;
  padding: 8px 10px;
  margin: 6px 0;
  font-size: 11px;
}
.ksef-errors h4 { color: #a00; margin-bottom: 4px; font-size: 12px; }
.ksef-errors ol { margin-left: 20px; color: #600; }
.ksef-errors li { margin-bottom: 2px; }

/* ============ KSeF LOADING STEPS ============ */
.ksef-steps {
  background: #f8f8f0;
  border: 1px solid #aca899;
  padding: 8px 10px;
  margin: 6px 0;
  font-size: 11px;
  font-family: "Courier New", monospace;
}
.ksef-steps .step { padding: 1px 0; }
.ksef-steps .step.ok { color: #060; }
.ksef-steps .step.fail { color: #a00; }
.ksef-steps .step.wait { color: #666; }
.progress-bar {
  height: 14px;
  background: #ddd;
  border: 1px inset #999;
  margin: 6px 0;
  position: relative;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(180deg, #5ab4ff, #0078d7);
  transition: width 0.3s;
}
.progress-bar-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #000;
  font-family: Tahoma;
}

/* ============ KSeF LOGIN METHODS ============ */
.ksef-login-methods { text-align: center; margin: 20px 0; }
.ksef-login-methods button {
  display: block;
  width: 80%;
  margin: 8px auto;
  padding: 10px;
  font-size: 13px;
  font-weight: bold;
  border: 1px solid #003c74;
  border-radius: 3px;
  cursor: pointer;
  color: #fff;
}
.ksef-btn-pz { background: linear-gradient(180deg, #3a80f2, #1966d4); }
.ksef-btn-token { background: linear-gradient(180deg, #3c983c, #2d7e2d); }
.ksef-btn-pz:hover, .ksef-btn-token:hover { filter: brightness(1.1); }

/* Winner */
.win-overlay {
  position: fixed; inset: 0;
  background: rgba(0,40,120,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 99998;
  color: #fff;
}
.win-overlay .win-box {
  background: #ece9d8; color: #000;
  border: 2px solid #0831d6;
  padding: 30px 40px;
  max-width: 500px;
  text-align: center;
}
.win-overlay h1 { color: #0831d6; margin-bottom: 14px; }
.win-overlay p { margin-bottom: 10px; font-size: 13px; line-height: 1.5; }
