/* PUBG Anti-Cheat — Adaptive site styles */

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

:root {
  --bg: #0c0c14;
  --bg2: #12121c;
  --card: #1a1a28;
  --card2: #222236;
  --accent: #6d5ce7;
  --accent2: #a29bfe;
  --green: #00b894;
  --yellow: #fdcb6e;
  --red: #e17055;
  --text: #f0f0f5;
  --text2: #7c7c93;
  --border: rgba(255,255,255,0.06);
  --glow: rgba(109,92,231,0.15);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-top: calc(20px + var(--safe-top));
  padding-bottom: calc(20px + var(--safe-bottom));
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  max-width: 400px;
  width: 100%;
}

/* ── Logo ── */

.logo-wrap {
  position: relative;
  width: 72px;
  height: 72px;
}

.logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 18px;
}

.shield-icon {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 18px;
}

.logo-wrap:has(.logo[style*="display: none"]) .shield-icon { display: flex; }

.title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.accent {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.4;
}

/* ── Card container ── */

.card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* ── Download button ── */

.dl-btn {
  display: inline-flex;
  text-decoration: none;
  width: 100%;
  max-width: 280px;
}

.dl-btn-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #5a4bd1);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 24px var(--glow);
  width: 100%;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.dl-btn:hover .dl-btn-inner {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(109,92,231,0.35);
}

.dl-btn:active .dl-btn-inner { transform: translateY(0); }

.dl-icon { width: 20px; height: 20px; flex-shrink: 0; }

.dl-text { display: flex; flex-direction: column; gap: 2px; }
.dl-label { font-size: 15px; }
.dl-size { font-size: 11px; font-weight: 400; opacity: 0.7; }

/* ── Upload area ── */

.upload-area {
  width: 100%;
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--bg2);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.upload-area:hover, .upload-area.dragover {
  border-color: var(--accent);
  background: var(--glow);
}

.upload-area:active {
  transform: scale(0.98);
}

.upload-area input { display: none; }
.upload-icon { font-size: 40px; margin-bottom: 10px; }
.upload-text { font-size: 14px; color: var(--text2); line-height: 1.5; }
.upload-text strong { color: var(--text); }

/* ── Preview ── */

.preview-wrap {
  display: none;
  width: 100%;
  position: relative;
}

.preview-wrap video {
  width: 100%;
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg2);
}

.preview-wrap img {
  width: 100%;
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.preview-remove:hover { background: var(--red); }

/* ── Send button ── */

.send-btn {
  display: none;
  width: 100%;
  max-width: 280px;
  padding: 14px 28px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #5a4bd1);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 24px var(--glow);
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.send-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(109,92,231,0.35); }
.send-btn:active { transform: translateY(0); }
.send-btn:disabled { opacity: 0.5; cursor: default; transform: none; }

/* ── Status ── */

.status {
  display: none;
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.status.ok { display: block; background: rgba(0,184,148,0.1); border: 1px solid rgba(0,184,148,0.25); color: var(--green); }
.status.err { display: block; background: rgba(225,112,85,0.1); border: 1px solid rgba(225,112,85,0.25); color: var(--red); }
.status.loading { display: block; background: var(--card); border: 1px solid var(--border); color: var(--text2); }

.progress-wrap {
  width: 100%;
  height: 24px;
  background: var(--bg2);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 8px;
  transition: width 0.2s ease;
}

.progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── VirusTotal badge ── */

.vt-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.vt-badge:hover:not(.pending) { border-color: rgba(109,92,231,0.3); }
.vt-badge.clean { border-color: rgba(0,184,148,0.3); background: rgba(0,184,148,0.08); }
.vt-badge.danger { border-color: rgba(225,112,85,0.4); background: rgba(225,112,85,0.1); }
.vt-badge.warn { border-color: rgba(253,203,110,0.3); background: rgba(253,203,110,0.08); }
.vt-badge.done { border-color: rgba(0,184,148,0.3); background: rgba(0,184,148,0.08); }

.vt-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.vt-badge.clean .vt-spinner,
.vt-badge.danger .vt-spinner,
.vt-badge.warn .vt-spinner,
.vt-badge.done .vt-spinner {
  animation: none;
  border: none;
  width: auto;
  height: auto;
}

.vt-badge.clean .vt-spinner::after { content: '\2705'; font-size: 14px; }
.vt-badge.danger .vt-spinner::after { content: '\26D4'; font-size: 14px; }
.vt-badge.warn .vt-spinner::after { content: '\26A0\FE0F'; font-size: 14px; }
.vt-badge.done .vt-spinner::after { content: '\2705'; font-size: 14px; }

.vt-text { color: var(--text2); }
.vt-badge.clean .vt-text { color: var(--green); }
.vt-badge.danger .vt-text { color: var(--red); }
.vt-badge.warn .vt-text { color: var(--yellow); }
.vt-badge.done .vt-text { color: var(--green); }

.vt-link-icon { width: 12px; height: 12px; flex-shrink: 0; opacity: 0.5; }
.vt-badge:hover .vt-link-icon { opacity: 1; }

/* ── VT button ── */

.vt-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.vt-btn:hover:not(:disabled) { border-color: rgba(109,92,231,0.3); background: var(--glow); }
.vt-btn:disabled { cursor: default; opacity: 0.6; }
.vt-btn-icon { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Footer ── */

.footer {
  font-size: 12px;
  color: var(--text2);
  opacity: 0.4;
  margin-top: auto;
}

/* ── Instruction ── */

.instruction-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.instruction-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.4;
}

.step strong { color: var(--text); }

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.instruction-video {
  margin-top: 12px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.instruction-video video {
  width: 100%;
  display: block;
  background: var(--bg2);
}

.hint-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 44px;
}

.hint-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.hint-btn:active {
  background: var(--glow);
}

.hint-video {
  display: none;
  margin-top: 12px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.hint-video video {
  width: 100%;
  display: block;
  background: var(--bg2);
}

/* ── Video Modal ── */

.video-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-top: calc(16px + var(--safe-top));
  padding-bottom: calc(16px + var(--safe-bottom));
}

.video-modal.active {
  display: flex;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  -webkit-tap-highlight-color: transparent;
}

.video-modal-content {
  position: relative;
  width: 100%;
  max-width: 700px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.video-modal-content video {
  width: 100%;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  object-fit: contain;
  display: block;
}

.video-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 1;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.video-modal-close:hover {
  background: var(--red);
}

/* ── Responsive: Mobile Small (<360px) ── */

@media (max-width: 360px) {
  .page { padding: 12px; }
  .title { font-size: 20px; }
  .subtitle { font-size: 12px; }
  .logo-wrap { width: 56px; height: 56px; }
  .card { padding: 14px; border-radius: 12px; gap: 12px; }
  .upload-area { padding: 20px 12px; }
  .upload-icon svg { width: 36px; height: 36px; }
  .hint-btn { padding: 10px 12px; font-size: 12px; }
  .send-btn { padding: 12px 20px; font-size: 14px; }
  .dl-btn-inner { padding: 12px 16px; font-size: 14px; }
}

/* ── Responsive: Mobile (361–480px) ── */

@media (min-width: 361px) and (max-width: 480px) {
  .page { padding: 16px; }
  .title { font-size: 22px; }
  .subtitle { font-size: 13px; }
  .card { padding: 16px; border-radius: 12px; }
  .upload-area { padding: 24px 16px; }
  .dl-btn-inner { padding: 12px 20px; font-size: 14px; }
}

/* ── Responsive: Tablet (481–768px) ── */

@media (min-width: 481px) and (max-width: 768px) {
  .hero { max-width: 380px; }
}

/* ── Responsive: Desktop (769–1023px) ── */

@media (min-width: 769px) {
  .hero { max-width: 420px; }
  .title { font-size: 32px; }
  .card { padding: 28px; }
}

/* ── Responsive: Large Desktop (1024px+) ── */

@media (min-width: 1024px) {
  .hero { max-width: 450px; }
  .preview-wrap video, .preview-wrap img { max-height: 240px; }
}

/* ── Touch devices ── */

@media (hover: none) and (pointer: coarse) {
  .upload-area { min-height: 120px; }
  .hint-btn { min-height: 48px; }
  .send-btn { min-height: 48px; }
  .dl-btn-inner { min-height: 48px; }
  .preview-remove { width: 36px; height: 36px; font-size: 20px; }
  .video-modal-close { width: 40px; height: 40px; font-size: 24px; }
}

/* ── Landscape mobile ── */

@media (max-height: 500px) and (orientation: landscape) {
  .page { padding: 8px; }
  .hero { gap: 8px; }
  .logo-wrap { width: 48px; height: 48px; }
  .title { font-size: 18px; }
  .card { padding: 12px; gap: 8px; }
  .upload-area { padding: 16px; }
}

/* ── Dark mode support (already dark, but ensure) ── */

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }
}

/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
