:root {
  --face: #c0c0c0;
  --light: #ffffff;
  --mid: #dfdfdf;
  --shadow: #808080;
  --dark: #000000;
  --navy: #000080;
  --teal: #008080;
  --taskbar-h: 34px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #000; color: #000;
  font: 13px Tahoma, "MS Sans Serif", Verdana, Geneva, sans-serif;
  -webkit-font-smoothing: none;
}
body.busy, body.busy * { cursor: wait !important; }
body.chicken, body.chicken * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ctext y='26' font-size='26'%3E%F0%9F%90%94%3C/text%3E%3C/svg%3E") 4 4, auto !important;
}
.hidden { display: none !important; }
button { font: inherit; color: inherit; }

/* ---------- Röhrenmonitor ---------- */
#crt {
  position: fixed; inset: 0; pointer-events: none; z-index: 99999;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.07) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,.35) 100%);
  animation: flicker 6s infinite;
}
@keyframes flicker { 0%, 96%, 100% { opacity: 1 } 97% { opacity: .85 } 98% { opacity: 1 } 99% { opacity: .9 } }

/* ---------- Vollbild-Screens ---------- */
.screen { position: fixed; inset: 0; z-index: 5000; }
#power {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #4f4; font-family: VT323, monospace; font-size: 26px; gap: 6px; text-align: center;
}
#power small { font-size: 18px; color: #2a2; }
#powerBtn {
  width: 96px; height: 96px; border-radius: 50%; font-size: 44px; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #555, #111); color: #4f4;
  border: 3px solid #333; box-shadow: 0 0 24px #0f04, inset 0 0 12px #000;
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 40px #0f08, inset 0 0 12px #000; } }

#bios, #blackout {
  background: #000; color: #c0c0c0; font-family: VT323, monospace; font-size: 22px;
  padding: 24px; overflow: hidden;
}
#bios pre, #blackout pre { margin: 0; white-space: pre-wrap; font: inherit; }

#splash {
  background: linear-gradient(#1a1a6e, #000 70%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; color: #fff;
}
.splash-logo { display: flex; align-items: center; gap: 18px; }
.splash-name { font: italic bold 64px "Trebuchet MS", Arial, sans-serif; letter-spacing: -2px; }
.splash-ver { font: bold 34px Arial, sans-serif; color: #ff6; vertical-align: super; margin-left: 6px; }
.splash-sub { font: italic 20px Arial, sans-serif; color: #9cf; }
.splash-bar { width: min(320px, 80vw); height: 18px; border: 2px solid #888; padding: 2px; }
.splash-bar div { height: 100%; width: 0; background: repeating-linear-gradient(90deg, #36f 0 14px, transparent 14px 17px); transition: width 3s linear; }

.flag { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 70px; height: 62px; transform: skewY(-8deg) perspective(200px) rotateY(-14deg); }
.flag i { display: block; border-radius: 3px; }
.flag i:nth-child(1) { background: #f33; } .flag i:nth-child(2) { background: #3c3; }
.flag i:nth-child(3) { background: #36f; } .flag i:nth-child(4) { background: #fd0; }
.flag.mini { width: 16px; height: 14px; gap: 1px; display: inline-grid; vertical-align: -2px; transform: none; }
.flag.mini i { border-radius: 1px; }

/* ---------- Desktop ---------- */
#desktop { position: fixed; inset: 0; background: var(--teal); }
#icons {
  position: absolute; top: 10px; left: 8px; bottom: calc(var(--taskbar-h) + 8px);
  display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-start; gap: 14px;
}
.icon {
  width: 82px; background: none; border: 1px dotted transparent; padding: 4px 2px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; color: #fff; text-align: center;
  font-size: 12px; text-shadow: 1px 1px 0 #000;
}
.icon .ico { font-size: 34px; line-height: 1; filter: drop-shadow(1px 1px 0 #0006); }
.icon:focus { outline: none; border-color: #ff0; }
.icon:focus span:last-child { background: var(--navy); }
#giftIcon.locked .ico { filter: grayscale(1) brightness(.8); }
#giftIcon.ready .ico { animation: bounce .7s infinite; }
#giftIcon.ready span:last-child { background: #c00; padding: 0 3px; }
@keyframes bounce { 50% { transform: translateY(-8px) scale(1.15); } }

#windows { position: absolute; inset: 0 0 var(--taskbar-h) 0; pointer-events: none; }
#windows > * { pointer-events: auto; }

/* ---------- Bevel-Helfer ---------- */
.raised {
  border: 1px solid; border-color: var(--light) var(--dark) var(--dark) var(--light);
  box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--mid);
}
.sunken {
  border: 1px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow);
  box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--mid);
}

/* ---------- Fenster ---------- */
.win {
  position: absolute; background: var(--face); padding: 3px;
  max-width: calc(100vw - 12px);
  border: 1px solid; border-color: var(--mid) var(--dark) var(--dark) var(--mid);
  box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--light), 4px 4px 0 #0003;
  animation: pop .12s ease-out;
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.win.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px) } 40%, 80% { transform: translateX(8px) } }

.titlebar {
  display: flex; align-items: center; gap: 4px; padding: 2px 2px 2px 4px; height: 22px;
  background: linear-gradient(90deg, var(--navy), #1084d0); color: #fff; font-weight: bold;
  cursor: move; user-select: none; touch-action: none;
}
.win.inactive .titlebar { background: linear-gradient(90deg, #808080, #b5b5b5); color: #ddd; }
.ttext { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbtns { display: flex; gap: 2px; }
.tbtn {
  width: 18px; height: 16px; padding: 0; background: var(--face); color: #000; cursor: pointer;
  font: bold 12px/1 Arial, sans-serif; display: grid; place-items: center;
  border: 1px solid; border-color: var(--light) var(--dark) var(--dark) var(--light);
  box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--mid);
}
.tbtn.tclose { margin-left: 2px; }
.tbtn:active { border-color: var(--dark) var(--light) var(--light) var(--dark); }
.wbody { padding: 10px; }

.btn {
  min-width: 80px; padding: 5px 12px; background: var(--face); cursor: pointer;
  border: 1px solid; border-color: var(--light) var(--dark) var(--dark) var(--light);
  box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--mid);
}
.btn:active { border-color: var(--dark) var(--light) var(--light) var(--dark); box-shadow: inset 1px 1px var(--shadow); }
.btn:disabled { color: var(--shadow); text-shadow: 1px 1px 0 #fff; cursor: not-allowed; }
.btn.default { outline: 1px solid #000; outline-offset: -4px; }
.btns { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

.msg { display: flex; gap: 14px; align-items: flex-start; }
.msg-icon { font-size: 32px; line-height: 1; }
.msg-text { line-height: 1.45; padding-top: 4px; }
.msg-text p { margin: 0 0 8px; }

/* Fortschrittsbalken */
.progress { height: 22px; padding: 2px; background: #fff; margin: 10px 0 4px; }
.progress > div {
  height: 100%; width: 0; transition: width .25s linear;
  background: repeating-linear-gradient(90deg, var(--navy) 0 10px, transparent 10px 12px);
}

/* Werbe-Popups */
.poster-body { padding: 4px; display: flex; flex-direction: column; gap: 6px; }
.poster-body img { display: block; background: #888; object-fit: cover; }
.poster-body .ad-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ad-badge { font: bold 11px Arial, sans-serif; background: #ff0; border: 1px solid #000; padding: 1px 5px; animation: blinkbg .8s steps(2) infinite; }
@keyframes blinkbg { 50% { background: #f0f; color: #fff; } }
.win.tinyclose .tclose { width: 9px; height: 8px; font-size: 7px; }

/* Anrufe */
.call .wbody { padding: 0; }
.call-screen { width: 300px; max-width: calc(100vw - 20px); background: linear-gradient(#2b2b4a, #111); color: #fff; text-align: center; padding: 18px 14px 14px; }
.avatar { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; display: block; margin: 0 auto 10px; }
.ringing .avatar { animation: ring 1.2s infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 #4f4a; } 100% { box-shadow: 0 0 0 26px #4f40; } }
.call-label { font-size: 12px; color: #9ab; letter-spacing: 1px; text-transform: uppercase; }
.call-name { font-size: 22px; font-weight: bold; margin: 4px 0 2px; }
.call-sub { font-size: 12px; color: #aaa; }
.call-area { position: relative; height: 130px; margin-top: 14px; }
.cbtn {
  position: absolute; top: 40px; width: 110px; height: 44px; border-radius: 22px; border: 0; cursor: pointer;
  font-weight: bold; color: #fff; transition: left .12s, top .12s;
}
.cbtn.accept { left: 20px; background: #2c2; animation: wiggle 1s infinite; }
.cbtn.decline { left: 170px; background: #d22; }
@keyframes wiggle { 0%, 100% { transform: rotate(0) } 25% { transform: rotate(-4deg) } 75% { transform: rotate(4deg) } }
.taunt { position: absolute; left: 0; right: 0; bottom: 0; font-size: 12px; color: #fc6; min-height: 16px; }
.chat-lines { text-align: left; min-height: 150px; max-height: 240px; overflow-y: auto; margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.bubble { background: #fff; color: #000; padding: 7px 10px; border-radius: 12px 12px 12px 2px; max-width: 90%; align-self: flex-start; animation: pop .15s; line-height: 1.35; }
.bubble.typing { color: #888; letter-spacing: 3px; }
.call-timer { font-family: VT323, monospace; font-size: 20px; color: #4f4; }

/* Messenger */
.chatwin { width: 320px; }
.chat-log { background: #fff; height: 150px; overflow-y: auto; padding: 6px; margin-bottom: 6px; line-height: 1.5; }
.chat-log b.m { color: #c06; } .chat-log b.s { color: #06c; } .chat-log b.p { color: #080; }
.chat-in { display: flex; gap: 6px; }
.chat-in input { flex: 1; min-width: 0; padding: 4px; font: inherit; }

/* Karl Klammer */
.clippy { display: flex; gap: 10px; align-items: flex-end; }
.clippy-fig { font-size: 64px; animation: wobble 2s infinite; }
@keyframes wobble { 50% { transform: rotate(-10deg) translateY(-4px); } }
.speech { background: #ffffe1; border: 1px solid #000; border-radius: 8px; padding: 10px; line-height: 1.4; position: relative; max-width: 240px; }

/* Millionster Besucher */
.winner { text-align: center; background: repeating-linear-gradient(45deg, #ff0 0 12px, #f0f 12px 24px); padding: 4px; }
.winner-in { background: #fff; padding: 14px; }
.winner h2 { margin: 0 0 8px; font: 900 24px "Comic Sans MS", "Comic Neue", cursive; color: #f00; animation: rainbow 1s linear infinite; }
@keyframes rainbow { 0% { color: #f00 } 33% { color: #0a0 } 66% { color: #00f } 100% { color: #f00 } }
.winner marquee, .winner .marq { font-weight: bold; }

/* Lizenzvertrag */
.eula { height: 170px; overflow-y: auto; background: #fff; padding: 8px; line-height: 1.45; margin: 8px 0; }
.eula p { margin: 0 0 10px; }

/* Virenscanner */
.scanlist { background: #fff; height: 120px; overflow-y: auto; padding: 4px 6px; font-family: "Courier New", monospace; font-size: 12px; margin-top: 8px; }
.scanlist div { padding: 2px 0; }
.scanlist .bad { color: #c00; }

/* Startmenü & Taskleiste */
#taskbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--taskbar-h); z-index: 4000;
  background: var(--face); display: flex; align-items: center; gap: 4px; padding: 2px 3px;
  border-top: 1px solid var(--mid); box-shadow: inset 0 1px var(--light);
}
#startBtn {
  font-weight: bold; height: 26px; padding: 0 8px; display: flex; align-items: center; gap: 5px; cursor: pointer;
  background: var(--face); border: 1px solid; border-color: var(--light) var(--dark) var(--dark) var(--light);
  box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--mid);
}
#startBtn.on { border-color: var(--dark) var(--light) var(--light) var(--dark); box-shadow: inset 1px 1px var(--shadow); }
#tasks { flex: 1; display: flex; gap: 3px; overflow: hidden; min-width: 0; }
.task {
  height: 26px; min-width: 0; max-width: 160px; flex: 0 1 160px; padding: 0 6px; text-align: left; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--face);
  border: 1px solid; border-color: var(--light) var(--dark) var(--dark) var(--light);
  box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--mid);
}
.task.active { font-weight: bold; background: repeating-conic-gradient(#c0c0c0 0 25%, #fff 0 50%) 0 0 / 2px 2px; border-color: var(--dark) var(--light) var(--light) var(--dark); }
#tray {
  height: 26px; display: flex; align-items: center; gap: 8px; padding: 0 8px; white-space: nowrap;
  border: 1px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow);
}
#tray button { background: none; border: 0; padding: 0; cursor: pointer; font-size: 14px; }
#balloon {
  position: absolute; right: 8px; bottom: calc(var(--taskbar-h) + 10px); width: 260px;
  background: #ffffe1; border: 1px solid #000; border-radius: 8px; padding: 10px 12px; line-height: 1.4;
  box-shadow: 3px 3px 0 #0004; cursor: pointer; animation: pop .2s;
}
#balloon::after { content: ""; position: absolute; right: 40px; bottom: -10px; border: 10px solid transparent; border-top-color: #ffffe1; border-bottom: 0; }

#startmenu {
  position: absolute; left: 2px; bottom: var(--taskbar-h); z-index: 4001; display: flex; background: var(--face);
  border: 1px solid; border-color: var(--mid) var(--dark) var(--dark) var(--mid);
  box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--light);
  padding: 3px;
}
.sm-side {
  writing-mode: vertical-rl; transform: rotate(180deg); background: linear-gradient(var(--navy), #1084d0);
  color: #c0c0c0; font: 22px Arial, sans-serif; padding: 6px 4px; letter-spacing: 1px;
}
.sm-side b { color: #fff; }
#startmenu ul { list-style: none; margin: 0; padding: 0; min-width: 220px; }
#startmenu li { padding: 8px 14px 8px 10px; cursor: pointer; font-size: 14px; }
#startmenu li:hover { background: var(--navy); color: #fff; }
#startmenu li.sep { padding: 0; height: 2px; margin: 3px 2px; border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--light); pointer-events: none; }
#startmenu small { color: #666; }
#startmenu li:hover small { color: #ccc; }

/* Bluescreen */
#bsod { background: #0000aa; color: #fff; font: 22px VT323, monospace; display: grid; place-items: center; padding: 20px; }
.bsod-inner { max-width: 640px; }
.bsod-title { background: #aaa; color: #0000aa; padding: 0 8px; display: table; margin: 0 auto 20px; }
.blink { animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Auflösung ---------- */
#reveal {
  position: fixed; inset: 0; z-index: 6000; overflow-y: auto; overflow-x: hidden;
  background: linear-gradient(180deg, #1b0a3c 0%, #5b1a6e 35%, #e0457b 62%, #ff9a3c 82%, #ffd166 100%);
  color: #fff; text-align: center;
}
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.sun {
  position: fixed; left: 50%; bottom: -18vmin; width: 70vmin; height: 70vmin; transform: translateX(-50%);
  border-radius: 50%; z-index: 0;
  background: linear-gradient(#ffe66d, #ff6b6b);
  -webkit-mask: repeating-linear-gradient(180deg, #000 0 18px, transparent 18px 24px);
          mask: repeating-linear-gradient(180deg, #000 0 18px, transparent 18px 24px);
  opacity: .85;
}
.palms { position: fixed; inset: auto 0 0 0; display: flex; justify-content: space-between; z-index: 1; pointer-events: none; }
.palms span { font-size: min(22vw, 180px); line-height: .8; filter: drop-shadow(0 0 12px #0008); }
.palms span:nth-child(2), .palms span:nth-child(3) { font-size: min(12vw, 100px); }
.reveal-content { position: relative; z-index: 2; max-width: 760px; margin: 0 auto; padding: 6vh 16px 200px; }
.r-hello { font: 22px Pacifico, cursive; margin: 0; opacity: 0; animation: up .8s .3s forwards; }
.r-name { font: 64px/1.1 Pacifico, cursive; margin: 4px 0 18px; text-shadow: 0 4px 0 #0005, 0 0 30px #ff5ec4; opacity: 0; animation: up .8s .8s forwards; }
.r-gift { font-size: 18px; letter-spacing: 3px; text-transform: uppercase; margin: 0 0 10px; opacity: 0; animation: up .8s 1.4s forwards; }
.gta { position: relative; display: inline-flex; flex-direction: column; align-items: center; padding: 18px 34px 22px; background: #000c; border: 3px solid #fff; box-shadow: 0 0 0 6px #000c, 0 20px 60px #0008; opacity: 0; animation: zoom .9s 1.9s cubic-bezier(.2, 1.6, .4, 1) forwards; }
.gta-top { font: 26px Anton, Impact, sans-serif; letter-spacing: 4px; text-transform: uppercase; }
.gta-vi {
  font: 150px/1 Anton, Impact, sans-serif; letter-spacing: -4px;
  background: linear-gradient(180deg, #ffb3d9 0%, #ff4f9a 40%, #ff8a3d 70%, #ffd166 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px #ff4f9a99);
}
.stamp {
  position: absolute; right: -34px; bottom: 22px; transform: rotate(-12deg);
  font: 20px Anton, Impact, sans-serif; letter-spacing: 2px; text-transform: uppercase; color: #3f3;
  border: 3px solid #3f3; padding: 2px 10px; background: #000a; opacity: 0; animation: stamp .4s 3s forwards;
}
@keyframes up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes zoom { from { opacity: 0; transform: scale(.3) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes stamp { from { opacity: 0; transform: rotate(-12deg) scale(3); } to { opacity: 1; transform: rotate(-12deg) scale(1); } }
.r-text { font-size: 19px; line-height: 1.55; margin: 28px auto 12px; max-width: 560px; background: #0005; padding: 14px 18px; border-radius: 10px; text-shadow: 0 2px 6px #0008; opacity: 0; animation: up .8s 3.4s forwards; }
.r-from { font: 26px Pacifico, cursive; margin: 10px 0 26px; text-shadow: 0 2px 8px #0008; opacity: 0; animation: up .8s 3.9s forwards; }
#againBtn { opacity: 0; animation: up .8s 4.6s forwards; color: #000; }
.marquee { position: fixed; left: 0; right: 0; bottom: 0; height: 120px; overflow: hidden; z-index: 2; background: #0006; border-top: 2px solid #fff4; opacity: 0; animation: up 1s 5s forwards; }
#marqueeTrack { display: flex; gap: 10px; padding: 8px 0; width: max-content; animation: scroll 80s linear infinite; }
#marqueeTrack img { height: 104px; width: auto; border: 2px solid #fff; }
@keyframes scroll { to { transform: translateX(-50%); } }

@media (max-width: 600px) {
  .r-name { font-size: 46px; }
  .gta-vi { font-size: 110px; }
  .stamp { right: -16px; font-size: 16px; }
  .icon { width: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .r-hello, .r-name, .r-gift, .gta, .stamp, .r-text, .r-from, #againBtn, .marquee { opacity: 1; }
}
