:root {
  --bg: #fffdf4;
  --surface: #ffffff;
  --ink: #5c4033;
  --muted: #8c7365;
  --line: #faebd7;
  --accent: #fff785;
  --accent-hover: #ffee59;
  --accent-disabled: #f7f3cc;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Fredoka', sans-serif;
  background-color: var(--bg);
  background-image: radial-gradient(#f0e68c 1.2px, transparent 1.2px), radial-gradient(#f0e68c 1.2px, #fffdf4 1.2px);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;

  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}


.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(5px);
  border-bottom: 2px dashed #f3e9b5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand span {
  font-family: 'Princess Sofia', cursive;
  font-size: 2.2rem;
  color: #6b4f42;
  letter-spacing: 1px;
}


.logo-icon {
  background-color: #ffe66d;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem; 
  margin-top: -2px;
  box-shadow: 0 3px 8px rgba(255, 230, 109, 0.4);
}


.layout {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 24px;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.stage-wrap {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stage {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1/1;
  background-color: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(92, 64, 51, 0.08);
  border: 4px solid #fff;
  position: relative;
}

#canvas {
  width: 100%;
  height: 100%;
  display: block;
}


.panel {
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 18px;
  border: 2px solid #f9f2d2;
  box-shadow: 0 4px 15px rgba(92, 64, 51, 0.03);
}

.step h2 {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #6b4f42;
}

.step h2 span {
  background: #fce38a;
  color: #5c4033;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}


.range {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

.range input[type="range"] {
  flex: 1;
  accent-color: #f6d155;
}

.row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}


.btn {
  border: none;
  border-radius: 10px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn.primary {
  width: 100%;
  padding: 12px;
  background-color: var(--accent);
  color: #5c4033;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(255, 247, 133, 0.5);
}

.btn.primary:hover:not(:disabled) {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
}

.btn.primary:disabled {
  background-color: var(--accent-disabled);
  color: #bfaea3;
  cursor: not-allowed;
  box-shadow: none;
}

.btn.small {
  padding: 8px;
  background: #fff8dc;
  color: #5c4033;
  font-size: 0.8rem;
  border: 1px solid #f3e9b5;
}

.btn.small.wide {
  flex: 1;
}

.btn.small:hover:not(:disabled) {
  background: #fce38a;
}


.position-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.control-label {
  font-size: 0.8rem;
  color: var(--muted);
  width: 100%;
  text-align: left;
}

.dpad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  max-width: 140px;
}

.dpad-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 4px;
}

.dpad-btn {
  width: 42px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}
.footer {
  text-align: center;
  padding: 20px;
  font-size: 0.85rem;
  color: #8c7365;
  margin-top: auto;
}

.footer span {
  font-weight: 600;
  color: #5c4033;
}
