@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --ink: #262638;
  --muted: #747487;
  --subtle: #a7a7b6;
  --line: #e7e7ef;
  --paper: #ffffff;
  --page: #f4f3f9;
  --accent: #6b50f7;
  --accent-dark: #5038ca;
  --accent-soft: #ece8ff;
  --shadow: 0 18px 55px rgba(45, 38, 85, 0.08);
  color: var(--ink);
  background: var(--page);
  font-family: 'DM Sans', sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% -6%, rgba(133, 109, 255, 0.18), transparent 26rem),
    radial-gradient(circle at 94% 18%, rgba(255, 175, 204, 0.14), transparent 23rem),
    var(--page);
}

button,
input,
output {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  color: inherit;
  background: var(--paper);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

button:hover:not(:disabled) {
  border-color: #c9c3eb;
  background: #faf9ff;
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(107, 80, 247, 0.34);
  outline-offset: 3px;
}

.primary {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
  box-shadow: 0 9px 18px rgba(91, 67, 213, 0.22);
}

.primary:hover:not(:disabled) {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  box-shadow: 0 12px 22px rgba(91, 67, 213, 0.28);
}

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 42px;
  border-bottom: 1px solid rgba(224, 223, 235, 0.86);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -1.5px;
}

.brand > span:last-child span {
  color: var(--accent);
}

.mark {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #866eff, #573de4);
  box-shadow: 0 8px 18px rgba(96, 74, 222, 0.26);
}

.mark svg {
  width: 25px;
  height: 25px;
}

.header-actions,
.studio-chip {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 18px;
}

.studio-chip {
  gap: 8px;
  color: #767587;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.studio-chip i,
.badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c2c2cd;
}

.studio-chip i {
  background: #91d8bf;
  box-shadow: 0 0 0 4px rgba(69, 187, 142, 0.12);
}

.save-button {
  min-height: 42px;
  padding-inline: 17px;
}

.save-button > span {
  margin-right: 4px;
  font-size: 16px;
  line-height: 0;
}

main {
  width: min(100%, 1550px);
  margin: 0 auto;
  padding: 44px 42px 18px;
}

.intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin: 0 0 29px;
}

.intro-copy {
  max-width: 690px;
}

.eyebrow,
.card-eyebrow,
.empty-kicker,
.toolbar-label,
.canvas-label {
  margin: 0;
  color: #858396;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 740px;
  margin: 9px 0 11px;
  color: #2a293b;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(34px, 3.3vw, 53px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.065em;
}

.intro h1 em {
  color: var(--accent);
  font-style: normal;
}

.intro-copy > p:last-child {
  max-width: 590px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.mode-switch {
  display: flex;
  flex: 0 0 auto;
  padding: 5px;
  border: 1px solid #deddea;
  border-radius: 15px;
  background: rgba(235, 234, 243, 0.84);
  box-shadow: inset 0 1px 1px rgba(34, 33, 57, 0.03);
}

.mode-switch button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  border: 0;
  color: #777688;
  background: transparent;
  box-shadow: none;
}

.mode-switch button:hover:not(:disabled) {
  border: 0;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: none;
}

.mode-switch button.active {
  color: var(--accent-dark);
  background: #fff;
  box-shadow: 0 3px 9px rgba(37, 34, 68, 0.09);
}

.mode-switch button span {
  font-size: 16px;
  line-height: 1;
}

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

.studio,
.card {
  border: 1px solid rgba(221, 220, 232, 0.95);
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--shadow);
}

.studio {
  overflow: hidden;
  border-radius: 24px;
}

.toolbar {
  display: flex;
  min-height: 83px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 20px;
  border-bottom: 1px solid #eeedf3;
}

.toolbar-section {
  display: flex;
  align-items: center;
}

.tool-section {
  gap: 12px;
}

.tools {
  display: flex;
  gap: 6px;
}

.tool-button,
.icon-action {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border-radius: 11px;
  color: #767587;
  font-size: 17px;
  line-height: 1;
}

.tool-button.active {
  border-color: #cdc3ff;
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(107, 80, 247, 0.06);
}

.color-section {
  flex: 1;
  justify-content: center;
  gap: 12px;
  padding: 0 18px;
  border-inline: 1px solid #eeedf4;
}

.color-heading {
  display: grid;
  gap: 3px;
}

#colorLabel {
  color: #4f4e60;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch {
  position: relative;
  z-index: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--color);
  box-shadow: 0 0 0 1px rgba(45, 44, 65, 0.14);
}

.swatch::after {
  position: absolute;
  z-index: -1;
  inset: -7px;
  border-radius: 50%;
  background: conic-gradient(var(--color) var(--hold-progress), #deddea 0);
  content: '';
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
}

.swatch:hover:not(:disabled) {
  border-color: #fff;
  background: var(--color);
  transform: scale(1.14);
}

.swatch.selected {
  box-shadow: 0 0 0 2px #5f5d72;
}

.swatch.holding::after {
  opacity: 1;
}

.brush {
  display: grid;
  min-width: 170px;
  grid-template-columns: auto 78px auto;
  align-items: center;
  gap: 9px;
}

.brush input {
  width: 78px;
  accent-color: var(--accent);
}

.brush output {
  min-width: 36px;
  color: #575668;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
}

.surface {
  position: relative;
  min-height: 400px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: #fdfdff;
  background-image:
    linear-gradient(rgba(96, 93, 123, 0.036) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 93, 123, 0.036) 1px, transparent 1px);
  background-size: 28px 28px;
}

.surface-glow {
  position: absolute;
  z-index: 0;
  inset: 0;
  background:
    radial-gradient(circle at 73% 30%, rgba(181, 168, 255, 0.18), transparent 25%),
    radial-gradient(circle at 18% 88%, rgba(255, 203, 222, 0.12), transparent 27%);
  pointer-events: none;
}

#drawing {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.canvas-label {
  position: absolute;
  z-index: 2;
  top: 21px;
  left: 23px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #9795a8;
  pointer-events: none;
}

.canvas-label::before {
  width: 17px;
  height: 1px;
  background: currentColor;
  content: '';
}

.empty {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 42px 24px;
  color: #393849;
  text-align: center;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.82) 0, rgba(255, 255, 255, 0.3) 53%, transparent 73%);
  pointer-events: none;
}

.empty-illustration {
  display: grid;
  width: 87px;
  height: 87px;
  place-items: center;
  margin-bottom: 17px;
  border: 1px solid #dbd4ff;
  border-radius: 28px;
  color: var(--accent);
  background: linear-gradient(145deg, #f6f4ff, #e9e4ff);
  box-shadow: 0 16px 32px rgba(101, 79, 228, 0.13);
  transform: rotate(-5deg);
}

.empty-illustration svg {
  width: 61px;
  height: 61px;
}

.empty-kicker {
  color: #8279b4;
}

.empty h2 {
  margin: 7px 0 6px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(22px, 2.3vw, 30px);
  letter-spacing: -0.05em;
}

.empty > p:not(.empty-kicker) {
  max-width: 330px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.empty .primary {
  min-height: 44px;
  margin-top: 20px;
  pointer-events: auto;
}

.empty .primary span {
  margin-right: 4px;
}

.text-button {
  margin-top: 7px;
  padding-block: 7px;
  border: 0;
  color: #69657e;
  background: transparent;
  box-shadow: none;
  pointer-events: auto;
}

.text-button:hover:not(:disabled) {
  border: 0;
  color: var(--accent);
  background: transparent;
  box-shadow: none;
}

.empty small {
  margin-top: 8px;
  color: #9c9aaa;
  font-size: 11px;
}

.air-palette {
  position: absolute;
  z-index: 5;
  top: 16px;
  left: 50%;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 12px 9px 10px;
  border: 1px solid rgba(211, 206, 235, 0.88);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(47, 40, 84, 0.13);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.air-palette.visible {
  display: flex;
}

.air-palette-note {
  padding-right: 8px;
  border-right: 1px solid #e5e2f0;
  color: #777486;
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.air-palette .swatch {
  width: 27px;
  height: 27px;
}

#cursor {
  position: absolute;
  z-index: 6;
  display: none;
  width: 25px;
  height: 25px;
  border: 3px solid var(--cursor-color, var(--accent));
  border-radius: 50%;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--cursor-color, var(--accent)) 16%, transparent);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

#cursor.visible {
  display: block;
}

#cursor:not(.drawing) {
  border-style: dashed;
}

.bottom-bar {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 18px 11px 21px;
  border-top: 1px solid #eeedf3;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6f6e7e;
  font-size: 12px;
  font-weight: 600;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b6b5c1;
}

.dot.live {
  background: #28b584;
  box-shadow: 0 0 0 4px rgba(40, 181, 132, 0.12);
}

.canvas-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-action {
  width: 34px;
  height: 34px;
  border-color: transparent;
  font-size: 18px;
}

.icon-action:hover:not(:disabled) {
  border-color: #e4e1f3;
  background: #f6f4ff;
}

.action-divider {
  width: 1px;
  height: 22px;
  margin: 0 3px;
  background: #e7e6ee;
}

.clear-button {
  min-height: 34px;
  padding: 7px 11px;
  border-color: #f0dddd;
  color: #b65360;
  background: #fffafa;
}

.clear-button:hover:not(:disabled) {
  border-color: #efc7cc;
  background: #fff4f5;
}

aside {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.card {
  padding: 20px;
  border-radius: 20px;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card h2 {
  margin: 4px 0 0;
  color: #303042;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.card-eyebrow {
  color: #9795a5;
  font-size: 9px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border-radius: 7px;
  color: #858394;
  background: #f2f1f6;
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.035em;
}

.badge.active {
  color: #218260;
  background: #e6f8f0;
}

.badge.active i {
  background: #26ae7e;
}

.badge.neutral {
  color: #7c788b;
  background: #f0eff5;
}

.badge.accent {
  color: #6950df;
  background: #ece8ff;
}

.camera {
  position: relative;
  display: grid;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  place-items: center;
  border-radius: 14px;
  background:
    radial-gradient(circle at 46% 12%, rgba(123, 100, 241, 0.38), transparent 30%),
    linear-gradient(145deg, #27263a, #171724);
}

.camera::after {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 6px);
  content: '';
  pointer-events: none;
}

.camera video {
  position: absolute;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.camera-placeholder {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 4px;
  color: #e6e4f0;
  text-align: center;
}

.camera-placeholder strong {
  font-size: 13px;
}

.camera-placeholder > span:last-child {
  color: #a7a5bc;
  font-size: 11px;
}

.camera-symbol {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  margin-bottom: 5px;
  border: 1px solid rgba(234, 230, 255, 0.27);
  border-radius: 13px;
  color: #e1daff;
  background: rgba(237, 232, 255, 0.09);
  font-size: 24px;
}

.camera-corner {
  position: absolute;
  z-index: 2;
  width: 17px;
  height: 17px;
  border-color: rgba(237, 231, 255, 0.66);
  pointer-events: none;
}

.top-left {
  top: 10px;
  left: 10px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.top-right {
  top: 10px;
  right: 10px;
  border-top: 1px solid;
  border-right: 1px solid;
}

.bottom-left {
  bottom: 10px;
  left: 10px;
  border-bottom: 1px solid;
  border-left: 1px solid;
}

.bottom-right {
  right: 10px;
  bottom: 10px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.camera-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0;
  padding: 9px 10px;
  border-radius: 10px;
  background: #f8f7fc;
}

.camera-note > span {
  color: #8b7ee7;
  line-height: 1;
}

.camera-note p,
.challenge > p,
.gesture p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.wide {
  width: 100%;
  min-height: 42px;
}

#message {
  min-height: 0;
  color: #9b4b60;
  font-size: 12px;
  line-height: 1.5;
}

#message:not(:empty) {
  margin-top: 11px;
  padding: 10px;
  border: 1px solid #f1d8de;
  border-radius: 10px;
  background: #fff8f9;
}

.gestures-card {
  padding-bottom: 10px;
}

.gesture {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 0;
}

.gesture + .gesture {
  border-top: 1px solid #f0eff5;
}

.gesture-key {
  display: grid;
  flex: 0 0 auto;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 9px;
  color: #626073;
  background: #f3f2f7;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
}

.gesture-key.draw {
  color: #5e48d5;
  background: #ece8ff;
}

.gesture-key.move {
  color: #2580c9;
  background: #e7f3ff;
}

.gesture-key.pause {
  color: #a26a2d;
  background: #fff1df;
}

.gesture-key.color {
  color: #c94f76;
  background: #ffe8f0;
}

.gesture strong {
  display: block;
  margin-bottom: 1px;
  color: #4a495a;
  font-size: 13px;
}

.challenge {
  position: relative;
  overflow: hidden;
  border-color: #2d2c47;
  color: #fff;
  background:
    radial-gradient(circle at 104% -2%, rgba(157, 136, 255, 0.53), transparent 45%),
    radial-gradient(circle at -13% 107%, rgba(230, 132, 186, 0.25), transparent 40%),
    #2c2b43;
  box-shadow: 0 18px 34px rgba(44, 43, 67, 0.2);
}

.challenge::before {
  position: absolute;
  top: 12px;
  right: 15px;
  width: 65px;
  height: 65px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  content: '';
}

.challenge h2 {
  color: #fff;
}

.challenge .card-eyebrow {
  color: #c4bfd9;
}

.challenge .badge.accent {
  color: #ddd6ff;
  background: rgba(235, 230, 255, 0.14);
}

.challenge > p {
  position: relative;
  z-index: 1;
  min-height: 37px;
  margin-bottom: 14px;
  color: #cbc9da;
}

#timer {
  position: relative;
  z-index: 1;
  margin: 1px 0 14px;
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 43px;
  font-weight: 700;
  letter-spacing: -0.08em;
  line-height: 1;
}

.challenge-button {
  position: relative;
  z-index: 1;
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.challenge-button:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.18);
}

.challenge-button span {
  margin-left: 4px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 23px 4px 11px;
  color: #9593a3;
  font-size: 11px;
}

.toast {
  position: fixed;
  z-index: 20;
  bottom: 27px;
  left: 50%;
  min-width: 220px;
  padding: 13px 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 13px;
  color: #fff;
  background: rgba(36, 35, 54, 0.95);
  box-shadow: 0 15px 34px rgba(26, 25, 43, 0.25);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(13px);
}

.hidden {
  display: none !important;
}

dialog {
  width: min(390px, calc(100vw - 34px));
  padding: 26px;
  border: 1px solid #e1dfea;
  border-radius: 22px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 28px 80px rgba(30, 27, 59, 0.25);
}

dialog::backdrop {
  background: rgba(37, 34, 60, 0.42);
  backdrop-filter: blur(3px);
}

.dialog-mark {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  margin-bottom: 15px;
  border-radius: 12px;
  color: #b8535f;
  background: #fff1f2;
  font-size: 25px;
  line-height: 1;
}

dialog h2 {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  letter-spacing: -0.05em;
}

dialog p {
  margin: 10px 0 23px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

#studio:fullscreen {
  width: 100%;
  max-width: 1300px;
  margin: auto;
  border-radius: 0;
}

#studio:fullscreen .surface {
  min-height: min(78vh, 850px);
}

@media (max-width: 1240px) {
  main {
    padding-inline: 26px;
  }

  .site-header {
    padding-inline: 27px;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr) 304px;
    gap: 18px;
  }

  .toolbar {
    gap: 12px;
    padding-inline: 15px;
  }

  .color-section {
    padding-inline: 12px;
  }

  .brush {
    min-width: 154px;
    grid-template-columns: auto 62px auto;
  }

  .brush input {
    width: 62px;
  }
}

@media (max-width: 1020px) {
  .intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  aside {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }

  .challenge {
    grid-column: 1 / -1;
  }

  .surface {
    min-height: 0;
  }
}

@media (max-width: 700px) {
  .site-header {
    min-height: 70px;
    padding: 0 16px;
  }

  .brand {
    gap: 8px;
    font-size: 23px;
  }

  .mark {
    width: 35px;
    height: 35px;
    border-radius: 11px;
  }

  .studio-chip {
    display: none;
  }

  .header-actions {
    gap: 0;
  }

  .save-button {
    min-height: 38px;
    padding-inline: 11px;
  }

  main {
    padding: 28px 14px 12px;
  }

  .intro {
    gap: 19px;
    margin-bottom: 21px;
  }

  .intro h1 {
    font-size: clamp(32px, 10vw, 42px);
  }

  .intro-copy > p:last-child {
    font-size: 14px;
  }

  .mode-switch {
    width: 100%;
  }

  .mode-switch button {
    flex: 1;
    justify-content: center;
    padding-inline: 8px;
    font-size: 12px;
  }

  .studio {
    border-radius: 19px;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: end;
    gap: 14px 11px;
    padding: 15px;
  }

  .tool-section {
    align-items: flex-end;
  }

  .color-section {
    grid-column: 1 / -1;
    justify-content: space-between;
    padding: 0;
    border: 0;
  }

  .brush {
    min-width: 0;
    grid-template-columns: auto minmax(44px, 1fr) auto;
  }

  .brush input {
    width: 100%;
  }

  .surface {
    aspect-ratio: 1 / 1.05;
  }

  .empty {
    padding: 30px 16px;
  }

  .empty-illustration {
    width: 68px;
    height: 68px;
    margin-bottom: 11px;
    border-radius: 22px;
  }

  .empty-illustration svg {
    width: 49px;
    height: 49px;
  }

  .empty h2 {
    font-size: 23px;
  }

  .empty .primary {
    margin-top: 15px;
  }

  .empty small {
    display: none;
  }

  .air-palette {
    gap: 7px;
    max-width: calc(100% - 20px);
    padding: 8px;
  }

  .air-palette-note {
    display: none;
  }

  .air-palette .swatch {
    width: 24px;
    height: 24px;
  }

  .canvas-label {
    top: 14px;
    left: 15px;
    font-size: 9px;
  }

  .bottom-bar {
    min-height: 58px;
    padding: 10px 12px 10px 15px;
  }

  .status {
    max-width: 48%;
    font-size: 11px;
    line-height: 1.3;
  }

  .clear-button {
    padding-inline: 8px;
    font-size: 12px;
  }

  aside {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .challenge {
    grid-column: auto;
  }

  .card {
    padding: 17px;
    border-radius: 18px;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    padding: 19px 4px 5px;
  }
}

@media (max-width: 385px) {
  .save-button {
    width: 39px;
    padding: 0;
    font-size: 0;
  }

  .save-button > span {
    margin: 0;
    font-size: 18px;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .tool-section {
    align-items: center;
    justify-content: space-between;
  }

  .brush {
    grid-row: 3;
  }

  .palette {
    gap: 6px;
  }

  .swatch {
    width: 22px;
    height: 22px;
  }

  .icon-action {
    width: 30px;
  }

  .action-divider {
    margin-inline: 0;
  }
}
