/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #070a12;
  --bg-card: rgba(12, 18, 32, 0.72);
  --bg-panel: rgba(8, 14, 28, 0.82);
  --border: rgba(255, 255, 255, 0.09);
  --border-glow: rgba(255, 255, 255, 0.18);
  --text: #f0f4fc;
  --text-muted: #8b95a8;
  --red: #ff3b5c;
  --red-glow: rgba(255, 59, 92, 0.4);
  --cyan: #00e5ff;
  --cyan-glow: rgba(0, 229, 255, 0.3);
  --lime: #b8ff3c;
  --lime-glow: rgba(184, 255, 60, 0.3);
  --yellow: #ffd93d;
  --radius: 20px;
  --radius-sm: 12px;
  --font: 'Inter', system-ui, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  --shadow-elevated: 0 20px 60px rgba(0, 0, 0, 0.45), 0 0 40px rgba(0, 229, 255, 0.04);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

.bg-photo {
  display: none;
}

.bg-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

.float-chips {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.float-chip {
  position: absolute;
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  opacity: 0.35;
  animation: chipFloat 14s ease-in-out infinite;
}

.float-chip--1 { top: 18%; left: 4%; animation-delay: 0s; }
.float-chip--2 { top: 55%; right: 3%; animation-delay: -5s; width: 64px; height: 64px; }
.float-chip--3 { bottom: 22%; left: 8%; animation-delay: -9s; width: 56px; height: 56px; }

@keyframes chipFloat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-18px) rotate(3deg); }
}

@media (max-width: 900px) {
  .float-chips { display: none; }
}

/* ===== ANIMATED BACKGROUND ===== */
.bg-gradient {
  position: fixed;
  inset: 0;
  background: linear-gradient(
    135deg,
    #070a12 0%,
    #0d1220 25%,
    #0a0f1a 50%,
    #0f0a14 75%,
    #070a12 100%
  );
  background-size: 400% 400%;
  animation: gradientShift 18s ease infinite;
  z-index: -3;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  z-index: -2;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}

.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: orbFloat 12s ease-in-out infinite;
}

.orb--red {
  width: 420px;
  height: 420px;
  background: var(--red);
  top: -10%;
  right: -5%;
  animation-delay: 0s;
}

.orb--cyan {
  width: 350px;
  height: 350px;
  background: var(--cyan);
  bottom: 10%;
  left: -8%;
  animation-delay: -4s;
}

.orb--lime {
  width: 280px;
  height: 280px;
  background: var(--lime);
  top: 40%;
  left: 50%;
  animation-delay: -8s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 30px) scale(0.95); }
}

/* ===== GLASS CARDS ===== */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.glass-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-elevated);
}

.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* ===== LAYOUT ===== */
.header {
  padding: 1.25rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 10, 18, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.logo__mark {
  position: relative;
  height: 52px;
  width: auto;
  max-width: min(220px, 55vw);
  border-radius: 0;
  overflow: visible;
  border: none;
  background: transparent;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform var(--transition), filter var(--transition);
}

.logo__mark:hover {
  transform: scale(1.03);
  filter: drop-shadow(0 0 18px rgba(255, 120, 40, 0.45));
}

.logo__img {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.logo__mark-emoji {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 0.85rem;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.8));
}

.logo__icon {
  font-size: 1.75rem;
  filter: drop-shadow(0 0 8px var(--red-glow));
}

.logo__tagline {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-left: 0.15rem;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.btn-icon:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 16px var(--cyan-glow);
  transform: scale(1.05);
}

.btn-icon:active {
  transform: scale(0.95);
}

.btn-icon--muted .btn-icon__glyph {
  opacity: 0.4;
}

.badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
}

.badge--beta {
  background: rgba(184, 255, 60, 0.12);
  color: var(--lime);
  border: 1px solid rgba(184, 255, 60, 0.25);
}

.main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

/* ===== HERO ===== */
.hero {
  padding: 2.5rem;
  overflow: hidden;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.hero__copy {
  text-align: left;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 1rem;
  padding: 0.35rem 0.75rem;
  background: rgba(0, 229, 255, 0.06);
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: 100px;
}

.hero__eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime-glow);
  animation: dotPulse 1.5s ease infinite;
}

.hero__headline {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
}

.text-gradient {
  background: linear-gradient(135deg, var(--cyan), var(--lime), var(--red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 440px;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.hero__stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.hero__stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.hero__stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero__avatars {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar-stack {
  display: flex;
}

.avatar-stack img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg);
  margin-left: -8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.avatar-stack img:first-child {
  margin-left: 0;
}

.hero__avatars-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.hero__visual {
  position: relative;
}

.hero__mosaic {
  position: relative;
}

.hero__mosaic-main {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-elevated);
}

.hero__mosaic-main img {
  display: block;
  width: 100%;
  height: 380px;
  object-fit: cover;
}

.hero__mosaic-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.35rem 0.65rem;
  background: rgba(255, 59, 92, 0.9);
  color: #fff;
  border-radius: 6px;
  animation: badgePulse 2s ease infinite;
}

.hero__mosaic-float {
  position: absolute;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  object-fit: cover;
}

.hero__mosaic-float--1 {
  width: 100px;
  height: 100px;
  bottom: -20px;
  left: -24px;
  animation: chipFloat 8s ease-in-out infinite;
}

.hero__mosaic-float--2 {
  width: 88px;
  height: 88px;
  top: -16px;
  right: -20px;
  animation: chipFloat 10s ease-in-out infinite reverse;
}

/* ===== FEATURES ===== */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.feature-card {
  overflow: hidden;
  padding: 0;
}

.feature-card__img-wrap {
  height: 140px;
  overflow: hidden;
  position: relative;
}

.feature-card__img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(7, 10, 18, 0.8), transparent 50%);
}

.feature-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.feature-card:hover .feature-card__img-wrap img {
  transform: scale(1.06);
}

.feature-card__body {
  padding: 1.15rem 1.25rem 1.35rem;
}

.feature-card__title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.feature-card__desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ===== SECTION HEAD ===== */
.section-head {
  margin-bottom: 1.25rem;
}

.section-head__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-head__sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ===== GALLERY ===== */
.gallery {
  padding: 1.5rem;
}

.gallery__header {
  margin-bottom: 1.25rem;
}

.gallery__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.gallery__sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.gallery__item {
  margin: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all var(--transition);
  cursor: default;
}

.gallery__item:hover {
  border-color: var(--border-glow);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.gallery__item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.gallery__item:hover img {
  transform: scale(1.05);
}

.gallery__item figcaption {
  padding: 0.5rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.3);
}

/* ===== INPUT ===== */
.input-section {
  padding: 1.5rem;
}

.drop-zone {
  border: 2px dashed rgba(0, 229, 255, 0.25);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.25rem;
  transition: all var(--transition);
  cursor: pointer;
  background: rgba(0, 0, 0, 0.15);
}

.drop-zone:hover,
.drop-zone--active {
  border-color: var(--cyan);
  background: rgba(0, 229, 255, 0.04);
  box-shadow: 0 0 24px var(--cyan-glow);
}

.drop-zone__visual {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  min-height: 48px;
}

.drop-zone__thumb {
  width: 80px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  opacity: 0.45;
  position: absolute;
  filter: blur(1px);
}

.drop-zone__icon {
  font-size: 1.75rem;
  position: relative;
  z-index: 1;
}

.drop-zone__label {
  font-weight: 600;
  font-size: 0.9rem;
}

.drop-zone__hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.input-group {
  margin-bottom: 1rem;
}

.input-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.input-textarea,
.input-url {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-textarea:focus,
.input-url:focus {
  outline: none;
  border-color: rgba(0, 229, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
}

.input-textarea::placeholder,
.input-url::placeholder {
  color: rgba(122, 132, 153, 0.6);
}

/* ===== ANALYZE BUTTON ===== */
.btn-analyze {
  width: 100%;
  position: relative;
  padding: 1.1rem 1.5rem;
  margin-top: 0.5rem;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--red) 0%, #ff6b3d 50%, var(--red) 100%);
  background-size: 200% 200%;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow var(--transition);
  animation: btnGradient 4s ease infinite;
  box-shadow: 0 4px 24px var(--red-glow);
}

@keyframes btnGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.btn-analyze:hover {
  box-shadow: 0 6px 32px var(--red-glow), 0 0 40px rgba(255, 59, 92, 0.2);
  transform: translateY(-2px);
}

.btn-analyze:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 12px var(--red-glow);
}

.btn-analyze:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-analyze__shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  animation: shine 3s ease infinite;
}

@keyframes shine {
  0% { left: -100%; }
  50%, 100% { left: 150%; }
}

/* ===== LOADING / BRAIN METER ===== */
.loading-section {
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.analyze-preview {
  margin: 0 auto 1.25rem;
  max-width: 520px;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.28);
  text-align: left;
}

.analyze-preview--scanning {
  position: relative;
  overflow: hidden;
}

.analyze-preview--scanning::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  animation: previewScan 2.2s linear infinite;
  pointer-events: none;
}

@keyframes previewScan {
  0% { top: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.analyze-preview__label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.55rem;
  font-weight: 600;
}

.analyze-preview__body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.analyze-preview__text {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text);
  border-left: 3px solid var(--lime);
  padding: 0.15rem 0 0.15rem 0.75rem;
  margin: 0;
  max-height: 110px;
  overflow-y: auto;
  word-break: break-word;
  white-space: pre-wrap;
}

.analyze-preview__screenshot {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.analyze-preview__img {
  display: block;
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 229, 255, 0.25);
  background: rgba(0, 0, 0, 0.45);
}

.analyze-preview__filename {
  font-size: 0.72rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analyze-preview__url {
  display: block;
  font-size: 0.8rem;
  color: var(--cyan);
  word-break: break-all;
  text-decoration: none;
}

.analyze-preview__url:hover {
  text-decoration: underline;
}

.results-section .analyze-preview {
  margin-bottom: 1.35rem;
}

.brain-meter__visual {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 1rem;
}

.brain-meter__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  opacity: 0.35;
  filter: blur(2px);
}

.brain-meter__ring {
  position: absolute;
  inset: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brain-meter__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  animation: brainPulse 1.5s ease-out infinite;
}

.brain-meter__pulse::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(0, 229, 255, 0.3);
  animation: brainPulse 1.5s ease-out infinite 0.3s;
}

@keyframes brainPulse {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

.brain-meter__emoji {
  font-size: 2rem;
  animation: brainBounce 1s ease infinite;
}

@keyframes brainBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.brain-meter__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.brain-meter__bars {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 1rem;
}

.brain-meter__bars span {
  width: 4px;
  height: 24px;
  background: var(--cyan);
  border-radius: 2px;
  animation: barDance 0.8s ease infinite;
}

.brain-meter__bars span:nth-child(1) { animation-delay: 0s; }
.brain-meter__bars span:nth-child(2) { animation-delay: 0.1s; }
.brain-meter__bars span:nth-child(3) { animation-delay: 0.2s; }
.brain-meter__bars span:nth-child(4) { animation-delay: 0.3s; }
.brain-meter__bars span:nth-child(5) { animation-delay: 0.4s; }

@keyframes barDance {
  0%, 100% { transform: scaleY(0.4); opacity: 0.4; }
  50% { transform: scaleY(1); opacity: 1; }
}

.brain-meter__status {
  font-size: 0.8rem;
  color: var(--text-muted);
  animation: statusFade 2s ease infinite;
}

@keyframes statusFade {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ===== RESULTS ===== */
.results-section {
  padding: 2rem 1.5rem;
}

.results-section--glitch {
  animation: cardGlitch 0.4s ease;
}

@keyframes cardGlitch {
  0%, 100% { transform: translate(0); filter: none; }
  10% { transform: translate(-3px, 1px); filter: hue-rotate(20deg); }
  20% { transform: translate(3px, -1px); filter: hue-rotate(-20deg); }
  30% { transform: translate(-2px, 2px); }
  40% { transform: translate(2px, -2px); filter: saturate(1.5); }
  50% { transform: translate(0); filter: none; }
}

.result-hero {
  text-align: center;
  margin-bottom: 1.5rem;
}

.result-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 2rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  animation: badgePulse 2s ease infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 20px var(--badge-glow, var(--red-glow)); }
  50% { box-shadow: 0 0 40px var(--badge-glow, var(--red-glow)), 0 0 60px var(--badge-glow, var(--red-glow)); }
}

.result-badge--ragebait {
  background: rgba(255, 59, 92, 0.12);
  border: 1px solid rgba(255, 59, 92, 0.4);
  --badge-glow: var(--red-glow);
}

.result-badge--probably {
  background: rgba(255, 217, 61, 0.1);
  border: 1px solid rgba(255, 217, 61, 0.35);
  --badge-glow: rgba(255, 217, 61, 0.35);
}

.result-badge--lowquality {
  background: rgba(184, 255, 60, 0.08);
  border: 1px solid rgba(184, 255, 60, 0.3);
  --badge-glow: var(--lime-glow);
}

.result-badge--clean {
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.3);
  --badge-glow: var(--cyan-glow);
}

.result-badge__emoji {
  font-size: 2.5rem;
}

.result-badge__label {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.result-badge__label--glitch {
  position: relative;
  color: var(--red);
  text-shadow: 0 0 20px var(--red-glow);
  animation: textShake 0.5s ease;
}

.result-badge__label--glitch::before,
.result-badge__label--glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.result-badge__label--glitch::before {
  color: var(--cyan);
  animation: glitchTop 0.3s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.result-badge__label--glitch::after {
  color: var(--lime);
  animation: glitchBottom 0.3s infinite;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes glitchTop {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-3px, 1px); }
  40% { transform: translate(3px, -1px); }
  60% { transform: translate(-2px, 0); }
}

@keyframes glitchBottom {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(3px, -1px); }
  40% { transform: translate(-3px, 1px); }
  60% { transform: translate(2px, 0); }
}

@keyframes textShake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.result-hero--shake {
  animation: resultShake 0.6s ease;
}

@keyframes resultShake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-6px) rotate(-0.5deg); }
  30% { transform: translateX(6px) rotate(0.5deg); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

/* Confidence bar */
.confidence {
  max-width: 400px;
  margin: 0 auto;
}

.confidence__header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
}

.confidence__title {
  color: var(--text-muted);
  font-weight: 500;
}

.confidence__value {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--cyan);
}

.confidence__track {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.confidence__fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--cyan), var(--lime));
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px var(--cyan-glow);
}

.confidence__fill--ragebait {
  background: linear-gradient(90deg, var(--red), #ff8c42);
  box-shadow: 0 0 12px var(--red-glow);
}

/* AI Explanation */
.ai-explanation {
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.ai-explanation__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ai-explanation__avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.ai-explanation__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime-glow);
  animation: dotPulse 1.5s ease infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.ai-explanation__title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ai-explanation__model {
  margin-left: auto;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: monospace;
}

.ai-explanation__text {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.7;
}

.ai-explanation__text .typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--cyan);
  margin-left: 2px;
  animation: cursorBlink 0.8s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* GIF Reaction */
.gif-reaction {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.gif-reaction__img {
  max-width: 280px;
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  opacity: 0;
  transform: translateY(12px) scale(0.95);
}

.gif-reaction__img--visible {
  animation: gifEnter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes gifEnter {
  0% { opacity: 0; transform: translateY(12px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Result actions */
.result-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-secondary {
  flex: 1;
  min-width: 140px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 16px var(--cyan-glow);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(1px) scale(0.98);
}

.btn-secondary--share:hover {
  border-color: var(--lime);
  box-shadow: 0 0 16px var(--lime-glow);
}

/* ===== HISTORY ===== */
.history-section {
  padding: 1.25rem 1.5rem;
}

.history__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.history__title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.history__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.history__title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
}

.history__clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: color var(--transition);
}

.history__clear:hover {
  color: var(--red);
}

.history__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history__empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.history__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
}

.history__item:hover {
  border-color: var(--border-glow);
  background: rgba(0, 229, 255, 0.04);
}

.history__item-emoji {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.history__item-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}

.history__item-score {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.history__item-score--ragebait { color: var(--red); }
.history__item-score--probably { color: var(--yellow); }
.history__item-score--lowquality { color: var(--lime); }
.history__item-score--clean { color: var(--cyan); }

/* ===== RAGEBAIT SHRINE CARD ===== */
.ragebait-shrine {
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.ragebait-shrine__layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 1.5rem;
  align-items: center;
}

.ragebait-shrine__side {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.ragebait-shrine__side--right {
  justify-content: center;
}

.ragebait-shrine__photo {
  width: 100%;
  max-width: 160px;
  aspect-ratio: 4/5;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform var(--transition);
}

.ragebait-shrine__photo--small {
  max-width: 90px;
  align-self: flex-end;
  margin-right: -12px;
  border-radius: 50%;
  aspect-ratio: 1;
}

.ragebait-shrine:hover .ragebait-shrine__photo {
  transform: translateY(-4px);
}

.ragebait-shrine__main {
  text-align: center;
  position: relative;
}

.ragebait-shrine::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(255, 59, 92, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.ragebait-shrine__link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--cyan);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color var(--transition);
}

.ragebait-shrine__link:hover {
  color: var(--lime);
}

.ragebait-shrine__header {
  margin-bottom: 1rem;
  position: relative;
}

.ragebait-shrine__badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  background: rgba(255, 59, 92, 0.12);
  border: 1px solid rgba(255, 59, 92, 0.3);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.ragebait-shrine__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--text);
  text-shadow: 0 0 20px var(--red-glow);
}

.ragebait-shrine__frame {
  position: relative;
  display: inline-block;
  border-radius: var(--radius-sm);
  padding: 4px;
  background: linear-gradient(135deg, var(--red), var(--cyan), var(--lime));
  background-size: 200% 200%;
  animation: shrineBorder 4s ease infinite;
  box-shadow: 0 0 30px var(--red-glow);
}

@keyframes shrineBorder {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.ragebait-shrine__gif {
  display: block;
  max-width: 100%;
  width: 320px;
  border-radius: calc(var(--radius-sm) - 2px);
  border: 2px solid rgba(0, 0, 0, 0.4);
}

.ragebait-shrine__gif--chaos {
  animation: shrineChaos 0.3s ease infinite;
  filter: saturate(2) hue-rotate(20deg);
}

@keyframes shrineChaos {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.05) rotate(-2deg); }
  75% { transform: scale(1.05) rotate(2deg); }
}

.ragebait-shrine__caption {
  margin-top: 0.85rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  position: relative;
}

/* ===== SCREENSHOT UPLOAD ===== */
.screenshot-upload {
  margin-bottom: 1.25rem;
}

.btn-screenshot {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
  border: 1px dashed rgba(0, 229, 255, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(0, 229, 255, 0.04);
  color: var(--cyan);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  justify-content: center;
}

.btn-screenshot__thumb {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.btn-screenshot:hover {
  border-color: var(--cyan);
  background: rgba(0, 229, 255, 0.08);
  box-shadow: 0 0 20px var(--cyan-glow);
  transform: translateY(-1px);
}

.btn-screenshot:active {
  transform: translateY(1px) scale(0.98);
}

.btn-screenshot__icon {
  font-size: 1.1rem;
}

.screenshot-preview {
  margin-top: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  animation: gifEnter 0.4s ease forwards;
}

.screenshot-preview__img {
  display: block;
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.4);
}

.screenshot-preview__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}

.screenshot-preview__name {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.screenshot-preview__remove {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 59, 92, 0.1);
  color: var(--red);
  cursor: pointer;
  font-size: 0.75rem;
  flex-shrink: 0;
  margin-left: 0.5rem;
  transition: all var(--transition);
}

.screenshot-preview__remove:hover {
  background: rgba(255, 59, 92, 0.25);
  box-shadow: 0 0 12px var(--red-glow);
}

.drop-zone--has-image {
  border-color: rgba(184, 255, 60, 0.4);
  background: rgba(184, 255, 60, 0.03);
}

/* ===== EASTER EGG ===== */
.chaos-mode {
  animation: chaosFlash 0.15s ease 3;
}

@keyframes chaosFlash {
  0%, 100% { filter: none; }
  50% { filter: hue-rotate(90deg) saturate(2); }
}

.easter-egg {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 10, 18, 0.92);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.easter-egg--visible {
  opacity: 1;
  pointer-events: auto;
}

.easter-egg__content {
  text-align: center;
  padding: 2rem;
  animation: gifEnter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.easter-egg__label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--red);
  text-shadow: 0 0 20px var(--red-glow);
  margin-bottom: 1.25rem;
  animation: badgePulse 1s ease infinite;
}

.easter-egg__gif {
  max-width: min(90vw, 360px);
  border-radius: var(--radius-sm);
  border: 3px solid var(--red);
  box-shadow: 0 0 60px var(--red-glow);
  margin-bottom: 1.25rem;
}

.easter-egg__text {
  font-family: var(--font-display);
  font-size: clamp(1rem, 3vw, 1.25rem);
  font-weight: 700;
  color: var(--text);
  max-width: 480px;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.easter-egg__sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 2.5rem 1.5rem 3rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  background: rgba(7, 10, 18, 0.6);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.footer__logo {
  width: min(200px, 70vw);
  height: auto;
  object-fit: contain;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 4px 16px rgba(255, 90, 30, 0.25));
  opacity: 0.92;
}

.footer__fine {
  font-size: 0.7rem;
  margin-top: 0.35rem;
  opacity: 0.6;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 0.75rem 1.25rem;
  background: rgba(14, 20, 36, 0.95);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  z-index: 200;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  backdrop-filter: blur(12px);
}

.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== UTILITIES ===== */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== LIVE STATS (corner) ===== */
.live-stats {
  position: fixed;
  top: 5.5rem;
  left: 1rem;
  z-index: 140;
  padding: 0.55rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 8.5rem;
  border-color: rgba(0, 229, 255, 0.22);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35), 0 0 16px rgba(0, 229, 255, 0.06);
  pointer-events: none;
  user-select: none;
}

.live-stats:hover {
  transform: none;
}

.live-stats__row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  line-height: 1;
}

.live-stats__icon.icon {
  width: 0.9rem;
  height: 0.9rem;
  color: var(--cyan);
  flex-shrink: 0;
}

.live-stats__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.7);
  flex-shrink: 0;
  animation: liveDotPulse 2s ease infinite;
}

@keyframes liveDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(0.85); }
}

.live-stats__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
  min-width: 1.5rem;
}

.live-stats__row--online .live-stats__value {
  color: #4ade80;
}

.live-stats__label {
  color: var(--text-muted);
  font-size: 0.68rem;
}

/* ===== KAUCJA WIDGET (corner link) ===== */
.kaucja-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem 0.55rem 0.55rem;
  background: rgba(12, 18, 32, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(184, 255, 60, 0.35);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 24px rgba(184, 255, 60, 0.12);
  transition: all var(--transition);
  animation: kaucjaPulse 3s ease infinite;
}

@keyframes kaucjaPulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 16px rgba(184,255,60,0.1); }
  50% { box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 28px rgba(184,255,60,0.25); }
}

.kaucja-widget:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: var(--lime);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 32px var(--lime-glow);
}

.kaucja-widget__icon {
  font-size: 1.5rem;
  line-height: 1;
}

.kaucja-widget__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.kaucja-widget__label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--lime);
  letter-spacing: 0.02em;
}

.kaucja-widget__hint {
  font-size: 0.65rem;
  color: var(--text-muted);
}

@media (max-width: 480px) {
  .kaucja-widget {
    bottom: 1rem;
    right: 1rem;
    padding: 0.55rem 0.75rem;
  }

  .kaucja-widget__text {
    display: none;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero__copy {
    text-align: center;
  }

  .hero__sub {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__stats {
    justify-content: center;
  }

  .hero__avatars {
    justify-content: center;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ragebait-shrine__layout {
    grid-template-columns: 1fr;
  }

  .ragebait-shrine__side {
    flex-direction: row;
    justify-content: center;
  }

  .ragebait-shrine__side--right {
    display: none;
  }

  .ragebait-shrine__photo--small {
    margin-right: 0;
  }
}

@media (max-width: 480px) {
  .main {
    padding: 1rem;
  }

  .hero {
    padding: 1.5rem 1.25rem;
  }

  .hero__stats {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .input-section,
  .results-section {
    padding: 1.25rem;
  }

  .result-actions {
    flex-direction: column;
  }

  .btn-secondary {
    min-width: unset;
  }

  .gallery__grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero__mosaic-main img {
    height: 280px;
  }

  .shrine-meme__grid {
    grid-template-columns: 1fr;
  }

  .meme-wall {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== MEME-FIRST LAYOUT ===== */
.meme-floats {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.meme-float {
  position: absolute;
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.1);
  opacity: 0.2;
  animation: chipFloat 14s ease-in-out infinite;
}

.meme-float--1 { top: 12%; left: 3%; }
.meme-float--2 { top: 50%; right: 2%; width: 70px; height: 70px; animation-delay: -5s; }
.meme-float--3 { bottom: 18%; left: 5%; width: 64px; height: 64px; animation-delay: -9s; }

@media (max-width: 900px) { .meme-floats { display: none; } }

.hero-meme {
  position: relative;
  overflow: hidden;
  padding: 0;
}

.hero-meme__img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
  filter: brightness(0.65);
}

.hero-meme__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
  background: linear-gradient(to top, rgba(7,10,18,0.95) 25%, transparent 75%);
}

.hero-meme__eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.5rem;
}

.hero-meme__title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.hero-meme__sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.btn-meme-shuffle {
  align-self: flex-start;
  padding: 0.55rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-meme-shuffle:hover {
  border-color: var(--lime);
  box-shadow: 0 0 16px var(--lime-glow);
}

.meme-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.meme-tab {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: rgba(0,0,0,0.25);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.meme-tab--active {
  background: rgba(255, 59, 92, 0.12);
  border-color: rgba(255, 59, 92, 0.4);
  color: var(--red);
}

.meme-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.meme-card {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.3);
  cursor: pointer;
  transition: all var(--transition);
}

.meme-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}

.meme-card__tag {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(0,0,0,0.75);
}

.meme-card__tag--ragebait { color: var(--red); }
.meme-card__tag--kaucja { color: var(--lime); }

.meme-card__img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.meme-card__caption {
  padding: 0.6rem 0.75rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.shrine-meme { padding: 1.5rem; text-align: center; }

.shrine-meme__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-transform: lowercase;
}

.shrine-meme__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 520px;
  margin: 0 auto;
}

.shrine-meme__gif,
.shrine-meme__side {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  aspect-ratio: 1;
  object-fit: cover;
}

.shrine-meme__gif--chaos {
  animation: shrineChaos 0.3s ease infinite;
}

@keyframes shrineChaos {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05) rotate(2deg); }
}

.shrine-meme__caption {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.tool-section { padding: 1.5rem; }

.tool-section__head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.tool-section__icon {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.tool-section__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.tool-section__sub { font-size: 0.78rem; color: var(--text-muted); }

.loading-logo {
  width: min(280px, 85vw);
  height: auto;
  object-fit: contain;
  margin: 0 auto 1rem;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(255, 100, 30, 0.35));
  animation: logoPulse 1.2s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 8px 24px rgba(255, 100, 30, 0.35)); }
  50% { transform: scale(1.04); filter: drop-shadow(0 12px 32px rgba(255, 120, 40, 0.55)); }
}

.loading-meme {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 10px;
  margin: 0 auto 1rem;
  display: block;
  border: 2px solid var(--red);
}

.meme-result-img {
  max-width: 340px;
  width: 100%;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.gif-reaction__caption {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-style: italic;
}

.meme-lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(7,10,18,0.92);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.meme-lightbox__close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0,0,0,0.5);
  color: var(--text);
  cursor: pointer;
}

.meme-lightbox__img {
  max-width: min(90vw, 560px);
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.meme-lightbox__caption {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.kaucja-widget__thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(184,255,60,0.3);
}

.footer__meme {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 0.75rem;
  opacity: 0.75;
  border: 1px solid var(--border);
}

/* ===== MOBILE ===== */
.mobile-dock {
  display: none;
}

@media (max-width: 768px) {
  html {
    -webkit-tap-highlight-color: transparent;
    scroll-padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  }

  body {
    padding-bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
  }

  .header {
    padding: 0.85rem 1rem;
  }

  .logo__mark {
    height: 44px;
    max-width: 180px;
  }

  .logo__tagline {
    font-size: 0.58rem;
  }

  .btn-icon {
    width: 44px;
    height: 44px;
  }

  .badge--beta {
    display: none;
  }

  .main {
    padding: 1rem 0.85rem 2rem;
    gap: 1rem;
  }

  .hero-meme__img {
    height: 220px;
  }

  .hero-meme__overlay {
    padding: 1.25rem;
  }

  .btn-meme-shuffle {
    min-height: 44px;
    padding: 0.65rem 1.1rem;
  }

  .meme-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.4rem;
    padding-bottom: 0.25rem;
    margin: 0 -0.15rem;
  }

  .meme-tabs::-webkit-scrollbar {
    display: none;
  }

  .meme-tab {
    flex-shrink: 0;
    min-height: 44px;
    padding: 0.55rem 1rem;
  }

  .meme-wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .meme-card__caption {
    font-size: 0.65rem;
    padding: 0.5rem 0.6rem;
  }

  .shrine-meme {
    padding: 1.1rem;
  }

  .tool-section {
    padding: 1.1rem;
  }

  .tool-section__head {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .drop-zone {
    min-height: 88px;
    padding: 1rem;
  }

  .btn-screenshot,
  .btn-analyze,
  .btn-secondary {
    min-height: 48px;
    font-size: 0.85rem;
  }

  .btn-analyze__text {
    font-size: 0.75rem;
    letter-spacing: 0.04em;
  }

  .input-textarea,
  .input-url {
    font-size: 16px;
  }

  .meme-lightbox {
    padding: 1rem;
    padding-top: calc(1rem + env(safe-area-inset-top, 0px));
  }

  .meme-lightbox__close {
    top: calc(0.75rem + env(safe-area-inset-top, 0px));
    right: 0.75rem;
    width: 44px;
    height: 44px;
  }

  .meme-lightbox__img {
    max-height: 65vh;
  }

  .history__clear {
    min-width: 44px;
    min-height: 44px;
  }

  .kaucja-widget {
    display: none;
  }

  .live-stats {
    top: auto;
    left: 0.75rem;
    bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
    padding: 0.45rem 0.65rem;
    min-width: 7.5rem;
  }

  .live-stats__row {
    font-size: 0.66rem;
  }

  .live-stats__value {
    font-size: 0.76rem;
  }

  .mobile-dock {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    justify-content: space-around;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.45rem 0.5rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
    background: rgba(7, 10, 18, 0.94);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
  }

  .mobile-dock__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-height: 52px;
    padding: 0.35rem 0.25rem;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    transition: all var(--transition);
  }

  .mobile-dock__item:active,
  .mobile-dock__item:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
  }

  .mobile-dock__item--kaucja {
    color: var(--lime);
    border: 1px solid rgba(184, 255, 60, 0.25);
    background: rgba(184, 255, 60, 0.08);
  }

  .mobile-dock__icon {
    font-size: 1.15rem;
    line-height: 1;
  }

  .footer {
    padding-bottom: 1rem;
  }
}

@media (max-width: 380px) {
  .meme-wall {
    grid-template-columns: 1fr;
  }

  .hero-meme__title {
    font-size: 1.5rem;
  }
}
