.icons { grid-auto-flow: column; grid-template-rows: repeat(6, auto); gap: 14px 6px; }

.taskbar .hire-link { display: inline-flex; align-items: center; height: 100%; padding: 0 12px; border: 2px solid; border-color: #fff var(--shade) var(--shade) #fff; background: #ffe600; color: #000; font-size: 18px; font-weight: 700; letter-spacing: 0.06em; text-decoration: none; }
.taskbar .hire-link:active { border-color: var(--shade) #fff #fff var(--shade); }
.hire-head { margin: 0 0 8px; font-family: var(--pix); font-size: 16px; color: var(--blue); }
.hire-body p { margin: 0 0 10px; }
.hire-points { margin: 0 0 14px; padding-left: 20px; }
.hire-points li { margin-bottom: 4px; }
.hire-body .actions { margin: 0; }
.icon-terminal { background: #000; background-image: linear-gradient(#5dff5d 0 0); background-size: 8px 2px; background-position: 2px 8px; background-repeat: no-repeat; }
.icon-mines { background: #c0c0c0; background-image: radial-gradient(circle, #000 0 3px, transparent 3.5px); }
.icon-hire { background: #ffe600; background-image: linear-gradient(#000 0 0); background-size: 8px 3px; background-position: 2px 3px; background-repeat: no-repeat; }
.icon-display { background: linear-gradient(#1084d0 0 60%, #c0c0c0 60%); }

.tray-button { display: inline-grid; place-items: center; width: 36px; height: 100%; padding: 0; }
.tray-button:not([aria-pressed="true"]) .waves { display: none; }
.tray-button[aria-pressed="true"] .mute { display: none; }

.grip { position: absolute; right: 2px; bottom: 2px; width: 16px; height: 16px; cursor: nwse-resize; touch-action: none; background: linear-gradient(135deg, transparent 0 48%, var(--shade) 48% 56%, transparent 56% 66%, var(--shade) 66% 74%, transparent 74% 84%, var(--shade) 84% 92%, transparent 92%); }
.window.maximized .grip { display: none; }
.resizing, .resizing * { user-select: none; }
.window.resized { width: var(--resized-w); }
.window.resized:not(.maximized) .window-body { height: var(--body-h); max-height: none; }
.window.resized:not(.maximized) .explorer-body,
.window.maximized .explorer-body { grid-template-rows: minmax(0, 1fr); }
.window.resized:not(.maximized) .explorer-list,
.window.resized:not(.maximized) .explorer-detail,
.window.maximized .explorer-list,
.window.maximized .explorer-detail { max-height: none; }

.terminal-body { display: flex; flex-direction: column; height: 340px; padding: 8px 10px; background: #000; color: #c0c0c0; font-size: 21px; overflow: hidden; }
.window.maximized .terminal-body { height: auto; }
.terminal-log { flex: 1; min-height: 0; overflow-y: auto; }
.terminal-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.terminal-line.echo { color: #fff; }
.terminal-line.error { color: #ff6b6b; }
.terminal-line.accent { color: #ffe600; }
.terminal-prompt { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.terminal-prompt label { color: #ffe600; white-space: nowrap; }
.terminal-prompt input { flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: #fff; font: inherit; caret-color: #ffe600; caret-shape: block; }

.paint-body { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; max-height: none; padding: 10px; background: var(--grey); overflow: visible; }
.paint-tools { display: grid; align-content: start; gap: 4px; }
.paint-tools button { padding: 2px 0 0; border: 2px solid; border-color: #fff var(--shade) var(--shade) #fff; background: var(--grey); color: #000; font-size: 19px; cursor: pointer; }
.paint-tools button[aria-pressed="true"],
.paint-tools button:active { border-color: var(--shade) #fff #fff var(--shade); background: #dedede; }
.tool-gap { height: 6px; }
.paint-canvas { display: block; width: 100%; aspect-ratio: 1; border: 2px solid; border-color: var(--shade) #fff #fff var(--shade); background: #fff; image-rendering: pixelated; cursor: crosshair; touch-action: none; }
.paint-palette { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(16, 1fr); gap: 3px; }
.swatch { aspect-ratio: 1; min-width: 0; padding: 0; border: 2px solid; border-color: var(--shade) #fff #fff var(--shade); cursor: pointer; }
.swatch[aria-checked="true"] { outline: 2px dotted #000; outline-offset: 1px; }

.mines-body { display: grid; justify-content: center; gap: 10px; max-height: none; padding: 10px; background: var(--grey); overflow: visible; }
.mines-head { display: flex; align-items: center; justify-content: space-between; padding: 6px; border: 2px solid; border-color: var(--shade) #fff #fff var(--shade); }
.mines-head .led { min-width: 64px; margin: 0; text-align: center; }
.mines-face { width: 42px; height: 36px; padding: 0; border: 2px solid; border-color: #fff var(--shade) var(--shade) #fff; background: var(--grey); color: #000; font-size: 22px; font-weight: 700; cursor: pointer; }
.mines-face:active { border-color: var(--shade) #fff #fff var(--shade); }
.mines-grid { display: grid; grid-template-columns: repeat(9, 28px); border: 3px solid; border-color: var(--shade) #fff #fff var(--shade); }
.cell { position: relative; width: 28px; height: 28px; padding: 0; border: 2px solid; border-color: #fff var(--shade) var(--shade) #fff; background: var(--grey); color: #000; font-size: 22px; font-weight: 700; line-height: 1; cursor: pointer; }
.cell.revealed { border: 1px solid #808080; background: #c0c0c0; cursor: default; }
.cell.n1 { color: #0000ff; }
.cell.n2 { color: #008000; }
.cell.n3 { color: #ff0000; }
.cell.n4 { color: #000080; }
.cell.n5 { color: #800000; }
.cell.n6 { color: #008080; }
.cell.n7 { color: #000; }
.cell.n8 { color: #808080; }
.cell.flag::after { content: ""; position: absolute; left: 9px; top: 6px; border-left: 11px solid #d00000; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.cell.mine::after,
.cell.wrong::after { content: ""; position: absolute; left: 7px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: #000; box-shadow: 0 0 0 2px #000; }
.cell.wrong::after { background: #d00000; box-shadow: 0 0 0 2px #d00000; }
.cell.exploded { background: #ff0000; }
.mines-body .push[aria-pressed="true"] { border-color: var(--shade) #fff #fff var(--shade); background: #dedede; }

.display-body p { margin: 0 0 10px; }
.theme-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.theme-option { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border: 2px solid; border-color: #fff var(--shade) var(--shade) #fff; background: var(--grey); color: #000; font-size: 20px; text-align: left; cursor: pointer; }
.theme-option[aria-checked="true"] { border-color: var(--shade) #fff #fff var(--shade); background: #fff; }
.theme-swatch { flex: none; width: 36px; height: 26px; border: 2px solid #000; background: linear-gradient(var(--deep) 0 7px, var(--light) 7px 9px, var(--desk) 9px); }
.check-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--navy); }

.context-menu { width: 210px; z-index: 3200; }

.screensaver { position: fixed; inset: 0; z-index: 5500; overflow: hidden; background: #000; cursor: none; }
.screensaver-logo { position: absolute; left: 0; top: 0; padding: 12px 20px 8px; border: 4px solid currentColor; color: #ffe600; font-family: var(--pix); font-size: 28px; letter-spacing: 0.08em; white-space: nowrap; will-change: transform; }
.screensaver-note { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--pix); font-size: clamp(28px, 8vw, 96px); color: #ffe600; text-shadow: 6px 6px 0 var(--navy); opacity: 0; pointer-events: none; }
.screensaver-note.show { opacity: 1; }

.bsod { position: fixed; inset: 0; z-index: 7000; padding: 8vh 8vw; background: #0000aa; color: #fff; font-size: clamp(20px, 2.4vw, 30px); cursor: pointer; }
.bsod h2 { display: inline-block; margin: 0 0 28px; padding: 2px 14px 0; background: #aaa; color: #0000aa; font: inherit; }
.bsod p { max-width: 70ch; margin: 0 0 20px; }
.bsod-prompt { animation: bsod-blink 1s steps(2, jump-none) infinite; }
@keyframes bsod-blink { 50% { opacity: 0.2; } }

@media (max-width: 760px) {
  .taskbar .studio-link { display: none; }
  .grip { display: none; }
  .window.resized { width: auto; }
  .window.resized .window-body { height: auto; }
  .paint-body { grid-template-columns: 1fr; }
  .paint-tools { grid-template-columns: repeat(4, 1fr); }
  .tool-gap { display: none; }
  .mines-body { justify-content: center; }
  .terminal-body { height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
  .bsod-prompt { animation: none; }
}
