/* --- PIXEL ART VARIABLES --- */
:root {
  --bg-sky-top: #2b32b2;
  --bg-sky-bot: #1488cc;
  
  --pixel-border: 4px solid #0d0d0d;
  --card-shadow: 6px 6px 0px rgba(0,0,0,0.3);
  --card-shadow-hover: 10px 10px 0px rgba(0,0,0,0.4);
  
  --font-pixel: 'Press Start 2P', cursive;
  --font-tech: 'Rajdhani', sans-serif;
  
  /* Vibrant Palette */
  --col-yellow: #f1c40f;
  --col-blue: #00cec9;
  --col-green: #00b894;
  --col-red: #ff7675;
  --col-purple: #a29bfe;
  --col-white: #ffffff;
  --col-dark: #2d3436;
  --col-bg-card: #dfe6e9;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-sky-bot);
  font-family: var(--font-tech);
  color: var(--col-dark);
  overflow-x: hidden;
  position: relative;
  font-size: 18px;
}

/* --- CRT SCANLINE LOGIC --- */
.scanlines {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  background-size: 100% 4px, 6px 100%;
  pointer-events: none;
  z-index: 999;
  opacity: 0; /* Default Off */
  transition: opacity 0.3s;
}
body.crt-active .scanlines { opacity: 1; }

/* --- BACKGROUND --- */
.pixel-sky {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
  background: linear-gradient(to bottom, var(--bg-sky-top) 0%, var(--bg-sky-bot) 100%);
}
.cloud {
  position: absolute; background: rgba(255,255,255,0.8); width: 160px; height: 50px;
  box-shadow: 40px 10px 0 10px rgba(255,255,255,0.8);
}
.c1 { top: 15%; left: -200px; animation: floatCloud 35s linear infinite; opacity: 0.8; }
.c2 { top: 40%; left: -200px; animation: floatCloud 50s linear infinite; animation-delay: 5s; opacity: 0.6; scale: 0.8; }
.c3 { top: 10%; left: -200px; animation: floatCloud 60s linear infinite; animation-delay: 20s; opacity: 0.4; scale: 0.5; }

@keyframes floatCloud { from { left: -250px; } to { left: 110%; } }

/* --- HEADER & TOGGLE SWITCH --- */
header {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: var(--pixel-border);
  padding: 15px 0;
  position: sticky; top: 0; z-index: 1000;
  backdrop-filter: blur(5px);
}
.header-container { max-width: 1000px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; }
.logo { font-family: var(--font-pixel); font-size: 0.9rem; text-shadow: 2px 2px 0px #ccc; }
nav ul { list-style: none; display: flex; gap: 20px; align-items: center; }

.pixel-link {
  font-family: var(--font-pixel); font-size: 0.6rem; text-decoration: none; color: var(--col-dark);
  position: relative; transition: 0.2s;
}
.pixel-link:hover { color: var(--col-blue); transform: translateY(-2px); }

/* Switch CSS */
.switch { position: relative; display: inline-block; width: 40px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc; transition: .4s; border: 2px solid #000;
}
.slider:before {
  position: absolute; content: ""; height: 10px; width: 10px; left: 3px; bottom: 3px;
  background-color: white; border: 2px solid #000; transition: .4s;
}
input:checked + .slider { background-color: var(--col-green); }
input:checked + .slider:before { transform: translateX(20px); }

/* --- GLOBAL XP HUD --- */
#xp-hud {
  position: fixed; top: 70px; left: 20px; z-index: 998;
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,0.8); padding: 5px 10px; border: 2px solid #fff;
  border-radius: 4px;
}
.xp-level { color: var(--col-yellow); font-family: var(--font-pixel); font-size: 0.6rem; }
.xp-bar-bg { width: 100px; height: 10px; background: #333; border: 1px solid #fff; }
#xp-bar-fill { width: 0%; height: 100%; background: var(--col-blue); transition: width 0.2s; }


/* --- MINI-GAME WINDOW --- */
.minigame-window {
  position: fixed; bottom: 20px; left: 20px;
  width: 200px; background: #f1f2f6;
  border: var(--pixel-border); z-index: 1000;
  font-family: var(--font-pixel);
  box-shadow: 6px 6px 0 rgba(0,0,0,0.4);
  transition: transform 0.3s;
}
.minigame-window.minimized { transform: translateY(160px); }

.window-header {
  background: var(--col-dark); color: white;
  padding: 5px 10px; font-size: 0.5rem;
  display: flex; justify-content: space-between; align-items: center;
}
.window-header button { background: none; border: none; color: white; font-family: inherit; cursor: pointer; }

.window-content { padding: 15px; text-align: center; }
.score-display { font-size: 0.7rem; margin-bottom: 10px; color: var(--col-dark); }
.click-area { margin-bottom: 15px; position: relative; }
.click-area small { display: block; font-size: 0.4rem; margin-top: 5px; color: #7f8c8d; }

#mine-btn {
  font-size: 1.5rem; padding: 10px; background: #fff;
  border: 4px solid var(--col-dark); cursor: pointer;
  box-shadow: 4px 4px 0 #ccc;
}
#mine-btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #ccc; }

.shop-area { border-top: 2px dashed #ccc; padding-top: 10px; }
.shop-btn {
  width: 100%; background: var(--col-blue); border: 2px solid #000;
  padding: 5px; cursor: pointer; font-family: inherit; font-size: 0.5rem;
  display: flex; flex-direction: column; gap: 2px;
}
.shop-btn.disabled { filter: grayscale(100%); cursor: not-allowed; opacity: 0.6; }
.mps-display { font-size: 0.4rem; margin-top: 5px; color: #555; }


/* --- SOCIAL LINKS --- */
.social-section { margin-top: 20px; padding-top: 20px; border-top: 2px dashed #555; }
.social-links { display: flex; justify-content: center; gap: 15px; margin-top: 15px; }
.soc-btn {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  background: #2d3436; border: 2px solid #fff; color: #fff;
  font-size: 1.2rem; text-decoration: none; transition: 0.2s;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.5);
}
.soc-btn.discord:hover { background: #5865F2; transform: translate(-2px,-2px); box-shadow: 6px 6px 0 #000; }
.soc-btn.twitter:hover { background: #1DA1F2; transform: translate(-2px,-2px); box-shadow: 6px 6px 0 #000; }
.soc-btn.youtube:hover { background: #FF0000; transform: translate(-2px,-2px); box-shadow: 6px 6px 0 #000; }
.soc-btn.tiktok:hover { background: #000000; border-color: #00f2ea; transform: translate(-2px,-2px); box-shadow: 6px 6px 0 #ff0050; }

/* --- HIDDEN BIT (GLITCH TEXT) --- */
.hidden-bit {
  cursor: crosshair; color: var(--col-red); font-weight: bold; position: relative;
  display: inline-block; animation: textGlitch 3s infinite;
}
.hidden-bit:hover { color: var(--col-yellow); text-shadow: 2px 0px 0px #000; }
.hidden-bit.collected { color: inherit; font-weight: normal; animation: none; pointer-events: none; transition: color 0.5s; }

@keyframes textGlitch {
  0% { transform: translate(0,0); }
  92% { transform: translate(0,0); }
  94% { transform: translate(-2px,1px); }
  96% { transform: translate(2px,-1px); }
  98% { transform: translate(0,2px); }
  100% { transform: translate(0,0); }
}

/* --- MAIN SECTIONS (Standard) --- */
main { max-width: 960px; margin: 0 auto; padding: 40px 20px; }
.retro-border { background: var(--col-white); border: var(--pixel-border); position: relative; }
.pixel-title { font-family: var(--font-pixel); text-align: center; margin: 80px 0 40px; font-size: 1.5rem; color: var(--col-white); text-shadow: 4px 4px 0 #000; }
.section-badge { display: inline-block; background: #000; color: #fff; font-family: var(--font-pixel); font-size: 0.5rem; padding: 5px 10px; margin-bottom: -4px; margin-left: 4px; position: relative; z-index: 2; }
.hero { min-height: 80vh; display: flex; align-items: center; justify-content: center; text-align: center; }
.hero-box { padding: 50px 30px; background: #fff; max-width: 700px; width: 100%; }
.float-anim { animation: floatBox 6s ease-in-out infinite; }
@keyframes floatBox { 0% { transform: translateY(0px); } 50% { transform: translateY(-15px); } 100% { transform: translateY(0px); } }
.hero-box h1 { font-family: var(--font-pixel); font-size: 1.6rem; line-height: 1.6; min-height: 60px; color: var(--col-dark); }
.subtitle { font-size: 1.2rem; font-weight: 700; margin-top: 15px; color: #555; text-transform: uppercase; letter-spacing: 1px; }
.btn-container { display: flex; justify-content: center; gap: 20px; margin-top: 40px; }
.pixel-btn { font-family: var(--font-pixel); font-size: 0.7rem; padding: 18px 25px; text-decoration: none; border: var(--pixel-border); box-shadow: 4px 4px 0px #000; transition: all 0.1s; text-transform: uppercase; font-weight: bold; }
.pixel-btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0px #000; }
.pixel-btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0px #000; }
.primary { background: var(--col-yellow); color: #000; }
.secondary { background: #fff; color: #000; }
.rpg-dialogue-box { display: flex; padding: 25px; gap: 30px; background: #fdfdfd; }
.avatar-frame { width: 140px; height: 140px; border: var(--pixel-border); background: #b2bec3; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; box-shadow: inset 4px 4px 0 rgba(0,0,0,0.1); }
.profile-avatar { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.dialogue-text h3 { font-family: var(--font-pixel); font-size: 0.9rem; margin-bottom: 15px; border-bottom: 4px solid #000; padding-bottom: 10px; display: inline-block; }
.stats-grid p { margin-bottom: 8px; font-size: 1.1rem; }
.helpers-section { margin-top: 25px; border-top: 2px dashed #ccc; padding-top: 15px; }
.section-label { font-family: var(--font-pixel); font-size: 0.6rem; color: #7f8c8d; margin-bottom: 10px; }
.helpers-list { display: flex; flex-wrap: wrap; gap: 15px; }
.helper-card { display: flex; align-items: center; gap: 10px; background: #ecf0f1; padding: 8px 12px; border: 2px solid #bdc3c7; }
.mini-frame { width: 40px; height: 40px; border: 2px solid #000; background: #fff; overflow: hidden; flex-shrink: 0; }
.mini-frame img { width: 100%; height: 100%; object-fit: cover; }
.helper-info { display: flex; flex-direction: column; }
.helper-name { font-family: var(--font-pixel); font-size: 0.5rem; color: #000; }
.helper-desc { font-size: 0.8rem; font-weight: 700; color: #7f8c8d; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 50px; }
.game-card { transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); display: flex; flex-direction: column; }
.game-card:hover { transform: translateY(-10px) scale(1.02); box-shadow: var(--card-shadow-hover); z-index: 10; }
.img-frame { border-bottom: var(--pixel-border); height: 180px; overflow: hidden; background: #000; }
.img-frame img { width: 100%; height: 100%; object-fit: cover; transition: 0.3s; }
.game-card:hover .img-frame img { transform: scale(1.1); }
.card-body { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.card-body h3 { font-family: var(--font-pixel); font-size: 0.8rem; margin-bottom: 10px; line-height: 1.4; }
.tags { margin-bottom: 15px; }
.pixel-tag { font-family: var(--font-pixel); font-size: 0.5rem; padding: 4px 6px; color: #000; border: 2px solid #000; margin-right: 5px; box-shadow: 2px 2px 0 #000; }
.pixel-tag.blue { background: var(--col-blue); }
.pixel-tag.green { background: var(--col-green); }
.pixel-tag.red { background: var(--col-red); }
.pixel-tag.purple { background: var(--col-purple); }
.pixel-tag.grey { background: #b2bec3; }
.card-body p { font-size: 1rem; margin-bottom: 20px; line-height: 1.4; color: #636e72; }
.app-buttons { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.store-btn { display: block; width: 100%; text-align: center; background: #2d3436; color: #fff; padding: 10px; font-family: var(--font-tech); font-weight: bold; text-decoration: none; border: 2px solid #000; transition: 0.2s; }
.store-btn:hover { background: #000; color: var(--col-yellow); }
.locked { opacity: 0.8; }
.locked .img-frame { position: relative; }
.grayscale { filter: grayscale(100%); }
.overlay-lock { position: absolute; top: 10px; right: 10px; background: var(--col-red); color: white; font-family: var(--font-pixel); font-size: 0.6rem; padding: 5px; border: 2px solid #000; z-index: 5; }
.locked-msg { font-family: var(--font-pixel); font-size: 0.6rem; color: #7f8c8d; text-align: center; padding: 10px; background: #ecf0f1; border: 2px dashed #bdc3c7; }
.stats-box { padding: 40px; background: #2d3436; color: white; }
.stat-row { margin-bottom: 25px; }
.stat-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.label { font-family: var(--font-pixel); font-size: 0.7rem; color: var(--col-yellow); }
.val { font-family: var(--font-pixel); font-size: 0.7rem; }
.hp-bar-container { width: 100%; height: 30px; background: #000; border: 4px solid #576574; padding: 2px; position: relative; }
.hp-bar-fill { height: 100%; width: 0%; transition: width 1.5s cubic-bezier(0.25, 1, 0.5, 1); }
.hp-bar-fill.green { background: repeating-linear-gradient(45deg, var(--col-green), var(--col-green) 10px, #00a884 10px, #00a884 20px); }
.hp-bar-fill.blue { background: repeating-linear-gradient(45deg, var(--col-blue), var(--col-blue) 10px, #00b5b0 10px, #00b5b0 20px); }
.hp-bar-fill.red { background: repeating-linear-gradient(45deg, var(--col-red), var(--col-red) 10px, #e17055 10px, #e17055 20px); }
footer { text-align: center; padding: 60px 0; color: #fff; text-shadow: 2px 2px 0 #000; }
.footer-links { margin: 15px 0; }
.footer-links a { color: #fff; text-decoration: underline; margin: 0 10px; }
.contact-box { margin-top: 30px; padding: 20px; background: rgba(0,0,0,0.5); border: 2px solid rgba(255,255,255,0.3); display: inline-block; }
.contact-box span { font-family: var(--font-pixel); font-size: 0.6rem; color: var(--col-yellow); }
.contact-box a { color: #fff; font-weight: bold; font-size: 1.2rem; text-decoration: none; display: block; margin-top: 5px; }
.blink { animation: blink 1.5s infinite; }
@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }
.scroll-hidden { opacity: 0; transform: translateY(50px); transition: all 0.8s ease-out; }
.scroll-visible { opacity: 1; transform: translateY(0); }
.click-particle { position: fixed; width: 6px; height: 6px; background-color: var(--col-yellow); pointer-events: none; z-index: 9999; box-shadow: 2px 2px 0 #000; }
.achievement-box { position: fixed; bottom: -100px; right: 20px; background: #2d3436; border: 4px solid #fff; padding: 15px 20px; display: flex; align-items: center; gap: 15px; box-shadow: 8px 8px 0 rgba(0,0,0,0.5); z-index: 1000; transition: bottom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); width: 320px; }
.achievement-box.unlocked { bottom: 20px; }
.trophy-icon { font-size: 2rem; animation: bounce 2s infinite; }
.ach-text h4 { font-family: var(--font-pixel); font-size: 0.6rem; color: var(--col-yellow); margin-bottom: 5px; }
.ach-text p { font-family: var(--font-tech); font-size: 0.9rem; color: #fff; margin: 0; font-weight: bold; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.god-mode { filter: invert(1) hue-rotate(180deg); }
.god-mode .scanlines { background: repeating-linear-gradient(0deg, rgba(0,0,0,0.1), rgba(0,0,0,0.1) 1px, transparent 1px, transparent 2px); }

@media (max-width: 768px) {
  .hero-box h1 { font-size: 1.2rem; }
  .rpg-dialogue-box { flex-direction: column; align-items: center; text-align: center; }
  .dialogue-text h3 { margin-top: 10px; }
  .helpers-list { justify-content: center; }
  .avatar-frame { margin-bottom: 10px; }
  .stat-header { flex-direction: row; } 
  .minigame-window { display: none; }
}