/* UGABUGA OS - Application-Specific Styles */
/* GAMIFIED RETRO ARCADE OS THEME */

/* ══════════════════════════════════════════
   GAME APP
══════════════════════════════════════════ */
.game-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  font-family: var(--font-retro);
  color: #00ff41;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
}
.game-loading-text {
  font-size: clamp(18px,3vw,28px);
  text-shadow: 0 0 12px rgba(0,255,65,0.8);
  animation: blink 1.2s step-end infinite;
  text-align: center;
  letter-spacing: 2px;
}
.game-bar-wrap {
  width: min(280px,70%);
  height: 20px;
  background: #050510;
  border: 1px solid rgba(0,255,65,0.4);
  overflow: hidden;
}
.game-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00cc33 0%, #00ff41 100%);
  box-shadow: 0 0 10px rgba(0,255,65,0.8);
  width: 0;
  animation: gameload 3s ease forwards;
}
@keyframes gameload { 0%{width:0} 60%{width:85%} 100%{width:100%} }
.game-sub {
  font-size: 12px;
  opacity: 0.5;
  font-family: var(--font-sys);
  text-align: center;
  color: rgba(0,255,65,0.6);
  letter-spacing: 1px;
}

/* ══════════════════════════════════════════
   MEME GENERATOR
══════════════════════════════════════════ */
.meme-gen-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.meme-gen-main {
  flex: 1;
  display: flex;
  overflow: hidden;
}
.meme-templates {
  width: 120px;
  flex-shrink: 0;
  border-right: 1px solid rgba(0,255,65,0.2);
  overflow-y: auto;
  background: #060612;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.meme-tpl-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  background: rgba(0,255,65,0.05);
  border: 1px solid rgba(0,255,65,0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: rgba(0,255,65,0.7);
  font-family: var(--font-sys);
  text-align: center;
  padding: 2px;
  transition: all 0.1s;
}
.meme-tpl-thumb:hover {
  border-color: #00ff41;
  background: rgba(0,255,65,0.1);
  box-shadow: 0 0 6px rgba(0,255,65,0.3);
}
.meme-tpl-thumb.selected {
  border: 2px solid #00e5ff;
  background: rgba(0,229,255,0.1);
  box-shadow: 0 0 8px rgba(0,229,255,0.4);
  color: #00e5ff;
}
.meme-preview-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #030310;
  margin: 4px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(0,255,65,0.1);
}
.meme-preview-canvas {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(0,255,65,0.2);
  font-family: var(--font-sys);
  font-size: 11px;
  color: rgba(0,255,65,0.4);
  flex-direction: column;
  gap: 4px;
  letter-spacing: 0.5px;
}
.meme-controls {
  width: 140px;
  flex-shrink: 0;
  border-left: 1px solid rgba(0,255,65,0.2);
  padding: 6px;
  background: #060612;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
}
.meme-controls label {
  font-family: var(--font-sys);
  font-size: 10px;
  color: rgba(0,255,65,0.7);
  letter-spacing: 0.3px;
}
.meme-controls input,
.meme-controls select {
  width: 100%;
  font-family: var(--font-sys);
  font-size: 10px;
  padding: 3px 5px;
  background: rgba(0,255,65,0.05);
  color: #00ff41;
  border: 1px solid rgba(0,255,65,0.3);
  outline: none;
}
.meme-controls input:focus,
.meme-controls select:focus {
  border-color: #00ff41;
  box-shadow: 0 0 6px rgba(0,255,65,0.3);
}
.meme-gen-btn {
  width: 100%;
  margin-top: 4px;
  background: rgba(0,255,65,0.1);
  border: 1px solid rgba(0,255,65,0.5);
  color: #00ff41;
  font-family: var(--font-sys);
  font-size: 10px;
  padding: 4px 0;
  cursor: pointer;
  letter-spacing: 0.5px;
  text-shadow: 0 0 6px rgba(0,255,65,0.6);
  transition: all 0.1s;
}
.meme-gen-btn:hover {
  background: rgba(0,255,65,0.2);
  box-shadow: 0 0 8px rgba(0,255,65,0.4);
}
.meme-statusbar {
  height: 18px;
  background: #060612;
  border-top: 1px solid rgba(0,255,65,0.2);
  padding: 0 8px;
  display: flex;
  align-items: center;
  font-family: var(--font-sys);
  font-size: 9px;
  color: rgba(0,255,65,0.5);
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

/* ══════════════════════════════════════════
   MEME GALLERY (legacy layout classes)
══════════════════════════════════════════ */
.gallery-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.gallery-addressbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px;
  background: #0d0d20;
  border-bottom: 1px solid rgba(0,255,65,0.2);
  flex-shrink: 0;
  height: 24px;
}
.gallery-addressbar label {
  font-family: var(--font-sys);
  font-size: 10px;
  color: rgba(0,255,65,0.6);
  white-space: nowrap;
}
.gallery-addr-input {
  flex: 1;
  font-family: var(--font-sys);
  font-size: 11px;
  padding: 1px 6px;
  background: rgba(0,255,65,0.04);
  color: rgba(0,255,65,0.8);
  border: 1px solid rgba(0,255,65,0.25);
  height: 18px;
  outline: none;
  letter-spacing: 0.5px;
}
.gallery-main {
  flex: 1;
  display: flex;
  overflow: hidden;
}
.gallery-tree {
  width: 150px;
  flex-shrink: 0;
  border-right: 1px solid rgba(0,255,65,0.2);
  overflow-y: auto;
  background: #060612;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
}
.gallery-tree-item {
  font-family: var(--font-sys);
  font-size: 11px;
  color: rgba(0,255,65,0.7);
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  user-select: none;
  border-left: 2px solid transparent;
  transition: all 0.1s;
}
.gallery-tree-item svg {
  width: 14px; height: 14px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 2px rgba(0,255,65,0.5));
}
.gallery-tree-item:hover {
  background: rgba(0,255,65,0.1);
  color: #00ff41;
  border-left-color: #00ff41;
  text-shadow: 0 0 6px rgba(0,255,65,0.6);
}
.gallery-tree-item.selected {
  background: rgba(0,255,65,0.15);
  color: #00ff41;
  border-left-color: #00ff41;
  box-shadow: inset 0 0 8px rgba(0,255,65,0.08);
}
.gallery-files {
  flex: 1;
  overflow-y: auto;
  background: #080818;
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
}
.gallery-file {
  width: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 4px;
  gap: 2px;
  border: 1px solid transparent;
  transition: all 0.1s;
}
.gallery-file:hover {
  background: rgba(0,255,65,0.1);
  border-color: rgba(0,255,65,0.4);
  box-shadow: 0 0 8px rgba(0,255,65,0.2);
}
.gallery-file:hover .gallery-file-name { color: #00ff41; }
.gallery-file-icon { width: 32px; height: 32px; }
.gallery-file-icon svg { width: 100%; height: 100%; }
.gallery-file-name {
  font-family: var(--font-sys);
  font-size: 9px;
  color: rgba(0,255,65,0.7);
  text-align: center;
  word-break: break-all;
  line-height: 1.2;
}

/* ══════════════════════════════════════════
   EXPLORER / FILE MANAGER (new classes)
══════════════════════════════════════════ */
.explorer-wrap {
  background: #080818;
  color: #00ff41;
  font-family: var(--font-sys);
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.explorer-toolbar {
  background: #0d0d20;
  border-bottom: 1px solid rgba(0,255,65,0.3);
  padding: 4px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.exp-btn {
  background: rgba(0,255,65,0.08);
  border: 1px solid rgba(0,255,65,0.35);
  color: #00ff41;
  font-family: var(--font-sys);
  font-size: 10px;
  padding: 2px 8px;
  cursor: pointer;
  letter-spacing: 0.3px;
  margin-right: 2px;
  transition: all 0.1s;
  outline: none;
}
.exp-btn:hover {
  background: rgba(0,255,65,0.2);
  box-shadow: 0 0 6px rgba(0,255,65,0.3);
}
.exp-btn:disabled {
  opacity: 0.3;
  cursor: default;
  box-shadow: none;
}
.exp-address {
  display: inline-flex;
  align-items: center;
  background: rgba(0,255,65,0.04);
  border: 1px solid rgba(0,255,65,0.25);
  padding: 2px 8px;
  font-size: 10px;
  color: rgba(0,255,65,0.8);
  letter-spacing: 0.5px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.explorer-sidebar {
  background: #060612;
  border-right: 1px solid rgba(0,255,65,0.2);
  width: 160px;
  padding: 8px 0;
  flex-shrink: 0;
  overflow-y: auto;
}
.sidebar-header {
  font-size: 9px;
  color: rgba(0,255,65,0.5);
  letter-spacing: 2px;
  padding: 0 10px 8px 10px;
  border-bottom: 1px solid rgba(0,255,65,0.15);
  margin-bottom: 4px;
  text-transform: uppercase;
}
.sidebar-item {
  padding: 8px 10px;
  cursor: pointer;
  font-size: 11px;
  color: rgba(0,255,65,0.7);
  border-left: 2px solid transparent;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.sidebar-item:hover {
  background: rgba(0,255,65,0.1);
  color: #00ff41;
  border-left-color: #00ff41;
  text-shadow: 0 0 6px rgba(0,255,65,0.6);
}
.sidebar-item.active {
  background: rgba(0,255,65,0.15);
  color: #00ff41;
  border-left-color: #00ff41;
  box-shadow: inset 0 0 10px rgba(0,255,65,0.08);
}
.folder-count {
  color: rgba(0,255,65,0.4);
  font-size: 9px;
  margin-left: auto;
  flex-shrink: 0;
}
.explorer-statusbar {
  background: #060612;
  border-top: 1px solid rgba(0,255,65,0.2);
  padding: 3px 10px;
  font-size: 9px;
  color: rgba(0,255,65,0.5);
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.explorer-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  opacity: 0.4;
}
.welcome-icon { font-size: 48px; }
.welcome-text {
  font-family: var(--font-sys);
  font-size: 11px;
  color: #00ff41;
  letter-spacing: 1px;
  margin-top: 10px;
}

/* ══════════════════════════════════════════
   WHITEPAPER VIEWER
══════════════════════════════════════════ */
.wp-view {
  flex: 1;
  overflow: auto;
  background: #030310;
  display: flex;
  align-items: center;
  justify-content: center;
}
.whitepaper-frame {
  width: 100%; height: 100%;
  border: none;
  background: #fff;
}
.wp-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #030310;
}
.wp-placeholder-box {
  background: rgba(0,255,65,0.04);
  padding: 30px 40px;
  text-align: center;
  font-family: var(--font-sys);
  font-size: 11px;
  color: rgba(0,255,65,0.8);
  border: 1px solid rgba(0,255,65,0.3);
  box-shadow: 0 0 20px rgba(0,255,65,0.15);
  max-width: 300px;
}
.wp-placeholder-box code {
  font-family: var(--font-retro);
  font-size: 13px;
  color: #00e5ff;
  background: rgba(0,229,255,0.1);
  padding: 1px 4px;
  text-shadow: 0 0 6px rgba(0,229,255,0.6);
}

/* ══════════════════════════════════════════
   COMICS READER
══════════════════════════════════════════ */
.comics-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
}
.comics-sidebar {
  width: 150px;
  flex-shrink: 0;
  border-right: 1px solid rgba(0,255,65,0.2);
  overflow-y: auto;
  background: #060612;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.comics-sidebar h4 {
  font-family: var(--font-sys);
  font-size: 10px;
  color: rgba(0,255,65,0.5);
  border-bottom: 1px solid rgba(0,255,65,0.2);
  padding-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.comic-cover {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 3px;
  border: 1px solid transparent;
  transition: all 0.12s;
}
.comic-cover:hover {
  border-color: rgba(0,255,65,0.5);
  box-shadow: 0 0 8px rgba(0,255,65,0.2);
}
.comic-cover.selected {
  border-color: #00e5ff;
  background: rgba(0,229,255,0.08);
  box-shadow: 0 0 10px rgba(0,229,255,0.3);
}
.comic-cover-img {
  width: 100%;
  aspect-ratio: 2/3;
  background: #0a0a20;
  border: 1px solid rgba(0,255,65,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-retro);
  font-size: 14px;
  color: rgba(0,255,65,0.7);
  text-align: center;
  padding: 4px;
  flex-direction: column;
  text-shadow: 0 0 6px rgba(0,255,65,0.5);
}
.comic-cover-title {
  font-family: var(--font-sys);
  font-size: 9px;
  color: rgba(0,255,65,0.6);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.comics-reader-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.comics-reader {
  flex: 1;
  overflow-y: auto;
  background: #030310;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  gap: 8px;
  scroll-behavior: smooth;
}
.comics-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sys);
  font-size: 12px;
  color: rgba(0,255,65,0.4);
  text-align: center;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  letter-spacing: 1px;
}
.comic-page {
  width: 100%;
  max-width: 600px;
  background: #080818;
  border: 1px solid rgba(0,255,65,0.2);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 16px;
  gap: 8px;
  font-family: var(--font-sys);
  font-size: 11px;
  color: rgba(0,255,65,0.6);
}
.comics-nav {
  height: 32px;
  background: #060612;
  border-top: 1px solid rgba(0,255,65,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-shrink: 0;
}
.comics-page-counter {
  font-family: var(--font-sys);
  font-size: 11px;
  color: rgba(0,255,65,0.7);
  min-width: 80px;
  text-align: center;
  letter-spacing: 0.5px;
}

/* ══════════════════════════════════════════
   MEME THUMBNAIL GRID
══════════════════════════════════════════ */
.meme-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 6px;
  padding: 10px;
  overflow-y: auto;
  max-height: 100%;
}
.meme-thumb-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 3px;
  border: 1px solid rgba(0,255,65,0.15);
  background: rgba(0,255,65,0.03);
  transition: all 0.12s;
}
.meme-thumb-item:hover {
  border-color: #00ff41;
  box-shadow: 0 0 10px rgba(0,255,65,0.4);
  transform: scale(1.03);
  background: rgba(0,255,65,0.08);
}
.thumb-img-wrap {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #030310;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0,255,65,0.1);
}
.thumb-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.thumb-label {
  font-size: 9px;
  color: rgba(0,255,65,0.6);
  text-align: center;
  padding: 2px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.3px;
  width: 100%;
}

/* ══════════════════════════════════════════
   LIGHTBOX
══════════════════════════════════════════ */
.meme-lightbox {
  position: absolute;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.meme-lightbox.hidden { display: none; }

.lightbox-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.88);
}
.lightbox-window {
  position: relative;
  z-index: 2;
  background: #05050f;
  border: 1px solid #00ff41;
  box-shadow:
    0 0 40px rgba(0,255,65,0.5),
    inset 0 0 30px rgba(0,0,0,0.9);
  width: 90%;
  max-width: 700px;
  max-height: 90%;
  display: flex;
  flex-direction: column;
}
.lightbox-toolbar {
  background: linear-gradient(90deg, #000060 0%, #003300 100%);
  border-bottom: 1px solid #00ff41;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.lightbox-toolbar > span {
  color: #00ff41;
  text-shadow: 0 0 6px rgba(0,255,65,0.8);
  font-family: var(--font-sys);
  font-size: 11px;
  font-weight: bold;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.lb-btn {
  background: rgba(0,255,65,0.08);
  border: 1px solid rgba(0,255,65,0.4);
  color: #00ff41;
  font-family: var(--font-sys);
  font-size: 10px;
  padding: 2px 8px;
  cursor: pointer;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: all 0.1s;
  white-space: nowrap;
  outline: none;
}
.lb-btn:hover {
  background: rgba(0,255,65,0.2);
  box-shadow: 0 0 8px rgba(0,255,65,0.4);
}
.lb-close {
  background: rgba(255,0,60,0.15);
  color: #ff003c;
  border-color: rgba(255,0,60,0.5);
}
.lb-close:hover {
  background: rgba(255,0,60,0.3);
  box-shadow: 0 0 8px rgba(255,0,60,0.5);
}
.lb-save {
  background: rgba(0,100,0,0.3);
  color: #00ff41;
  border-color: #00ff41;
  font-weight: bold;
}
.lb-save:hover {
  background: rgba(0,150,0,0.4);
  box-shadow: 0 0 10px rgba(0,255,65,0.5);
}
.lb-tweet {
  background: rgba(0,0,0,0.8);
  color: #fff;
  border-color: #555;
  font-weight: bold;
}
.lb-tweet:hover {
  background: #111;
  border-color: #aaa;
  box-shadow: 0 0 8px rgba(255,255,255,0.2);
}
#lbCounter {
  color: rgba(0,255,65,0.6);
  font-family: var(--font-sys);
  font-size: 10px;
  white-space: nowrap;
}
.lightbox-img-wrap {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  min-height: 200px;
  max-height: 70vh;
}
.lightbox-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* ══════════════════════════════════════════
   MOBILE RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 768px) {
  .meme-thumb-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 4px;
    padding: 6px;
  }
  .thumb-img-wrap { aspect-ratio: 1; }
  .lightbox-window { width: 98%; }
  .lb-controls { gap: 2px; }
  .lb-btn { padding: 2px 5px; font-size: 9px; }
  /* Reduce neon effects on mobile for performance */
  .win { box-shadow: 0 0 0 1px #003300, 0 0 10px rgba(0,255,65,0.2); }
  .desktop-icon:hover { box-shadow: 0 0 6px rgba(0,255,65,0.3); }
  #taskbar { box-shadow: 0 -2px 10px rgba(0,255,65,0.15); }
  .win-ctrl:hover { box-shadow: none; }
}

/* ── Folder Icon Grid (Meme Gallery root view) ─────────────────── */
.folder-icon-grid {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 16px 20px;
  padding: 20px;
  height: 100%;
  overflow-y: auto;
  overflow-x: visible;
  align-items: flex-start;
}

.folder-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 86px;
  min-height: 80px;
  cursor: pointer;
  padding: 6px 4px 8px 4px;
  border: 2px solid transparent;
  border-radius: 2px;
  user-select: none;
  transition: background 0.1s;
  overflow: visible;
}

.folder-icon-item:hover {
  background: #000080;
  border-color: #000080;
}

.folder-icon-item:hover .folder-icon-name {
  color: #fff;
}

.folder-icon-item.selected,
.folder-icon-item:active {
  background: #000080;
  border-color: #808080;
}

.folder-icon-svg {
  position: relative;
  width: 56px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(1px 2px 2px rgba(0,0,0,0.3));
}

.folder-icon-svg svg {
  width: 56px;
  height: 48px;
}

.folder-badge {
  position: absolute;
  bottom: -4px;
  right: -6px;
  background: #c0392b;
  color: #fff;
  font-size: 9px;
  font-family: 'MS Sans Serif', Arial, sans-serif;
  font-weight: bold;
  padding: 1px 4px;
  border-radius: 8px;
  border: 1px solid #fff;
  line-height: 1.4;
  min-width: 16px;
  text-align: center;
}

.folder-icon-name {
  margin-top: 6px;
  font-family: 'MS Sans Serif', Arial, sans-serif;
  font-size: 11px;
  font-weight: bold;
  color: #ffffff;
  text-align: center;
  word-break: break-word;
  line-height: 1.4;
  width: 84px;
  white-space: normal;
  overflow: visible;
  display: block;
  text-shadow: 1px 1px 0 #000, 0 0 4px rgba(0,0,0,0.8);
  background: transparent;
  padding: 1px 2px;
}
