/* Slice It (js/arcade/sliceit.js). Every class starts with .sl- */

.sl-wrap { position: relative; display: grid; gap: 8px; width: min(100%, 680px); margin: 0 auto; padding-bottom: 14px; }

/* ---------- HUD ---------- */
.sl-hud { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 14px; font: 700 14px var(--font-ui); color: var(--muted); }
.sl-hud b { color: var(--ink); font-size: 19px; }
.sl-stars { display: inline-flex; gap: 3px; }
.sl-star {
  --f: 0%; width: 24px; height: 24px;
  clip-path: polygon(50% 2%, 62% 36%, 98% 37%, 69% 59%, 80% 94%, 50% 73%, 20% 94%, 31% 59%, 2% 37%, 38% 36%);
  background: linear-gradient(90deg, var(--sun) var(--f), var(--tile-shadow) var(--f));
}
.sl-star.sl-half { --f: 50%; }
.sl-star.sl-full { --f: 100%; animation: sl-pop 0.45s; }
@keyframes sl-pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.25); } 100% { transform: none; } }

/* ---------- the shape to make ---------- */
.sl-goal { display: grid; justify-items: center; padding: 6px 14px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-soft); text-align: center; }
.sl-q { font: 800 23px/1.25 var(--font-read); color: var(--grape-d); }
.sl-from { font: 400 14px/1.3 var(--font-read); color: var(--muted); }

/* ---------- the solid with its cut, and the cut face flat beside it ---------- */
.sl-main { display: grid; grid-template-columns: 1.55fr 1fr; gap: 8px; }
.sl-stage { position: relative; height: clamp(210px, 34vh, 400px); border-radius: var(--radius); background: color-mix(in srgb, var(--grape) 7%, white); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--grape) 30%, white), var(--shadow-soft); overflow: hidden; }
.sl-right .sl-stage, .sl-right .sl-panel { box-shadow: inset 0 0 0 4px var(--green-d), var(--shadow-soft); }
.sl-gl { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.sl-flatbox { position: absolute; inset: 0; }
.sl-flat { display: block; width: 100%; height: 100%; }
.sl-drag { display: none; position: absolute; left: 10px; bottom: 6px; font: 700 12px var(--font-ui); color: var(--muted); pointer-events: none; }
.sl-turn { position: absolute; right: 6px; bottom: 8px; padding: 4px 12px; touch-action: manipulation; }
.sl-3d .sl-drag { display: block; }
.sl-3d .sl-flatbox, .sl-3d .sl-turn { display: none; }
.sl-glass { fill: color-mix(in srgb, var(--sky) 30%, transparent); stroke: none; }
.sl-back { fill: none; stroke: var(--muted); stroke-width: 3; stroke-dasharray: 9 9; stroke-linecap: round; }
.sl-front { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linejoin: round; stroke-linecap: round; }
.sl-plane { fill: color-mix(in srgb, var(--grape) 14%, transparent); stroke: var(--grape); stroke-width: 2.5; stroke-linejoin: round; }
.sl-cutface { fill: var(--rose); stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; }

.sl-panel { display: grid; grid-template-rows: auto 1fr; align-items: center; justify-items: center; padding: 6px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-soft); min-width: 0; }
.sl-panel > div { width: 100%; }
.sl-cap { font: 700 13px var(--font-ui); color: var(--muted); }
.sl-flatcut { display: block; width: 100%; height: auto; }
.sl-dots { fill: none; stroke: var(--line); stroke-width: 3; stroke-dasharray: 6 8; }

/* ---------- the controls ---------- */
.sl-axes, #sl-tiltrow { display: none; }
.sl-row { display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 8px; padding: 2px 10px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow-soft); }
div.sl-row { display: grid; grid-template-columns: 48px 48px 1fr 48px; }
.sl-many #sl-tiltrow { display: grid; }
.sl-two .sl-axes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sl-name { font: 800 16px var(--font-ui); color: var(--ink); }
.sl-range { width: 100%; height: 44px; margin: 0; accent-color: var(--grape); touch-action: pan-y; cursor: pointer; }
.sl-step { min-width: 44px; min-height: 44px; padding: 0; font-size: 26px; line-height: 1; touch-action: manipulation; }
.sl-axis { touch-action: manipulation; }
.sl-axis.sl-on { background: var(--grape); color: var(--card); box-shadow: 0 5px 0 var(--grape-d); }

.sl-msg { min-height: 44px; margin: 0; display: grid; place-items: center; text-align: center; font: 700 16px/1.35 var(--font-read); color: var(--ink); }
.sl-check { justify-self: center; min-width: 200px; touch-action: manipulation; }

.sl-no { animation: sl-no 0.32s; }
@keyframes sl-no { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

@media (min-width: 700px) {
  .sl-wrap { gap: 12px; }
  .sl-q { font-size: 30px; }
  .sl-from { font-size: 16px; }
  .sl-msg { font-size: 19px; }
  .sl-stage { height: 400px; }
  .sl-cap { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .sl-star.sl-full, .sl-no { animation: none; }
}
