@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700;900&family=JetBrains+Mono:wght@400;600&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  tap-highlight-color: transparent;
}

*:focus {
  outline: none;
}

*::selection {
  background: #000000;
  color: #FFDE00;
}

:root {
  --bg: #FFDE00;
  --black: #0A0A0A;
  --white: #FFFFFF;
  --pink: #FF6B9D;
  --blue: #4D9FFF;
  --green: #7ED957;
  --red: #FF4D4D;
}

html, body {
  width: 100%;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  font-family: 'Space Grotesk', sans-serif;
  color: var(--black);
  min-height: 100vh;
  position: relative;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

input {
  font-family: 'JetBrains Mono', monospace;
}

img {
  display: block;
  max-width: 100%;
}

.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--black);
  border-bottom: 4px solid var(--black);
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(14px, 3vw, 18px) clamp(16px, 4vw, 20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-weight: 900;
  font-size: clamp(16px, 4vw, 20px);
  letter-spacing: -0.5px;
}

.brand i {
  width: 24px;
  height: 24px;
  color: var(--bg);
  flex-shrink: 0;
}

.badge-nowm {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--green);
  color: var(--black);
  border: 3px solid var(--black);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 100px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge-nowm i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.main-container {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 40px) clamp(16px, 4vw, 20px) 80px;
  position: relative;
  z-index: 2;
}

.hero-section {
  text-align: center;
  margin-bottom: clamp(24px, 6vw, 36px);
}

.hero-title {
  font-size: clamp(26px, 6vw, 52px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -1.5px;
  text-transform: uppercase;
}

.hero-sub {
  margin-top: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(12px, 3vw, 14px);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.85;
}

.input-card {
  background: var(--white);
  border: 4px solid var(--black);
  box-shadow: 6px 6px 0 var(--black);
  padding: clamp(16px, 4vw, 20px);
  border-radius: 4px;
  margin-bottom: clamp(20px, 5vw, 30px);
}

.input-row {
  display: flex;
  gap: 12px;
}

.input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 3px solid var(--black);
  padding: clamp(14px, 3vw, 16px) 14px;
  background: var(--bg);
  border-radius: 4px;
  min-width: 0;
}

.input-wrap i {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: clamp(13px, 3vw, 14px);
  color: var(--black);
  min-width: 0;
  width: 100%;
}

.input-wrap input::placeholder {
  color: rgba(10,10,10,0.45);
}

.btn-primary, .btn-secondary, .btn-audio {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 4px solid var(--black);
  font-weight: 900;
  font-size: clamp(14px, 3.2vw, 16px);
  padding: clamp(18px, 4.5vw, 22px) clamp(20px, 5vw, 28px);
  border-radius: 6px;
  box-shadow: 5px 5px 0 var(--black);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1;
}

.btn-primary {
  background: var(--pink);
  color: var(--black);
}

.btn-secondary {
  background: var(--white);
  color: var(--black);
}

.btn-audio {
  width: 100%;
  background: var(--blue);
  color: var(--black);
  margin-top: 12px;
}

.btn-primary i, .btn-secondary i, .btn-audio i {
  width: clamp(18px, 4vw, 22px);
  height: clamp(18px, 4vw, 22px);
  flex-shrink: 0;
}

.btn-primary:active, .btn-secondary:active, .btn-audio:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 var(--black);
}

.btn-primary:disabled, .btn-secondary:disabled, .btn-audio:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.error-box {
  display: none;
  margin-top: 14px;
  background: var(--red);
  color: var(--white);
  border: 3px solid var(--black);
  padding: 12px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
}

.error-box.show {
  display: block;
}

.loading-section {
  display: flex;
  justify-content: center;
  padding: 50px 0;
}

.loading-section.hidden {
  display: none;
}

.loader-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 3px solid var(--black);
  padding: 16px 24px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 4px 4px 0 var(--black);
}

.loader-box i {
  width: 20px;
  height: 20px;
}

.spin {
  animation: spin 0.8s linear infinite;
}

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

.result-section.hidden {
  display: none;
}

.result-meta {
  display: flex;
  gap: 14px;
  background: var(--white);
  border: 4px solid var(--black);
  padding: clamp(12px, 3vw, 16px);
  border-radius: 4px;
  margin-bottom: clamp(16px, 4vw, 20px);
  box-shadow: 5px 5px 0 var(--black);
  align-items: center;
}

.result-meta img {
  width: clamp(52px, 12vw, 64px);
  height: clamp(52px, 12vw, 64px);
  object-fit: cover;
  border: 3px solid var(--black);
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--bg);
}

.meta-text {
  min-width: 0;
}

.meta-text h3 {
  font-size: clamp(14px, 3.5vw, 15px);
  font-weight: 700;
  margin-bottom: 4px;
}

.meta-text p {
  font-size: clamp(11px, 2.8vw, 12px);
  font-family: 'JetBrains Mono', monospace;
  opacity: 0.75;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.media-viewer {
  position: relative;
  background: var(--black);
  border: 4px solid var(--black);
  border-radius: 4px;
  box-shadow: 6px 6px 0 var(--black);
  overflow: hidden;
  aspect-ratio: 9 / 14;
  max-height: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-frame {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.media-frame img, .media-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--black);
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: clamp(38px, 9vw, 44px);
  height: clamp(38px, 9vw, 44px);
  background: var(--bg);
  border: 3px solid var(--black);
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 3px 3px 0 var(--black);
}

.nav-arrow i {
  width: 20px;
  height: 20px;
}

.nav-left {
  left: 12px;
}

.nav-right {
  right: 12px;
}

.nav-arrow.hidden {
  display: none;
}

.pagination-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.dot {
  width: 12px;
  height: 12px;
  border: 2px solid var(--black);
  border-radius: 100px;
  background: var(--white);
  transition: background 0.2s ease, transform 0.2s ease;
}

.dot.active {
  background: var(--pink);
  transform: scale(1.2);
}

.counter-box {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.counter-box span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  background: var(--white);
  border: 2px solid var(--black);
  padding: 4px 12px;
  border-radius: 100px;
}

.action-buttons {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.action-buttons .btn-primary, .action-buttons .btn-secondary {
  flex: 1;
  min-width: 0;
}

.permission-toast, .download-notif {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 92%;
  padding: 14px 16px;
  border: 3px solid var(--black);
  border-radius: 4px;
  box-shadow: 5px 5px 0 var(--black);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
}

.permission-toast {
  background: var(--blue);
  color: var(--black);
}

.permission-toast button {
  flex-shrink: 0;
  display: flex;
}

.permission-toast i, .download-notif i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.download-notif {
  background: var(--green);
  color: var(--black);
}

.hidden {
  display: none !important;
}

.site-footer {
  text-align: center;
  padding: 24px 20px 40px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  opacity: 0.6;
  position: relative;
  z-index: 2;
}

@media (max-width: 600px) {
  .input-row {
    flex-direction: column;
  }
  .btn-primary, .btn-secondary, .btn-audio {
    width: 100%;
  }
  .action-buttons {
    flex-direction: column;
  }
  .media-viewer {
    max-height: 520px;
  }
}