* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  font-family: 'VT323', monospace;
  font-size: 18px;
  color: #7FA8FF;
  background-color: #050718;
  background: url('../../assets/wallpaper.png') repeat center center;
  background-size: cover;
  text-rendering: optimizeSpeed;
}

body.desktop {
  overflow: hidden;
}

@media (max-width: 900px) {
  body.desktop {
    overflow: auto;
  }
}

/* ======= WORKINGTITLE BANNER ======= */
.site-banner {
  position: fixed;
  top: 12px;
  left: 20px;
  z-index: 10;
  pointer-events: none;
}

.glitch {
  position: relative;
  font-family: 'VT323', monospace;
  font-size: 48px;
  color: #70e6d5;
  letter-spacing: 2px;
  text-shadow: 2px 2px 0 #000;
  animation: glitch-drift 12s infinite;
}

/* RGB layers */
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  overflow: hidden;
  opacity: 0;
}

.glitch::before {
  color: #70e6d5;
  transform: translate(0, 0);
  animation: glitch-rgb-before 12s infinite;
}

.glitch::after {
  color: #6107f1;
  transform: translate(0, 0);
  animation: glitch-rgb-after 12s infinite;
}

@keyframes glitch-drift {
  0%, 97%, 100% {
    transform: none;
  }
  98% {
    transform: translateX(6px);
  }
  99% {
    transform: translateX(-2px);
  }
}

/* Cyan layer with subtle flicker */
@keyframes glitch-rgb-before {
  0%, 90%, 100% {
    opacity: 0;
    transform: translateX(0);
  }
  91% {
    opacity: 1;
    transform: translateX(3px);
  }
  92% {
    opacity: 1;
    transform: translateX(-2px);
  }
  93%, 99% {
    opacity: 1;
    transform: translateX(1px);
  }
}

/* Purple-y layer */
@keyframes glitch-rgb-after {
  0%, 92%, 100% {
    opacity: 0;
    transform: translateX(0);
  }
  93% {
    opacity: 1;
    transform: translateX(-3px);
  }
  94% {
    opacity: 1;
    transform: translateX(2px);
  }
  95%, 99% {
    opacity: 1;
    transform: translateX(-1px);
  }
}

/* ======= DESKTOP ICONS AND FOLDERS ======= */
.desktop-folders {
  position: absolute;
  inset: 0;
  top: 40px;
  left: 40px;
  width: calc(50% - 60px);
  height: calc(100% - 80px);
  z-index: 10;
  pointer-events: none;
}

.folder-icon {
  position: absolute;
  z-index: 20;
  pointer-events: auto;
  width: 90px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  touch-action: none;
  -webkit-user-drag: none;
  transition: transform 0.08s ease;
}

.folder-icon.dragging {
  cursor: grabbing;
  transform: scale(0.96);
}

.folder-icon:active {
  transform: scale(0.96);
  cursor: grabbing;
}

/* Default icon sizes */
.folder-icon img {
  width: 70px;
  height: auto;
  display: block;
  margin: 0 auto;
  -webkit-user-drag: none;
}

/* Override size for certain icons so they're all equal */
.folder-icon[data-file="start"] img {
  width: 90px;
}

.folder-icon[data-file="colors"] img {
  height: 100px;
  width: auto;
}

.folder-icon[data-file="textAnimation"] img {
  height: 70px;
  width: auto;
}

.folder-label {
  margin-top: 4px;
  font-size: 16px;
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 4px;
  border-radius: 2px;
}

.folder-icon:hover .folder-label {
  background: rgba(50, 120, 255, 0.7);
  filter: brightness(1.2);
}

/* ======= DESKTOP FOLDER POPUP WINDOWS ======= */
.folder-window {
  width: 400px;
  background: #bcbcbc;
  border: 2px solid #fff;
  border-right-color: #000;
  border-bottom-color: #000;
  box-shadow: 3px 3px 0 #000;
  position: absolute;
  top: 25%;
  left: 25%;
  transform: none;
  z-index: 150;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  overflow: hidden;
}

.folder-window .panel-header {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #3366cc;
  color: #fff;
  padding: 4px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
  border-bottom: 2px solid #000;
}

.panel,
.folder-window {
  transform: none !important;
}

.folder-window .panel-body {
  padding: 10px;
  background: #fff;
  color: #000;
  font-family: 'VT323', monospace;
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  background: #fff;
  color: #000;
}

.folder-window ul {
  list-style: none;
  padding-left: 0;
}

.folder-window li {
  padding: 4px 0;
  border-bottom: 1px solid #ddd;
}

/* ======= EDITOR ENVIRONMENT ======= */
.app-window {
  position: absolute;
  top: 40px;
  right: 40px;
  width: 720px;
  height: calc(100% - 120px);
  background: #bcbcbc;
  border: 2px solid #999;
  border-right-color: #000;
  border-bottom-color: #000;
  box-shadow: 8px 8px 0 #000;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.window-titlebar {
  background: #1A2050;
  color: #7FA8FF;
  font-weight: bold;
  font-size: 18px;
  padding: 4px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #2E45A3;
}

.window-titlebar h1 {
  margin: 0;
  line-height: 1;
  display: flex;
  align-items: center;
}

.window-titlebar .editor-toolbar {
  margin: 0;
  align-items: center;
}

.window-body {
  flex: 1;
  background: #d8d8d8;
  padding: 6px;
  display: flex;
  flex-direction: column;
}

/* ======= HTML/CSS/JS BOXES ======= */
.editor-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 2px solid #222;
  background: #050718;
  padding: 8px;
  height: auto;
  overflow: visible;
}

.editor-section {
  display: flex;
  flex-direction: column;
  border: 2px solid #5a5a8a;
  background: #d4d4d4;
  box-shadow: inset 0 0 0 2px #888;
}

.editor-label {
  background: #5b8bff;
  color: #050718;
  font-family: 'VT323', monospace;
  font-size: 18px;
  padding: 2px 8px;
  border-bottom: 2px solid #2e45a3;
  letter-spacing: 0.5px;
}

.editor {
  width: 100%;
  height: 150px;
  background: #1e1e1e;
  border-top: 1px solid #3a3a5c;
  color: #7FA8FF;
}

/* ======= RUN/RESET/LOAD EXAMPLE ======= */
.editor-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.editor-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1a1a1a;
  border: 1px solid #7FA8FF;
  padding: 6px 14px;
  font-family: 'VT323', monospace;
  font-size: 17px;
  letter-spacing: 0.5px;
  color: #9FD1FF;
  cursor: pointer;
  border-radius: 2px;
  filter: brightness(1) drop-shadow(1px 1px 0 #000);
  transition: transform 0.1s ease, filter 0.1s ease, background 0.1s ease;
}

.editor-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.2) drop-shadow(1px 1px 1px #000);
}

.editor-btn:active {
  transform: translateY(1px);
  filter: brightness(0.9) drop-shadow(0 0 0 #000);
}

.editor-hint {
  font-family: 'VT323', monospace;
  font-size: 16px;
  color: #546ddd;
  margin-left: 8px;
  margin-right: 8px;
}

/* ======= ABOUT/REFERENCES POPUPS ======= */
.panel {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  max-width: 700px;
  background: #bcbcbc;
  border: 2px solid #fff;
  border-right-color: #000;
  border-bottom-color: #000;
  box-shadow: 3px 3px 0 #000;
  z-index: 150;
}

.panel-header {
  background: #3366cc;
  color: #fff;
  padding: 4px 8px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
}

.panel-body {
  padding: 10px;
  background: #fff;
  color: #000;
}

.panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #c0c0c0;
  border: 1px solid #000;
  color: #1a1a1a;
  width: 20px;
  height: 20px;
  padding: 0;
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
  border-radius: 2px;
  cursor: pointer;
  filter: brightness(1) drop-shadow(1px 1px 0 #000);
  transition: transform 0.1s ease, filter 0.1s ease;
}

.panel-close:hover {
  transform: scale(1.1);
  filter: brightness(1.2) drop-shadow(1px 1px 1px #000);
}

.panel-close:active {
  transform: scale(0.95);
}

.hidden {
  display: none !important;
}

pre {
  white-space: pre;
  overflow-x: auto;
  background: #111;
  color: #9FD1FF;
  padding: 6px;
  border: 2px inset #444;
  font-family: 'VT323', monospace;
}

code {
  font-family: inherit;
}

/* ======= BOTTOM TASKBAR ======= */
.taskbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 12px;
  position: fixed;
  bottom: 0;
  left: 0;
  height: 40px;
  background: #0c0c0c;
  border-top: 2px solid #7FA8FF;
  z-index: 100;
}

.taskbar-left,
.taskbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 40px);
  margin: 0 20px;
}

.taskbar-left {
  flex: 1;
}

.taskbar-right {
  justify-content: flex-end;
  gap: 16px;
}

.taskbar-btn {
  background: #1a1a1a;
  border: 1px solid #7FA8FF;
  border-radius: 2px;
  color: #9FD1FF;
  font-family: 'VT323', monospace;
  font-size: 18px;
  padding: 2px 20px;
  cursor: pointer;
}

.taskbar-btn:hover {
  background: #7FA8FF;
  color: #0c0c0c;
}

.tray-clock {
  font-family: 'VT323', monospace;
  color: #70e6d5;
  font-size: 18px;
}

/* ======= GALLERY PAGE ======= */
.gallery-page {
  position: relative;
  min-height: 100vh;
  background-color: #261A73;
  background-image: url('../../assets/wallpaper.png');
  background-repeat: repeat;
  background-position: center center;
  background-size: cover;
  color: #1BF266;
  overflow-x: hidden;
}

.gallery-header {
  text-align: center;
  padding: 20px 20px 36px;
  color: #70e6d5;
  text-shadow: 2px 2px 0 #000;
}

.gallery-header h1 {
  font-family: 'VT323', monospace;
  font-size: 64px;
  letter-spacing: 3px;
  margin-bottom: 6px;
}

.gallery-header p {
  font-size: 22px;
  color: #f0f0f0;
  max-width: 680px;
  margin: 0 auto;
}

.highlight-link {
  color: #70e6d5;
  text-decoration: underline;
}

.highlight-link:hover {
  color: #70e6d5;
}

.gallery-wall {
  position: relative;
  width: min(1200px, 95vw);
  margin: 0 auto;
  padding: 36px 24px 140px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 42px 28px;
}

.gallery-wall::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 2px dashed rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.pin-card {
  position: relative;
  background: #f1f3fd;
  border: 1px solid #9fb2e7;
  border-radius: 6px;
  padding: 16px 16px 48px;
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.35), 0 6px 12px rgba(0, 0, 0, 0.22);
  transform: translate(var(--shift-x, 0px), var(--shift-y, 0px)) rotate(var(--tilt, -2deg));
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  width: min(360px, 100%);
  margin: 0 auto;
}

.pin-card:hover {
  transform: translate(0, -6px) rotate(0deg) scale(1.04);
  box-shadow: 0 26px 40px rgba(0, 0, 0, 0.45), 0 10px 20px rgba(0, 0, 0, 0.25);
  z-index: 10;
}

.pin-media {
  background: #06060a;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  position: relative;
  cursor: zoom-in;
}

.pin-media img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  filter: saturate(1.2);
}

.pin-media video {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  filter: saturate(1.2);
}

.pin-card figcaption {
  margin-top: 12px;
  font-family: 'VT323', monospace;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 18px;
  color: #ffffff;
  text-align: center;
}

.pin-card.polaroid {
  background: #dee1fb;
  border: 1px solid #d6dcf0;
  padding: 16px 16px 56px;
  box-shadow: 4px 6px 0 #000, 0 0 0 1px rgba(0, 0, 0, 0.32) !important;
  --tape1-left: 20px;
  --tape1-right: auto;
  --tape1-top: -18px;
  --tape1-bottom: auto;
  --tape1-rot: -9deg;
  --tape1-visible: 1;
  --tape2-left: auto;
  --tape2-right: 22px;
  --tape2-top: -18px;
  --tape2-bottom: auto;
  --tape2-rot: 7deg;
  --tape2-visible: 1;
}

.pin-card.polaroid figcaption {
  color: #0511F2;
}

.pin-card.polaroid:hover {
  box-shadow: 5px 7px 0 #000, 0 0 0 1px rgba(0, 0, 0, 0.38) !important;
}

.pin-card.polaroid::before,
.pin-card.polaroid::after {
  content: "";
  position: absolute;
  width: 92px;
  height: 26px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(230, 230, 230, 0.65));
  opacity: 0.9;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);
  z-index: 1;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.pin-card.polaroid::before {
  left: var(--tape1-left);
  right: var(--tape1-right);
  top: var(--tape1-top);
  bottom: var(--tape1-bottom);
  transform: rotate(var(--tape1-rot)) scale(var(--tape1-visible));
  opacity: var(--tape1-visible);
}

.pin-card.polaroid::after {
  left: var(--tape2-left);
  right: var(--tape2-right);
  top: var(--tape2-top);
  bottom: var(--tape2-bottom);
  transform: rotate(var(--tape2-rot)) scale(var(--tape2-visible));
  opacity: var(--tape2-visible);
}

.pin-card.polaroid.tape-single-left {
  --tape2-visible: 0;
}

.pin-card.polaroid.tape-single-right {
  --tape1-visible: 0;
}

.pin-card.polaroid.tape-diagonal-tl-br {
  --tape1-left: 12px;
  --tape1-top: -16px;
  --tape1-rot: -6deg;
  --tape2-right: 14px;
  --tape2-top: auto;
  --tape2-bottom: -18px;
  --tape2-rot: 8deg;
}

.pin-card.polaroid.tape-diagonal-tr-bl {
  --tape1-left: auto;
  --tape1-right: 12px;
  --tape1-top: -16px;
  --tape1-rot: 6deg;
  --tape2-left: 14px;
  --tape2-right: auto;
  --tape2-top: auto;
  --tape2-bottom: -18px;
  --tape2-rot: -8deg;
}

/* Polaroid tape angle/placement variety */
.gallery-wall .pin-card.polaroid:nth-of-type(1) {
  --tape1-rot: -15deg;
  --tape2-rot: 18deg;
}

.gallery-wall .pin-card.polaroid:nth-of-type(2) {
  --tape1-rot: -4deg;
  --tape2-rot: 22deg;
}

.gallery-wall .pin-card.polaroid:nth-of-type(3) {
  --tape1-rot: 14deg;
  --tape2-rot: -17deg;
}

.gallery-wall .pin-card.polaroid:nth-of-type(4) {
  --tape1-rot: -18deg;
  --tape2-rot: 8deg;
}

.gallery-wall .pin-card.polaroid:nth-of-type(5) {
  --tape1-rot: -9deg;
  --tape2-rot: 16deg;
}

.gallery-wall .pin-card.polaroid:nth-of-type(6) {
  --tape1-rot: 12deg;
  --tape2-rot: -14deg;
}

.gallery-wall .pin-card.polaroid:nth-of-type(7) {
  --tape1-rot: -6deg;
  --tape2-rot: 20deg;
}

.pin-card.sticky {
  background: #815ba9;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 18px 18px 52px;
  border-radius: 4px;
  --tape-width: 120px;
  --tape-height: 26px;
  --tape-rot: -2deg;
  --tape-l-x: 10%;
  --tape-r-x: 10%;
  --tape-l-rot: -10deg;
  --tape-r-rot: 8deg;
  box-shadow:
    4px 6px 0 #000,
    0 0 0 1px rgba(0, 0, 0, 0.28) !important;
}

.pin-card.sticky:hover {
  box-shadow:
    5px 7px 0 #000,
    0 0 0 1px rgba(0, 0, 0, 0.34) !important;
}

.pin-card.sticky::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%) rotate(var(--tape-rot));
  width: var(--tape-width);
  height: var(--tape-height);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(240, 240, 240, 0.6));
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
  border-radius: 3px;
  z-index: 1;
}

.tape-ripped.pin-card.polaroid::before,
.tape-ripped.pin-card.polaroid::after,
.tape-ripped.pin-card.sticky::before,
.tape-ripped.pin-card.sticky::after {
  clip-path: polygon(
    0 6%, 4% 10%, 0 16%, 6% 22%, 2% 30%, 8% 38%, 4% 50%, 10% 60%, 4% 70%, 8% 82%, 2% 90%, 0 98%,
    100% 98%, 96% 90%, 100% 82%, 94% 74%, 98% 64%, 92% 56%, 98% 48%, 92% 38%, 98% 30%, 94% 22%, 100% 14%, 96% 6%
  );
}

.tape-jagged.pin-card.polaroid::before,
.tape-jagged.pin-card.polaroid::after,
.tape-jagged.pin-card.sticky::before,
.tape-jagged.pin-card.sticky::after {
  clip-path: polygon(
    0 0,
    4% 8%, 0 16%, 5% 26%, 0 36%, 5% 48%, 0 58%, 5% 68%, 0 78%, 4% 88%, 0 100%,
    100% 100%,
    100% 88%, 95% 78%, 100% 68%, 95% 58%, 100% 48%, 95% 38%, 100% 28%, 95% 18%, 100% 8%, 96% 0
  );
}

/* Tape variation */
.gallery-wall .pin-card.sticky:nth-of-type(2) {
  --tape-rot: -8deg;
  --tape-width: 142px;
  --tape-height: 24px;
  --tape-l-x: 6%;
  --tape-r-x: 18%;
  --tape-l-rot: -14deg;
  --tape-r-rot: 6deg;
}

.gallery-wall .pin-card.sticky:nth-of-type(4) {
  --tape-rot: 5deg;
  --tape-width: 116px;
  --tape-height: 22px;
  --tape-l-x: 12%;
  --tape-r-x: 6%;
  --tape-l-rot: -6deg;
  --tape-r-rot: 14deg;
}

.gallery-wall .pin-card.sticky:nth-of-type(6) {
  --tape-rot: -3deg;
  --tape-width: 132px;
  --tape-height: 26px;
  --tape-l-x: 4%;
  --tape-r-x: 16%;
  --tape-l-rot: -18deg;
  --tape-r-rot: 2deg;
}

.gallery-wall .pin-card.sticky:nth-of-type(8) {
  --tape-rot: 9deg;
  --tape-width: 150px;
  --tape-height: 24px;
  --tape-l-x: 14%;
  --tape-r-x: 8%;
  --tape-l-rot: -10deg;
  --tape-r-rot: 16deg;
}

.pin-card.sticky .pin-media {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), 0 6px 10px rgba(0, 0, 0, 0.15);
}

.note-body {
  font-size: 18px;
  color: #ffffff;
  line-height: 1.3;
  display: grid;
  gap: 10px;
}

.note-callout {
  align-self: start;
  min-height: 260px;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2000;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 24, 0.8);
  backdrop-filter: blur(4px);
}

.lightbox-content {
  position: relative;
  width: min(1100px, 92vw);
  max-height: 90vh;
  background: #0b0e2a;
  border: 2px solid #70e6d5;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  padding: 16px 16px 20px;
  border-radius: 8px;
  display: grid;
  gap: 12px;
}

.lightbox-media {
  background: #02030d;
  border: 1px solid rgba(112, 230, 213, 0.3);
  border-radius: 6px;
  max-height: 74vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.lightbox-media img,
.lightbox-media video {
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}

.lightbox-caption {
  text-align: center;
  color: #70e6d5;
  font-family: 'VT323', monospace;
  font-size: 20px;
  letter-spacing: 1px;
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #c0c0c0;
  border: 1px solid #000;
  width: 26px;
  height: 26px;
  font-size: 18px;
  cursor: pointer;
  color: #1a1a1a;
  border-radius: 4px;
  display: grid;
  place-items: center;
  filter: brightness(1) drop-shadow(1px 1px 0 #000);
  transition: transform 0.1s ease, filter 0.1s ease;
  z-index: 1;
}

.lightbox-close:hover {
  transform: scale(1.05);
  filter: brightness(1.1) drop-shadow(1px 1px 1px #000);
}

/* ======= PREVIEW PANEL ======= */
#preview-panel {
  position: absolute;
  top: calc(50% - 200px);
  left: calc(50% - 350px);
  transform: none;
  width: 70%;
  max-width: 900px;
  background: #bcbcbc;
  border: 2px solid #fff;
  border-right-color: #000;
  border-bottom-color: #000;
  box-shadow: 3px 3px 0 #000;
  z-index: 999;
  cursor: default;
  transition: left 0.02s linear, top 0.02s linear;
}

#preview-panel .panel-header {
  background: #1A2050;
  color: #7FA8FF;
  font-family: 'VT323', monospace;
  font-size: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  border-bottom: 2px solid #2E45A3;
  cursor: move;
  pointer-events: auto;
}

#preview-panel .panel-close {
  background: #c0c0c0;
  border: 1px solid #000;
  width: 20px;
  height: 20px;
  font-size: 16px;
  cursor: pointer;
  color: #1a1a1a;
}

#preview-panel::after {
  content: '';
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, #777 25%, transparent 25%, transparent 50%, #777 50%, #777 75%, transparent 75%, transparent);
  background-size: 6px 6px;
  opacity: 0.4;
  pointer-events: none;
}

.preview-body {
  background: #050718;
  padding: 8px;
  height: 70vh;
  overflow: hidden;
}

.preview-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-actions .preview-btn {
  display: flex;
  background: #1a1a1a;
  border: 1px solid #435986;
  padding: 0;
  margin-left: 8px;
  cursor: pointer;
  filter: brightness(1) drop-shadow(1px 1px 0 #000);
  transition: transform 0.1s ease, filter 0.1s ease;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #7FA8FF;
  border-radius: 2px;
  padding: 6px 12px;
  font-family: 'VT323', monospace;
  font-size: 16px;
}

.preview-actions .preview-btn:hover {
  transform: scale(1.1);
  filter: brightness(1.3) drop-shadow(1px 1px 1px #000);
}

.preview-actions img {
  width: 18px;
  height: auto;
  image-rendering: pixelated;
}

.format-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #0e1337;
  border: 1px solid #435986;
  padding: 2px 6px;
  font-size: 12px;
  letter-spacing: 0.5px;
  border-radius: 2px;
  cursor: pointer;
  user-select: none;
}

.preview-actions {
  position: relative;
}

.save-menu {
  position: absolute;
  top: 46px;
  left: 8px;
  display: grid;
  gap: 4px;
  background: #0b0e2a;
  border: 1px solid #435986;
  border-radius: 4px;
  padding: 8px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
  z-index: 20;
}

.save-menu button {
  background: #1a1f4b;
  color: #7FA8FF;
  border: 1px solid #435986;
  padding: 6px 10px;
  font-family: 'VT323', monospace;
  font-size: 14px;
  border-radius: 2px;
  cursor: pointer;
  text-align: left;
}

.save-menu button:hover {
  background: #22307a;
}

.preview-actions .panel-close {
  margin-left: 8px;
  padding: 0;
  width: 20px;
  height: 20px;
  min-width: 20px;
  background: #c0c0c0;
  border: 1px solid #000;
  color: #1a1a1a;
  filter: brightness(1) drop-shadow(1px 1px 0 #000);
}

.panel {
  position: absolute;
  min-width: 320px;
  min-height: 200px;
  resize: none;
}

.resize-grip {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 18px;
  height: 18px;
  cursor: se-resize;
  background: linear-gradient(135deg, transparent 50%, #444 50%);
  opacity: 0.6;
}

.resize-grip:hover {
  opacity: 1;
}

/* ======= MOBILE LAYOUT ======= */
@media (max-width: 900px) {
  .site-banner {
    position: static;
    margin: 12px auto 0;
    text-align: center;
  }

  .desktop-folders {
    position: relative;
    inset: unset;
    width: 100%;
    height: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
    gap: 12px;
    pointer-events: auto;
    z-index: 5;
  }

  .folder-icon {
    position: relative;
    width: 86px;
    justify-self: center;
    left: auto !important;
    top: auto !important;
  }

  .folder-icon img {
    width: 64px;
  }

  .folder-label {
    font-size: 14px;
  }

  .app-window {
    position: relative;
    inset: 0;
    width: 100%;
    height: auto;
    margin-top: 12px;
    z-index: 1;
  }

  .window-body,
  .editor-container {
    height: auto;
  }

  .editor {
    height: 180px;
  }

  .panel,
  .folder-window,
  #preview-panel {
    position: relative;
    width: 100%;
    max-width: none;
    left: 0 !important;
    top: 0 !important;
    transform: none;
    height: auto;
    max-height: none;
    margin-top: 12px;
  }

  #preview-panel {
    height: 70vh;
  }

  .preview-body {
    height: calc(70vh - 48px);
  }

  .panel-header,
  #preview-panel .panel-header {
    cursor: default;
  }

  .resize-grip {
    display: none;
  }

  .taskbar {
    position: sticky;
    bottom: 0;
  }
}
