/* Blurred-frame 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;
  display: block;
  max-width: none;
  overflow-x: hidden;
  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(1080px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px);
  display: block;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

h1,
h2,
h3,
p {
  text-align: left;
}

h1 {
  margin: 16px 0 14px;
  color: var(--ink);
  font-size: clamp(2.4rem, 8vw, 4.7rem);
  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;
  color: var(--ink);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}

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

.des {
  max-width: 760px;
}

.label1,
#downloadBtn {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  margin: 18px 0;
  border: 0;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 1rem;
  font-weight: 850;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 14px 24px rgba(23, 33, 43, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.label1:hover,
#downloadBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(23, 33, 43, 0.20);
}

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

#imageUpload {
  display: none;
}

.ont {
  display: none;
  margin: 24px 0;
}

.editor {
  display: grid;
  grid-template-columns: minmax(320px, 1.35fr) minmax(260px, 0.75fr);
  gap: 16px;
  align-items: start;
  width: 100%;
}

.canvas-container,
.tools {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.canvas-container {
  min-height: 330px;
  margin: 0;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background:
    linear-gradient(45deg, #eef4f2 25%, transparent 25% 75%, #eef4f2 75%),
    linear-gradient(45deg, #eef4f2 25%, transparent 25% 75%, #eef4f2 75%),
    #ffffff;
  background-size: 30px 30px;
  background-position: 0 0, 15px 15px;
}

.tools {
  padding: 16px;
}

canvas {
  max-width: 100%;
  border-radius: 14px;
  box-shadow: 0 14px 28px rgba(23, 33, 43, 0.14);
}

.label2 {
  display: block;
  margin: 16px 0 8px;
  color: var(--muted);
  font-weight: 780;
}

.aratio,
#customRatio {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--aqua);
}

.loading-indicator {
  display: none;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  text-align: center;
}

.dot {
  display: inline-block;
  opacity: 0;
  animation: blink 1.4s infinite both;
}

.dot1 {
  animation-delay: 0;
}

.dot2 {
  animation-delay: 0.2s;
}

.dot3 {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
}

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: 860px) {
  .editor {
    grid-template-columns: 1fr;
  }
}

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

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

  .canvas-container {
    min-height: 260px;
    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;
  }
}
