:root {
  --ink: #17121a;
  --cream: #fff9ef;
  --paper: #f7f1e8;
  --pink: #ff5cb8;
  --hot-pink: #ff2f9b;
  --lime: #dfff55;
  --aqua: #75eced;
  --violet: #a58aff;
  --line: 2px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 11% 22%, rgba(255, 92, 184, 0.15) 0 10%, transparent 10.5%),
    radial-gradient(circle at 93% 87%, rgba(117, 236, 237, 0.18) 0 12%, transparent 12.5%),
    var(--paper);
  font-family: Inter, "Arial Black", "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
.upload-zone:focus-within {
  outline: 3px solid var(--aqua);
  outline-offset: 2px;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 99;
  opacity: 0.055;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.topbar {
  min-height: 82px;
  padding: 14px clamp(18px, 3vw, 52px);
  border-bottom: var(--line);
  background: rgba(255, 249, 239, 0.94);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  z-index: 5;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  display: grid;
  grid-template-columns: 34px auto;
  grid-template-rows: 31px 15px;
  font-size: 26px;
  font-weight: 1000;
  letter-spacing: -2px;
  line-height: 1;
}

.brand-star {
  width: 29px;
  height: 29px;
  border: var(--line);
  background: var(--lime);
  border-radius: 50%;
  display: grid;
  place-items: center;
  grid-row: 1 / 3;
  align-self: center;
  font-size: 18px;
  transform: rotate(-8deg);
}

.brand .amp {
  color: var(--pink);
  font-family: Georgia, serif;
  font-style: italic;
}

.brand small {
  grid-column: 2;
  font-size: 8px;
  letter-spacing: 3px;
  font-weight: 900;
}

.top-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-tags span {
  padding: 5px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.5px;
  background: white;
}

.top-tags span:nth-child(2) {
  background: var(--lime);
}

.top-tags span:nth-child(3) {
  color: white;
  background: var(--ink);
}

.app-shell {
  width: min(1500px, 100%);
  min-height: calc(100vh - 82px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 350px) minmax(430px, 1fr) minmax(270px, 370px);
}

.panel {
  padding: 28px clamp(20px, 2.2vw, 34px) 36px;
  background: rgba(255, 249, 239, 0.74);
}

.left-panel {
  border-right: var(--line);
}

.right-panel {
  border-left: var(--line);
}

.panel-kicker {
  display: inline-block;
  margin-bottom: 7px;
  padding: 4px 7px;
  background: var(--ink);
  color: white;
  font-family: "Courier New", monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.3px;
  transform: rotate(-1deg);
}

.panel h2 {
  margin: 0 0 21px;
  font-size: clamp(20px, 2vw, 29px);
  font-weight: 1000;
  letter-spacing: -1.5px;
}

.upload-zone {
  min-height: 172px;
  border: 2px dashed var(--ink);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.82) 50%, transparent 50%) 0 0 / 14px 14px,
    linear-gradient(rgba(255,255,255,.82) 50%, transparent 50%) 0 0 / 14px 14px,
    #f1eaf5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: relative;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

.upload-zone:hover,
.upload-zone.is-dragging {
  transform: translateY(-2px) rotate(-0.4deg);
  background-color: #ffe2f3;
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-disc {
  width: 56px;
  height: 56px;
  margin-bottom: 8px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(from 30deg, #9ef5f2, #fbb4db, #e8f78b, #a7a9ff, #9ef5f2);
  box-shadow: inset 0 0 0 7px rgba(255,255,255,.62);
}

.upload-disc i {
  width: 14px;
  height: 14px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: white;
}

.upload-zone strong {
  font-size: 15px;
  font-weight: 1000;
}

.upload-zone small {
  margin-top: 2px;
  color: #665c68;
  font-size: 11px;
}

.upload-zone em {
  position: absolute;
  right: 10px;
  bottom: 9px;
  padding: 3px 6px;
  background: var(--lime);
  border: 1px solid var(--ink);
  font-family: "Courier New", monospace;
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
  transform: rotate(-2deg);
}

.mini-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 40px;
  gap: 7px;
  margin-top: 10px;
}

.mini-button,
.history-actions button,
.layer-actions button,
.selected-title button {
  min-height: 34px;
  border: 1.5px solid var(--ink);
  background: white;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
}

.mini-button:hover,
.history-actions button:hover,
.layer-actions button:hover,
.selected-title button:hover {
  background: var(--lime);
  transform: translate(-1px, -1px);
}

.mini-button:active,
.history-actions button:active,
.layer-actions button:active,
.selected-title button:active {
  box-shadow: none;
  transform: translate(2px, 2px);
}

.mini-button:disabled,
.photo-rotation-head button:disabled,
.photo-rotation-control input:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.mini-button:disabled:hover {
  background: white;
  box-shadow: 2px 2px 0 var(--ink);
  transform: none;
}

.photo-rotation-control {
  margin-top: 10px;
  padding: 10px 11px 8px;
  border: 1.5px dashed var(--ink);
  border-radius: 11px;
  background: rgba(255, 222, 241, .68);
}

.photo-rotation-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 7px;
  align-items: center;
  margin-bottom: 9px;
}

.photo-rotation-head label {
  font-size: 10px;
  font-weight: 1000;
}

.photo-rotation-head output {
  min-width: 42px;
  color: var(--hot-pink);
  font-family: "Courier New", monospace;
  font-size: 11px;
  font-weight: 900;
  text-align: right;
}

.photo-rotation-head button {
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: white;
  font-size: 8px;
  font-weight: 900;
  cursor: pointer;
}

.photo-rotation-head button:not(:disabled):hover {
  background: var(--lime);
}

.photo-rotation-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: #716971;
  font-family: "Courier New", monospace;
  font-size: 7px;
  font-weight: 700;
}

.control-group {
  margin-top: 27px;
}

.group-head {
  margin-bottom: 11px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.group-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 1000;
}

.group-head span {
  color: #756d77;
  font-family: "Courier New", monospace;
  font-size: 9px;
  font-weight: 700;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.filter-chip {
  min-width: 0;
  padding: 5px 5px 7px;
  border: 1.5px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}

.filter-chip:hover,
.filter-chip.is-active {
  border-color: var(--ink);
  background: white;
  box-shadow: 2px 2px 0 var(--ink);
}

.filter-preview {
  height: 54px;
  display: block;
  border-radius: 7px;
  border: 1px solid var(--ink);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, #f5c5af 0 13%, transparent 14%),
    radial-gradient(ellipse at 50% 85%, #2b2232 0 35%, transparent 36%),
    linear-gradient(135deg, #c9dafa, #f9c4db);
}

.filter-preview::before {
  content: "";
  position: absolute;
  width: 30px;
  height: 23px;
  left: calc(50% - 15px);
  top: 10px;
  border-radius: 50% 50% 35% 35%;
  background: #30202f;
}

.filter-preview.pink { filter: saturate(1.4) hue-rotate(-12deg); }
.filter-preview.blue { filter: saturate(.9) hue-rotate(28deg) contrast(1.1); }
.filter-preview.milky { filter: brightness(1.18) contrast(.8) saturate(.75); }
.filter-preview.cyber { filter: saturate(1.8) contrast(1.35) hue-rotate(-24deg); }
.filter-preview.mono { filter: grayscale(1) contrast(1.15); }

.filter-chip span {
  margin-top: 4px;
  display: block;
  font-family: "Courier New", monospace;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.05;
  text-transform: uppercase;
}

.adjustments {
  margin-top: 22px;
  border-top: 1px solid #b9b0b8;
  border-bottom: 1px solid #b9b0b8;
}

.adjustments summary {
  padding: 12px 0;
  display: flex;
  justify-content: space-between;
  list-style: none;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.adjustments[open] summary span {
  transform: rotate(45deg);
}

.adjustments label,
.selected-tools > label {
  margin: 3px 0 12px;
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 9px;
  align-items: center;
}

.adjustments label span,
.selected-tools > label span {
  font-size: 10px;
  font-weight: 800;
}

.adjustments output {
  color: var(--hot-pink);
  font-family: "Courier New", monospace;
}

input[type="range"] {
  width: 100%;
  height: 4px;
  border: 0;
  appearance: none;
  background: var(--ink);
  border-radius: 99px;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  appearance: none;
  background: var(--pink);
  box-shadow: 1px 1px 0 var(--ink);
}

.studio {
  min-width: 0;
  padding: 19px clamp(18px, 3.2vw, 54px) 28px;
  background:
    linear-gradient(45deg, rgba(0,0,0,.035) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.035) 75%) 0 0 / 24px 24px,
    linear-gradient(45deg, rgba(0,0,0,.035) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.035) 75%) 12px 12px / 24px 24px,
    #e9e1e9;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.studio-head,
.studio-caption {
  width: min(100%, 480px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "Courier New", monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
}

.live-dot {
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  display: inline-block;
  background: var(--hot-pink);
  box-shadow: 0 0 0 4px rgba(255, 47, 155, .16);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  50% { box-shadow: 0 0 0 7px rgba(255, 47, 155, 0); }
}

.history-actions {
  display: flex;
  gap: 5px;
}

.history-actions button {
  min-width: 30px;
  min-height: 26px;
  padding: 0 7px;
  box-shadow: 1px 1px 0 var(--ink);
}

.history-actions button:disabled {
  cursor: not-allowed;
  opacity: .35;
  box-shadow: none;
}

.canvas-stage {
  width: min(100%, 480px);
  margin: 15px auto 9px;
  padding: 14px 0 17px;
  display: grid;
  place-items: center;
  position: relative;
  isolation: isolate;
}

.canvas-stage::before {
  content: "";
  position: absolute;
  width: min(88%, 410px);
  height: 76%;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--lime);
  transform: rotate(-7deg);
  z-index: -3;
}

.card-shadow {
  position: absolute;
  width: min(76%, 370px);
  aspect-ratio: 5 / 7;
  border-radius: 4px;
  background: var(--ink);
  transform: translate(11px, 11px) rotate(1.5deg);
  z-index: -1;
}

#cardCanvas {
  width: min(76%, 370px);
  height: auto;
  aspect-ratio: 5 / 7;
  display: block;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: white;
  cursor: grab;
  touch-action: none;
  position: relative;
  z-index: 1;
}

#cardCanvas:active {
  cursor: grabbing;
}

.sparkle {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink);
  background: white;
  box-shadow: 2px 2px 0 var(--ink);
  font-weight: 900;
}

.s-one {
  width: 42px;
  height: 42px;
  left: 1%;
  top: 14%;
  border-radius: 50%;
  color: var(--hot-pink);
  transform: rotate(-12deg);
}

.s-two {
  width: 38px;
  height: 38px;
  right: 0;
  bottom: 16%;
  color: #5735ff;
  transform: rotate(11deg);
}

.s-three {
  right: 4%;
  top: 4%;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--pink);
  font-size: 27px;
}

.drag-hint {
  position: absolute;
  bottom: 4px;
  z-index: 3;
  padding: 5px 10px;
  border: 1px solid var(--ink);
  border-radius: 99px;
  background: rgba(255,255,255,.91);
  font-size: 9px;
  font-weight: 800;
  pointer-events: none;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.drag-hint.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.studio-caption {
  padding: 0 4px;
  color: #615961;
}

.selected-tools {
  width: min(100%, 480px);
  margin-top: 13px;
  padding: 10px 12px;
  border: 1.5px solid var(--ink);
  background: rgba(255,255,255,.84);
  box-shadow: 3px 3px 0 var(--ink);
}

.selected-tools.is-hidden {
  display: none;
}

.selected-title {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
}

.selected-title strong {
  color: var(--hot-pink);
}

.selected-title button {
  min-height: 25px;
  padding: 0 8px;
  box-shadow: 1px 1px 0 var(--ink);
}

.selected-title button.danger:hover {
  color: white;
  background: #ff3b49;
}

.selected-tools > label {
  margin: 8px 0;
}

.layer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.layer-actions button {
  min-height: 28px;
  box-shadow: 1px 1px 0 var(--ink);
}

.download-button {
  width: min(100%, 480px);
  min-height: 58px;
  margin-top: 18px;
  padding: 9px 64px 9px 18px;
  border: 2px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: var(--pink);
  box-shadow: 5px 5px 0 var(--ink);
  cursor: pointer;
  position: relative;
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.download-button:hover {
  background: var(--lime);
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--ink);
}

.download-button:active {
  transform: translate(4px, 4px);
  box-shadow: 1px 1px 0 var(--ink);
}

.download-button span,
.download-button small {
  display: block;
}

.download-button span {
  font-size: 15px;
  font-weight: 1000;
}

.download-button small {
  margin-top: 2px;
  font-family: "Courier New", monospace;
  font-size: 8px;
  letter-spacing: 1px;
}

.download-button i {
  position: absolute;
  right: 16px;
  top: 9px;
  width: 38px;
  height: 38px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: white;
  display: grid;
  place-items: center;
  font-size: 23px;
  font-style: normal;
  font-weight: 900;
}

.privacy-note {
  max-width: 480px;
  margin: 12px auto 0;
  color: #635c66;
  font-size: 9px;
  text-align: center;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 2px solid var(--ink);
}

.tab {
  padding: 9px 4px;
  border: 0;
  background: transparent;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.tab.is-active {
  color: white;
  background: var(--ink);
}

.tab-panel {
  display: none;
  padding-top: 17px;
}

.tab-panel.is-active {
  display: block;
}

.sticker-categories,
.frame-categories {
  display: flex;
  gap: 6px;
  margin-bottom: 11px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.sticker-categories button,
.frame-categories button {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: white;
  font-size: 9px;
  font-weight: 900;
  cursor: pointer;
}

.sticker-categories button:hover,
.sticker-categories button.is-active,
.frame-categories button:hover,
.frame-categories button.is-active {
  background: var(--lime);
  box-shadow: 2px 2px 0 var(--ink);
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-height: 520px;
  padding: 2px 6px 8px 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--ink) transparent;
}

.sticker-grid button {
  min-width: 0;
  aspect-ratio: 1;
  padding: 5px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #f1edf4 25%, transparent 25% 75%, #f1edf4 75%) 0 0 / 16px 16px,
    linear-gradient(45deg, #f1edf4 25%, white 25% 75%, #f1edf4 75%) 8px 8px / 16px 16px;
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
  overflow: hidden;
}

.sticker-grid button:hover {
  background: var(--lime);
  transform: rotate(-3deg) scale(1.04);
}

.sticker-grid button:nth-child(2n):hover {
  transform: rotate(3deg) scale(1.04);
}

.sticker-grid button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.sticker-loading {
  grid-column: 1 / -1;
  padding: 24px 8px;
  border: 1px dashed #938993;
  color: #746a73;
  font-size: 10px;
  text-align: center;
}

.sticker-icon {
  min-height: 34px;
  display: grid;
  place-items: center;
  font-size: clamp(22px, 2.2vw, 34px);
  font-weight: 1000;
  line-height: 1;
  -webkit-text-stroke: 1px var(--ink);
}

.sticker-grid small {
  display: block;
  font-family: "Courier New", monospace;
  font-size: 6px;
  font-weight: 900;
}

.spark-icon { color: var(--lime); }
.heart-icon { color: var(--pink); }
.bow-icon { color: #8d78ff; }
.butterfly-icon { color: var(--aqua); letter-spacing: -10px; transform: translateX(-5px); }
.cherry-icon { color: #ff3948; letter-spacing: -3px; }
.cd-icon { color: #a6d9ff; }
.smile-icon { color: #ffe147; }
.crown-icon { color: #e8ff4c; }
.kiss-icon { color: #ff337f; }
.flower-icon { color: #ff9dcc; }
.phone-icon { color: #8295ff; }
.warning-icon { color: #ff3d50; }

.tiny-tip {
  margin: 14px 0 0;
  padding-top: 10px;
  border-top: 1px dashed #938993;
  color: #746a73;
  font-size: 9px;
  text-align: center;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-family: "Courier New", monospace;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1px;
}

.text-entry {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 6px;
}

.text-entry input,
select {
  min-width: 0;
  height: 42px;
  padding: 0 11px;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: white;
  font-size: 12px;
  font-weight: 800;
}

.text-entry button {
  border: 1.5px solid var(--ink);
  color: white;
  background: var(--pink);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 23px;
  font-weight: 900;
  cursor: pointer;
}

.field-row {
  margin-top: 15px;
  display: grid;
  grid-template-columns: 1fr 70px;
  gap: 10px;
}

.field-row label > span {
  margin-bottom: 5px;
  display: block;
  font-size: 9px;
  font-weight: 900;
}

.field-row select,
.field-row input[type="color"] {
  width: 100%;
  height: 38px;
  border: 1.5px solid var(--ink);
  background: white;
}

.quick-phrases {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.quick-phrases > span {
  width: 100%;
  font-size: 10px;
  font-weight: 900;
}

.quick-phrases button {
  padding: 6px 8px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: white;
  font-family: "Courier New", monospace;
  font-size: 8px;
  font-weight: 800;
  cursor: pointer;
}

.quick-phrases button:hover {
  background: var(--lime);
}

.custom-frame-upload {
  min-height: 72px;
  margin-bottom: 13px;
  padding: 10px 12px;
  border: 1.5px dashed var(--ink);
  border-radius: 12px;
  background: linear-gradient(135deg, #fff 0 45%, #ffe3f3 45% 72%, #defafa 72%);
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  position: relative;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.custom-frame-upload:hover,
.custom-frame-upload.is-dragging {
  box-shadow: 3px 3px 0 var(--ink);
  transform: translate(-1px, -1px);
}

.custom-frame-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.custom-frame-plus {
  width: 36px;
  height: 44px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  background: white;
  display: grid;
  place-items: center;
  color: var(--hot-pink);
  font-size: 23px;
  font-weight: 500;
  box-shadow: 2px 2px 0 var(--ink);
}

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

.custom-frame-upload strong {
  font-size: 11px;
  font-weight: 1000;
}

.custom-frame-upload small {
  margin-top: 3px;
  color: #716971;
  font-size: 7px;
  line-height: 1.45;
}

.custom-frame-upload em {
  padding: 4px 6px;
  border: 1px solid var(--ink);
  background: var(--lime);
  font-family: "Courier New", monospace;
  font-size: 7px;
  font-style: normal;
  font-weight: 900;
  transform: rotate(2deg);
}

.custom-frame-upload.has-frame em {
  color: white;
  background: var(--hot-pink);
}

.frame-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 520px;
  padding: 2px 6px 8px 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--ink) transparent;
}

.frame-option {
  min-width: 0;
  padding: 6px;
  border: 1.5px solid var(--ink);
  background: white;
  display: block;
  position: relative;
  text-align: center;
  cursor: pointer;
}

.frame-option:hover,
.frame-option.is-active {
  background: #f1ffb9;
  box-shadow: 2px 2px 0 var(--ink);
}

.frame-option > img {
  width: 100%;
  aspect-ratio: 5 / 7;
  object-fit: cover;
  border: 1px solid var(--ink);
  display: block;
}

.chrome-frame { background: linear-gradient(135deg, #fff, #8fb4c7 30%, #fff 48%, #c6a0dd 72%, #fafafa); }
.pink-frame { background: radial-gradient(circle, #fff 0 22%, transparent 24%) 0 0/12px 12px, #ff78bf; }
.scrap-frame { background: repeating-linear-gradient(-45deg, #fbf0dc 0 7px, #ffcbdc 7px 10px); }
.aqua-frame { background: linear-gradient(145deg, rgba(255,255,255,.7), #65e3e0, rgba(255,255,255,.7)); }
.black-frame { background: radial-gradient(circle, #f4ff55 0 1px, transparent 2px) 0 0/8px 8px, #181419; }
.clean-frame { background: #fff; }

.frame-option span {
  min-width: 0;
  padding-top: 6px;
  display: block;
}

.frame-option strong,
.frame-option small {
  display: block;
}

.frame-option strong {
  font-family: "Courier New", monospace;
  font-size: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frame-option small {
  margin-top: 2px;
  color: #716971;
  font-size: 7px;
}

.frame-option em {
  display: none;
  position: absolute;
  right: 10px;
  top: 10px;
  width: 17px;
  height: 17px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--pink);
  color: white;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.frame-option.is-active em {
  display: block;
}

.frame-loading {
  grid-column: 1 / -1;
  padding: 24px 8px;
  border: 1px dashed #938993;
  color: #746a73;
  font-size: 10px;
  text-align: center;
}

.mood-note {
  margin-top: 28px;
  padding: 13px 18px;
  border: 1.5px solid var(--ink);
  background: var(--aqua);
  box-shadow: var(--shadow);
  position: relative;
  transform: rotate(1.4deg);
}

.mood-note span {
  display: block;
  font-family: "Courier New", monospace;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 1px;
}

.mood-note strong {
  display: block;
  margin-top: 3px;
  font-family: Georgia, serif;
  font-size: 21px;
  font-style: italic;
  line-height: .95;
}

.mood-note i {
  position: absolute;
  top: 8px;
  right: 12px;
  color: var(--pink);
  font-size: 23px;
  font-style: normal;
  -webkit-text-stroke: 1px var(--ink);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 100;
  min-width: 220px;
  padding: 12px 18px;
  border: 2px solid var(--ink);
  background: var(--lime);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 260px minmax(430px, 1fr);
  }

  .right-panel {
    grid-column: 1 / -1;
    border-top: var(--line);
    border-left: 0;
  }

  .right-panel .tab-panel {
    max-width: 760px;
  }

  .sticker-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

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

  .mood-note {
    max-width: 400px;
  }
}

@media (max-width: 760px) {
  .topbar {
    min-height: 68px;
  }

  .top-tags span:first-child,
  .top-tags span:nth-child(2) {
    display: none;
  }

  .app-shell {
    display: flex;
    flex-direction: column;
  }

  .studio {
    order: 1;
    min-height: auto;
    padding: 15px 18px 26px;
  }

  .left-panel {
    order: 2;
    border-top: var(--line);
    border-right: 0;
  }

  .right-panel {
    order: 3;
  }

  .panel {
    padding: 24px 20px 30px;
  }

  .canvas-stage {
    max-width: 430px;
  }

  #cardCanvas,
  .card-shadow {
    width: min(79vw, 340px);
  }

  .filter-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .filter-preview {
    height: 63px;
  }

  .sticker-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 500px) {
  .brand {
    font-size: 21px;
  }

  .top-tags span {
    font-size: 8px;
  }

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

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

  .s-one {
    left: -2%;
  }

  .s-two {
    right: -2%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
