/* ============================================================
   v6 OS module: DR/OS XP (2001–2006) — candy desktop, wizard,
   marquee select, RUDAEV! portal, real window chrome
   ============================================================ */
#os-xp { position: absolute; inset: 0; display: none; font-family: Tahoma, "Segoe UI", var(--sans); }
#os-xp.on { display: block; }

.xp-wall {
  position: absolute; inset: 0;
  background:
    radial-gradient(90% 46% at 78% 4%, rgba(255, 255, 255, .5), transparent 60%),
    radial-gradient(70% 34% at 24% 14%, rgba(255, 255, 255, .38), transparent 65%),
    radial-gradient(150% 95% at 16% 112%, var(--xp-hill-a, #7dbb6a) 38%, transparent 62%),
    radial-gradient(170% 85% at 88% 116%, var(--xp-hill-b, #2f7f3f) 44%, transparent 64%),
    linear-gradient(180deg, var(--xp-sky-a, #5a9fd4), var(--xp-sky-b, #b8ddf2) 78%);
}

/* boot splash */
#xp-boot { position: absolute; inset: 0; z-index: 50; background: #000; color: #e8e8e8; display: grid; place-items: center; transition: opacity .45s ease; }
#xp-boot.gone { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .45s ease, visibility 0s .45s; }
#xp-boot .xb { display: grid; gap: 26px; justify-items: center; }
#xp-boot .logo { font-size: 30px; font-weight: 700; letter-spacing: .02em; }
#xp-boot .logo i { font-style: italic; color: #7ab0e8; }
#xp-boot .pips { display: flex; gap: 5px; width: 130px; overflow: hidden; border: 1px solid #444; border-radius: 4px; padding: 3px 4px; }
#xp-boot .pips i { width: 12px; height: 12px; border-radius: 2px; background: linear-gradient(180deg, #5a9fd4, #2456b0); animation: pip 1.1s linear infinite; }
#xp-boot .pips i:nth-child(2) { animation-delay: .08s; }
#xp-boot .pips i:nth-child(3) { animation-delay: .16s; }
@keyframes pip { 0% { transform: translateX(-40px); } 100% { transform: translateX(130px); } }

/* taskbar */
#xp-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 42px; z-index: 40;
  background: var(--xp-tb, linear-gradient(180deg, #3a76d6, #2456b0));
  display: flex; align-items: stretch; gap: 8px;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, .35) inset;
  color: #fff;
}
#xp-go {
  display: flex; align-items: center; gap: 7px; flex: none;
  background: var(--xp-go, linear-gradient(180deg, #7ecb6f, #3f9a3f));
  color: #fff; font-weight: 700; font-style: italic; font-size: 15px;
  padding: 0 20px 0 12px; border-radius: 0 12px 12px 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 2px 0 6px rgba(0, 0, 0, .25);
}
#xp-go i { font-style: normal; font-size: 13px; }
#xp-go.open { filter: brightness(.9); }
#xp-tabs { flex: 1; display: flex; gap: 5px; overflow: hidden; padding: 5px 0; }
#os-xp .wtab {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, .12));
  border-radius: 4px; color: #fff; font-size: 12px; padding: 0 10px;
  max-width: 150px; min-width: 0; white-space: nowrap; overflow: hidden;
}
#os-xp .wtab .wtab-t { overflow: hidden; text-overflow: ellipsis; }
#os-xp .wtab.act { background: rgba(0, 0, 30, .3); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .4); }
#os-xp .wtab.minned { opacity: .75; font-style: italic; }
#xp-tray { display: flex; align-items: center; padding: 0 12px; background: rgba(0, 20, 60, .35); box-shadow: inset 1px 0 0 rgba(255, 255, 255, .2); font-size: 12px; flex: none; }

/* start panel */
#xp-start {
  position: absolute; left: 4px; bottom: 46px; z-index: 45; width: min(400px, calc(100% - 12px));
  max-height: calc(100% - 56px); overflow-y: auto;
  border-radius: 8px 8px 0 0; display: none;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .45), 0 0 0 1px #1c46a0;
  font-size: 13px;
}
#xp-start.on { display: block; }
.xs-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--xp-tb, linear-gradient(180deg, #3a76d6, #2456b0)); color: #fff;
}
.xs-head .av { width: 34px; height: 34px; border-radius: 6px; background: linear-gradient(160deg, #f0a828, #d07818); display: grid; place-items: center; font-weight: 700; font-size: 14px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.xs-head b { display: block; font-size: 13.5px; }
.xs-head small { opacity: .8; font-size: 10.5px; }
.xs-cols { display: grid; grid-template-columns: 1.15fr 1fr; }
.xs-left { background: #fff; padding: 8px 6px; display: flex; flex-direction: column; gap: 2px; }
.xs-left button {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 7px 8px; border-radius: 4px; color: #1a1a2e; min-height: 44px;
}
.xs-left button:hover { background: #2456b0; color: #fff; }
.xs-left button:hover small { color: #cfe0ff; }
.xs-left .ic { font-size: 20px; width: 26px; text-align: center; }
.xs-left b { display: block; font-size: 12.5px; }
.xs-left small { display: block; font-size: 10.5px; color: #777; }
.xs-right { background: #d6e4f7; padding: 10px; border-left: 1px solid #a8c0e0; }
.xs-cap { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #4a6a9a; font-weight: 700; margin: 6px 0 4px; }
.xs-recent .xr { font-size: 11.5px; color: #33507a; line-height: 1.45; padding: 4px 2px; }
#xs-links { display: flex; flex-direction: column; }
#xs-links a { display: flex; gap: 8px; align-items: center; color: #1a4bb0; text-decoration: none; padding: 6px 2px; font-size: 12.5px; min-height: 34px; }
#xs-links a:hover { text-decoration: underline; }
#xs-links .ic { font-size: 14px; }

/* desktop icons + selection */
#xp-icons { position: absolute; top: 14px; left: 14px; bottom: 52px; display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-start; gap: 10px; z-index: 5; }
.xicon { width: 96px; text-align: center; color: #fff; font-size: 11.5px; padding: 6px 2px; border: 1px dashed transparent; text-shadow: 0 1px 3px rgba(0, 0, 0, .65); border-radius: 4px; }
.xicon:hover { border-color: rgba(255, 255, 255, .5); background: rgba(50, 90, 180, .3); }
.xicon.sel { background: rgba(40, 90, 190, .45); border: 1px dotted rgba(255, 255, 255, .8); }
.xicon .g { display: block; font-size: 30px; margin-bottom: 4px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }
@media (max-width: 620px) { .xicon { width: 78px; font-size: 10.5px; } .xicon .g { font-size: 25px; } }

/* marquee selection rectangle */
#xp-marquee {
  position: absolute; z-index: 8; pointer-events: none;
  background: rgba(70, 120, 220, .22);
  border: 1px solid rgba(60, 110, 210, .85);
}

/* ============ windows (shared WM chrome, XP skin) ============ */
#os-xp .win {
  position: absolute; z-index: 10;
  background: #ece9d8; color: #1a1a1a;
  border: 1px solid #2456b0;
  border-radius: 8px 8px 3px 3px;
  box-shadow: 0 6px 24px rgba(0, 0, 20, .4);
  min-width: 250px; max-width: min(580px, calc(100% - 12px));
  max-height: calc(100% - 54px);
  display: flex; flex-direction: column;
}
#os-xp .win.pop { animation: xwin-pop .16s ease-out; }
@keyframes xwin-pop { from { transform: scale(.94); opacity: 0; } }
#os-xp .win.focus { z-index: 20; }
#os-xp .win.max { inset: 4px 4px 46px 4px !important; width: auto !important; height: auto !important; max-width: none; border-radius: 4px; }
#os-xp .win-tb {
  display: flex; align-items: center; gap: 7px; flex: none;
  background: var(--xp-tb, linear-gradient(180deg, #3a76d6, #2456b0)); color: #fff;
  padding: 6px 6px 6px 10px; font-size: 12.5px; font-weight: 700;
  border-radius: 7px 7px 0 0; cursor: grab; user-select: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
#os-xp .win:not(.focus) .win-tb { filter: saturate(.35) brightness(1.1); }
#os-xp .win-ic { font-size: 13px; }
#os-xp .win-title { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#os-xp .win-btns { display: flex; gap: 3px; }
#os-xp .win-btn {
  width: 22px; height: 21px; display: grid; place-items: center; padding: 0;
  background: linear-gradient(180deg, #5a8fe0, #2c5cb8); color: #fff; border-radius: 4px;
  font-size: 12px; font-weight: 700; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 0 0 1px rgba(255, 255, 255, .25);
  line-height: 1;
}
#os-xp .win-btn.x { background: linear-gradient(180deg, #f0885a, #d0482a); }
#os-xp .win-btn:hover { filter: brightness(1.12); }
#os-xp .win-body { padding: 12px; font-size: 13px; line-height: 1.6; overflow: auto; flex: 1; min-height: 0; }
#os-xp .win-rz {
  position: absolute; right: 1px; bottom: 1px; width: 18px; height: 18px; cursor: nwse-resize;
  background: repeating-linear-gradient(135deg, transparent 0 3px, #b8b4a2 3px 5px);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}
.xpre { font-family: var(--mono); font-size: 12px; white-space: pre-wrap; line-height: 1.65; background: #fff; border: 1px solid #b8b4a2; padding: 10px; margin-bottom: 8px; }

/* XP modal dialogs */
#os-xp .wm-modal { position: absolute; inset: 0; z-index: 60; background: rgba(20, 20, 40, .2); display: grid; place-items: center; }
#os-xp .wm-dlg {
  width: min(360px, calc(100% - 30px));
  background: #ece9d8; color: #1a1a1a;
  border: 1px solid #2456b0; border-radius: 8px 8px 3px 3px;
  box-shadow: 0 10px 34px rgba(0, 0, 20, .5);
}
#os-xp .wm-dlg .win-tb { cursor: default; }
#os-xp .wm-dlg-body { display: flex; gap: 14px; padding: 16px 14px; align-items: flex-start; }
#os-xp .wm-dlg-ic { font-size: 30px; line-height: 1; }
#os-xp .wm-dlg-txt { font-size: 12.5px; line-height: 1.6; }
#os-xp .wm-dlg-btns { display: flex; justify-content: center; gap: 8px; padding: 0 14px 14px; flex-wrap: wrap; }
#os-xp .wm-dlg-btn {
  background: linear-gradient(180deg, #fdfdfb, #e8e5d4); border: 1px solid #8a8672;
  border-radius: 4px; padding: 7px 18px; font-size: 12.5px; min-height: 36px; min-width: 84px; color: #222;
  box-shadow: inset 0 1px 0 #fff;
}
#os-xp .wm-dlg-btn.primary { box-shadow: inset 0 1px 0 #fff, 0 0 0 2px rgba(90, 150, 230, .5); }
#os-xp .wm-dlg-btn:hover { border-color: #4a80d0; }

/* wizard */
.wiz { display: grid; grid-template-columns: 64px 1fr; gap: 12px; min-height: 168px; }
.wiz-side { background: linear-gradient(180deg, #2456b0, #6aa0e8); border-radius: 4px; display: grid; place-items: start center; padding-top: 14px; }
.wiz-side .orb { width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #fff, #9cc4f2 40%, #2456b0); }
.wiz-step { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: #777; margin-bottom: 4px; }
.wiz-main h3 { font-size: 16px; margin-bottom: 8px; color: #1a3a7a; }
.wiz-main p { min-height: 3.2em; margin-bottom: 8px; }
.wiz-check { display: flex; gap: 8px; align-items: center; font-size: 12px; color: #555; }
.wiz-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 2px 2px; border-top: 1px solid #d0ccba; margin-top: 10px; }
.xbtn {
  background: linear-gradient(180deg, #fdfdfb, #e8e5d4); border: 1px solid #8a8672;
  border-radius: 4px; padding: 6px 16px; font-size: 12.5px; min-height: 34px; color: #222;
  box-shadow: inset 0 1px 0 #fff;
}
.xbtn:hover:not(:disabled) { border-color: #4a80d0; box-shadow: inset 0 0 0 1.5px rgba(90, 150, 230, .5); }
.xbtn:disabled { opacity: .5; cursor: default; }
.xbtn.primary { background: var(--xp-go, linear-gradient(180deg, #7ecb6f, #3f9a3f)); color: #fff; border-color: #2f7a2f; text-shadow: 0 1px 1px rgba(0, 0, 0, .3); font-weight: 700; }
.xinput { width: 100%; border: 1px solid #7a96c8; border-radius: 3px; padding: 8px 10px; font: inherit; font-size: 13px; outline: none; background: #fff; color: #1a1a1a; }
.xinput:focus { border-color: #2456b0; }
.cw-done { color: #2f7a2f; font-weight: 700; font-size: 12.5px; margin-top: 8px; }
.run-row { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; margin-bottom: 10px; }

/* breakout */
#bo-cv { display: block; width: 100%; border: 1px solid #8a8672; border-radius: 3px; background: #0d1b2e; touch-action: none; }
.bo-status { font-size: 12px; font-family: var(--mono); margin-bottom: 6px; color: #333; }
.bo-hint { font-size: 11px; color: #777; margin-top: 6px; text-align: center; }

/* ---------- Daniel Explorer: RUDAEV! portal ---------- */
.ie-bar { display: flex; gap: 5px; align-items: center; margin: -4px -4px 8px; padding: 6px; background: #f1efe2; border-bottom: 1px solid #d0ccba; }
.ie-nav { width: 28px; height: 26px; border: 1px solid #b8b4a2; border-radius: 3px; background: linear-gradient(180deg, #fdfdfb, #e8e5d4); font-size: 12px; }
.ie-nav:disabled { opacity: .4; }
.ie-addr { flex: 1; min-width: 60px; background: #fff; color: #333; border: 1px solid #7a96c8; border-radius: 3px; padding: 5px 8px; font-size: 12px; font-family: var(--mono); }
.ie-go { border: 1px solid #8a8672; border-radius: 3px; background: linear-gradient(180deg, #fdfdfb, #e8e5d4); padding: 5px 10px; font-size: 12px; color: #222; }
.ie-page { background: #fff; border: 1px solid #d0ccba; padding: 14px 14px 10px; }
.ie-status { display: flex; justify-content: space-between; font-size: 11px; color: #777; padding: 6px 2px 0; }
.ru-mast { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; border-bottom: 3px double #b8b4a2; padding-bottom: 8px; }
.ru-logo { font-family: "Times New Roman", serif; font-size: 30px; font-weight: 700; letter-spacing: -.5px; color: #6a1fb0; }
.ru-logo i { color: #d03a1a; font-style: normal; }
.ru-slogan { font-size: 11.5px; color: #777; font-style: italic; }
.ru-search { display: flex; gap: 6px; margin: 12px 0 4px; }
.ru-search input { flex: 1; min-width: 60px; border: 1px solid #7a96c8; border-radius: 3px; padding: 7px 9px; font-size: 12.5px; background: #fff; color: #222; }
.ru-result { font-size: 12px; color: #146c14; padding: 5px 2px 0; }
.ru-ad {
  display: block; width: 100%; margin: 10px 0; padding: 9px 10px; text-align: center;
  background: repeating-linear-gradient(45deg, #ffe93d 0 14px, #1c1c1c 14px 28px);
  color: #fff; font-weight: 700; font-size: 12px; text-shadow: 0 1px 0 #000, 0 0 6px #000;
  border: 2px dashed #d03a1a; animation: adblink 1.1s steps(2) infinite; cursor: pointer;
}
@keyframes adblink { 50% { filter: invert(1); } }
.ru-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 12px 0; }
.ru-cat b { display: block; font-size: 12.5px; color: #6a1fb0; border-bottom: 1px solid #e0dcc8; margin-bottom: 5px; padding-bottom: 3px; }
.ru-cat a { display: block; color: #1a4bb0; font-size: 12px; text-decoration: underline; padding: 2.5px 0; }
.ru-cat a:visited { color: #6b21a8; }
.ru-news { border-top: 3px double #b8b4a2; padding-top: 8px; }
.ru-news > b { font-size: 12px; color: #d03a1a; text-transform: uppercase; letter-spacing: .06em; }
.ru-nitem { font-size: 12px; padding: 4px 0; border-bottom: 1px dotted #e0dcc8; }
.ru-nitem span { color: #777; font-family: var(--mono); font-size: 10.5px; margin-right: 8px; }
.ru-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ru-counter { font-family: var(--mono); font-size: 11px; background: #1c1c1c; color: #4be04b; padding: 3px 8px; letter-spacing: .12em; }
.ru-badge { font-size: 10px; border: 1px solid #b8b4a2; padding: 3px 7px; color: #777; background: #f4f2e8; }

/* homework.xls */
.xls { border-collapse: collapse; margin-bottom: 10px; width: 100%; }
.xls th, .xls td { border: 1px solid #b0c4d8; padding: 5px 10px; font-size: 12px; text-align: center; }
.xls th { background: #d6e4f7; font-weight: 700; color: #33507a; }
.xls td { background: #fff; font-family: var(--mono); }
.xls-note { font-size: 11.5px; color: #2f7a2f; margin-left: 8px; }

/* balloon */
#xp-balloon {
  position: absolute; right: 12px; bottom: 52px; z-index: 48; max-width: 260px;
  background: #fffbe1; border: 1.5px solid #b5a865; border-radius: 8px;
  padding: 10px 13px; font-size: 12px; line-height: 1.5; color: #333;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}
#xp-balloon::after { content: ""; position: absolute; right: 26px; bottom: -8px; border: 8px solid transparent; border-top-color: #b5a865; border-bottom: none; }
#xp-balloon b { display: block; margin-bottom: 2px; font-size: 12.5px; }

@media (prefers-reduced-motion: reduce) {
  #xp-boot .pips i, .ru-ad { animation: none; }
  #os-xp .win.pop { animation: none; }
}


/* ============================================================
   v7 additions — z-order law + clickable @tags
   ============================================================ */
#xp-bar { z-index: 8000 !important; }
#xp-start { z-index: 8100 !important; }
#xp-balloon { z-index: 8050 !important; }
#os-xp .wm-modal { z-index: 9000; }
#os-xp .clippy-bubble { font-family: var(--sans, 'Tahoma', sans-serif); }
.ru-tag {
  color: #1c51a8; font-weight: 700; text-decoration: underline; cursor: pointer;
  font: inherit; padding: 0;
}
.ru-tag:hover { color: #c2452e; }

/* ============================================================
   v7.1 — the portal grows real pages + the Finish payoff
   ============================================================ */
.ru-mast.small { padding: 6px 10px; margin-bottom: 8px; }
.ru-back { display: inline-block; margin-top: 12px; color: #1a3fa0; font-size: 11.5px; text-decoration: underline; cursor: pointer; }

.ru-tues { padding: 8px 6px 14px; text-align: center; }
.ru-tues-h {
  font: 800 21px/1.25 "Trebuchet MS", "Comic Sans MS", sans-serif; color: #c22a12;
  animation: ru-blink 1.1s steps(2) infinite; margin: 8px 0 4px; text-wrap: balance;
}
.ru-tues-h.small { font-size: 17px; animation: none; }
.ru-tues-sub { font-size: 12.5px; color: #333; margin-bottom: 8px; }
.ru-tues-list { text-align: left; max-width: 380px; margin: 0 auto 10px; padding-left: 22px; font-size: 12px; line-height: 1.65; color: #222; }
.ru-tues-list li { margin-bottom: 3px; }
.ru-tues-quote { font-style: italic; font-size: 11.5px; color: #555; background: #fdf6d8; border: 1px dashed #d8c46a; padding: 7px 10px; max-width: 400px; margin: 0 auto 12px; }
.ru-tues-cta {
  font: 800 15px "Trebuchet MS", sans-serif; color: #fff; cursor: pointer;
  background: linear-gradient(180deg, #ff9c3f, #e8641a); border: 2px outset #ffb46a;
  padding: 9px 20px; border-radius: 4px; box-shadow: 0 2px 0 #9c3f08;
}
.ru-tues-cta:active { border-style: inset; transform: translateY(1px); }
.ru-tues-fine { font-size: 10px; color: #888; margin-top: 7px; }
@keyframes ru-blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .ru-tues-h { animation: none; } }

.ru-res-page { padding: 2px 2px 12px; }
.ru-res-h { font: 700 13px "Trebuchet MS", sans-serif; color: #222; margin: 10px 2px 2px; }
.ru-res-note { font-size: 10.5px; color: #777; margin: 0 2px 8px; }
.ru-hit {
  display: block; width: 100%; text-align: left; background: #fff; cursor: pointer;
  border: 1px solid #d8dde8; border-radius: 3px; padding: 7px 9px; margin-bottom: 5px;
  font-family: inherit; text-decoration: none;
}
.ru-hit:hover { border-color: #7a9ad0; background: #f4f8ff; }
.ru-hit b { display: block; color: #1a3fa0; font-size: 12.5px; text-decoration: underline; margin-bottom: 2px; }
.ru-hit span { font-size: 11.5px; color: #444; line-height: 1.45; display: block; }
.ru-sponsored {
  display: block; width: 100%; text-align: left; cursor: pointer; margin-top: 8px;
  background: #fdf6d8; border: 1px solid #d8c46a; border-radius: 3px; padding: 7px 9px;
  font: 700 11.5px "Trebuchet MS", sans-serif; color: #9c6a00;
}
.ru-sponsored:hover { background: #fbeeb4; }

.ru-nf { text-align: center; padding: 22px 10px; }
.ru-nf-dig { font-size: 44px; animation: ru-dig 1s ease-in-out infinite; display: inline-block; }
.ru-nf-note { font-size: 10.5px; color: #888; margin-top: 6px; }
@keyframes ru-dig { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(16deg) translateY(2px); } }
@media (prefers-reduced-motion: reduce) { .ru-nf-dig { animation: none; } }

/* Finish payoff — balloons over the whole desktop */
#xp-party { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 80; }
#xp-party i {
  position: absolute; top: 103%; font-style: normal;
  animation: xp-balloon 4s ease-in forwards;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
@keyframes xp-balloon {
  0% { transform: rotate(-5deg); opacity: 0; }
  8% { opacity: 1; }
  55% { transform: rotate(6deg) translateX(9px); }
  100% { top: -14%; transform: rotate(-5deg); opacity: .95; }
}
