.toy-page {
  width: min(100% - 40px, var(--max));
  margin: 0 auto;
}

.toy-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 52px 0 34px;
}

.toy-hero h1 {
  max-width: none;
  margin-bottom: 14px;
  font-size: clamp(3rem, 8vw, 6rem);
}

.back-link {
  margin-bottom: 24px;
  color: var(--mint-dark);
  font-weight: 800;
  border-bottom: 1px solid rgba(14, 114, 95, 0.35);
}

.draw-tool {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(340px, 1.25fr) minmax(240px, 0.7fr);
  gap: 18px;
  align-items: start;
  padding: 18px 0 72px;
}

.tool-panel,
.result-panel {
  padding: 22px;
  border: 1px solid rgba(14, 114, 95, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: 0 14px 36px rgba(29, 42, 38, 0.08);
}

label {
  display: block;
  margin-bottom: 10px;
  color: var(--mint-dark);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid rgba(14, 114, 95, 0.22);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.62);
  color: #10231f;
  font: 1rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

textarea:focus,
.tool-panel button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(82, 189, 168, 0.45);
  outline-offset: 3px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: none;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
  accent-color: var(--mint-dark);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.tool-panel button {
  min-height: 42px;
  border: 1px solid rgba(14, 114, 95, 0.3);
  border-radius: 6px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--mint-dark);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.tool-panel button:hover {
  border-color: var(--mint-dark);
}

.tool-panel button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.result-panel {
  min-height: 480px;
  display: grid;
  justify-items: center;
  text-align: center;
}

.wheel-wrap {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
}

.draw-wheel {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(#49b99f 0 50%, #0a7a61 50% 100%);
  box-shadow: 0 22px 44px rgba(29, 42, 38, 0.16);
  overflow: hidden;
  transition: transform 4.2s cubic-bezier(0.1, 0.72, 0.18, 1);
}

.wheel-label {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 96px;
  margin-left: -48px;
  margin-top: -0.55em;
  color: #10231f;
  font-size: clamp(0.7rem, 1vw, 0.9rem);
  font-weight: 900;
  line-height: 1.05;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
  white-space: nowrap;
  will-change: transform;
}

.wheel-label.light-label {
  color: #d3f0e3;
  text-shadow: 0 1px 0 rgba(16, 35, 31, 0.32);
}

.wheel-pointer {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 0;
  height: 0;
  border-right: 14px solid transparent;
  border-left: 14px solid transparent;
  border-top: 30px solid #10231f;
  transform: translateX(-50%);
  z-index: 3;
}

.wheel-hub {
  position: absolute;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #10231f;
  color: #d3f0e3;
  font-size: 2rem;
  font-weight: 950;
  z-index: 2;
}

#winnerOutput {
  display: block;
  min-height: 44px;
  color: #10231f;
  font-size: clamp(1.7rem, 4vw, 3.6rem);
  font-weight: 900;
  line-height: 1;
  word-break: break-word;
}

.status-text {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--muted);
}

.tool-panel h2 {
  margin-bottom: 16px;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 24px;
  color: #10231f;
  font-weight: 780;
}

li::marker {
  color: var(--mint-dark);
}

@media (max-width: 1080px) {
  .draw-tool {
    grid-template-columns: 1fr;
  }

  .result-panel {
    order: -1;
  }
}

@media (max-width: 560px) {
  .toy-page {
    width: min(100% - 28px, var(--max));
  }

  .toy-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .back-link {
    margin-bottom: 0;
  }
}
