/* --- 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;
  --col-yellow: #f1c40f;
  --col-blue: #00cec9;
  --col-green: #00b894;
  --col-red: #ff7675;
  --col-purple: #a29bfe;
  --col-white: #ffffff;
  --col-dark: #2d3436;
}

* { 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 SCANLINES */
.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; 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 & 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 { 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; }

/* NEW FLOATING BUTTON STYLES */
.floating-miner-btn {
  position: fixed; bottom: 30px; left: 30px; z-index: 1000;
  background: #fff; border: 4px solid #000;
  width: 80px; height: 80px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 6px 6px 0 rgba(0,0,0,0.4); transition: transform 0.1s;
}
.floating-miner-btn:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 rgba(0,0,0,0.4); }
.floating-miner-btn .icon { font-size: 2rem; }
.floating-miner-btn .badge {
  position: absolute; top: -10px; right: -10px;
  background: var(--col-red); color: white; border: 2px solid #000;
  font-family: var(--font-pixel); font-size: 0.5rem; padding: 5px 8px; border-radius: 10px;
}

/* EMAIL FORM STYLES */
.newsletter-box {
  margin-top: auto; padding-top: 15px; border-top: 2px dashed #ccc;
}
.email-form { display: flex; flex-direction: column; gap: 10px; }
.email-form input[type="email"] {
  width: 100%; padding: 10px; font-family: var(--font-tech); border: 2px solid #000; background: #fff; font-size: 0.9rem; outline: none;
}
.email-form input[type="email"]:focus { background: #f1f2f6; border-color: var(--col-blue); }
.pixel-btn.sm { padding: 8px; font-size: 0.5rem; width: 100%; cursor: pointer; }
.success-msg { display: none; color: var(--col-green); font-family: var(--font-pixel); font-size: 0.6rem; text-align: center; margin-top: 10px; animation: blink 1s infinite; }

/* 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:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 #000; }
.soc-btn.discord:hover { background: #5865F2; }
.soc-btn.twitter:hover { background: #1DA1F2; }
.soc-btn.youtube:hover { background: #FF0000; }
.soc-btn.tiktok:hover { background: #000000; border-color: #00f2ea; }

/* MAIN SECTIONS */
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%, 100% { transform: translateY(0px); } 50% { transform: translateY(-15px); } }
.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: 5px; 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: 15px; border-top: 2px dashed #bdc3c7; 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.yellow { background: var(--col-yellow); }
.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; }

/* OLD STATS BOX CLASSES (Retained for bar colors) */
.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%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.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); }
.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%, 92%, 100% { transform: translate(0,0); } 94% { transform: translate(-2px,1px); } 96% { transform: translate(2px,-1px); } 98% { transform: translate(0,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; } }

/* --- 1. HERO SYSTEM STATUS --- */
.system-status {
    position: absolute;
    top: 10px; left: 15px;
    font-family: var(--font-pixel);
    font-size: 0.5rem;
    color: #b2bec3;
}

/* --- 2. PROFILE HUD (Moved under Header) --- */
.profile-hud {
    display: flex;
    gap: 20px;
    margin-top: 5px; /* Reduced to sit closer to header */
    margin-bottom: 20px;
    padding: 10px;
    background: #ecf0f1;
    border: 2px solid #bdc3c7;
    width: fit-content;
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.hud-label {
    font-family: var(--font-pixel);
    font-size: 0.5rem;
    color: #636e72;
    font-weight: bold;
}

.hud-bar {
    width: 120px;
    height: 16px;
    background: #2d3436;
    border: 2px solid #000;
    position: relative;
}

.bar-text-overlay {
    position: absolute;
    width: 100%;
    text-align: center;
    top: 0;
    left: 0;
    font-size: 0.55rem;
    color: white;
    font-weight: bold;
    line-height: 12px;
    z-index: 2;
    text-shadow: 1px 1px 0 #000;
    font-family: var(--font-tech);
}

.hud-fill { height: 100%; position: relative; z-index: 1; }
.hud-fill.red { background: var(--col-red); }
.hud-fill.blue { background: var(--col-blue); }

/* --- 3. PARTY MEMBER STYLES --- */
.party-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.party-member-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ecf0f1;
    border: 2px solid #bdc3c7;
    padding: 8px;
    min-width: 180px;
    flex: 1;
}

.party-frame {
    width: 45px;
    height: 45px;
    border: 2px solid #000;
    overflow: hidden;
    background: #fff;
    transition: width 0.3s ease, height 0.3s ease;
    cursor: pointer;
}
.party-frame:hover {
    width: 140px;
    height: 140px;
}
.party-frame img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.party-hover-text {
    display: none;
    font-family: var(--font-pixel);
    font-size: 0.4rem;
    color: #7f8c8d;
    margin-top: 4px;
}
.party-member-card:hover .party-hover-text {
    display: block;
}

.party-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

.p-name {
    font-family: var(--font-pixel);
    font-size: 0.5rem;
    color: #2d3436;
}

.party-hp-bar {
    width: 100%;
    height: 14px;
    background: #2d3436;
    border: 1px solid #000;
    position: relative;
}

.hp-num {
    position: absolute;
    width: 100%;
    text-align: center;
    top: 0;
    font-size: 0.5rem;
    color: #fff;
    line-height: 12px;
    z-index: 2;
    font-family: var(--font-tech);
    font-weight: bold;
}

.p-fill { height: 100%; position: relative; z-index: 1; }
.p-fill.green { background: var(--col-green); }
.p-fill.blue { background: var(--col-blue); }

/* --- 4. REVERTED SKILL TREE (White Background) --- */
.white-stat-box {
    padding: 40px;
    background: #fff;
    width: 100%;
}

.label-dark {
    font-family: var(--font-pixel);
    font-size: 0.7rem;
    color: #000;
}

.val-dark {
    font-family: var(--font-pixel);
    font-size: 0.7rem;
    color: #636e72;
}

.hp-bar-container.light-mode {
    background: #dfe6e9; 
    border: 3px solid #000;
}

/* Ensure bars animate */
.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); }
.stat-row { margin-bottom: 25px; }
.stat-header { display: flex; justify-content: space-between; margin-bottom: 8px; }

/* --- IMPROVED PLAYER STATS --- */
.avatar-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.player-title-badge {
    font-family: var(--font-pixel);
    font-size: 0.5rem;
    color: #000;
    background: #ecf0f1;
    padding: 5px 12px;
    border: 2px solid #bdc3c7;
    text-align: center;
    letter-spacing: 1px;
}

.player-bars-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 5px;
    margin-bottom: 18px;
    padding: 12px;
    background: #ecf0f1;
    border: 2px solid #bdc3c7;
}

.player-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bar-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    line-height: 1;
}

.player-bar-row:nth-child(1) .bar-icon { color: var(--col-red); }
.player-bar-row:nth-child(2) .bar-icon { color: #0984e3; }
.player-bar-row:nth-child(3) .bar-icon { color: #636e72; }

.bar-label {
    font-family: var(--font-pixel);
    font-size: 0.5rem;
    color: #2d3436;
    width: 50px;
    flex-shrink: 0;
}

.player-bar-track {
    flex: 1;
    height: 22px;
    background: #dfe6e9;
    border: 3px solid #000;
    position: relative;
    overflow: hidden;
}

.player-bar-fill {
    height: 100%;
    transition: width 1.5s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
}

.hp-fill {
    background: repeating-linear-gradient(45deg, var(--col-red), var(--col-red) 10px, #e17055 10px, #e17055 20px);
}

.mana-fill {
    background: repeating-linear-gradient(45deg, var(--col-blue), var(--col-blue) 10px, #00b5b0 10px, #00b5b0 20px);
}

.shield-fill {
    background: repeating-linear-gradient(45deg, #b2bec3, #b2bec3 10px, #95a5a6 10px, #95a5a6 20px);
}

.player-bar-text {
    position: absolute;
    top: 0; left: 0; right: 0;
    text-align: center;
    font-family: var(--font-tech);
    font-size: 0.7rem;
    color: #000;
    font-weight: bold;
    line-height: 16px;
    z-index: 2;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 15px;
}

.stat-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px dashed #bdc3c7;
}

.stat-key {
    font-family: var(--font-pixel);
    font-size: 0.45rem;
    color: #7f8c8d;
    white-space: nowrap;
}

.stat-val {
    font-family: var(--font-tech);
    font-size: 1rem;
    font-weight: 700;
    color: #2d3436;
}

.quest-box {
    background: #ecf0f1;
    border: 2px solid #bdc3c7;
    padding: 12px;
    margin-bottom: 15px;
    position: relative;
}

.quest-tag {
    position: absolute;
    top: -10px;
    left: 10px;
    background: #fff;
    color: #000;
    font-family: var(--font-pixel);
    font-size: 0.4rem;
    padding: 3px 8px;
    border: 2px solid #bdc3c7;
}

.quest-box p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #2d3436;
    margin-top: 5px;
}

@media (max-width: 768px) {
    .stats-grid { grid-template-columns: 1fr; }
}