* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: 'MS Sans Serif', Arial, sans-serif;
  overflow: hidden;
}

/* Wallpaper lives on its own fixed layer (not directly on body) so the
   per-theme `filter` below only recolors the background image - filter
   is applied to the whole element including descendants, so putting it
   directly on body would also filter every icon/window/taskbar on top
   of it. Explicit z-index (rather than relying on default stacking of
   position:fixed + z-index:auto) keeps this unambiguously behind
   .desktop regardless of DOM order. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: var(--xp-wallpaper-image);
  background-size: cover;
  background-attachment: fixed;
  background-color: var(--xp-wallpaper-color);
  filter: var(--xp-wallpaper-filter, none);
}

/* Desktop */
.desktop {
  width: 100%;
  height: calc(100% - 28px);
  padding: 20px;
  overflow: auto;
  position: relative;
  z-index: 1;
}

.desktop::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}

.desktop::-webkit-scrollbar-track {
  background: var(--xp-chrome-bg);
}

.desktop::-webkit-scrollbar-thumb {
  background-color: var(--xp-bevel-light);
  border: 2px solid;
  border-color: var(--xp-bevel-out);
}

/* Desktop Icons */
.desktop-icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, 80px);
  gap: 20px;
  padding: 10px;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  width: 80px;
  padding: 5px;
  border-radius: 2px;
  transition: all 0.1s;
}

.desktop-icon:hover {
  background-color: rgba(0, 0, 128, 0.3);
  border: 1px dotted #ffffff;
}

.desktop-icon:active {
  background-color: rgba(0, 0, 128, 0.5);
}

.desktop-icon img {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
}

.desktop-icon p {
  color: white;
  font-size: 12px;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  word-break: break-word;
  width: 100%;
}

/* Windows */
.windows-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - 28px);
  pointer-events: none;
  z-index: 1000;
}

.window {
  position: fixed;
  background-color: var(--xp-chrome-bg);
  border: 2px solid;
  border-color: var(--xp-bevel-out);
  box-shadow: var(--xp-inset-shadow);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  z-index: 1000;
  min-width: 300px;
  min-height: 200px;
}

.window.active {
  z-index: 2000;
}

.window-titlebar {
  background: var(--xp-titlebar-gradient);
  color: var(--xp-titlebar-text);
  padding: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 20px;
  font-weight: bold;
  font-size: 11px;
  cursor: move;
  user-select: none;
}

.window-title {
  padding: 0 4px;
  flex: 1;
}

.window-buttons {
  display: flex;
  gap: 2px;
  margin-right: 2px;
}

.window-btn {
  width: 16px;
  height: 14px;
  padding: 0;
  border: 1px solid;
  border-color: var(--xp-bevel-out);
  background: var(--xp-btn-gradient);
  box-shadow: var(--xp-btn-shadow);
  color: black;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1;
}

.window-btn:active {
  border-color: var(--xp-bevel-in);
  background: var(--xp-btn-gradient-active);
  box-shadow: var(--xp-btn-shadow-active);
}

.window-btn.close:hover {
  background-color: #ff0000;
  color: white;
}

.window-content {
  flex: 1;
  padding: 8px;
  overflow: auto;
  background-color: var(--xp-chrome-bg);
  font-size: 11px;
  color: #000;
  line-height: 1.6;
}

.window-content h1 {
  font-size: 16px;
  margin-bottom: 10px;
  color: var(--xp-accent);
}

.window-content p {
  margin-bottom: 10px;
  text-align: justify;
}

/* Taskbar */
.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: var(--xp-taskbar-gradient);
  border-top: 2px solid;
  border-color: var(--xp-bevel-out);
  display: flex;
  align-items: center;
  padding: 2px;
  gap: 2px;
  z-index: 3000;
}

.taskbar-start {
  margin-right: 5px;
}

.taskbar-start a {
  text-decoration: none;
}

.start-button {
  padding: 2px 18px;
  min-width: 64px;
  border: 2px solid;
  border-color: var(--xp-bevel-out);
  background: var(--xp-btn-gradient);
  color: black;
  font-family: 'MS Sans Serif', Arial, sans-serif;
  font-size: 11px;
  text-decoration: none;
  cursor: pointer;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.start-button:active {
  border-color: var(--xp-bevel-in);
  background: var(--xp-btn-gradient-active);
}

.taskbar-apps {
  flex: 1;
  display: flex;
  gap: 2px;
  overflow-x: auto;
}

.taskbar-app-btn {
  padding: 2px 8px;
  border: 2px solid;
  border-color: var(--xp-bevel-out);
  background: var(--xp-btn-gradient);
  color: black;
  font-family: 'MS Sans Serif', Arial, sans-serif;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  max-width: 200px;
  text-overflow: ellipsis;
  overflow: hidden;
}

.taskbar-app-btn:active {
  border-color: var(--xp-bevel-in);
  background: var(--xp-btn-gradient-active);
}

/* Shared 3D press bevel for all the classic grey buttons on the page. */
.start-button,
.taskbar-app-btn,
.view-toggle-btn {
  box-shadow: var(--xp-btn-shadow);
}

.start-button:active,
.taskbar-app-btn:active,
.view-toggle-btn:active {
  box-shadow: var(--xp-btn-shadow-active);
}

.taskbar-tray {
  margin-left: auto;
  display: flex;
  align-items: center;
  padding: 0 5px;
  gap: 5px;
  border-left: 2px solid;
  border-color: var(--xp-bevel-in);
  padding-left: 5px;
}

.system-time {
  font-size: 11px;
  color: #000;
  font-weight: bold;
}

/* Scrollbar for window content */
.window-content::-webkit-scrollbar {
  width: 16px;
}

.window-content::-webkit-scrollbar-track {
  background: var(--xp-chrome-bg);
}

.window-content::-webkit-scrollbar-thumb {
  background-color: var(--xp-bevel-light);
  border: 2px solid;
  border-color: var(--xp-bevel-out);
}

/* Ticket app (Box Office window) */
.ticket-app {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
}

.ticket-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--xp-bevel-dark);
}

.ticket-nav-user {
  margin-left: auto;
  font-size: 10px;
  color: #333;
}

.xp-action-btn {
  display: inline-block;
  padding: 3px 10px;
  border: 2px solid;
  border-color: var(--xp-bevel-out);
  background: var(--xp-btn-gradient);
  box-shadow: var(--xp-btn-shadow);
  color: black;
  font-family: 'MS Sans Serif', Arial, sans-serif;
  font-size: 11px;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.xp-action-btn:active {
  border-color: var(--xp-bevel-in);
  background: var(--xp-btn-gradient-active);
  box-shadow: var(--xp-btn-shadow-active);
}

.ticket-message {
  background-color: #ffffcc;
  border: 1px solid var(--xp-bevel-dark);
  padding: 6px 8px;
  font-size: 11px;
}

.ticket-error {
  color: #b00000;
  font-size: 11px;
}

.event-card,
.ticket-card {
  border: 1px solid var(--xp-bevel-dark);
  background-color: var(--xp-content-card-bg);
  padding: 8px;
  margin-bottom: 10px;
}

.event-title {
  font-size: 13px;
  color: var(--xp-accent);
  margin-bottom: 4px;
}

.event-datetime {
  font-size: 11px;
  font-weight: bold;
}

.event-description {
  font-size: 11px;
  margin: 4px 0;
}

.event-price {
  font-size: 11px;
  font-weight: bold;
  margin: 4px 0;
}

.event-buy-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.event-qty {
  font-size: 11px;
  padding: 2px;
}

.event-buy-status {
  font-size: 10px;
  color: #333;
}

.ticket-auth,
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 260px;
}

.ticket-input {
  padding: 4px;
  font-size: 11px;
  border: 2px solid;
  border-color: var(--xp-bevel-in);
}

.auth-btn-row {
  display: flex;
  gap: 6px;
}

.ticket-status {
  font-size: 11px;
  font-weight: bold;
  margin: 4px 0;
}

.ticket-status.valid {
  color: #006400;
}

.ticket-status.used {
  color: #808080;
}

.ticket-qr {
  display: flex;
  justify-content: center;
  padding: 6px;
  background: white;
}

.ticket-qr canvas {
  image-rendering: pixelated;
  max-width: 100%;
}

/* Guestbook app */
.guestbook-app {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
}

.guestbook-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-bottom: 1px solid var(--xp-bevel-dark);
  padding-bottom: 10px;
}

.guestbook-input {
  padding: 4px;
  font-size: 11px;
  font-family: 'MS Sans Serif', Arial, sans-serif;
  border: 2px solid;
  border-color: var(--xp-bevel-in);
}

.guestbook-textarea {
  min-height: 50px;
  resize: vertical;
}

.guestbook-status {
  font-size: 10px;
  color: #b00000;
}

.guestbook-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.guestbook-entry {
  border: 1px solid var(--xp-bevel-dark);
  background-color: var(--xp-content-card-bg);
  padding: 6px 8px;
}

.guestbook-entry p {
  margin: 4px 0;
  font-size: 11px;
}

.guestbook-entry-date {
  font-size: 9px;
  color: #555;
}

/* Gallery app */
.gallery-app {
  height: 100%;
  overflow-y: auto;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 6px;
}

.gallery-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 2px solid;
  border-color: var(--xp-bevel-out);
  cursor: pointer;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 5000;
}

.gallery-lightbox-img {
  max-width: 90vw;
  max-height: 75vh;
  border: 3px solid var(--xp-chrome-bg);
}

.gallery-lightbox-caption {
  color: #fff;
  font-size: 12px;
}

.gallery-lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: var(--xp-chrome-bg);
  border: 2px solid;
  border-color: var(--xp-bevel-out);
  font-size: 14px;
  width: 28px;
  height: 28px;
  cursor: pointer;
}

/* Mixes app */
.mixes-app {
  height: 100%;
  overflow-y: auto;
}

.mixes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mixes-card {
  border: 1px solid var(--xp-bevel-dark);
  background-color: var(--xp-content-card-bg);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mixes-dj {
  font-size: 10px;
  color: #555;
}

.mixes-player {
  width: 100%;
  height: 32px;
}

/* Photo Booth app */
.photobooth-app {
  height: 100%;
  overflow-y: auto;
}

.photobooth-intro {
  font-size: 11px;
  margin-bottom: 10px;
}

.photobooth-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.photobooth-file-input {
  font-size: 11px;
}

.photobooth-preview {
  max-width: 100%;
  max-height: 200px;
  border: 2px solid;
  border-color: var(--xp-bevel-in);
  align-self: flex-start;
}

.photobooth-input {
  padding: 4px;
  font-size: 11px;
  font-family: 'MS Sans Serif', Arial, sans-serif;
  border: 2px solid;
  border-color: var(--xp-bevel-in);
}

.photobooth-status {
  font-size: 10px;
  color: #b00000;
}

/* Chat app */
.chat-app {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-blocked {
  font-size: 11px;
  padding: 10px;
}

.chat-guest-name {
  font-size: 10px;
  color: #555;
  padding: 0 2px 6px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--xp-bevel-dark);
  background-color: #fff;
  padding: 6px;
}

.chat-empty {
  font-size: 11px;
  color: #555;
}

.chat-message {
  border-bottom: 1px solid var(--xp-content-card-bg);
  padding-bottom: 4px;
}

.chat-message-email {
  font-size: 10px;
  font-weight: bold;
  color: var(--xp-accent);
  margin-right: 6px;
}

.chat-message-time {
  font-size: 9px;
  color: #808080;
}

.chat-message-text {
  font-size: 11px;
  margin: 2px 0 0;
}

.chat-composer {
  display: flex;
  gap: 6px;
}

.chat-input {
  flex: 1;
  padding: 4px;
  font-size: 11px;
  font-family: 'MS Sans Serif', Arial, sans-serif;
  border: 2px solid;
  border-color: var(--xp-bevel-in);
}

.chat-composer-status {
  font-size: 10px;
  color: #b00000;
}

/* View toggle (taskbar tray button) */
.view-toggle-btn {
  padding: 2px 8px;
  border: 2px solid;
  border-color: var(--xp-bevel-out);
  background: var(--xp-btn-gradient);
  color: black;
  font-family: 'MS Sans Serif', Arial, sans-serif;
  font-size: 11px;
  cursor: pointer;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-toggle-btn:active {
  border-color: var(--xp-bevel-in);
  background: var(--xp-btn-gradient-active);
}

/* Tab (vertical list) view - hidden unless body.view-tabs */
.tab-view {
  display: none;
}

body.view-tabs .desktop,
body.view-tabs .windows-container {
  display: none;
}

body.view-tabs .tab-view {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  height: calc(100% - 28px);
  margin: 0 auto;
  overflow: hidden;
  background-color: var(--xp-chrome-bg);
  border: 2px solid;
  border-color: var(--xp-bevel-out);
  box-shadow: var(--xp-inset-shadow), 0 0 24px rgba(0, 0, 0, 0.4);
}

.tab-view-header {
  background: var(--xp-titlebar-gradient);
  color: #000;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: 1px;
  padding: 6px 12px;
  flex-shrink: 0;
}

.tab-view-list {
  flex: 1;
  overflow-y: auto;
  background-color: var(--xp-chrome-bg);
}

.tab-view-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--xp-bevel-dark);
  box-shadow: 0 1px 0 var(--xp-highlight);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.tab-view-row:hover {
  background-color: #a8a8a8;
}

.tab-view-row:active {
  background-color: #909090;
}

.tab-view-row img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.tab-view-row-label {
  color: #000;
  font-size: 13px;
  flex: 1;
}

.tab-view-row-arrow {
  color: #555;
  font-size: 16px;
}

.tab-view-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--xp-chrome-bg);
  z-index: 10;
}

.tab-view-panel:empty {
  display: none;
}

.tab-view-panel .tab-view-titlebar {
  flex-shrink: 0;
  height: 36px;
  padding: 0 6px;
}

.tab-view-titlebar .tab-view-back {
  width: 40px;
  height: 28px;
  font-size: 16px;
  margin-right: 6px;
}

.tab-view-titlebar .window-title {
  font-size: 13px;
}

.tab-view-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

/* Games folder */
.games-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 80px);
  gap: 16px;
  padding: 8px;
}

.games-folder-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  width: 80px;
  padding: 5px;
  border-radius: 2px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.games-folder-icon:hover {
  background-color: rgba(0, 0, 128, 0.15);
  border: 1px dotted var(--xp-accent);
}

.games-folder-icon img {
  width: 48px;
  height: 48px;
}

.games-folder-icon p {
  color: #000;
  font-size: 11px;
  text-align: center;
  word-break: break-word;
  width: 100%;
}

/* Snake / Flappy (arcade games) */
.arcade-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.arcade-canvas {
  border: 3px solid;
  border-color: var(--xp-bevel-in);
  cursor: pointer;
  max-width: 100%;
  height: auto; /* scale down proportionally rather than squash on tiny screens */
  /* Taps and swipes on the board are game input, so the browser must not treat
     them as scroll/double-tap-zoom gestures first. */
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.arcade-dpad {
  display: grid;
  grid-template-areas:
    ".    up   ."
    "left .    right"
    ".    down .";
  gap: 4px;
}

.arcade-dpad-btn {
  width: 34px;
  height: 34px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Minesweeper */
.minesweeper-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ms-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.ms-mode-row {
  display: flex;
  justify-content: center;
}

.ms-mode-btn {
  padding: 6px 14px;
  font-size: 12px;
}

.ms-mode-btn.active {
  border-color: var(--xp-bevel-in);
  background: var(--xp-btn-gradient-active);
}

.ms-status {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--xp-chrome-bg);
  border: 2px solid;
  border-color: var(--xp-bevel-in);
  padding: 4px 8px;
}

.ms-counter,
.ms-timer {
  font-family: 'Courier New', monospace;
  background: #000;
  color: #ff2b2b;
  font-size: 16px;
  font-weight: bold;
  padding: 2px 6px;
  min-width: 34px;
  text-align: center;
}

.ms-face {
  font-size: 16px;
  width: 26px;
  height: 26px;
  border: 2px solid;
  border-color: var(--xp-bevel-out);
  background: var(--xp-chrome-bg);
  cursor: pointer;
}

/* .minesweeper-app centres its children, and a centre-aligned box wider than
   its parent overflows on *both* sides - the leftmost columns would be
   permanently unreachable. Keep the overflow inside a scroller that itself
   always fits instead. */
.ms-board-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.ms-board {
  display: grid;
  gap: 0;
  width: max-content;
  margin: 0 auto;
  border: 3px solid;
  border-color: var(--xp-bevel-in);
}

.ms-cell {
  width: 24px;
  height: 24px;
  background: var(--xp-chrome-bg);
  border: 2px solid;
  border-color: var(--xp-bevel-out);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  /* Long-press flags a square, so iOS must not answer the same gesture with a
     text-selection callout or a zoom. */
  -webkit-touch-callout: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.ms-cell.revealed {
  border: 1px solid var(--xp-bevel-dark);
  background: var(--xp-content-card-bg);
  cursor: default;
}

.ms-cell.mine {
  background: #ff6b6b;
}

.ms-cell.n1 { color: #0000ff; }
.ms-cell.n2 { color: #008200; }
.ms-cell.n3 { color: #ff0000; }
.ms-cell.n4 { color: #000084; }
.ms-cell.n5 { color: #840000; }
.ms-cell.n6 { color: #008284; }
.ms-cell.n7 { color: #000000; }
.ms-cell.n8 { color: #808080; }

.ms-best {
  font-size: 11px;
  color: #333;
}

.ms-hint {
  font-size: 10px;
  color: #555;
  text-align: center;
}

/* Card games (shared) */
/* Card geometry lives in custom properties because the games fan stacked piles
   out with inline `top` offsets computed in JS - cards-common.js reads these
   back through CardEngine.cardMetrics() so the two can't disagree when the
   phone breakpoint shrinks a card. */
:root {
  --pc-card-w: 46px;
  --pc-card-h: 64px;
  --pc-stack: 20px;
}

.pc-card,
.pc-slot-empty {
  width: var(--pc-card-w);
  height: var(--pc-card-h);
  border-radius: 3px;
  font-family: Georgia, serif;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.pc-card.face-up {
  background: #fefefe;
  border: 1px solid #333;
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
}

.pc-card.face-down {
  background: repeating-linear-gradient(45deg, #1a4fa0, #1a4fa0 4px, #163e80 4px, #163e80 8px);
  border: 1px solid #0a2450;
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
}

.pc-card.pc-red { color: #c0392b; }
.pc-card.pc-black { color: #111; }

.pc-card.pc-selected {
  outline: 2px solid #ffcc00;
  outline-offset: 1px;
}

.pc-corner {
  position: absolute;
  font-size: 10px;
  line-height: 1;
  left: 3px;
  top: 3px;
}

.pc-corner.pc-br {
  left: auto;
  top: auto;
  right: 3px;
  bottom: 3px;
  transform: rotate(180deg);
}

.pc-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.pc-slot-empty {
  border: 1.5px dashed #ffffff88;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #ffffffaa;
  cursor: pointer;
}

.pc-pile {
  position: relative;
  min-width: var(--pc-card-w);
  min-height: var(--pc-card-h);
  cursor: pointer;
}

.pc-pile .pc-card,
.pc-pile .pc-slot-empty {
  position: absolute;
  top: 0;
  left: 0;
}

.pc-tableau-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.pc-game-felt {
  background: #1b6b3a;
  padding: 12px;
  border-radius: 4px;
  height: 100%;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pc-toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
}

.pc-message {
  color: #fff;
  font-size: 13px;
  font-weight: bold;
}

/* Responsive */
@media (max-width: 768px) {
  .desktop {
    height: calc(100% - 32px);
    padding: 10px;
  }

  .desktop-icons {
    grid-template-columns: repeat(auto-fill, 84px);
    gap: 14px;
    padding: 5px;
  }

  .desktop-icon {
    width: 84px;
    padding: 4px;
  }

  .desktop-icon img {
    width: 52px;
    height: 52px;
  }

  .desktop-icon p {
    font-size: 11px;
  }

  .window {
    min-width: 200px;
    min-height: 150px;
    font-size: 10px;
    max-width: calc(100vw - 20px) !important;
    max-height: calc(100vh - 60px) !important;
    width: calc(100vw - 20px) !important;
    height: 350px !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
  }

  .window-titlebar {
    height: 18px;
    font-size: 10px;
  }

  .window-content {
    font-size: 12px;
    padding: 6px;
  }

  .window-content h1 {
    font-size: 15px;
  }

  .window-content p {
    margin-bottom: 8px;
  }

  .taskbar {
    height: 32px;
  }

  .start-button {
    padding: 2px 14px;
    min-width: 52px;
    font-size: 10px;
    height: 24px;
  }

  .taskbar-app-btn {
    padding: 2px 6px;
    font-size: 9px;
    max-width: 120px;
  }

  .view-toggle-btn {
    padding: 2px 8px;
    font-size: 10px;
    height: 24px;
  }

  .system-time {
    font-size: 10px;
  }

  .window-btn {
    width: 14px;
    height: 12px;
    font-size: 8px;
  }
}

@media (max-width: 480px) {
  .desktop {
    padding: 5px;
    height: calc(100% - 36px);
  }

  .desktop-icons {
    grid-template-columns: repeat(auto-fill, 76px);
    gap: 12px;
  }

  .desktop-icon {
    width: 76px;
  }

  .desktop-icon img {
    width: 46px;
    height: 46px;
  }

  .desktop-icon p {
    font-size: 10px;
  }

  .window {
    min-width: 160px !important;
    min-height: 120px !important;
    max-width: calc(100vw - 10px) !important;
    max-height: calc(100vh - 50px) !important;
    width: calc(100vw - 10px) !important;
    height: 300px !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
  }

  .window-titlebar {
    height: 16px;
    font-size: 9px;
    padding: 1px;
  }

  .window-content {
    font-size: 11px;
    padding: 4px;
  }

  .window-content h1 {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .taskbar {
    height: 36px;
  }

  .start-button {
    padding: 2px 10px;
    min-width: 44px;
    font-size: 9px;
    height: 24px;
  }

  .taskbar-app-btn {
    padding: 2px 4px;
    font-size: 8px;
    max-width: 80px;
  }

  .view-toggle-btn {
    padding: 2px 6px;
    font-size: 9px;
    height: 24px;
  }

  .system-time {
    font-size: 8px;
  }

  .window-btn {
    width: 12px;
    height: 10px;
    font-size: 7px;
  }

  .window-title {
    font-size: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Games on a phone. The list view fills the screen, so everything the card
     games lay out in a row - 10 columns of Spider being the worst case - has
     to survive at ~360px of usable width without side-scrolling. JS reads the
     card variables back, so changing them here is enough. */
  :root {
    --pc-card-w: 34px;
    --pc-card-h: 48px;
    --pc-stack: 16px;
  }

  .pc-corner {
    font-size: 8px;
  }

  .pc-center {
    font-size: 15px;
  }

  .pc-tableau-row {
    gap: 4px;
  }

  .pc-game-felt {
    padding: 8px;
    gap: 10px;
  }

  .pc-message {
    font-size: 11px;
  }

  /* Thumb-sized, since these are the whole control scheme for Snake. */
  .arcade-dpad-btn {
    width: 46px;
    height: 46px;
    font-size: 14px;
  }
}

/* Standalone page (events.html) - the direct-linkable ticket page
   that live outside the XP desktop chrome. Reuse .ticket-app/.event-card/
   .xp-action-btn etc. as-is above; this section is just the page shell
   (header/footer) around them. Unlike the desktop, these pages need normal
   document scrolling, so `body.standalone-page` opts back out of the
   `overflow: hidden` set on html/body up top. */
body.standalone-page {
  overflow-y: auto;
  overflow-x: hidden;
}

.standalone-shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.standalone-header {
  background: var(--xp-titlebar-gradient);
  color: var(--xp-titlebar-text);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.standalone-header-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.5px;
}

.standalone-header-subtitle {
  font-size: 11px;
  opacity: 0.85;
  margin-top: 2px;
}

.standalone-header-back {
  color: var(--xp-titlebar-text);
  font-size: 11px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.6);
  padding: 3px 8px;
  flex-shrink: 0;
}

.standalone-header-back:hover {
  background: rgba(255, 255, 255, 0.15);
}

.standalone-main {
  flex: 1;
  width: min(94vw, 640px);
  margin: 0 auto;
  padding: 16px 0 32px;
}

.standalone-footer {
  background: var(--xp-chrome-bg);
  border-top: 2px solid;
  border-color: var(--xp-bevel-out);
  padding: 12px 16px 20px;
  flex-shrink: 0;
}

.standalone-footer-section {
  width: min(94vw, 640px);
  margin: 0 auto 8px;
  background: var(--xp-content-card-bg);
  border: 1px solid var(--xp-bevel-dark);
  padding: 0 10px;
}

.standalone-footer-section summary {
  cursor: pointer;
  padding: 6px 0;
  font-size: 12px;
  font-weight: bold;
  color: var(--xp-accent);
}

.standalone-footer-section > div {
  padding: 4px 0 10px;
  font-size: 11px;
}

.standalone-footer-contact {
  width: min(94vw, 640px);
  margin: 8px auto 0;
  font-size: 11px;
  text-align: center;
}

@media (max-width: 480px) {
  .standalone-header-title {
    font-size: 18px;
  }
}

/* --- Event page (events.html) ----------------------------------------
   This page reads as a document you scroll, not as the XP desktop, so it
   drops the photo wallpaper for the theme's own flat chrome color. Every
   theme already redefines --xp-chrome-bg, so all four adapt from this one
   rule with no per-theme overrides. filter is reset too: the themes tint
   the wallpaper photo with it, and leaving it on would tint this flat
   color instead. */
body.standalone-page::before {
  background-image: none;
  background-color: var(--xp-chrome-bg);
  filter: none;
}

/* Panels share the notepad/readme surface (--xp-content-card-bg) and the
   same 1px dark bevel as .event-card/.guestbook-entry, so the page still
   sits inside the existing visual language rather than inventing a new one.
   All classes are ep- prefixed to stay clear of the .event-* classes
   ticket-app.js already renders into #ticketRoot. */
.ep-hero,
.ep-section {
  background: var(--xp-content-card-bg);
  border: 1px solid var(--xp-bevel-dark);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.ep-kicker {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--xp-accent);
  margin: 0 0 6px;
}

.ep-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.05;
  margin: 0 0 8px;
  color: var(--xp-accent);
}

.ep-tagline {
  font-size: 12px;
  line-height: 1.5;
  margin: 0 0 12px;
}

.ep-meta {
  list-style: none;
  margin: 0;
  padding: 10px 0 0;
  border-top: 1px solid var(--xp-bevel-dark);
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
}

/* Fixed label column keeps When/Where/Age values aligned without a table. */
.ep-meta-label {
  display: inline-block;
  width: 52px;
  font-weight: bold;
  color: var(--xp-accent);
}

.ep-section-title {
  font-size: 13px;
  margin: 0 0 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--xp-bevel-dark);
  color: var(--xp-accent);
}

.ep-section p {
  font-size: 12px;
  line-height: 1.55;
  margin: 0 0 8px;
}

/* The buy box is the point of the page - the titlebar gradient lifts it
   above the surrounding document panels. */
.ep-section-tickets {
  border: 2px solid var(--xp-bevel-dark);
  padding: 0 0 12px;
}

.ep-section-tickets .ep-section-title {
  background: var(--xp-titlebar-gradient);
  color: var(--xp-titlebar-text);
  border-bottom: none;
  margin: 0 0 10px;
  padding: 6px 12px;
}

.ep-section-tickets > #ticketRoot {
  padding: 0 12px;
}

.ep-lineup {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.ep-act {
  display: grid;
  grid-template-columns: 54px 1fr;
  grid-template-areas:
    'time name'
    'time role';
  gap: 0 10px;
  align-items: baseline;
  padding: 7px 8px;
  background: var(--xp-chrome-bg);
  border: 1px solid var(--xp-bevel-dark);
}

.ep-act-time {
  grid-area: time;
  align-self: center;
  font-weight: bold;
  font-size: 13px;
  color: var(--xp-accent);
}

.ep-act-name {
  grid-area: name;
  font-size: 12px;
  font-weight: bold;
}

.ep-act-role {
  grid-area: role;
  font-size: 10px;
  opacity: 0.75;
  margin-top: 2px;
}

.ep-facts {
  margin: 0 0 8px;
  font-size: 12px;
}

.ep-facts dt {
  font-weight: bold;
  color: var(--xp-accent);
  margin-top: 8px;
}

.ep-facts dt:first-child {
  margin-top: 0;
}

.ep-facts dd {
  margin: 2px 0 0;
  line-height: 1.5;
}

.ep-faq {
  border-top: 1px solid var(--xp-bevel-dark);
  padding: 6px 0;
}

.ep-faq summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
}

.ep-faq p {
  margin: 6px 0 2px;
  padding-left: 12px;
}

/* Matches the parenthetical placeholder notes already used in the blog
   post copy in apps-registry.js - delete these lines as the real copy
   lands. */
.ep-placeholder-note {
  font-size: 10px;
  font-style: italic;
  color: #555;
  margin: 10px 0 0;
}

/* Filled in by events-page.js once /api/events/:id resolves - only shown
   when the event is still upcoming, so this never has to say "in -3 days". */
.ep-countdown {
  display: inline-block;
  font-size: 11px;
  font-weight: bold;
  color: var(--xp-titlebar-text);
  background: var(--xp-accent);
  padding: 3px 8px;
  margin: 0 0 10px;
}

.ep-tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}

.ep-tier {
  border: 1px solid var(--xp-bevel-dark);
  background: var(--xp-chrome-bg);
  padding: 10px;
  text-align: center;
}

/* The tier meant to catch the eye gets the titlebar treatment, same as the
   Tickets panel heading above it. */
.ep-tier-featured {
  border-color: var(--xp-accent);
  background: var(--xp-content-card-bg);
  box-shadow: inset 0 0 0 1px var(--xp-accent);
}

.ep-tier-name {
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--xp-accent);
}

.ep-tier-price {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  margin: 4px 0;
}

.ep-tier-note {
  font-size: 10px;
  opacity: 0.8;
}

/* Mixes/photos teasers reuse .mixes-list/.mixes-card and .gallery-grid/
   .gallery-thumb as-is (same classes the Mixes and Gallery desktop apps
   render into) - only capping height differs, since this is a preview
   strip rather than the full library. */
.ep-mixes .mixes-list {
  max-height: 420px;
  overflow-y: auto;
}

.ep-photos-credit {
  font-size: 10px;
  color: #555;
  margin-top: 8px;
}

.ep-share {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ep-share p {
  margin: 0;
  flex-basis: 100%;
}

.ep-share-status {
  font-size: 11px;
  color: var(--xp-accent);
}

@media (max-width: 480px) {
  .ep-title {
    font-size: 26px;
  }

  .ep-hero,
  .ep-section {
    padding: 10px;
  }

  .ep-section-tickets {
    padding: 0 0 10px;
  }

  .ep-tiers {
    grid-template-columns: 1fr;
  }
}

/* Announcement banner offsets. The banner is an in-flow block at the top of
   <body>, so anything sized against the viewport has to subtract its height.
   --announcement-h is measured and published at runtime by
   announcement-banner.js; the 0px fallback makes these no-ops when no banner
   is showing, so they can sit here unconditionally. */
body.has-announcement .desktop {
  height: calc(100% - 28px - var(--announcement-h, 0px));
}

/* .windows-container is position:fixed at top:0, so it needs pushing down as
   well as shortening - otherwise dragged windows sit underneath the banner. */
body.has-announcement .windows-container {
  top: var(--announcement-h, 0px);
  height: calc(100% - 28px - var(--announcement-h, 0px));
}

body.has-announcement.view-tabs .tab-view {
  height: calc(100% - 28px - var(--announcement-h, 0px));
}