:root {
  --gb-green: #0f380f;
  --gb-light: #9bbc0f;
  --gb-dark: #306230;
  --accent: #ff8c42;
}

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

body {
  background: #111;
  color: var(--gb-light);
  font-family: "Press Start 2P", cursive;
  image-rendering: pixelated;
}

/* GAME BOY SHELL */
.gameboy {
  max-width: 1100px;
  margin: 40px auto;
  background: #2c2c2c;
  border: 20px solid #1f1f1f;
  border-radius: 30px 30px 60px 30px;
  box-shadow: 
    0 30px 0 #0a0a0a,
    0 40px 60px rgba(0,0,0,0.9);
  overflow: hidden;
}

/* HEADER */
.header {
  background: linear-gradient(#222, #111);
  padding: 15px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 10px solid var(--gb-dark);
}

.title {
  font-size: 2.8rem;
  color: #00ffcc;
  text-shadow: 5px 5px 0 #000;
}

.secret {
  cursor: pointer;
  user-select: none;
}

/* HERO CARTRIDGE */
.main-cartridge {
  background: var(--gb-green);
  padding: 50px 30px;
  text-align: center;
  border-top: 14px solid var(--gb-light);
  border-bottom: 14px solid var(--gb-light);
  position: relative;
}

.main-cartridge::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(transparent, rgba(255,255,255,0.1));
  pointer-events: none;
}

.main-cartridge h1 {
  font-size: 5rem;
  color: #ffcc00;
  text-shadow: 6px 6px 0 #000;
  margin-bottom: 15px;
}

.main-cartridge p {
  font-size: 1.5rem;
  max-width: 700px;
  margin: 0 auto 30px;
}

/* Big Button */
.big-btn {
  display: inline-block;
  padding: 20px 50px;
  background: var(--accent);
  color: #000;
  border: 8px solid #000;
  font-size: 1.4rem;
  text-decoration: none;
  box-shadow: 0 10px 0 #000;
  transition: all 0.2s;
}

.big-btn:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 0 #000;
}

/* PROJECTS */
.projects {
  padding: 50px 30px;
  background: #1c1c1c;
}

.section-title {
  text-align: center;
  font-size: 2.4rem;
  margin-bottom: 40px;
  color: #ffcc00;
  text-shadow: 3px 3px 0 #000;
}

.cartridge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 35px;
}

.cartridge {
  background: #222;
  border: 12px solid #555;
  border-top-color: #999;
  border-left-color: #999;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s;
  box-shadow: 8px 8px 0 #000;
  cursor: pointer;
}

.cartridge:hover {
  transform: scale(1.1) rotate(3deg);
  box-shadow: 12px 12px 0 var(--accent);
  border-color: var(--accent);
}

.cartridge img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  image-rendering: pixelated;
  border-bottom: 6px solid #333;
}

.cartridge-label {
  background: linear-gradient(#333, #111);
  color: #ffcc00;
  text-align: center;
  padding: 14px 10px;
  font-size: 1.2rem;
  text-shadow: 2px 2px 0 #000;
  border-top: 4px solid #666;
}

/* Footer */
footer {
  text-align: center;
  padding: 40px;
  background: #0a0a0a;
  color: #555;
  font-size: 0.9rem;
}

/* MANUAL BUTTON (inside header) */
.manual-btn {
  background: #222;
  color: #ffcc00;
  border: 4px solid #555;
  padding: 8px 16px;
  font-family: "Press Start 2P", cursive;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 3px 3px 0 #000;
  margin-left: auto;
  margin-right: 15px;
}

.manual-btn:hover {
  background: #ffcc00;
  color: #000;
}

/* MANUAL POPUP */
.manual-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.manual-overlay.open { display: flex; }

.manual-modal {
  background: #0f380f;
  border: 12px solid #9bbc0f;
  width: 90%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 50px 40px 40px;
  position: relative;
  box-shadow: 0 20px 40px rgba(0,0,0,0.9);
  scrollbar-width: none;
}

.manual-modal::-webkit-scrollbar { display: none; }

.manual-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 35px;
  border-bottom: 6px solid #306230;
}

.tab-btn {
  flex: 1;
  padding: 16px;
  background: #1f1f1f;
  border: 4px solid #555;
  color: #9bbc0f;
  font-family: "Press Start 2P", cursive;
  cursor: pointer;
}

.tab-btn.active {
  background: #306230;
  border-color: #9bbc0f;
  color: #ffcc00;
}

/* CLICK OUTSIDE HINT */
.exit-hint {
  text-align: center;
  font-size: 0.9rem;
  color: #6bc96b;
  margin-bottom: 25px;
  text-shadow: 1px 1px 0 #000;
  opacity: 0.9;
}

/* FULL PAGE RETRO BACKGROUND */
body {
  background: 
    linear-gradient(rgba(0,0,0,0.85), rgba(0,0,0,0.85)),
    #0a0a0a;
  background-attachment: fixed;
  position: relative;
}

/* Subtle scanlines */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 255, 80, 0.03) 2px,
    rgba(0, 255, 80, 0.03) 4px
  );
  pointer-events: none;
  z-index: -1;
}

/* Very subtle CRT glow / vignette */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, transparent 60%, rgba(0,0,0,0.6) 100%);
  pointer-events: none;
  z-index: -1;
}