/* =========================================================
   DylanOS 98. Pixels, bevels, and poor decisions.
   ========================================================= */
:root {
  --face: #c3c3c3;
  --hi: #ffffff;
  --lo: #7b7b7b;
  --dk: #111111;
  --title1: #ff3e9a;
  --title2: #ff8a3d;
  --cyan: #3df0ff;
  --lime: #c6ff3d;
  --yellow: #ffd23f;
  --ink: #111;
  --night: #1a0b3d;

  --ui: "Pixelify Sans", "Trebuchet MS", sans-serif;
  --tiny: "Silkscreen", "Pixelify Sans", monospace;
  --term: "VT323", ui-monospace, monospace;

  --raised: inset -1px -1px var(--dk), inset 1px 1px var(--hi), inset -2px -2px var(--lo), inset 2px 2px #dfdfdf;
  --sunken: inset -1px -1px var(--hi), inset 1px 1px var(--lo), inset -2px -2px #dfdfdf, inset 2px 2px var(--dk);
  --pressed: inset -1px -1px var(--hi), inset 1px 1px var(--dk), inset -2px -2px #dfdfdf, inset 2px 2px var(--lo);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: #000;
  color: var(--ink);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.35;
  -webkit-font-smoothing: none;
  -webkit-tap-highlight-color: transparent;
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='28' shape-rendering='crispEdges'><path d='M0 0h2v2h2v2h2v2h2v2h2v2h2v2h2v2h-6v2h2v4h2v4h-4v-4h-2v-4h-2v2h-2v2h-2z' fill='black'/><path d='M2 4h2v2h2v2h2v2h2v2h2v2h-4v4h2v4h-2v-4h-2v-4h-2v2h-2z' fill='white'/></svg>") 0 0, auto;
}
a { color: #2b2bd9; }
button { font: inherit; color: inherit; cursor: inherit; }
img { image-rendering: pixelated; }
.dim { color: #666; }
.label { font-family: var(--tiny); font-size: 10px; text-transform: uppercase; color: #555; margin: 0 0 6px; }
:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }

/* =================== BOOT =================== */
.boot {
  position: fixed; inset: 0; z-index: 200;
  background: #000; color: #c8c8c8;
  font-family: var(--term); font-size: clamp(17px, 2.1vw, 24px); line-height: 1.15;
  padding: clamp(16px, 3vw, 40px);
}
.boot.off { animation: crtOff .55s ease-in forwards; }
@keyframes crtOff {
  0% { transform: none; filter: brightness(1); }
  60% { transform: scale(1, .004); filter: brightness(3); }
  100% { transform: scale(0, .004); filter: brightness(5); opacity: 0; }
}
.bios div { white-space: pre-wrap; }
.bios div:first-child { color: #fff; }
.bios__ok { color: var(--lime); }
.bios__warn { color: var(--yellow); }
.bios__bad { color: #ff4b4b; }
.splash {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  background: radial-gradient(circle at 50% 40%, #2a1458, #000 70%);
}
.splash__logo { display: flex; align-items: center; gap: 18px; font-family: var(--ui); color: #fff; animation: logoIn .8s steps(6) both; }
.splash__logo b { font-size: clamp(2.4rem, 7vw, 4.4rem); font-weight: 700; letter-spacing: -1px; text-shadow: 3px 3px 0 var(--title1), 6px 6px 0 var(--cyan); }
.splash__logo span { font-family: var(--tiny); font-size: clamp(1.1rem, 3vw, 1.8rem); color: var(--lime); margin-left: 8px; vertical-align: top; }
.splash__icon { width: 64px; height: 64px; }
@keyframes logoIn { from { opacity: 0; transform: translateY(14px); } }
.splash__bar {
  position: relative; width: min(240px, 60vw); height: 18px; overflow: hidden;
  border: 2px solid #fff; padding: 2px; background: #000;
}
.splash__bar i { position: absolute; top: 2px; width: 14px; height: 10px; background: var(--cyan); animation: slide 1.6s linear infinite; }
.splash__bar i:nth-child(2) { animation-delay: .12s; background: var(--title1); }
.splash__bar i:nth-child(3) { animation-delay: .24s; background: var(--lime); }
@keyframes slide { from { left: -40px; } to { left: 260px; } }
.splash__msg { margin: 0; font-family: var(--term); font-size: 22px; color: #c8b8ff; min-height: 1em; }
.boot__skip { position: absolute; right: 20px; bottom: 16px; background: none; border: 0; color: #555; font-family: var(--term); font-size: 18px; animation: blink 1s steps(1) infinite; }

/* =================== SCREEN =================== */
.screen { position: fixed; inset: 0; overflow: hidden; background: var(--night); }
body.booting .screen { visibility: hidden; }
body.powering-on .screen { animation: crtOn 1.1s cubic-bezier(.2,.8,.2,1) both; }
@keyframes crtOn {
  0% { transform: scale(0, .004); filter: brightness(6); }
  35% { transform: scale(1, .004); filter: brightness(4); }
  70% { transform: scale(1, 1.02); filter: brightness(1.4); }
  100% { transform: none; filter: none; }
}
body.shutting .screen { animation: crtOff .8s ease-in forwards; }
.wallpaper { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; display: block; }

/* CRT overlay */
.crt { position: absolute; inset: 0; pointer-events: none; z-index: 150; display: none; }
body.crt-on .crt {
  display: block;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, .14) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 62%, rgba(0, 0, 0, .45));
  animation: flicker 4s steps(2) infinite;
}
@keyframes flicker { 0%, 96%, 100% { opacity: 1; } 97% { opacity: .85; } 98% { opacity: .95; } }

/* news ticker */
.news {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; align-items: center; height: 24px; overflow: hidden;
  background: #000; color: var(--lime); font-family: var(--term); font-size: 19px;
  border-bottom: 2px solid var(--title1);
}
.news__tag { position: relative; z-index: 1; flex: none; padding: 0 10px; height: 100%; display: grid; place-items: center; background: var(--title1); color: #fff; font-family: var(--tiny); font-size: 11px; animation: blink 1s steps(1) infinite; }
.news__track { display: flex; gap: 22px; padding-left: 22px; white-space: nowrap; animation: marquee 60s linear infinite; }
.news__track b { color: var(--title1); font-weight: 400; }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes blink { 50% { opacity: .35; } }

/* desktop icons */
.icons {
  position: absolute; top: 36px; left: 8px; bottom: 48px; z-index: 2;
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 86px); grid-auto-columns: 92px; gap: 4px 6px;
}
.icon button {
  width: 92px; height: 84px; padding: 4px 2px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: 0; color: #fff;
  font-size: 12px; line-height: 1.1; text-align: center;
  text-shadow: 1px 1px 0 #000, -1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000;
}
.icon img { width: 40px; height: 40px; transition: transform .15s steps(2); }
.icon button:hover img { transform: translateY(-3px); }
.icon button span { padding: 1px 3px; }
.icon button.is-sel span { background: #2b2bd9; text-shadow: none; outline: 1px dotted #fff; }
.icon button.is-sel img { filter: drop-shadow(0 0 0 #2b2bd9) brightness(.75) sepia(1) hue-rotate(200deg) saturate(4); }

/* widgets */
.widgets { position: absolute; right: 14px; top: 38px; z-index: 2; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.widget { background: var(--face); box-shadow: var(--raised); padding: 6px; font-size: 11px; }
.construction { position: relative; width: 210px; text-align: center; font-family: var(--tiny); font-size: 10px; padding: 0; overflow: hidden; }
.construction__stripes { height: 14px; background: repeating-linear-gradient(-45deg, #000 0 8px, var(--yellow) 8px 16px); animation: stripes 1s linear infinite; background-size: 22.6px 22.6px; }
.construction span { display: block; padding: 4px 4px 5px; background: var(--yellow); }
@keyframes stripes { to { background-position: 22.6px 0; } }
.counter { display: flex; flex-direction: column; align-items: center; width: 150px; }
.counter b { font-family: var(--term); font-size: 26px; background: #000; color: #ff3b3b; padding: 0 6px; letter-spacing: 3px; box-shadow: var(--sunken); margin: 2px 0; }
.counter small { color: #555; font-size: 10px; }

/* =================== WINDOWS =================== */
.windows { position: absolute; inset: 24px 0 40px; z-index: 5; pointer-events: none; }
.win {
  position: absolute; display: flex; flex-direction: column;
  background: var(--face); box-shadow: var(--raised), 6px 6px 0 rgba(0, 0, 0, .35);
  padding: 3px; pointer-events: auto;
  animation: winOpen .22s steps(4) both;
}
@keyframes winOpen { from { transform: translate(var(--fx, 0), var(--fy, 0)) scale(.1); opacity: .2; } }
.win.is-closing { animation: winClose .16s steps(3) forwards; }
@keyframes winClose { to { transform: scale(.6); opacity: 0; } }
.win.is-min { display: none; }
.win.is-max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; box-shadow: var(--raised); }
.win.is-drag { opacity: .92; }
.win__bar {
  display: flex; align-items: center; gap: 6px; height: 24px; padding: 0 3px 0 5px; flex: none;
  background: linear-gradient(90deg, #7b7b7b, #b5b5b5); color: #ddd;
  user-select: none; touch-action: none;
}
.win.is-focus .win__bar { background: linear-gradient(90deg, var(--title1), var(--title2)); color: #fff; }
.win__icon { width: 16px; height: 16px; }
.win__title { flex: 1; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 1px 1px 0 rgba(0, 0, 0, .3); }
.win__ctrls { display: flex; gap: 2px; }
.win__ctrls button {
  width: 18px; height: 16px; padding: 0; border: 0; background: var(--face); box-shadow: var(--raised);
  font-family: var(--tiny); font-size: 10px; line-height: 14px; color: #000;
}
.win__ctrls button:active { box-shadow: var(--pressed); }
.win__ctrls button[data-w="close"] { margin-left: 2px; }
.win__body { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: 3px; overflow: hidden; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 70px; padding: 5px 12px; border: 0; background: var(--face); box-shadow: var(--raised);
  font-size: 13px; color: #000; text-decoration: none; white-space: nowrap;
}
.btn:active:not(:disabled) { box-shadow: var(--pressed); transform: translate(1px, 1px); }
.btn:disabled { color: #8a8a8a; text-shadow: 1px 1px #fff; }
.btn--small { min-width: 0; padding: 3px 8px; font-size: 12px; }
.btn--go { background: var(--lime); }

.menubar { display: flex; gap: 14px; padding: 2px 6px 4px; font-size: 13px; flex: none; }
.menubar span:first-letter { text-decoration: underline; }
.statusbar { display: flex; justify-content: space-between; gap: 10px; margin-top: 3px; flex: none; }
.statusbar span { flex: 1; padding: 2px 6px; box-shadow: var(--sunken); font-size: 11px; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.statusbar span + span { flex: 0 1 auto; }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 4px 6px 6px; flex: none; border-bottom: 1px solid var(--lo); box-shadow: 0 1px 0 var(--hi); }
.toolbar__title { font-weight: 700; font-size: 16px; margin-right: auto; }
.badge { font-family: var(--tiny); font-size: 9px; padding: 2px 6px; background: #000; color: #fff; }
.badge--live { background: #0c6b2d; color: var(--lime); }
.app { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* notepad */
.notepad { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.notepad__text { flex: 1; overflow: auto; background: #fff; box-shadow: var(--sunken); padding: 10px 12px; font-size: 15px; }
.notepad__text p { margin: 0 0 10px; }

/* =================== OUTBOX =================== */
.ob__wrap { flex: 1; min-height: 0; display: grid; grid-template-columns: 230px 1fr; gap: 6px; padding: 6px 4px 0; }
.ob__list { list-style: none; margin: 0; padding: 2px; overflow: auto; background: #fff; box-shadow: var(--sunken); }
.ob__list li { display: flex; gap: 8px; align-items: center; padding: 7px 6px; border-bottom: 1px dotted #ccc; }
.ob__list li[aria-selected="true"] { background: #2b2bd9; color: #fff; }
.ob__list .av { flex: none; width: 28px; height: 28px; display: grid; place-items: center; background: var(--c); color: #000; font-size: 11px; font-weight: 700; box-shadow: var(--raised); }
.ob__who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ob__who b { font-weight: 600; font-size: 14px; }
.chip { font-style: normal; font-family: var(--tiny); font-size: 9px; padding: 1px 5px; align-self: flex-start; color: #000; }
.chip--lime { background: var(--lime); } .chip--orange { background: var(--title2); } .chip--pink { background: var(--title1); color: #fff; } .chip--cyan { background: var(--cyan); }
.ob__detail { display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: auto; }
.ob__notice { padding: 8px 10px; background: #fffbe0; border: 1px solid #000; box-shadow: 3px 3px 0 #000; font-size: 13px; }
.ob__notice b { color: #b3005f; }
.ob__thread { padding: 6px 8px; background: #fff; box-shadow: var(--sunken); font-size: 13px; }
.ob__thread p { margin: 0 0 4px; }
.ob__draftbox { background: #fff; box-shadow: var(--sunken); flex: 1; min-height: 96px; display: flex; flex-direction: column; }
.ob__draftbar { display: flex; justify-content: space-between; padding: 3px 8px; background: #e6e6e6; font-family: var(--tiny); font-size: 9px; }
.ob__voice { color: #b3005f; }
.ob__draft { margin: 0; padding: 8px; font-size: 14px; min-height: 3em; }
.ob__draft.is-typing::after { content: "▌"; animation: blink .8s steps(1) infinite; }
.ob__actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* =================== BOYD =================== */
.by__clock { font-family: var(--term); font-size: 20px; background: #000; color: var(--lime); padding: 0 8px; box-shadow: var(--sunken); }
.by__wrap { flex: 1; min-height: 0; display: grid; grid-template-columns: 210px 1fr; gap: 8px; padding: 8px 4px 0; }
.by__docs { display: flex; flex-direction: column; gap: 6px; }
.by__files { list-style: none; margin: 0; padding: 4px; background: #fff; box-shadow: var(--sunken); }
.by__files li { display: flex; align-items: center; gap: 6px; padding: 3px 4px; font-size: 13px; cursor: grab; }
.by__files li:hover { background: #2b2bd9; color: #fff; }
.by__files img { width: 16px; height: 16px; }
.by__drop { flex: 1; min-height: 80px; display: grid; place-items: center; text-align: center; padding: 8px; border: 2px dashed #555; font-size: 13px; background: repeating-linear-gradient(45deg, #d4d4d4 0 6px, #c9c9c9 6px 12px); }
.by__drop small { color: #555; font-size: 11px; }
.by__drop.is-over { background: var(--lime); border-color: #000; }
.by__drop.is-full { background: #e8ffd0; border-style: solid; }
.by__run { display: flex; flex-direction: column; min-height: 0; }
.by__agents { list-style: none; margin: 0 0 6px; padding: 6px; background: #fff; box-shadow: var(--sunken); display: grid; gap: 4px; }
.by__agents li { display: grid; grid-template-columns: 74px 1fr 56px; gap: 8px; align-items: center; font-size: 13px; }
.by__agents em { font-style: normal; font-family: var(--tiny); font-size: 9px; color: #777; }
.by__agents li.is-run em { color: #b3005f; animation: blink .6s steps(1) infinite; }
.by__agents li.is-done em { color: #0c6b2d; }
.pbar { height: 14px; padding: 2px; box-shadow: var(--sunken); background: #fff; }
.pbar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, #2b2bd9 0 8px, transparent 8px 10px); }
.by__agents li.is-done .pbar i { background: repeating-linear-gradient(90deg, #0c6b2d 0 8px, transparent 8px 10px); }
.by__log { flex: 1; min-height: 70px; margin: 0; padding: 6px 8px; overflow: auto; background: #000; color: var(--lime); font-family: var(--term); font-size: 17px; line-height: 1.1; box-shadow: var(--sunken); white-space: pre-wrap; }
.by__memo { position: absolute; inset: 30px 0 0; display: grid; place-items: center; background: rgba(0, 0, 0, .35); z-index: 2; }
.by { position: relative; }
.memo { width: min(360px, 92%); background: #fff; padding: 16px 18px; border: 2px solid #000; box-shadow: 6px 6px 0 #000; animation: winOpen .25s steps(4) both; }
.memo__h { margin: 0 0 10px; font-family: var(--tiny); font-size: 13px; }
.memo__h span { font-family: var(--ui); font-size: 12px; color: #666; }
.memo dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.memo dt { font-size: 11px; color: #666; }
.memo dd { margin: 0; font-family: var(--term); font-size: 26px; line-height: 1; color: #b3005f; }
.memo__fine { font-size: 11px; color: #666; margin: 12px 0 10px; }

/* =================== RECYCLE BIN =================== */
.bin__wrap { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 220px; gap: 6px; padding: 0 4px; }
.bin__list { list-style: none; margin: 0; padding: 4px; overflow: auto; background: #fff; box-shadow: var(--sunken); }
.bin__list li { display: flex; align-items: center; gap: 6px; padding: 4px; font-size: 13px; }
.bin__list li img { width: 16px; height: 16px; }
.bin__list li[aria-selected="true"] { background: #2b2bd9; color: #fff; }
.bin__list li.poof { animation: poof .5s steps(4) forwards; }
@keyframes poof { to { transform: scale(1.4) rotate(8deg); opacity: 0; filter: blur(2px); } }
.bin__list .empty { padding: 20px; justify-content: center; }
.bin__props { display: flex; flex-direction: column; gap: 6px; }
.bin__detail { flex: 1; padding: 8px; background: #fff; box-shadow: var(--sunken); font-size: 13px; display: flex; flex-direction: column; gap: 4px; overflow: auto; }
.bin__detail b { word-break: break-all; }
.bin__detail p { margin: 6px 0 0; }
.bin__btns { display: grid; gap: 4px; }

/* =================== INTERNOT EXPLORER =================== */
.ie__bar { display: flex; gap: 4px; align-items: center; padding: 2px 4px 6px; flex: none; }
.ie__addr { flex: 1; display: flex; align-items: center; gap: 6px; font-size: 12px; }
.ie__addr input { flex: 1; min-width: 0; font: inherit; font-size: 12px; padding: 3px 5px; border: 0; box-shadow: var(--sunken); background: #fff; }
.ie__tabs { display: flex; gap: 2px; padding: 0 4px; flex: none; }
.ie__tab { padding: 4px 10px; border: 0; background: var(--face); box-shadow: var(--raised); font-size: 12px; }
.ie__tab.is-on { background: #fff; position: relative; top: 1px; }
.ie__page { flex: 1; min-height: 0; overflow: auto; background: #fff; box-shadow: var(--sunken); margin: 0 4px; padding: 14px 18px; font-family: "Times New Roman", serif; font-size: 15px; }
.ie__loading { font-family: var(--term); font-size: 22px; color: #555; }
.dots::after { content: ""; animation: dots 1s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.ie__err h4 { font-family: var(--ui); font-size: 20px; margin: 0 0 10px; color: #000; }
.ie__err ul { margin: 4px 0 12px; }
.ie__err .btn { font-family: var(--ui); }
.ie__err .dim { margin-top: 20px; font-size: 12px; }
.tw { border: 1px solid #000; box-shadow: 3px 3px 0 #000; padding: 10px 12px; margin-bottom: 12px; font-family: var(--ui); }
.tw header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tw header img { width: 22px; height: 22px; }
.tw p { margin: 0 0 6px; font-size: 15px; white-space: pre-wrap; }
.tw a { font-size: 12px; }

/* =================== RESUME =================== */
.doc__page { flex: 1; overflow: auto; background: #fff; box-shadow: var(--sunken); padding: 18px 22px; }
.doc__page h3 { margin: 0 0 14px; font-size: 20px; }
.doc__page h3 small { font-size: 12px; color: #777; font-weight: 400; }
.cv { margin: 0; }
.cv div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px dotted #bbb; }
.cv dt { font-family: var(--tiny); font-size: 10px; color: #b3005f; padding-top: 3px; }
.cv dd { margin: 0; font-size: 14px; }
.cv dd b { display: block; font-size: 16px; }

/* =================== BUDDYCHAT =================== */
.buddies { padding: 4px; }
.buddies__head { display: flex; align-items: center; gap: 8px; padding: 8px; background: linear-gradient(#ffe66b, var(--yellow)); box-shadow: var(--raised); margin-bottom: 8px; }
.buddies__head img { width: 32px; height: 32px; }
.buddies__head b { font-size: 18px; }
.buddies__head small { margin-left: auto; font-size: 11px; color: #555; }
.buddies__list { list-style: none; margin: 0 0 8px; padding: 4px; background: #fff; box-shadow: var(--sunken); flex: 1; overflow: auto; }
.buddies__list a { display: grid; grid-template-columns: 14px 1fr; gap: 0 8px; padding: 8px 6px; color: #000; text-decoration: none; font-weight: 600; font-size: 15px; }
.buddies__list a:hover { background: #2b2bd9; color: #fff; }
.buddies__list small { grid-column: 2; font-weight: 400; font-size: 12px; color: #666; }
.buddies__list a:hover small { color: #ddd; }
.buddies__list i { width: 10px; height: 10px; margin-top: 4px; border: 1px solid #000; }
.buddies__list i.on { background: var(--lime); }
.buddies__list i.away { background: var(--yellow); }

/* =================== TERMINAL =================== */
.term { flex: 1; min-height: 0; overflow: auto; background: #000; color: #d8d8d8; font-family: var(--term); font-size: 19px; line-height: 1.1; padding: 8px 10px; box-shadow: var(--sunken); }
.term__out { margin: 0; white-space: pre-wrap; font: inherit; }
.term__line { display: flex; gap: 6px; }
.term__in { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--lime); font: inherit; caret-color: var(--lime); padding: 0; }

/* =================== MINESWEEPER =================== */
.mines { padding: 6px; gap: 6px; }
.mines__top { display: flex; justify-content: space-between; align-items: center; padding: 5px; box-shadow: var(--sunken); }
.mines__lcd { font-family: var(--term); font-size: 26px; line-height: 1; background: #000; color: #ff2b2b; padding: 0 4px; }
.mines__face { width: 30px; height: 30px; padding: 0; border: 0; background: var(--face); box-shadow: var(--raised); font-size: 16px; }
.mines__grid { flex: 1; display: grid; box-shadow: var(--sunken); padding: 3px; }
.cell { aspect-ratio: 1; border: 0; padding: 0; background: var(--face); box-shadow: var(--raised); font-family: var(--tiny); font-size: 12px; font-weight: 700; }
.cell.open { box-shadow: inset 1px 1px #8a8a8a; background: #d6d6d6; }
.cell.boom { background: #ff3b3b; }
.cell[data-n="1"] { color: #0000ff; } .cell[data-n="2"] { color: #008000; } .cell[data-n="3"] { color: #ff0000; } .cell[data-n="4"] { color: #000080; } .cell[data-n="5"] { color: #800000; }
.mines__foot { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: #555; }

/* =================== PICTURE =================== */
.pic { background: #808080; }
.pic__canvas { flex: 1; min-height: 0; width: 100%; image-rendering: pixelated; object-fit: contain; background: #000; box-shadow: var(--sunken); }

/* =================== DIALOG =================== */
.dialog { padding: 10px; justify-content: space-between; }
.dialog__body { display: flex; gap: 14px; align-items: flex-start; padding: 6px 4px; }
.dialog__body img { width: 40px; height: 40px; flex: none; }
.dialog__body p { margin: 0; font-size: 14px; }
.dialog__btns { display: flex; justify-content: center; gap: 8px; padding: 8px 0 4px; }
.modal { position: fixed; inset: 0; z-index: 180; display: grid; place-items: center; background: rgba(0, 0, 0, .2); }
.modal__win { position: relative; width: min(400px, 92vw); }
.modal__win .win__body { padding: 10px; }

/* =================== TASKBAR / START =================== */
.taskbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 100;
  height: 40px; padding: 4px 4px max(4px, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 4px;
  background: var(--face); box-shadow: inset 0 1px var(--hi), inset 0 2px #dfdfdf;
}
.startbtn { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 6px; border: 0; background: var(--face); box-shadow: var(--raised); font-weight: 700; font-size: 15px; }
.startbtn img { width: 20px; height: 20px; }
.startbtn.is-on, .startbtn:active { box-shadow: var(--pressed); }
.tasks { flex: 1; min-width: 0; display: flex; gap: 4px; overflow: hidden; }
.task { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 170px; flex: 1; height: 30px; padding: 0 8px; border: 0; background: var(--face); box-shadow: var(--raised); font-size: 12px; text-align: left; }
.task img { width: 16px; height: 16px; flex: none; }
.task span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task.is-on { box-shadow: var(--pressed); background: repeating-conic-gradient(#d8d8d8 0 25%, #c3c3c3 0 50%) 0 0 / 2px 2px; font-weight: 700; }
.tray { display: flex; align-items: center; gap: 4px; height: 30px; padding: 0 4px; box-shadow: var(--sunken); }
.tray__btn { border: 0; background: none; font-size: 12px; padding: 2px 6px; }
.nopebtn { border: 0; height: 22px; padding: 0 8px; background: #ff2b2b; color: #fff; font-family: var(--tiny); font-size: 10px; box-shadow: inset -1px -1px #7a0000, inset 1px 1px #ff9b9b; animation: nudge 3s steps(2) infinite; }
.nopebtn:hover { animation: shake .2s steps(2) infinite; }
@keyframes nudge { 0%, 90%, 100% { transform: none; } 93% { transform: rotate(-6deg); } 96% { transform: rotate(6deg); } }
@keyframes shake { 50% { transform: translate(-1px, 1px) rotate(-2deg); } }

.start {
  position: absolute; left: 4px; bottom: 40px; z-index: 120;
  display: flex; background: var(--face); box-shadow: var(--raised), 4px 4px 0 rgba(0, 0, 0, .35); padding: 3px;
  animation: startUp .15s steps(3) both;
}
@keyframes startUp { from { transform: translateY(20px); opacity: 0; } }
.start__banner { width: 30px; background: linear-gradient(0deg, var(--title1), #6a1b8a); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; }
.start__banner span { writing-mode: vertical-rl; transform: rotate(180deg); color: #fff; font-weight: 700; font-size: 18px; letter-spacing: 1px; }
.start__banner b { color: var(--lime); }
.start__list { list-style: none; margin: 0; padding: 2px; min-width: 210px; }
.start__list li { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; font-size: 14px; }
.start__list li img { width: 24px; height: 24px; }
.start__list li:hover { background: #2b2bd9; color: #fff; }
.start__sep { height: 2px; padding: 0 !important; margin: 4px 2px; box-shadow: inset 0 1px var(--lo), inset 0 -1px var(--hi); }

/* context menu */
.ctx { position: absolute; z-index: 130; list-style: none; margin: 0; padding: 3px; min-width: 190px; background: var(--face); box-shadow: var(--raised), 3px 3px 0 rgba(0, 0, 0, .3); }
.ctx li { padding: 4px 18px; font-size: 13px; }
.ctx li:hover { background: #2b2bd9; color: #fff; }
.ctx__sep { height: 2px; padding: 0 !important; margin: 3px 2px; box-shadow: inset 0 1px var(--lo), inset 0 -1px var(--hi); }

/* =================== DUCK =================== */
.duck { position: absolute; right: 18px; bottom: 54px; z-index: 110; display: flex; align-items: flex-end; gap: 6px; animation: duckIn .4s steps(4) both; }
@keyframes duckIn { from { transform: translateY(120px); } }
.duck__body { border: 0; background: none; padding: 0; animation: bob 1.4s steps(2) infinite; }
.duck__body img { width: 72px; height: 72px; filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, .4)); }
@keyframes bob { 50% { transform: translateY(-4px); } }
.duck__bubble { position: relative; max-width: 260px; padding: 10px 12px; background: #ffffe1; border: 1px solid #000; font-size: 13px; box-shadow: 3px 3px 0 rgba(0, 0, 0, .3); margin-bottom: 40px; }
.duck__bubble::after { content: ""; position: absolute; right: -10px; bottom: 14px; border: 6px solid transparent; border-left: 8px solid #000; }
.duck__bubble.gone { display: none; }
.duck__bubble p { margin: 0 0 8px; }
.duck__btns { display: flex; gap: 4px; flex-wrap: wrap; }
.quack { position: absolute; right: 10px; bottom: 80px; font-family: var(--tiny); font-size: 14px; color: #fff; text-shadow: 2px 2px 0 #000; animation: quack .9s steps(5) forwards; pointer-events: none; }
@keyframes quack { to { transform: translateY(-40px) rotate(-10deg); opacity: 0; } }

/* =================== TOASTS =================== */
.toasts { position: fixed; left: 50%; top: 34px; transform: translateX(-50%); z-index: 190; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; width: max-content; max-width: 92vw; }
.toast { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; background: #ffffe1; border: 1px solid #000; box-shadow: 3px 3px 0 rgba(0, 0, 0, .4); font-size: 13px; animation: toastIn .25s steps(3) both; }
.toast img { width: 22px; height: 22px; }
.toast.out { animation: toastOut .3s steps(3) forwards; }
@keyframes toastIn { from { transform: translateY(-14px); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(-14px); opacity: 0; } }

/* =================== OVERLAYS =================== */
.bsod { position: fixed; inset: 0; z-index: 210; display: grid; place-items: center; background: #0000aa; color: #fff; font-family: var(--term); font-size: clamp(18px, 2.4vw, 26px); padding: 24px; }
.bsod > div { max-width: 760px; }
.bsod__title { text-align: center; } .bsod__title { display: table; margin: 0 auto 24px; background: #aaa; color: #0000aa; padding: 0 10px; }
.bsod__key { text-align: center; margin-top: 28px; }
.bsod__key span { animation: blink 1s steps(1) infinite; }
.saver { position: fixed; inset: 0; z-index: 205; background: #000; overflow: hidden; }
.saver__logo { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 10px; color: #ff3e9a; font-weight: 700; font-size: 44px; white-space: nowrap; }
.saver__logo img { width: 48px; height: 48px; }
.saver__logo b { font-family: var(--tiny); font-size: 20px; margin-left: 4px; }
.saver__logo.corner { animation: corner .15s steps(2) 8; }
@keyframes corner { 50% { filter: invert(1); } }
.shutdown { position: fixed; inset: 0; z-index: 205; display: grid; place-content: center; gap: 20px; text-align: center; background: #000; color: var(--title2); font-family: var(--term); font-size: clamp(24px, 4vw, 40px); }
.shutdown p { margin: 0; }
.shutdown button { justify-self: center; background: none; border: 1px solid #555; color: #888; font-family: var(--term); font-size: 20px; padding: 6px 14px; }
.shutdown button:hover { color: #fff; border-color: #fff; }

.rain { position: fixed; top: -80px; z-index: 195; pointer-events: none; animation: rain var(--dur) linear forwards; }
@keyframes rain { to { transform: translateY(calc(100vh + 120px)) rotate(var(--rot)); } }
.spark { position: fixed; z-index: 199; width: 4px; height: 4px; pointer-events: none; animation: spark .7s steps(4) forwards; }
@keyframes spark { to { transform: translateY(14px) scale(.5); opacity: 0; } }

/* =================== MOBILE =================== */
@media (max-width: 700px) {
  .icons { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); grid-template-rows: none; grid-auto-rows: 86px; right: 8px; }
  .icon button { width: 100%; }
  .widgets { display: none; }
  .windows { inset: 24px 0 40px; }
  .ob__wrap, .by__wrap, .bin__wrap { grid-template-columns: 1fr; overflow: auto; align-content: start; }
  .ob__detail { overflow: visible; }
  .ob__draftbox { min-height: 120px; }
  .ob__list { max-height: 150px; }
  .by__drop { min-height: 50px; }
  .nopebtn { font-size: 8px; padding: 0 5px; }
  #crtBtn { display: none; }
  .task { max-width: 110px; }
  .duck__bubble { max-width: 200px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =================== MENUS =================== */
.menubar span { padding: 1px 6px; cursor: default; }
.menubar span:hover, .menubar span.is-open { background: #2b2bd9; color: #fff; }
.menu { position: fixed; z-index: 185; list-style: none; margin: 0; padding: 3px; min-width: 210px; background: var(--face); box-shadow: var(--raised), 3px 3px 0 rgba(0, 0, 0, .3); animation: startUp .12s steps(2) both; }
.menu li { padding: 4px 16px; font-size: 13px; white-space: nowrap; }
.menu li:hover { background: #2b2bd9; color: #fff; }

/* =================== MY COMPUTER =================== */
.drives { flex: 1; list-style: none; margin: 0; padding: 8px; background: #fff; box-shadow: var(--sunken); overflow: auto; display: grid; gap: 4px; align-content: start; }
.drives button { width: 100%; display: grid; grid-template-columns: 32px 1fr; gap: 0 10px; align-items: center; padding: 6px; border: 0; background: none; text-align: left; }
.drives button img { grid-row: span 3; width: 32px; height: 32px; }
.drives button b { font-size: 14px; }
.drives button small { font-size: 11px; color: #666; }
.drives button:hover, .drives button.is-sel { background: #2b2bd9; color: #fff; }
.drives button:hover small, .drives button.is-sel small { color: #ddd; }
.usage { display: block; height: 8px; margin-top: 3px; box-shadow: var(--sunken); background: #fff; padding: 1px; }
.usage i { display: block; height: 100%; background: repeating-linear-gradient(90deg, #b3005f 0 6px, transparent 6px 8px); }

/* =================== DYLANNEWS =================== */
.newsapp__wrap { flex: 1; min-height: 0; display: grid; grid-template-columns: 240px 1fr; gap: 6px; padding: 0 4px; }
.newsapp__list { list-style: none; margin: 0; padding: 2px; overflow: auto; background: #fff; box-shadow: var(--sunken); }
.newsapp__list button { width: 100%; padding: 6px 8px; border: 0; border-bottom: 1px dotted #ccc; background: none; text-align: left; font-size: 12px; line-height: 1.25; }
.newsapp__list button:hover, .newsapp__list button.is-sel { background: #2b2bd9; color: #fff; }
.newsapp__article { overflow: auto; padding: 14px 16px; background: #fffdf4; box-shadow: var(--sunken); font-family: "Times New Roman", serif; font-size: 16px; line-height: 1.45; }
.newsapp__article h4 { margin: 4px 0 10px; font-size: 24px; line-height: 1.1; font-family: "Times New Roman", serif; }
.newsapp__kicker { margin: 0; font-family: var(--tiny); font-size: 10px; color: #b3005f; }
.news { cursor: pointer; }
.news__track span:hover { color: #fff; text-decoration: underline; }

/* =================== CONTROL PANEL =================== */
.settings__body { flex: 1; overflow: auto; padding: 10px 12px; background: #fff; box-shadow: var(--sunken); margin: 0 4px; display: grid; gap: 8px; align-content: start; }
.opt { display: flex; align-items: center; gap: 8px; font-size: 14px; flex-wrap: wrap; }
.opt small { flex-basis: 100%; padding-left: 24px; margin-top: -4px; font-size: 11px; color: #777; }
.opt--range small { flex-basis: auto; padding: 0; margin: 0; }
.opt--range input { flex: 1; accent-color: #b3005f; }
.opt input[type="checkbox"] { width: 14px; height: 14px; accent-color: #2b2bd9; }

/* =================== ACHIEVEMENTS =================== */
.trophies { padding: 4px; }
.trophies__head { display: flex; align-items: center; gap: 12px; padding: 10px; background: linear-gradient(90deg, #2a1458, #6a1b8a); color: #fff; box-shadow: var(--raised); margin-bottom: 6px; }
.trophies__head b { display: block; font-size: 22px; }
.trophies__head small { font-size: 11px; color: #e6d6ff; }
.trophies__list { flex: 1; list-style: none; margin: 0; padding: 4px; overflow: auto; background: #fff; box-shadow: var(--sunken); }
.trophies__list li { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: center; padding: 6px; border-bottom: 1px dotted #ccc; opacity: .55; }
.trophies__list li.got { opacity: 1; }
.trophies__list li span { font-size: 20px; text-align: center; }
.trophies__list b { display: block; font-size: 14px; }
.trophies__list small { font-size: 11px; color: #666; }

/* misc egg states */
.pic__canvas.flipped { transform: scaleX(-1); }
.pic__canvas.inverted { filter: invert(1); }
.construction.fast .construction__stripes { animation-duration: .15s; }
.widget { cursor: pointer; }
.doc__page mark { background: var(--lime); padding: 0 2px; margin: 0 2px; font-weight: 700; }

/* =================== GO BLUE =================== */
body.goblue .win.is-focus .win__bar { background: linear-gradient(90deg, #00274c, #00274c 55%, #ffcb05); }
body.goblue .news { border-bottom-color: #ffcb05; color: #ffcb05; }
body.goblue .news__tag { background: #00274c; color: #ffcb05; }
body.goblue .start__banner { background: linear-gradient(0deg, #00274c, #00274c); }
body.goblue .start__banner span, body.goblue .start__banner b { color: #ffcb05; }
body.goblue .taskbar { box-shadow: inset 0 2px #ffcb05; }
body.goblue .icon button.is-sel span { background: #00274c; color: #ffcb05; }

@media (max-width: 700px) {
  .newsapp__wrap { grid-template-columns: 1fr; grid-template-rows: 170px 1fr; }
  #volBtn, #trophyBtn { display: none; }
}

.counter.is-live small::before { content: "● live · "; color: #0c6b2d; }
