:root {
  color-scheme: light;
  --ds-bg: #e6dcc6;
  --ds-panel: rgba(248, 244, 233, 0.88);
  --ds-panel-edge: rgba(89, 67, 40, 0.2);
  --ds-ink: #2d2015;
  --ds-muted: #6f6254;
  --ds-accent: #bb5a2d;
  --ds-accent-strong: #8d3917;
  --ds-grid-a: #f4e8cf;
  --ds-grid-b: #e6d7b7;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  margin: 0;
  min-height: 100%;
  width: 100%;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.55), transparent 28%),
    linear-gradient(135deg, #efe4cc 0%, var(--ds-bg) 52%, #d4c5a9 100%);
  color: var(--ds-ink);
  font-family: Georgia, 'Times New Roman', serif;
}

button,
input {
  font: inherit;
}

.doodlestudio-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 150px 1fr;
}

.doodlestudio-sidebar {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: linear-gradient(180deg, rgba(109, 86, 54, 0.14), rgba(109, 86, 54, 0.04));
  border-right: 1px solid rgba(72, 48, 25, 0.15);
  backdrop-filter: blur(5px);
}

.doodlestudio-brand h1,
.doodlestudio-stage-header h2,
.doodlestudio-section h2 {
  margin: 0;
}

.doodlestudio-brand p,
.doodlestudio-stage-header p {
  margin: 4px 0 0;
  color: var(--ds-muted);
  line-height: 1.4;
}

.doodlestudio-section {
  display: grid;
  gap: 5px;
  padding: 7px;
  border: 1px solid var(--ds-panel-edge);
  border-radius: 9px;
  background: var(--ds-panel);
  box-shadow: 0 7px 14px rgba(62, 43, 23, 0.08);
}

.doodlestudio-tool {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 6px 7px;
  border-radius: 7px;
  border: 1px solid rgba(96, 68, 41, 0.18);
  background: white;
  color: inherit;
  cursor: pointer;
}

.doodlestudio-tool span {
  color: var(--ds-muted);
  font-size: 0.46rem;
}

.doodlestudio-tool.is-active {
  background: linear-gradient(180deg, #db7344 0%, var(--ds-accent) 100%);
  color: white;
  border-color: var(--ds-accent-strong);
}

.doodlestudio-tool.is-active span {
  color: rgba(255, 255, 255, 0.82);
}

.doodlestudio-control {
  display: grid;
  gap: 4px;
}

.doodlestudio-control span {
  color: var(--ds-muted);
}

.doodlestudio-control input[type='range'] {
  width: 100%;
}

.doodlestudio-preview {
  width: 100%;
  image-rendering: pixelated;
  border-radius: 6px;
  border: 1px solid rgba(73, 53, 33, 0.18);
  background:
    linear-gradient(45deg, var(--ds-grid-a) 25%, transparent 25%, transparent 75%, var(--ds-grid-a) 75%),
    linear-gradient(45deg, var(--ds-grid-a) 25%, transparent 25%, transparent 75%, var(--ds-grid-a) 75%),
    var(--ds-grid-b);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
}

.doodlestudio-stage {
  display: grid;
  grid-template-rows: 1fr;
  gap: 0;
  padding: 14px;
  min-height: 0;
}

.doodlestudio-status {
  margin: 0;
  color: var(--ds-muted);
}

.doodlestudio-canvas-wrap {
  display: grid;
  place-items: center;
  min-height: 100%;
  border-radius: 14px;
  border: 1px solid rgba(61, 43, 22, 0.12);
  background:
    linear-gradient(45deg, var(--ds-grid-a) 25%, transparent 25%, transparent 75%, var(--ds-grid-a) 75%),
    linear-gradient(45deg, var(--ds-grid-a) 25%, transparent 25%, transparent 75%, var(--ds-grid-a) 75%),
    var(--ds-grid-b);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.doodlestudio-canvas {
  width: min(100%, calc(100vh - 28px));
  height: min(100%, calc(100vh - 28px));
  aspect-ratio: 1;
  image-rendering: pixelated;
  background: transparent;
  border-radius: 9px;
  box-shadow: 0 12px 20px rgba(47, 33, 17, 0.18);
  touch-action: none;
}

@media (max-width: 300px) {
  .doodlestudio-shell {
    grid-template-columns: 1fr;
  }

  .doodlestudio-sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(72, 48, 25, 0.15);
  }

  .doodlestudio-canvas {
    width: min(100%, calc(100vh - 28px));
    height: min(100%, calc(100vh - 28px));
  }
}
