/* =============================================
   qrunk.lol — Dark Angular / OSK / TETR.IO Style
   Black & White Only. No gradients. No emojis.
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

:root {
  --bg: #000;
  --fg: #fff;
  --dim: #666;
  --border: #fff;
  --surface: #111;
  --surface2: #1a1a1a;
  --hover: #222;
  --active: #333;
  --accent: #fff;
  --font: 'Space Mono', monospace;
  --clip: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  --clip-sm: polygon(0 0, calc(100% - 5px) 0, 100% 5px, 100% 100%, 5px 100%, 0 calc(100% - 5px));
  --clip-lg: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

body {
  font-family: var(--font);
  font-size: 13px;
  background: var(--bg);
  color: var(--fg);
  overflow: hidden;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  height: 100vh;
  width: 100vw;
}

.hidden { display: none !important; }

/* ===== BOOT ===== */
#boot-screen {
  position: fixed; inset: 0;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  z-index: 99999;
  overflow: hidden;
}

.boot-blobs {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}

.blob1-path {
  animation: blob1-morph 4s ease-in-out infinite alternate;
}
.blob2-path {
  animation: blob2-morph 5s ease-in-out infinite alternate;
}
.blob3-path {
  animation: blob3-morph 3.5s ease-in-out infinite alternate;
}

@keyframes blob1-morph {
  0% { d: path("M150,300 C150,150 350,50 500,150 C650,250 750,100 850,200 C950,300 900,500 700,500 C500,500 400,550 300,450 C200,350 150,400 150,300Z"); }
  33% { d: path("M100,250 C120,100 300,20 520,120 C700,200 800,80 900,220 C980,350 850,520 650,530 C450,540 350,600 250,480 C150,360 80,380 100,250Z"); }
  66% { d: path("M180,350 C200,180 380,80 480,180 C580,280 720,120 830,250 C920,360 880,480 720,480 C560,480 450,520 320,430 C190,340 160,450 180,350Z"); }
  100% { d: path("M130,280 C140,120 320,30 530,140 C680,220 780,90 870,210 C960,330 910,510 710,520 C510,530 380,570 280,460 C180,350 120,410 130,280Z"); }
}

@keyframes blob2-morph {
  0% { d: path("M-50,200 C0,50 200,0 300,100 C400,200 350,350 250,400 C150,450 50,500 -50,350Z"); }
  33% { d: path("M-80,250 C-30,80 180,30 320,130 C430,220 380,380 270,430 C160,480 30,520 -80,400Z"); }
  66% { d: path("M-30,180 C20,30 220,-20 340,80 C440,170 370,330 260,390 C150,450 60,480 -30,320Z"); }
  100% { d: path("M-60,220 C-10,60 190,10 310,110 C410,210 360,360 250,410 C140,460 40,510 -60,370Z"); }
}

@keyframes blob3-morph {
  0% { d: path("M700,400 C750,300 900,250 1050,350 C1100,400 1050,550 950,580 C850,610 800,550 700,500Z"); }
  33% { d: path("M680,380 C720,270 880,220 1070,330 C1120,390 1080,560 970,600 C860,630 780,570 680,480Z"); }
  66% { d: path("M720,420 C770,320 920,280 1040,370 C1090,420 1040,570 930,590 C820,620 790,540 720,490Z"); }
  100% { d: path("M690,390 C740,280 890,240 1060,340 C1110,400 1060,560 950,590 C840,620 810,560 690,500Z"); }
}

.boot-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.boot-logo {
  font-family: var(--font);
  font-size: 64px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 6px;
  text-transform: uppercase;
  margin-bottom: 20px;
  text-shadow: 0 0 30px rgba(255,255,255,0.3);
  mix-blend-mode: difference;
}
.boot-logo span { font-weight: 400; opacity: 0.5; }

.boot-text {
  font-size: 12px;
  color: #999;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 16px;
  mix-blend-mode: difference;
}

.boot-bar-track {
  width: 300px;
  height: 2px;
  background: #333;
  margin: 0 auto;
  mix-blend-mode: difference;
}

.boot-bar-fill {
  height: 100%;
  width: 0%;
  background: #fff;
  transition: width 0.1s linear;
}

/* ===== BIRTHDAY BALLOONS ===== */
@keyframes bday-float {
  0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 1; }
  20% { opacity: 1; }
  50% { transform: translateY(-60vh) translateX(calc(var(--sway) * 0.5)) rotate(-5deg); opacity: 0.9; }
  80% { opacity: 0.7; }
  100% { transform: translateY(-120vh) translateX(var(--sway)) rotate(5deg); opacity: 0; }
}

/* ===== DESKTOP ===== */
#desktop {
  width: 100vw; height: 100vh;
  position: relative; overflow: hidden;
  background: #000;
}

#parallax-bg {
  position: absolute; inset: -60px;
  background-image: url('https://images.unsplash.com/photo-1534351590666-13e3e96b5017?w=1920&q=80');
  background-size: cover;
  background-position: center;
  filter: brightness(0.3) saturate(0);
  transition: transform 0.15s ease-out;
  z-index: 0;
}

#parallax-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1;
}

/* ===== DESKTOP ICONS ===== */
#desktop-icons {
  position: absolute;
  top: 12px; left: 12px;
  display: flex; flex-direction: column;
  flex-wrap: wrap; align-content: flex-start;
  gap: 4px;
  height: calc(100vh - 52px);
  z-index: 2;
}

.desktop-icon {
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  width: 76px; padding: 8px 4px;
  cursor: pointer;
  clip-path: var(--clip-sm);
  border: 1px solid transparent;
  transition: background 0.1s;
}

.desktop-icon:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.15);
}

.desktop-icon.selected {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.3);
}

.desktop-icon .di-svg {
  width: 36px; height: 36px;
  margin-bottom: 4px;
  color: #fff;
}

.desktop-icon .di-label {
  font-size: 11px;
  color: #fff;
  text-align: center;
  line-height: 1.2;
  text-shadow: 0 1px 3px #000;
  max-width: 72px;
  word-wrap: break-word;
}

/* ===== ANGULAR WINDOW ===== */
.window {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  clip-path: var(--clip-lg);
  display: flex; flex-direction: column;
  min-width: 220; min-height: 130;
  z-index: 10;
  animation: winOpen 0.12s ease-out;
}

@keyframes winOpen {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.window.maximized {
  top: 0 !important; left: 0 !important;
  width: 100vw !important;
  height: calc(100vh - 40px) !important;
  clip-path: none;
}

.window-titlebar {
  display: flex; align-items: center;
  padding: 0 12px;
  height: 28px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  cursor: grab;
  flex-shrink: 0;
}

.window.inactive .window-titlebar { opacity: 0.5; }

.window-titlebar .wt-icon {
  width: 14px; height: 14px;
  margin-right: 8px; color: #fff;
  flex-shrink: 0;
}

.window-titlebar .wt-title {
  flex: 1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window-controls {
  display: flex; gap: 2px; margin-left: auto;
}

.window-controls button {
  width: 22px; height: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: #fff;
  font-family: var(--font);
  font-size: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  clip-path: var(--clip-sm);
  transition: background 0.1s;
}

.window-controls button:hover { background: var(--hover); }
.window-controls button:active { background: var(--active); }
.wc-close:hover { background: #fff !important; color: #000 !important; }

/* Menu bar */
.window-menubar {
  display: flex; padding: 0;
  background: var(--surface);
  border-bottom: 1px solid #333;
  flex-shrink: 0;
}

.window-menubar .mi {
  padding: 4px 12px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
}
.window-menubar .mi:hover { background: #fff; color: #000; }

/* Body */
.window-body {
  flex: 1; overflow: auto;
  background: var(--surface);
  position: relative;
}

.window-body-inset {
  flex: 1;
  margin: 6px;
  border: 1px solid #333;
  background: var(--surface2);
  overflow: auto;
  position: relative;
}

/* Status bar */
.window-statusbar {
  padding: 3px 10px;
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 1px;
  text-transform: uppercase;
  border-top: 1px solid #333;
  background: var(--bg);
  flex-shrink: 0;
}

/* Resize */
.window-resize {
  position: absolute; bottom: 0; right: 0;
  width: 14px; height: 14px;
  cursor: nwse-resize;
}
.window-resize::after {
  content: '';
  position: absolute; bottom: 3px; right: 3px;
  width: 8px; height: 8px;
  border-right: 2px solid #555;
  border-bottom: 2px solid #555;
}

/* ===== TASKBAR ===== */
#taskbar {
  position: fixed; bottom: 0; left: 0;
  width: 100%; height: 40px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 4px;
  z-index: 9999;
  gap: 4px;
}

#start-btn {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  padding: 0 14px;
  height: 30px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  clip-path: var(--clip-sm);
  transition: background 0.1s;
  flex-shrink: 0;
}
#start-btn:hover { background: var(--hover); }
#start-btn.active { background: #fff; color: #000; }
#start-btn.active svg rect { fill: #000; }

#taskbar-apps {
  flex: 1;
  display: flex; gap: 3px;
  overflow: hidden; height: 30px;
}

.taskbar-app {
  font-family: var(--font);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0 12px;
  height: 30px;
  max-width: 170px; min-width: 60px;
  background: var(--surface);
  border: 1px solid #444;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  clip-path: var(--clip-sm);
  transition: background 0.1s;
}
.taskbar-app:hover { background: var(--hover); }
.taskbar-app.active {
  background: #fff; color: #000;
  border-color: #fff;
}
.taskbar-app .ta-icon { width: 12px; height: 12px; flex-shrink: 0; }
.taskbar-app.active .ta-icon { color: #000; }

#sys-tray {
  display: flex; align-items: center;
  padding: 0 12px; height: 30px;
  border: 1px solid #333;
  clip-path: var(--clip-sm);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--dim);
  flex-shrink: 0;
}

/* ===== START MENU ===== */
#start-menu {
  position: fixed; bottom: 40px; left: 0;
  width: 240px;
  background: var(--bg);
  border: 1px solid var(--border);
  clip-path: var(--clip);
  z-index: 10000;
}

.sm-header {
  padding: 10px 14px;
  font-size: 14px;
  letter-spacing: 4px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.sm-header b { opacity: 0.4; }

.sm-items { padding: 4px 0; }

.sm-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 14px;
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.08s;
}
.sm-item:hover { background: #fff; color: #000; }
.sm-item:hover .sm-icon { color: #000; }

.sm-icon { width: 16px; height: 16px; color: #fff; flex-shrink: 0; }

.sm-sep {
  height: 1px;
  background: #333;
  margin: 3px 10px;
}

/* ===== CONTEXT MENU ===== */
#context-menu {
  position: fixed;
  background: var(--bg);
  border: 1px solid var(--border);
  clip-path: var(--clip-sm);
  z-index: 10001;
  min-width: 180px;
  padding: 4px 0;
}

.ctx-item {
  padding: 6px 16px;
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
}
.ctx-item:hover { background: #fff; color: #000; }

.ctx-sep {
  height: 1px;
  background: #333;
  margin: 2px 8px;
}

/* ===== SHUTDOWN ===== */
#shutdown-screen {
  position: fixed; inset: 0;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  z-index: 99999;
}
.sd-text {
  font-size: 20px;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 16px;
}
.sd-sub { font-size: 12px; color: #666; }
.sd-sub a { color: #fff; text-decoration: underline; cursor: pointer; }

/* ===== DIALOG ===== */
.dialog-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 10002;
  display: flex; align-items: center; justify-content: center;
}

.dialog-box {
  background: var(--bg);
  border: 1px solid var(--border);
  clip-path: var(--clip);
  min-width: 300px;
  max-width: 400px;
}

.dialog-titlebar {
  display: flex; align-items: center;
  padding: 0 12px; height: 26px;
  border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.dialog-titlebar span { flex: 1; }
.dialog-titlebar button {
  background: none; border: 1px solid #fff;
  color: #fff; width: 18px; height: 16px;
  font-size: 10px; cursor: pointer;
  clip-path: var(--clip-sm);
}
.dialog-titlebar button:hover { background: #fff; color: #000; }

.dialog-body {
  padding: 20px 16px;
  font-size: 13px;
  line-height: 1.6;
}

.dialog-buttons {
  padding: 8px 16px 14px;
  display: flex; justify-content: flex-end; gap: 8px;
}

.win-btn {
  font-family: var(--font);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 5px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: #fff;
  cursor: pointer;
  clip-path: var(--clip-sm);
  transition: background 0.1s;
}
.win-btn:hover { background: #fff; color: #000; }

/* ===== APP: NOTEPAD ===== */
.notepad-textarea {
  width: 100%; height: 100%;
  border: none; resize: none;
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  padding: 8px;
  outline: none;
  background: var(--surface2);
  color: #fff;
  caret-color: #fff;
}

/* ===== APP: TERMINAL ===== */
.terminal-body {
  background: #000;
  color: #fff;
  font-family: var(--font);
  font-size: 12px;
  padding: 8px;
  height: 100%;
  overflow-y: auto;
}

.terminal-line {
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.5;
}

.terminal-input-line {
  display: flex; align-items: center;
}

.terminal-prompt { color: #fff; white-space: pre; }

.terminal-input {
  background: transparent;
  border: none; color: #fff;
  font-family: var(--font);
  font-size: 12px;
  outline: none; flex: 1;
  caret-color: #fff;
}

/* ===== APP: PAINT ===== */
.paint-container {
  display: flex; flex-direction: column;
  height: 100%;
}

.paint-toolbar {
  display: flex; padding: 4px; gap: 2px;
  background: var(--surface);
  border-bottom: 1px solid #333;
  flex-shrink: 0;
}

.paint-tool {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid #444;
  color: #fff;
  cursor: pointer;
  clip-path: var(--clip-sm);
  transition: background 0.08s;
}
.paint-tool svg { width: 14px; height: 14px; }
.paint-tool:hover { background: var(--hover); }
.paint-tool.active { background: #fff; color: #000; border-color: #fff; }

.paint-colors {
  display: flex; padding: 4px; gap: 2px;
  background: var(--surface);
  border-top: 1px solid #333;
  flex-shrink: 0; flex-wrap: wrap;
}

.paint-color {
  width: 18px; height: 18px;
  border: 1px solid #444;
  cursor: pointer;
  clip-path: var(--clip-sm);
}
.paint-color.active { border: 2px solid #fff; }

.paint-canvas-container {
  flex: 1; overflow: auto;
  background: #0a0a0a;
  display: flex; align-items: flex-start;
  justify-content: flex-start;
  padding: 6px;
}

.paint-canvas {
  background: #fff;
  cursor: crosshair;
  image-rendering: pixelated;
}

/* ===== APP: EXPLORER ===== */
.explorer-container {
  display: flex; flex-direction: column;
  height: 100%;
}

.explorer-toolbar {
  display: flex; padding: 4px; gap: 4px;
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid #333;
  flex-shrink: 0;
}

.explorer-path {
  flex: 1;
  font-family: var(--font);
  font-size: 11px;
  padding: 4px 8px;
  border: 1px solid #444;
  background: var(--surface2);
  color: #fff;
}

.explorer-content {
  flex: 1; padding: 8px;
  display: flex; flex-wrap: wrap; gap: 8px;
  align-content: flex-start;
  overflow-y: auto;
  background: var(--surface2);
  margin: 6px;
  border: 1px solid #333;
}

.explorer-item {
  display: flex; flex-direction: column;
  align-items: center; width: 76px; padding: 6px;
  cursor: pointer; text-align: center;
  border: 1px solid transparent;
  clip-path: var(--clip-sm);
  transition: background 0.08s;
}
.explorer-item:hover { background: rgba(255,255,255,0.06); }
.explorer-item.selected { background: #fff; color: #000; border-color: #fff; }
.explorer-item .ei-icon { width: 32px; height: 32px; margin-bottom: 4px; color: #fff; }
.explorer-item.selected .ei-icon { color: #000; }
.explorer-item .ei-name { font-size: 10px; word-wrap: break-word; max-width: 72px; }

/* ===== APP: MINESWEEPER ===== */
.minesweeper-container {
  padding: 8px;
  display: flex; flex-direction: column;
  align-items: center;
}

.mines-header {
  display: flex; align-items: center;
  justify-content: space-between;
  width: 100%; margin-bottom: 8px;
  padding: 4px 8px;
  border: 1px solid #333;
  background: var(--surface);
}

.mines-counter, .mines-timer {
  font-family: var(--font);
  font-size: 18px; color: #fff;
  background: #000;
  border: 1px solid #333;
  padding: 2px 8px;
  min-width: 50px;
  text-align: center;
}

.mines-face {
  font-size: 16px;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid #fff;
  color: #fff;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  clip-path: var(--clip-sm);
  font-family: var(--font);
}
.mines-face:hover { background: #fff; color: #000; }

.mines-grid {
  display: grid;
  border: 1px solid #fff;
}

.mines-cell {
  width: 24px; height: 24px;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid #333;
  font-family: var(--font);
  color: #fff;
  transition: background 0.05s;
}
.mines-cell:hover { background: var(--hover); }
.mines-cell.revealed { background: var(--bg); border-color: #222; }
.mines-cell.mine-hit { background: #fff; color: #000; }
.mines-cell.flagged { color: #fff; }
.mines-cell[data-num="1"] { color: #aaa; }
.mines-cell[data-num="2"] { color: #ccc; }
.mines-cell[data-num="3"] { color: #999; }
.mines-cell[data-num="4"] { color: #eee; }
.mines-cell[data-num="5"] { color: #bbb; }
.mines-cell[data-num="6"] { color: #ddd; }
.mines-cell[data-num="7"] { color: #888; }
.mines-cell[data-num="8"] { color: #fff; }

/* ===== APP: MEDIA PLAYER (WMP style) ===== */
.wmp {
  display: flex; flex-direction: column;
  height: 100%; background: var(--bg);
  font-family: var(--font);
}

/* tabs */
.wmp-tabs {
  display: flex; gap: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 4px;
  flex-shrink: 0;
}
.wmp-tab {
  padding: 6px 14px;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #666;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.wmp-tab:hover { color: #aaa; }
.wmp-tab.active {
  color: #fff;
  border-bottom-color: #fff;
}

/* main area */
.wmp-main {
  flex: 1; display: flex;
  overflow: hidden;
  min-height: 0;
}

/* visualization */
.wmp-vis {
  flex: 1; background: #000;
  overflow: hidden; position: relative;
}
.wmp-canvas { width: 100%; height: 100%; display: block; }

/* sidebar */
.wmp-sidebar {
  width: 200px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.wmp-art {
  width: 100%; aspect-ratio: 1;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.wmp-art-icon { width: 48px; height: 48px; }
.wmp-art-img { width: 100%; height: 100%; object-fit: cover; }

.wmp-track-info {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.wmp-track-title {
  font-size: 11px; font-weight: 700;
  color: #fff; letter-spacing: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 2px;
}
.wmp-track-artist {
  font-size: 10px; color: #999;
  letter-spacing: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.wmp-playlist-header {
  font-size: 9px; letter-spacing: 2px;
  text-transform: uppercase;
  color: #555; padding: 8px 12px 4px;
  flex-shrink: 0;
}

.wmp-playlist {
  flex: 1; overflow-y: auto;
  padding: 0 8px 8px;
}
.wmp-pl-item {
  font-size: 10px; color: #888;
  padding: 4px 6px;
  letter-spacing: 0.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: default;
  transition: background 0.1s;
}
.wmp-pl-item:hover { background: var(--hover); }
.wmp-pl-item.active { color: #fff; }
.wmp-pl-item.loading { color: #444; font-style: italic; }
.wmp-pl-bullet { color: #fff; margin-right: 2px; }

/* controls */
.wmp-controls {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0;
  flex-shrink: 0;
}
.wmp-progress {
  height: 3px; background: #333;
  cursor: pointer;
}
.wmp-progress-fill {
  height: 100%; width: 0; background: #fff;
  transition: width 0.3s linear;
}
.wmp-ctrl-row {
  display: flex; align-items: center;
  padding: 6px 12px;
  gap: 8px;
}
.wmp-ctrl-left {
  flex: 1; display: flex; align-items: center; gap: 8px;
  min-width: 0;
}
.wmp-now-label {
  font-size: 10px; color: #888;
  letter-spacing: 0.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wmp-time {
  font-size: 10px; color: #555;
  letter-spacing: 1px;
  flex-shrink: 0;
}
.wmp-ctrl-btns {
  display: flex; gap: 4px;
  flex-shrink: 0;
}
.wmp-btn {
  width: 28px; height: 28px;
  background: none;
  border: 1px solid #555;
  color: #888;
  font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  clip-path: var(--clip-sm);
  transition: background 0.1s, color 0.1s;
}
.wmp-btn:hover { background: #fff; color: #000; border-color: #fff; }
.wmp-btn-play {
  width: 36px; height: 36px;
  border-color: #fff;
  color: #fff;
  font-size: 13px;
}
.wmp-btn-play:hover { background: #fff; color: #000; }
.wmp-ctrl-right {
  flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 6px;
}
.wmp-vol-icon { color: #555; flex-shrink: 0; }
.wmp-vol {
  width: 60px; height: 3px;
  background: #333;
}
.wmp-vol-fill {
  width: 70%; height: 100%;
  background: #fff;
}

/* ===== APP: BROWSER ===== */
.browser-container {
  display: flex; flex-direction: column;
  height: 100%;
}

.browser-toolbar {
  display: flex; padding: 4px; gap: 4px;
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid #333;
  flex-shrink: 0;
}

.browser-nav-btn {
  font-family: var(--font);
  font-size: 12px; color: #fff;
  width: 26px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid #444;
  cursor: pointer;
  clip-path: var(--clip-sm);
}
.browser-nav-btn:hover { background: #fff; color: #000; }

.browser-url {
  flex: 1;
  font-family: var(--font);
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid #444;
  background: var(--surface2);
  color: #fff;
  outline: none;
}

.browser-go {
  font-family: var(--font);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 10px;
  background: var(--surface);
  border: 1px solid #555;
  color: #fff;
  cursor: pointer;
  clip-path: var(--clip-sm);
}
.browser-go:hover { background: #fff; color: #000; }

.browser-content {
  flex: 1;
  background: var(--surface2);
  margin: 6px;
  border: 1px solid #333;
  overflow-y: auto;
  padding: 16px;
  font-family: var(--font);
  font-size: 12px;
  line-height: 1.7;
  color: #ccc;
}

.browser-content h1 {
  font-size: 18px; color: #fff;
  letter-spacing: 3px; text-transform: uppercase;
  margin-bottom: 12px;
  border-bottom: 1px solid #333;
  padding-bottom: 8px;
}

.browser-content h2 {
  font-size: 14px; color: #fff;
  letter-spacing: 2px; text-transform: uppercase;
  margin: 14px 0 6px;
}

.browser-content p { margin-bottom: 8px; }

.browser-content a {
  color: #fff;
  text-decoration: underline;
  cursor: pointer;
}
.browser-content a:hover { background: #fff; color: #000; }

.browser-content hr {
  border: none;
  border-top: 1px solid #333;
  margin: 10px 0;
}

.browser-content .blink-text {
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ===== APP: COOKIE CLICKER ===== */
.ck-container {
  display: flex; height: 100%; overflow: hidden;
}
.ck-left {
  flex: 0 0 260px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  border-right: 1px solid #333; background: var(--surface);
}
.ck-count { text-align: center; }
.ck-num {
  font-size: 36px; font-weight: 700; letter-spacing: 4px; display: block;
}
.ck-per-sec {
  font-size: 10px; letter-spacing: 2px; color: var(--dim); text-transform: uppercase; margin-top: 4px;
}
.ck-cookie-wrap { position: relative; }
.ck-cookie {
  width: 160px; height: 160px; cursor: pointer;
  transition: transform 0.08s; display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 0 16px rgba(255,255,255,0.25));
}
.ck-cookie svg { width: 100%; height: 100%; }
.ck-cookie:hover { transform: scale(1.08); filter: drop-shadow(0 0 24px rgba(255,255,255,0.4)); }
.ck-cookie.ck-clicked { transform: scale(0.9); }
.ck-float {
  position: absolute; font-size: 18px; font-weight: 700; color: #fff;
  pointer-events: none; animation: ck-float-up 0.8s ease-out forwards;
  text-shadow: 0 0 6px rgba(255,255,255,0.5);
}
@keyframes ck-float-up {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-60px); }
}
.ck-right {
  flex: 1; overflow-y: auto; padding: 10px; background: var(--bg);
}
.ck-shop-title, .ck-stats-title {
  font-size: 11px; letter-spacing: 3px; color: var(--dim); margin-bottom: 8px;
  text-transform: uppercase; border-bottom: 1px solid #333; padding-bottom: 4px;
}
.ck-stats-title { margin-top: 12px; }
.ck-stats {
  font-size: 10px; letter-spacing: 1px; color: var(--dim); line-height: 2;
}
.ck-item {
  padding: 8px 10px; margin-bottom: 4px; background: var(--surface);
  border: 1px solid #333; cursor: pointer; clip-path: var(--clip-sm);
  transition: all 0.1s;
}
.ck-item:hover { border-color: #888; background: var(--surface2); }
.ck-item.ck-locked { opacity: 0.35; cursor: default; }
.ck-item.ck-locked:hover { border-color: #333; background: var(--surface); }
.ck-item-name {
  font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
}
.ck-item-icon { font-size: 14px; }
.ck-item-owned { color: var(--dim); font-size: 10px; }
.ck-item-info { font-size: 9px; color: var(--dim); letter-spacing: 1px; margin-top: 2px; }
.ck-item-cost {
  font-size: 11px; font-weight: 700; margin-top: 2px; letter-spacing: 1px;
}
.ck-shop { max-height: 280px; overflow-y: auto; }

/* ===== APP: MUSIC MAKER ===== */
.piano-container {
  display: flex; flex-direction: column; height: 100%; background: var(--surface); user-select: none;
}
.piano-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-bottom: 1px solid #333; flex-shrink: 0;
}
.piano-label {
  font-size: 10px; letter-spacing: 2px; color: var(--dim); text-transform: uppercase;
}
.piano-instrument {
  font-family: var(--font); font-size: 11px; padding: 3px 6px;
  background: var(--surface2); color: #fff; border: 1px solid #444;
  clip-path: var(--clip-sm); cursor: pointer; letter-spacing: 1px;
}
.piano-oct-btn {
  font-family: var(--font); font-size: 14px; width: 24px; height: 24px;
  background: var(--surface2); color: #fff; border: 1px solid #444;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  clip-path: var(--clip-sm);
}
.piano-oct-btn:hover { background: var(--hover); }
.piano-oct-val {
  font-size: 14px; font-weight: 700; min-width: 16px; text-align: center;
}
.piano-vol {
  width: 60px; accent-color: #fff;
}
.piano-keys {
  flex: 1; display: flex; position: relative; padding: 0; overflow: hidden;
}
.piano-key {
  display: flex; align-items: flex-end; justify-content: center;
  cursor: pointer; position: relative; transition: background 0.05s;
  padding-bottom: 10px;
}
.piano-white {
  flex: 1; background: #ddd; border-right: 1px solid #999; border-bottom: 2px solid #aaa;
  color: #555; z-index: 1; min-width: 0;
}
.piano-white:last-child { border-right: none; }
.piano-white:hover { background: #ccc; }
.piano-white.piano-active { background: #999; }
.piano-black {
  width: 36px; flex: 0 0 36px; background: #111; border: 1px solid #333;
  margin: 0 -18px; z-index: 2; height: 58%;
  color: #666; border-bottom: 2px solid #222;
}
.piano-black:hover { background: #222; }
.piano-black.piano-active { background: #444; }
.piano-key-label {
  font-size: 10px; font-family: var(--font); letter-spacing: 1px;
  pointer-events: none;
}
.piano-hint {
  font-size: 9px; letter-spacing: 2px; color: #555; text-align: center;
  padding: 6px; text-transform: uppercase; flex-shrink: 0; border-top: 1px solid #333;
}

/* ===== APP: CHESS ===== */
.chess-container { padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.chess-status {
  font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--dim);
}
.chess-board {
  display: grid; grid-template-columns: repeat(8, 1fr); width: 480px; height: 480px;
  border: 2px solid #555;
}
.chess-sq {
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; cursor: pointer; user-select: none;
  transition: background 0.1s;
}
.chess-light { background: #2a2a2a; }
.chess-dark { background: #111; }
.chess-sq:hover { outline: 1px solid #888 inset; }
.chess-selected { background: #444 !important; box-shadow: inset 0 0 8px rgba(255,255,255,0.3); }
.chess-valid { position: relative; }
.chess-valid::after {
  content: ''; position: absolute;
  width: 14px; height: 14px; border-radius: 50%;
  background: rgba(255,255,255,0.25);
}
.chess-piece { cursor: grab; }
.chess-controls {
  display: flex; align-items: center; gap: 12px; font-size: 18px;
}
.chess-captured-w, .chess-captured-b { font-size: 16px; letter-spacing: 2px; }
.chess-reset { font-size: 10px; }

/* ===== APP: UNDERTALE ===== */
.ut-container { background: #000; height: 100%; display: flex; }
.ut-iframe { width: 100%; height: 100%; border: none; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb {
  background: #333;
  border: 1px solid #555;
}
::-webkit-scrollbar-thumb:hover { background: #555; }

::selection { background: #fff; color: #000; }

/* ===== WELCOME WINDOW ===== */
.welcome-body {
  padding: 24px;
  font-family: var(--font);
}

.welcome-body h1 {
  font-size: 20px;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 16px;
  border-bottom: 1px solid #333;
  padding-bottom: 12px;
}

.welcome-body p {
  font-size: 13px;
  line-height: 1.8;
  color: #888;
  margin-bottom: 10px;
}

.welcome-body b {
  color: #fff;
}

.welcome-link {
  color: #fff;
  text-decoration: underline;
  cursor: pointer;
}
.welcome-link:hover {
  background: #fff;
  color: #000;
}

/* Game links */
.welcome-body h2 {
  font-size: 14px;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: #666;
}

.game-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.game-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid #222;
  color: #fff;
  text-decoration: none;
  font-family: var(--font);
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  clip-path: var(--clip-sm);
  transition: background 0.08s, border-color 0.08s;
}

.game-link:hover {
  background: #fff;
  color: #000;
  border-color: #fff;
}
.game-link:hover .game-logo { color: #000; }
.game-link:hover .game-logo-text { background: #000; color: #fff; }
.game-link:hover .game-tag { color: #444; }

.game-logo {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #fff;
  object-fit: contain;
}

.browser-embed {
  flex: 1;
  overflow: hidden;
}

.browser-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #111;
}

.game-logo-text {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #000;
  font-weight: 700;
  font-size: 13px;
  filter: none;
}

.game-tag {
  font-size: 9px;
  color: #555;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-left: auto;
}

.game-sep {
  height: 1px;
  background: #333;
  margin: 16px 0;
}

/* ===== SOCIAL LINKS ===== */
.social-links {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

.social-link {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #333;
  background: var(--surface);
  color: #888;
  cursor: pointer;
  clip-path: var(--clip-sm);
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.social-link:hover {
  background: #fff;
  color: #000;
  border-color: #fff;
}
.social-icon {
  width: 18px;
  height: 18px;
}

/* ===== PROJECT CARDS ===== */
.project-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-card {
  border: 1px solid #333;
  padding: 14px 16px;
  clip-path: var(--clip);
  background: var(--surface);
  transition: border-color 0.15s;
}
.project-card:hover {
  border-color: #666;
}

.project-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.project-name {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
}

.project-ext-link,
.project-gh {
  margin-left: auto;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #888;
  cursor: pointer;
  border: 1px solid #333;
  background: none;
  font-size: 10px;
  transition: color 0.1s, border-color 0.1s, background 0.1s;
  text-decoration: none;
  clip-path: var(--clip-sm);
}
.project-ext-link:hover,
.project-gh:hover {
  color: #000;
  background: #fff;
  border-color: #fff;
}
.project-gh svg {
  width: 12px;
  height: 12px;
}

.project-desc {
  font-family: var(--font);
  font-size: 11px;
  line-height: 1.6;
  color: #999;
  letter-spacing: 0.5px;
  margin: 0 0 10px 0;
}

.project-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-langs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.lang-badge {
  font-family: var(--font);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 2px 8px;
  clip-path: var(--clip-sm);
  border: 1px solid;
}

/* Language colors */
.lang-vue      { color: #42b883; border-color: #42b883; background: rgba(66,184,131,0.1); }
.lang-node     { color: #68a063; border-color: #68a063; background: rgba(104,160,99,0.1); }
.lang-swift    { color: #f05138; border-color: #f05138; background: rgba(240,81,56,0.1); }
.lang-js       { color: #f7df1e; border-color: #f7df1e; background: rgba(247,223,30,0.1); }
.lang-ts       { color: #3178c6; border-color: #3178c6; background: rgba(49,120,198,0.1); }
.lang-python   { color: #3776ab; border-color: #3776ab; background: rgba(55,118,171,0.1); }
.lang-rust     { color: #dea584; border-color: #dea584; background: rgba(222,165,132,0.1); }
.lang-go       { color: #00add8; border-color: #00add8; background: rgba(0,173,216,0.1); }
.lang-c        { color: #a8b9cc; border-color: #a8b9cc; background: rgba(168,185,204,0.1); }
.lang-cpp      { color: #6295cb; border-color: #6295cb; background: rgba(98,149,203,0.1); }
.lang-html     { color: #e34c26; border-color: #e34c26; background: rgba(227,76,38,0.1); }
.lang-css      { color: #563d7c; border-color: #563d7c; background: rgba(86,61,124,0.1); }
.lang-java     { color: #b07219; border-color: #b07219; background: rgba(176,114,25,0.1); }
.lang-kotlin   { color: #a97bff; border-color: #a97bff; background: rgba(169,123,255,0.1); }
.lang-ruby     { color: #cc342d; border-color: #cc342d; background: rgba(204,52,45,0.1); }
.lang-lua      { color: #000080; border-color: #5566aa; background: rgba(85,102,170,0.1); }

.project-oss {
  margin-left: auto;
  font-family: var(--font);
  font-size: 8px;
  letter-spacing: 2px;
  color: #555;
  text-transform: uppercase;
}

/* ===== SWAN CLAN ===== */
.swan-container {
  padding: 20px;
  overflow-y: auto;
  height: 100%;
}

.swan-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.swan-logo {
  width: 64px;
  height: 64px;
}

.swan-title {
  font-family: var(--font);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 6px;
  color: #4a9eff;
  text-align: center;
}

.swan-streak {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #333;
  background: var(--surface);
  clip-path: var(--clip);
  margin-bottom: 16px;
}

.swan-fire {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.swan-streak-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.swan-streak-label {
  font-family: var(--font);
  font-size: 9px;
  letter-spacing: 3px;
  color: #666;
  text-transform: uppercase;
}

.swan-streak-num {
  font-family: var(--font);
  font-size: 28px;
  font-weight: 700;
  color: #ff6b35;
  line-height: 1;
}

.swan-sep {
  height: 1px;
  background: #333;
  margin: 16px 0;
}

.swan-section-title {
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #666;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.swan-players {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.swan-player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid #222;
  clip-path: var(--clip-sm);
  transition: background 0.08s, border-color 0.08s;
}
.swan-player:hover {
  background: var(--hover);
  border-color: #444;
}

.swan-flag {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.swan-flag img {
  width: 20px;
  height: 20px;
}

.swan-name {
  font-family: var(--font);
  font-size: 12px;
  letter-spacing: 2px;
  color: #fff;
  text-transform: uppercase;
}

/* ===== XP NOTIFICATION BALLOON ===== */
#xp-balloon {
  position: fixed;
  bottom: 50px;
  right: 12px;
  width: 280px;
  background: #111;
  border: 1px solid #555;
  font-family: var(--font);
  z-index: 10001;
  clip-path: var(--clip);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
#xp-balloon.balloon-in {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
#xp-balloon.balloon-out {
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
}
.balloon-pointer {
  position: absolute;
  bottom: -7px;
  right: 30px;
  width: 14px;
  height: 7px;
  overflow: hidden;
}
.balloon-pointer::after {
  content: '';
  position: absolute;
  top: 0; left: 2px;
  width: 10px; height: 10px;
  background: #111;
  border: 1px solid #555;
  transform: rotate(45deg);
  transform-origin: top left;
}
.balloon-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #333;
  background: #1a1a1a;
}
.balloon-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-flex;
  color: #fff;
}
.balloon-icon svg {
  width: 100%;
  height: 100%;
}
.balloon-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  flex: 1;
}
.balloon-close {
  background: none;
  border: 1px solid #555;
  color: #fff;
  width: 18px;
  height: 18px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  clip-path: var(--clip-sm);
  transition: background 0.1s;
}
.balloon-close:hover {
  background: #fff;
  color: #000;
}
.balloon-body {
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.6;
  color: #aaa;
  letter-spacing: 0.5px;
}

/* ===== MEDAL POPUP ===== */
.medal-popup {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #0a0a0a;
  border: 1px solid #333;
  padding: 12px 20px 12px 14px;
  clip-path: var(--clip-sm);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s;
  pointer-events: none;
  min-width: 260px;
  max-width: 400px;
}
.medal-popup.medal-in {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.medal-popup.medal-out {
  transform: translateX(-50%) translateY(-40px);
  opacity: 0;
}
.medal-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  text-shadow: 0 0 8px currentColor;
}
.medal-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.medal-rank {
  font-size: 8px;
  letter-spacing: 3px;
  font-weight: bold;
}
.medal-name {
  font-size: 13px;
  letter-spacing: 1px;
  color: #fff;
}
.medal-desc {
  font-size: 9px;
  color: #666;
  letter-spacing: 0.5px;
}

/* ===== INK BALL ===== */
.ib-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #000;
}
.ib-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.ib-info {
  display: flex;
  gap: 16px;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--fg);
}
.ib-new-btn {
  background: var(--surface2);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 3px 12px;
  font-family: inherit;
  font-size: 10px;
  cursor: pointer;
  letter-spacing: 1px;
  clip-path: var(--clip-sm);
}
.ib-new-btn:hover {
  background: #fff;
  color: #000;
}
.ib-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  cursor: crosshair;
  background: #080808;
}
.ib-status {
  padding: 5px 10px;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: #666;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* ===== SNAKE ===== */
.snake-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #000;
}
.snake-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--fg);
  gap: 12px;
}
.snake-new-btn {
  background: var(--surface2);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 3px 12px;
  font-family: inherit;
  font-size: 10px;
  cursor: pointer;
  letter-spacing: 1px;
  clip-path: var(--clip-sm);
}
.snake-new-btn:hover { background: #fff; color: #000; }
.snake-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  background: #080808;
}
.snake-status {
  padding: 5px 10px;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: #666;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* ===== 2048 ===== */
.g2048-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #000;
}
.g2048-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--fg);
  gap: 12px;
}
.g2048-new-btn {
  background: var(--surface2);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 3px 12px;
  font-family: inherit;
  font-size: 10px;
  cursor: pointer;
  letter-spacing: 1px;
  clip-path: var(--clip-sm);
}
.g2048-new-btn:hover { background: #fff; color: #000; }
.g2048-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 12px;
  flex: 1;
  aspect-ratio: 1;
  max-height: calc(100% - 70px);
  box-sizing: border-box;
  align-self: center;
  width: 100%;
}
.g2048-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Mono', monospace;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 1px;
  border: 1px solid #222;
  aspect-ratio: 1;
  transition: background 0.1s, color 0.1s;
  clip-path: var(--clip-sm);
}
.g2048-tile-filled {
  animation: g2048-pop 0.15s ease-out;
}
.g2048-tile-big {
  font-size: 16px;
}
@keyframes g2048-pop {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}
.g2048-status {
  padding: 5px 10px;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: #666;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* ===== WINDOWS PHONE 8 MOBILE UI ===== */

/* Status bar */
.wp8-statusbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 28px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 12px;
  z-index: 9999;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: #fff;
}
.wp8-sb-clock {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
}

/* Tile wrapper (scrollable area) */
.wp8-tile-wrap {
  position: fixed;
  top: 28px;
  left: 0; right: 0;
  bottom: 50px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 16px 10px 40px 16px;
  background: #000;
}

/* Tile grid — WP8 uses a 6-column small-tile grid */
.wp8-tile-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  max-width: 400px;
  margin: 0 auto;
}

/* Tile sizes */
.wp8-tile {
  background: #1a1a1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.08s, background 0.12s;
  -webkit-tap-highlight-color: transparent;
  aspect-ratio: 1;
}
.wp8-tile:active {
  transform: scale(0.93);
  background: #333;
}

/* Small = 1x1 (2 grid cols) */
.wp8-tile-sm {
  grid-column: span 2;
}

/* Medium = 2x2 (3 grid cols) */
.wp8-tile-med {
  grid-column: span 3;
  aspect-ratio: 1;
}

/* Wide = 4x2 (6 grid cols) */
.wp8-tile-wide {
  grid-column: span 6;
  aspect-ratio: 3 / 1;
  flex-direction: row;
  gap: 12px;
  padding: 0 16px;
}

.wp8-tile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.wp8-tile-sm .wp8-tile-icon svg { width: 24px; height: 24px; }
.wp8-tile-med .wp8-tile-icon svg { width: 36px; height: 36px; }
.wp8-tile-wide .wp8-tile-icon svg { width: 30px; height: 30px; }

.wp8-tile-label {
  position: absolute;
  bottom: 5px;
  left: 7px;
  font-size: 10px;
  font-family: 'Space Mono', monospace;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.5px;
  text-transform: lowercase;
}
.wp8-tile-wide .wp8-tile-label {
  position: static;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
}

/* All apps arrow */
.wp8-all-apps-arrow {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 0 16px;
  color: #666;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.wp8-all-apps-arrow:active { color: #fff; }

/* Bottom navbar */
.wp8-navbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 50px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  z-index: 9999;
  border-top: 1px solid #111;
}
.wp8-nav-btn {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 8px;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.1s;
}
.wp8-nav-btn:active { color: #fff; }

/* All apps panel */
.wp8-allapps {
  position: fixed;
  top: 28px; left: 0; right: 0; bottom: 50px;
  background: #000;
  z-index: 9000;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  animation: wp8-slide-in 0.2s ease-out;
}
@keyframes wp8-slide-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.wp8-aa-header {
  padding: 20px 20px 12px;
  font-size: 22px;
  letter-spacing: 4px;
  color: #fff;
  font-family: 'Space Mono', monospace;
}
.wp8-aa-list {
  padding: 0 12px;
}
.wp8-aa-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 8px;
  border-bottom: 1px solid #111;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.1s;
}
.wp8-aa-item:active { background: #1a1a1a; }
.wp8-aa-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  background: #1a1a1a;
  color: #fff;
}
.wp8-aa-icon svg { width: 22px; height: 22px; }
.wp8-aa-label {
  font-size: 14px;
  color: #ccc;
  font-family: 'Space Mono', monospace;
  letter-spacing: 0.5px;
}

/* Fullscreen windows on mobile */
.wp8-fullscreen {
  position: fixed !important;
  top: 28px !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 50px !important;
  width: auto !important;
  height: auto !important;
  border: none !important;
  clip-path: none !important;
  animation: wp8-win-in 0.15s ease-out;
}
@keyframes wp8-win-in {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.wp8-fullscreen .window-titlebar {
  border-radius: 0;
}
.wp8-fullscreen .wc-min,
.wp8-fullscreen .wc-max,
.wp8-fullscreen .window-resize {
  display: none !important;
}
.wp8-fullscreen .window-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Hide desktop elements in mobile mode */
.wp8-mode #desktop {
  background: #000;
}
.wp8-mode #parallax-bg,
.wp8-mode #parallax-overlay {
  display: none !important;
}

/* Mobile-specific overrides for game canvases */
.wp8-mode .snake-canvas,
.wp8-mode .ib-canvas {
  max-width: 100%;
  height: auto !important;
  aspect-ratio: 1;
}
.wp8-mode .g2048-board {
  max-width: 100%;
}

/* Scrollbar hide for mobile */
.wp8-tile-wrap::-webkit-scrollbar,
.wp8-allapps::-webkit-scrollbar {
  display: none;
}
.wp8-tile-wrap, .wp8-allapps {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
