/* Tomasovo — old-school desktop portfolio */

:root {
  --ui: Tahoma, "MS Sans Serif", Geneva, sans-serif;
  --mono: "Courier New", ui-monospace, monospace;
  --gray: #c0c0c0;
  --gray-dark: #808080;
  --gray-darker: #404040;
  --gray-light: #dfdfdf;
}

[data-wall="teal"] { --wall: #008080; }
[data-wall="charcoal"] { --wall: #1a1a1a; }
[data-wall="navy"] { --wall: #000060; }

[data-tb="red"] { --tb1: #7a0000; --tb2: #e20101; }
[data-tb="blue"] { --tb1: #000080; --tb2: #1084d0; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--ui);
  font-size: 12px;
  background: var(--wall, #008080);
  overflow: hidden;
}
#root { height: 100%; }

/* ============ bevels ============ */
.bevel-out {
  background: var(--gray);
  box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff,
              inset -2px -2px var(--gray-dark), inset 2px 2px var(--gray-light);
}
.bevel-in {
  background: #fff;
  box-shadow: inset -1px -1px #fff, inset 1px 1px #0a0a0a,
              inset -2px -2px var(--gray-light), inset 2px 2px var(--gray-dark);
}

/* ============ desktop ============ */
.desktop {
  position: fixed; inset: 0 0 40px 0;
  overflow: hidden;
}
.icon-grid {
  position: absolute; top: 14px; left: 10px;
  display: flex; flex-direction: column; flex-wrap: wrap; gap: 10px;
  max-height: calc(100% - 20px);
}
.dicon {
  width: 84px; padding: 6px 2px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: transparent; border: 1px dotted transparent;
  cursor: pointer; user-select: none;
}
.dicon:focus, .dicon.selected { border-color: rgba(255, 255, 255, 0.7); outline: none; }
.dicon .glyph { width: 34px; height: 34px; image-rendering: pixelated; }
.dicon .label {
  color: #fff; font-size: 11px; text-align: center; line-height: 1.25;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8);
}
.dicon.selected .label { background: var(--tb2); }

/* ============ window ============ */
.win {
  position: absolute;
  display: flex; flex-direction: column;
  min-width: 280px;
  padding: 3px;
}
.win-titlebar {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(90deg, var(--tb1), var(--tb2));
  color: #fff; font-weight: bold; font-size: 12px;
  padding: 3px 3px 3px 8px;
  cursor: default; user-select: none; touch-action: none;
}
.win.inactive .win-titlebar { background: linear-gradient(90deg, #6d6d6d, #a8a8a8); }
.win-titlebar .title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-ctrl {
  width: 18px; height: 16px;
  font-family: var(--ui); font-size: 10px; font-weight: bold; line-height: 1;
  color: #000; border: none; padding: 0; cursor: pointer;
}
.win-ctrl:active { box-shadow: inset 1px 1px #0a0a0a, inset -1px -1px #fff; }
.win-body {
  flex: 1; min-height: 0;
  margin: 2px;
  overflow-y: auto;
  padding: 12px 14px;
  font-size: 12px; line-height: 1.55;
  scrollbar-width: auto;
}
.win-body.notepad { font-family: var(--mono); font-size: 13px; white-space: pre-wrap; }
.win-statusbar {
  display: flex; gap: 3px; padding: 2px 1px 1px;
}
.win-statusbar .cell {
  flex: 1; padding: 2px 8px; font-size: 11px;
  box-shadow: inset 1px 1px var(--gray-dark), inset -1px -1px #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* content bits */
.h95 { font-size: 12px; font-weight: bold; margin: 14px 0 4px; }
.h95:first-child { margin-top: 0; }
.groupbox {
  border: 1px solid var(--gray-dark);
  box-shadow: 1px 1px 0 #fff inset, -1px -1px 0 #fff;
  outline: 1px solid #fff;
  outline-offset: -2px;
  border-radius: 0;
  margin: 10px 0 14px; padding: 10px 12px 10px;
  position: relative;
}
.groupbox > legend, .groupbox > .legend {
  position: absolute; top: -8px; left: 8px;
  background: var(--gray); padding: 0 5px; font-weight: bold;
}
.xp-dates { color: #555; }
ul.plain { margin: 4px 0 0; padding-left: 18px; }
ul.plain li { margin: 2px 0; }
.tag {
  display: inline-block;
  border: 1px solid var(--gray-dark);
  background: #fff;
  padding: 1px 7px; margin: 0;
  font-size: 11px;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 2px; }
a.link95 { color: #0000c8; }
a.link95:visited { color: #0000c8; }
.kv95 { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.kv95 .k { font-weight: bold; }

.btn95 {
  font-family: var(--ui); font-size: 12px;
  background: var(--gray); color: #000;
  border: none; padding: 6px 18px; min-height: 28px;
  box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff,
              inset -2px -2px var(--gray-dark), inset 2px 2px var(--gray-light);
  cursor: pointer;
}
.btn95:active {
  box-shadow: inset 1px 1px #0a0a0a, inset -1px -1px #fff,
              inset 2px 2px var(--gray-dark);
  padding: 7px 17px 5px 19px;
}

/* ============ taskbar ============ */
.taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: 40px;
  display: flex; align-items: center; gap: 6px;
  padding: 4px 6px;
  z-index: 1000;
}
.start-btn {
  display: flex; align-items: center; gap: 6px;
  font-weight: bold; font-size: 12px;
  padding: 4px 12px; min-height: 30px;
}
.start-btn .start-mark {
  width: 14px; height: 14px;
  background: conic-gradient(#e20101 0 25%, #77ff87 0 50%, #ffb52e 0 75%, #1084d0 0);
  border: 1px solid #000;
}
.start-btn.pressed {
  box-shadow: inset 1px 1px #0a0a0a, inset -1px -1px #fff, inset 2px 2px var(--gray-dark);
}
.task-row { flex: 1; display: flex; gap: 4px; min-width: 0; overflow: hidden; }
.task-btn {
  font-family: var(--ui); font-size: 11px;
  max-width: 170px; min-width: 60px; flex-shrink: 1;
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; min-height: 30px;
  background: var(--gray); border: none; cursor: pointer;
  box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff,
              inset -2px -2px var(--gray-dark), inset 2px 2px var(--gray-light);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task-btn.active {
  font-weight: bold;
  background: repeating-conic-gradient(#fff 0 25%, var(--gray-light) 0 50%) 0 0 / 4px 4px;
  box-shadow: inset 1px 1px #0a0a0a, inset -1px -1px #fff, inset 2px 2px var(--gray-dark);
}
.task-btn img, .task-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.tray {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; min-height: 30px; font-size: 11px;
  box-shadow: inset 1px 1px var(--gray-dark), inset -1px -1px #fff;
}

/* start menu */
.start-menu {
  position: fixed; left: 4px; bottom: 44px; z-index: 1001;
  width: 230px; padding: 3px;
  display: flex;
}
.start-menu .side {
  width: 26px;
  background: linear-gradient(180deg, var(--tb2), var(--tb1));
  color: #fff; font-weight: bold; font-size: 14px; letter-spacing: 0.06em;
  writing-mode: vertical-rl; transform: rotate(180deg);
  display: flex; align-items: center; justify-content: flex-start;
  padding: 8px 0;
}
.start-menu .items { flex: 1; display: flex; flex-direction: column; padding: 2px; }
.sm-item {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--ui); font-size: 12px; text-align: left;
  background: transparent; border: none; cursor: pointer;
  padding: 7px 10px; min-height: 34px; width: 100%;
}
.sm-item:hover { background: var(--tb2); color: #fff; }
.sm-item .glyph { width: 22px; height: 22px; }
.sm-sep { height: 1px; margin: 3px 2px; background: var(--gray-dark); box-shadow: 0 1px 0 #fff; }

/* ============ games ============ */
.ms-frame { display: inline-block; }
.ms-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 8px; margin-bottom: 8px;
}
.led {
  font-family: var(--mono); font-weight: bold; font-size: 18px; line-height: 1;
  color: #f00; background: #000;
  padding: 3px 5px; letter-spacing: 2px;
}
.ms-face { padding: 2px 4px; min-height: 28px; display: flex; align-items: center; }
.ms-grid {
  display: grid; gap: 0; padding: 4px; background: var(--gray);
}
.ms-cell {
  width: 24px; height: 24px; padding: 0;
  font-family: var(--ui); font-size: 13px; font-weight: bold; line-height: 1;
  background: var(--gray); border: none; cursor: pointer;
  box-shadow: inset -2px -2px var(--gray-dark), inset 2px 2px #fff;
}
.ms-cell.open {
  box-shadow: inset 1px 1px var(--gray-dark);
  background: var(--gray);
  cursor: default;
}
.ms-cell.boom { background: #f00; }

.sol-felt { background: #057f30; }
.sol-row { display: flex; gap: 8px; margin-bottom: 14px; }
.sol-gap { flex: 1; }
.sol-slot {
  width: 46px; height: 64px; flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.45); border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative;
}
.sol-slot .recycle { color: rgba(255, 255, 255, 0.7); font-size: 22px; }
.sol-slot .ace-hint { color: rgba(255, 255, 255, 0.45); font-size: 18px; font-weight: bold; }
.sol-tabs { display: flex; gap: 8px; align-items: flex-start; }
.sol-pile { position: relative; width: 46px; flex-shrink: 0; }
.sol-pile.empty {
  height: 64px;
  border: 1px dashed rgba(255, 255, 255, 0.5); border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.sol-pile .king-hint { color: rgba(255, 255, 255, 0.45); font-size: 18px; font-weight: bold; }
.scard {
  width: 46px; height: 64px;
  background: #fff; border: 1px solid #333; border-radius: 3px;
  position: relative; cursor: pointer; user-select: none;
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.35);
}
.sol-pile .scard { position: absolute; left: 0; }
.sol-slot .scard { position: absolute; left: -1px; top: -1px; }
.scard.back {
  background: repeating-linear-gradient(45deg, #1048a0 0 4px, #0c3878 4px 8px);
}
.scard.sel { outline: 2px solid #ffd800; outline-offset: 1px; }
.scard .corner {
  position: absolute; top: 2px; left: 3px;
  font-size: 11px; font-weight: bold; color: #000; line-height: 1.1;
}
.scard .pip {
  position: absolute; bottom: 2px; right: 4px;
  font-size: 18px; color: #000;
}
.scard .red { color: #d00; }

/* ============ shutdown ============ */
.shutdown {
  /* one above .twk-panel's 2147483646 — nothing floats over a powered-off CRT */
  position: fixed; inset: 0; z-index: 2147483647;
  background: #000; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 0 16px; text-align: center;
}
.shutdown div {
  color: #ffa500; font-family: var(--mono);
  font-size: 24px; font-weight: bold;
}
.shutdown .sub { color: #707070; font-size: 12px; font-weight: normal; }

/* ============ CRT overlay ============ */
[data-crt="on"] body::after {
  content: ""; position: fixed; inset: 0; z-index: 9000; pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.25)),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 3px);
}

/* ============ responsive ============ */
@media (max-width: 640px) {
  .win {
    left: 4px !important; top: 4px !important;
    right: 4px; bottom: 44px;
    width: auto !important; height: auto !important;
  }
  .icon-grid { flex-direction: row; max-height: none; right: 10px; flex-wrap: wrap; }
  .task-btn { min-width: 40px; }
}
