#taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--taskbar-height);
  height: calc(var(--taskbar-height) + env(safe-area-inset-bottom, 0px));   /* the page reaches the screen's edges; the bar keeps clear of a phone's home indicator */
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--taskbar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(100,100,255,0.2);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  z-index: 10000;
}

/* Top taskbar: setTheme puts it there for the Apple themes, and the theme builder for any theme */
.taskbar-top #taskbar {
  top: 0;
  bottom: auto;
  border-top: none;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  height: calc(var(--taskbar-height) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: 0;
}

.taskbar-top #desktop {
  top: var(--taskbar-height);
  top: calc(var(--taskbar-height) + env(safe-area-inset-top, 0px));
  height: calc(100vh - var(--taskbar-height));
  height: calc(100dvh - var(--taskbar-height) - env(safe-area-inset-top, 0px));
}

.taskbar-top #start-menu {
  top: 52px;
  bottom: auto;
}

.start-btn {
  height: 36px;
  padding: 0 16px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border: none;
  border-radius: var(--border-radius-sm);
  color: white;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
}

.start-btn:hover {
  filter: brightness(1.15);
  transform: scale(1.05);
}

.start-btn:hover .start-icon {
  transform: rotate(30deg);
}

.start-icon {
  font-size: 16px;
  transition: transform 0.3s ease;
}

.taskbar-windows {
  flex: 1;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 8px;
}

.taskbar-windows::-webkit-scrollbar {
  height: 2px;
}

.taskbar-window-btn {
  height: 32px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
}

.taskbar-window-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

.taskbar-window-btn.active {
  border-color: var(--accent);
  color: var(--text-primary);
  background: rgba(255,255,255,0.1);
}

.taskbar-tray {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,0.1);
}

.tray-item {
  font-size: 12px;
  color: var(--text-secondary);
}

/* The Guide, in the corner where a desk keeps its help: a button that
   says what it is, with a round mark players know as help. */
.guide-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--border-radius-sm, 6px);
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.guide-btn:hover, .guide-btn:focus-visible { border-color: var(--accent); background: rgba(255, 255, 255, 0.08); outline: none; }
.guide-btn-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  font-weight: 700;
}
/* the Guide waits to be opened for the first time */
.guide-btn.fresh .guide-btn-icon { animation: guide-call 1.6s ease-in-out 3; }
@keyframes guide-call { 50% { transform: scale(1.35); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25); } }
@media (prefers-reduced-motion: reduce) { .guide-btn.fresh .guide-btn-icon { animation: none; } }

.clock {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

/* A phone's width: the start button and the tray give the window list room
   for its buttons (at 375px they left it 16px). */
@media (max-width: 600px) {
  .start-btn { padding: 0 10px; }
  .start-label { display: none; }
  .taskbar-tray { gap: 8px; padding-left: 8px; }
  .guide-btn-label { display: none; }
  .guide-btn { min-width: 36px; min-height: 36px; justify-content: center; padding: 0; }
  .taskbar-window-btn { max-width: 120px; padding: 0 8px; }
}
