/* ===== CSS VARIABLES ===== */
:root {
  --bg: #0a0c0f;
  --bg2: #0f1217;
  --bg3: #141820;
  --card: #111418;
  --border: #1e2530;
  --border-glow: #00d4ff33;
  --accent: #00d4ff;
  --accent2: #ff6b35;
  --accent3: #7fff00;
  --text: #c8d8e8;
  --text-dim: #4a6070;
  --text-mid: #7a9ab0;
  --success: #7fff00;
  --error: #ff4455;
  --warning: #ffaa00;
  --font-mono: 'Share Tech Mono', monospace;
  --font-body: 'Rajdhani', sans-serif;
  --font-title: 'Orbitron', sans-serif;
  --glow: 0 0 20px rgba(0, 212, 255, 0.3);
  --glow-strong: 0 0 40px rgba(0, 212, 255, 0.5);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== SCANLINE + NOISE ===== */
.scanline {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 9999;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px
  );
}
.noise {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 9998; opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== NAVBAR ===== */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem; height: 60px;
  background: rgba(10,12,15,0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.nav-logo {
  font-family: var(--font-title);
  font-size: 1.1rem; letter-spacing: 2px;
  color: var(--text);
}
.nav-logo a { text-decoration: none; color: inherit; }
.logo-bracket { color: var(--text-dim); }
.logo-accent { color: var(--accent); text-shadow: var(--glow); }
.nav-links { display: flex; align-items: center; gap: 0.5rem; }
.nav-link {
  color: var(--text-dim); text-decoration: none;
  font-family: var(--font-mono); font-size: 0.78rem;
  padding: 0.3rem 0.8rem; letter-spacing: 1px;
  border: 1px solid transparent; border-radius: 2px;
  transition: all 0.2s;
}
.nav-link:hover, .nav-link.active {
  color: var(--accent); border-color: var(--accent);
  background: rgba(0,212,255,0.05);
}
.nav-btn {
  color: var(--bg); background: var(--accent);
  text-decoration: none; font-family: var(--font-mono);
  font-size: 0.78rem; padding: 0.3rem 1rem;
  letter-spacing: 1px; border-radius: 2px;
  transition: all 0.2s;
}
.nav-btn:hover { background: var(--accent2); }
.nav-user {
  color: var(--accent3); font-family: var(--font-mono);
  font-size: 0.78rem; padding: 0 0.5rem;
}

/* ===== CONTAINER ===== */
.container {
  max-width: 1100px; margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ===== HERO ===== */
.hero {
  text-align: center; padding: 3rem 0 2rem;
}
.hero-tag {
  display: inline-block; font-family: var(--font-mono);
  font-size: 0.75rem; color: var(--accent2);
  letter-spacing: 3px; margin-bottom: 1rem;
}
.hero-title {
  font-family: var(--font-title); font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900; line-height: 1.1;
  color: var(--text); letter-spacing: -1px;
  text-shadow: 0 0 60px rgba(0,212,255,0.15);
  margin-bottom: 1rem;
}
.hero-title .accent {
  color: var(--accent);
  text-shadow: var(--glow-strong);
}
.hero-sub {
  color: var(--text-mid); font-size: 1rem; max-width: 500px;
  margin: 0 auto; line-height: 1.6;
}

/* ===== CARD ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px; padding: 2rem;
  margin-bottom: 1.5rem;
  position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.5;
}
.card-header {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.5rem;
}
.card-num {
  font-family: var(--font-title); font-size: 2rem;
  color: var(--border); line-height: 1;
}
.card-header h2 {
  font-family: var(--font-title); font-size: 1rem;
  letter-spacing: 3px; color: var(--text);
}
.card-line { flex: 1; height: 1px; background: var(--border); }

/* ===== TABS ===== */
.mode-tabs {
  display: flex; gap: 0.5rem; margin-bottom: 1.5rem;
}
.tab-btn {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-dim); font-family: var(--font-mono);
  font-size: 0.8rem; padding: 0.5rem 1rem;
  cursor: pointer; border-radius: 2px;
  transition: all 0.2s;
}
.tab-btn.active, .tab-btn:hover {
  border-color: var(--accent); color: var(--accent);
  background: rgba(0,212,255,0.05);
}

/* ===== DROP ZONE ===== */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 4px; padding: 3rem 2rem;
  text-align: center; cursor: pointer;
  transition: all 0.2s; position: relative;
  background: var(--bg2);
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(0,212,255,0.03);
  box-shadow: var(--glow);
}
.drop-zone.small { padding: 1.5rem; }
.drop-icon {
  font-size: 2.5rem; color: var(--accent);
  margin-bottom: 1rem; display: block;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.drop-title {
  font-family: var(--font-mono); font-size: 0.9rem;
  color: var(--text); margin-bottom: 0.3rem;
}
.drop-sub { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 0.5rem; }
.drop-hint {
  font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--accent2); margin-top: 0.5rem;
}

/* ===== FILE PREVIEW ===== */
.file-preview {
  margin-top: 1rem; max-height: 150px;
  overflow-y: auto; font-family: var(--font-mono);
  font-size: 0.75rem;
}
.file-preview .file-item-prev {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0.5rem; color: var(--text-mid);
  border-bottom: 1px solid var(--bg3);
}
.file-preview .file-item-prev:last-child { border: none; }
.file-count {
  font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--accent3); padding: 0.5rem 0;
}

/* ===== OPTIONS ===== */
.options-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1rem; margin: 1.5rem 0;
}
.option-group { display: flex; flex-direction: column; gap: 0.4rem; }
.field-label {
  font-family: var(--font-mono); font-size: 0.65rem;
  color: var(--text-dim); letter-spacing: 2px;
}
.select-field {
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font-mono);
  font-size: 0.85rem; padding: 0.5rem;
  border-radius: 2px; cursor: pointer;
  transition: border-color 0.2s;
}
.select-field:focus { outline: none; border-color: var(--accent); }
.select-field.small { padding: 0.3rem 0.5rem; font-size: 0.75rem; }

/* ===== COMPILE BUTTON ===== */
.compile-btn {
  width: 100%; padding: 1rem;
  background: var(--accent); color: var(--bg);
  border: none; border-radius: 2px;
  font-family: var(--font-title); font-size: 1rem;
  font-weight: 700; letter-spacing: 3px;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
  gap: 0.5rem;
}
.compile-btn:hover {
  background: #00f5ff;
  box-shadow: var(--glow-strong);
  transform: translateY(-1px);
}
.compile-btn:active { transform: translateY(0); }
.compile-btn:disabled {
  background: var(--border); color: var(--text-dim);
  cursor: not-allowed; box-shadow: none; transform: none;
}

/* ===== SPINNER ===== */
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(0,0,0,0.3);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner.large { width: 32px; height: 32px; border-color: var(--border); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-loading { display: none; align-items: center; gap: 0.5rem; }

/* ===== STATUS BOX ===== */
.status-box {
  padding: 0.8rem 1rem; border-radius: 2px;
  font-family: var(--font-mono); font-size: 0.85rem;
  margin-bottom: 1rem; display: none;
}
.status-box.success { background: rgba(127,255,0,0.1); border: 1px solid var(--success); color: var(--success); }
.status-box.error { background: rgba(255,68,85,0.1); border: 1px solid var(--error); color: var(--error); }
.status-box.info { background: rgba(0,212,255,0.1); border: 1px solid var(--accent); color: var(--accent); }

/* ===== TERMINAL ===== */
.output-terminal {
  border: 1px solid var(--border); border-radius: 4px;
  overflow: hidden; margin-bottom: 1rem;
}
.terminal-header {
  background: var(--bg3); padding: 0.5rem 1rem;
  display: flex; align-items: center; gap: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block;
}
.dot.red { background: #ff5f57; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #28c840; }
.terminal-title {
  font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--text-dim); margin-left: 0.5rem; flex: 1;
}
.terminal-body {
  background: #060810; padding: 1rem;
  font-family: var(--font-mono); font-size: 0.8rem;
  color: var(--text-mid); min-height: 150px;
  max-height: 350px; overflow-y: auto;
  white-space: pre-wrap; line-height: 1.6;
}
.terminal-body .t-error { color: var(--error); }
.terminal-body .t-warning { color: var(--warning); }
.terminal-body .t-success { color: var(--success); }
.terminal-body .t-info { color: var(--accent); }

/* ===== DOWNLOAD SECTION ===== */
.download-section {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem; background: rgba(127,255,0,0.05);
  border: 1px solid rgba(127,255,0,0.2); border-radius: 4px;
}
.download-info { display: flex; align-items: center; gap: 1rem; }
.file-icon { font-size: 1.5rem; color: var(--success); }
.download-name {
  font-family: var(--font-mono); font-size: 0.9rem;
  color: var(--text); font-weight: 600;
}
.download-size { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim); }
.download-btn {
  background: var(--success); color: var(--bg);
  padding: 0.6rem 1.5rem; border-radius: 2px;
  font-family: var(--font-title); font-size: 0.85rem;
  font-weight: 700; letter-spacing: 2px;
  text-decoration: none; transition: all 0.2s;
}
.download-btn:hover { background: #9fff40; box-shadow: 0 0 20px rgba(127,255,0,0.4); }

/* ===== INCLUDE SECTION ===== */
.include-section { margin-top: 1rem; }

/* ===== AUTH ===== */
.auth-container {
  max-width: 460px; margin: 3rem auto;
}
.auth-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 4px; padding: 2.5rem;
  position: relative; overflow: hidden;
}
.auth-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent));
}
.auth-header {
  text-align: center; margin-bottom: 2rem;
}
.auth-icon {
  font-size: 3rem; color: var(--accent);
  text-shadow: var(--glow-strong); margin-bottom: 1rem;
  animation: pulse 2s ease-in-out infinite;
}
.auth-header h1 {
  font-family: var(--font-title); font-size: 1.5rem;
  letter-spacing: 4px; color: var(--text); margin-bottom: 0.3rem;
}
.auth-header p { color: var(--text-dim); font-size: 0.85rem; }
.field-group { margin-bottom: 1.2rem; display: flex; flex-direction: column; gap: 0.4rem; }
.input-field {
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font-mono);
  font-size: 0.9rem; padding: 0.7rem 1rem; border-radius: 2px;
  transition: border-color 0.2s; width: 100%;
}
.input-field:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
.input-field::placeholder { color: var(--text-dim); }
.auth-switch {
  text-align: center; margin-top: 1.5rem;
  font-size: 0.85rem; color: var(--text-dim);
}
.auth-switch a { color: var(--accent); text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* ===== ALERT ===== */
.alert {
  padding: 0.8rem 1rem; border-radius: 2px;
  font-family: var(--font-mono); font-size: 0.82rem;
  margin-bottom: 1rem;
}
.alert.success { background: rgba(127,255,0,0.1); border: 1px solid var(--success); color: var(--success); }
.alert.error { background: rgba(255,68,85,0.1); border: 1px solid var(--error); color: var(--error); }
.alert.hidden { display: none; }

/* ===== PAGE HEADER ===== */
.page-header { padding: 2rem 0 1.5rem; }
.page-header h1 {
  font-family: var(--font-title); font-size: clamp(1.5rem,3vw,2.5rem);
  font-weight: 900; letter-spacing: -1px; color: var(--text);
  margin-bottom: 0.3rem;
}
.page-header p { color: var(--text-mid); }

/* ===== HISTORY ===== */
.history-list { display: flex; flex-direction: column; gap: 1rem; }
.history-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 4px; padding: 1.2rem 1.5rem;
  display: flex; align-items: center; gap: 1.5rem;
  transition: border-color 0.2s;
}
.history-card:hover { border-color: var(--accent); }
.history-status {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0;
}
.history-status.ok { background: var(--success); box-shadow: 0 0 8px var(--success); }
.history-status.fail { background: var(--error); box-shadow: 0 0 8px var(--error); }
.history-info { flex: 1; }
.history-name {
  font-family: var(--font-mono); font-size: 0.9rem;
  color: var(--text); margin-bottom: 0.3rem;
}
.history-meta {
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--text-dim);
}
.history-actions { display: flex; gap: 0.5rem; }
.history-btn {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-mid); font-family: var(--font-mono);
  font-size: 0.72rem; padding: 0.3rem 0.8rem;
  border-radius: 2px; cursor: pointer; text-decoration: none;
  transition: all 0.2s; display: inline-flex; align-items: center;
}
.history-btn:hover { border-color: var(--accent); color: var(--accent); }
.history-btn.dl { border-color: rgba(127,255,0,0.3); color: var(--success); }
.history-btn.dl:hover { background: rgba(127,255,0,0.1); }
.empty-state {
  text-align: center; padding: 3rem;
  color: var(--text-dim); font-family: var(--font-mono);
  font-size: 0.85rem; line-height: 1.8;
}
.loading-state {
  text-align: center; padding: 3rem;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  color: var(--text-dim);
}

/* ===== EDITOR LAYOUT ===== */
.editor-layout {
  display: grid;
  grid-template-columns: 200px 1fr 320px;
  height: calc(100vh - 60px);
  overflow: hidden;
}
.editor-sidebar {
  background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-header {
  padding: 0.8rem 1rem; font-family: var(--font-mono);
  font-size: 0.65rem; color: var(--text-dim);
  letter-spacing: 2px; border-bottom: 1px solid var(--border);
}
.sidebar-actions { padding: 0.5rem; border-bottom: 1px solid var(--border); }
.sidebar-btn {
  width: 100%; background: transparent; border: 1px dashed var(--border);
  color: var(--text-dim); font-family: var(--font-mono);
  font-size: 0.75rem; padding: 0.4rem; border-radius: 2px;
  cursor: pointer; transition: all 0.2s;
}
.sidebar-btn:hover { border-color: var(--accent); color: var(--accent); }
.file-tree { flex: 1; overflow-y: auto; padding: 0.5rem 0; }
.file-tree .file-item {
  padding: 0.4rem 1rem; font-family: var(--font-mono);
  font-size: 0.78rem; color: var(--text-dim);
  cursor: pointer; transition: all 0.15s;
}
.file-tree .file-item:hover { background: var(--bg3); color: var(--text); }
.file-tree .file-item.active { background: rgba(0,212,255,0.1); color: var(--accent); }
.editor-main {
  display: flex; flex-direction: column; overflow: hidden;
}
.editor-toolbar {
  background: var(--bg2); border-bottom: 1px solid var(--border);
  padding: 0.5rem 1rem; display: flex;
  align-items: center; justify-content: space-between; gap: 1rem;
}
.editor-filename {
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--text);
}
.toolbar-actions { display: flex; gap: 0.5rem; align-items: center; }
.toolbar-btn {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text-mid); font-family: var(--font-mono);
  font-size: 0.75rem; padding: 0.35rem 0.8rem;
  border-radius: 2px; cursor: pointer; transition: all 0.2s;
}
.toolbar-btn:hover { border-color: var(--text-mid); color: var(--text); }
.toolbar-btn.compile {
  background: var(--accent); color: var(--bg);
  border-color: var(--accent); font-weight: 700;
}
.toolbar-btn.compile:hover { background: #00f5ff; box-shadow: var(--glow); }
#editor-wrapper { flex: 1; overflow: hidden; }
#editor-wrapper .CodeMirror {
  height: 100%; font-family: var(--font-mono);
  font-size: 0.85rem; background: #060810;
}
.editor-output {
  background: var(--bg2); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.output-tabs {
  display: flex; border-bottom: 1px solid var(--border);
}
.out-tab {
  flex: 1; padding: 0.6rem;
  background: transparent; border: none; border-right: 1px solid var(--border);
  color: var(--text-dim); font-family: var(--font-mono);
  font-size: 0.7rem; letter-spacing: 1px; cursor: pointer;
  transition: all 0.2s;
}
.out-tab:last-child { border-right: none; }
.out-tab.active, .out-tab:hover { background: var(--bg3); color: var(--accent); }
.tab-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.tab-content.hidden { display: none; }
#editor-terminal {
  flex: 1; background: #060810; overflow-y: auto;
  font-family: var(--font-mono); font-size: 0.77rem;
  color: var(--text-mid); padding: 1rem; white-space: pre-wrap;
  line-height: 1.6; min-height: 0;
}
.clear-btn {
  background: none; border: none; color: var(--text-dim);
  font-family: var(--font-mono); font-size: 0.65rem;
  cursor: pointer; margin-left: auto; padding: 0 0.5rem;
  letter-spacing: 1px;
}
.clear-btn:hover { color: var(--error); }
.download-panel {
  flex: 1; padding: 1rem; overflow-y: auto;
}
.download-panel .download-item {
  background: rgba(127,255,0,0.05);
  border: 1px solid rgba(127,255,0,0.2);
  border-radius: 4px; padding: 1rem;
  margin-bottom: 0.5rem;
}
.download-panel .dl-name {
  font-family: var(--font-mono); font-size: 0.82rem;
  color: var(--success); margin-bottom: 0.5rem;
}
.download-panel .dl-btn {
  display: inline-block; background: var(--success);
  color: var(--bg); padding: 0.4rem 1rem;
  font-family: var(--font-mono); font-size: 0.75rem;
  text-decoration: none; border-radius: 2px;
  transition: all 0.2s;
}
.download-panel .dl-btn:hover { background: #9fff40; }

/* ===== COMPILE SECTION ===== */
.compile-section { display: flex; flex-direction: column; gap: 0; }

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  text-align: center; padding: 1.5rem;
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--text-dim);
}

/* ===== UTILS ===== */
.hidden { display: none !important; }
.accent { color: var(--accent); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .options-grid { grid-template-columns: 1fr 1fr; }
  .editor-layout { grid-template-columns: 1fr; grid-template-rows: 60px 1fr 300px; }
  .editor-sidebar { display: none; }
  .navbar { padding: 0 1rem; }
  .nav-links { gap: 0.2rem; }
}

/* ===== ZIP GUIDE ===== */
.zip-guide {
  background: var(--bg2); border: 1px solid var(--border);
  border-left: 3px solid var(--accent2);
  border-radius: 4px; padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
}
.zip-guide-title {
  font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--text-mid); margin-bottom: 0.5rem;
  letter-spacing: 1px;
}
.zip-tree {
  font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--text-dim); line-height: 1.7;
  background: none; border: none; padding: 0; margin: 0;
}
.zip-tree .accent { color: var(--accent3); }

/* ===== ZIP PREVIEW ===== */
.zip-preview { margin-top: 1rem; }
.zip-selected {
  display: flex; align-items: center; gap: 1rem;
  background: rgba(0,212,255,0.05);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 4px; padding: 0.8rem 1rem;
}
.zip-icon { font-size: 1.5rem; }
.zip-name { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text); }
.zip-sz   { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim); margin-top: 2px; }
.zip-clear {
  margin-left: auto; background: none; border: 1px solid var(--border);
  color: var(--text-dim); width: 24px; height: 24px;
  border-radius: 2px; cursor: pointer; font-size: 0.7rem;
  transition: all 0.2s;
}
.zip-clear:hover { border-color: var(--error); color: var(--error); }

code {
  font-family: var(--font-mono); font-size: 0.85em;
  color: var(--accent2); background: rgba(255,107,53,0.1);
  padding: 1px 5px; border-radius: 2px;
}

/* ===== INC PREVIEW ===== */
.inc-preview {
  margin-top: .5rem;
  font-family: var(--font-mono);
  font-size: .75rem;
}
.inc-preview .file-item-prev {
  display: flex; align-items: center; gap: .5rem;
  padding: .25rem .5rem; color: var(--text-mid);
  border-bottom: 1px solid var(--bg3);
}

/* ===== COMPILER VERSION BADGE ===== */
.ver-info {
  display: flex; align-items: center; gap: .8rem;
  padding: .7rem 1rem; margin-bottom: 1rem;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 4px; flex-wrap: wrap;
}
.ver-badge {
  font-family: var(--font-mono); font-size: .72rem;
  padding: .2rem .7rem; border-radius: 2px;
  font-weight: 700; letter-spacing: 1px; white-space: nowrap;
}
.ver-badge.samp   { background: rgba(127,255,0,.15); color: var(--success); border: 1px solid var(--success); }
.ver-badge.latest { background: rgba(0,212,255,.15); color: var(--accent);  border: 1px solid var(--accent); }
.ver-desc { font-family: var(--font-mono); font-size: .72rem; color: var(--text-dim); }

/* ===== NAV TOGGLE (mobile) ===== */
.nav-toggle {
  display: none; background: none; border: 1px solid var(--border);
  color: var(--text); font-size: 1.1rem; padding: .2rem .6rem;
  cursor: pointer; border-radius: 2px; line-height: 1;
}

/* ===== FULL RESPONSIVE ===== */

/* Tablet — max 900px */
@media (max-width: 900px) {
  .options-grid { grid-template-columns: repeat(2, 1fr); }
  .editor-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr 280px; }
  .editor-sidebar { display: none; }
  .editor-output { border-left: none; border-top: 1px solid var(--border); }
  .history-card { flex-wrap: wrap; gap: 1rem; }
  .history-actions { width: 100%; justify-content: flex-end; }
}

/* Mobile — max 640px */
@media (max-width: 640px) {
  /* Navbar */
  .navbar { flex-wrap: wrap; padding: 0 1rem; height: auto; gap: 0; }
  .nav-toggle { display: block; margin: .8rem 0; }
  .nav-links {
    display: none; flex-direction: column; width: 100%;
    padding: .5rem 0 1rem; gap: .2rem;
    border-top: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: .5rem .5rem; font-size: .82rem; }
  #auth-nav, #user-nav { display: flex; flex-direction: column; gap: .2rem; }
  .nav-btn { text-align: center; padding: .5rem; }

  /* Hero */
  .hero { padding: 1.5rem 0 1rem; }
  .hero-title { font-size: 1.8rem; }
  .hero-sub { font-size: .88rem; }

  /* Container */
  .container { padding: 1rem; }

  /* Card */
  .card { padding: 1.2rem; }
  .card-num { font-size: 1.4rem; }

  /* Options */
  .options-grid { grid-template-columns: 1fr 1fr; gap: .6rem; }

  /* Drop zone */
  .drop-zone { padding: 1.5rem 1rem; }
  .drop-icon { font-size: 1.8rem; margin-bottom: .5rem; }

  /* Compile button */
  .compile-btn { font-size: .85rem; letter-spacing: 1px; padding: .8rem; }

  /* Download */
  .download-section { flex-direction: column; gap: 1rem; align-items: flex-start; }
  .download-btn { width: 100%; text-align: center; padding: .7rem; }

  /* Terminal */
  .terminal-body { font-size: .72rem; min-height: 120px; }

  /* Auth */
  .auth-container { margin: 1rem auto; }
  .auth-card { padding: 1.5rem 1rem; }

  /* History */
  .history-card { padding: 1rem; }
  .page-header h1 { font-size: 1.5rem; }

  /* Ver info */
  .ver-info { flex-direction: column; align-items: flex-start; gap: .4rem; }

  /* Zip guide */
  .zip-tree { font-size: .7rem; }

  /* Mode tabs */
  .mode-tabs { gap: .3rem; }
  .tab-btn { font-size: .75rem; padding: .4rem .7rem; }

  /* Footer */
  .footer { padding: 1rem; font-size: .65rem; }
}

/* Very small — max 380px */
@media (max-width: 380px) {
  .options-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 1.5rem; }
  .card-header h2 { font-size: .85rem; letter-spacing: 1px; }
}
