* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  font-family: Tahoma, "MS Sans Serif", Arial, sans-serif;
  font-size: 13px;
  color: #222;
}
button,
a {
  font: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
a:focus-visible {
  outline: 2px dotted #111;
  outline-offset: 2px;
}
.desktop {
  min-height: 100dvh;
  background: #087f80;
  position: relative;
  overflow: hidden;
  padding-bottom: 44px;
  background-image: radial-gradient(
    circle at 80% 25%,
    #15999a66,
    transparent 35%
  );
}
.desktop:after {
  content: "ONE KIDNEYY®";
  position: fixed;
  right: 28px;
  bottom: 70px;
  color: #ffffff18;
  font-size: clamp(44px, 8vw, 140px);
  font-weight: 900;
  letter-spacing: -0.07em;
  pointer-events: none;
}
.desktop-icons {
  position: absolute;
  top: 25px;
  left: 18px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 1;
}
.desktop-icons button {
  border: 1px solid transparent;
  color: white;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 94px;
  text-shadow: 1px 1px #004f50;
  padding: 7px 0;
  line-height: 1.4;
}
.desktop-icons button span {
  font-size: 35px;
  text-shadow: none;
  filter: drop-shadow(2px 2px #004c4c);
}
.desktop-icons button:hover,
.desktop-icons button:focus {
  background: #ffffff1e;
  border: 1px dotted white;
}
.window {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #404040 #404040 #fff;
  box-shadow: 2px 2px #1118;
  position: absolute;
  z-index: 5;
  min-width: 260px;
  display: flex;
  flex-direction: column;
}
.window.active {
  z-index: 20;
}
.welcome {
  top: clamp(30px, 8vh, 100px);
  left: clamp(125px, 18vw, 260px);
  width: min(860px, calc(100vw - 160px));
}
.titlebar {
  height: 30px;
  padding: 4px 5px 4px 8px;
  background: #000080;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  font-size: 13px;
  cursor: grab;
  user-select: none;
  gap: 10px;
}
.window.inactive .titlebar {
  background: #777;
}
.titlebar > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.titlebar div {
  display: flex;
  gap: 2px;
}
.titlebar button {
  width: 21px;
  height: 20px;
  border: 2px solid;
  border-color: #fff #555 #555 #fff;
  background: #c0c0c0;
  color: #111;
  font-weight: bold;
  line-height: 12px;
  padding: 0;
}
.menubar {
  display: flex;
  gap: 2px;
  padding: 5px 7px;
  border-bottom: 1px solid #888;
}
.menubar button {
  border: 0;
  background: transparent;
  padding: 3px 8px;
}
.menubar button:hover {
  background: #000080;
  color: white;
}
.menubar span {
  margin-left: auto;
  color: #666;
  font-size: 11px;
  padding: 4px;
}
.welcome-body {
  background: #f7f7f2;
  margin: 6px;
  padding: clamp(24px, 5vw, 58px) clamp(25px, 6vw, 65px) 20px;
  min-height: 410px;
  border: 2px inset #bbb;
}
.eyebrow {
  font:
    700 11px "Courier New",
    monospace;
  letter-spacing: 0.17em;
  color: #666;
}
.welcome h1 {
  font-size: clamp(35px, 5.4vw, 69px);
  letter-spacing: -0.065em;
  line-height: 1.08;
  margin: 23px 0;
  font-weight: 800;
}
.welcome h1 em {
  font-style: normal;
  color: #008080;
}
.cursor {
  font-family: monospace;
  animation: blink 1s steps(2) infinite;
  color: #008080;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
.welcome p {
  max-width: 590px;
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.75;
  color: #454545;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 32px 0 45px;
}
.button {
  background: #c0c0c0;
  border: 2px solid;
  border-color: white #666 #666 white;
  padding: 11px 17px;
  font-weight: bold;
  box-shadow: 1px 1px #222;
}
.button:active,
.start:active {
  border-color: #666 #fff #fff #666;
  transform: translate(1px, 1px);
}
.button.primary {
  background: #000080;
  color: white;
}
.welcome-bottom {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #666;
  border-top: 1px solid #ddd;
  padding-top: 17px;
  font:
    11px "Courier New",
    monospace;
}
.statusbar {
  display: flex;
  gap: 5px;
  padding: 3px 5px;
  color: #555;
}
.statusbar span {
  flex: 1;
  border: 1px inset white;
  padding: 3px 6px;
}
.statusbar span:last-child {
  flex: 0 0 110px;
}
.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 42px;
  background: #c0c0c0;
  border-top: 2px solid white;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
}
.start {
  font-weight: bold;
  font-size: 16px;
  background: #c0c0c0;
  border: 2px solid;
  border-color: white #555 #555 white;
  padding: 4px 10px;
  box-shadow: 1px 1px #555;
}
.start span {
  font-size: 20px;
  color: #007f80;
}
.tasks {
  display: flex;
  gap: 4px;
  overflow: auto;
  flex: 1;
  scrollbar-width: none;
}
.task {
  min-width: 105px;
  max-width: 175px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  padding: 7px 11px;
  background: #c0c0c0;
  border: 2px solid;
  border-color: white #555 #555 white;
}
.task.selected {
  border-color: #555 white white #555;
  background: #b4b4b4;
}
.taskbar time {
  padding: 7px 12px;
  border: 1px inset white;
  white-space: nowrap;
}
.startmenu {
  position: fixed;
  bottom: 42px;
  left: 4px;
  z-index: 120;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #444 #444 #fff;
  display: flex;
  min-width: 260px;
  box-shadow: 3px 3px #0006;
}
.startmenu[hidden] {
  display: none;
}
.start-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  background: #777;
  color: white;
  padding: 10px;
  font-size: 19px;
  font-weight: bold;
}
.start-label strong {
  color: #ddd;
}
.start-options {
  display: flex;
  flex-direction: column;
  padding: 7px;
  flex: 1;
}
.start-options button,
.start-options a {
  border: 0;
  text-decoration: none;
  text-align: left;
  background: transparent;
  color: #111;
  padding: 12px;
  font-size: 14px;
}
.start-options button:hover,
.start-options a:hover {
  background: #000080;
  color: white;
}
.start-options hr {
  width: 100%;
  border: 0;
  border-top: 1px solid #888;
}
.appwindow {
  top: 12vh;
  left: 24vw;
  width: min(760px, calc(100vw - 140px));
  max-height: calc(100dvh - 95px);
}
.appwindow .content {
  overflow: auto;
  background: #f5f5f1;
  margin: 5px;
  border: 2px inset #999;
  padding: 24px;
  line-height: 1.65;
}
.appwindow h2 {
  font-size: 28px;
  letter-spacing: -0.04em;
  margin: 0 0 10px;
}
.appwindow h3 {
  font-size: 16px;
  margin: 23px 0 6px;
}
.appwindow p {
  font-size: 14px;
  margin: 8px 0 14px;
  color: #444;
}
.appwindow .lead {
  font-size: 16px;
  color: #333;
}
.profile {
  display: flex;
  gap: 24px;
  align-items: center;
}
.profile img {
  width: 130px;
  height: 130px;
  object-fit: cover;
  border: 3px ridge #ccc;
}
.skill-list {
  display: grid;
  gap: 12px;
}
.skill {
  background: white;
  border: 1px solid #c8c8c8;
  padding: 15px;
}
.skill h3 {
  margin: 0;
}
.skill p {
  margin: 5px 0 0;
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 19px;
}
.project-card {
  background: white;
  border: 1px solid #aaa;
  text-align: left;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.project-card:hover {
  background: #e6f1f1;
  outline: 1px solid #008080;
}
.project-card img {
  width: 100%;
  aspect-ratio: 1.5;
  object-fit: cover;
  background: #ddd;
}
.project-card strong {
  font-size: 13px;
}
.project-card small {
  color: #666;
}
.project-hero {
  width: 100%;
  max-height: 265px;
  object-fit: cover;
  border: 2px inset #aaa;
  background: #ddd;
  margin-bottom: 14px;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.gallery figure {
  margin: 0;
}
.gallery img {
  width: 100%;
  border: 2px inset #bbb;
}
.gallery figcaption {
  font-size: 12px;
  color: #555;
}
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 16px 0;
}
.links a {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #555 #555 #fff;
  color: #111;
  text-decoration: none;
  padding: 7px 11px;
}
.links a:hover {
  background: #000080;
  color: white;
}
.feature-list {
  padding-left: 20px;
}
.feature-list li {
  margin: 8px 0;
}
.contact-box {
  background: white;
  border: 1px inset #777;
  padding: 17px;
  margin: 20px 0;
}
.contact-box a {
  color: #000080;
  font-size: 17px;
  overflow-wrap: anywhere;
}
.contact-note {
  color: #666 !important;
  font-size: 12px !important;
}
.label {
  font-size: 11px;
  color: #777;
  font-family: monospace;
  letter-spacing: 0.08em;
}
.empty-note {
  color: #777;
  font-style: italic;
}
.content a {
  overflow-wrap: anywhere;
}
@media (max-width: 780px) {
  .desktop {
    overflow: auto;
    min-height: 100dvh;
  }
  .desktop-icons {
    position: relative;
    top: auto;
    left: auto;
    flex-direction: row;
    justify-content: center;
    gap: 3px;
    padding: 15px 8px;
  }
  .desktop-icons button {
    width: 76px;
    font-size: 11px;
  }
  .desktop-icons button span {
    font-size: 26px;
  }
  .welcome,
  .appwindow {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: calc(100% - 24px) !important;
    max-height: none !important;
    margin: 6px 12px 18px;
  }
  .welcome-body {
    min-height: auto;
    padding: 28px 20px 14px;
  }
  .welcome h1 {
    margin: 20px 0;
  }
  .welcome-bottom {
    flex-direction: column;
  }
  .appwindow .content {
    max-height: 65vh;
  }
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .profile {
    align-items: flex-start;
  }
  .profile img {
    width: 85px;
    height: 85px;
  }
  .taskbar {
    gap: 4px;
  }
  .task {
    min-width: 65px;
    max-width: 115px;
    padding: 6px;
    font-size: 11px;
  }
  .taskbar time {
    font-size: 11px;
    padding: 6px;
  }
  .start {
    padding: 4px 7px;
  }
}
@media (max-width: 430px) {
  .project-grid,
  .gallery {
    grid-template-columns: 1fr;
  }
  .welcome h1 {
    font-size: 37px;
  }
  .appwindow .content {
    padding: 16px;
  }
  .menubar span {
    display: none;
  }
}

/* =============================================================
   MINI GAMES — Game Library, Tic-Tac-Toe, Reaction Test
   Keep the game logic in games.js. Adjust game styling here.
   ============================================================= */

.game-library {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.game-entry {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 180px;
  padding: 18px;
  background: #fff;
  border: 2px solid;
  border-color: #fff #777 #777 #fff;
  text-align: left;
}

.game-entry:hover,
.game-entry:focus-visible {
  background: #e5f4f3;
}

.game-entry-icon { font-size: 36px; }
.game-entry strong { font-size: 17px; }
.game-entry small { color: #666; }
.game-play-label { margin-top: auto; color: #000080; font-weight: bold; }
.game-footnote { color: #666; font-size: 12px !important; }

/* Tic-Tac-Toe */
.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: min(100%, 320px);
  margin: 15px auto 18px;
}

.ttt-cell {
  aspect-ratio: 1;
  border: 3px solid;
  border-color: #777 #fff #fff #777;
  background: #fff;
  color: #000080;
  font-size: clamp(32px, 7vw, 54px);
  font-weight: bold;
  cursor: pointer;
}

.ttt-cell:disabled { cursor: default; opacity: 1; }
.ttt-cell.winner { background: #b8f0c4; color: #075c24; }

/* Reaction Test */
.reaction-target {
  width: 100%;
  min-height: 195px;
  margin: 14px 0;
  padding: 20px;
  border: 3px inset #bbb;
  background: #e7e7e7;
  color: #222;
  font-size: 23px;
  font-weight: bold;
  cursor: pointer;
}

.reaction-target.waiting { background: #af3131; color: white; }
.reaction-target.go { background: #2d9e54; color: white; }
.reaction-target.too-soon { background: #ffd2aa; }
.reaction-target.finished { background: #d9ecff; color: #000080; }

.game-status {
  padding: 8px 12px;
  background: #fff;
  border: 2px inset #aaa;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
}

.game-reset { display: block; margin: 15px auto 0; }

@media (max-width: 440px) {
  .game-library { grid-template-columns: 1fr; }
  .reaction-target { min-height: 150px; }
}
