@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323:wght@400&family=Courier+Prime:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --bg-dark:        #0a0a1a;
  --bg-card:        #0f1535;
  --bg-card2:       #111827;
  --blue-main:      #3b82f6;
  --blue-light:     #60a5fa;
  --yellow-main:    #facc15;
  --yellow-light:   #fde68a;
  --green-pixel:    #22c55e;
  --red-pixel:      #ef4444;
  --purple-pixel:   #a855f7;
  --border-pixel:   #1e3a8a;
  --text-main:      #e2e8f0;
  --text-dim:       #94a3b8;
  --pixel-shadow:   4px 4px 0px #000;
  --pixel-shadow-blue:   4px 4px 0px #1e40af;
  --pixel-shadow-yellow: 4px 4px 0px #92400e;
}

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

body {
  font-family: 'VT323', monospace;
  background: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  image-rendering: pixelated;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--blue-main); border: 2px solid #000; }

/* ===== SCANLINE OVERLAY ===== */
.scanlines {
  position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.04) 2px,
    rgba(0,0,0,0.04) 4px
  );
}

/* ===== PIXEL BUTTONS ===== */
.btn-pixel {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  padding: 12px 20px;
  border: 3px solid #000;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-block;
  text-decoration: none;
}
.btn-pixel:hover { transform: translate(-2px, -2px); }
.btn-pixel:active { transform: translate(2px, 2px); box-shadow: none !important; }

.btn-yellow { background: var(--yellow-main); color: #000; box-shadow: 4px 4px 0 #92400e; }
.btn-yellow:hover { box-shadow: 6px 6px 0 #92400e; color: #000; text-decoration: none; }

.btn-blue { background: var(--blue-main); color: #fff; box-shadow: 4px 4px 0 #1e40af; }
.btn-blue:hover { box-shadow: 6px 6px 0 #1e40af; color: #fff; text-decoration: none; }

.btn-green { background: var(--green-pixel); color: #000; box-shadow: 4px 4px 0 #15803d; }
.btn-green:hover { box-shadow: 6px 6px 0 #15803d; color: #000; text-decoration: none; }

.btn-red { background: var(--red-pixel); color: #fff; box-shadow: 4px 4px 0 #991b1b; }
.btn-red:hover { box-shadow: 6px 6px 0 #991b1b; color: #fff; text-decoration: none; }

/* ===== PIXEL CARD ===== */
.pixel-card {
  background: var(--bg-card);
  border: 3px solid var(--blue-main);
  box-shadow: 6px 6px 0 #000, inset 0 0 30px rgba(59,130,246,0.05);
  padding: 24px;
  position: relative;
}

/* ===== PIXEL INPUT ===== */
.pixel-input {
  width: 100%;
  background: #000;
  border: 3px solid var(--border-pixel);
  color: var(--text-main);
  font-family: 'VT323', monospace;
  font-size: 22px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s;
}
.pixel-input:focus { border-color: var(--yellow-main); }
.pixel-input::placeholder { color: #334155; }

/* ===== NAVBAR ===== */
.navbar-pixel {
  background: #000;
  border-bottom: 4px solid var(--yellow-main);
  padding: 0 24px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 0 rgba(250,204,21,0.2);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-logo img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  image-rendering: pixelated;
}

.nav-logo-text {
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  color: var(--text-main);
  line-height: 1;
}

.nav-logo-text span { color: var(--yellow-main); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-username {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: var(--yellow-main);
}

.nav-xp {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: var(--blue-light);
  background: rgba(59,130,246,0.15);
  border: 2px solid var(--blue-main);
  padding: 4px 10px;
}

.nav-version {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #ffffff;
  background: rgba(255,255,255,0.08);
  border: 2px solid var(--yellow-main);
  padding: 6px 10px;
  border-radius: 18px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.splash-version {
  margin-top: 14px;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--text-main);
  background: rgba(255,255,255,0.08);
  border: 2px solid var(--yellow-main);
  border-radius: 16px;
  padding: 8px 14px;
  letter-spacing: 0.14em;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.08);
}

/* ===== SECTION TITLE ===== */
.section-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 16px;
  color: var(--yellow-main);
  text-shadow: 2px 2px 0 #000;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.section-title span { color: var(--blue-light); }

/* ===== TEXT PIXEL ===== */
.text-pixel {
  font-family: 'Press Start 2P', monospace;
  line-height: 1.8;
}

/* ===== PROGRESS BAR ===== */
.progress-pixel {
  background: #000;
  border: 2px solid var(--border-pixel);
  height: 18px;
  position: relative;
  overflow: hidden;
}

.progress-pixel-fill {
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--yellow-main) 0px,
    var(--yellow-main) 14px,
    #d97706 14px,
    #d97706 16px
  );
  transition: width 1s ease;
  box-shadow: 0 0 8px rgba(250,204,21,0.5);
}

.progress-pixel-fill.blue {
  background: repeating-linear-gradient(
    90deg,
    var(--blue-main) 0px,
    var(--blue-main) 14px,
    #1e40af 14px,
    #1e40af 16px
  );
  box-shadow: 0 0 8px rgba(59,130,246,0.5);
}

.progress-pixel-fill.green {
  background: var(--green-pixel);
  box-shadow: 0 0 8px rgba(34,197,94,0.5);
}

/* ===== PIXEL ALERT ===== */
.pixel-alert {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  padding: 12px 16px;
  border: 2px solid;
  margin-bottom: 16px;
  line-height: 1.8;
}

.pixel-alert-success { color: var(--green-pixel); border-color: var(--green-pixel); background: rgba(34,197,94,0.1); }
.pixel-alert-error   { color: var(--red-pixel);   border-color: var(--red-pixel);   background: rgba(239,68,68,0.1); }
.pixel-alert-info    { color: var(--blue-light);   border-color: var(--blue-main);   background: rgba(59,130,246,0.1); }

/* ===== ANIMATIONS ===== */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes pixelIn {
  from { opacity: 0; transform: scale(0.8); image-rendering: pixelated; }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes twinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.3; transform: scale(0.8); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-5px); }
  40%       { transform: translateX(5px); }
  60%       { transform: translateX(-5px); }
  80%       { transform: translateX(5px); }
}

.shake { animation: shake 0.4s ease; }
.fade-in { animation: slideUp 0.6s ease forwards; }
.fade-in-delay-1 { animation: slideUp 0.6s 0.1s ease both; }
.fade-in-delay-2 { animation: slideUp 0.6s 0.2s ease both; }
.fade-in-delay-3 { animation: slideUp 0.6s 0.3s ease both; }

/* ===== LOCK ICON ===== */
.lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.lock-icon {
  font-size: 32px;
  filter: grayscale(1);
  opacity: 0.6;
}

/* ===== TERMINAL ===== */
.pixel-terminal {
  background: #000;
  border: 3px solid var(--green-pixel);
  box-shadow: 5px 5px 0 #000, 0 0 20px rgba(34,197,94,0.1);
  font-family: 'Courier Prime', monospace;
  overflow: hidden;
}

.terminal-header {
  background: var(--green-pixel);
  color: #000;
  padding: 6px 12px;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-dots { display: flex; gap: 5px; }
.terminal-dot {
  width: 10px; height: 10px;
  border-radius: 0;
  border: 2px solid #000;
}
.td-red { background: var(--red-pixel); }
.td-yellow { background: var(--yellow-main); }
.td-green { background: #16a34a; }

.terminal-body { padding: 12px; }

.terminal-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--green-pixel);
  font-family: 'Courier Prime', monospace;
  font-size: 16px;
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.terminal-output {
  border-top: 2px solid #1a2e1a;
  padding: 10px;
  color: #86efac;
  font-family: 'Courier Prime', monospace;
  font-size: 15px;
  white-space: pre-wrap;
  min-height: 40px;
  line-height: 1.6;
}

.terminal-prompt {
  color: var(--yellow-main);
  font-family: 'Courier Prime', monospace;
  font-size: 15px;
  margin-bottom: 4px;
}

/* ===== CODE BLOCK ===== */
.code-block {
  background: #000;
  border: 2px solid var(--border-pixel);
  border-left: 4px solid var(--blue-main);
  padding: 16px;
  font-family: 'Courier Prime', monospace;
  font-size: 15px;
  color: #86efac;
  white-space: pre-wrap;
  overflow-x: auto;
  position: relative;
}

.code-output {
  background: #0a1a0a;
  border: 2px solid var(--green-pixel);
  border-left: 4px solid var(--green-pixel);
  padding: 12px 16px;
  font-family: 'Courier Prime', monospace;
  font-size: 15px;
  color: #86efac;
  white-space: pre-wrap;
  margin-top: 4px;
}

.code-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* ===== XP POPUP ===== */
.xp-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  font-family: 'Press Start 2P', monospace;
  font-size: 24px;
  color: var(--yellow-main);
  text-shadow: 4px 4px 0 #000;
  background: rgba(0,0,0,0.95);
  border: 4px solid var(--yellow-main);
  box-shadow: 0 0 30px rgba(250,204,21,0.3);
  padding: 28px 40px;
  animation: pixelIn 0.3s ease;
  text-align: center;
  pointer-events: none;
}
