/* Cube Folding — net reference, pick the matching assembled cube */

.cube-folding-game .cf-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.15fr);
  gap: 20px;
  align-items: stretch;
}

@media (max-width: 900px) {
  .cube-folding-game .cf-layout {
    grid-template-columns: 1fr;
  }
}

.cube-folding-game .cf-reference,
.cube-folding-game .cf-answers-panel {
  padding: 20px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  min-width: 0;
}

.cube-folding-game .cf-eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
}

.cube-folding-game .cf-reference h3,
.cube-folding-game .cf-answers-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  color: #111827;
}

.cube-folding-game .cf-lead {
  margin: 0 0 16px;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
}

.cube-folding-game .cf-answers-title {
  margin-bottom: 14px;
}

.cube-folding-game .cf-net-stage {
  background: var(--net-stage-bg, #fff);
  border: 1px dashed var(--net-stage-border, #9ca3af);
  border-radius: 12px;
  padding: 28px 20px;
  margin-bottom: 12px;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cube-folding-game .cf-reference-net.cube-net {
  grid-template-columns: repeat(4, 48px);
  grid-template-rows: repeat(3, 48px);
}

.cube-folding-game .cf-reference-net.cube-net .cell,
.cube-folding-game .cf-reference-net.cube-net .empty {
  width: 48px;
  height: 48px;
}

.cube-folding-game .cf-reference-net.cube-net .cell {
  font-size: 1.5rem;
}

.cube-folding-game .cf-hint {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
  font-weight: 600;
  line-height: 1.45;
}

.cube-folding-game .cf-cube-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cube-folding-game button.cf-cube-option {
  height: auto;
  min-height: 0;
  width: 100%;
  margin: 0;
  padding: 12px 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  background: #fff;
  color: #111827;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font: inherit;
  font-weight: inherit;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.cube-folding-game button.cf-cube-option:hover:not(:disabled):not(.is-correct):not(.is-wrong) {
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  transform: translateY(-1px);
}

.cube-folding-game button.cf-cube-option:disabled {
  cursor: default;
  opacity: 1;
}

.cube-folding-game button.cf-cube-option.is-correct {
  border-color: #16a34a;
  background: #dcfce7;
}

.cube-folding-game button.cf-cube-option.is-wrong {
  border-color: #dc2626;
  background: #fee2e2;
  animation: cf-cube-shake 0.35s ease;
}

@keyframes cf-cube-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

.cube-folding-game .cf-option-stage {
  width: 100%;
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px dashed #e5e7eb;
  border-radius: 10px;
  padding: 8px;
}

.cube-folding-game .cf-cube-scene {
  width: 100%;
  max-width: 180px;
  height: 180px;
  min-height: 180px;
  margin: 0 auto;
  perspective: 700px;
  position: relative;
  overflow: visible;
}

.cube-folding-game .cf-cube-scene .cube {
  width: 96px;
  height: 96px;
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -48px 0 0 -48px;
  transform-style: preserve-3d;
  transform-origin: center center;
  transition: transform 0.55s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.cube-folding-game .cf-cube-scene .face {
  position: absolute;
  width: 96px;
  height: 96px;
  background: #fff;
  color: #111827;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 30px;
  border: 2px solid #111827;
  box-sizing: border-box;
  backface-visibility: hidden;
  border-radius: 4px;
  overflow: hidden;
}

.cube-folding-game .cf-cube-scene .face-icon {
  display: inline-block;
  line-height: 1;
  transform: rotate(var(--icon-rotate, 0deg));
}

.cube-folding-game .cf-cube-scene .front {
  transform: rotateY(0deg) translateZ(48px);
}
.cube-folding-game .cf-cube-scene .back {
  transform: rotateY(180deg) translateZ(48px);
}
.cube-folding-game .cf-cube-scene .right {
  transform: rotateY(90deg) translateZ(48px);
}
.cube-folding-game .cf-cube-scene .left {
  transform: rotateY(-90deg) translateZ(48px);
}
.cube-folding-game .cf-cube-scene .top {
  transform: rotateX(90deg) translateZ(48px);
}
.cube-folding-game .cf-cube-scene .bottom {
  transform: rotateX(-90deg) translateZ(48px);
}

#cfTotalTimer.is-low {
  color: #dc2626;
}

.graph-line.cubeFolding {
  stroke: #db2777;
}

.graph-area.cubeFolding {
  fill: #db2777;
}

.graph-dot.cubeFolding {
  stroke: #db2777;
}
