:root {
  --bg: #f3c93a;
  --panel: #f4f4f4;
  --title: #0f0f0f;
  --line: #0f0f0f;
  --text: #0f0f0f;
  --muted: #444;
  --shadow: 8px 8px 0 #000;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Courier New", monospace;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

.desktop {
  position: relative;
  width: 100vw;
  height: calc(100vh - 56px);
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 1px, transparent 1px);
  background-size: 26px 26px;
  overflow: hidden;
}

.window {
  position: absolute;
  min-width: 280px;
  max-width: min(94vw, 650px);
  min-height: 160px;
  background: var(--panel);
  border: 3px solid var(--line);
  box-shadow: var(--shadow);
}

.window.hidden {
  display: none;
}

.window.minimized {
  min-height: 0;
}

.window.minimized .window-body {
  display: none;
}

.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.4rem 0.35rem 0.55rem;
  background: var(--title);
  color: #fff;
  border-bottom: 3px solid var(--line);
  cursor: move;
  user-select: none;
}

.titlebar p {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.window-actions {
  display: flex;
  gap: 0.25rem;
}

.action-btn {
  width: 26px;
  height: 24px;
  border: 2px solid #fff;
  background: #111;
  color: #fff;
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.action-btn:hover {
  background: #fff;
  color: #000;
}

.window-body {
  padding: 0.9rem;
  font-size: 1rem;
}

h1 {
  margin: 0 0 0.4rem;
  font-size: 2rem;
}

.claim {
  margin: 0 0 0.7rem;
  font-weight: 700;
}

.logo-image {
  display: block;
  width: 100%;
  height: auto;
}

.window[data-window="logo-jpg"] .window-body {
  padding: 0;
}

.app-grid {
  display: grid;
  gap: 0.6rem;
}

.app-card {
  border: 2px solid #000;
  background: #fff;
  padding: 0.55rem;
}

.app-name {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
}

.app-tagline {
  margin: 0 0 0.45rem;
  color: var(--muted);
}

.app-links {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.chip {
  font: inherit;
  display: inline-block;
  padding: 0.3rem 0.45rem;
  border: 2px solid #000;
  color: #fff;
  background: #111;
  text-decoration: none;
  font-size: 0.9rem;
  cursor: pointer;
}

.chip:hover {
  background: #fff;
  color: #000;
}

a {
  color: #111;
  font-weight: 700;
}

.privacy-controls {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}

.privacy-tab {
  border: 2px solid #000;
  background: #f4f4f4;
  color: #000;
  font: inherit;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
}

.privacy-tab.active {
  background: #000;
  color: #fff;
}

.privacy-placeholder {
  margin: 0;
  padding: 0.55rem;
  border: 2px solid #000;
  background: #fff;
}

.privacy-source {
  margin: 0.45rem 0 0;
}

.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 56px;
  border-top: 3px solid #000;
  background: #d7d7d7;
  display: flex;
  gap: 0.4rem;
  align-items: center;
  padding: 0.5rem;
  overflow-x: auto;
}

.task-btn {
  border: 2px solid #000;
  background: #f4f4f4;
  color: #000;
  font: inherit;
  height: 34px;
  min-width: 110px;
  padding: 0 0.55rem;
  cursor: pointer;
  white-space: nowrap;
}

.task-btn.active {
  background: #000;
  color: #fff;
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .desktop {
    height: auto;
    min-height: calc(100vh - 56px);
    padding-bottom: 5.4rem;
  }

  .window {
    position: relative;
    left: auto !important;
    top: auto !important;
    width: calc(100vw - 2rem) !important;
    max-width: none;
    margin: 0.8rem auto 0;
  }

  .titlebar {
    cursor: default;
  }

  .taskbar {
    gap: 0.35rem;
    padding:
      0.45rem
      calc(0.55rem + env(safe-area-inset-right))
      calc(0.45rem + env(safe-area-inset-bottom))
      calc(0.55rem + env(safe-area-inset-left));
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }

  .task-btn {
    height: 36px;
    min-width: 94px;
    max-width: 138px;
    padding: 0 0.45rem;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.86rem;
    scroll-snap-align: start;
  }
}
