/* =========================================================
   niuniuniu.nft — Windows 98 desktop theme
   Palette:
   --win-gray  #C0C0C0   window chrome
   --win-blue  #000080 -> #1084D0   titlebar gradient
   --desktop   #008080   teal desktop
   --hi        #DFDFDF   bevel highlight
   --lo        #808080   bevel shadow
   --lo2       #404040   bevel dark shadow
   --stonks    #00c853   gains / viral green
   --alert     #ff2d55   alert red
   ========================================================= */

* { box-sizing: border-box; }

:root {
  --win-gray: #c0c0c0;
  --hi: #ffffff;
  --hi2: #dfdfdf;
  --lo: #808080;
  --lo2: #404040;
  --desktop: #008080;
  --blue1: #000080;
  --blue2: #1084d0;
  --stonks: #00c853;
  --alert: #ff2d55;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--desktop);
  font-family: Tahoma, "MS Sans Serif", Geneva, sans-serif;
  font-size: 12px;
  color: #000;
  overflow: hidden;
}

.hidden { display: none !important; }

/* ---------------- BOOT SCREEN ---------------- */
#boot-screen {
  position: fixed;
  inset: 0;
  background: #000;
  color: #b8b8b8;
  font-family: "Courier New", monospace;
  z-index: 999;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
}
.boot-text p { margin: 4px 0; font-size: 16px; }
#boot-final { color: #fff; }
.dots::after {
  content: '';
  animation: dots 1.4s steps(4, end) infinite;
}
@keyframes dots {
  0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; }
}
#boot-bar-track {
  margin-top: 20px;
  width: 300px;
  height: 14px;
  border: 1px solid #555;
  background: #111;
}
#boot-bar-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(45deg, #0f0, #0f0 6px, #060 6px, #060 12px);
  animation: fillbar 3.2s ease forwards;
}
@keyframes fillbar { to { width: 100%; } }

/* ---------------- DESKTOP ---------------- */
#desktop {
  position: relative;
  width: 100%;
  height: 100vh;
  /* Wallpaper hook: drop a file at media/wallpaper.jpg (or .png) and it is
     used automatically. If the file is missing this falls through to the
     plain teal desktop color below — nothing breaks either way.
     Recommended size: 1920x1080px (landscape, 16:9), JPG or PNG, under ~2MB.
     It is applied with background-size:cover so any similar wide/landscape
     resolution (e.g. 2560x1440) also works fine. */
  background:
    radial-gradient(circle at 15% 10%, rgba(255,255,255,0.06), transparent 40%),
    url('../media/wallpaper.jpg') center / cover no-repeat,
    var(--desktop);
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 60px;
}

#desktop-icons {
  position: absolute;
  top: 42px; /* clears the ticker bar so about.txt isn't clipped under it */
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 1;
  max-height: calc(100vh - 42px - 40px);
  overflow: visible;
}
.icon {
  width: 78px;
  text-align: center;
  color: #fff;
  text-shadow: 1px 1px 1px #000;
  cursor: pointer;
  user-select: none;
  padding: 4px;
}
.icon:focus-within, .icon.selected {
  background: rgba(0, 0, 128, 0.4);
  outline: 1px dotted #fff;
}
.icon-img {
  width: 40px;
  height: 40px;
  margin: 0 auto 4px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  image-rendering: pixelated;
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.5));
}
.icon span { font-size: 11px; line-height: 1.2; display: block; }

/* pixel-ish icon glyphs via CSS shapes / emoji fallback */
.icon-cow { background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><rect width="40" height="40" fill="%23ffffff" fill-opacity="0"/><text x="50%25" y="60%25" font-size="28" text-anchor="middle">🐮</text></svg>') center/contain no-repeat; }
.icon-newspaper { background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><text x="50%25" y="60%25" font-size="28" text-anchor="middle">📰</text></svg>') center/contain no-repeat; }
.icon-images { background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><text x="50%25" y="60%25" font-size="28" text-anchor="middle">🖼️</text></svg>') center/contain no-repeat; }
.icon-player { background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><text x="50%25" y="60%25" font-size="28" text-anchor="middle">▶️</text></svg>') center/contain no-repeat; }
.icon-wallet { background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><text x="50%25" y="60%25" font-size="28" text-anchor="middle">💾</text></svg>') center/contain no-repeat; }
.icon-globe { background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><text x="50%25" y="60%25" font-size="28" text-anchor="middle">🌐</text></svg>') center/contain no-repeat; }
.icon-bird { background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><text x="50%25" y="60%25" font-size="28" text-anchor="middle">🐦</text></svg>') center/contain no-repeat; }
.icon-bin { background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><text x="50%25" y="60%25" font-size="28" text-anchor="middle">🗑️</text></svg>') center/contain no-repeat; }
.icon-mine { background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><text x="50%25" y="60%25" font-size="28" text-anchor="middle">💣</text></svg>') center/contain no-repeat; }
.icon-folder { background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><text x="50%25" y="60%25" font-size="28" text-anchor="middle">📁</text></svg>') center/contain no-repeat; }
.icon-snake { background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><text x="50%25" y="60%25" font-size="28" text-anchor="middle">🐍</text></svg>') center/contain no-repeat; }
.icon-ttt { background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><text x="50%25" y="60%25" font-size="28" text-anchor="middle">❌</text></svg>') center/contain no-repeat; }
.icon-cards { background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><text x="50%25" y="60%25" font-size="28" text-anchor="middle">🃏</text></svg>') center/contain no-repeat; }
.icon-memes { background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><text x="50%25" y="60%25" font-size="28" text-anchor="middle">🤣</text></svg>') center/contain no-repeat; }
.icon-niu { background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><text x="50%25" y="60%25" font-size="28" text-anchor="middle">🐄</text></svg>') center/contain no-repeat; }
.icon-img.small { width: 28px; height: 28px; margin: 0; }

/* ---------------- TICKER ---------------- */
#ticker-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 26px;
  background: #000;
  color: var(--stonks);
  font-family: "Courier New", monospace;
  font-weight: bold;
  border-bottom: 2px solid var(--lo2);
  z-index: 500;
  padding: 3px 0;
  box-sizing: border-box;
}
#ticker-marquee { font-size: 13px; }

/* ---------------- WINDOWS ---------------- */
.win {
  position: absolute;
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--hi) var(--lo2) var(--lo2) var(--hi);
  box-shadow: 1px 1px 0 var(--hi2) inset, 2px 2px 8px rgba(0,0,0,0.5);
  min-width: 260px;
  z-index: 5;
}
.titlebar {
  background: linear-gradient(90deg, var(--blue1), var(--blue2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 4px 3px 6px;
  font-weight: bold;
  font-size: 12px;
  cursor: grab;
  user-select: none;
}
.titlebar:active { cursor: grabbing; }
.titlebar-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titlebar-btns { display: flex; gap: 2px; flex-shrink: 0; }
.tb-btn {
  width: 18px;
  height: 16px;
  background: var(--win-gray);
  border: 1px solid;
  border-color: var(--hi) var(--lo2) var(--lo2) var(--hi);
  font-size: 11px;
  line-height: 1;
  font-weight: bold;
  cursor: pointer;
  color: #000;
  padding: 0;
}
.tb-btn:active {
  border-color: var(--lo2) var(--hi) var(--hi) var(--lo2);
}

.win-toolbar {
  background: var(--win-gray);
  border-bottom: 1px solid var(--lo);
  padding: 3px 6px;
  font-size: 11px;
  color: #333;
}

.win-body {
  padding: 12px;
  background: var(--win-gray);
  max-height: 60vh;
  overflow: auto;
}
.win-body.no-pad { padding: 0; }
.win-body.scrollable { max-height: 340px; }

.status-bar {
  display: flex;
  justify-content: space-between;
  padding: 3px 8px;
  font-size: 11px;
  border-top: 1px solid var(--hi2);
  background: var(--win-gray);
}
.status-bar span {
  border: 1px solid;
  border-color: var(--lo) var(--hi2) var(--hi2) var(--lo);
  padding: 1px 6px;
}

/* window minimized state pushed to taskbar */
.win.minimized { display: none; }

/* ---------------- HERO / ABOUT ---------------- */
.hero-flex { display: flex; gap: 16px; align-items: flex-start; }
.cow-ascii {
  font-family: "Courier New", monospace;
  font-size: 11px;
  white-space: pre;
  line-height: 1.1;
  background: #fff;
  border: 1px solid;
  border-color: var(--lo) var(--hi2) var(--hi2) var(--lo);
  padding: 8px;
  flex-shrink: 0;
}
.glitch-title {
  font-family: 'VT323', "Courier New", monospace;
  font-size: 52px;
  margin: 0 0 4px;
  letter-spacing: 2px;
  color: #000;
  text-shadow: 2px 0 var(--alert), -2px 0 var(--blue2);
}
.subtitle { margin: 0 0 10px; font-weight: bold; }
.stat-row { display: flex; gap: 8px; margin-bottom: 10px; }
.stat-box {
  background: #fff;
  border: 1px solid;
  border-color: var(--lo) var(--hi2) var(--hi2) var(--lo);
  padding: 6px 10px;
  text-align: center;
}
.stat-box b { display: block; font-size: 14px; }
.stat-box span { font-size: 10px; color: #333; }
.hero-desc { line-height: 1.4; margin-bottom: 12px; }

.win98-btn {
  font-family: Tahoma, sans-serif;
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--hi) var(--lo2) var(--lo2) var(--hi);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  color: #000;
}
.win98-btn:active {
  border-color: var(--lo2) var(--hi) var(--hi) var(--lo2);
}
.primary-btn {
  background: linear-gradient(180deg, #fdf3a0, #f4d13c);
}

/* ---------------- LORE ---------------- */
#win-lore h2 { font-size: 16px; margin-top: 0; }
#win-lore h3 { font-size: 13px; border-bottom: 1px solid var(--lo); padding-bottom: 2px; }
#win-lore p { line-height: 1.5; }
.lore-byline { font-style: italic; color: #444; font-size: 10px; }
blockquote {
  background: #fff;
  border-left: 4px solid var(--blue2);
  margin: 10px 0;
  padding: 6px 10px;
  font-style: italic;
}
.lore-tie {
  background: #fef9d7;
  border: 1px dashed var(--lo);
  padding: 8px;
}

/* ---------------- GALLERY ---------------- */
.sneak-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.sneak-tile {
  background: #fff;
  border: 1px solid;
  border-color: var(--lo) var(--hi2) var(--hi2) var(--lo);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.sneak-tile img, .sneak-tile video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sneak-tile .tile-noise {
  position: absolute;
  inset: 0;
  opacity: 0.9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sneak-tile .tile-num {
  position: relative;
  font-family: 'VT323', monospace;
  font-size: 34px;
  color: rgba(0,0,0,0.55);
}
.sneak-tile:hover { outline: 2px dotted var(--blue1); }
.hint-text { font-size: 10px; color: #333; margin-top: 10px; line-height: 1.4; }
.hint-text code { background: #fff; padding: 0 3px; border: 1px solid var(--lo); }

.win98-tip {
  margin-top: 10px;
  background: #ffffe1;
  border: 1px solid;
  border-color: var(--lo2) var(--hi) var(--hi) var(--lo2);
  padding: 6px 10px;
  font-size: 11px;
  font-style: italic;
  color: #333;
}

/* ---------------- VIDEO ---------------- */
.video-win .win-body { max-height: none; }
.video-screen {
  background: #000;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-screen video { width: 100%; height: 100%; background: #000; }
.wmp-controls {
  background: var(--win-gray);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  font-size: 14px;
  border-top: 1px solid var(--hi2);
}
.wmp-bar {
  flex: 1;
  height: 8px;
  background: #fff;
  border: 1px solid var(--lo);
}
.wmp-bar-fill { height: 100%; width: 0%; background: var(--blue2); }

/* ---------------- MINT ---------------- */
.mint-title { margin-top: 0; font-size: 16px; }
.progress-wrap { margin-bottom: 12px; }
.progress-track {
  height: 20px;
  background: #fff;
  border: 1px solid;
  border-color: var(--lo) var(--hi2) var(--hi2) var(--lo);
  padding: 2px;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(45deg, var(--stonks), var(--stonks) 8px, #00e676 8px, #00e676 16px);
  transition: width 1.2s ease;
}
.progress-label { font-size: 11px; margin-top: 4px; text-align: center; }
.mint-facts { padding-left: 18px; line-height: 1.6; font-size: 12px; }
.wallet-btn, .opensea-btn { display: block; width: 100%; margin-top: 8px; text-align: center; }
.mint-note { font-size: 10px; color: #333; margin-top: 10px; }

/* ---------------- OXSWEEPER GAME ---------------- */
.mine-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--lo2) var(--hi) var(--hi) var(--lo2);
  margin: 8px;
  padding: 6px 8px;
}
.mine-counter, .mine-timer {
  background: #000;
  color: var(--alert);
  font-family: "Courier New", monospace;
  font-weight: bold;
  font-size: 18px;
  padding: 2px 6px;
  border: 1px solid;
  border-color: var(--lo2) var(--hi) var(--hi) var(--lo2);
  letter-spacing: 2px;
  min-width: 46px;
  text-align: center;
}
.mine-face {
  width: 32px;
  height: 32px;
  font-size: 18px;
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--hi) var(--lo2) var(--lo2) var(--hi);
  cursor: pointer;
  line-height: 1;
}
.mine-face:active { border-color: var(--lo2) var(--hi) var(--hi) var(--lo2); }

.mine-grid {
  display: grid;
  grid-template-columns: repeat(9, 26px);
  grid-template-rows: repeat(9, 26px);
  gap: 0;
  border: 3px solid;
  border-color: var(--lo2) var(--hi) var(--hi) var(--lo2);
  margin: 0 8px 10px;
  width: max-content;
}
.mine-cell {
  width: 26px;
  height: 26px;
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--hi) var(--lo2) var(--lo2) var(--hi);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Courier New", monospace;
  font-weight: bold;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.mine-cell.revealed {
  border: 1px solid var(--lo);
  background: #d4d4d4;
  cursor: default;
}
.mine-cell.mine.revealed { background: var(--alert); }
.mine-cell[data-n="1"] { color: #0000ff; }
.mine-cell[data-n="2"] { color: #008000; }
.mine-cell[data-n="3"] { color: #ff0000; }
.mine-cell[data-n="4"] { color: #000080; }
.mine-cell[data-n="5"] { color: #800000; }
.mine-cell[data-n="6"] { color: #008080; }

/* ---------------- LINKS ---------------- */
.link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid;
  border-color: var(--lo) var(--hi2) var(--hi2) var(--lo);
  padding: 8px;
  margin-bottom: 8px;
  text-decoration: none;
  color: #000;
}
.link-row:hover { background: #eef; }
.link-row span { font-size: 10px; color: #333; }

/* ---------------- BSOD ---------------- */
#bsod {
  position: fixed;
  inset: 0;
  background: #0000aa;
  color: #fff;
  z-index: 998;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Courier New", monospace;
  cursor: pointer;
}
.bsod-inner { max-width: 560px; padding: 30px; font-size: 16px; line-height: 1.5; }
.blink { animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------------- TASKBAR ---------------- */
#taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 34px;
  background: var(--win-gray);
  border-top: 2px solid var(--hi);
  display: flex;
  align-items: center;
  padding: 2px 4px;
  gap: 6px;
  z-index: 600;
}
#start-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--hi) var(--lo2) var(--lo2) var(--hi);
  font-weight: bold;
  padding: 3px 10px;
  cursor: pointer;
  font-size: 12px;
}
#start-btn:active, #start-btn.active {
  border-color: var(--lo2) var(--hi) var(--hi) var(--lo2);
}
.start-flag { font-size: 14px; }

#start-menu {
  position: absolute;
  bottom: 32px;
  left: 2px;
  width: 220px;
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--hi) var(--lo2) var(--lo2) var(--hi);
  box-shadow: 2px 2px 6px rgba(0,0,0,0.5);
  padding: 4px;
  z-index: 200;
}
.start-menu-item {
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
}
.start-menu-item:hover { background: var(--blue1); color: #fff; }
#start-menu hr { border: none; border-top: 1px solid var(--lo); margin: 4px 0; }

#taskbar-open-wins { display: flex; gap: 4px; flex: 1; overflow: hidden; }
.taskbar-win-btn {
  background: var(--win-gray);
  border: 1px solid;
  border-color: var(--lo2) var(--hi) var(--hi) var(--lo2);
  font-size: 11px;
  padding: 3px 10px;
  cursor: pointer;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#taskbar-tray {
  border: 1px solid;
  border-color: var(--lo) var(--hi2) var(--hi2) var(--lo);
  padding: 3px 10px;
  font-family: "Courier New", monospace;
  font-size: 11px;
}

/* ---------------- SCROLLBARS (retro) ---------------- */
.win-body::-webkit-scrollbar { width: 16px; }
.win-body::-webkit-scrollbar-track { background: var(--win-gray); }
.win-body::-webkit-scrollbar-thumb { background: var(--win-gray); border: 1px solid; border-color: var(--hi) var(--lo2) var(--lo2) var(--hi); }

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 900px) {
  .win { position: relative !important; top: auto !important; left: auto !important; width: 92vw !important; margin: 10px auto; }
  #desktop { overflow-y: auto; height: auto; min-height: 100vh; padding-bottom: 120px; padding-top: 30px; }
  #desktop-icons { position: relative; flex-direction: row; flex-wrap: wrap; top: auto; left: auto; padding: 10px; }
  .hero-flex { flex-direction: column; }
  .sneak-grid { grid-template-columns: repeat(2, 1fr); }
  #ticker-bar { position: relative; }
}

/* focus visibility for keyboard users */
button:focus-visible, a:focus-visible {
  outline: 2px dashed #000;
  outline-offset: 1px;
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------------- VOLUME TOGGLE (video boxes) ---------------- */
.vol-toggle { cursor: pointer; }

/* ---------------- LIGHTBOX ---------------- */
#lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lightbox-win {
  background: var(--win-gray);
  border: 2px solid;
  border-color: var(--hi) var(--lo2) var(--lo2) var(--hi);
  box-shadow: 2px 2px 10px rgba(0,0,0,0.6);
  max-width: min(90vw, 720px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.lightbox-body {
  background: #000;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#lightbox-img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  display: block;
}

/* ---------------- GAMES FOLDER ---------------- */
.games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.dark-icon { color: #000; text-shadow: none; width: auto; }
.dark-icon:hover { background: #dfefff; outline: 1px dotted var(--blue1); }

/* ---------------- SNAKE ---------------- */
.snake-wrap { position: relative; background: #000; }
#snake-canvas { display: block; width: 100%; image-rendering: pixelated; }
.snake-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  color: #0f0;
  font-family: "Courier New", monospace;
  cursor: pointer;
  text-align: center;
}
.snake-overlay p { margin: 4px 0; }
.snake-sub { font-size: 11px; color: #9f9; }

/* ---------------- TIC TAC TOE ---------------- */
.ttt-status { text-align: center; font-weight: bold; margin: 0 0 8px; }
.ttt-grid {
  display: grid;
  grid-template-columns: repeat(3, 64px);
  grid-template-rows: repeat(3, 64px);
  gap: 4px;
  justify-content: center;
  margin: 0 auto 12px;
}
.ttt-cell {
  background: #fff;
  border: 1px solid;
  border-color: var(--lo) var(--hi2) var(--hi2) var(--lo);
  font-size: 30px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ttt-cell.x { color: var(--blue2); }
.ttt-cell.o { color: var(--alert); }
.ttt-cell.win { background: #fef9d7; }

/* ---------------- MEMORY MATCH ---------------- */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.memory-card {
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--blue1), var(--blue2));
  border: 2px solid;
  border-color: var(--hi) var(--lo2) var(--lo2) var(--hi);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  color: transparent;
}
.memory-card.flipped, .memory-card.matched {
  background: #fff;
  color: #000;
}
.memory-card.matched { opacity: 0.55; cursor: default; }

/* ---------------- NIU GENERATOR ---------------- */
.niugen-label {
  display: block;
  font-size: 11px;
  font-weight: bold;
  margin: 6px 0 3px;
}
.niugen-input, .niugen-output {
  width: 100%;
  font-family: "Courier New", monospace;
  font-size: 12px;
  padding: 6px;
  border: 1px solid;
  border-color: var(--lo) var(--hi2) var(--hi2) var(--lo);
  resize: vertical;
  box-sizing: border-box;
}
.niugen-output {
  background: #000;
  color: var(--stonks);
  margin-bottom: 4px;
}
.niugen-btn { display: block; width: 100%; margin: 8px 0 4px; text-align: center; }
