/* Interactive desktop: taskbar strip, open animation, My Projects explorer,
   project viewers. Chrome variables come from .jg-win in profile.css. */

/* ---- taskbar strip for overlay windows (the emulator owns #task-buttons) ---- */
#jg-taskstrip { display: flex; gap: 2px; min-width: 0; margin-right: 2px; }
#jg-taskstrip:empty { display: none; }
#jg-taskstrip .jg-taskbtn {
  display: flex; align-items: center; gap: 4px; min-width: 0; max-width: 160px; height: 22px; padding: 0 6px;
  font: 11px "MS Sans Serif", Tahoma, Arial, sans-serif; color: #000; text-align: left; background: #c0c0c0;
  border: 1px solid; border-color: #fff #000 #000 #fff; box-shadow: inset -1px -1px #808080, inset 1px 1px #dfdfdf; cursor: default;
}
#jg-taskstrip .jg-taskbtn img { width: 16px; height: 16px; flex-shrink: 0; }
#jg-taskstrip .jg-taskbtn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#jg-taskstrip .jg-taskbtn.jg-on {
  font-weight: bold; border-color: #000 #fff #fff #000; box-shadow: inset 1px 1px #808080;
  background: repeating-conic-gradient(#c0c0c0 0 25%, #fff 0 50%) 0 0 / 2px 2px;
}
body.app-running #jg-taskstrip, body.single-app #jg-taskstrip { display: none; }

/* ---- Win98 open/close "zoom" rectangle ---- */
.jg-zoom {
  position: absolute; z-index: 99; pointer-events: none; box-sizing: border-box;
  border: 2px solid #808080; background: linear-gradient(#000080 0 18px, transparent 18px);
  transition: left .2s ease-out, top .2s ease-out, width .2s ease-out, height .2s ease-out, opacity .2s;
}
@media (prefers-reduced-motion: reduce) { .jg-zoom { display: none; } }

/* ---- menu bar ---- */
.jg-menubar { display: flex; flex-shrink: 0; margin: 0 3px; padding: 1px 0; position: relative; }
.jg-menubar > button {
  padding: 2px 7px; font: inherit; color: #000; background: none; border: 1px solid transparent; cursor: default;
}
.jg-menubar > button:hover, .jg-menubar > button[aria-expanded="true"] { border-color: var(--hi) var(--shadow) var(--shadow) var(--hi); }
.jg-menubar > button[aria-expanded="true"] { border-color: var(--shadow) var(--hi) var(--hi) var(--shadow); }
.jg-menu {
  position: absolute; top: 100%; z-index: 20; min-width: 160px; padding: 2px; background: var(--face);
  border: 1px solid; border-color: var(--lite) var(--dark) var(--dark) var(--lite);
  box-shadow: inset 1px 1px var(--hi), inset -1px -1px var(--shadow), 2px 2px 0 rgba(0,0,0,.25);
}
.jg-menu[hidden] { display: none; }
.jg-menu button {
  display: flex; gap: 8px; width: 100%; padding: 3px 20px 3px 6px; font: inherit; color: #000; text-align: left;
  background: none; border: 0; cursor: default;
}
.jg-menu button::before { content: ""; width: 10px; text-align: center; }
.jg-menu button[aria-checked="true"]::before { content: "\25CF"; font-size: 8px; line-height: 16px; }
.jg-menu button:hover, .jg-menu button:focus-visible { background: var(--navy); color: #fff; outline: none; }
.jg-menu hr { margin: 3px 1px; border: 0; border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--hi); }

/* ---- My Projects explorer ---- */
.jg-exp-toolbar { display: flex; align-items: center; gap: 1px; flex-shrink: 0; margin: 0 3px; padding: 2px;
  border-top: 1px solid var(--hi); border-bottom: 1px solid var(--shadow); box-shadow: 0 1px var(--hi); }
.jg-exp-toolbar .jg-tool { flex-direction: column; justify-content: center; gap: 0; height: 40px; min-width: 50px; padding: 0 6px; font-size: 11px; }
.jg-exp-toolbar .jg-tool b { font: 17px/1 "Segoe UI Symbol", Tahoma, sans-serif; }
.jg-exp-toolbar .jg-tool:disabled { color: var(--shadow); text-shadow: 1px 1px var(--hi); border-color: transparent; }
.jg-exp-address { display: flex; align-items: center; gap: 6px; flex-shrink: 0; margin: 2px 3px 3px; padding: 0 2px; }
.jg-exp-address label { color: #000; }
.jg-exp-address output {
  flex: 1; display: flex; align-items: center; gap: 4px; height: 21px; padding: 0 4px; background: #fff;
  border: 2px solid; border-color: var(--shadow) var(--hi) var(--hi) var(--shadow); box-shadow: inset 1px 1px var(--dark);
  white-space: nowrap; overflow: hidden;
}
.jg-exp-address output img { width: 16px; height: 16px; }
.jg-exp-body {
  flex: 1; min-height: 0; display: flex; margin: 0 3px; background: #fff;
  border: 2px solid; border-color: var(--shadow) var(--hi) var(--hi) var(--shadow); box-shadow: inset 1px 1px var(--dark);
}
/* Windows 98 folder "web view": the left panel describes the selection. */
.jg-webview { width: 210px; flex-shrink: 0; overflow: auto; padding: 14px 14px 12px; background: #fff; border-right: 1px solid #e3e3e3; }
.jg-webview .jg-wv-icon { width: 32px; height: 32px; }
.jg-webview h2 { margin: 6px 0 4px; font: bold 17px/1.15 Verdana, Tahoma, sans-serif; color: #000; }
.jg-webview .jg-wv-rule { height: 3px; margin: 0 -14px 10px 0; background: linear-gradient(90deg, #ffc000, #ff7a00 30%, #1084d0 70%, transparent); }
.jg-webview h3 { margin: 0 0 3px; font: bold 12px Verdana, Tahoma, sans-serif; }
.jg-webview p { margin: 0 0 8px; font: 11px/1.45 Verdana, Tahoma, sans-serif; color: #222; }
.jg-webview .jg-wv-kind { color: #666; }
.jg-webview a { color: var(--navy); }
.jg-exp-view { flex: 1; min-width: 0; overflow: auto; outline: none; }
.jg-exp-view.jg-icons { display: grid; grid-template-columns: repeat(auto-fill, 86px); grid-auto-rows: 84px; gap: 6px 4px; align-content: start; padding: 10px; }
.jg-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 3px 2px; color: #000;
  background: none; border: 0; font: 11px/1.2 Tahoma, "MS Sans Serif", sans-serif; text-align: center; cursor: default;
}
.jg-item .jg-ico { position: relative; width: 32px; height: 32px; flex-shrink: 0; }
.jg-item .jg-ico img { width: 32px; height: 32px; display: block; }
.jg-item .jg-lbl { padding: 1px 2px; max-width: 82px; overflow-wrap: anywhere; }
.jg-item:focus { outline: none; }
.jg-item.jg-sel .jg-lbl { background: var(--navy); color: #fff; }
.jg-item.jg-sel:focus .jg-lbl { outline: 1px dotted #ffff80; outline-offset: -1px; }
.jg-item.jg-sel .jg-ico::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,128,.45); mix-blend-mode: multiply; }
.jg-item:hover .jg-lbl { text-decoration: underline; }
.jg-exp-view.jg-details { display: block; }
.jg-exp-view table { width: 100%; border-collapse: collapse; font: 11px Tahoma, sans-serif; }
.jg-exp-view th {
  position: sticky; top: 0; z-index: 1; padding: 2px 6px; text-align: left; font-weight: normal; background: var(--face);
  border: 1px solid; border-color: var(--hi) var(--shadow) var(--shadow) var(--hi);
}
.jg-exp-view td { padding: 1px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.jg-exp-view tr.jg-item { display: table-row; text-align: left; }
.jg-exp-view tr.jg-item td:first-child { display: flex; align-items: center; gap: 6px; }
.jg-exp-view tr.jg-item img { width: 16px; height: 16px; }
.jg-exp-view tr.jg-sel td:first-child span { background: var(--navy); color: #fff; padding: 0 2px; }

/* ---- project viewer ---- */
.jg-view-scroll { flex: 1; min-height: 0; overflow: auto; margin: 0 3px; background: #fff;
  border: 2px solid; border-color: var(--shadow) var(--hi) var(--hi) var(--shadow); box-shadow: inset 1px 1px var(--dark); }
.jg-stage { position: relative; display: grid; place-items: center; min-height: 220px; padding: 16px;
  background: radial-gradient(120% 90% at 50% 0%, #1b2a6b, #070b24 70%); }
.jg-stage.jg-light { background: linear-gradient(#f4f1ea, #ddd8cc); }
.jg-view-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px 4px; }
.jg-view-head img { width: 32px; height: 32px; }
.jg-view-head h2 { margin: 0; font: 22px/1.1 "Arial Black", "Archivo Black", Arial, sans-serif; color: var(--accent); }
.jg-view-head p { margin: 2px 0 0; color: var(--dim); font-style: italic; }
.jg-view-text { padding: 6px 20px 18px; font: 13px/1.6 Tahoma, "Segoe UI", Arial, sans-serif; color: var(--ink); max-width: 780px; }
.jg-view-text p { margin: 0 0 10px; }
.jg-view-text code { font: 12px "Lucida Console", Consolas, monospace; background: #f1f1f1; padding: 0 3px; }
.jg-view-text .jg-tags { color: #6b7390; font-size: 11.5px; letter-spacing: .02em; }
.jg-view-text .jg-links { display: none; }
.jg-feats { list-style: none; padding: 0; margin: 4px 0 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.jg-feats li { padding: 6px 8px; background: #f5f6fb; border-left: 3px solid var(--accent); font-size: 12px; color: #333; }
.jg-feats b { display: block; color: #000; }
.jg-view-buttons { display: flex; gap: 6px; flex-shrink: 0; justify-content: flex-end; padding: 6px 4px 2px; margin: 0 3px; }
.jg-view-buttons .jg-btn:disabled { color: var(--shadow) !important; text-shadow: 1px 1px var(--hi); }
.jg-view-buttons .jg-spacer { flex: 1; }
.jg-view-buttons .jg-btn { white-space: nowrap; }

/* gallery: one picture on stage, thumbnails under it */
.jg-gallery { display: grid; gap: 10px; justify-items: center; width: 100%; }
.jg-gallery .jg-shot { max-width: 100%; max-height: min(330px, 46vh); width: auto; height: auto; display: block;
  border: 2px solid; border-color: #dfdfdf #000 #000 #dfdfdf; box-shadow: 0 10px 30px rgba(0,0,0,.45); background: #111; animation: jg-shot .25s ease-out; }
@keyframes jg-shot { from { opacity: 0; transform: scale(.985); } }
.jg-thumbs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.jg-thumbs button { width: 64px; height: 44px; padding: 0; background: #000; border: 2px solid; border-color: #808080 #fff #fff #808080; cursor: pointer; }
.jg-thumbs button img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .65; }
.jg-thumbs button[aria-current="true"] { border-color: #ffd200; }
.jg-thumbs button[aria-current="true"] img, .jg-thumbs button:hover img { opacity: 1; }

/* phones: a row of handsets, scroll-snapped, with the middle one forward */
.jg-phones { display: flex; justify-content: safe center; gap: 18px; width: 100%; overflow-x: auto; padding: 6px 20px 12px; scroll-snap-type: x mandatory;
  scrollbar-width: thin; scrollbar-color: #5a6ab8 transparent; }
.jg-phone { flex: 0 0 auto; scroll-snap-align: center; width: 150px; padding: 8px 6px 12px; border-radius: 22px; background: #0b0b0c;
  box-shadow: 0 0 0 2px #2b2b30, 0 14px 30px rgba(0,0,0,.55); transition: transform .25s ease; }
.jg-phone:nth-child(odd) { transform: translateY(8px) rotate(-1.5deg); }
.jg-phone:nth-child(even) { transform: translateY(-4px) rotate(1.5deg); }
.jg-phone:hover { transform: translateY(-8px) scale(1.04); }
.jg-phone img { width: 100%; height: auto; display: block; border-radius: 14px; }
.jg-phones::before, .jg-phones::after { content: ""; flex: 0 0 1px; }

/* terminal: an MS-DOS Prompt window that types itself */
.jg-term { width: min(620px, 100%); background: #000; color: #c0c0c0;
  border: 2px solid; border-color: #dfdfdf #000 #000 #dfdfdf; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.jg-term-bar { display: flex; align-items: center; gap: 6px; padding: 2px 4px; background: linear-gradient(90deg, #000080, #1084d0); color: #fff; font: bold 11px Tahoma, sans-serif; }
.jg-term-bar i { flex: 1; font-style: normal; }
.jg-term-bar button { font: 10px Tahoma, sans-serif; padding: 0 5px; background: #c0c0c0; border: 1px solid; border-color: #fff #000 #000 #fff; }
.jg-term-body { display: flex; min-height: 150px; font: 13px/1.5 "Lucida Console", "Cascadia Mono", Consolas, monospace; }
.jg-term-tabs { display: flex; flex-direction: column; gap: 2px; padding: 8px 6px; border-right: 1px solid #333; background: #0c0c14; }
.jg-term-tabs span { padding: 2px 8px; color: #8a90a8; white-space: nowrap; font-size: 12px; }
.jg-term-tabs span:first-child { color: #fff; background: #1c2350; border-left: 2px solid #ffd200; }
.jg-term-out { flex: 1; min-width: 0; padding: 8px 10px; white-space: pre; overflow-x: auto; }
.jg-term-out > span { display: block; }
.jg-term .g { color: #55ff55; } .jg-term .y { color: #ffff55; } .jg-term .b { color: #55ffff; } .jg-term .d { color: #808080; }
.jg-caret { display: inline-block; width: .6em; height: 1em; vertical-align: -2px; background: #c0c0c0; animation: jg-blink 1s steps(1) infinite; }
@keyframes jg-blink { 50% { opacity: 0; } }

/* text-only projects get a big glyph on stage */
.jg-bigicon { display: grid; place-items: center; width: 120px; height: 120px; font-size: 64px; line-height: 1;
  background: #c0c0c0; border: 2px solid; border-color: #fff #000 #000 #fff; box-shadow: inset -2px -2px #808080, 0 12px 30px rgba(0,0,0,.45); }
.jg-bigicon img { width: 64px; height: 64px; image-rendering: pixelated; }

@media (max-width: 760px) {
  .jg-webview { display: none; }
  .jg-exp-toolbar .jg-tool { min-width: 42px; }
  .jg-exp-toolbar .jg-tool span { display: none; }
  .jg-stage { min-height: 170px; padding: 12px 6px; }
  .jg-view-head { padding: 12px 14px 2px; }
  .jg-view-head h2 { font-size: 19px; }
  .jg-view-text { padding: 6px 14px 14px; }
  .jg-phone { width: 128px; }
  .jg-term-tabs { display: none; }
  .jg-term-out { font-size: 11.5px; }
  .jg-view-buttons { gap: 4px; }
  .jg-view-buttons [data-jg="close"], .jg-view-buttons .jg-spacer { display: none; }
  .jg-view-buttons .jg-btn { min-width: 0; flex: 1; padding: 0 6px; }
  .jg-view-links { display: contents; }
}
