/* Disable text selection highlighting */
::selection {
    background: transparent;
}
::-moz-selection {
    background: transparent;
}
/* Custom styles for interactive features */
.apple-logo {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: url('icon/apple.svg') no-repeat center;
    background-size: contain;
    cursor: pointer;
    vertical-align: middle;
}
.apple-menu:hover .apple-logo,
.apple-menu:focus .apple-logo,
.apple-menu:active .apple-logo {
    filter: invert(1);
}
.window {
    position: absolute;
    cursor: default;
    z-index: 10;
    resize: both;
    overflow: hidden;
    min-width: 200px;
    min-height: 120px;
}
.window-pane {
    overflow: auto;
    max-height: calc(100% - 30px);
}
.title-bar {
    cursor: grab;
}
.title-bar:active {
    cursor: grabbing;
}
.window.collapsed .window-pane,
.window.collapsed .separator {
    display: none;
}
.hidden-dialog {
    display: none;
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}
.modal-overlay.visible {
    display: flex;
}
.modal-dialog {
    background: white;
    padding: 0;
}
.modal-contents {
    padding: 1.5rem;
    text-align: center;
    font-family: Chicago_12, 'ChiKareGo2', monospace;
}
.modal-contents p {
    margin: 0.5rem 0;
    font-family: Chicago_12, 'ChiKareGo2', monospace;
}
.alert-box {
    background: white;
}
.alert-contents {
    padding: 1rem;
    text-align: center;
    font-family: Chicago_12, 'ChiKareGo2', monospace;
}
.alert-text {
    font-family: Chicago_12, 'ChiKareGo2', monospace;
}
.alert-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}
/* Date/Time Modal */
.date-modal-contents {
    font-family: Chicago_12, 'ChiKareGo2', monospace;
    min-width: 200px;
}
.date-modal-time {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 0 0.5rem 0;
    font-family: Chicago_12, 'ChiKareGo2', monospace;
}
.date-modal-date {
    font-size: 1rem;
    margin: 0 0 0.25rem 0;
    font-family: Chicago_12, 'ChiKareGo2', monospace;
}
.date-modal-timezone {
    font-size: 0.8rem;
    color: #666;
    margin: 0;
    font-family: Chicago_12, 'ChiKareGo2', monospace;
}
/* About This Mac */
.about-mac-contents {
    font-family: Chicago_12, 'ChiKareGo2', monospace;
    min-width: 280px;
    text-align: left;
}
.about-mac-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid black;
}
.about-mac-icon {
    width: 32px;
    height: 32px;
}
.about-mac-info {
    font-size: 0.85rem;
    margin-bottom: 1rem;
}
.about-mac-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
}
.about-mac-divider {
    border-top: 1px dotted black;
    margin: 8px 0;
}
.about-mac-memory {
    margin: 8px 0;
    padding-left: 12px;
}
.about-mac-bar {
    height: 12px;
    border: 1px solid black;
    background: white;
}
.about-mac-bar-fill {
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        black 0px,
        black 2px,
        white 2px,
        white 4px
    );
}
.about-mac-credits {
    text-align: center;
    font-size: 0.75rem;
    color: #666;
    border-top: 1px solid black;
    padding-top: 0.5rem;
}
.about-mac-credits p {
    margin: 0;
}
.calculator-window {
    width: 220px;
    min-width: 220px;
}
.calc-display {
    background: white;
    border: 1px solid black;
    padding: 0.25rem 0.5rem;
    text-align: right;
    font-family: 'ChiKareGo2', monospace;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}
.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}
.calc-buttons button {
    padding: 0.5rem;
    min-width: 40px;
    width: 100%;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}
.fade-out {
    animation: fadeOut 0.5s forwards;
}
.fade-in {
    animation: fadeIn 0.3s forwards;
}
/* Startup screen */
#startup-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    gap: 1rem;
}
#startup-screen.hidden {
    display: none;
}
.startup-icon {
    width: 64px;
    height: 64px;
}
.startup-text {
    font-family: 'ChicagoFLF', 'ChiKareGo2', monospace;
    font-size: 14px;
}
/* Menu bar clock */
.menu-clock {
    padding: 6px 10px;
    cursor: pointer;
}
/* Menu bar sound icon */
.menu-sound {
    margin-left: auto;
    padding: 4px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
}
.menu-sound img {
    width: 16px;
    height: 16px;
    image-rendering: pixelated;
}
/* Desktop grid system */
.desktop-grid {
    position: fixed;
    top: 28px;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}
/* Desktop icons */
.desktop-icon {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    user-select: none;
    width: 80px;
    height: 80px;
    pointer-events: auto;
    box-sizing: border-box;
}
.desktop-icon:hover {
    background: rgba(0,0,0,0.1);
}
.desktop-icon.selected {
    background: black;
    color: white;
}
.desktop-icon.selected img {
    filter: invert(1);
}
.desktop-icon.dragging {
    opacity: 0.7;
    z-index: 5;
}
.desktop-icon img {
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
}
.desktop-icon span {
    font-family: 'ChicagoFLF', 'ChiKareGo2', monospace;
    font-size: 12px;
    margin-top: 4px;
    text-align: center;
    white-space: nowrap;
}
/* Lunar Lander */
.lander-output {
    font-family: 'ChiKareGo2', monospace;
    font-size: 12px;
    border: 1px solid black;
    padding: 0.5rem;
    margin: 0 0 0.5rem 0;
    height: 160px;
    overflow-y: auto;
}
/* Star Trek */
.startrek-window {
    width: 360px;
    min-width: 340px;
    min-height: 480px;
}
.startrek-output {
    font-family: 'ChiKareGo2', monospace;
    font-size: 10px;
    border: 1px solid black;
    padding: 0.5rem;
    margin: 0 0 0.5rem 0;
    height: 320px;
    overflow-y: auto;
    white-space: pre;
    line-height: 1.2;
}
.startrek-window .btn {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Blackjack */
.blackjack-window {
    width: 260px;
    min-width: 240px;
}
.blackjack-output {
    font-family: 'ChiKareGo2', monospace;
    font-size: 11px;
    border: 1px solid black;
    padding: 0.5rem;
    margin: 0 0 0.5rem 0;
    height: 180px;
    overflow-y: auto;
    white-space: pre;
    line-height: 1.3;
}
.blackjack-buttons {
    display: flex;
    gap: 4px;
    justify-content: center;
}
.blackjack-buttons .btn {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Mastermind */
.mastermind-window {
    width: 280px;
    min-width: 260px;
}
.mastermind-output {
    font-family: 'ChiKareGo2', monospace;
    font-size: 11px;
    border: 1px solid black;
    padding: 0.5rem;
    margin: 0 0 0.5rem 0;
    height: 200px;
    overflow-y: auto;
    white-space: pre;
    line-height: 1.3;
}
/* Hamurabi */
.hamurabi-window {
    width: 320px;
    min-width: 300px;
}
.hamurabi-output {
    font-family: 'ChiKareGo2', monospace;
    font-size: 11px;
    border: 1px solid black;
    padding: 0.5rem;
    margin: 0 0 0.5rem 0;
    height: 220px;
    overflow-y: auto;
    white-space: pre;
    line-height: 1.3;
}
/* Puzzle game */
.puzzle-window {
    width: 220px;
    min-width: 220px;
}
.puzzle-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    background: black;
    padding: 2px;
}
.puzzle-tile {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'ChicagoFLF', 'ChiKareGo2', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    background: white;
    border: 1px solid #999;
    cursor: pointer;
}
.puzzle-tile:hover {
    background: #eee;
}
.puzzle-tile.empty {
    background: #ccc;
    border: none;
    cursor: default;
}
.puzzle-controls {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}
/* Note Pad */
.notepad-window {
    width: 280px;
}
.notepad-content {
    position: relative;
}
.notepad-textarea {
    width: 100%;
    height: 150px;
    border: 1px solid black;
    font-family: 'Geneva', 'ChiKareGo2', monospace;
    font-size: 12px;
    padding: 0.5rem;
    resize: none;
    box-sizing: border-box;
}
.notepad-corner {
    position: absolute;
    bottom: 5px;
    left: 5px;
    cursor: pointer;
    font-size: 1.2rem;
}
.notepad-page-num {
    text-align: center;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}
/* Email window */
.email-window {
    width: 320px;
}
.email-window .window-pane {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-family: Chicago_12, 'ChiKareGo2', monospace;
}
.email-window label {
    font-family: Chicago_12, 'ChiKareGo2', monospace;
    font-size: 14px;
}
.email-window .field-row {
    align-items: center;
}
.email-window .field-row label {
    min-width: 65px;
    text-align: left;
}
.email-window textarea {
    width: 100%;
    height: 100px;
    border: 1px solid black;
    font-family: Chicago_12, 'ChiKareGo2', monospace;
    font-size: 14px;
    padding: 0.5rem;
    resize: none;
    box-sizing: border-box;
}
.email-window input {
    font-family: Chicago_12, 'ChiKareGo2', monospace;
    font-size: 14px;
}
.email-window input[readonly] {
    background: #eee;
    cursor: pointer;
}
/* Sad Mac */
.sad-mac-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    flex-direction: column;
    gap: 1rem;
}
.sad-mac-screen.visible {
    display: flex;
}
.sad-mac-code {
    color: #fff;
    font-family: 'ChicagoFLF', 'ChiKareGo2', monospace;
    font-size: 14px;
}
/* Scrolling credits */
.credits-container {
    height: 80px;
    overflow: hidden;
    position: relative;
    border: 1px solid black;
    margin-top: 0.5rem;
}
.credits-scroll {
    position: absolute;
    width: 100%;
    animation: scrollCredits 30s linear infinite;
}
@keyframes scrollCredits {
    0% { top: 80px; }
    100% { top: -450px; }
}
/* Base body styles for flush menu bar */
body {
    margin: 0;
    padding: 0;
}
/* Dark mode toggle icon */
.menu-darkmode {
    padding: 4px 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 14px;
    line-height: 1;
}
/* ============ NEW APPS & GAMES ============ */
/* Global: align inputs and buttons consistently in field-rows */
.field-row { align-items: center; }
/* Fix button text centering — system.css border-image + padding misaligns text */
.btn, .btn-default {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}


/* MacPaint */
.macpaint-window { width:420px; min-width:420px; min-height:382px; }
.macpaint-window .window-pane { overflow:hidden; padding:8px; }
.macpaint-container { display:flex; border:1px solid black; }
.macpaint-toolbar { display:flex; flex-direction:column; gap:2px; padding:4px; border-right:1px solid black; }
.macpaint-tool { width:28px; height:28px; border:1px solid black; background:white; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:14px; font-family:'ChiKareGo2',monospace; padding:0; }
.macpaint-tool.active { background:black; color:white; }
.macpaint-tool:hover:not(.active) { background:#ccc; }
.macpaint-canvas-wrap { flex:1; display:flex; flex-direction:column; }
.macpaint-canvas { display:block; width:100%; cursor:crosshair; image-rendering:pixelated; background:white; }
.macpaint-bottom { display:flex; gap:8px; padding:6px; justify-content:center; align-items:center; }
.macpaint-sizes { display:flex; gap:2px; }
.macpaint-size { width:22px; height:22px; border:1px solid black; background:white; cursor:pointer; display:flex; align-items:center; justify-content:center; padding:0; }
.macpaint-size.active { background:black; color:white; }
.macpaint-size-dot { background:black; border-radius:50%; }
.macpaint-size.active .macpaint-size-dot { background:white; }
/* Eliza */
.eliza-window { width:340px; min-width:340px; min-height:350px; }
.eliza-window .window-pane { overflow:hidden; }
.eliza-output { font-family:'ChiKareGo2',monospace; font-size:11px; border:1px solid black; padding:0.5rem; margin:0 0 0.5rem 0; height:220px; overflow-y:auto; line-height:1.4; }
.eliza-msg { margin:4px 0; }
.eliza-msg.eliza { font-weight:bold; }
.eliza-msg.user { color:#444; }
/* Alarm Clock */
.alarmclock-window { width:240px; min-width:240px; min-height:200px; }
.alarmclock-window .window-pane { overflow:hidden; }
.alarmclock-display { font-family:'ChiKareGo2',monospace; font-size:28px; text-align:center; border:1px solid black; padding:0.75rem; margin-bottom:0.5rem; }
.alarmclock-date { font-family:'ChiKareGo2',monospace; font-size:12px; text-align:center; margin-bottom:0.5rem; }
.alarmclock-alarm { font-family:'ChiKareGo2',monospace; font-size:11px; text-align:center; padding:4px 0; }
.alarmclock-controls { display:flex; gap:4px; justify-content:center; align-items:center; margin-top:0.5rem; }
/* Scrapbook */
.scrapbook-window { width:300px; min-width:300px; min-height:280px; }
.scrapbook-window .window-pane { overflow:hidden; }
.scrapbook-content { border:1px solid black; height:160px; padding:0.5rem; overflow-y:auto; font-family:'ChiKareGo2',monospace; font-size:11px; margin-bottom:0.5rem; }
.scrapbook-nav { display:flex; justify-content:space-between; align-items:center; font-family:'ChiKareGo2',monospace; font-size:11px; }
.scrapbook-controls { display:flex; gap:4px; justify-content:center; margin-top:0.5rem; }
/* Key Caps */
.keycaps-window { width:360px; min-width:360px; min-height:240px; }
.keycaps-window .window-pane { overflow:hidden; padding:8px; }
.keycaps-output { font-family:'ChiKareGo2',monospace; font-size:14px; border:1px solid black; padding:4px 8px; margin-bottom:6px; min-height:24px; }
.keycaps-grid { display:flex; flex-direction:column; gap:2px; align-items:center; }
.keycaps-row { display:flex; gap:2px; }
.keycaps-key { width:24px; height:24px; border:1px solid black; background:white; display:flex; align-items:center; justify-content:center; cursor:pointer; font-family:'ChiKareGo2',monospace; font-size:11px; padding:0; }
.keycaps-key:hover { background:#ccc; }
.keycaps-key:active { background:black; color:white; }
.keycaps-key.wide { width:120px; }
/* Oregon Trail */
.oregon-window { width:380px; min-width:380px; min-height:390px; }
.oregon-window .window-pane { overflow:hidden; }
.oregon-output { font-family:'ChiKareGo2',monospace; font-size:11px; border:1px solid black; padding:0.5rem; margin:0 0 0.5rem 0; height:260px; overflow-y:auto; white-space:pre; line-height:1.3; }
/* Breakout */
.breakout-window { width:370px; min-width:370px; min-height:332px; }
.breakout-window .window-pane { overflow:hidden; padding:8px; }
.breakout-canvas { border:1px solid black; display:block; margin:0 auto; background:white; }
.breakout-info { font-family:'ChiKareGo2',monospace; font-size:11px; display:flex; justify-content:space-between; padding:4px 0; }
.breakout-controls { display:flex; gap:4px; justify-content:center; margin-top:4px; }
/* Snake */
.snake-window { width:320px; min-width:320px; min-height:340px; }
.snake-window .window-pane { overflow:hidden; padding:8px; }
.snake-canvas { display:block; border:1px solid black; margin:0 auto; background:white; }
.snake-info { font-family:'ChiKareGo2',monospace; font-size:11px; text-align:center; padding:4px 0; }
.snake-controls { display:flex; gap:4px; justify-content:center; margin-top:4px; }
/* Hangman */
.hangman-window { width:320px; min-width:320px; min-height:360px; }
.hangman-window .window-pane { overflow:hidden; }
.hangman-canvas { display:block; border:1px solid black; margin:0 auto 0.5rem auto; background:white; }
.hangman-word { font-family:'ChiKareGo2',monospace; font-size:18px; text-align:center; letter-spacing:6px; margin:0.75rem 0 0.25rem 0; }
.hangman-used { font-family:'ChiKareGo2',monospace; font-size:10px; text-align:center; margin:0.25rem 0 0.5rem 0; color:#666; min-height:14px; }
.hangman-msg { font-family:'ChiKareGo2',monospace; font-size:11px; text-align:center; margin:0 0 0.5rem 0; font-weight:bold; min-height:14px; }
.hangman-window .field-row { justify-content:center; gap:6px; }
/* Adventure */
.adventure-window { width:400px; min-width:400px; min-height:400px; }
.adventure-window .window-pane { overflow:hidden; }
.adventure-output { font-family:'ChiKareGo2',monospace; font-size:11px; border:1px solid black; padding:0.5rem; margin:0 0 0.5rem 0; height:260px; overflow-y:auto; white-space:pre-wrap; line-height:1.3; }
/* Minesweeper */
.minesweeper-window { min-width:220px; min-height:300px; }
.minesweeper-window .window-pane { overflow:hidden; padding:8px; }
.mines-info { font-family:'ChiKareGo2',monospace; font-size:11px; display:flex; justify-content:space-between; padding:4px 0; }
.mines-grid { display:grid; grid-template-columns:repeat(9,1fr); gap:0; border:1px solid black; margin:0 auto; }
.mines-cell { width:20px; height:20px; border:1px solid #999; background:#ccc; display:flex; align-items:center; justify-content:center; cursor:pointer; font-family:'ChiKareGo2',monospace; font-size:11px; font-weight:bold; padding:0; }
.mines-cell.revealed { background:white; cursor:default; }
.mines-cell.flagged { background:#ccc; }
.mines-cell.mine { background:black; color:white; }
.mines-controls { display:flex; gap:4px; justify-content:center; margin-top:6px; }
/* Reversi */
.reversi-window { width:300px; min-width:300px; min-height:360px; }
.reversi-window .window-pane { overflow:hidden; padding:8px; }
.reversi-info { font-family:'ChiKareGo2',monospace; font-size:11px; text-align:center; padding:4px 0; }
.reversi-grid { display:grid; grid-template-columns:repeat(8,1fr); gap:0; border:1px solid black; margin:0 auto; width:fit-content; }
.reversi-cell { width:28px; height:28px; border:1px solid #666; background:white; display:flex; align-items:center; justify-content:center; cursor:pointer; padding:0; }
.reversi-cell:hover { background:#eee; }
.reversi-piece { width:20px; height:20px; border-radius:50%; }
.reversi-piece.black { background:black; }
.reversi-piece.white { background:white; border:1px solid black; }
.reversi-controls { display:flex; gap:4px; justify-content:center; margin-top:6px; }
/* Number Munchers */
.munchers-window { width:360px; min-width:360px; min-height:340px; }
.munchers-window .window-pane { overflow:hidden; padding:8px; }
.munchers-info { font-family:'ChiKareGo2',monospace; font-size:11px; display:flex; justify-content:space-between; padding:4px 0; }
.munchers-prompt { font-family:'ChiKareGo2',monospace; font-size:12px; text-align:center; padding:4px 0; font-weight:bold; }
.munchers-grid { display:grid; grid-template-columns:repeat(6,1fr); gap:0; border:1px solid black; }
.munchers-cell { height:32px; border:1px solid #999; background:white; display:flex; align-items:center; justify-content:center; font-family:'ChiKareGo2',monospace; font-size:14px; padding:0; }
.munchers-cell.player { background:black; color:white; }
.munchers-msg { font-family:'ChiKareGo2',monospace; font-size:11px; text-align:center; padding:4px 0; }
/* Dark mode overrides for new apps */
.dark-mode .eliza-msg.user { color:#888; }
.dark-mode .hangman-used { color:#888; }
.dark-mode .mines-cell { background:#333; border-color:#555; color:#ccc; }
.dark-mode .mines-cell.revealed { background:#000; }
.dark-mode .mines-cell.mine { background:#ccc; color:#000; }
.dark-mode .reversi-cell { background:#000; border-color:#555; }
.dark-mode .reversi-cell:hover { background:#222; }
.dark-mode .reversi-piece.black { background:#ccc; }
.dark-mode .reversi-piece.white { background:#000; border-color:#ccc; }
.dark-mode .munchers-cell { background:#000; border-color:#555; color:#ccc; }
.dark-mode .munchers-cell.player { background:#ccc; color:#000; }
.dark-mode .keycaps-key { background:#000; color:#ccc; border-color:#555; }
.dark-mode .keycaps-key:hover { background:#333; }
.dark-mode .keycaps-key:active { background:#ccc; color:#000; }
.dark-mode .macpaint-tool { background:#000; color:#ccc; border-color:#555; }
.dark-mode .macpaint-tool.active { background:#ccc; color:#000; }
.dark-mode .macpaint-size { background:#000; border-color:#555; }
.dark-mode .macpaint-size.active { background:#ccc; }
.dark-mode .macpaint-size-dot { background:#ccc; }
.dark-mode .macpaint-size.active .macpaint-size-dot { background:#000; }
.dark-mode .macpaint-container { border-color:#555; }
.dark-mode canvas { border-color:#555 !important; }
/* ============ DARK MODE ============ */
/* Swap system.css theme tokens — everything else follows automatically */
html.dark-mode {
    --sys-color-white: #000 !important;
    --sys-color-black: #ccc !important;
    --sys-color-grey: #444 !important;
    --sys-color-darkgrey: #333 !important;
    --primary: #000 !important;
    --secondary: #ccc !important;
    --tertiary: #444 !important;
    --disabled: #333 !important;
}
.dark-mode body {
    background: linear-gradient(90deg, #000 21px, transparent 1%) center,
                linear-gradient(#000 21px, transparent 1%) center, #222;
    background-size: 22px 22px;
    background-attachment: fixed;
    color: #ccc;
}
.dark-mode .desktop-icon img {
    filter: invert(1);
}
.dark-mode .desktop-icon span {
    color: #ccc;
}
.dark-mode .desktop-icon:hover {
    background: rgba(255,255,255,0.1);
}
.dark-mode .desktop-icon.selected {
    background: #ccc;
    color: #000;
}
.dark-mode .desktop-icon.selected img {
    filter: none;
}
.dark-mode .menu-sound img {
    filter: invert(1);
}
.dark-mode .apple-logo {
    filter: invert(1);
}
.dark-mode .about-mac-bar-fill {
    background: repeating-linear-gradient(
        90deg,
        #ccc 0px,
        #ccc 2px,
        #000 2px,
        #000 4px
    );
}
.dark-mode .about-mac-credits {
    color: #888;
}
.dark-mode .window-pane,
.dark-mode .window-pane p,
.dark-mode .window-pane strong,
.dark-mode .title-bar .title,
.dark-mode .modal-contents,
.dark-mode .modal-contents p,
.dark-mode .alert-contents,
.dark-mode .alert-text {
    color: #ccc;
}
.dark-mode .window-pane a {
    color: #999;
}
/* Dropdown menus */
.dark-mode ul[role="menu"] {
    background: #111 !important;
    color: #ccc !important;
    border-color: #555 !important;
    box-shadow: 2px 2px #333 !important;
}
.dark-mode ul[role="menu"]::before {
    box-shadow: inset 1px 0 rgba(255,255,255,0.1), inset -1px 0 #111 !important;
}
.dark-mode ul[role="menu"] > [role="menu-item"] > a,
.dark-mode ul[role="menu"] > [role="menu-item"] > button {
    color: #ccc !important;
}
.dark-mode ul[role="menu"] > [role="menu-item"] > a:hover,
.dark-mode ul[role="menu"] > [role="menu-item"] > a:focus {
    background: #ccc !important;
    color: #000 !important;
}
.dark-mode [role="menu-item"].divider::after {
    border-top-color: #555 !important;
}
/* Menu bar */
.dark-mode ul[role="menu-bar"] {
    background: #111;
    color: #ccc;
    border-bottom: 1px solid #555;
}
.dark-mode ul[role="menu-bar"] > [role="menu-item"]:focus,
.dark-mode ul[role="menu-bar"] > [role="menu-item"]:focus-within,
.dark-mode ul[role="menu-bar"] > [role="menu-item"]:hover {
    background: #ccc;
    color: #000;
}
/* Buttons */
.dark-mode .btn,
.dark-mode .btn-default {
    border-image: none !important;
    border: 2px solid #ccc !important;
    border-radius: 6px;
    background: #000 !important;
    color: #ccc !important;
    box-shadow: none !important;
}
.dark-mode .btn-default {
    border-width: 3px !important;
}
.dark-mode .btn:active {
    background: #333 !important;
}
/* Window borders */
.dark-mode .window {
    border-color: #555;
}
.dark-mode .separator {
    border-color: #555;
}
/* Inputs */
.dark-mode input[type="text"],
.dark-mode input[type="number"],
.dark-mode input[type="time"],
.dark-mode textarea,
.dark-mode select {
    background: #111;
    color: #ccc;
    border-color: #555;
}
.dark-mode input::placeholder {
    color: #666;
}
/* Modal overlays */
.dark-mode .modal-dialog,
.dark-mode .alert-box {
    background: #111;
    border-color: #555;
}
.dark-mode .outer-border {
    border-color: #555;
}
.dark-mode .inner-border {
    border-color: #444;
}
/* Selected desktop icon */
.dark-mode .desktop-icon.selected span {
    color: #000;
}
/* Mobile responsive styles */
@media (max-width: 480px) {
    html {
        overflow: hidden;
        height: 100%;
    }
    body {
        overflow: hidden;
        width: 100%;
        height: 100%;
        min-height: 100%;
        background-attachment: scroll;
    }
    .window {
        width: calc(100% - 2rem);
        max-width: none;
        overflow: hidden;
    }
    .window .title-bar {
        overflow: hidden;
    }
    .desktop-icon {
        display: none;
    }
    ul[role="menu-bar"] {
        overflow: visible;
        width: 100%;
        box-sizing: border-box;
    }
    ul[role="menu-bar"] > [role="menu-item"],
    .menu-clock {
        padding: 12px 12px;
        font-size: 16px;
    }
    /* Hide Edit and View menus on mobile */
    ul[role="menu-bar"] > [role="menu-item"]:nth-child(3),
    ul[role="menu-bar"] > [role="menu-item"]:nth-child(4) {
        display: none;
    }
    ul[role="menu-bar"] > [role="menu-item"]:first-child {
        padding-left: 16px;
    }
    .menu-clock {
        padding-right: 16px;
    }
    /* Mobile menu - toggle via JavaScript instead of :focus */
    ul[role="menu-bar"] > [role="menu-item"].menu-open > ul[role="menu"] {
        display: block;
    }
    .calculator-window,
    .puzzle-window,
    .notepad-window,
    .email-window,
    .search-window,
    .lander-window {
        width: calc(100% - 2rem) !important;
    }
}

/* ============ SECRETS WINDOW ============ */

.secrets-window {
    width: 440px;
    min-width: 340px;
    max-height: 70vh;
}

.secrets-window .window-pane {
    overflow-y: auto;
    max-height: calc(70vh - 40px);
}

.secrets-list {
    font-family: Chicago_12, 'ChiKareGo2', monospace;
    font-size: 16px;
    padding: 0.75rem;
    padding-bottom: 1rem;
}

.secrets-header {
    text-align: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid black;
    margin-bottom: 0.75rem;
}

.secrets-progress {
    font-size: 12px;
    margin-top: 4px;
}

.secret-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px dotted #999;
}

.secret-check {
    min-width: 22px;
    text-align: left;
    font-size: 12px;
    white-space: nowrap;
}

.secret-info {
    flex: 1;
}

.secret-name {
    font-weight: bold;
    font-size: 16px;
}

.secret-hint {
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}

.secret-try {
    font-size: 10px;
    cursor: pointer;
    text-decoration: underline;
    white-space: nowrap;
    background: none;
    border: none;
    font-family: Chicago_12, 'ChiKareGo2', monospace;
    padding: 0;
}

.secret-try:hover {
    background: black;
    color: white;
}

/* Secret Credits Animation */
.secret-credits-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: transparent;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.secret-credits-overlay.visible {
    display: flex;
}

.secret-credits-box {
    width: 100vw;
    height: 100vh;
    background: black;
    border: none;
    overflow: hidden;
    position: relative;
}

.secret-credits-scroll {
    position: absolute;
    width: 100%;
    color: white;
    font-family: Chicago_12, 'ChiKareGo2', monospace;
    font-size: 14px;
    text-align: center;
    line-height: 2;
    animation: scrollSecretCredits 45s linear forwards;
}

@keyframes scrollSecretCredits {
    0% { top: 100vh; }
    100% { top: -1800px; }
}

/* Calculator overflow flash */
.calc-overflow .btn {
    background: black !important;
    color: white !important;
}

/* Screen burn-in overlay */
#burn-in-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.06;
    display: none;
}

#burn-in-overlay.visible {
    display: block;
}
