@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&display=swap');

.v-kubiki.stage {
  --ink: #1a1a2e;
  --yellow: #ffe066;
  --mint: #63e6be;
  --coral: #ff6b6b;
  --sky: #74c0fc;
  font-family: "Fredoka", sans-serif;
  background: var(--sky);
}

.v-kubiki .block-bg {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(0,0,0,0.04) 39px, rgba(0,0,0,0.04) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(0,0,0,0.04) 39px, rgba(0,0,0,0.04) 40px);
}

.v-kubiki .game-top {
  position: absolute;
  top: calc(14px + var(--safe-top));
  left: calc(100px + var(--safe-left));
  right: calc(20px + var(--safe-right));
  z-index: 2;
}

.v-kubiki .title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}
.v-kubiki .title-row h1 {
  font-size: 32px;
  color: var(--ink);
  background: var(--yellow);
  padding: 6px 16px;
  border: 4px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}

.v-kubiki .squirrel-svg {
  width: 110px;
  height: 110px;
  border: 4px solid var(--ink);
  background: var(--coral);
  border-radius: 8px;
  box-shadow: 6px 6px 0 var(--ink);
  padding: 4px;
}
.v-kubiki .squirrel-svg.chew { animation: shake-kub 0.4s steps(4); }
.v-kubiki .squirrel-svg.happy { animation: jump-kub 0.5s ease 2; }
@keyframes shake-kub {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
@keyframes jump-kub {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

.v-kubiki .fruit-slots {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  max-width: 980px;
  margin: 0 auto;
}

.v-kubiki .fruit-slot {
  aspect-ratio: 1;
  border: 4px solid var(--ink);
  background: #fff;
  border-radius: 4px;
  font-size: 28px;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.v-kubiki .fruit-slot.selected {
  background: var(--yellow);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}
.v-kubiki .fruit-slot.current { background: var(--mint); }
.v-kubiki .fruit-slot.eaten { background: #ccc; font-size: 20px; font-weight: 700; }
.v-kubiki .fruit-slot.skipped { opacity: 0.35; }

.v-kubiki .game-bottom {
  position: absolute;
  left: calc(20px + var(--safe-left));
  right: calc(20px + var(--safe-right));
  bottom: calc(16px + var(--safe-bottom));
  top: calc(270px + var(--safe-top));
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.v-kubiki .phase-panel {
  border: 4px solid var(--ink);
  background: #fff;
  box-shadow: 8px 8px 0 var(--ink);
  padding: 14px;
}
.v-kubiki #phase-select { flex: 0 0 auto; }
.v-kubiki .select-panel { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.v-kubiki .select-panel p { font-size: 18px; font-weight: 600; }

.v-kubiki #phase-feed:not([hidden]) {
  display: grid;
  grid-template-columns: 130px 1fr 130px;
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.v-kubiki .letter-box {
  border: 4px solid var(--ink);
  padding: 8px;
  background: #f8f9fa;
}
.v-kubiki .letter-box h2 { font-size: 11px; text-align: center; font-weight: 700; text-transform: uppercase; }
.v-kubiki .letter-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.v-kubiki .letter {
  border: 3px solid var(--ink);
  background: #fff;
  font-size: 22px;
  font-weight: 700;
  min-height: 38px;
  border-radius: 0;
  cursor: pointer;
}
.v-kubiki .letter.active { background: var(--coral); color: #fff; }

.v-kubiki .syllable-panel {
  background: var(--yellow);
  border: 4px solid var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: inset 0 0 0 4px rgba(0,0,0,0.05);
}
.v-kubiki .current-fruit { font-size: 40px; transition: transform 0.4s ease, opacity 0.4s ease; }
.v-kubiki .current-fruit.fly-eat { transform: scale(0) translateY(-60px); opacity: 0; }
.v-kubiki .syllable {
  font-size: clamp(96px, 13vw, 130px);
  font-weight: 700;
  color: var(--ink);
  line-height: 0.95;
}
.v-kubiki .syllable.pop { animation: pop-kub 0.25s ease; }
@keyframes pop-kub {
  0% { transform: scale(0.5); }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
.v-kubiki .progress { font-size: 13px; font-weight: 600; }
.v-kubiki .teacher-note { font-size: 12px; text-align: center; max-width: 220px; font-weight: 500; }

.v-kubiki .actions:not([hidden]) { display: flex; justify-content: center; gap: 10px; }
.v-kubiki .actions .btn {
  border: 4px solid var(--ink);
  border-radius: 0;
  box-shadow: 4px 4px 0 var(--ink);
  min-width: 170px;
  font-weight: 700;
}
.v-kubiki .btn-success { background: var(--mint); color: var(--ink); }
.v-kubiki .btn-secondary { background: #fff; }
.v-kubiki .btn-primary { background: var(--yellow); color: var(--ink); }
.v-kubiki #phase-done:not([hidden]) { text-align: center; padding: 24px; }
.v-kubiki .back-link { border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); border-radius: 0; font-weight: 700; }
