:root {
  color-scheme: dark;
  --black: #050403;
  --black-soft: #0d0905;
  --panel: rgba(14, 10, 6, 0.97);
  --gold: #d99a31;
  --gold-bright: #ffc45a;
  --gold-soft: #ffe2a1;
  --orange: #d85508;
  --orange-bright: #f27412;
  --red: #8e2108;
  --cream: #fff0c7;
  --white: #f7f4ed;
  --muted: #c1ad8a;
  --line: rgba(217, 154, 49, 0.44);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.52);
  font-family: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--black);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--white);
  background:
    radial-gradient(circle at 50% 0%, rgba(217, 154, 49, 0.16), transparent 32rem),
    linear-gradient(180deg, #120b04 0%, #070503 38%, #000 100%);
}

button,
input,
label {
  font: inherit;
}

button,
label {
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
}

.shell {
  width: min(100% - 28px, 780px);
  margin-inline: auto;
}

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid var(--gold);
  background: #070402;
}

.hero__art {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #120b04;
}

.hero__action {
  position: relative;
  margin-top: -1px;
  padding: 20px 0 31px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(28, 15, 5, 0.95), rgba(5, 4, 3, 1));
}

.hero__action::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
}

.hero__copy {
  max-width: 560px;
  margin: 0 auto;
  color: #f3e3c4;
  font-size: 0.94rem;
  line-height: 1.5;
}

.privacy-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-top: 15px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 226, 161, 0.27);
  color: #f5dfb4;
  background: rgba(0, 0, 0, 0.56);
  font-size: 0.7rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.hero__cta {
  display: flex;
  width: min(100%, 330px);
  min-height: 50px;
  align-items: center;
  justify-content: center;
  margin: 18px auto 0;
  border: 1px solid var(--gold-bright);
  color: #fff2ce;
  text-decoration: none;
  font-family: "Anton", Impact, sans-serif;
  letter-spacing: 0.05em;
  background:
    linear-gradient(180deg, rgba(255, 196, 90, 0.2), transparent 45%),
    linear-gradient(180deg, #d85b0a 0%, #851e07 100%);
  box-shadow:
    0 13px 28px rgba(0, 0, 0, 0.38),
    inset 0 0 18px rgba(255, 191, 73, 0.15);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.section-kicker {
  margin: 0;
  color: var(--gold-bright);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h2,
.frame-card__text strong,
.upload-button strong,
.button,
.howto strong,
footer strong {
  font-family: "Anton", Impact, sans-serif;
  font-weight: 400;
  letter-spacing: 0.025em;
}

.main {
  display: grid;
  gap: 16px;
  padding-block: 18px 48px;
}

.panel {
  position: relative;
  padding: 17px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(217, 154, 49, 0.09), transparent 38%),
    var(--panel);
  box-shadow: var(--shadow);
  clip-path: polygon(11px 0, 100% 0, 100% calc(100% - 11px), calc(100% - 11px) 100%, 0 100%, 0 11px);
}

.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 11px;
  width: 92px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-bright), var(--orange));
}

.section-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 15px;
}

.section-heading--compact {
  margin-bottom: 13px;
}

.section-heading h2,
.howto h2 {
  margin: 2px 0 0;
  color: var(--cream);
  font-size: 1.55rem;
  line-height: 1;
}

.section-heading p:not(.section-kicker) {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.step {
  display: grid;
  flex: 0 0 auto;
  width: 41px;
  height: 41px;
  place-items: center;
  border: 1px solid var(--gold-bright);
  color: var(--cream);
  background: linear-gradient(180deg, #d98d1f, #7e2509);
  font-family: "Anton", Impact, sans-serif;
  font-size: 0.96rem;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.frame-grid {
  display: grid;
  gap: 10px;
}

.frame-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 560px);
  margin-inline: auto;
}

.frame-card {
  position: relative;
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 8px;
  overflow: hidden;
  border: 1px solid rgba(217, 154, 49, 0.48);
  color: var(--white);
  text-align: left;
  background: #080604;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.frame-card:active {
  transform: scale(0.985);
}

.frame-card.is-active {
  border-color: var(--gold-bright);
  box-shadow:
    0 0 0 2px rgba(255, 196, 90, 0.15),
    0 12px 28px rgba(0, 0, 0, 0.34);
}

.thumb {
  position: relative;
  display: grid;
  width: 100%;
  overflow: hidden;
  place-items: center;
  background:
    linear-gradient(45deg, #2b2116 25%, transparent 25%),
    linear-gradient(-45deg, #2b2116 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2b2116 75%),
    linear-gradient(-45deg, transparent 75%, #2b2116 75%),
    #12100d;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.thumb--preview {
  aspect-ratio: 1 / 1;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.frame-card__text {
  min-width: 0;
  padding: 1px 3px 4px;
}

.frame-card__text strong {
  display: block;
  overflow: hidden;
  color: var(--cream);
  font-size: 0.86rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.frame-card__text small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.68rem;
}

.check {
  position: absolute;
  top: 13px;
  right: 13px;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid var(--cream);
  color: var(--cream);
  background: linear-gradient(180deg, var(--gold), var(--red));
  font-size: 0.76rem;
  font-weight: 900;
  opacity: 0;
  transform: scale(0.72);
  transition: opacity 150ms ease, transform 150ms ease;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}

.frame-card.is-active .check {
  opacity: 1;
  transform: scale(1);
}

.upload-button {
  display: flex;
  gap: 13px;
  align-items: center;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--gold);
  color: var(--cream);
  background:
    linear-gradient(100deg, rgba(217, 154, 49, 0.15), rgba(142, 33, 8, 0.08)),
    #080604;
  cursor: pointer;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.upload-button:active {
  transform: scale(0.99);
}

.upload-button__icon {
  display: grid;
  flex: 0 0 auto;
  width: 43px;
  height: 43px;
  place-items: center;
  color: var(--cream);
  background: linear-gradient(180deg, var(--gold), var(--red));
  font-size: 1.42rem;
  font-weight: 700;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.upload-button strong,
.upload-button small {
  display: block;
}

.upload-button strong {
  font-size: 0.96rem;
}

.upload-button small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.71rem;
}

.error-box {
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 108, 83, 0.48);
  color: #ffd9d0;
  background: rgba(103, 24, 11, 0.38);
  font-size: 0.76rem;
  line-height: 1.45;
}

.editor-panel {
  scroll-margin-top: 12px;
}

.canvas-wrap {
  position: relative;
  display: grid;
  width: min(100%, 430px);
  margin-inline: auto;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--gold);
  background:
    linear-gradient(45deg, #2b2116 25%, transparent 25%),
    linear-gradient(-45deg, #2b2116 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2b2116 75%),
    linear-gradient(-45deg, transparent 75%, #2b2116 75%),
    #0b0907;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.47);
  touch-action: none;
  user-select: none;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}

.canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: grab;
}

.canvas-wrap canvas:active {
  cursor: grabbing;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--cream);
  text-align: center;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(2px);
}

.empty-state__icon {
  margin-bottom: 8px;
  font-size: 2rem;
}

.empty-state strong {
  font-family: "Anton", Impact, sans-serif;
  font-size: 0.86rem;
  letter-spacing: 0.03em;
}

.empty-state small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.72rem;
}

.canvas-wrap:not(.is-empty) .empty-state {
  display: none;
}

.gesture-hint {
  position: absolute;
  right: 9px;
  bottom: 9px;
  display: flex;
  gap: 5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.canvas-wrap:not(.is-empty) .gesture-hint {
  opacity: 1;
}

.gesture-hint span {
  padding: 5px 7px;
  color: var(--cream);
  background: rgba(0, 0, 0, 0.76);
  font-size: 0.58rem;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.controls {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.control {
  display: grid;
  gap: 7px;
}

.control > span {
  display: flex;
  justify-content: space-between;
  color: var(--cream);
  font-size: 0.75rem;
}

.control output {
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  height: 30px;
  margin: 0;
  accent-color: var(--gold);
}

input[type="range"]:disabled {
  opacity: 0.38;
}

.mini-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.button {
  display: inline-flex;
  min-height: 49px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border: 1px solid transparent;
  color: var(--cream);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.36;
}

.button--secondary {
  border-color: rgba(217, 154, 49, 0.62);
  background: #0b0805;
  font-size: 0.76rem;
}

.button--primary {
  width: 100%;
  margin-top: 13px;
  border-color: var(--gold-bright);
  background:
    linear-gradient(180deg, rgba(255, 196, 90, 0.18), transparent 42%),
    linear-gradient(180deg, #dc5c0a 0%, #8d2007 100%);
  box-shadow: 0 13px 30px rgba(0, 0, 0, 0.4);
  font-size: 0.98rem;
}

.button--share {
  width: 100%;
  margin-top: 8px;
  border-color: rgba(255, 226, 161, 0.32);
  background: #111;
  font-size: 0.87rem;
}

.button--primary:not(:disabled):active,
.button--secondary:active,
.button--share:active {
  transform: translateY(1px) scale(0.995);
}

.download-note {
  margin: 9px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.66rem;
  line-height: 1.4;
}

.howto {
  padding: 15px 2px 0;
}

.howto__grid {
  display: grid;
  gap: 8px;
}

.howto article {
  position: relative;
  min-height: 90px;
  padding: 14px 14px 14px 55px;
  border: 1px solid rgba(217, 154, 49, 0.35);
  background: rgba(255, 255, 255, 0.018);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.howto article > span {
  position: absolute;
  top: 15px;
  left: 14px;
  color: var(--gold-bright);
  font-family: "Anton", Impact, sans-serif;
  font-size: 0.85rem;
}

.howto strong {
  display: block;
  color: var(--cream);
  font-size: 0.85rem;
}

.howto p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.71rem;
  line-height: 1.4;
}

footer {
  border-top: 2px solid var(--gold);
  color: var(--muted);
  background: #000;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 25px 0 max(28px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.7rem;
}

footer strong {
  color: var(--cream);
  font-size: 0.84rem;
}

.copyright {
  display: block;
  margin-top: 9px;
  color: #817464;
  font-size: 0.64rem;
  text-align: center;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (min-width: 620px) {
  .hero__action {
    padding-block: 24px 38px;
  }

  .main {
    gap: 20px;
    padding-top: 24px;
  }

  .panel {
    padding: 22px;
  }

  .frame-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .howto__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .howto article {
    min-height: 126px;
    padding: 42px 14px 14px;
  }

  .howto article > span {
    top: 14px;
  }
}

@media (max-width: 619px) {
  .hero__copy {
    font-size: 0.84rem;
  }

  .privacy-pill {
    max-width: 100%;
    font-size: 0.64rem;
  }
}

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


.frame-grid--two .frame-card__text strong {
  white-space: normal;
}

@media (max-width: 390px) {
  .frame-grid--two {
    gap: 7px;
  }

  .frame-card {
    padding: 6px;
  }

  .frame-card__text strong {
    font-size: 0.76rem;
  }

  .frame-card__text small {
    font-size: 0.61rem;
  }
}
