/* EdgyGeo arcade: RetroWindowsGUI skin. Every frame, button, bevel, scrollbar arrow and title-bar glyph below is a sprite from assets/ui/retro (the RetroWindowsGUI pack),
   icons are from the pixel-art generic icon pack. Loaded after games.css, only touches .gm */
.gm { --face:#d4d0c8; --hi:#ffffff; --lo:#808080; --dk:#404040; --navy:#000080; 
  background:#008080; image-rendering:pixelated; padding-bottom:36px; gap:0; }
.gm.booting { background:#000; }
.gm, .gm *, .gm button { font-family:Mc, monospace !important; }
.gm { font-size:16px; line-height:20px; }
.gm img { image-rendering:pixelated; }
.lu { display:inline-block; width:1em; height:1em; background:currentColor; -webkit-mask:var(--m) center / contain no-repeat; mask:var(--m) center / contain no-repeat; vertical-align:-.125em; flex:none; }

/* desktop icons */
.ng-desk { position:absolute; left:10px; top:10px; bottom:46px; display:grid; grid-auto-flow:column; grid-template-rows:repeat(auto-fill, 92px); grid-auto-columns:100px; gap:4px 4px; align-content:start; pointer-events:none; z-index:0; }
.ng-bin { position:absolute; right:10px; bottom:46px; z-index:0; }
.gm.booting .ng-desk, .gm.booting .ng-bin { display:none; }
.gm .ng-ic { pointer-events:auto; display:flex; flex-direction:column; align-items:center; gap:4px; width:96px; padding:3px 0; background:none; border:1px solid transparent; color:#fff; text-align:center; cursor:default; }
.ng-ic .ng-pxi { width:48px; height:48px; display:block; }
.ng-ic span { display:block; font-size:16px; line-height:18px; padding:0; max-width:100%; overflow-wrap:normal; word-break:keep-all; }
.ng-ic.sel { border:1px dotted #fff; } .ng-ic.sel span { background:#000080; } .ng-ic.sel .ng-pxi { filter:brightness(.7) sepia(1) hue-rotate(190deg) saturate(4); }
@media (max-width:760px) { .ng-desk { grid-template-rows:repeat(auto-fill, 86px); } .ng-ic { width:72px; } .ng-ic .ng-pxi { width:36px; height:36px; } .ng-bin { display:none; } }
@media (max-width:560px), (max-height:560px) { .ng-desk, .ng-bin { display:none; } }

/* window frame + title bar: Window_Header is nine-sliced (25px top = bevel + 22px navy bar) */
.gm .ng-win { padding:0; width:calc(var(--s) * 304px + 14px); border-style:solid; border-width:25px 3px 3px 3px; border-color:transparent; border-image:url("../assets/ui/retro/window_header.png") 25 3 3 3 fill stretch; background:none; box-shadow:4px 4px 0 rgba(0,0,0,.45); z-index:1; image-rendering:pixelated; }
.gm .ng-title { height:22px; margin:-22px 0 0; padding:0 2px 0 3px; gap:5px; background:none; border-radius:0; align-items:center; position:relative; z-index:1; }
.gm .ng-title b { font:700 16px/22px Mc, monospace !important; color:#fff; letter-spacing:0; }
.gm .ng-ico, .gm .ng-tki { width:16px; height:16px; flex:none; }
.gm .ng-tb { gap:2px; }
.gm .ng-tb button, .gm .ng-go, .gm .ng-ok, .gm .ng-pad button, .gm .ng-start, .gm .ng-tk { border:3px solid transparent; border-image:url("../assets/ui/retro/windows_button.png") 3 fill stretch; background:none; box-shadow:none; border-radius:0; color:#000; image-rendering:pixelated; }
.gm .ng-tb button { position:relative; width:22px; height:20px; padding:0; background:none; }
/* the glyph is its own layer: border-image "fill" paints the button face over any background, so a background glyph is hidden */
.gm .ng-tb button::before { content:""; display:block; position:absolute; inset:0; background:url("../assets/ui/retro/windows_icons.png") no-repeat; background-position:var(--ix, -48px) -1px; image-rendering:pixelated; pointer-events:none; }
.gm .ng-tb button::after { display:none; }
.gm .ng-tb i { display:none; }
.gm .ng-min { --ix:-96px; } .gm .ng-max { --ix:-80px; } .gm .ng-x { --ix:-48px; }
.gm .ng-tb button:active, .gm .ng-go:active, .gm .ng-ok:active, .gm .ng-pad button.dn, .gm .ng-start.on, .gm .ng-start:active { border-image-source:url("../assets/ui/retro/windows_button_pressed.png"); }
.gm .ng-tb .ng-min::before, .gm .ng-tb .ng-max::before { opacity:.45; }
.gm .ng-go:focus-visible, .gm .ng-ok:focus-visible, .gm .ng-pad button:focus-visible { outline:0; border-image-source:url("../assets/ui/retro/windows_button_focus_outlined.png"); }
.gm .ng-go { min-width:84px; padding:3px 12px; margin:auto 6px 0 0; }
.gm .ng-ok { min-width:84px; padding:3px 12px; }

/* menus */
.gm .ng-menu { padding:2px 2px; background:var(--face); border-bottom:1px solid var(--lo); box-shadow:0 1px 0 var(--hi); }
.gm .ng-menu button { padding:0 8px; border:0; background:none; border-radius:0; }
.gm .ng-menu button:hover, .gm .ng-menu button.on { background:var(--navy); color:#fff; border:0; }
.gm .ng-drop { top:52px; padding:3px; border:3px solid transparent; border-image:url("../assets/ui/retro/window_base.png") 3 fill stretch; box-shadow:3px 3px 0 rgba(0,0,0,.4); background:none; }
.gm .ng-drop button { padding:1px 10px 1px 2px; }
.gm .ng-drop button:hover { background:var(--navy); color:#fff; } .gm .ng-drop button:hover em { color:#fff; }
.gm .ng-drop hr { border-top:1px solid var(--lo); border-bottom:1px solid var(--hi); margin:3px 1px; }

/* client, list, preview: sunken frames are Windows_Inner_Frame_Inverted */
.gm .ng-client, .gm .ng-lb, .gm .ng-prev, .gm .ng-pc, .gm .ng-status span { border:2px solid transparent; border-image:url("../assets/ui/retro/windows_inner_frame_inverted.png") 2 stretch; }
.gm .ng-client { margin:2px; background:#000; }
.gm .ng-list { background:var(--face); gap:0 8px; padding:8px; }
.gm .ng-lh { font-weight:700; color:#000; padding-bottom:4px; }
.gm .ng-lb { background:#fff; }
.gm .ng-lb li { border:1px solid transparent; padding:1px 6px; }
.gm .ng-lb li.sel { background:var(--navy); color:#fff; border:1px dotted #ffff80; } .gm .ng-lb li.sel span { color:#c0c0c0; }
.gm .ng-prev { gap:6px; padding:6px; align-items:stretch; background:var(--face); border-radius:0; }
.gm .ng-pc { align-self:center; width:calc(100% - 12px); max-width:calc(96px * var(--s) * 1.4); height:auto; aspect-ratio:96 / 72; margin:0; background:#000; box-shadow:none; }
.gm .ng-pt { order:-1; margin:0; padding:1px 6px; font-size:16px; color:#fff; background:var(--navy); text-shadow:none; }
.gm .ng-pd { padding:0 4px; color:#000; } .gm .ng-pb { padding:0 4px; color:#000080; }

/* status bar */
.gm .ng-status { padding:2px; gap:2px; background:var(--face); }
.gm .ng-status span { padding:0 6px; border-width:2px; }

/* message box */
.gm .ng-msgbox { padding:0; width:min(340px, 92%); border-style:solid; border-width:25px 3px 3px 3px; border-color:transparent; border-image:url("../assets/ui/retro/window_header.png") 25 3 3 3 fill stretch; background:none; box-shadow:4px 4px 0 rgba(0,0,0,.5); overflow:visible; }
.gm .ng-msgbox .ng-title { margin:-22px 0 0; height:22px; background:none; }
.gm .ng-msgbox .ng-title b { line-height:22px; }
.gm .ng-mb { padding:14px 14px 10px; }

/* taskbar */
.gm .ng-task { height:34px; padding:3px 3px; gap:4px; border-top:2px solid var(--hi); background:var(--face); box-shadow:0 -1px 0 var(--lo); }
.gm .ng-start { height:28px; margin:0; padding:0 8px 0 4px; gap:4px; display:flex; align-items:center; }
.gm .ng-start b { font:700 16px/20px Mc, monospace !important; color:#000; }
.gm .ng-start .ng-flag { width:16px; height:16px; margin:0; flex:none; image-rendering:pixelated; }
.gm .ng-sep { display:none; }
.gm .ng-tk { height:28px; min-width:150px; margin:0; padding:0 8px; gap:6px; display:flex; align-items:center; border-image-source:url("../assets/ui/retro/windows_button_pressed.png"); font-weight:700; color:#000; }
.gm .ng-tray { height:28px; margin:0 0 0 auto; padding:0 10px; gap:8px; display:flex; align-items:center; border:2px solid transparent; border-image:url("../assets/ui/retro/windows_inner_frame_inverted.png") 2 stretch; background:none; color:#000; }
.gm .ng-tray time { color:#000; font-size:16px; }
.gm .ng-smenu { left:0; bottom:34px; width:200px; padding:3px; border:3px solid transparent; border-image:url("../assets/ui/retro/window_base.png") 3 fill stretch; background:none; box-shadow:3px 0 0 rgba(0,0,0,.35); overflow:visible; }
.gm .ng-smenu::before { content:none; }
.gm .ng-smenu button { padding:5px 10px; gap:10px; } .gm .ng-smenu button:hover { background:var(--navy); color:#fff; }

/* scrollbars: arrows come from Windows_Icons, track from Windows_SideBar_Underside, thumb/buttons from Windows_Button */
.gm ::-webkit-scrollbar { width:16px; height:16px; }
.gm ::-webkit-scrollbar-track { background:url("../assets/ui/retro/windows_sidebar_underside.png"); }
.gm ::-webkit-scrollbar-thumb { background:var(--face); border:3px solid transparent; border-image:url("../assets/ui/retro/windows_button.png") 3 fill stretch; }
.gm ::-webkit-scrollbar-button:single-button { width:16px; height:16px; background:var(--face) url("../assets/ui/retro/windows_icons.png") no-repeat; border:3px solid transparent; border-image:url("../assets/ui/retro/windows_button.png") 3 fill stretch; background-origin:border-box; }
.gm ::-webkit-scrollbar-button:single-button:vertical:decrement { background-position:-16px 0; }
.gm ::-webkit-scrollbar-button:single-button:vertical:increment { background-position:0 0; }
.gm ::-webkit-scrollbar-button:single-button:horizontal { background-image:none; }
.gm { scrollbar-color:#d4d0c8 #eceae6; }

/* boot keeps its terminal look */
.gm .ng-boot { background:#000; }
@media (prefers-reduced-motion:no-preference) {
  .gm:not(.booting) .ng-win { animation:xpOpen .16s steps(4) both; }
}
@keyframes xpOpen { from { opacity:0; } to { opacity:1; } }

/* the title bar is the drag handle */
.gm .ng-win > .ng-title { cursor:default; user-select:none; -webkit-user-select:none; touch-action:none; }
.gm .ng-win.dragging { will-change:translate; }
.gm.touch .ng-tb button::before { background-position:calc(var(--ix, -48px) + 3px) 0; }
.gm .ng-tb .ng-min, .gm .ng-tb .ng-max { opacity:1; }
