/* Square-crop editor styles */
:root {
  --ink: #17212b;
  --ink-soft: #3d4a57;
  --muted: #697785;
  --line: #dce4eb;
  --paper: #f8fbfa;
  --panel: #ffffff;
  --aqua: #00a6a6;
  --blue: #2454ff;
  --coral: #ff6b4a;
  --gold: #f5b841;
  --shadow: 0 18px 45px rgba(23, 33, 43, 0.12);
  --soft-shadow: 0 10px 28px rgba(23, 33, 43, 0.08);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

body {
  margin: 0;
  padding: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(rgba(23, 33, 43, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 33, 43, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 0 0, rgba(0, 166, 166, 0.10), transparent 28rem),
    var(--paper);
  background-size: 32px 32px, 32px 32px, auto, auto;
}

.container {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

h1,
h2,
h3 {
  color: var(--ink);
  text-align: left;
}

h1 {
  margin: 16px 0 14px;
  font-size: clamp(2.4rem, 8vw, 4.6rem);
  line-height: 0.98;
  font-weight: 950;
  letter-spacing: -0.06em;
}

h1::after {
  content: "";
  display: block;
  width: 150px;
  height: 7px;
  margin-top: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--aqua), var(--gold), var(--coral));
}

h2 {
  margin: 42px 0 16px;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}

h3 {
  margin: 24px 0 12px;
}

p,
li {
  color: var(--ink-soft);
  font-size: 1.04rem;
  line-height: 1.65;
}

.des {
  max-width: 760px;
}

.upload-button,
select,
button {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 850;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.upload-button,
#downloadCurrentImage {
  border: 0;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 14px 24px rgba(23, 33, 43, 0.18);
}

.upload-button:hover,
button:hover,
select:hover {
  transform: translateY(-2px);
  border-color: var(--aqua);
  box-shadow: var(--soft-shadow);
}

button:focus-visible,
select:focus-visible,
a:focus-visible,
.upload-button:focus-visible {
  outline: 3px solid rgba(245, 184, 65, 0.75);
  outline-offset: 3px;
}

input[type="file"] {
  display: none;
}

.edit {
  display: none;
  margin: 24px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

#cropper {
  margin: 18px auto;
}

.cr-boundary,
.cr-viewport {
  border-radius: 14px;
}

label {
  display: inline-block;
  margin: 10px 0 6px;
  color: var(--muted);
  font-weight: 760;
}

#dropOverlay {
  position: fixed;
  inset: 16px;
  z-index: 99;
  display: none;
  align-items: center;
  justify-content: center;
  border: 3px dashed var(--blue);
  border-radius: 22px;
  background: rgba(248, 251, 250, 0.9);
  color: var(--ink);
  font-size: clamp(1.4rem, 6vw, 3rem);
  font-weight: 900;
  backdrop-filter: blur(12px);
}

#imageGallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

#imageGallery img {
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  object-fit: cover;
  margin: 0;
  border: 2px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}

#imageGallery img:hover {
  border-color: var(--aqua);
}

footer {
  margin: 46px 0 20px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.center {
  display: block;
  margin: auto;
}

.a1 {
  color: var(--ink-soft);
  text-decoration: none;
  text-underline-offset: 3px;
}

.a1:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  body {
    padding: 8px;
  }

  .container {
    padding: 16px;
    border-radius: 18px;
  }

  .edit {
    padding: 10px;
  }
}

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