/* POLSAS 98 – vinduer og skrivebordsapps på forsiden (desktop.js og desktop-apps.js). Bruger tokens fra polsas-theme.css. */

/* ---------- Skrivebordet, når man er logget ind ---------- */
html.pol98.pol-wm-active body.home-shortcuts { overflow: hidden; }
html.pol98.pol-wm-active :is(.home-main, .home-audio-control) { display: none !important; }
html.pol98.pol-wm-active .home-topbar { position: fixed; right: 24px; bottom: 48px; z-index: 3; padding: 0; pointer-events: none; }
html.pol98.pol-wm-active .home-brand { font-size: 34px !important; opacity: .85; }
html.pol98.pol-wm-active .pol-desktop { position: fixed !important; top: 10px !important; left: 10px !important; right: auto !important; bottom: 46px !important; z-index: 40 !important; display: grid !important; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 86px); gap: 4px; align-content: start; max-width: none !important; flex-direction: initial !important; }

/* ---------- Vinduer ---------- */
.pol-wm { position: fixed; inset: 0 0 36px 0; z-index: 60; pointer-events: none; overflow: hidden; }
.pol-win { position: absolute; display: flex; flex-direction: column; min-width: 240px; min-height: 140px; padding: 3px; background: var(--w98-face); box-shadow: var(--w98-raised), 4px 4px 0 #00000040; pointer-events: auto; font: 12px var(--pol-font); color: #000; }
.pol-win.minimized { display: none; }
.pol-win.max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; box-shadow: var(--w98-raised); }
.pol-win-title { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; height: 22px; padding: 0 3px 0 4px; background: linear-gradient(90deg, #7b7b7b, #b5b5b5); color: #d4d0c8; font-weight: bold; user-select: none; touch-action: none; cursor: default; }
.pol-win.active .pol-win-title { background: var(--w98-title); color: #fff; }
.pol-win-icon { flex: 0 0 auto; width: 18px; font-size: 14px; font-style: normal; text-align: center; }
.pol-win-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pol-win .pol-titlebar-buttons { display: flex; gap: 2px; margin-left: auto; }
.pol-win-body { position: relative; flex: 1 1 auto; min-height: 0; margin-top: 2px; overflow: auto; }
.pol-win.system .pol-win-body { overflow: hidden; background: #fff; box-shadow: var(--w98-sunken); padding: 2px; }
.pol-win-frame { display: block; width: 100%; height: 100%; border: 0; background: var(--w98-face); }
.pol-wm.dragging .pol-win-frame { pointer-events: none; }
.pol-wm.dragging { cursor: move; }
.pol-win-grip { position: absolute; right: 3px; bottom: 3px; width: 14px; height: 14px; cursor: nwse-resize; touch-action: none; background: linear-gradient(135deg, transparent 0 45%, #fff 45% 52%, #808080 52% 60%, transparent 60% 70%, #fff 70% 77%, #808080 77% 85%, transparent 85%); }
.pol-win.max .pol-win-grip { display: none; }
.pol-taskbar .pol-systembar-system.running:not(.active) { font-weight: bold !important; }
html.pol98 .pol-startmenu-group { padding: 6px 10px 2px; color: #4a4a4a; font: bold 11px var(--pol-font); border-top: 1px solid #808080; box-shadow: inset 0 1px #fff; }

/* ---------- Fælles app-elementer ---------- */
.app-pad { padding: 10px; }
.app-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.app-toolbar { display: flex; align-items: center; gap: 10px; padding: 4px 6px; box-shadow: inset 0 -1px #808080, inset 0 -2px #fff; }
.app-check { display: inline-flex; align-items: center; gap: 4px; }
.app-statusbar { padding: 3px 6px; box-shadow: inset 1px 1px #808080, inset -1px -1px #fff; margin-top: 2px; }
.app-statusbar-text { color: #333; font-size: 11px; }
.pol-win.app .pol-win-body { display: flex; flex-direction: column; }

/* Infotavle */
.app-info-title { margin: 0 0 8px; font: bold 18px var(--pol-font); color: #000; }
.app-info-text { margin: 0; white-space: pre-wrap; line-height: 1.5; }

/* Musikafspiller */
.app-lcd { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; background: #0b1a0b; color: #7cff6b; font: 13px "Courier New", monospace; box-shadow: var(--w98-sunken); }
.app-lcd b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: normal; }
html.pol98 .pol-win .app-music-play { min-width: 92px; font-weight: bold !important; }
.app-volume input { flex: 1; accent-color: var(--w98-select); }
.app-music-status { margin-top: 6px; color: #333; font-size: 11px; }

/* Notesblok */
html.pol98 .pol-win .app-notes { flex: 1 1 auto; width: 100%; min-height: 0; margin: 0; padding: 6px 8px !important; resize: none; white-space: pre-wrap; font: 13px/1.5 "Lucida Console", "Courier New", monospace !important; }

/* Lommeregner */
html.pol98 .pol-win .app-calc-display { width: 100%; margin-bottom: 8px; text-align: right; font: 20px "Courier New", monospace !important; min-height: 34px !important; }
.app-calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
html.pol98 .pol-win .app-calc-keys button { min-height: 34px !important; padding: 0 !important; font-size: 14px !important; }
html.pol98 .pol-win .app-calc-keys button.wide { grid-column: span 2; }
html.pol98 .pol-win .app-calc-keys button.op { color: #0a246a !important; font-weight: bold !important; }

/* Bombehunden */
.app-mine-head { display: flex; justify-content: space-between; align-items: center; padding: 5px; margin-bottom: 6px; box-shadow: var(--w98-sunken); }
.app-led { min-width: 46px; padding: 2px 4px; background: #000; color: #ff2a2a; font: bold 20px "Courier New", monospace; text-align: center; }
html.pol98 .pol-win .app-face { width: 34px; height: 30px; padding: 0 !important; font-size: 18px !important; }
.app-mine-board { display: grid; grid-template-columns: repeat(9, 28px); justify-content: center; gap: 0; padding: 3px; box-shadow: var(--w98-sunken); }
.app-mine-cell { width: 28px; height: 28px; padding: 0; border: 0; background: var(--w98-face); box-shadow: var(--w98-raised); font: bold 14px var(--pol-font); cursor: pointer; }
.app-mine-cell.open { box-shadow: inset 1px 1px #808080; background: #c9c5bd; cursor: default; }
.app-mine-cell.boom { background: #e04040; }
.app-mine-cell[data-n="1"] { color: #0000c8; } .app-mine-cell[data-n="2"] { color: #007b00; } .app-mine-cell[data-n="3"] { color: #c80000; } .app-mine-cell[data-n="4"] { color: #00007b; } .app-mine-cell[data-n="5"] { color: #7b0000; } .app-mine-cell[data-n="6"] { color: #007b7b; }
.app-mode { min-width: 70px; }

/* Huskespil */
.app-memory-grid { display: grid; grid-template-columns: repeat(4, 64px); gap: 6px; justify-content: center; }
.app-memory-card { width: 64px; height: 64px; padding: 0; border: 0; background: repeating-linear-gradient(45deg, #0a246a 0 6px, #3a6ea5 6px 12px); box-shadow: var(--w98-raised); font-size: 30px; cursor: pointer; }
.app-memory-card.shown { background: #fff; box-shadow: var(--w98-sunken); }
.app-memory-card.found { background: #e7f3df; }

/* Kryds og bolle */
.app-ttt-grid { display: grid; grid-template-columns: repeat(3, 72px); gap: 4px; justify-content: center; margin: 8px 0; }
.app-ttt-cell { width: 72px; height: 72px; padding: 0; border: 0; background: #fff; box-shadow: var(--w98-sunken); font: bold 38px var(--pol-font); cursor: pointer; }
.app-ttt-cell.x { color: #0a246a; } .app-ttt-cell.o { color: #b00020; }

@media (max-width: 800px) {
  .pol-win:not(.fixed-size) { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; }
  .pol-win.fixed-size { left: 50% !important; top: 8px !important; transform: translateX(-50%); max-width: 100%; }
}

/* Den fælles videoafspiller har synligt billede og browserens egne mediekontroller. */
html.pol98 .pol-win .app-video-body {display:flex;flex-direction:column;overflow:hidden;background:#111;color:#fff;}
.app-video-title,.app-video-status {margin:0;padding:8px 12px;flex:none;}
.app-video-status {font-size:12px;}
.app-video-stage {flex:1;min-height:80px;min-width:0;display:flex;align-items:center;justify-content:center;background:#000;}
.app-video-stage video {display:block;width:100%;height:100%;max-height:100%;object-fit:contain;background:#000;}
#home-video-dialog {width:min(900px,92vw);max-height:90vh;padding:12px;background:#d4d0c8;color:#111;border:2px solid #222;}
#home-video-dialog video {display:block;width:100%;max-height:72vh;background:#000;}
#home-video-dialog::backdrop {background:#0009;}
