/* Mini-Game Web-Demos */

.game-shell {
  min-height: 100%;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.game-shell--page {
  min-height: 70vh;
  padding: 1.5rem 0 3rem;
}

.game-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.game-status {
  font-weight: 700;
  color: var(--violet);
  min-height: 1.5em;
}

.game-status.is-ok {
  color: var(--turquoise);
}

.game-status.is-try {
  color: #c46a2d;
}

/* MG-001 Dice */
.dice-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 1rem;
}

.dice {
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 1.1rem;
  background: linear-gradient(160deg, #f7efe3, #e8d7c0);
  box-shadow:
    inset 0 -6px 0 rgba(81, 77, 102, 0.08),
    0 14px 28px rgba(81, 77, 102, 0.18);
  position: relative;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}

.dice.is-colored {
  background: linear-gradient(160deg, var(--dice-color), color-mix(in srgb, var(--dice-color) 75%, white));
}

.dice.is-solved {
  transform: scale(1.15);
  opacity: 0;
}

.dice-pip {
  position: absolute;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #6a657a, #2f2c3d 70%);
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.25);
}

.dice.is-colored .dice-pip {
  background: radial-gradient(circle at 35% 30%, #fff, #f0e8dc 70%);
}

.dice-drop-hint {
  position: absolute;
  inset: 0.45rem;
  border: 2px dashed rgba(255, 248, 240, 0.55);
  border-radius: 0.85rem;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.dice.is-target .dice-drop-hint {
  opacity: 1;
}

.number-tray {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.5rem 0 0.25rem;
}

.number-chip {
  width: 3.1rem;
  height: 3.1rem;
  border: 0;
  border-radius: 0.9rem;
  font: inherit;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff8f0;
  cursor: grab;
  background: linear-gradient(145deg, var(--turquoise), var(--turquoise-light));
  box-shadow: 0 8px 18px rgba(21, 138, 131, 0.25);
  touch-action: none;
  user-select: none;
  transition: transform 0.2s var(--ease), opacity 0.25s;
}

.number-chip:active {
  cursor: grabbing;
}

.number-chip.is-dragging {
  opacity: 0.35;
  transform: scale(0.92);
}

.number-chip.is-gone {
  transform: scale(1.4);
  opacity: 0;
  pointer-events: none;
}

.number-chip.is-ghost {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  margin: 0;
  box-shadow: 0 16px 30px rgba(81, 77, 102, 0.28);
}

/* MG-003 Quantity */
.quantity-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  flex: 1;
  min-height: 240px;
}

.quantity-card {
  border: 0;
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  min-height: 220px;
  color: #fff8f0;
  box-shadow: var(--shadow);
  transition: transform 0.2s var(--ease), filter 0.2s;
}

.quantity-card:hover {
  transform: translateY(-3px);
}

.quantity-card:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
}

.quantity-card.is-left {
  background: linear-gradient(155deg, var(--turquoise), var(--turquoise-light));
}

.quantity-card.is-right {
  background: linear-gradient(155deg, var(--blue), var(--blue-light));
}

.quantity-card.is-wrong {
  filter: saturate(0.85);
  animation: nudge 0.45s var(--ease);
}

.quantity-card.is-right-answer {
  animation: pulse-ok 0.55s var(--ease);
}

.dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
  align-content: center;
  max-width: 11rem;
}

.dot {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff, #f3e7d6 68%);
  box-shadow: 0 2px 4px rgba(40, 36, 60, 0.18);
}

.dot.is-large {
  width: 1.55rem;
  height: 1.55rem;
}

@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@keyframes pulse-ok {
  0% { transform: scale(1); }
  40% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@media (max-width: 560px) {
  .quantity-stage {
    grid-template-columns: 1fr;
  }

  .dice {
    width: 6.4rem;
    height: 6.4rem;
  }
}
