:root {
  color-scheme: dark;
  font-family:
    Inter, ui-rounded, "SF Pro Rounded", "SF Pro Display", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #050507;
  color: #f7f5f2;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overscroll-behavior: none;
}

body {
  min-height: 100svh;
  background:
    radial-gradient(circle at 50% -20%, rgba(108, 84, 255, 0.13), transparent 42%),
    #050507;
}

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

.app {
  width: min(100%, 72rem);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(0.9rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(0.8rem, 2vw, 1.25rem);
}

.app__header {
  position: relative;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: inherit;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 720;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.brand__spark {
  display: grid;
  width: 1.85rem;
  height: 1.85rem;
  place-items: center;
  border-radius: 0.65rem;
  background: linear-gradient(135deg, #ff4cb7, #ffbd3f 43%, #49e5b9 70%, #6a79ff);
  color: #08080a;
  font-size: 0.9rem;
  box-shadow: 0 0.4rem 1.3rem rgba(178, 85, 255, 0.2);
}

.controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-0.25rem);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.controls--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.tool-button {
  position: relative;
  min-height: 2.55rem;
  padding: 0.6rem 0.95rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.88);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 620;
  cursor: pointer;
  backdrop-filter: blur(16px);
  transition: background-color 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.tool-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.tool-button:active:not(:disabled) {
  transform: scale(0.96);
}

.tool-button:focus-visible {
  outline: 2px solid #71e8c5;
  outline-offset: 3px;
}

.tool-button:disabled {
  opacity: 0.34;
  pointer-events: none;
}

.tool-button--icon {
  display: grid;
  width: 2.55rem;
  padding: 0;
  place-items: center;
}

.tool-button--icon svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.tool-button--replay {
  display: flex;
  min-width: 5.7rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.12);
}

.tool-button--replay::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, #ff61b7, #ffe359, #4be2c5, #7c76ff);
  content: "";
  transform: scaleX(var(--replay-progress, 0));
  transform-origin: left;
  transition: transform 50ms linear;
}

.replay-icon {
  width: 0;
  height: 0;
  border-top: 0.28rem solid transparent;
  border-bottom: 0.28rem solid transparent;
  border-left: 0.42rem solid currentColor;
  transition: all 160ms ease;
}

.tool-button--replay.is-playing .replay-icon {
  width: 0.52rem;
  height: 0.52rem;
  border: 0;
  border-radius: 0.08rem;
  background: currentColor;
}

.canvas-stage {
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
}

.canvas-frame {
  position: relative;
  width: auto;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  border: 0;
  border-radius: clamp(1.5rem, 4vw, 2.75rem);
  aspect-ratio: var(--canvas-aspect-ratio);
  background: #111116;
  box-shadow:
    0 1.5rem 5rem rgba(0, 0, 0, 0.44),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px rgba(255, 255, 255, 0.04);
  isolation: isolate;
}

.canvas-frame,
.canvas-frame * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.art-layer {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.art-layer--interactive {
  -webkit-user-drag: none;
  cursor: crosshair;
  touch-action: none;
}

.art-layer--interactive.is-replaying {
  cursor: wait;
  pointer-events: none;
}

.art-layer--interactive.is-busy {
  cursor: progress;
  pointer-events: none;
}

.prompt {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.58);
  font-size: clamp(0.82rem, 2vw, 0.92rem);
  font-weight: 570;
  letter-spacing: 0.01em;
  pointer-events: none;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(12px);
  transition:
    opacity 320ms ease,
    transform 320ms ease;
}

.prompt--hidden {
  opacity: 0;
  transform: translate(-50%, -45%) scale(0.96);
}

.prompt__gesture {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: #faf8f4;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35);
  animation: gesture 2s ease-out infinite;
}

.tool-picker-button {
  position: relative;
  grid-area: tool;
  justify-self: start;
  display: grid;
  min-width: 9.25rem;
  min-height: 3rem;
  padding: 0.38rem 0.58rem 0.38rem 0.42rem;
  grid-template-columns: 2rem minmax(0, 1fr) 0.85rem;
  align-items: center;
  gap: 0.48rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 1rem;
  background: rgba(15, 15, 21, 0.84);
  color: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0.65rem 1.8rem rgba(0, 0, 0, 0.34);
  font: inherit;
  text-align: left;
  cursor: pointer;
  backdrop-filter: blur(16px);
  transition: border-color 180ms ease, background-color 180ms ease, opacity 180ms ease,
    transform 180ms ease;
}

.tool-picker-button:hover:not(:disabled) {
  border-color: rgba(113, 232, 197, 0.4);
  background: rgba(25, 25, 33, 0.92);
}

.tool-picker-button:active:not(:disabled) {
  transform: scale(0.97);
}

.tool-picker-button:focus-visible {
  outline: 2px solid #71e8c5;
  outline-offset: 3px;
}

.tool-picker-button:disabled {
  opacity: 0.42;
  pointer-events: none;
}

.tool-picker-button__copy {
  display: grid;
  gap: 0.08rem;
  line-height: 1.05;
}

.tool-picker-button__copy small {
  display: block;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.58rem;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tool-picker-button__copy strong {
  overflow: hidden;
  font-size: 0.72rem;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-picker-button__icon {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.7rem;
  background: linear-gradient(140deg, rgba(255, 87, 177, 0.18), rgba(75, 226, 197, 0.14));
}

.tool-picker-button__icon svg,
.tool-picker-button > svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-picker-button__icon svg {
  width: 1.14rem;
  height: 1.14rem;
  stroke-width: 1.7;
}

.tool-picker-button > svg {
  display: block;
  width: 0.85rem;
  height: 0.85rem;
  color: rgba(255, 255, 255, 0.46);
  stroke-width: 2;
}

.app__footer {
  position: relative;
  display: grid;
  min-height: 2.75rem;
  grid-template-areas:
    "tool tagline action"
    "guidance guidance guidance";
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: 2.75rem auto;
  align-items: center;
  column-gap: 0.5rem;
  row-gap: 0;
  margin: 0;
}

.footer-tagline {
  grid-area: tagline;
  justify-self: center;
  margin: 0;
  color: rgba(255, 255, 255, 0.34);
  font-size: 0.75rem;
  font-weight: 540;
  letter-spacing: 0.055em;
  text-align: center;
  text-transform: uppercase;
  transition: opacity 200ms ease, transform 200ms ease;
}

.share-button {
  --share-progress: 0;
  position: relative;
  grid-area: action;
  justify-self: end;
  display: flex;
  min-width: 7rem;
  min-height: 2.75rem;
  padding: 0.62rem 1.1rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(255, 87, 177, 0.16), rgba(75, 226, 197, 0.14));
  color: rgba(255, 255, 255, 0.95);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 680;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.3rem) scale(0.96);
  transition: opacity 200ms ease, transform 200ms ease, border-color 200ms ease;
}

.share-guidance {
  grid-area: guidance;
  height: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.7rem;
  font-weight: 560;
  letter-spacing: 0.015em;
  line-height: 1rem;
  opacity: 0;
  text-align: center;
  transform: translateY(-0.2rem);
  transition: opacity 180ms ease, transform 180ms ease;
}

.share-guidance.is-visible {
  height: auto;
  min-height: 1rem;
  margin-top: 0.2rem;
  overflow: visible;
  opacity: 1;
  transform: translateY(0);
}

.share-button::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, #ff61b7, #ffe359, #4be2c5, #7c76ff);
  content: "";
  transform: scaleX(var(--share-progress));
  transform-origin: left;
}

.share-button svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.app__footer--shareable .footer-tagline {
  opacity: 0;
  transform: translateY(-0.25rem);
}

.app__footer--shareable .share-button {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.share-button.is-ready {
  border-color: rgba(91, 232, 199, 0.55);
  background: linear-gradient(120deg, rgba(55, 206, 173, 0.28), rgba(103, 119, 255, 0.22));
  box-shadow: 0 0 1.4rem rgba(76, 224, 194, 0.14);
}

.share-button.is-preparing:disabled {
  cursor: progress;
  opacity: 1;
}

.app__footer--shareable .share-button:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.share-button.is-preparing:disabled {
  opacity: 1;
}

.share-button:active:not(:disabled) {
  transform: scale(0.96);
}

.share-button:focus-visible {
  outline: 2px solid #71e8c5;
  outline-offset: 3px;
}

.share-dialog {
  width: min(calc(100% - 2rem), 31rem);
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1.75rem;
  background:
    radial-gradient(circle at 20% -10%, rgba(255, 77, 182, 0.17), transparent 38%),
    radial-gradient(circle at 90% 10%, rgba(74, 225, 195, 0.14), transparent 34%),
    #121217;
  color: #f7f5f2;
  box-shadow: 0 2rem 6rem rgba(0, 0, 0, 0.62);
}

.share-dialog[open] {
  animation: share-dialog-in 220ms ease-out;
}

.share-dialog::backdrop {
  background: rgba(2, 2, 4, 0.72);
  backdrop-filter: blur(8px);
}

.share-dialog__handle {
  display: none;
  width: 2.8rem;
  height: 0.28rem;
  border-radius: 999px;
  margin: -0.15rem auto 1rem;
  background: rgba(255, 255, 255, 0.22);
}

.share-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.15rem 0.15rem 1.1rem;
}

.share-dialog__eyebrow {
  margin: 0 0 0.35rem;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.68rem;
  font-weight: 720;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.share-dialog h2 {
  margin: 0;
  font-size: clamp(1.25rem, 5vw, 1.55rem);
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.share-dialog__close {
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  flex: 0 0 auto;
  place-items: center;
  padding: 0 0 0.15rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 1.4rem;
  cursor: pointer;
}

.export-options {
  display: grid;
  gap: 0.65rem;
}

.export-option {
  display: grid;
  min-height: 4.6rem;
  padding: 0.75rem;
  grid-template-columns: 3.25rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.055);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.export-option:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.09);
}

.export-option:active {
  transform: scale(0.985);
}

.export-option:focus-visible,
.share-dialog__close:focus-visible {
  outline: 2px solid #71e8c5;
  outline-offset: 3px;
}

.export-option--featured {
  border-color: rgba(93, 232, 200, 0.3);
  background: linear-gradient(120deg, rgba(255, 80, 178, 0.13), rgba(74, 225, 195, 0.12));
}

.export-option__badge {
  display: grid;
  width: 3.25rem;
  height: 3.25rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 0.9rem;
  background: rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.7rem;
  font-weight: 760;
  letter-spacing: 0.02em;
}

.export-option--featured .export-option__badge {
  background: linear-gradient(145deg, rgba(255, 82, 181, 0.7), rgba(91, 111, 255, 0.58));
  color: white;
}

.export-option__copy {
  display: grid;
  min-width: 0;
  gap: 0.22rem;
}

.export-option__copy strong {
  font-size: 0.93rem;
  letter-spacing: -0.01em;
}

.export-option__copy small {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.export-option__tag {
  padding: 0.35rem 0.5rem;
  border-radius: 999px;
  background: rgba(83, 226, 194, 0.12);
  color: #83ead1;
  font-size: 0.62rem;
  font-weight: 720;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tool-dialog {
  width: min(calc(100% - 2rem), 34rem);
  max-height: min(calc(100dvh - 1rem), 46rem);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1.75rem;
  background:
    radial-gradient(circle at 16% -10%, rgba(255, 77, 182, 0.16), transparent 37%),
    radial-gradient(circle at 92% 0%, rgba(74, 225, 195, 0.14), transparent 35%),
    #121217;
  color: #f7f5f2;
  box-shadow: 0 2rem 6rem rgba(0, 0, 0, 0.62);
}

.tool-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: share-dialog-in 220ms ease-out;
}

.tool-dialog::backdrop {
  background: rgba(2, 2, 4, 0.72);
  backdrop-filter: blur(8px);
}

.tool-dialog__handle {
  display: none;
  width: 2.8rem;
  height: 0.28rem;
  border-radius: 999px;
  margin: 0.7rem auto 0;
  background: rgba(255, 255, 255, 0.22);
}

.tool-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem 0.75rem;
}

.tool-dialog h2 {
  margin: 0;
  font-size: clamp(1.25rem, 5vw, 1.55rem);
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.tool-dialog__close {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  place-items: center;
  padding: 0 0 0.15rem;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.38);
  font: inherit;
  font-size: 1.15rem;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.tool-dialog__close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.82);
}

.tool-dialog__body {
  min-height: 0;
  padding: 0 1.15rem 1rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
  -webkit-overflow-scrolling: touch;
}

.tool-section {
  padding: 0;
  border: 0;
  margin: 0;
}

.tool-section + .tool-section {
  margin-top: 1rem;
}

.tool-section legend,
.tool-section__heading h3 {
  padding: 0;
  margin: 0 0 0.65rem;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.67rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tool-choice-grid {
  display: grid;
  gap: 0.55rem;
}

.tool-section--styles .tool-choice-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tool-section--tips .tool-choice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tool-choice {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.tool-choice[hidden] {
  display: none;
}

.tool-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.tool-choice__surface {
  position: relative;
  display: grid;
  min-height: 5.1rem;
  padding: 0.58rem 0.35rem 0.52rem;
  grid-template-rows: minmax(2.15rem, auto) auto;
  align-items: center;
  justify-items: center;
  gap: 0.38rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.68);
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease,
    transform 160ms ease;
}

.tool-choice__surface::after {
  position: absolute;
  top: 0.38rem;
  right: 0.38rem;
  display: grid;
  width: 1rem;
  height: 1rem;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #c779ff, #58d8c4);
  color: #09090c;
  content: "";
  opacity: 0;
  transform: scale(0.75);
  transition: opacity 140ms ease, transform 140ms ease;
}

.tool-choice input:checked + .tool-choice__surface {
  border-color: transparent;
  background:
    linear-gradient(140deg, rgba(33, 30, 41, 0.98), rgba(24, 30, 35, 0.98)) padding-box,
    linear-gradient(135deg, #d078ff, #68c5ff 58%, #55e1c0) border-box;
  color: #fff;
  box-shadow: 0 0.55rem 1.4rem rgba(0, 0, 0, 0.2);
}

.tool-choice input:checked + .tool-choice__surface::after {
  opacity: 1;
  transform: scale(1);
}

.tool-choice input:disabled + .tool-choice__surface {
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.025);
  color: rgba(255, 255, 255, 0.33);
  cursor: not-allowed;
  filter: saturate(0.35);
  opacity: 0.68;
}

.tool-choice input:disabled + .tool-choice__surface::after {
  display: none;
}

.tool-choice input:focus-visible + .tool-choice__surface,
.tool-dialog__close:focus-visible,
.tool-dialog__done:focus-visible,
.tool-size input:focus-visible {
  outline: 2px solid #71e8c5;
  outline-offset: 3px;
}

.tool-choice:active .tool-choice__surface {
  transform: scale(0.98);
}

.tool-choice__surface strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.7rem;
  font-weight: 660;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-choice__badge {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  padding: 0.16rem 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.46);
  font-size: 0.48rem;
  font-weight: 760;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
}

.brush-sample,
.tip-sample {
  position: relative;
  display: block;
  width: 100%;
  height: 2.2rem;
  overflow: hidden;
}

.brush-sample::before,
.brush-sample::after,
.tip-sample::before,
.tip-sample::after {
  position: absolute;
  content: "";
}

.brush-sample--standard::before,
.brush-sample--neon::before,
.brush-sample--sparkle::before,
.brush-sample--marker::before {
  top: 50%;
  left: 8%;
  width: 84%;
  height: 0.48rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff8a7a, #e984ff 44%, #74d8ff);
  transform: translateY(-50%) rotate(-7deg);
}

.brush-sample--neon::before {
  height: 0.26rem;
  background: #fb73ff;
  box-shadow: 0 0 0.25rem #ff57ef, 0 0 0.58rem rgba(154, 100, 255, 0.95),
    0 0 0.9rem rgba(91, 217, 255, 0.5);
}

.brush-sample--sparkle::before {
  height: 0.34rem;
  opacity: 0.88;
}

.brush-sample--sparkle::after {
  inset: 0;
  color: #ffd7fb;
  content: "✦  ·   ✧  ·";
  font-size: 0.7rem;
  letter-spacing: 0.2rem;
  line-height: 2.15rem;
  text-align: center;
  text-shadow: 0 0 0.4rem rgba(255, 125, 237, 0.9);
  transform: rotate(-7deg);
}

.brush-sample--marker::before {
  height: 0.72rem;
  border-radius: 0.2rem;
  opacity: 0.82;
  transform: translateY(-50%) rotate(-7deg) skewX(-10deg);
}

.tip-sample--round::before,
.tip-sample--fine::before,
.tip-sample--chisel::before {
  top: 50%;
  left: 12%;
  width: 76%;
  border-radius: 999px;
  background: linear-gradient(90deg, #9a9cff, #cf83ff 58%, #8bd6ff);
  transform: translateY(-50%) rotate(-10deg);
}

.tip-sample--round::before {
  height: 0.62rem;
}

.tip-sample--fine::before {
  height: 0.2rem;
}

.tip-sample--chisel::before {
  height: 0.7rem;
  border-radius: 0.08rem;
  transform: translateY(-50%) rotate(-14deg) skewX(-8deg);
}

.tip-sample--dotted::before {
  inset: 0.5rem 6%;
  background: radial-gradient(circle, #a89aff 0 0.19rem, transparent 0.21rem) 0 50% / 1rem 1rem
    repeat-x;
  transform: rotate(-10deg);
}

.tool-section__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.tool-section__heading h3 {
  margin-bottom: 0;
}

.tool-section__heading .tool-size__value,
.tool-section__heading p {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.68rem;
  font-weight: 640;
  font-variant-numeric: tabular-nums;
}

.tool-size {
  display: grid;
  gap: 0.5rem;
  padding-top: 0.1rem;
}

.tool-size__control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.2rem;
  align-items: center;
  gap: 0.8rem;
}

.tool-size input {
  appearance: none;
  width: 100%;
  min-height: 2.75rem;
  margin: 0;
  background: transparent;
  cursor: pointer;
  touch-action: pan-x;
}

.tool-size input::-webkit-slider-runnable-track {
  height: 0.4rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #c96fff, #6dbbff 62%, #66e0c3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.tool-size input::-webkit-slider-thumb {
  appearance: none;
  width: 1.45rem;
  height: 1.45rem;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  margin-top: -0.52rem;
  background: #f9f8f7;
  box-shadow: 0 0.25rem 0.7rem rgba(0, 0, 0, 0.45);
}

.tool-size input::-moz-range-track {
  height: 0.4rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #c96fff, #6dbbff 62%, #66e0c3);
}

.tool-size input::-moz-range-thumb {
  width: 1.35rem;
  height: 1.35rem;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  background: #f9f8f7;
}

.tool-size__sample {
  display: grid;
  min-height: 2.75rem;
  place-items: center;
}

.tool-size__sample span {
  width: 3.9rem;
  height: min(1.2rem, calc(0.12rem + var(--tool-size-scale, 1) * 0.45rem));
  border-radius: 999px;
  background: linear-gradient(90deg, #d173ff, #79c9ff, #65e1c1);
  box-shadow: 0 0.2rem 0.8rem rgba(111, 145, 255, 0.22);
  transition: height 100ms ease;
}

.stroke-preview {
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stroke-preview__stage {
  position: relative;
  height: 6.25rem;
  margin-top: 0.65rem;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 1rem;
  background:
    radial-gradient(circle at 16% 30%, #ff8c80 0, transparent 34%) padding-box,
    radial-gradient(circle at 52% 62%, #d177ff 0, transparent 42%) padding-box,
    radial-gradient(circle at 88% 35%, #65d9ff 0, transparent 38%) padding-box,
    linear-gradient(#786dff, #786dff) padding-box,
    linear-gradient(125deg, #ef89ff, #72caff 58%, #6ee3c5) border-box;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
}

.stroke-preview__stage canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.tool-dialog__footer {
  flex: 0 0 auto;
  padding: 0.8rem 1.15rem max(0.9rem, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(18, 18, 23, 0.92);
  box-shadow: 0 -0.8rem 2rem rgba(5, 5, 7, 0.24);
  backdrop-filter: blur(18px);
}

.tool-dialog__done {
  width: 100%;
  min-height: 3.2rem;
  border: 1px solid rgba(113, 232, 197, 0.4);
  border-radius: 999px;
  background: linear-gradient(115deg, rgba(185, 75, 202, 0.72), rgba(76, 149, 198, 0.75), rgba(44, 168, 139, 0.76));
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 740;
  box-shadow: 0 0.65rem 1.8rem rgba(36, 109, 111, 0.15);
  cursor: pointer;
}

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

.orientation-guard {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  min-height: 100svh;
  padding:
    max(1.5rem, env(safe-area-inset-top))
    max(2rem, env(safe-area-inset-right))
    max(1.5rem, env(safe-area-inset-bottom))
    max(2rem, env(safe-area-inset-left));
  place-items: center;
  background:
    radial-gradient(circle at 25% 0%, rgba(255, 76, 183, 0.18), transparent 38%),
    radial-gradient(circle at 80% 100%, rgba(73, 229, 185, 0.16), transparent 42%),
    #050507;
  text-align: center;
}

.orientation-guard[hidden] {
  display: none;
}

.orientation-guard:focus {
  outline: none;
}

.orientation-guard__card {
  width: min(100%, 26rem);
}

.orientation-guard__phone {
  position: relative;
  display: grid;
  width: 3.15rem;
  height: 5.2rem;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 0.85rem;
  margin: 0 auto 1.15rem;
  box-shadow: 0 0 2.2rem rgba(126, 111, 255, 0.3);
  animation: turn-upright 900ms cubic-bezier(0.22, 0.84, 0.3, 1) 140ms both;
}

.orientation-guard__phone::before {
  position: absolute;
  top: 0.36rem;
  width: 1.05rem;
  height: 0.14rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  content: "";
}

.orientation-guard__phone span {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff4cb7, #ffd34a 42%, #49e5b9 72%, #6a79ff);
  box-shadow: 0 0 1.25rem rgba(255, 105, 191, 0.3);
}

.orientation-guard__eyebrow {
  margin: 0 0 0.45rem;
  color: #83ead1;
  font-size: 0.68rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.orientation-guard h2 {
  margin: 0;
  font-size: clamp(1.55rem, 7vw, 2.15rem);
  letter-spacing: -0.045em;
}

.orientation-guard__card > p:last-child {
  max-width: 24rem;
  margin: 0.65rem auto 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.92rem;
  line-height: 1.45;
}

body.is-orientation-blocked {
  overflow: hidden;
}

body.is-orientation-blocked .app {
  visibility: hidden;
}

@keyframes gesture {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3);
  }
  65%,
  100% {
    box-shadow: 0 0 0 0.6rem rgba(255, 255, 255, 0);
  }
}

@keyframes share-dialog-in {
  from {
    opacity: 0;
    transform: translateY(0.65rem) scale(0.98);
  }
}

@keyframes turn-upright {
  from {
    opacity: 0.74;
    transform: rotate(-90deg) scale(0.92);
  }

  to {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}

@media (max-width: 42rem) {
  .app {
    height: 100dvh;
    padding-top: max(0.75rem, env(safe-area-inset-top));
    padding-left: max(1.5rem, calc(env(safe-area-inset-left) + 0.75rem));
    padding-right: max(1.5rem, calc(env(safe-area-inset-right) + 0.75rem));
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    gap: 0.5rem;
  }

  .footer-tagline {
    display: none;
  }

  .app__header {
    gap: 0.6rem;
  }

  .controls {
    gap: 0.3rem;
  }

  .tool-button--replay {
    min-width: 5.25rem;
    padding-inline: 0.75rem;
  }

  .share-dialog,
  .tool-dialog {
    width: 100%;
    max-width: none;
    inset: auto 0 0;
    border-width: 1px 0 0;
    border-radius: 1.75rem 1.75rem 0 0;
    margin: 0;
  }

  .share-dialog {
    padding: 1rem max(1rem, env(safe-area-inset-right))
      max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  }

  .tool-dialog {
    max-height: min(calc(100dvh - 0.5rem), 46rem);
    padding: 0;
  }

  .tool-dialog__header,
  .tool-dialog__body,
  .tool-dialog__footer {
    padding-right: max(0.9rem, env(safe-area-inset-right));
    padding-left: max(0.9rem, env(safe-area-inset-left));
  }

  .share-dialog__handle,
  .tool-dialog__handle {
    display: block;
  }
}

@media (max-height: 34rem) {
  .app {
    padding-top: max(0.65rem, env(safe-area-inset-top));
    padding-bottom: max(0.55rem, env(safe-area-inset-bottom));
    gap: 0.55rem;
  }

  .canvas-frame {
    border-radius: 1.4rem;
  }

  .footer-tagline {
    font-size: 0.65rem;
  }

  .tool-dialog__header {
    padding-top: 0.6rem;
    padding-bottom: 0.5rem;
  }

  .tool-dialog__body {
    padding-bottom: 0.75rem;
  }

  .tool-section + .tool-section {
    margin-top: 0.8rem;
  }

  .stroke-preview__stage {
    height: 5.25rem;
  }

  .tool-dialog__footer {
    padding-top: 0.6rem;
    padding-bottom: max(0.65rem, env(safe-area-inset-bottom));
  }
}

@media (max-width: 22rem) {
  .brand > span:last-child {
    display: none;
  }

  .app__header {
    min-width: 0;
  }

  .controls {
    margin-left: auto;
  }

  .tool-picker-button {
    min-width: 9rem;
  }

  .tool-button--replay {
    min-width: 4.7rem;
    padding-inline: 0.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .prompt__gesture,
  .orientation-guard__phone {
    animation: none;
  }

  .controls,
  .prompt,
  .tool-button,
  .share-button,
  .share-dialog,
  .tool-picker-button,
  .tool-dialog,
  .tool-choice__surface,
  .tool-size__sample span,
  .export-option,
  .footer-tagline,
  .replay-icon {
    transition-duration: 0.01ms;
  }
}
