/* === CLASSIC MAC OS RESET & BASE === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-system);
  font-size: var(--text-base);
  color: var(--mac-text);
  background: var(--mac-desktop-bg);
  cursor: default;
  -webkit-font-smoothing: antialiased;
}

/* === MAC MENU BAR (Top) === */
.mac-menubar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--menubar-height);
  background: var(--mac-menubar-bg);
  border-bottom: 1px solid var(--mac-window-border);
  display: flex;
  align-items: center;
  padding: 0 8px;
  z-index: var(--z-menubar);
  font-size: var(--text-sm);
  font-weight: 500;
}

.mb-logo {
  font-family: var(--font-system);
  font-size: 14px;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 700;
}

.mb-logo:hover {
  background: var(--mac-menu-highlight);
  color: var(--mac-text-inverse);
  border-radius: 4px;
}

.menubar-item {
  padding: 2px 12px;
  cursor: default;
  border-radius: 4px;
}

.menubar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.menubar-clock {
  font-variant-numeric: tabular-nums;
}

/* === MAC DESKTOP === */
.mac-desktop {
  position: fixed;
  top: var(--menubar-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--mac-desktop-bg);
  background-image: var(--mac-desktop-pattern);
  z-index: var(--z-desktop);
  overflow: hidden;
}

/* === DESKTOP ICONS (Finder Style) === */
.desktop-icons {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
  z-index: var(--z-desktop);
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2);
  width: 80px;
  cursor: pointer;
  border-radius: 4px;
  text-decoration: none;
  color: var(--mac-text-inverse);
}

.desktop-icon:hover {
  background: rgba(255, 255, 255, 0.2);
}

.desktop-icon:focus,
.desktop-icon.selected {
  background: var(--mac-selection-bg);
}

.desktop-icon img {
  width: 48px;
  height: 48px;
  filter: drop-shadow(1px 2px 3px var(--mac-icon-shadow));
}

.desktop-icon span {
  font-size: var(--text-xs);
  color: var(--mac-text-inverse);
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  word-wrap: break-word;
  max-width: 100%;
  line-height: 1.3;
  padding: 1px 4px;
  border-radius: 2px;
}

.desktop-icon.selected span {
  background: var(--mac-selection-bg);
}

/* === MAC WINDOW === */
.window {
  position: absolute;
  background: var(--mac-window-bg);
  border-radius: var(--window-border-radius);
  box-shadow:
    0 0 0 1px var(--mac-window-border),
    0 4px 16px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 var(--mac-window-border-light);
  display: flex;
  flex-direction: column;
  min-width: 300px;
  min-height: 200px;
  z-index: var(--z-window);
  overflow: hidden;
}

.window.active {
  z-index: var(--z-window-active);
  box-shadow:
    0 0 0 1px var(--mac-window-border-dark),
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 var(--mac-window-border-light);
}

.window.maximized,
.window.window-maximized {
  top: var(--menubar-height) !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: calc(100vh - var(--menubar-height)) !important;
  transform: none !important;
  max-width: none !important;
  border-radius: 0;
}

.window.minimized {
  display: none;
}

/* Mac Titlebar with Stripes */
.window-titlebar {
  display: flex;
  align-items: center;
  height: var(--titlebar-height);
  padding: 0 8px;
  background: var(--mac-titlebar-inactive);
  border-bottom: 1px solid var(--mac-window-border);
  border-radius: var(--window-border-radius) var(--window-border-radius) 0 0;
  cursor: grab;
  flex-shrink: 0;
  user-select: none;
  position: relative;
}

.window.active .window-titlebar {
  background: var(--mac-titlebar-bg);
}


/* Window Controls - Mac Style (Close on Left) */
.window-controls {
  display: flex;
  gap: 8px;
  z-index: 1;
  padding: 4px 6px;
  margin: -4px -6px;
  border-radius: 8px;
}

.window-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: bold;
  color: transparent;
  transition: all 0.1s;
  position: relative;
}

.window-btn::before {
  opacity: 0;
  transition: opacity 0.1s;
  line-height: 1;
  margin-top: -2px;
  margin-left: 1px;
}

.window-btn.close {
  background: #ff5f57;
  border-color: #e14640;
}

.window-btn.close::before {
  content: '×';
  color: rgba(0, 0, 0, 0.5);
}

.window-btn.minimize {
  background: #febc2e;
  border-color: #d69c1e;
}

.window-btn.minimize::before {
  content: '−';
  color: rgba(0, 0, 0, 0.5);
}

.window-btn.maximize {
  background: #28c840;
  border-color: #1aab2e;
}

.window-btn.maximize::before {
  content: '+';
  color: rgba(0, 0, 0, 0.5);
}

.window:not(.active) .window-btn {
  background: #cccccc;
  border-color: #aaaaaa;
}

.window:not(.active) .window-btn::before {
  display: none;
}

/* Show all icons when hovering over the controls area */
.window-controls:hover .window-btn::before {
  opacity: 1;
}

.window-btn.close:hover { background: #ff4136; }
.window-btn.minimize:hover { background: #ffb000; }
.window-btn.maximize:hover { background: #00d544; }

/* Window Title */
.window-title-area {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  pointer-events: none;
}

.window-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.window-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--mac-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window:not(.active) .window-title {
  color: var(--mac-text-muted);
}

/* Window Toolbar (Finder Style) */
.window-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 4px 12px;
  background: linear-gradient(180deg, #f5f5f5 0%, #e5e5e5 100%);
  border-bottom: 1px solid var(--mac-window-border);
  font-size: var(--text-xs);
  flex-shrink: 0;
}

.toolbar-btn {
  padding: 4px 12px;
  background: var(--mac-btn-bg);
  border: 1px solid var(--mac-btn-border);
  border-radius: 4px;
  font-size: var(--text-xs);
  cursor: pointer;
}

.toolbar-btn:active {
  background: var(--mac-btn-pressed);
}

.toolbar-path {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--mac-text-muted);
}

.toolbar-path span {
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

/* Window Content */
.window-content {
  flex: 1;
  overflow: auto;
  background: #ffffff;
  user-select: text;
  cursor: auto;
}

.window-content-padded {
  padding: var(--space-6);
}

.window-content-list {
  padding: 0;
}

/* Finder List View */
.finder-list {
  display: flex;
  flex-direction: column;
}

.finder-list-header {
  display: grid;
  grid-template-columns: 1fr 100px 120px;
  padding: 4px 12px;
  background: linear-gradient(180deg, #f8f8f8 0%, #e8e8e8 100%);
  border-bottom: 1px solid var(--mac-window-border);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--mac-text-muted);
}

.finder-item {
  display: grid;
  grid-template-columns: 1fr 100px 120px;
  padding: 6px 12px;
  align-items: center;
  text-decoration: none;
  color: var(--mac-text);
  border-bottom: 1px solid #f0f0f0;
}

.finder-item:hover {
  background: #f5f5f5;
}

.finder-item.selected,
.finder-item:focus {
  background: var(--mac-selection-bg);
  color: var(--mac-selection-text);
}

.finder-item-name {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.finder-item-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.finder-item-date,
.finder-item-size {
  font-size: var(--text-xs);
  color: var(--mac-text-muted);
}

.finder-item.selected .finder-item-date,
.finder-item.selected .finder-item-size {
  color: var(--mac-selection-text);
}

/* Finder Icon View */
.finder-icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: var(--space-4);
  padding: var(--space-4);
}

.finder-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  text-decoration: none;
  color: var(--mac-text);
  border-radius: 6px;
  text-align: center;
}

.finder-icon-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.finder-icon-item.selected,
.finder-icon-item:focus {
  background: var(--mac-selection-bg);
  color: var(--mac-selection-text);
}

.finder-icon-item img {
  width: 48px;
  height: 48px;
}

.finder-icon-item span {
  font-size: var(--text-xs);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Window Statusbar */
.window-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px;
  background: var(--mac-window-bg);
  border-top: 1px solid var(--mac-window-border);
  font-size: var(--text-xs);
  color: var(--mac-text-muted);
  flex-shrink: 0;
}

/* Resize Handle */
.window-resize {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: se-resize;
  background: linear-gradient(
    -45deg,
    transparent 30%,
    var(--mac-window-border) 30%,
    var(--mac-window-border) 40%,
    transparent 40%,
    transparent 50%,
    var(--mac-window-border) 50%,
    var(--mac-window-border) 60%,
    transparent 60%,
    transparent 70%,
    var(--mac-window-border) 70%,
    var(--mac-window-border) 80%,
    transparent 80%
  );
}

/* === MB MENU DROPDOWN === */
.mb-menu-dropdown {
  position: fixed;
  top: var(--menubar-height);
  left: 8px;
  width: 180px;
  background: var(--mac-menu-bg);
  border: 1px solid var(--mac-menu-border);
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: var(--z-menu);
  display: none;
  padding: 4px 0;
}

.mb-menu-dropdown.open {
  display: block;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 6px 16px;
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--mac-text);
  text-decoration: none;
}

.menu-item:hover {
  background: var(--mac-menu-highlight);
  color: var(--mac-text-inverse);
}

.menu-item img {
  width: 18px;
  height: 18px;
}

.menu-divider {
  height: 1px;
  background: #e0e0e0;
  margin: 4px 0;
}

/* === WELCOME CONTENT === */
.welcome-content {
  padding: var(--space-8);
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

.welcome-content h1 {
  font-size: var(--text-2xl);
  font-weight: 500;
  margin-bottom: var(--space-3);
}

.welcome-subtitle {
  font-size: var(--text-lg);
  color: var(--mac-text-muted);
  margin-bottom: var(--space-6);
}

.welcome-quote {
  padding: var(--space-4);
  background: #f8f8f8;
  border-radius: 8px;
  margin-bottom: var(--space-6);
  font-style: italic;
  color: var(--mac-text-muted);
}

.welcome-actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

/* === ARTICLE LAYOUT === */
.article-content {
  padding: var(--space-6);
  overflow-y: auto;
  line-height: 1.7;
  background: #ffffff;
  max-width: 800px;
  margin: 0 auto;
}

.article-title {
  font-size: var(--text-2xl);
  font-weight: 500;
  margin-bottom: var(--space-2);
}

.article-subtitle {
  font-size: var(--text-lg);
  color: var(--mac-text-muted);
  margin-bottom: var(--space-4);
}

.article-meta {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  color: var(--mac-text-muted);
}

.article-banner img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: var(--space-6);
}

.article-preamble {
  padding: 12px 16px;
  background: #fffde7;
  border-radius: 6px;
  margin-bottom: 24px;
  border-left: 3px solid #ffc107;
}

.article-body {
  color: var(--mac-text);
}

.article-body h2 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
  font-weight: 500;
}

.article-body p {
  margin-bottom: var(--space-4);
}

.article-body ul, .article-body ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.article-body li {
  margin-bottom: var(--space-2);
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: var(--space-4) 0;
}

.article-body blockquote {
  padding: var(--space-4);
  background: #f8f8f8;
  border-left: 3px solid var(--mac-menu-highlight);
  border-radius: 0 6px 6px 0;
  margin: var(--space-4) 0;
  font-style: italic;
}

.article-end {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid #e0e0e0;
  text-align: center;
  color: var(--mac-text-muted);
}

/* Code Blocks */
.code-block {
  position: relative;
  margin: var(--space-4) 0;
}

.code-block pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: var(--space-4);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.5;
  border-radius: 6px;
}

.copy-button {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 4px;
  font-size: var(--text-xs);
  color: #ffffff;
  cursor: pointer;
}

.copy-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* === MAC BUTTONS === */
.mac-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 20px;
  background: var(--mac-btn-bg);
  border: 1px solid var(--mac-btn-border);
  border-radius: 6px;
  font-family: var(--font-system);
  font-size: var(--text-sm);
  cursor: pointer;
  text-decoration: none;
  color: var(--mac-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.mac-btn:active {
  background: var(--mac-btn-pressed);
}

.mac-btn-primary,
.mac-btn-primary:link,
.mac-btn-primary:visited {
  background: var(--mac-selection-bg);
  color: #ffffff !important;
  border-color: #2255aa;
}

.mac-btn-primary:hover {
  background: #2255aa;
  color: #ffffff !important;
  text-decoration: none;
}

.mac-btn-primary:active {
  background: #1a4488;
  color: #ffffff !important;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-system);
  font-weight: 500;
  color: var(--mac-text);
  margin-bottom: var(--space-4);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p {
  margin-bottom: var(--space-4);
  line-height: 1.6;
}

a {
  color: var(--mac-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:visited {
  color: var(--mac-link-visited);
}

/* === SELECTION === */
::selection {
  background: var(--mac-selection-bg);
  color: var(--mac-selection-text);
}

/* === MAC SCROLLBARS === */
::-webkit-scrollbar {
  width: 15px;
  height: 15px;
}

::-webkit-scrollbar-track {
  background: var(--mac-scroll-track);
  border-left: 1px solid #d0d0d0;
}

::-webkit-scrollbar-thumb {
  background: var(--mac-scroll-thumb);
  border: 1px solid #aaaaaa;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, #e0e0e0 0%, #b0b0b0 50%, #909090 100%);
}

::-webkit-scrollbar-corner {
  background: var(--mac-scroll-track);
}

/* === LANGUAGE SWITCHER === */
.language-switcher {
  display: flex;
  gap: 4px;
}

.language-switcher a {
  text-decoration: none;
  color: var(--mac-text);
  padding: 2px 6px;
  font-size: var(--text-xs);
  border-radius: 3px;
}

.language-switcher a:hover,
.language-switcher a.active {
  background: var(--mac-selection-bg);
  color: var(--mac-text-inverse);
}

/* === macOS DOCK === */
.dock {
  position: fixed;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
}

.dock-container {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(30, 30, 30, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.dock-item {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 48px;
  height: 48px;
}

/* Invisible hover zone that stays in place */
.dock-item::before {
  content: '';
  position: absolute;
  inset: -20px -8px -10px -8px;
  z-index: -1;
}

/* Icon wrapper for unified transform */
.dock-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease-out;
  transform-origin: bottom center;
}

.dock-item img {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: transform 0.15s ease-out;
  transform-origin: bottom center;
}

/* Items without wrapper - direct img transform */
.dock-item:not(:has(.dock-icon-wrapper)):hover img {
  transform: scale(1.5) translateY(-12px);
}

/* Items with wrapper - wrapper transforms */
.dock-item:hover .dock-icon-wrapper {
  transform: scale(1.5) translateY(-12px);
}

/* Neighboring icons */
.dock-item:hover + .dock-item img,
.dock-item:has(+ .dock-item:hover) img {
  transform: scale(1.2) translateY(-6px);
}

.dock-item:hover + .dock-item .dock-icon-wrapper,
.dock-item:has(+ .dock-item:hover) .dock-icon-wrapper {
  transform: scale(1.2) translateY(-6px);
}

/* Reset direct img transform when inside wrapper */
.dock-icon-wrapper img {
  transition: none;
}

.dock-item:hover .dock-icon-wrapper img,
.dock-item:hover + .dock-item .dock-icon-wrapper img,
.dock-item:has(+ .dock-item:hover) .dock-icon-wrapper img {
  transform: none;
}

.dock-item.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
}

/* Notification Badge */
.dock-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ff3b30;
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  border: 2px solid white;
  z-index: 1;
  pointer-events: none;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .mac-menubar {
    padding: 0 4px;
  }

  .menubar-item {
    padding: 2px 8px;
    font-size: var(--text-xs);
  }

  .desktop-icons {
    right: auto;
    left: var(--space-2);
    flex-direction: row;
    flex-wrap: wrap;
    bottom: var(--space-4);
    top: auto;
    justify-content: center;
  }

  .desktop-icon {
    width: 70px;
  }

  .desktop-icon img {
    width: 40px;
    height: 40px;
  }

  .window {
    left: 4px !important;
    top: calc(var(--menubar-height) + 4px) !important;
    right: 4px !important;
    width: calc(100% - 8px) !important;
    height: calc(100vh - var(--menubar-height) - 8px) !important;
    transform: none !important;
    max-width: none !important;
  }


  .finder-list-header,
  .finder-item {
    grid-template-columns: 1fr 80px;
  }

  .finder-item-size {
    display: none;
  }

  .mb-menu-dropdown {
    width: 100%;
    left: 0;
    right: 0;
    border-radius: 0;
  }

  .dock-container {
    padding: 4px 10px;
    gap: 6px;
  }

  .dock-item {
    width: 42px;
    height: 42px;
  }

  .dock-item img {
    width: 38px;
    height: 38px;
  }

  .dock-item:hover img {
    transform: scale(1.3) translateY(-8px);
  }

  .dock-item:hover .dock-badge {
    transform: scale(1.3) translateY(-8px);
  }

  .dock-item:hover + .dock-item img,
  .dock-item:has(+ .dock-item:hover) img {
    transform: scale(1.1) translateY(-3px);
  }

  .mac-desktop {
    bottom: 70px;
  }
}

/* === EMPTY STATE === */
.empty-message {
  text-align: center;
  padding: var(--space-8);
  color: var(--mac-text-muted);
}

/* === PAGINATION === */
.pagination-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.pagination-info {
  font-size: var(--text-xs);
  color: var(--mac-text-muted);
}

/* === SNAKE GAME === */
.snake-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  background: #1a1a1a;
  user-select: none;
}

.snake-header {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 10px;
  background: #2d2d2d;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 14px;
}

.snake-score {
  color: #9bbc0f;
}

.snake-highscore {
  color: #ffd700;
}

#snakeCanvas {
  background: #9bbc0f;
  border-radius: 4px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.snake-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  width: 100%;
}

.snake-btn {
  padding: 10px 32px;
  background: linear-gradient(180deg, #4a9f4a 0%, #306230 100%);
  border: 2px solid #0f380f;
  border-radius: 8px;
  color: #ffffff;
  font-family: var(--font-system);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.snake-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.snake-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.snake-instructions {
  font-size: 11px;
  color: #666666;
  text-align: center;
}

.snake-game-over {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.85);
  padding: 24px 32px;
  border-radius: 12px;
  text-align: center;
  z-index: 10;
}

.snake-game-over h3 {
  color: #ff4444;
  margin-bottom: 8px;
  font-size: 24px;
}

.snake-game-over p {
  color: #ffffff;
  margin-bottom: 16px;
}

/* Desktop icon dragging */
.desktop-icon {
  cursor: grab;
  user-select: none;
}

.desktop-icon.dragging {
  cursor: grabbing;
  opacity: 0.8;
  z-index: 100;
}

.desktop-icon.selected {
  background: var(--mac-selection-bg);
}

/* === TETRIS GAME === */
.tetris-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px;
  background: #1a1a2e;
  user-select: none;
}

.tetris-main {
  display: flex;
  justify-content: center;
  gap: 15px;
}

#tetrisCanvas {
  background: #0f0f23;
  border: 2px solid #e94560;
  border-radius: 4px;
}

.tetris-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100px;
}

.tetris-next {
  background: #16213e;
  border-radius: 6px;
  padding: 8px;
  text-align: center;
}

.tetris-next span {
  display: block;
  color: #e94560;
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: 1px;
}

#tetrisNext {
  background: #0f0f23;
  border-radius: 4px;
}

.tetris-stats {
  background: #16213e;
  border-radius: 6px;
  padding: 10px;
}

.tetris-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 8px;
}

.tetris-stat:last-child {
  margin-bottom: 0;
}

.tetris-stat span:first-child {
  color: #e94560;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
}

.tetris-stat span:last-child {
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.tetris-btn {
  padding: 10px 20px;
  background: linear-gradient(180deg, #e94560 0%, #c73e54 100%);
  border: none;
  border-radius: 6px;
  color: #ffffff;
  font-family: var(--font-system);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.tetris-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(233, 69, 96, 0.4);
}

.tetris-btn:active {
  transform: translateY(0);
}

.tetris-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.tetris-instructions {
  margin-top: 12px;
  font-size: 10px;
  color: #666;
  text-align: center;
}

/* === PONG GAME === */
.pong-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px;
  background: #0a0a0a;
  user-select: none;
}

.pong-scores {
  display: flex;
  justify-content: space-around;
  width: 100%;
  margin-bottom: 10px;
}

.pong-player {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pong-label {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.pong-score {
  font-size: 48px;
  font-weight: bold;
  color: #ffffff;
  font-family: var(--font-mono);
}

#pongCanvas {
  background: #111111;
  border: 2px solid #333;
  border-radius: 4px;
}

.pong-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 15px;
}

.pong-mode-select {
  display: flex;
  gap: 4px;
}

.pong-mode-btn {
  padding: 8px 16px;
  background: #222;
  border: 1px solid #444;
  border-radius: 4px;
  color: #888;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.pong-mode-btn:hover {
  background: #333;
  color: #fff;
}

.pong-mode-btn.active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.pong-btn {
  padding: 10px 32px;
  background: #ffffff;
  border: none;
  border-radius: 6px;
  color: #000000;
  font-family: var(--font-system);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.1s;
}

.pong-btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.pong-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

.pong-instructions {
  display: flex;
  gap: 30px;
  margin-top: 12px;
  font-size: 11px;
  color: #555;
}
