/* ==========================================================
   RESPONSIVE DESIGN
========================================================== */

/* ===========================
   1440px+
=========================== */

@media (width >= 1440px) {
  .container {
    max-width: 980px;
  }

  .chapter-box {
    padding: 3rem;
  }

  .manga-card {
    padding: 3rem;
  }

  .output-panel {
    min-height: 220px;
  }
}

/* ===========================
   DESKTOP
=========================== */

@media (width <= 1200px) {
  .container {
    width: min(94%, 900px);
  }
}

/* ===========================
   TABLETS
=========================== */

@media (width <= 992px) {
  .container {
    padding: 2rem 1rem;
  }

  .chapter-box h1 {
    font-size: clamp(2.5rem, 8vw, 4rem);
  }

  .manga-card {
    padding: 1.75rem;
  }

  .floating-panels span {
    opacity: 0.35;
  }
}

/* ===========================
   LARGE PHONES
=========================== */

@media (width <= 768px) {
  .container {
    width: 95%;
  }

  .chapter-box {
    padding: 1.5rem;
  }

  .chapter-box h1 {
    letter-spacing: 1px;
  }

  .manga-card {
    padding: 1.5rem;
  }

  .panel {
    margin-bottom: 1.4rem;
  }

  .input-group {
    flex-direction: column;
  }

  .input-group button {
    width: 100%;
    height: 52px;
  }

  .action-buttons {
    grid-template-columns: 1fr;
  }

  .action-buttons button {
    width: 100%;
  }

  .output-panel {
    min-height: 160px;
    padding: 1.5rem;
  }
}

/* ===========================
   MOBILE
=========================== */

@media (width <= 576px) {
  body {
    font-size: 15px;
  }

  .container {
    padding: 1rem 0.75rem;
  }

  .chapter-box {
    padding: 1.25rem;
  }

  .chapter-small {
    font-size: 0.75rem;
    letter-spacing: 2px;
  }

  .chapter-box h1 {
    font-size: 2.4rem;
  }

  .jp {
    font-size: 0.85rem;
  }

  .manga-card {
    padding: 1rem;
  }

  .panel label {
    font-size: 1rem;
  }

  .input-group input {
    height: 52px;
    font-size: 0.95rem;
  }

  .action-buttons button {
    height: 56px;
    font-size: 1rem;
    letter-spacing: 2px;
  }

  .output-panel {
    min-height: 150px;
    padding: 1rem;
  }

  footer {
    font-size: 0.85rem;
    padding-bottom: 1rem;
  }

  .floating-panels {
    display: none;
  }

  .halftone {
    opacity: 0.04;
  }
}

/* ===========================
   SMALL DEVICES
=========================== */

@media (width <= 400px) {
  .chapter-box h1 {
    font-size: 2rem;
  }

  .chapter-small {
    font-size: 0.7rem;
  }

  .panel label {
    font-size: 0.95rem;
  }

  .input-group input {
    padding: 0.75rem;
  }

  .action-buttons {
    gap: 0.75rem;
  }
}

/* ===========================
   VERY SMALL DEVICES
=========================== */

@media (width <= 340px) {
  .container {
    width: 98%;
  }

  .chapter-box {
    padding: 1rem;
  }

  .manga-card {
    padding: 0.85rem;
  }

  .chapter-box h1 {
    font-size: 1.8rem;
  }

  .output-panel {
    min-height: 130px;
    font-size: 0.9rem;
  }
}

/* ===========================
   LANDSCAPE PHONES
=========================== */

@media (height <= 500px) and (orientation: landscape) {
  .container {
    padding: 1rem;
  }

  .chapter-box {
    margin-bottom: 1rem;
  }

  .manga-card {
    padding: 1rem;
  }

  .output-panel {
    min-height: 120px;
  }
}

/* ===========================
   REDUCED MOTION
=========================== */

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ===========================
   HIGH DPI
=========================== */

@media (min-device-pixel-ratio: 2), (resolution >= 192dpi) {
  .paper-texture {
    opacity: 0.12;
  }
}

/* ===========================
   PRINT
=========================== */

@media print {
  body {
    background: white;
  }

  .paper-texture,
  .halftone,
  .floating-panels,
  .speed-lines {
    display: none;
  }

  .chapter-box,
  .manga-card {
    box-shadow: none;
  }
}
