:root {
  --bg: linear-gradient(180deg, #eef6ff 0%, #f5fbff 100%);
  --surface: #ffffff;
  --text: #12305e;
  --muted: #5d739a;
  --border: #d8e6fb;
  --accent: #0c49b7;
  --accent-text: #ffffff;
  --accent-2: #ffd200;
  --accent-3: #ff0f7b;
  --radius-lg: 28px;
  --radius-md: 16px;
  --shadow: 0 22px 55px rgba(12, 73, 183, 0.10);
}


* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 30px;
}

.intro {
  max-width: 720px;
  margin-bottom: 34px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 18px;
  color: #0c49b7;
}

.brand::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-2), #ff9600);
  box-shadow: 16px 0 0 #0c49b7;
  margin-right: 16px;
}

h1 {
  margin: 0;
  max-width: 660px;
  font-size: clamp(38px, 5vw, 72px);
  line-height: .98;
  letter-spacing: -.055em;
  font-weight: 820;
  color: #0f3777;
}

.intro p {
  margin: 22px 0 0;
  max-width: 580px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, .6fr);
  gap: 24px;
  align-items: start;
}

.preview-column,
.controls {
  background: var(--surface);
  border: 1px solid rgba(12,73,183,.10);
  box-shadow: var(--shadow);
}

.preview-column {
  border-radius: 1vw;
  padding: 18px;
  position: relative;
}

.preview-column::before,
.controls::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 6px;
  border-radius: 28px 28px 0 0;
  background: linear-gradient(90deg, #0c49b7 0%, #12b9e8 60%, #ffd200 60%, #ffd200 78%, #ff0f7b 78%, #ff0f7b 100%);
}

.preview-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 100%;
  background:
    linear-gradient(45deg, #ededeb 25%, transparent 25%),
    linear-gradient(-45deg, #ededeb 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ededeb 75%),
    linear-gradient(-45deg, transparent 75%, #ededeb 75%), #f8f8f6;
  background-size: 28px 28px;
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
  outline: none;
  touch-action: none;
  cursor: pointer;
}

.preview-wrap.has-image { cursor: grab; }
.preview-wrap.has-image:active { cursor: grabbing; }
.preview-wrap:focus-visible { box-shadow: 0 0 0 4px rgba(0,0,0,.14); }

canvas {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  color: var(--text);
}

.upload-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #171717;
  color: #fff;
  margin-bottom: 18px;
}

.empty-state strong { font-size: 21px; }
.empty-state span { color: var(--muted); margin-top: 7px; line-height: 1.4; }
.empty-state small { color: #92928c; margin-top: 18px; font-size: 12px; font-weight: 700; letter-spacing: .06em; }

.drag-hint {
  position: absolute;
  inset: 14px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 2px dashed #171717;
  background: rgba(255,255,255,.90);
  font-weight: 800;
  font-size: 18px;
  z-index: 10;
}

.privacy-note {
  margin: 13px 4px 2px;
  color: #898983;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.controls {
  border-radius: 1vw;
  padding: 28px;
  position: sticky;
  top: 22px;
}

.step {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 13px;
  align-items: start;
}

.step-number {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eaf2ff;
  color: #0c49b7;
  font-weight: 900;
  font-size: 13px;
  border: 1px solid #d8e6fb;
}

.step strong { display: block; font-size: 15px; margin: 1px 0 6px; }
.step p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.step.compact { margin-bottom: 20px; }


.frame-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.frame-option {
display: flex;
  appearance: none;
  border: 0px solid;
  border-radius: 24px;
  cursor: pointer;
  text-align: left;
  flex-direction: column;
    align-items: center;
    background: #ffffff !important;
    padding: 19px 10px 19px 10px;
}

.frame-option:hover {
  transform: translateY(-1px);
  background: #bfd7fb !important;
}

.frame-option:focus-visible {
  outline: 3px solid rgba(12,73,183,.18);
  outline-offset: 2px;
}

.frame-option.is-active {
  border-color: #0c49b7 !important;
  background: var(--accent-2) !important;
}

.frame-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
}

.frame-thumb img {
  display: block;
  width: 100%;
  border-radius: 100%;
  background: #cecece;
}

.frame-label {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 800;
  color: #12305e;
}


.button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: transform .16s ease, background-color .16s ease, border-color .16s ease;
}

.button:active { transform: scale(.985); }
.button:focus-visible { outline: 3px solid rgba(0,0,0,.16); outline-offset: 2px; }
.button-primary { margin-top: 22px; background: linear-gradient(135deg, #0c49b7, #1566d6); color: var(--accent-text); box-shadow: 0 12px 22px rgba(12,73,183,.18); }
.button-primary:hover, .button-download:hover { background: linear-gradient(135deg, #0a43a8, #115dca); }
.button-secondary { background: #f4f8ff; color: var(--text); border: 1px solid var(--border); }
.button-secondary:hover { background: #e9f1ff; }

.button-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: linear-gradient(135deg, #0c49b7, #1566d6);
  color: var(--accent-text);
  box-shadow: 0 12px 24px rgba(12,73,183,.18);
}

.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.divider { height: 1px; background: var(--border); margin: 26px 0; }

.field-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 750;
  margin-bottom: 11px;
}

.field-label output { color: var(--muted); font-variant-numeric: tabular-nums; }

.range {
  width: 100%;
  accent-color: #0c49b7;
  cursor: pointer;
}

.mobile-tip{
  display: none;
}

footer {
  text-align: center;
  color: #5d739a;
  font-size: 12px;
  padding-top: 24px;
}


.mobile-share-note {
  margin: 10px 4px 0;
  color: #5d739a;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  background: #171717;
  color: white;
  padding: 11px 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 100;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 850px) {
  .app-shell { width: min(680px, calc(100% - 24px)); padding-top: 34px; }
  .intro { margin-bottom: 24px; }
  .workspace { grid-template-columns: 1fr; }


  .mobile-tip {
  display: block;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(12,73,183,.07), rgba(18,185,232,.08));
  border: 1px solid #d8e6fb;
  color: #27436f;
  font-size: 13px;
  line-height: 1.5;
}

.mobile-tip strong {
  color: #0c49b7;
}
}

@media (max-width: 520px) {
  .frame-options { grid-template-columns: 1fr 1fr; }
  .app-shell { width: calc(100% - 18px);  }
  h1 { font-size: clamp(38px, 12vw, 54px); }
  .intro p { font-size: 15px; margin-top: 16px; }
  .preview-column { padding: 25px 15px 15px 15px;  }
  .button-row { grid-template-columns: 1fr; }
  .privacy-note { padding: 0 4px 4px; }
}

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

@media (max-width: 850px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .preview-column {
    top: 8px;
    z-index: 50;
    align-self: start;
  }

}
