/* HyperOS: a beige computer at night (the room), and the operating system inside it (cream windows, teal desktop). */
:root {
  --ink: #0b1426; --ink2: #1f3550; --cream: #ede6d3; --cream2: #e2d9c1; --cream3: #cfc4a8; --shadow: #9a8f74;
  --teal: #50d2c1; --teal-d: #0f4a42; --teal-dd: #0a332d; --hi: #97fce4; --amber: #ffb547; --red: #e5484d; --green: #2f9e6a; --gold: #f6c945;
  --desk: #06302b; --mono: "IBM Plex Mono", ui-monospace, monospace; --pix: "Silkscreen", monospace; --vt: "VT323", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #05080f; color: var(--ink); font: 14px/1.5 var(--mono); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.px { display: block; image-rendering: pixelated; }
[hidden] { display: none !important; }

/* ---------- the room ---------- */
#room { position: fixed; inset: 0; z-index: 5; background: #05080f; }
#room canvas { width: 100%; height: 100%; display: block; }
.room-ui { position: absolute; inset: 0; pointer-events: none; color: #e9e0c9; }
.room-top { position: absolute; top: 22px; left: 26px; display: flex; align-items: center; gap: 14px; }
.room-top .wordmark { font-size: 18px; }
.room-tag { font: 400 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: rgba(233,224,201,.55); }
.room-hint { position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 12px 20px;
  font: 400 15px var(--pix); letter-spacing: .04em; color: #e9e0c9; background: rgba(5,8,15,.55); border: 1px solid rgba(151,252,228,.25); backdrop-filter: blur(6px); white-space: nowrap; }
.pulse { width: 10px; height: 10px; background: var(--hi); box-shadow: 0 0 12px var(--hi); animation: pulse 1.2s steps(2) infinite; }
@keyframes pulse { 50% { opacity: .2; } }
.room-skip { pointer-events: auto; position: absolute; right: 24px; bottom: 24px; background: none; border: 0; color: rgba(233,224,201,.5); font: 400 12px var(--mono); letter-spacing: .06em; padding: 8px; }
.room-skip:hover { color: #e9e0c9; }
.room-fade { position: absolute; inset: 0; background: #06101a; opacity: 0; pointer-events: none; transition: opacity .35s; }
#room.leaving .room-fade { opacity: 1; }
#room.leaving .room-ui { opacity: 0; transition: opacity .3s; }
.wordmark { display: inline-flex; align-items: center; gap: .45em; font-family: var(--pix); line-height: 1; white-space: nowrap; }
.wordmark .wm-px { width: 1.6em; height: 1.6em; }
.wordmark b { font-weight: 700; letter-spacing: .02em; }
.wordmark i { font-style: normal; font-weight: 400; color: var(--teal); }

/* ---------- the OS ---------- */
#os { position: fixed; inset: 0; z-index: 4; display: flex; flex-direction: column; background: var(--desk); animation: power-on .5s ease-out; }
@keyframes power-on { 0% { filter: brightness(3) saturate(0); transform: scaleY(.01); } 40% { transform: scaleY(1); filter: brightness(2) saturate(.4); } 100% { filter: none; } }
#desktop { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.wallpaper { position: absolute; inset: 0; background:
  radial-gradient(120% 90% at 50% 40%, #0b4a42 0%, #06302b 45%, #04211d 100%); }
.wallpaper::before { content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(rgba(151,252,228,.10) 1px, transparent 1.2px); background-size: 6px 6px; }
.wp-mark { position: absolute; right: 6%; bottom: 10%; opacity: .16; color: var(--cream); font-size: clamp(28px, 5vw, 64px); }
.wp-mark .wordmark i { color: var(--cream); }

.icons { position: absolute; top: 18px; left: 14px; display: grid; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 92px); gap: 6px 8px; height: calc(100% - 36px); }
.icon { width: 86px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; background: none; border: 1px dotted transparent; color: var(--cream); text-align: center; }
.icon .px { width: 40px; height: 40px; filter: drop-shadow(2px 2px 0 rgba(0,0,0,.35)); }
.icon span { font: 400 12px/1.25 var(--mono); text-shadow: 1px 1px 0 rgba(0,0,0,.6); padding: 1px 4px; }
.icon:hover span, .icon:focus-visible span { background: var(--ink); }
.icon:focus-visible { outline: none; border-color: var(--cream); }

/* windows */
#wins { position: absolute; inset: 0; pointer-events: none; }
.win { position: absolute; pointer-events: auto; display: flex; flex-direction: column; min-width: 320px; min-height: 200px; max-width: 100%; max-height: 100%;
  background: var(--cream); border: 2px solid var(--ink); box-shadow: 6px 6px 0 rgba(0,0,0,.35), inset -2px -2px 0 var(--cream3), inset 2px 2px 0 #fff; animation: win-in .16s ease-out; }
@keyframes win-in { from { transform: scale(.96); opacity: 0; } }
.win.max { inset: 0 !important; width: auto !important; height: auto !important; box-shadow: none; }
.win.min { display: none; }
.titlebar { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 4px 0 8px; background: var(--ink2); color: var(--cream); user-select: none; cursor: grab; flex: none; }
.win.active .titlebar { background: linear-gradient(90deg, var(--teal-d), #1b8a7a); }
.titlebar .px { width: 18px; height: 18px; }
.titlebar .t { flex: 1; min-width: 0; font: 700 12px var(--pix); letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-btn { width: 22px; height: 20px; display: grid; place-items: center; background: var(--cream); color: var(--ink); border: 0; padding: 0;
  box-shadow: inset -2px -2px 0 var(--shadow), inset 2px 2px 0 #fff; font: 700 11px var(--mono); }
.tb-btn:active { box-shadow: inset 2px 2px 0 var(--shadow), inset -2px -2px 0 #fff; }
.tb-btn svg { width: 10px; height: 10px; }
.menubar { display: flex; gap: 2px; padding: 3px 6px; border-bottom: 1px solid var(--cream3); flex: none; font-size: 12.5px; overflow-x: auto; scrollbar-width: none; }
.menubar button { background: none; border: 0; padding: 3px 9px; white-space: nowrap; }
.menubar button.on { background: var(--ink); color: var(--cream); }
.menubar button:hover:not(.on) { background: var(--cream2); }
.wbody { flex: 1; min-height: 0; overflow: auto; padding: 16px; }
.wbody.flush { padding: 0; }
.status { flex: none; display: flex; gap: 12px; padding: 3px 10px; border-top: 1px solid var(--cream3); font-size: 11.5px; color: #5d5a4e; white-space: nowrap; overflow: hidden; }
.status span + span { border-left: 1px solid var(--cream3); padding-left: 12px; }
.grip { position: absolute; right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, var(--shadow) 50% 60%, transparent 60% 70%, var(--shadow) 70% 80%, transparent 80%); }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 16px; background: var(--cream); border: 2px solid var(--ink); color: var(--ink);
  box-shadow: inset -2px -2px 0 var(--cream3), inset 2px 2px 0 #fff, 2px 2px 0 var(--ink); font: 600 13px var(--mono); text-decoration: none; white-space: nowrap; }
.btn:active { transform: translate(1px, 1px); box-shadow: inset 2px 2px 0 var(--cream3), 1px 1px 0 var(--ink); }
.btn.go { background: var(--teal); color: var(--ink); box-shadow: inset -2px -2px 0 #2fa594, inset 2px 2px 0 #a8f5e6, 2px 2px 0 var(--ink); }
.btn.dark { background: var(--ink); color: var(--cream); box-shadow: inset -2px -2px 0 #000, inset 2px 2px 0 #2a3a58, 2px 2px 0 #000; }
.btn.big { padding: 11px 22px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.field label i { font-style: normal; font-weight: 400; color: #77725f; }
.in { width: 100%; padding: 8px 10px; background: #fffdf6; border: 2px solid var(--ink); box-shadow: inset 2px 2px 0 var(--cream3); outline: none; }
.in:focus { border-color: var(--teal-d); box-shadow: inset 2px 2px 0 var(--cream3), 0 0 0 2px var(--teal); }
textarea.in { resize: vertical; min-height: 70px; }
.hint { font-size: 12px; color: #6d685a; margin: 0; }
.err { color: #b3261e; font-size: 13px; }
.panel { background: #fffdf6; border: 2px solid var(--ink); box-shadow: inset -2px -2px 0 var(--cream2); padding: 14px; }
.inset { background: var(--cream2); border: 2px solid; border-color: var(--shadow) #fff #fff var(--shadow); padding: 12px; }
.sunk { background: #06101a; color: #c9d6e0; border: 2px solid; border-color: var(--shadow) #fff #fff var(--shadow); }
.label { font: 700 11px var(--pix); letter-spacing: .06em; color: var(--teal-d); text-transform: uppercase; }
.h1 { font: 700 26px/1.15 var(--pix); margin: 0; letter-spacing: -.01em; }
.h2 { font: 700 18px/1.2 var(--pix); margin: 0; }
.muted { color: #6d685a; }
.mono { font-family: var(--mono); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid2 > *, .grid3 > * { min-width: 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { padding: 5px 10px; background: var(--cream); border: 2px solid var(--ink); font-size: 12.5px; }
.chips button.on { background: var(--ink); color: var(--cream); }
.pic { width: 40px; height: 40px; flex: none; background: var(--ink2); border: 2px solid var(--ink); display: grid; place-items: center; overflow: hidden; image-rendering: auto; }
.pic img { width: 100%; height: 100%; object-fit: cover; }
.pic.lg { width: 72px; height: 72px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px; font: 600 11px var(--mono); background: var(--ink); color: var(--cream); white-space: nowrap; }
.tag.teal { background: var(--teal-d); }
.tag.amber { background: var(--amber); color: var(--ink); }
.tag.dot::before { content: ""; width: 7px; height: 7px; background: var(--hi); box-shadow: 0 0 6px var(--hi); }
.tag.sleep::before { background: #6d685a; box-shadow: none; }
.bar { height: 12px; background: var(--cream2); border: 2px solid var(--ink); position: relative; }
.bar i { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(90deg, var(--teal) 0 8px, var(--teal-d) 8px 10px); }
.empty { padding: 34px 16px; text-align: center; color: #6d685a; }
.empty b { display: block; font: 700 14px var(--pix); color: var(--ink); margin-bottom: 6px; }
.tx { color: var(--teal-d); text-decoration: underline; text-underline-offset: 2px; }

/* lists */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--cream3); background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; width: 100%; }
.item:hover { background: var(--cream2); }
.item .grow { flex: 1; min-width: 0; }
.item .t1 { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .t2 { font-size: 12px; color: #6d685a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .num { text-align: right; font-size: 12.5px; white-space: nowrap; }
.toolbar { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--cream3); flex-wrap: wrap; }
.toolbar .in { width: auto; flex: 1; min-width: 140px; padding: 5px 8px; }

/* terminal-ish surfaces */
.term { font: 400 19px/1.25 var(--vt); padding: 14px 16px; }
.term .p { color: var(--hi); }
.term .a { color: var(--amber); }
.term .m { color: #7d93a6; }
.term .e { color: #ff8a8a; }
.screen { position: relative; overflow: hidden; }
.screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px); }

/* chat + square */
.chat { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 88%; padding: 7px 10px; background: #fffdf6; border: 2px solid var(--ink); align-self: flex-start; }
.msg .who { font-size: 11px; color: #77725f; display: flex; gap: 6px; align-items: center; }
.msg.mind { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.msg.mind .who { color: var(--hi); }
.msg .who .px, .item > .px { width: 16px; height: 16px; flex: none; }
.item > .px { width: 28px; height: 28px; }
.msg.me { align-self: flex-end; background: #d6f5ee; }
.compose { flex: none; display: flex; gap: 8px; padding: 10px; border-top: 2px solid var(--ink); background: var(--cream2); }
.post { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #1c2c45; }
.post .pic { width: 34px; height: 34px; }
.post .meta { font-size: 12px; color: #7d93a6; display: flex; gap: 8px; align-items: center; }
.post .meta b { color: var(--hi); font-family: var(--pix); font-weight: 700; }
.post .body { color: #dbe6ee; font-size: 13.5px; margin-top: 2px; }
.post .re { font-size: 11.5px; color: var(--amber); }

/* votes */
.vote { border: 2px solid var(--ink); background: #fffdf6; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.opt { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 8px 10px; border: 2px solid var(--ink); background: var(--cream); text-align: left; position: relative; overflow: hidden; }
.opt .fill { position: absolute; inset: 0 auto 0 0; background: rgba(80,210,193,.28); z-index: 0; }
.opt > * { position: relative; z-index: 1; }
.opt .by { font-size: 11px; color: #77725f; grid-column: 1; }
.opt.win { border-color: var(--teal-d); background: #dcf7f1; }
.opt.mine { box-shadow: inset 4px 0 0 var(--teal-d); }
button.opt:hover { background: var(--cream2); }

/* build window */
.build-frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }

/* taskbar */
#taskbar { flex: none; height: 40px; display: flex; align-items: center; gap: 6px; padding: 4px; background: var(--cream); border-top: 2px solid #fff; box-shadow: 0 -2px 0 var(--ink); z-index: 30; }
.start { height: 30px; display: flex; align-items: center; gap: 7px; padding: 0 10px 0 6px; background: var(--cream); border: 0; box-shadow: inset -2px -2px 0 var(--shadow), inset 2px 2px 0 #fff, inset -3px -3px 0 var(--ink); font: 700 13px var(--pix); }
.start .px { width: 22px; height: 22px; }
.start.on, .start:active { box-shadow: inset 2px 2px 0 var(--shadow), inset -2px -2px 0 #fff; background: var(--cream2); }
.tasks { flex: 1; min-width: 0; display: flex; gap: 4px; overflow: hidden; }
.task { max-width: 190px; min-width: 0; flex: 0 1 190px; height: 30px; display: flex; align-items: center; gap: 6px; padding: 0 8px; background: var(--cream); border: 0;
  box-shadow: inset -2px -2px 0 var(--shadow), inset 2px 2px 0 #fff; font-size: 12px; text-align: left; }
.task .px { width: 16px; height: 16px; flex: none; }
.task span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task.on { box-shadow: inset 2px 2px 0 var(--shadow), inset -2px -2px 0 #fff; background: repeating-conic-gradient(var(--cream) 0 25%, var(--cream2) 0 50%) 0 0 / 4px 4px; font-weight: 600; }
.tray { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px; box-shadow: inset 2px 2px 0 var(--shadow), inset -2px -2px 0 #fff; }
.tray-btn { width: 24px; height: 24px; display: grid; place-items: center; background: none; border: 0; color: var(--ink); padding: 0; }
.tray-btn svg { width: 15px; height: 15px; }
.wallet { height: 24px; display: flex; align-items: center; gap: 6px; padding: 0 9px; background: var(--ink); color: var(--cream); border: 0; font: 600 11.5px var(--mono); white-space: nowrap; }
.wallet .dot { width: 7px; height: 7px; background: var(--hi); box-shadow: 0 0 6px var(--hi); }
.clock { font-size: 12px; min-width: 44px; text-align: right; }
.startmenu { position: fixed; left: 4px; bottom: 44px; z-index: 40; width: 270px; display: flex; background: var(--cream); border: 2px solid var(--ink); box-shadow: 6px 6px 0 rgba(0,0,0,.35); }
.sm-side { width: 30px; background: linear-gradient(0deg, var(--teal-d), var(--ink)); color: var(--cream); writing-mode: vertical-rl; transform: rotate(180deg); font: 700 15px var(--pix); padding: 10px 0; letter-spacing: .08em; }
.sm-side i { font-style: normal; color: var(--teal); }
.sm-list { flex: 1; padding: 4px 0; }
.sm-list button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 12px; background: none; border: 0; text-align: left; font-size: 13px; }
.sm-list button:hover { background: var(--ink); color: var(--cream); }
.sm-list .px { width: 24px; height: 24px; }
.sm-list hr { border: 0; border-top: 1px solid var(--shadow); border-bottom: 1px solid #fff; margin: 4px 6px; }

/* CRT overlay on the whole OS */
.crt { position: fixed; inset: 0; pointer-events: none; z-index: 60;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.07) 0 1px, transparent 1px 3px), radial-gradient(130% 100% at 50% 50%, transparent 60%, rgba(0,0,0,.38) 100%); mix-blend-mode: multiply; }
body.no-crt .crt { display: none; }

.toast { position: fixed; left: 50%; bottom: 58px; transform: translateX(-50%); z-index: 90; background: var(--ink); color: var(--cream); padding: 9px 16px; border: 2px solid var(--cream); font-size: 13px; box-shadow: 4px 4px 0 rgba(0,0,0,.4); }
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(5,8,15,.55); padding: 16px; }
.modal .win { position: relative; width: min(460px, 100%); animation: win-in .16s ease-out; }
.steps { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 14px; }
.steps div { display: flex; gap: 10px; align-items: center; color: #8d8775; }
.steps i { width: 16px; height: 16px; border: 2px solid currentColor; display: grid; place-items: center; font-style: normal; font-size: 10px; flex: none; }
.steps .done { color: var(--ink); } .steps .done i { background: var(--ink); color: var(--cream); }
.steps .on { color: var(--teal-d); font-weight: 600; } .steps .on i { animation: pulse 1s steps(2) infinite; background: var(--teal); }
.ca { display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: var(--ink); color: var(--cream); font-size: 12px; word-break: break-all; }

/* welcome window */
.hero-pix { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.hero-pix .px { width: 96px; height: 96px; }
.feat { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.feat > div { border: 2px solid var(--ink); background: #fffdf6; padding: 10px 12px; }
.feat b { font: 700 12px var(--pix); display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.feat b .px { width: 20px; height: 20px; }
.feat p { margin: 0; font-size: 12.5px; color: #4d493e; }
.cmp { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cmp th, .cmp td { border: 1px solid var(--cream3); padding: 6px 8px; text-align: left; vertical-align: top; }
.cmp th { background: var(--ink); color: var(--cream); font-weight: 600; }
.cmp td.y { color: var(--green); font-weight: 600; }
.cmp td.n { color: #b3261e; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; height: 100%; min-height: 0; }
.split > * { min-width: 0; min-height: 0; }

@media (max-width: 760px) {
  html, body { font-size: 13px; }
  .room-top { top: 16px; left: 16px; }
  .room-tag { display: none; }
  .room-hint { bottom: 70px; font-size: 13px; }
  .win { inset: 0 !important; width: auto !important; height: auto !important; min-width: 0; box-shadow: none; border-width: 0; }
  .grip, .tb-btn.mx { display: none; }
  .icons { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); grid-template-rows: none; height: auto; right: 14px; }
  .icon { width: auto; }
  .task { flex-basis: 40px; max-width: 120px; }
  .grid2, .grid3, .split, .feat { grid-template-columns: 1fr; }
  .split { height: auto; }
  .wp-mark { display: none; }
  .clock { display: none; }
  .crt { background: repeating-linear-gradient(0deg, rgba(0,0,0,.06) 0 1px, transparent 1px 3px); }
}
